Flow123d  jenkins-Flow123d-linux-release-multijob-198
output_msh.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4  *
5  * Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6  * especially for academic research:
7  * Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8  *
9  * This program is free software; you can redistribute it and/or modify it under the terms
10  * of the GNU General Public License version 3 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with this program; if not,
17  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18  *
19  *
20  * $Id: $
21  * $Revision: $
22  * $LastChangedBy: $
23  * $LastChangedDate: $
24  *
25  * @file output_msh.h
26  * @brief Header: The functions for MSH (GMSH) outputs.
27  *
28  */
29 
30 #ifndef OUTPUT_MSH_HH_
31 #define OUTPUT_MSH_HH_
32 
33 #include "output_time.hh"
34 #include "system/sys_vector.hh"
35 
36 /**
37  * \brief This class is used for output data to VTK file format
38  */
39 class OutputMSH : public OutputTime {
40 public:
41 
42  /**
43  * \brief The constructor of this class
44  */
45  OutputMSH();
46 
47  /**
48  * \brief The constructor of this class
49  */
50  OutputMSH(const Input::Record &in_rec);
51 
52  /**
53  * \brief The destructor of this class
54  */
55  ~OutputMSH();
56 
57  /**
58  * \brief The definition of input record for gmsh file format
59  */
61 
62  /**
63  * \brief This method writes head of GMSH (.msh) file format
64  *
65  * \return This function returns 1
66  */
67  int write_head(void);
68 
69  /**
70  * \brief This method writes data to GMSH (.msh) file format for current time
71  *
72  * \return This function returns 1
73  */
74  int write_data(void);
75 
76  /**
77  * \brief This method should write tail of GMSH (.msh) file format
78  *
79  * It is stupid file format. It doesn't write anything special at the end of
80  * the file
81  *
82  * \return This function returns 1
83  */
84  int write_tail(void);
85 
86 
87 private:
88 
90 
91  /**
92  * \brief This function write header of GMSH (.msh) file format
93  */
94  void write_msh_header(void);
95 
96  /**
97  * \brief This function writes geometry (position of nodes) to GMSH (.msh) file
98  * format
99  */
100  void write_msh_geometry(void);
101 
102  /**
103  * \brief This function writes topology (connection of nodes) to the GMSH (.msh)
104  * file format
105  */
106  void write_msh_topology(void);
107 
108  /**
109  * \brief This function writes continuous ascii data to GMSH (.msh) output file.
110  *
111  * \param[in] *out_data The pointer at structure storing pointer at own data.
112  */
113  template<class element>
115 
116  /**
117  * \brief This function writes discontinuous ascii data to GMSH (.msh) output file.
118  *
119  * \param[in] *out_data The pointer at structure storing pointer at own data.
120  */
122 
123  /**
124  * \brief This function write all data on nodes to output file. This function
125  * is used for static and dynamic data
126  *
127  * \param[in] time The time from start
128  * \param[in] step The number of steps from start
129  */
130  void write_msh_node_data(double time, int step);
131 
132 
133  /**
134  * \brief This function write all data on elements to output file. This
135  * function is used for static and dynamic data
136  *
137  * \param[in] time The time from start
138  * \param[in] step The number of steps from start
139  */
140  void write_msh_elem_data(double time, int step);
141 
142  /**
143  * \brief This method add right suffix to .msh GMSH file
144  */
145  void fix_base_file_name(void);
146 };
147 
148 #endif /* OUTPUT_MSH_HH_ */
double time
Definition: output_time.hh:190
void write_msh_header(void)
This function write header of GMSH (.msh) file format.
Definition: output_msh.cc:43
void write_msh_elem_data(double time, int step)
This function write all data on elements to output file. This function is used for static and dynamic...
Definition: output_msh.cc:178
OutputMSH()
The constructor of this class.
void write_msh_geometry(void)
This function writes geometry (position of nodes) to GMSH (.msh) file format.
Definition: output_msh.cc:53
int write_tail(void)
This method should write tail of GMSH (.msh) file format.
Definition: output_msh.cc:245
Small extension of Vector&lt;T&gt; container with support to Id numbers.
Definition: sys_vector.hh:164
static Input::Type::Record input_type
The definition of input record for gmsh file format.
Definition: output_msh.hh:60
void fix_base_file_name(void)
This method add right suffix to .msh GMSH file.
void write_msh_ascii_cont_data(flow::VectorId< element > &vec, OutputDataPtr output_data)
This function writes continuous ascii data to GMSH (.msh) output file.
Definition: output_msh.cc:92
void write_msh_topology(void)
This function writes topology (connection of nodes) to the GMSH (.msh) file format.
Definition: output_msh.cc:67
Accessor to the data with type Type::Record.
Definition: accessors.hh:327
void write_msh_ascii_discont_data(OutputDataPtr output_data)
This function writes discontinuous ascii data to GMSH (.msh) output file.
Definition: output_msh.cc:108
bool header_written
Definition: output_msh.hh:89
void write_msh_node_data(double time, int step)
This function write all data on nodes to output file. This function is used for static and dynamic da...
Definition: output_msh.cc:131
~OutputMSH()
The destructor of this class.
Definition: output_msh.cc:264
The class for outputting data during time.
Definition: output_time.hh:32
int write_data(void)
This method writes data to GMSH (.msh) file format for current time.
Definition: output_msh.cc:221
Vector classes to support both Iterator, index and Id access and creating co-located vectors...
std::shared_ptr< OutputDataBase > OutputDataPtr
Definition: output_time.hh:173
Record type proxy class.
Definition: type_record.hh:169
This class is used for output data to VTK file format.
Definition: output_msh.hh:39
int write_head(void)
This method writes head of GMSH (.msh) file format.
Definition: output_msh.cc:205