19 #ifndef MSH_VTK_READER_HH 20 #define MSH_VTK_READER_HH 22 #include <boost/exception/info.hpp> 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");
71 ascii, binary_uncompressed, binary_zlib
114 typedef typename std::multimap< std::string, MeshDataHeader >
HeaderTable;
122 VtkMeshReader(
const FilePath &file_name, std::shared_ptr<ElementDataFieldMap> element_data_values,
double time_step);
138 void create_node_element_caches();
147 DataType get_data_type(std::string type_str);
150 unsigned int type_value_size(
DataType data_type);
153 void parse_ascii_data(
ElementDataCacheBase &data_cache,
unsigned int n_components,
unsigned int n_entities,
154 Tokenizer::Position pos,
bool boundary_domain);
157 void parse_binary_data(
ElementDataCacheBase &data_cache,
unsigned int n_components,
unsigned int n_entities,
158 Tokenizer::Position pos,
bool boundary_domain);
161 void parse_compressed_data(
ElementDataCacheBase &data_cache,
unsigned int n_components,
unsigned int n_entities,
162 Tokenizer::Position pos,
bool boundary_domain);
165 void read_base_vtk_attributes(pugi::xml_node vtk_node,
unsigned int &n_nodes,
unsigned int &n_elements);
168 Tokenizer::Position get_appended_position();
174 bool boundary_domain)
override;
void read_elements(Mesh *mesh) override
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 check_compatible_mesh(Mesh &mesh) override
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)
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
void make_header_table() override
std::istream * data_stream_
input stream allow read appended data, used only if this tag exists
DataType header_type_
header type of VTK file (only for appended data)
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
bool compare_points(const arma::vec3 &p1, const arma::vec3 &p2)
void read_physical_names(Mesh *mesh) override
unsigned int n_read_
store count of read entities
Dedicated class for storing path to input and output files.
DataFormat
Type of data formats - ascii, binary or compressed with zLib.
void read_element_data(ElementDataCacheBase &data_cache, MeshDataHeader actual_header, unsigned int n_components, bool boundary_domain) override
DataType
Types of VTK data (value 'undefined' for empty value)
MeshDataHeader & find_header(HeaderQuery &header_query) override
void read_nodes(Mesh *mesh) override