Template Numerical Library version\ main:4e58ea6
Loading...
Searching...
No Matches
TNL::Meshes::Readers::MeshReader Class Referenceabstract
Inheritance diagram for TNL::Meshes::Readers::MeshReader:
Collaboration diagram for TNL::Meshes::Readers::MeshReader:

Public Types

using VariantVector
 

Public Member Functions

 MeshReader (std::string fileName)
 
virtual void detectMesh ()=0
 Main method responsible for reading the mesh file.
 
void forceGlobalIndexType (std::string globalIndexType)
 
void forceLocalIndexType (std::string localIndexType)
 
void forceRealType (std::string realType)
 
VTK::EntityShape getCellShape () const
 
std::string getGlobalIndexType () const
 
std::string getLocalIndexType () const
 
int getMeshDimension () const
 
std::string getMeshType () const
 
std::string getRealType () const
 
int getSpaceDimension () const
 
template<typename MeshType >
std::enable_if_t< isGrid< MeshType >::value > loadMesh (MeshType &mesh)
 Method which loads the intermediate mesh representation into a mesh object.
 
template<typename MeshType >
std::enable_if_t< ! isGrid< MeshType >::value > loadMesh (MeshType &mesh)
 Method which loads the intermediate mesh representation into a mesh object.
 
virtual VariantVector readCellData (const std::string &arrayName) const
 
virtual VariantVector readPointData (const std::string &arrayName) const
 
virtual void reset ()
 This method resets the reader to an empty state.
 
void setFileName (const std::string &fileName)
 

Protected Member Functions

template<typename T >
void reset_std_vectors (std::vector< T > &v)
 
template<typename T , typename... Ts>
void reset_std_vectors (std::vector< T > &v, std::vector< Ts > &... vs)
 
void resetBase ()
 Resets the base class MeshReader to the empty state.
 

Protected Attributes

VariantVector cellConnectivityArray
 
VariantVector cellOffsetsArray
 
VTK::EntityShape cellShape = VTK::EntityShape::Vertex
 
std::string connectivityType
 
VariantVector faceConnectivityArray
 
VariantVector faceOffsetsArray
 
std::string fileName
 
std::string forcedGlobalIndexType
 
std::string forcedLocalIndexType = "std::int16_t"
 
std::string forcedRealType
 
std::vector< std::int64_tgridExtent
 
std::vector< double > gridOrigin
 
std::vector< double > gridSpacing
 
int meshDimension
 
std::string meshType
 
std::size_t NumberOfCells
 
std::size_t NumberOfFaces
 
std::size_t NumberOfPoints
 
std::string offsetsType
 
VariantVector pointsArray
 
std::string pointsType
 
int spaceDimension
 
VariantVector typesArray
 
std::string typesType
 

Member Typedef Documentation

◆ VariantVector

Member Function Documentation

◆ detectMesh()

virtual void TNL::Meshes::Readers::MeshReader::detectMesh ( )
pure virtual

Main method responsible for reading the mesh file.

The implementation has to set all protected attributes of this class such that the mesh representation can be loaded into the mesh object by the loadMesh method.

Implemented in TNL::Meshes::Readers::FPMAReader, TNL::Meshes::Readers::NetgenReader, TNL::Meshes::Readers::PVTIReader, TNL::Meshes::Readers::PVTUReader, TNL::Meshes::Readers::VTIReader, TNL::Meshes::Readers::VTKReader, and TNL::Meshes::Readers::VTUReader.

◆ loadMesh() [1/2]

template<typename MeshType >
std::enable_if_t< isGrid< MeshType >::value > TNL::Meshes::Readers::MeshReader::loadMesh ( MeshType & mesh)
inline

Method which loads the intermediate mesh representation into a mesh object.

This overload applies to structured grids, i.e. TNL::Meshes::Grid.

When the method exits, the intermediate mesh representation is destroyed to save memory. However, depending on the specific file format, the mesh file may remain open so that the user can load additional data.

◆ loadMesh() [2/2]

template<typename MeshType >
std::enable_if_t< ! isGrid< MeshType >::value > TNL::Meshes::Readers::MeshReader::loadMesh ( MeshType & mesh)
inline

Method which loads the intermediate mesh representation into a mesh object.

This overload applies to unstructured meshes, i.e. TNL::Meshes::Mesh.

When the method exits, the intermediate mesh representation is destroyed to save memory. However, depending on the specific file format, the mesh file may remain open so that the user can load additional data.

◆ reset()

virtual void TNL::Meshes::Readers::MeshReader::reset ( )
inlinevirtual

This method resets the reader to an empty state.

In particular, implementations should call the resetBase method to reset the arrays holding the intermediate mesh representation.

Reimplemented in TNL::Meshes::Readers::PVTIReader, TNL::Meshes::Readers::PVTUReader, TNL::Meshes::Readers::VTKReader, and TNL::Meshes::Readers::XMLVTK.

◆ resetBase()

void TNL::Meshes::Readers::MeshReader::resetBase ( )
inlineprotected

Resets the base class MeshReader to the empty state.

Subclasses should call this method from their reset method.


The documentation for this class was generated from the following file: