43 namespace NekMeshUtils
51 int Pyramid::m_faceIds[5][4] = {
52 {0, 1, 2, 3}, {0, 1, 4, -1}, {1, 2, 4, -1}, {3, 2, 4, -1}, {0, 3, 4, -1}
59 vector<NodeSharedPtr> pNodeList,
61 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
69 map<pair<int, int>,
int> edgeNodeMap;
71 edgeNodeMap[pair<int, int>(1, 2)] = 6;
72 edgeNodeMap[pair<int, int>(2, 3)] = 6 + n;
73 edgeNodeMap[pair<int, int>(4, 3)] = 6 + 2 * n;
74 edgeNodeMap[pair<int, int>(1, 4)] = 6 + 3 * n;
75 edgeNodeMap[pair<int, int>(1, 5)] = 6 + 4 * n;
76 edgeNodeMap[pair<int, int>(2, 5)] = 6 + 5 * n;
77 edgeNodeMap[pair<int, int>(3, 5)] = 6 + 6 * n;
78 edgeNodeMap[pair<int, int>(4, 5)] = 6 + 7 * n;
81 for (
int i = 0; i < 5; ++i)
88 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
90 vector<NodeSharedPtr> edgeNodes;
93 for (
int j = it->second; j < it->second + n; ++j)
95 edgeNodes.push_back(pNodeList[j - 1]);
99 pNodeList[it->first.second - 1],
102 m_edge.back()->m_id = eid++;
106 int face_edges[5][4];
107 int faceoffset = 5 + 8 * n;
108 for (
int j = 0; j < 5; ++j)
110 vector<NodeSharedPtr> faceVertices;
111 vector<EdgeSharedPtr> faceEdges;
112 vector<NodeSharedPtr> faceNodes;
113 int nEdge = j > 0 ? 3 : 4;
115 for (
int k = 0; k < nEdge; ++k)
120 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
125 faceEdges.push_back(
m_edge[i]);
126 face_edges[j][k] = i;
134 int facenodes = j == 0 ? n * n : n * (n - 1) / 2;
135 for (
int i = 0; i < facenodes; ++i)
137 faceNodes.push_back(pNodeList[faceoffset + i]);
139 faceoffset += facenodes;
146 vector<EdgeSharedPtr> tmp(8);
147 tmp[0] =
m_edge[face_edges[0][0]];
148 tmp[1] =
m_edge[face_edges[0][1]];
149 tmp[2] =
m_edge[face_edges[0][2]];
150 tmp[3] =
m_edge[face_edges[0][3]];
151 tmp[4] =
m_edge[face_edges[1][2]];
152 tmp[5] =
m_edge[face_edges[1][1]];
153 tmp[6] =
m_edge[face_edges[3][1]];
154 tmp[7] =
m_edge[face_edges[3][2]];
162 for (
int i = 0; i < 5; ++i)
164 faces[i] =
m_face[i]->GetGeom(coordDim);
178 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.
Represents an edge which joins two points.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Represents a face comprised of three or more edges.
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::vector< int > m_taglist
List of integers specifying properties of the element.
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.
boost::shared_ptr< Node > NodeSharedPtr
std::string m_tag
Tag character describing the element.
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this 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.
boost::shared_ptr< Face > FaceSharedPtr
static int m_faceIds[5][4]
Vertex IDs that make up pyramid faces.
boost::shared_ptr< Geometry > GeometrySharedPtr
Base class for element definitions.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.