27 using namespace
Input::Type;
30 return Record(
"gmsh",
"Parameters of gmsh output format.")
36 const int OutputMSH::registrar = Input::register_class< OutputMSH, const Input::Record & >(
"gmsh") +
45 file <<
"$MeshFormat" << endl;
46 file <<
"2" <<
" 0 " <<
sizeof(double) << endl;
47 file <<
"$EndMeshFormat" << endl;
56 file <<
"$Nodes" << endl;
59 file <<
NODE_FULL_ITER(mesh, nod).id() <<
" " << nod->getX() <<
" " << nod->getY() <<
" " << nod->getZ() << endl;
61 file <<
"$EndNodes" << endl;
69 const static unsigned int gmsh_simplex_types_[4] = {0, 1, 2, 4};
72 file <<
"$Elements" << endl;
77 <<
" " << gmsh_simplex_types_[ elm->dim() ]
78 <<
" 3 " << elm->region().id() <<
" " << elm->region().id() <<
" " << elm->pid;
84 file <<
"$EndElements" << endl;
88 template<
class element>
94 file.precision(std::numeric_limits<double>::digits10);
96 for(
unsigned int i=0; i < output_data->n_values; i ++) {
97 file << vec(i).id() <<
" ";
98 output_data->print(file, i);
111 file.precision(std::numeric_limits<double>::digits10);
115 unsigned int i_corner = 0;
117 file << ele.id() <<
" " << ele->n_nodes() <<
" ";
120 output_data->print(file, i_corner++);
133 double time_fixed = isfinite(time)?time:0;
137 file <<
"$NodeData" << endl;
140 file <<
"\"" << output_data->output_field_name <<
"\"" << endl;
143 file << time_fixed << endl;
146 file << step << endl;
147 file << output_data->n_elem_ << endl;
148 file << output_data->n_values << endl;
152 file <<
"$EndNodeData" << endl;
156 file <<
"$ElementNodeData" << endl;
159 file <<
"\"" << output_data->output_field_name <<
"\"" << endl;
162 file << time_fixed << endl;
165 file << step << endl;
166 file << output_data->n_elem_ << endl;
171 file <<
"$EndElementNodeData" << endl;
179 double time_fixed = isfinite(time) ? time : 0;
183 file <<
"$ElementData" << endl;
186 file <<
"\"" << output_data->output_field_name <<
"\"" << endl;
189 file << time_fixed << endl;
192 file << step << endl;
193 file << output_data->n_elem_ << endl;
194 file << output_data->n_values << endl;
198 file <<
"$EndElementData" << endl;
254 if(this->
rank == 0) {
void write_msh_header(void)
This function write header of GMSH (.msh) file format.
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...
#define FOR_ELEMENT_NODES(i, j)
static const Input::Type::Record & get_input_type()
The definition of input record for gmsh file format.
#define NODE_FULL_ITER(_mesh_, i)
static Input::Type::Abstract & get_input_format_type()
The specification of output file format.
OutputMSH()
The constructor of this class.
void fix_main_file_extension(std::string extension)
#define FOR_ELEMENTS(_mesh_, __i)
static const int registrar
Registrar of class to factory.
void write_msh_geometry(void)
This function writes geometry (position of nodes) to GMSH (.msh) file format.
#define ELEM_FULL_ITER(_mesh_, i)
int write_tail(void)
This method should write tail of GMSH (.msh) file format.
Small extension of Vector<T> container with support to Id numbers.
#define INPUT_CHECK(i,...)
Debugging macros.
unsigned int size() const
Returns size of the container. This is independent of the allocated space.
unsigned int n_elements() const
void write_msh_ascii_cont_data(flow::VectorId< element > &vec, OutputDataPtr output_data)
This function writes continuous ascii data to GMSH (.msh) output file.
void write_msh_topology(void)
This function writes topology (connection of nodes) to the GMSH (.msh) file format.
void write_msh_ascii_discont_data(OutputDataPtr output_data)
This function writes discontinuous ascii data to GMSH (.msh) output file.
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...
~OutputMSH()
The destructor of this class.
The class for outputting data during time.
#define FOR_NODES(_mesh_, i)
int write_data(void)
This method writes data to GMSH (.msh) file format for current time.
OutputDataFieldVec output_data_vec_[N_DISCRETE_SPACES]
std::shared_ptr< OutputDataBase > OutputDataPtr
This class is used for output data to VTK file format.
int write_head(void)
This method writes head of GMSH (.msh) file format.
#define FLOW123D_FORCE_LINK_IN_CHILD(x)
NodeVector node_vector
Vector of nodes of the mesh.
ElementVector element
Vector of elements of the mesh.