Flow123d  jenkins-Flow123d-windows32-release-multijob-51
Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
OutputVTK Class Reference

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

#include <output_vtk.h>

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

Public Member Functions

 OutputVTK (const Input::Record &in_rec)
 The constructor of this class. The head of file is written, when constructor is called. More...
 
 OutputVTK ()
 The constructor of this class. The head of file is written, when constructor is called. More...
 
 ~OutputVTK ()
 The destructor of this class. It writes tail of the file too. More...
 
int write_data (void)
 This function write data to VTK (.pvd) file format for curent time. More...
 
int write_head (void)
 This function writes header of VTK (.pvd) file format. More...
 
int write_tail (void)
 This function writes tail of VTK (.pvd) file format. More...
 
- Public Member Functions inherited from OutputTime
 TYPEDEF_ERR_INFO (EI_FieldName, std::string)
 
 DECLARE_EXCEPTION (ExcOutputVariableVector,<< "Can not output field "<< EI_FieldName::qval<< " returning variable size vectors. Try convert to MultiField.\n")
 
 OutputTime (const Input::Record &in_rec)
 Constructor of OutputTime object. It opens base file for writing. More...
 
virtual ~OutputTime ()
 Destructor of OutputTime. It doesn't do anything, because all necessary destructors will be called in destructor of Output. More...
 
template<int spacedim, class Value >
void register_data (const DiscreteSpace type, MultiField< spacedim, Value > &multi_field)
 Generic method for registering output data stored in MultiField. More...
 
template<int spacedim, class Value >
void register_data (const DiscreteSpace ref_type, Field< spacedim, Value > &field)
 Generic method for registering of output data stored in Field. More...
 
void write_time_frame ()
 
void add_admissible_field_names (const Input::Array &in_array, const Input::Type::Selection &in_sel)
 Registers names of output fields that can be written using this stream. More...
 
void clear_data (void)
 Clear data for output computed by method compute_field_data. More...
 
void mark_output_times (const TimeGovernor &tg)
 
template<int spacedim, class Value >
void register_data (const Input::Record &in_rec, const RefType type, MultiField< spacedim, Value > &multi_field)
 
template<int spacedim, class Value >
void register_data (const Input::Record &in_rec, const RefType ref_type, Field< spacedim, Value > &field_ref)
 

Static Public Attributes

static Input::Type::Record input_type
 The definition of input record for vtk file format. More...
 
static Input::Type::Selection input_type_variant
 The definition of input record for selection of variant of file format. More...
 
static Input::Type::Selection input_type_compression
 The definition of input record for selection of compression type. More...
 
- Static Public Attributes inherited from OutputTime
static Input::Type::Record input_type
 The specification of output stream. More...
 
static Input::Type::AbstractRecord input_format_type
 The specification of output file format. More...
 

Private Types

enum  Variant { VARIANT_ASCII = 1, VARIANT_BINARY = 2 }
 The declaration enumeration used for variant of file VTK format. More...
 
enum  Compression { COMPRESSION_NONE = 1, COMPRESSION_GZIP = 2 }
 The declaration of enumeration used for type of compression used in file format. More...
 
enum  VTKElemType {
  VTK_VERTEX = 1, VTK_POLY_VERTEX = 2, VTK_LINE = 3, VTK_POLY_LINE = 4,
  VTK_TRIANGLE = 5, VTK_TRIANGLE_STRIP = 6, VTK_POLYGON = 7, VTK_PIXEL = 8,
  VTK_QUAD = 9, VTK_TETRA = 10, VTK_VOXEL = 11, VTK_HEXAHEDRON = 12,
  VTK_WEDGE = 13, VTK_PYRAMID = 14, VTK_QUADRIC_EDGE = 21, VTK_QUADRIC_TRIANGLE = 22,
  VTK_QUADRIC_QUAD = 23, VTK_QUADRIC_TETRA = 24, VTK_QUADRIC_HEXAHEDRON = 25
}
 
enum  VTKElemSize { VTK_LINE_SIZE = 2, VTK_TRIANGLE_SIZE = 3, VTK_TETRA_SIZE = 4 }
 
typedef enum OutputVTK::Variant Variant
 The declaration enumeration used for variant of file VTK format. More...
 
typedef enum OutputVTK::Compression Compression
 The declaration of enumeration used for type of compression used in file format. More...
 

Private Member Functions

void write_vtk_vtu_head (void)
 Write header of VTK file (.vtu) More...
 
void write_vtk_geometry (void)
 Write geometry (position of nodes) to the VTK file (.vtu) More...
 
void write_vtk_topology (void)
 Write topology (connection of nodes) to the VTK file (.vtu) More...
 
void write_vtk_discont_geometry (void)
 Write geometry (position of nodes) to the VTK file (.vtu) More...
 
void write_vtk_discont_topology (void)
 Write topology (connection of nodes) to the VTK file (.vtu) More...
 
void write_vtk_data_ascii (vector< OutputDataBase * > &output_data)
 
void write_vtk_data_names (ofstream &file, vector< OutputDataBase * > &output_data)
 Write names of data sets in output_data vector that have value type equal to type. Output is done into stream file. More...
 
void write_vtk_node_data (void)
 Write data on nodes to the VTK file (.vtu) More...
 
void write_vtk_element_data (void)
 Write data on elements to the VTK file (.vtu) More...
 
void write_vtk_vtu_tail (void)
 Write tail of VTK file (.vtu) More...
 
void write_vtk_vtu (void)
 This function write all scalar and vector data on nodes and elements to the VTK file (.vtu) More...
 

Private Attributes

bool header_written
 

Additional Inherited Members

- Public Types inherited from OutputTime
enum  DiscreteSpace { NODE_DATA = 0, CORNER_DATA = 1, ELEM_DATA = 3 }
 
- Static Public Member Functions inherited from OutputTime
static void destroy_all (void)
 Try to find output stream from a key in record. More...
 
static OutputTimecreate_output_stream (const Input::Record &in_rec)
 This method write all registered data to output streams. More...
 
- Protected Types inherited from OutputTime
enum  OutFileFormat { NONE = 0, GMSH = 1, VTK = 2 }
 
typedef enum
OutputTime::OutFileFormat 
OutFileFormat
 
- Protected Member Functions inherited from OutputTime
template<int spacedim, class Value >
void compute_field_data (DiscreteSpace space, Field< spacedim, Value > &field)
 
OutputDataBaseoutput_data_by_field_name (const string &field_name, DiscreteSpace ref_type)
 This method returns pointer at existing data, when corresponding output data exists or it creates new one. More...
 
void set_data_time (void *data, double time)
 This method set current time for registered data array/vector. More...
 
string * base_filename ()
 
ofstream & get_base_file (void)
 
ofstream & get_data_file (void)
 
string & get_data_filename (void)
 
Meshget_mesh (void)
 
unsigned int get_corner_count (void)
 
void set_data_file (ofstream *_data_file)
 
void set_mesh (Mesh *_mesh)
 
void set_base_file (ofstream *_base_file)
 
- Protected Attributes inherited from OutputTime
int rank
 MPI rank of process (is tested in methods) More...
 
OutFileFormat file_format
 
vector< OutputDataBase * > node_data
 
vector< OutputDataBase * > corner_data
 
vector< OutputDataBase * > elem_data
 
int current_step
 Current step. More...
 
double time
 The newest time of registered data. More...
 
double write_time
 The last time, when data was wrote to this stream. More...
 
map< string, bool > output_names
 Map of names of output fields. True means that field will be saved. More...
 
Input::Record input_record_
 
- Static Protected Attributes inherited from OutputTime
static std::vector< OutputTime * > output_streams
 Vector of pointers at OutputTime. More...
 

Detailed Description

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

Definition at line 41 of file output_vtk.h.

Member Typedef Documentation

The declaration of enumeration used for type of compression used in file format.

typedef enum OutputVTK::Variant OutputVTK::Variant
private

The declaration enumeration used for variant of file VTK format.

Member Enumeration Documentation

enum OutputVTK::Compression
private

The declaration of enumeration used for type of compression used in file format.

Enumerator
COMPRESSION_NONE 
COMPRESSION_GZIP 

Definition at line 112 of file output_vtk.h.

enum OutputVTK::Variant
private

The declaration enumeration used for variant of file VTK format.

Enumerator
VARIANT_ASCII 
VARIANT_BINARY 

Definition at line 103 of file output_vtk.h.

enum OutputVTK::VTKElemSize
private
Enumerator
VTK_LINE_SIZE 
VTK_TRIANGLE_SIZE 
VTK_TETRA_SIZE 

Definition at line 141 of file output_vtk.h.

enum OutputVTK::VTKElemType
private
Enumerator
VTK_VERTEX 
VTK_POLY_VERTEX 
VTK_LINE 
VTK_POLY_LINE 
VTK_TRIANGLE 
VTK_TRIANGLE_STRIP 
VTK_POLYGON 
VTK_PIXEL 
VTK_QUAD 
VTK_TETRA 
VTK_VOXEL 
VTK_HEXAHEDRON 
VTK_WEDGE 
VTK_PYRAMID 
VTK_QUADRIC_EDGE 
VTK_QUADRIC_TRIANGLE 
VTK_QUADRIC_QUAD 
VTK_QUADRIC_TETRA 
VTK_QUADRIC_HEXAHEDRON 

Definition at line 118 of file output_vtk.h.

Constructor & Destructor Documentation

OutputVTK::OutputVTK ( const Input::Record in_rec)

The constructor of this class. The head of file is written, when constructor is called.

Definition at line 605 of file output_vtk.cc.

OutputVTK::OutputVTK ( )

The constructor of this class. The head of file is written, when constructor is called.

OutputVTK::~OutputVTK ( )

The destructor of this class. It writes tail of the file too.

Definition at line 612 of file output_vtk.cc.

Member Function Documentation

int OutputVTK::write_data ( void  )
virtual

This function write data to VTK (.pvd) file format for curent time.

Implements OutputTime.

Definition at line 448 of file output_vtk.cc.

int OutputVTK::write_head ( void  )
virtual

This function writes header of VTK (.pvd) file format.

Implements OutputTime.

Definition at line 558 of file output_vtk.cc.

int OutputVTK::write_tail ( void  )
virtual

This function writes tail of VTK (.pvd) file format.

Implements OutputTime.

Definition at line 582 of file output_vtk.cc.

Here is the caller graph for this function:

void OutputVTK::write_vtk_data_ascii ( vector< OutputDataBase * > &  output_data)
private

Definition at line 286 of file output_vtk.cc.

void OutputVTK::write_vtk_data_names ( ofstream &  file,
vector< OutputDataBase * > &  output_data 
)
private

Write names of data sets in output_data vector that have value type equal to type. Output is done into stream file.

Definition at line 317 of file output_vtk.cc.

void OutputVTK::write_vtk_discont_geometry ( void  )
private

Write geometry (position of nodes) to the VTK file (.vtu)

This method is used, when discontinuous data are saved to the .vtu file

Definition at line 186 of file output_vtk.cc.

void OutputVTK::write_vtk_discont_topology ( void  )
private

Write topology (connection of nodes) to the VTK file (.vtu)

This method is used, when discontinuous data are saved to the .vtu file

Definition at line 215 of file output_vtk.cc.

void OutputVTK::write_vtk_element_data ( void  )
private

Write data on elements to the VTK file (.vtu)

Definition at line 366 of file output_vtk.cc.

void OutputVTK::write_vtk_geometry ( void  )
private

Write geometry (position of nodes) to the VTK file (.vtu)

Definition at line 87 of file output_vtk.cc.

void OutputVTK::write_vtk_node_data ( void  )
private

Write data on nodes to the VTK file (.vtu)

Definition at line 336 of file output_vtk.cc.

void OutputVTK::write_vtk_topology ( void  )
private

Write topology (connection of nodes) to the VTK file (.vtu)

Definition at line 118 of file output_vtk.cc.

void OutputVTK::write_vtk_vtu ( void  )
private

This function write all scalar and vector data on nodes and elements to the VTK file (.vtu)

Definition at line 394 of file output_vtk.cc.

void OutputVTK::write_vtk_vtu_head ( void  )
private

Write header of VTK file (.vtu)

Definition at line 76 of file output_vtk.cc.

void OutputVTK::write_vtk_vtu_tail ( void  )
private

Write tail of VTK file (.vtu)

Definition at line 385 of file output_vtk.cc.

Member Data Documentation

bool OutputVTK::header_written
private

Was header already written to output file?

Definition at line 98 of file output_vtk.h.

Record OutputVTK::input_type
static
Initial value:
= Record("vtk", "Parameters of vtk output format.")
.declare_key("variant", input_type_variant, Default("ascii"),
"Variant of output stream file format.")
.declare_key("parallel", Bool(), Default("false"),
"Parallel or serial version of file format.")
.declare_key("compression", input_type_compression, Default("none"),
"Compression used in output stream file format.")

The definition of input record for vtk file format.

Definition at line 65 of file output_vtk.h.

Selection OutputVTK::input_type_compression
static
Initial value:
= Selection("Type of compression of VTK file format")
.add_value(OutputVTK::COMPRESSION_NONE, "none",
"Data in VTK file format are not compressed")
.add_value(OutputVTK::COMPRESSION_GZIP, "zlib",
"Data in VTK file format are compressed using zlib (not supported yet)")

The definition of input record for selection of compression type.

Definition at line 75 of file output_vtk.h.

Selection OutputVTK::input_type_variant
static
Initial value:
= Selection("VTK variant (ascii or binary)")
.add_value(OutputVTK::VARIANT_ASCII, "ascii",
"ASCII variant of VTK file format")
.add_value(OutputVTK::VARIANT_BINARY, "binary",
"Binary variant of VTK file format (not supported yet)")

The definition of input record for selection of variant of file format.

Definition at line 70 of file output_vtk.h.


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