Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::VtkUtil Class Reference

General data about VTK files for use by read and write code. More...

#include <VtkUtil.hpp>

+ Collaboration diagram for moab::VtkUtil:

Static Public Member Functions

static const VtkElemTypeget_vtk_type (EntityType type, unsigned num_nodes)
 Get the VTK type corresponding to a tuple of the MOAB type and number of nodes. num_nodes is ignored for MBPOLYGON type. More...
 

Static Public Attributes

static const char * vtkTypeNames []
 vtk data type names, indexed by DataType More...
 
static const VtkElemType vtkElemTypes []
 Vtk types, indexed by VTK type number. For unused VTK type numbers, mb_type will be MBMAXTYPE. More...
 
static const unsigned numVtkElemType = sizeof( VtkUtil::vtkElemTypes ) / sizeof( VtkUtil::vtkElemTypes[0] )
 Lenght of vtkElemTypes. More...
 

Detailed Description

General data about VTK files for use by read and write code.

Author
Jason Kraftcheck

Definition at line 43 of file VtkUtil.hpp.

Member Function Documentation

◆ get_vtk_type()

const VtkElemType * moab::VtkUtil::get_vtk_type ( EntityType  type,
unsigned  num_nodes 
)
static

Get the VTK type corresponding to a tuple of the MOAB type and number of nodes. num_nodes is ignored for MBPOLYGON type.

Definition at line 125 of file VtkUtil.cpp.

126 {
127  const int i = mb_to_vtk_type[type][0]; // Index for linear type
128  const int j = mb_to_vtk_type[type][1]; // Index for quadratic type
129  const int k = mb_to_vtk_type[type][2]; // Index for full quadratic type
130  if( i ) // If element type is supported at all (if not linear then not quadratic either)
131  {
132  // If the linear type is requested (all polygons are linear
133  // irrespective of the number of nodes), return that.
134  if( type == MBPOLYGON || type == MBPOLYHEDRON || vtkElemTypes[i].num_nodes == num_nodes )
135  return vtkElemTypes + i;
136  // Otherwise if there is a quadratic type and the number of
137  // nodes specified corresponds to the quadratic type, return that.
138  else if( j && vtkElemTypes[j].num_nodes == num_nodes )
139  return vtkElemTypes + j;
140  // Otherwise if there is a full quadratic type and the number of
141  // nodes specified corresponds to the quadratic type, return that.
142  else if( k && vtkElemTypes[k].num_nodes == num_nodes )
143  return vtkElemTypes + k;
144  }
145 
146  return 0;
147 }

References moab::mb_to_vtk_type, MBPOLYGON, MBPOLYHEDRON, and vtkElemTypes.

Referenced by moab::WriteVtk::gather_mesh(), and moab::WriteVtk::write_elems().

Member Data Documentation

◆ numVtkElemType

const unsigned moab::VtkUtil::numVtkElemType = sizeof( VtkUtil::vtkElemTypes ) / sizeof( VtkUtil::vtkElemTypes[0] )
static

Lenght of vtkElemTypes.

Definition at line 55 of file VtkUtil.hpp.

Referenced by moab::ReadVtk::vtk_read_unstructured_grid().

◆ vtkElemTypes

const VtkElemType moab::VtkUtil::vtkElemTypes
static

Vtk types, indexed by VTK type number. For unused VTK type numbers, mb_type will be MBMAXTYPE.

Definition at line 52 of file VtkUtil.hpp.

Referenced by get_vtk_type(), and moab::ReadVtk::vtk_read_unstructured_grid().

◆ vtkTypeNames

const char * moab::VtkUtil::vtkTypeNames
static
Initial value:
= {
"unsigned_char",
"int",
"double",
"bit",
"unsigned_long",
}

vtk data type names, indexed by DataType

Definition at line 48 of file VtkUtil.hpp.

Referenced by moab::WriteVtk::write_tag().


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