42 namespace NekMeshUtils
50 int Pyramid::m_faceIds[5][4] = {
51 {0, 1, 2, 3}, {0, 1, 4, -1}, {1, 2, 4, -1}, {3, 2, 4, -1}, {0, 3, 4, -1}
58 vector<NodeSharedPtr> pNodeList,
60 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
68 map<pair<int, int>,
int> edgeNodeMap;
69 map<pair<int, int>,
int>::iterator it;
70 edgeNodeMap[pair<int, int>(1, 2)] = 6;
71 edgeNodeMap[pair<int, int>(2, 3)] = 6 + n;
72 edgeNodeMap[pair<int, int>(4, 3)] = 6 + 2 * n;
73 edgeNodeMap[pair<int, int>(1, 4)] = 6 + 3 * n;
74 edgeNodeMap[pair<int, int>(1, 5)] = 6 + 4 * n;
75 edgeNodeMap[pair<int, int>(2, 5)] = 6 + 5 * n;
76 edgeNodeMap[pair<int, int>(3, 5)] = 6 + 6 * n;
77 edgeNodeMap[pair<int, int>(4, 5)] = 6 + 7 * n;
80 for (
int i = 0; i < 5; ++i)
87 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
89 vector<NodeSharedPtr> edgeNodes;
92 for (
int j = it->second; j < it->second + n; ++j)
94 edgeNodes.push_back(pNodeList[j - 1]);
98 pNodeList[it->first.second - 1],
101 m_edge.back()->m_id = eid++;
105 int face_edges[5][4];
106 int faceoffset = 5 + 8 * n;
107 for (
int j = 0; j < 5; ++j)
109 vector<NodeSharedPtr> faceVertices;
110 vector<EdgeSharedPtr> faceEdges;
111 vector<NodeSharedPtr> faceNodes;
112 int nEdge = j > 0 ? 3 : 4;
114 for (
int k = 0; k < nEdge; ++k)
119 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
124 faceEdges.push_back(
m_edge[i]);
125 face_edges[j][k] = i;
133 int facenodes = j == 0 ? n * n : n * (n - 1) / 2;
134 for (
int i = 0; i < facenodes; ++i)
136 faceNodes.push_back(pNodeList[faceoffset + i]);
138 faceoffset += facenodes;
145 vector<EdgeSharedPtr> tmp(8);
146 tmp[0] =
m_edge[face_edges[0][0]];
147 tmp[1] =
m_edge[face_edges[0][1]];
148 tmp[2] =
m_edge[face_edges[0][2]];
149 tmp[3] =
m_edge[face_edges[0][3]];
150 tmp[4] =
m_edge[face_edges[1][2]];
151 tmp[5] =
m_edge[face_edges[1][1]];
152 tmp[6] =
m_edge[face_edges[3][1]];
153 tmp[7] =
m_edge[face_edges[3][2]];
161 for (
int i = 0; i < 5; ++i)
163 faces[i] =
m_face[i]->GetGeom(coordDim);
183 return 5 + 8 * (n - 1) + (n - 1)*(n - 1);
187 return 5 + 8 * (n - 1);
bool m_faceNodes
Denotes whether the element contains face nodes. For 2D elements, if this is true then the element co...
Basic information about an element.
LibUtilities::PointsType m_faceCurveType
Distribution of points in faces.
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Represents an edge which joins two points.
Represents a face comprised of three or more edges.
std::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
ElementFactory & GetElementFactory()
ElmtConfig m_conf
Contains configuration of the element.
std::shared_ptr< Node > NodeSharedPtr
std::vector< int > m_taglist
List of integers specifying properties of the element.
std::shared_ptr< Face > FaceSharedPtr
LibUtilities::PointsType m_edgeCurveType
Distribution of points in edges.
unsigned int m_order
Order of the element.
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
unsigned int m_dim
Dimension of the element.
std::vector< EdgeSharedPtr > m_edge
List of element edges.
std::shared_ptr< Geometry > GeometrySharedPtr
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::string m_tag
Tag character describing the element.
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
unsigned int m_id
ID of the element.
static NEKMESHUTILS_EXPORT unsigned int GetNumNodes(ElmtConfig pConf)
Return the number of nodes defining a pyramid.
std::vector< FaceSharedPtr > m_face
List of element faces.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static int m_faceIds[5][4]
Vertex IDs that make up pyramid faces.
Base class for element definitions.