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

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

#include <GmshUtil.hpp>

+ Collaboration diagram for moab::GmshUtil:

Static Public Member Functions

static int get_gmsh_type (EntityType type, unsigned num_nodes)
 Get the Gmsh type corresponding to a tuple of the MOAB type and number of nodes. num_nodes is ignored for MBPOLYGON type. Returns -1 for unsupported types. More...
 

Static Public Attributes

static const GmshElemType gmshElemTypes []
 Gmsh types, indexed by Gmsh type number. For unused Gmsh type numbers, mb_type will be MBMAXTYPE. More...
 
static const unsigned numGmshElemType = sizeof( GmshUtil::gmshElemTypes ) / sizeof( GmshUtil::gmshElemTypes[0] )
 Length of gmshElemTypes. More...
 

Detailed Description

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

Author
Jason Kraftcheck

Definition at line 43 of file GmshUtil.hpp.

Member Function Documentation

◆ get_gmsh_type()

int moab::GmshUtil::get_gmsh_type ( EntityType  type,
unsigned  num_nodes 
)
static

Get the Gmsh type corresponding to a tuple of the MOAB type and number of nodes. num_nodes is ignored for MBPOLYGON type. Returns -1 for unsupported types.

Definition at line 102 of file GmshUtil.cpp.

103 {
104  if( num_nodes >= (unsigned)MAX_NODES ) return -1;
105 
106  int idx = mb_to_gmsh_type[type][num_nodes];
107  if( !idx ) return -1;
108 
109  return gmshElemTypes[idx].mb_type == MBMAXTYPE ? -1 : idx;
110 }

References gmshElemTypes, moab::MAX_NODES, moab::mb_to_gmsh_type, moab::GmshElemType::mb_type, and MBMAXTYPE.

Referenced by moab::WriteGmsh::write_file().

Member Data Documentation

◆ gmshElemTypes

const GmshElemType moab::GmshUtil::gmshElemTypes
static

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

Definition at line 49 of file GmshUtil.hpp.

Referenced by get_gmsh_type(), moab::ReadGmsh::load_file(), and moab::WriteGmsh::write_file().

◆ numGmshElemType

const unsigned moab::GmshUtil::numGmshElemType = sizeof( GmshUtil::gmshElemTypes ) / sizeof( GmshUtil::gmshElemTypes[0] )
static

Length of gmshElemTypes.

Definition at line 52 of file GmshUtil.hpp.

Referenced by moab::ReadGmsh::load_file().


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