45 namespace NekMeshUtils
56 vector<NodeSharedPtr> pNodeList,
58 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
68 map<pair<int, int>,
int> edgeNodeMap;
72 edgeNodeMap[pair<int, int>(1, 2)] = 7;
73 edgeNodeMap[pair<int, int>(2, 3)] = 7 + n;
74 edgeNodeMap[pair<int, int>(4, 3)] = 7 + 2 * n;
75 edgeNodeMap[pair<int, int>(1, 4)] = 7 + 3 * n;
76 edgeNodeMap[pair<int, int>(1, 5)] = 7 + 4 * n;
77 edgeNodeMap[pair<int, int>(2, 5)] = 7 + 5 * n;
78 edgeNodeMap[pair<int, int>(3, 6)] = 7 + 6 * n;
79 edgeNodeMap[pair<int, int>(4, 6)] = 7 + 7 * n;
80 edgeNodeMap[pair<int, int>(5, 6)] = 7 + 8 * n;
83 for (
int i = 0; i < 6; ++i)
90 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
92 vector<NodeSharedPtr> edgeNodes;
95 for (
int j = it->second; j < it->second + n; ++j)
97 edgeNodes.push_back(pNodeList[j - 1]);
101 pNodeList[it->first.second - 1],
104 m_edge.back()->m_id = eid++;
117 int face_ids[5][4] = {
118 {0, 1, 2, 3}, {0, 1, 4, -1}, {1, 2, 5, 4}, {3, 2, 5, -1}, {0, 3, 5, 4}};
119 int face_edges[5][4];
122 face_offset[0] = 6 + 9 * n;
123 for (
int j = 0; j < 4; ++j)
125 int facenodes = j % 2 == 0 ? n * n : n * (n - 1) / 2;
126 face_offset[j + 1] = face_offset[j] + facenodes;
129 for (
int j = 0; j < 5; ++j)
131 vector<NodeSharedPtr> faceVertices;
132 vector<EdgeSharedPtr> faceEdges;
133 vector<NodeSharedPtr> faceNodes;
134 int nEdge = 3 - (j % 2 - 1);
136 for (
int k = 0; k < nEdge; ++k)
138 faceVertices.push_back(
m_vertex[face_ids[j][k]]);
142 for (i = 0; i <
m_edge.size(); ++i)
144 if ((
m_edge[i]->m_n1->m_id == a->m_id &&
145 m_edge[i]->m_n2->m_id == b->m_id) ||
146 (
m_edge[i]->m_n1->m_id == b->m_id &&
147 m_edge[i]->m_n2->m_id == a->m_id))
149 faceEdges.push_back(
m_edge[i]);
150 face_edges[j][k] = i;
157 face_edges[j][k] = -1;
163 int face = j, facenodes;
170 face = (face + 4) % 6;
174 face = (face + 2) % 6;
180 facenodes = n * (n - 1) / 2;
183 for (
int i = 0; i < facenodes; ++i)
185 faceNodes.push_back(pNodeList[face_offset[face] + i]);
193 vector<EdgeSharedPtr> tmp(9);
194 ASSERTL1(face_edges[0][0] != -1,
"face_edges[0][0] == -1");
195 tmp[0] =
m_edge[face_edges[0][0]];
196 ASSERTL1(face_edges[0][1] != -1,
"face_edges[0][1] == -1");
197 tmp[1] =
m_edge[face_edges[0][1]];
198 ASSERTL1(face_edges[0][2] != -1,
"face_edges[0][2] == -1");
199 tmp[2] =
m_edge[face_edges[0][2]];
200 ASSERTL1(face_edges[0][3] != -1,
"face_edges[0][3] == -1");
201 tmp[3] =
m_edge[face_edges[0][3]];
202 ASSERTL1(face_edges[1][2] != -1,
"face_edges[1][2] == -1");
203 tmp[4] =
m_edge[face_edges[1][2]];
204 ASSERTL1(face_edges[1][1] != -1,
"face_edges[1][1] == -1");
205 tmp[5] =
m_edge[face_edges[1][1]];
206 ASSERTL1(face_edges[2][1] != -1,
"face_edges[2][1] == -1");
207 tmp[6] =
m_edge[face_edges[2][1]];
208 ASSERTL1(face_edges[3][2] != -1,
"face_edges[3][2] == -1");
209 tmp[7] =
m_edge[face_edges[3][2]];
210 ASSERTL1(face_edges[4][2] != -1,
"face_edges[4][2] == -1");
211 tmp[8] =
m_edge[face_edges[4][2]];
222 return (n + 1) * (n + 1) * (n + 2) / 2;
224 return 3 * (n + 1) * (n + 1) + 2 * (n + 1) * (n + 2) / 2 - 9 * (n + 1) +
227 return 9 * (n + 1) - 12;
235 for (
int i = 0; i < 5; ++i)
237 faces[i] =
m_face[i]->GetGeom(coordDim);
276 nodalPrism->GetNodalPoints(x, y, z);
305 int nqtot = prism->GetTotPoints();
315 prism->GetCoords(xi, yi, zi);
317 for (i = 0; i < 3; ++i)
320 prism->FwdTrans(alloc + i * nqtot, coeffs);
322 nodalPrism->ModalToNodal(coeffs, tmp = alloc + (i + 3) * nqtot);
327 for (i = 0; i < 9; ++i)
329 pos = 6 + i * (order - 1);
330 m_edge[i]->m_edgeNodes.clear();
331 for (j = 0; j < order - 1; ++j)
334 new Node(0, xo[pos + j], yo[pos + j], zo[pos + j])));
339 pos = 6 + 9 * (order - 1);
340 for (i = 0; i < 5; ++i)
343 i % 2 ? (order - 2) * (order - 1) / 2 : (order - 1) * (order - 1);
344 m_face[i]->m_faceNodes.clear();
345 for (j = 0; j < facesize; ++j)
348 new Node(0, xo[pos + j], yo[pos + j], zo[pos + j])));
354 for (i = pos; i < (order + 1) * (order + 1) * (order + 2) / 2; ++i)
391 for (
int i = 0; i < 6; ++i)
397 gid[0] = gid[3] = max(gid[0], gid[3]);
398 gid[1] = gid[2] = max(gid[1], gid[2]);
399 gid[4] = gid[5] = max(gid[4], gid[5]);
401 for (
int i = 1; i < 6; ++i)
405 swap(gid[i], gid[0]);
406 swap(lid[i], lid[0]);
410 if (lid[0] == 4 || lid[0] == 5)
414 else if (lid[0] == 1 || lid[0] == 2)
417 vector<NodeSharedPtr> vertexmap(6);
427 else if (lid[0] == 0 || lid[0] == 3)
430 vector<NodeSharedPtr> vertexmap(6);
442 cerr <<
"Warning: possible prism orientation problem." << endl;
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.
unsigned int m_orientation
Represents a face comprised of three or more edges.
virtual NEKMESHUTILS_EXPORT void Complete(int order)
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.
Represents a point in the domain.
void OrientPrism()
Orient prism to align degenerate vertices.
std::vector< int > m_taglist
List of integers specifying properties of the element.
Gauss Radau pinned at x=-1, .
LibUtilities::PointsType m_edgeCurveType
Distribution of points in edges.
unsigned int m_order
Order of the element.
Principle Orthogonal Functions .
boost::shared_ptr< StdNodalPrismExp > StdNodalPrismExpSharedPtr
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
unsigned int m_dim
Dimension of the element.
static NEKMESHUTILS_EXPORT unsigned int GetNumNodes(ElmtConfig pConf)
Return the number of nodes defining a prism.
bool m_volumeNodes
Denotes whether the element contains volume (i.e. interior) nodes. These are not supported by either ...
std::vector< EdgeSharedPtr > m_edge
List of element edges.
boost::shared_ptr< Node > NodeSharedPtr
Principle Orthogonal Functions .
Defines a specification for a set of points.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
boost::shared_ptr< PrismExp > PrismExpSharedPtr
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
boost::shared_ptr< PrismGeom > PrismGeomSharedPtr
3D Evenly-spaced points on a Prism
std::vector< FaceSharedPtr > m_face
List of element faces.
bool m_reorient
Denotes whether the element needs to be re-orientated for a spectral element framework.
boost::shared_ptr< Face > FaceSharedPtr
Shared pointer to a face.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< Geometry > GeometrySharedPtr
Describes the specification for a Basis.
1D Gauss-Lobatto-Legendre quadrature points
Base class for element definitions.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.