16 #ifndef GEOS_MESH_GENERATORS_PRISMUTILITIES_HPP_
17 #define GEOS_MESH_GENERATORS_PRISMUTILITIES_HPP_
36 template< localIndex N >
42 "Function getFaceNodePrism can be called for a prism with N-sided polygon base where N > 5." );
43 static constexpr
auto nodeCountError =
"Not enough nodes for {} element (face index = {}).\n";
50 GEOS_FMT( nodeCountError, N, faceNum ),
52 faceNodes[0] = elemNodes[0];
53 faceNodes[1] = elemNodes[1];
54 faceNodes[2] = elemNodes[N+1];
55 faceNodes[3] = elemNodes[N];
58 else if( faceNum == 1 )
62 GEOS_FMT( nodeCountError, N, faceNum ),
64 faceNodes[0] = elemNodes[0];
67 faceNodes[i] = elemNodes[N-i];
71 else if( faceNum == 2 )
75 GEOS_FMT( nodeCountError, N, faceNum ),
77 faceNodes[0] = elemNodes[0];
78 faceNodes[1] = elemNodes[N];
79 faceNodes[2] = elemNodes[N*2-1];
80 faceNodes[3] = elemNodes[N-1];
83 else if( faceNum >= 3 && faceNum <= N )
87 GEOS_FMT( nodeCountError, N, faceNum ),
89 faceNodes[0] = elemNodes[faceNum-2];
90 faceNodes[1] = elemNodes[faceNum-1];
91 faceNodes[2] = elemNodes[N+faceNum-1];
92 faceNodes[3] = elemNodes[N+faceNum-2];
95 else if( faceNum == N + 1 )
99 GEOS_FMT( nodeCountError, N, faceNum ),
103 faceNodes[i] = elemNodes[i+N];
109 GEOS_ERROR( GEOS_FMT(
"Local face index out of range for Prism{} element: face index = {}.\n{}",
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
#define GEOS_ERROR(...)
Raise a hard error and terminate the program.
#define GEOS_ERROR_IF_LT_MSG(lhs, rhs,...)
Raise a hard error if one value compares less than the other.
Lightweight non-owning wrapper over a contiguous range of elements.
constexpr size_type size() const noexcept
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
localIndex getFaceNodesPrism(localIndex const faceNum, arraySlice1d< localIndex const, cells::NODE_MAP_USD - 1 > const &elemNodes, Span< localIndex > const faceNodes)
Get the local indices of the nodes in a face of the prism with N-sided polygon base.
constexpr auto generalMeshErrorAdvice
String available for mesh errors.