Flow123d  release_1.8.2-1603-g0109a2b
output_msh.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file output_msh.h
15  * @brief Header: The functions for MSH (GMSH) outputs.
16  */
17 
18 #ifndef OUTPUT_MSH_HH_
19 #define OUTPUT_MSH_HH_
20 
21 #include "output_time.hh"
22 #include "system/sys_vector.hh"
23 
24 /**
25  * \brief This class is used for output data to VTK file format
26  */
27 class OutputMSH : public OutputTime {
28 public:
30 
31  /**
32  * \brief The constructor of this class
33  */
34  OutputMSH();
35 
36  /**
37  * \brief The constructor of this class
38  */
39  OutputMSH(const Input::Record &in_rec);
40 
41  /**
42  * \brief The destructor of this class
43  */
44  ~OutputMSH();
45 
46  /**
47  * \brief The definition of input record for gmsh file format
48  */
49  static const Input::Type::Record & get_input_type();
50 
51  /**
52  * \brief This method writes head of GMSH (.msh) file format
53  *
54  * \return This function returns 1
55  */
56  int write_head(void);
57 
58  /**
59  * \brief This method writes data to GMSH (.msh) file format for current time
60  *
61  * \return This function returns 1
62  */
63  int write_data(void);
64 
65  /**
66  * \brief This method should write tail of GMSH (.msh) file format
67  *
68  * It is stupid file format. It doesn't write anything special at the end of
69  * the file
70  *
71  * \return This function returns 1
72  */
73  int write_tail(void);
74 
75 
76 private:
77 
78  /// Registrar of class to factory
79  static const int registrar;
80 
82 
83  /**
84  * \brief This function write header of GMSH (.msh) file format
85  */
86  void write_msh_header(void);
87 
88  /**
89  * \brief This function writes geometry (position of nodes) to GMSH (.msh) file
90  * format
91  */
92  void write_msh_geometry(void);
93 
94  /**
95  * \brief This function writes topology (connection of nodes) to the GMSH (.msh)
96  * file format
97  */
98  void write_msh_topology(void);
99 
100  /**
101  * \brief This function writes continuous ascii data to GMSH (.msh) output file.
102  *
103  * \param[in] *out_data The pointer at structure storing pointer at own data.
104  */
105  template<class element>
107 
108  /**
109  * \brief This function writes discontinuous ascii data to GMSH (.msh) output file.
110  *
111  * \param[in] *out_data The pointer at structure storing pointer at own data.
112  */
114 
115  /**
116  * \brief This function write all data on nodes to output file. This function
117  * is used for static and dynamic data
118  *
119  * \param[in] time The time from start
120  * \param[in] step The number of steps from start
121  */
122  void write_msh_node_data(double time, int step);
123 
124 
125  /**
126  * \brief This function write all data on elements to output file. This
127  * function is used for static and dynamic data
128  *
129  * \param[in] time The time from start
130  * \param[in] step The number of steps from start
131  */
132  void write_msh_elem_data(double time, int step);
133 
134  /**
135  * \brief This method add right suffix to .msh GMSH file
136  */
137  void fix_base_file_name(void);
138 };
139 
140 #endif /* OUTPUT_MSH_HH_ */
double time
Definition: output_time.hh:200
void write_msh_header(void)
This function write header of GMSH (.msh) file format.
Definition: output_msh.cc:40
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:175
static const Input::Type::Record & get_input_type()
The definition of input record for gmsh file format.
Definition: output_msh.cc:29
OutputMSH()
The constructor of this class.
static const int registrar
Registrar of class to factory.
Definition: output_msh.hh:79
void write_msh_geometry(void)
This function writes geometry (position of nodes) to GMSH (.msh) file format.
Definition: output_msh.cc:50
OutputTime FactoryBaseType
Definition: output_msh.hh:29
int write_tail(void)
This method should write tail of GMSH (.msh) file format.
Definition: output_msh.cc:242
Small extension of Vector<T> container with support to Id numbers.
Definition: sys_vector.hh:154
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:89
void write_msh_topology(void)
This function writes topology (connection of nodes) to the GMSH (.msh) file format.
Definition: output_msh.cc:64
Accessor to the data with type Type::Record.
Definition: accessors.hh:277
void write_msh_ascii_discont_data(OutputDataPtr output_data)
This function writes discontinuous ascii data to GMSH (.msh) output file.
Definition: output_msh.cc:105
bool header_written
Definition: output_msh.hh:81
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:128
~OutputMSH()
The destructor of this class.
Definition: output_msh.cc:261
The class for outputting data during time.
Definition: output_time.hh:42
int write_data(void)
This method writes data to GMSH (.msh) file format for current time.
Definition: output_msh.cc:218
Vector classes to support both Iterator, index and Id access and creating co-located vectors...
std::shared_ptr< OutputDataBase > OutputDataPtr
Definition: output_time.hh:183
Record type proxy class.
Definition: type_record.hh:171
This class is used for output data to VTK file format.
Definition: output_msh.hh:27
int write_head(void)
This method writes head of GMSH (.msh) file format.
Definition: output_msh.cc:202