NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
PNTMesh Namespace Reference

Classes

struct  blockType
 
class  pntMesh
 

Typedefs

using idTyp = int
 
using BlockMap = std::vector< blockType >
 

Enumerations

enum  elementType {
  elementType::BAR, elementType::QUADRILATERAL, elementType::TRIANGLE, elementType::HEXAGON,
  elementType::SPHERICAL, elementType::CYLINDRICAL, elementType::BRICK, elementType::LAGRANGE_BRICK,
  elementType::TETRAHEDRON, elementType::HEXPRISM, elementType::PRISMATIC, elementType::OTHER
}
 
enum  surfaceBCTag { surfaceBCTag::REFLECTIVE, surfaceBCTag::VOID }
 

Functions

VTKCellType p2vEMap (elementType et)
 
elementType v2pEMap (VTKCellType vt)
 
surfaceBCTag bcTagNum (const std::string &tag)
 
std::string bcTagStr (surfaceBCTag tag)
 
elementType elmTypeNum (const std::string &tag)
 
std::string elmTypeStr (elementType tag)
 
int elmNumNde (elementType et, int order)
 
int elmNumSrf (elementType et)
 

Typedef Documentation

◆ BlockMap

using PNTMesh::BlockMap = typedef std::vector<blockType>

Definition at line 86 of file pntMesh.H.

◆ idTyp

using PNTMesh::idTyp = typedef int

Definition at line 45 of file pntMesh.H.

Enumeration Type Documentation

◆ elementType

◆ surfaceBCTag

enum PNTMesh::surfaceBCTag
strong
Enumerator
REFLECTIVE 
VOID 

Definition at line 62 of file pntMesh.H.

Function Documentation

◆ bcTagNum()

PNTMesh::surfaceBCTag PNTMesh::bcTagNum ( const std::string &  tag)

Definition at line 78 of file pntMesh.C.

References nemAux::toLower().

Referenced by PNTMesh::pntMesh::pntMesh(), and NEM::DRV::JSON::pntMeshBcTagFromJSON().

79 {
80  std::string tag = _tag;
81  nemAux::toLower(tag);
82  if (tag == "reflective") return surfaceBCTag::REFLECTIVE;
83  if (tag == "void") return surfaceBCTag::VOID;
84  std::cerr << "Unknown surface tag " << tag << std::endl;
85  throw;
86 }
void toLower(std::string &str)

◆ bcTagStr()

std::string PNTMesh::bcTagStr ( surfaceBCTag  tag)

Definition at line 88 of file pntMesh.C.

Referenced by NEM::DRV::JSON::pntMeshBcTagToJSON(), and PNTMesh::pntMesh::write().

89 {
90  switch (tag) {
91  case surfaceBCTag::REFLECTIVE: return "REFLECTIVE";
92  case surfaceBCTag::VOID: return "VOID";
93  }
94  throw;
95 }

◆ elmNumNde()

int PNTMesh::elmNumNde ( elementType  et,
int  order 
)

Definition at line 133 of file pntMesh.C.

References TRIANGLE.

Referenced by PNTMesh::pntMesh::pntMesh().

134 {
135  if (tag == elementType::BAR) return (2 + order - 1);
136  if (tag == elementType::QUADRILATERAL && order == 1) return 4;
137  if (tag == elementType::QUADRILATERAL && order == 2) return 8;
138  if (tag == elementType::TRIANGLE && order == 1) return 3;
139  if (tag == elementType::TRIANGLE && order == 2) return 6;
140  if (tag == elementType::HEXAGON && order == 1) return 8;
141  if (tag == elementType::HEXAGON && order == 2) return 27;
142  if (tag == elementType::BRICK && order == 1) return 8;
143  if (tag == elementType::BRICK && order == 2) return 27;
144  if (tag == elementType::LAGRANGE_BRICK && order == 1) return 8;
145  if (tag == elementType::LAGRANGE_BRICK && order == 2) return 27;
146  if (tag == elementType::TETRAHEDRON && order == 1) return 4;
147  if (tag == elementType::TETRAHEDRON && order == 2) return 10;
148  if (tag == elementType::HEXPRISM && order == 1) return 16;
149  if (tag == elementType::PRISMATIC && order == 1) return 6;
150  if (tag == elementType::PRISMATIC && order == 2) return 15;
151  std::cerr << "Unknown element/order combination\n";
152  throw;
153 }
TRIANGLE
Definition: exoMesh.H:55

◆ elmNumSrf()

int PNTMesh::elmNumSrf ( elementType  et)

Definition at line 155 of file pntMesh.C.

References TRIANGLE.

Referenced by PNTMesh::pntMesh::pntMesh().

156 {
157  if (tag == elementType::BAR) return 2;
158  if (tag == elementType::QUADRILATERAL) return 4;
159  if (tag == elementType::TRIANGLE) return 3;
160  if (tag == elementType::HEXAGON) return 8;
161  if (tag == elementType::BRICK) return 6;
162  if (tag == elementType::LAGRANGE_BRICK) return 6;
163  if (tag == elementType::TETRAHEDRON) return 4;
164  if (tag == elementType::HEXPRISM) return 10;
165  if (tag == elementType::PRISMATIC) return 6;
166  std::cerr << "Unknown element type\n";
167  throw;
168 }
TRIANGLE
Definition: exoMesh.H:55

