19 #ifndef MSH_VTK_READER_HH
20 #define MSH_VTK_READER_HH
35 namespace pugi {
class xml_node; }
51 <<
"Invalid format of DataArray " << EI_FieldName::val <<
", expected " << EI_ExpectedFormat::val <<
"\n"
52 <<
"in the input file: " << EI_VTKFile::qval);
54 <<
"Unsupported or missing format of DataArray " << EI_FieldName::val <<
"\n" <<
"in the input file: " << EI_VTKFile::qval);
56 << EI_ErrMessage::val <<
" data type of " << EI_SectionTypeName::val <<
"\n" <<
"in the input file: " << EI_VTKFile::qval);
58 <<
"Incompatible meshes, " << EI_ErrMessage::val <<
"\n" <<
"for VTK input file: " << EI_VTKFile::qval);
60 <<
"Missing " << EI_TagType::val <<
" " << EI_TagName::val <<
"\n" <<
" in the input file: " << EI_VTKFile::qval);
62 <<
"Invalid DOF handler hash for field: " << EI_FieldName::qval <<
" in the input file: " << EI_VTKFile::qval <<
".\n");
94 MeshDataHeader &
find_header(HeaderQuery &header_query)
override;
102 typedef typename std::multimap< std::string, MeshDataHeader >
HeaderTable;
110 VtkMeshReader(
const FilePath &file_name, std::shared_ptr<ElementDataFieldMap> element_data_values,
double time_step);
142 Tokenizer::Position pos);
146 Tokenizer::Position pos);
150 Tokenizer::Position pos);
Dedicated class for storing path to input and output files.
void read_element_data(ElementDataCacheBase &data_cache, MeshDataHeader header) override
VtkMeshReader(const FilePath &file_name)
TYPEDEF_ERR_INFO(EI_VTKFile, std::string)
TYPEDEF_ERR_INFO(EI_ErrMessage, std::string)
void parse_binary_data(ElementDataCacheBase &data_cache, unsigned int n_components, unsigned int n_entities, Tokenizer::Position pos)
Parse binary data to data cache.
std::multimap< std::string, MeshDataHeader > HeaderTable
DECLARE_EXCEPTION(ExcMissingTag,<< "Missing "<< EI_TagType::val<< " "<< EI_TagName::val<< "\n"<< " in the input file: "<< EI_VTKFile::qval)
virtual ~VtkMeshReader()
Destructor.
DataFormat data_format_
variants of data format (ascii, appended, compressed appended)
Tokenizer::Position get_appended_position()
Get position of AppendedData tag in VTK file.
void read_elements(Mesh *mesh)
TYPEDEF_ERR_INFO(EI_SectionTypeName, std::string)
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)
HeaderTable header_table_
Table with data of DataArray headers.
DataSections
Possible data sections in UnstructuredGrid - Piece node.
static const double point_tolerance
Tolerance during comparison point data with GMSH nodes.
double time_step_
time of VTK file (getting only during initialization from PVD reader)
TYPEDEF_ERR_INFO(EI_TagName, std::string)
std::istream * data_stream_
input stream allow read appended data, used only if this tag exists
void parse_ascii_data(ElementDataCacheBase &data_cache, unsigned int n_components, unsigned int n_entities, Tokenizer::Position pos)
Parse ascii data to data cache.
DECLARE_EXCEPTION(ExcInvalidDofHandler,<< "Invalid DOF handler hash for field: "<< EI_FieldName::qval<< " in the input file: "<< EI_VTKFile::qval<< ".\n")
void parse_compressed_data(ElementDataCacheBase &data_cache, unsigned int n_components, unsigned int n_entities, Tokenizer::Position pos)
Uncompress and parse binary compressed data to data cache.
unsigned int type_value_size(DataType data_type)
Return size of value of data_type.
TYPEDEF_ERR_INFO(EI_TagType, std::string)
DECLARE_EXCEPTION(ExcWrongType,<< EI_ErrMessage::val<< " data type of "<< EI_SectionTypeName::val<< "\n"<< "in the input file: "<< EI_VTKFile::qval)
void make_header_table() override
Reads table of DataArray headers through pugixml interface.
DataFormat
Type of data formats - ascii, binary or compressed with zLib.
DataType get_data_type(std::string type_str)
Get DataType by value of string.
TYPEDEF_ERR_INFO(EI_ExpectedFormat, std::string)
unsigned int n_read_
store count of read entities
DataType header_type_
header type of VTK file (only for appended data)
DECLARE_EXCEPTION(ExcUnknownFormat,<< "Unsupported or missing format of DataArray "<< EI_FieldName::val<< "\n"<< "in the input file: "<< EI_VTKFile::qval)
void read_nodes(Mesh *mesh)
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.
void create_node_element_caches()
void read_physical_names(Mesh *mesh) override
DECLARE_EXCEPTION(ExcIncompatibleMesh,<< "Incompatible meshes, "<< EI_ErrMessage::val<< "\n"<< "for VTK input file: "<< EI_VTKFile::qval)
DECLARE_EXCEPTION(ExcInvalidFormat,<< "Invalid format of DataArray "<< EI_FieldName::val<< ", expected "<< EI_ExpectedFormat::val<< "\n"<< "in the input file: "<< EI_VTKFile::qval)
MeshDataHeader & find_header(HeaderQuery &header_query) override
DataType
Types of VTK data (value 'undefined' for empty value)