Flow123d
release_2.2.0-41-g0958a8d
|
This class is used for output data to VTK file format. More...
#include <output_vtk.hh>
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< ElementDataCacheBase > | OutputDataPtr |
typedef std::vector< OutputDataPtr > | OutputDataFieldVec |
Public Member Functions | |
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... | |
void | init_from_input (const std::string &equation_name, Mesh &mesh, const Input::Record &in_rec) override |
Override OutputTime::init_from_input . More... | |
Public Member Functions inherited from OutputTime | |
OutputTime () | |
Default constructor. Only for testing. 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::Array > | get_time_set_array () |
Input::Iterator< Input::Record > | get_output_mesh_record () |
void | write_time_frame () |
std::shared_ptr< Observe > | observe () |
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< OutputMeshBase > | create_output_mesh_ptr (bool init_input, bool discont=false) |
std::shared_ptr< OutputMeshBase > | get_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::Record & | get_input_type () |
The definition of input record for vtk file format. More... | |
static const Input::Type::Selection & | get_input_type_variant () |
The definition of input record for selection of variant of file format. More... | |
Static Public Member Functions inherited from OutputTime | |
static const Input::Type::Record & | get_input_type () |
The specification of output stream. More... | |
static Input::Type::Abstract & | get_input_format_type () |
The specification of output file format. More... | |
static std::shared_ptr< OutputTime > | create_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... | |
Protected Types | |
enum | VTKVariant { VARIANT_ASCII = 0, VARIANT_BINARY_UNCOMPRESSED = 1, VARIANT_BINARY_ZLIB = 2 } |
The declaration enumeration used for variant of file VTK 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 } |
Protected Member Functions | |
void | write_vtk_vtu_head (void) |
Write header of VTK file (.vtu) More... | |
std::shared_ptr< ElementDataCache< unsigned int > > | fill_element_types_data () |
Fills the data cache with VTK element types indicators. More... | |
void | write_vtk_field_data (OutputDataFieldVec &output_data_map) |
void | write_vtk_data (OutputDataPtr output_data) |
void | write_vtk_data_names (ofstream &file, OutputDataFieldVec &output_data_map) |
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... | |
void | make_subdirectory () |
void | compress_data (stringstream &uncompressed_stream, stringstream &compressed_stream) |
Protected Member Functions inherited from OutputTime | |
void | compute_discontinuous_output_mesh () |
void | fix_main_file_extension (std::string extension) |
Protected Attributes | |
ofstream | _data_file |
ostringstream | appended_data_ |
string | subdir_name_ |
string | main_output_basename_ |
Basename of main output file (without extension) More... | |
string | main_output_dir_ |
Main output file directory. More... | |
VTKVariant | variant_type_ |
Output format (ascii, binary or binary compressed) More... | |
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< OutputMesh > | output_mesh_ |
Output mesh. More... | |
std::shared_ptr< OutputMeshDiscontinuous > | output_mesh_discont_ |
Discontinuous (non-conforming) mesh. Used for CORNER_DATA. More... | |
std::shared_ptr< Observe > | observe_ |
bool | enable_refinement_ |
Auxiliary flag for refinement enabling, due to gmsh format. More... | |
Static Protected 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 |
This class is used for output data to VTK file format.
Definition at line 34 of file output_vtk.hh.
typedef OutputTime OutputVTK::FactoryBaseType |
Definition at line 37 of file output_vtk.hh.
|
protected |
Enumerator | |
---|---|
VTK_LINE_SIZE | |
VTK_TRIANGLE_SIZE | |
VTK_TETRA_SIZE |
Definition at line 117 of file output_vtk.hh.
|
protected |
Definition at line 94 of file output_vtk.hh.
|
protected |
The declaration enumeration used for variant of file VTK format.
Enumerator | |
---|---|
VARIANT_ASCII | |
VARIANT_BINARY_UNCOMPRESSED | |
VARIANT_BINARY_ZLIB |
Definition at line 87 of file output_vtk.hh.
OutputVTK::OutputVTK | ( | ) |
The constructor of this class. The head of file is written, when constructor is called.
Definition at line 67 of file output_vtk.cc.
OutputVTK::~OutputVTK | ( | ) |
The destructor of this class. It writes tail of the file too.
Definition at line 74 of file output_vtk.cc.
|
protected |
Compress data stored in uncompressed_stream
to compressed_stream
.
Use ZLib compression.
Definition at line 287 of file output_vtk.cc.
|
protected |
Fills the data cache with VTK element types indicators.
Definition at line 197 of file output_vtk.cc.
|
static |
The definition of input record for vtk file format.
Definition at line 35 of file output_vtk.cc.
|
static |
The definition of input record for selection of variant of file format.
Definition at line 48 of file output_vtk.cc.
|
overridevirtual |
Override OutputTime::init_from_input
.
Reimplemented from OutputTime.
Definition at line 81 of file output_vtk.cc.
|
protected |
Set appropriate file path substrings. Make subdirectory for VTU time frames.
Definition at line 163 of file output_vtk.cc.
|
virtual |
This function write data to VTK (.pvd) file format for curent time.
Implements OutputTime.
Definition at line 106 of file output_vtk.cc.
int OutputVTK::write_head | ( | void | ) |
This function writes header of VTK (.pvd) file format.
Definition at line 518 of file output_vtk.cc.
int OutputVTK::write_tail | ( | void | ) |
This function writes tail of VTK (.pvd) file format.
Definition at line 538 of file output_vtk.cc.
|
protected |
Write output data stored in OutputData vector to output stream
Definition at line 240 of file output_vtk.cc.
|
protected |
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 362 of file output_vtk.cc.
|
protected |
Write data on elements to the VTK file (.vtu)
Definition at line 411 of file output_vtk.cc.
|
protected |
Write registered data of all components of given Field to output stream
Definition at line 353 of file output_vtk.cc.
|
protected |
Write data on nodes to the VTK file (.vtu)
Definition at line 384 of file output_vtk.cc.
|
protected |
This function write all scalar and vector data on nodes and elements to the VTK file (.vtu)
Definition at line 447 of file output_vtk.cc.
|
protected |
Write header of VTK file (.vtu)
Definition at line 177 of file output_vtk.cc.
|
protected |
Write tail of VTK file (.vtu)
Definition at line 431 of file output_vtk.cc.
|
protected |
Data output stream (could be same as base_file)
Definition at line 191 of file output_vtk.hh.
|
protected |
Stream of appended data (used only for binary appended output)
Definition at line 196 of file output_vtk.hh.
|
protected |
Basename of main output file (without extension)
Definition at line 204 of file output_vtk.hh.
|
protected |
Main output file directory.
Definition at line 207 of file output_vtk.hh.
|
staticprotected |
Registrar of class to factory.
Definition at line 124 of file output_vtk.hh.
|
protected |
Path to time frame VTU data subdirectory
Definition at line 201 of file output_vtk.hh.
|
protected |
Output format (ascii, binary or binary compressed)
Definition at line 210 of file output_vtk.hh.