◆ elmTypeNum()

PNTMesh::elementType PNTMesh::elmTypeNum ( const std::string &  tag)

Definition at line 97 of file pntMesh.C.

References nemAux::toLower(), and TRIANGLE.

Referenced by PNTMesh::pntMesh::pntMesh(), and NEM::DRV::JSON::rangeToVec().

98 {
99  std::string tag = _tag;
100  nemAux::toLower(tag);
101  if (tag == "bar") return elementType::BAR;
102  if (tag == "quadrilateral") return elementType::QUADRILATERAL;
103  if (tag == "triangle") return elementType::TRIANGLE;
104  if (tag == "hexagon") return elementType::HEXAGON;
105  if (tag == "spherical") return elementType::SPHERICAL;
106  if (tag == "cylindrical") return elementType::CYLINDRICAL;
107  if (tag == "brick") return elementType::BRICK;
108  if (tag == "lagrange_brick") return elementType::LAGRANGE_BRICK;
109  if (tag == "tetrahedron") return elementType::TETRAHEDRON;
110  if (tag == "hexprism") return elementType::HEXPRISM;
111  if (tag == "prismatic") return elementType::PRISMATIC;
112  std::cout << "Warning : Element type " << tag << " may be not supported"
113  << std::endl;
114  return elementType::OTHER;
115 }
void toLower(std::string &str)
TRIANGLE
Definition: exoMesh.H:55

◆ elmTypeStr()

std::string PNTMesh::elmTypeStr ( elementType  tag)

Definition at line 117 of file pntMesh.C.

References TRIANGLE.

Referenced by PNTMesh::pntMesh::pntMesh(), NEM::DRV::JSON::rangeToVec(), and PNTMesh::pntMesh::write().

118 {
119  if (tag == elementType::BAR) return "BAR";
120  if (tag == elementType::QUADRILATERAL) return "QUADRILATERAL";
121  if (tag == elementType::TRIANGLE) return "TRIANGLE";
122  if (tag == elementType::HEXAGON) return "HEXAGON";
123  if (tag == elementType::SPHERICAL) return "SPHERICAL";
124  if (tag == elementType::CYLINDRICAL) return "CYLINDRICAL";
125  if (tag == elementType::BRICK) return "BRICK";
126  if (tag == elementType::LAGRANGE_BRICK) return "LAGRANGE_BRICK";
127  if (tag == elementType::TETRAHEDRON) return "TETRAHEDRON";
128  if (tag == elementType::HEXPRISM) return "HEXPRISM";
129  if (tag == elementType::PRISMATIC) return "PRISMATIC";
130  return "OTHER";
131 }
TRIANGLE
Definition: exoMesh.H:55

◆ p2vEMap()

VTKCellType PNTMesh::p2vEMap ( elementType  et)

Definition at line 38 of file pntMesh.C.

References TRIANGLE.

39 {
40  std::map<elementType, VTKCellType> eMap =
41  {
42  {elementType::BAR, VTK_LINE},
43  {elementType::QUADRILATERAL, VTK_QUAD},
44  {elementType::TRIANGLE, VTK_TRIANGLE},
45  {elementType::HEXAGON, VTK_HEXAHEDRON},
46  {elementType::SPHERICAL, VTK_EMPTY_CELL},
47  {elementType::CYLINDRICAL, VTK_EMPTY_CELL},
48  {elementType::BRICK, VTK_HEXAHEDRON},
49  {elementType::LAGRANGE_BRICK, VTK_HEXAHEDRON},
50  {elementType::TETRAHEDRON, VTK_TETRA},
51  {elementType::HEXPRISM, VTK_HEXAGONAL_PRISM},
52  {elementType::PRISMATIC, VTK_WEDGE},
53  {elementType::OTHER, VTK_EMPTY_CELL}
54  };
55  return eMap[et];
56 }
TRIANGLE
Definition: exoMesh.H:55

◆ v2pEMap()

PNTMesh::elementType PNTMesh::v2pEMap ( VTKCellType  vt)

Definition at line 58 of file pntMesh.C.

References TRIANGLE.

Referenced by PNTMesh::pntMesh::pntMesh().

59 {
60  std::map<VTKCellType, elementType> eMap =
61  {
62  {VTK_LINE, elementType::BAR},
63  {VTK_QUAD, elementType::QUADRILATERAL},
64  {VTK_QUADRATIC_QUAD, elementType::QUADRILATERAL},
65  {VTK_TRIANGLE, elementType::TRIANGLE},
66  {VTK_QUADRATIC_TRIANGLE, elementType::TRIANGLE},
67  {VTK_HEXAHEDRON, elementType::HEXAGON},
68  {VTK_QUADRATIC_HEXAHEDRON, elementType::HEXAGON},
69  {VTK_TETRA, elementType::TETRAHEDRON},
70  {VTK_QUADRATIC_TETRA, elementType::TETRAHEDRON},
71  {VTK_HEXAGONAL_PRISM, elementType::HEXPRISM},
72  {VTK_WEDGE, elementType::PRISMATIC},
73  {VTK_EMPTY_CELL, elementType::OTHER}
74  };
75  return eMap[vt];
76 }
TRIANGLE
Definition: exoMesh.H:55