19 #ifndef MSH_VTK_READER_HH 20 #define MSH_VTK_READER_HH 24 #include <pugixml.hpp> 38 <<
"Invalid format of DataArray " << EI_FieldName::val <<
", expected " << EI_ExpectedFormat::val <<
"\n" 39 <<
"in the input file: " << EI_VTKFile::qval);
41 <<
"Unsupported or missing format of DataArray " << EI_FieldName::val <<
"\n" <<
"in the input file: " << EI_VTKFile::qval);
43 << EI_ErrMessage::val <<
" data type of " << EI_SectionTypeName::val <<
"\n" <<
"in the input file: " << EI_VTKFile::qval);
45 <<
"Incompatible meshes, " << EI_ErrMessage::val <<
"\n" <<
"for VTK input file: " << EI_VTKFile::qval);
47 <<
"Missing " << EI_TagType::val <<
" " << EI_TagName::val <<
"\n" <<
" in the input file: " << EI_VTKFile::qval);
126 Tokenizer::Position pos,
bool boundary_domain);
130 Tokenizer::Position pos,
bool boundary_domain,
DataType value_type);
134 Tokenizer::Position pos,
bool boundary_domain,
DataType value_type);
146 bool boundary_domain)
override;
void make_header_table() override
Reads table of DataArray headers through pugixml interface.
bool compare_points(arma::vec3 &p1, arma::vec3 &p2)
DataSections
Possible data sections in UnstructuredGrid - Piece node.
HeaderTable header_table_
Table with data of DataArray headers.
void read_nodes(Mesh *mesh)
static const double point_tolerance
Tolerance during comparison point data with GMSH nodes.
DataFormat data_format_
variants of data format (ascii, appended, compressed appended)
MeshDataHeader & find_header(double time, std::string field_name) override
VtkMeshReader(const FilePath &file_name)
void read_base_vtk_attributes(pugi::xml_node vtk_node, unsigned int &n_nodes, unsigned int &n_elements)
Set base attributes of VTK and get count of nodes and elements.
DataType get_data_type(std::string type_str)
Get DataType by value of string.
void parse_compressed_data(ElementDataCacheBase &data_cache, unsigned int n_components, unsigned int n_entities, Tokenizer::Position pos, bool boundary_domain, DataType value_type)
Uncompress and parse binary compressed data to data cache.
void read_physical_names(Mesh *mesh) override
std::istream * data_stream_
input stream allow read appended data, used only if this tag exists
void check_compatible_mesh(Mesh &mesh) override
TYPEDEF_ERR_INFO(EI_VTKFile, std::string)
~VtkMeshReader()
Destructor.
DECLARE_EXCEPTION(ExcInvalidFormat,<< "Invalid format of DataArray "<< EI_FieldName::val<< ", expected "<< EI_ExpectedFormat::val<< "\n"<< "in the input file: "<< EI_VTKFile::qval)
DataType header_type_
header type of VTK file (only for appended data)
unsigned int n_read_
store count of read entities
Dedicated class for storing path to input and output files.
void read_elements(Mesh *mesh)
void parse_binary_data(ElementDataCacheBase &data_cache, unsigned int n_components, unsigned int n_entities, Tokenizer::Position pos, bool boundary_domain, DataType value_type)
Parse binary data to data cache.
MeshDataHeader create_header(pugi::xml_node node, unsigned int n_entities, Tokenizer::Position pos)
Helper method that create DataArray header of given xml node (used from make_header_table) ...
std::map< std::string, MeshDataHeader > HeaderTable
void read_element_data(ElementDataCacheBase &data_cache, MeshDataHeader actual_header, unsigned int n_components, bool boundary_domain) override
DataFormat
Type of data formats - ascii, binary or compressed with zLib.
DataType
Types of VTK data (value 'undefined' for empty value)
unsigned int type_value_size(DataType data_type)
Return size of value of data_type.
Tokenizer::Position get_appended_position()
Get position of AppendedData tag in VTK file.
void parse_ascii_data(ElementDataCacheBase &data_cache, unsigned int n_components, unsigned int n_entities, Tokenizer::Position pos, bool boundary_domain)
Parse ascii data to data cache.