libMesh::VTKIO::ElementMaps Struct Reference

Public Member Functions

void associate (ElemType libmesh_type, vtkIdType vtk_type)
 
vtkIdType find (ElemType libmesh_type)
 
ElemType find (vtkIdType vtk_type)
 

Public Attributes

std::map< ElemType, vtkIdType > writing_map
 
std::map< vtkIdType, ElemTypereading_map
 

Detailed Description

Helper object that holds a map from VTK to libMesh element types and vice-versa.

Definition at line 168 of file vtk_io.h.

Member Function Documentation

◆ associate()

void libMesh::VTKIO::ElementMaps::associate ( ElemType  libmesh_type,
vtkIdType  vtk_type 
)
inline

Definition at line 171 of file vtk_io.h.

References reading_map, and writing_map.

Referenced by libMesh::VTKIO::build_element_maps().

172  {
173  writing_map[libmesh_type] = vtk_type;
174  reading_map[vtk_type] = libmesh_type;
175  }
std::map< ElemType, vtkIdType > writing_map
Definition: vtk_io.h:199
std::map< vtkIdType, ElemType > reading_map
Definition: vtk_io.h:200

◆ find() [1/2]

vtkIdType libMesh::VTKIO::ElementMaps::find ( ElemType  libmesh_type)
inline

Definition at line 178 of file vtk_io.h.

References writing_map.

Referenced by libMesh::VTKIO::cells_to_vtk(), and libMesh::VTKIO::read().

179  {
180  std::map<ElemType, vtkIdType>::iterator it = writing_map.find(libmesh_type);
181 
182  if (it == writing_map.end())
183  libmesh_error_msg("Element type " << libmesh_type << " not available in VTK.");
184 
185  return it->second;
186  }
std::map< ElemType, vtkIdType > writing_map
Definition: vtk_io.h:199

◆ find() [2/2]

ElemType libMesh::VTKIO::ElementMaps::find ( vtkIdType  vtk_type)
inline

Definition at line 189 of file vtk_io.h.

References reading_map.

190  {
191  std::map<vtkIdType, ElemType>::iterator it = reading_map.find(vtk_type);
192 
193  if (it == reading_map.end())
194  libmesh_error_msg("Element type " << vtk_type << " not available in libMesh.");
195 
196  return it->second;
197  }
std::map< vtkIdType, ElemType > reading_map
Definition: vtk_io.h:200

Member Data Documentation

◆ reading_map

std::map<vtkIdType, ElemType> libMesh::VTKIO::ElementMaps::reading_map

Definition at line 200 of file vtk_io.h.

Referenced by associate(), and find().

◆ writing_map

std::map<ElemType, vtkIdType> libMesh::VTKIO::ElementMaps::writing_map

Definition at line 199 of file vtk_io.h.

Referenced by associate(), libMesh::VTKIO::build_element_maps(), and find().


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