Flow123d  release_2.2.0-23-g01927c6
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
OutputMSH Class Reference

This class is used for output data to VTK file format. More...

#include <output_msh.hh>

Inheritance diagram for OutputMSH:
Inheritance graph
[legend]
Collaboration diagram for OutputMSH:
Collaboration graph
[legend]

Public Types

typedef OutputTime FactoryBaseType
 
- Public Types inherited from OutputTime
enum  DiscreteSpace { NODE_DATA = 0, CORNER_DATA = 1, ELEM_DATA = 2 }
 
typedef unsigned int DiscreteSpaceFlags
 
typedef std::shared_ptr< ElementDataCacheBaseOutputDataPtr
 
typedef std::vector< OutputDataPtrOutputDataFieldVec
 

Public Member Functions

 OutputMSH ()
 The constructor of this class. We open the output file in first call of write_data. More...
 
 ~OutputMSH ()
 The destructor of this class. More...
 
int write_head (void)
 This method writes head of GMSH (.msh) file format. More...
 
int write_data (void)
 This method writes data to GMSH (.msh) file format for current time. More...
 
int write_tail (void)
 This method should write tail of GMSH (.msh) file format. More...
 
- Public Member Functions inherited from OutputTime
 OutputTime ()
 Default constructor. Only for testing. More...
 
virtual void init_from_input (const std::string &equation_name, Mesh &mesh, const Input::Record &in_rec)
 Constructor of OutputTime object. It opens base file for writing. More...
 
void set_stream_precision (std::ofstream &stream)
 
virtual ~OutputTime ()
 Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in destructor of Output. More...
 
Input::Iterator< Input::Arrayget_time_set_array ()
 
Input::Iterator< Input::Recordget_output_mesh_record ()
 
void write_time_frame ()
 
std::shared_ptr< Observeobserve ()
 
void clear_data (void)
 Clear data for output computed by method compute_field_data. More...
 
bool is_output_mesh_init ()
 
bool enable_refinement ()
 Return auxiliary flag enable_refinement_. More...
 
std::shared_ptr< OutputMeshBasecreate_output_mesh_ptr (bool init_input, bool discont=false)
 
std::shared_ptr< OutputMeshBaseget_output_mesh_ptr (bool discont=false)
 
int get_rank ()
 
void update_time (double field_time)
 
template<typename T >
ElementDataCache< T > & prepare_compute_data (std::string field_name, DiscreteSpace space_type, unsigned int n_rows, unsigned int n_cols)
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 The definition of input record for gmsh file format. More...
 
- Static Public Member Functions inherited from OutputTime
static const Input::Type::Recordget_input_type ()
 The specification of output stream. More...
 
static Input::Type::Abstractget_input_format_type ()
 The specification of output file format. More...
 
static std::shared_ptr< OutputTimecreate_output_stream (const std::string &equation_name, Mesh &mesh, const Input::Record &in_rec)
 This method delete all object instances of class OutputTime stored in output_streams vector. More...
 

Private Member Functions

void write_msh_header (void)
 This function write header of GMSH (.msh) file format. More...
 
void write_msh_geometry (void)
 This function writes geometry (position of nodes) to GMSH (.msh) file format. More...
 
void write_msh_topology (void)
 This function writes topology (connection of nodes) to the GMSH (.msh) file format. More...
 
template<class element >
void write_msh_ascii_cont_data (flow::VectorId< element > &vec, OutputDataPtr output_data)
 This function writes continuous ascii data to GMSH (.msh) output file. More...
 
void write_msh_ascii_discont_data (OutputDataPtr output_data)
 This function writes discontinuous ascii data to GMSH (.msh) output file. More...
 
void write_node_data (OutputDataPtr output_data)
 This function write all data on nodes to output file. This function is used for static and dynamic data. More...
 
void write_corner_data (OutputDataPtr output_data)
 writes ElementNode data ascii GMSH (.msh) output file. More...
 
void write_elem_data (OutputDataPtr output_data)
 This function write all data on elements to output file. This function is used for static and dynamic data. More...
 
void write_field_data (OutputTime::DiscreteSpace type_idx, void(OutputMSH::*format_fce)(OutputDataPtr))
 
void fix_base_file_name (void)
 This method add right suffix to .msh GMSH file. More...
 

Private Attributes

bool header_written
 
std::vector< std::vector< OutputDataPtr > > dummy_data_list_
 

Static Private Attributes

static const int registrar
 Registrar of class to factory. More...
 

Additional Inherited Members

- Static Public Attributes inherited from OutputTime
static const unsigned int N_DISCRETE_SPACES = 3
 
- Protected Member Functions inherited from OutputTime
void compute_discontinuous_output_mesh ()
 
void fix_main_file_extension (std::string extension)
 
- Protected Attributes inherited from OutputTime
int rank
 
OutputDataFieldVec output_data_vec_ [N_DISCRETE_SPACES]
 
int current_step
 
double time
 
double write_time
 
Input::Record input_record_
 
ofstream _base_file
 
FilePath _base_filename
 
std::string equation_name_
 
int precision_
 
Mesh_mesh
 
std::shared_ptr< OutputMeshoutput_mesh_
 Output mesh. More...
 
std::shared_ptr< OutputMeshDiscontinuousoutput_mesh_discont_
 Discontinuous (non-conforming) mesh. Used for CORNER_DATA. More...
 
std::shared_ptr< Observeobserve_
 
bool enable_refinement_
 Auxiliary flag for refinement enabling, due to gmsh format. More...
 

Detailed Description

This class is used for output data to VTK file format.

Definition at line 27 of file output_msh.hh.

Member Typedef Documentation

Definition at line 29 of file output_msh.hh.

Constructor & Destructor Documentation

OutputMSH::OutputMSH ( )

The constructor of this class. We open the output file in first call of write_data.

Definition at line 92 of file output_msh.cc.

OutputMSH::~OutputMSH ( )

The destructor of this class.

Definition at line 102 of file output_msh.cc.

Member Function Documentation

void OutputMSH::fix_base_file_name ( void  )
private

This method add right suffix to .msh GMSH file.

const Record & OutputMSH::get_input_type ( )
static

The definition of input record for gmsh file format.

Definition at line 81 of file output_msh.cc.

void OutputMSH::write_corner_data ( OutputDataPtr  output_data)
private

writes ElementNode data ascii GMSH (.msh) output file.

Definition at line 218 of file output_msh.cc.

Here is the caller graph for this function:

int OutputMSH::write_data ( void  )
virtual

This method writes data to GMSH (.msh) file format for current time.

Returns
This function returns 1

Implements OutputTime.

Definition at line 305 of file output_msh.cc.

void OutputMSH::write_elem_data ( OutputDataPtr  output_data)
private

This function write all data on elements to output file. This function is used for static and dynamic data.

Parameters
[in]timeThe time from start
[in]stepThe number of steps from start

Definition at line 241 of file output_msh.cc.

Here is the caller graph for this function:

void OutputMSH::write_field_data ( OutputTime::DiscreteSpace  type_idx,
void(OutputMSH::*)(OutputDataPtr format_fce 
)
private

Write fields of single discrete space type, use given format function for the output of single field data.

At first call it fills dummy_data_list_ (assuming output of all fields at the first output frame).

Definition at line 264 of file output_msh.cc.

Here is the caller graph for this function:

int OutputMSH::write_head ( void  )

This method writes head of GMSH (.msh) file format.

Returns
This function returns 1

Definition at line 290 of file output_msh.cc.

Here is the caller graph for this function:

template<class element >
void OutputMSH::write_msh_ascii_cont_data ( flow::VectorId< element > &  vec,
OutputDataPtr  output_data 
)
private

This function writes continuous ascii data to GMSH (.msh) output file.

Parameters
[in]*out_dataThe pointer at structure storing pointer at own data.

Definition at line 159 of file output_msh.cc.

Here is the caller graph for this function:

void OutputMSH::write_msh_ascii_discont_data ( OutputDataPtr  output_data)
private

This function writes discontinuous ascii data to GMSH (.msh) output file.

Parameters
[in]*out_dataThe pointer at structure storing pointer at own data.

Definition at line 172 of file output_msh.cc.

Here is the caller graph for this function:

void OutputMSH::write_msh_geometry ( void  )
private

This function writes geometry (position of nodes) to GMSH (.msh) file format.

Definition at line 120 of file output_msh.cc.

Here is the caller graph for this function:

void OutputMSH::write_msh_header ( void  )
private

This function write header of GMSH (.msh) file format.

Definition at line 110 of file output_msh.cc.

Here is the caller graph for this function:

void OutputMSH::write_msh_topology ( void  )
private

This function writes topology (connection of nodes) to the GMSH (.msh) file format.

Definition at line 134 of file output_msh.cc.

Here is the caller graph for this function:

void OutputMSH::write_node_data ( OutputDataPtr  output_data)
private

This function write all data on nodes to output file. This function is used for static and dynamic data.

Parameters
[in]timeThe time from start
[in]stepThe number of steps from start

Definition at line 193 of file output_msh.cc.

Here is the caller graph for this function:

int OutputMSH::write_tail ( void  )

This method should write tail of GMSH (.msh) file format.

It is stupid file format. It doesn't write anything special at the end of the file

Returns
This function returns 1

Definition at line 338 of file output_msh.cc.

Here is the caller graph for this function:

Member Data Documentation

std::vector< std::vector< OutputDataPtr > > OutputMSH::dummy_data_list_
private

EquationOutput force output of all output fields at the time zero. We keep this list to perform single elemnent/node output in order to have correct behavior in GMSH.

Definition at line 83 of file output_msh.hh.

bool OutputMSH::header_written
private

Definition at line 77 of file output_msh.hh.

const int OutputMSH::registrar
staticprivate
Initial value:
= Input::register_class< OutputMSH >("gmsh") +

Registrar of class to factory.

Definition at line 75 of file output_msh.hh.


The documentation for this class was generated from the following files: