19 #ifndef MSH_VTK_READER_HH 20 #define MSH_VTK_READER_HH 24 #include <pugixml.hpp> 44 <<
"Invalid format of DataArray " << EI_FieldName::val <<
", expected " << EI_ExpectedFormat::val <<
"\n" 45 <<
"in the input file: " << EI_VTKFile::qval);
47 <<
"Unsupported or missing format of DataArray " << EI_FieldName::val <<
"\n" <<
"in the input file: " << EI_VTKFile::qval);
49 << EI_ErrMessage::val <<
" data type of " << EI_SectionTypeName::val <<
"\n" <<
"in the input file: " << EI_VTKFile::qval);
51 <<
"Incompatible meshes, " << EI_ErrMessage::val <<
"\n" <<
"for VTK input file: " << EI_VTKFile::qval);
53 <<
"Missing " << EI_TagType::val <<
" " << EI_TagName::val <<
"\n" <<
" in the input file: " << EI_VTKFile::qval);
55 <<
"Invalid DOF handler hash for field: " << EI_FieldName::qval <<
" in the input file: " << EI_VTKFile::qval <<
".\n");
105 typedef typename std::multimap< std::string, MeshDataHeader >
HeaderTable;
113 VtkMeshReader(
const FilePath &file_name, std::shared_ptr<ElementDataFieldMap> element_data_values,
double time_step);
145 Tokenizer::Position pos,
bool boundary_domain);
149 Tokenizer::Position pos,
bool boundary_domain,
DataType value_type);
153 Tokenizer::Position pos,
bool boundary_domain,
DataType value_type);
165 bool boundary_domain)
override;
MeshDataHeader create_header(pugi::xml_node node, unsigned int n_entities, Tokenizer::Position pos, OutputTime::DiscreteSpace disc)
Helper method that create DataArray header of given xml node (used from make_header_table) ...
void make_header_table() override
Reads table of DataArray headers through pugixml interface.
bool compare_points(arma::vec3 &p1, arma::vec3 &p2)
double time_step_
time of VTK file (getting only during initialization from PVD reader)
DataSections
Possible data sections in UnstructuredGrid - Piece node.
HeaderTable header_table_
Table with data of DataArray headers.
void read_nodes(Mesh *mesh)
std::multimap< std::string, MeshDataHeader > HeaderTable
static const double point_tolerance
Tolerance during comparison point data with GMSH nodes.
DataFormat data_format_
variants of data format (ascii, appended, compressed appended)
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.
MeshDataHeader & find_header(HeaderQuery &header_query) override
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)
virtual ~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.
void create_node_element_caches()
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.