49 namespace NekMeshUtils
57 int Prism::m_faceIds[5][4] = {
58 {0, 1, 2, 3}, {0, 1, 4, -1}, {1, 2, 5, 4}, {3, 2, 5, -1}, {0, 3, 5, 4}
65 vector<NodeSharedPtr> pNodeList,
67 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
77 map<pair<int, int>,
int> edgeNodeMap;
81 edgeNodeMap[pair<int, int>(1, 2)] = 7;
82 edgeNodeMap[pair<int, int>(2, 3)] = 7 + n;
83 edgeNodeMap[pair<int, int>(4, 3)] = 7 + 2 * n;
84 edgeNodeMap[pair<int, int>(1, 4)] = 7 + 3 * n;
85 edgeNodeMap[pair<int, int>(1, 5)] = 7 + 4 * n;
86 edgeNodeMap[pair<int, int>(2, 5)] = 7 + 5 * n;
87 edgeNodeMap[pair<int, int>(3, 6)] = 7 + 6 * n;
88 edgeNodeMap[pair<int, int>(4, 6)] = 7 + 7 * n;
89 edgeNodeMap[pair<int, int>(5, 6)] = 7 + 8 * n;
92 for (
int i = 0; i < 6; ++i)
99 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
101 vector<NodeSharedPtr> edgeNodes;
104 for (
int j = it->second; j < it->second + n; ++j)
106 edgeNodes.push_back(pNodeList[j - 1]);
110 pNodeList[it->first.second - 1],
113 m_edge.back()->m_id = eid++;
126 int face_edges[5][4];
129 face_offset[0] = 6 + 9 * n;
130 for (
int j = 0; j < 4; ++j)
132 int facenodes = j % 2 == 0 ? n * n : n * (n - 1) / 2;
133 face_offset[j + 1] = face_offset[j] + facenodes;
136 for (
int j = 0; j < 5; ++j)
138 vector<NodeSharedPtr> faceVertices;
139 vector<EdgeSharedPtr> faceEdges;
140 vector<NodeSharedPtr> faceNodes;
141 int nEdge = 3 - (j % 2 - 1);
143 for (
int k = 0; k < nEdge; ++k)
149 for (i = 0; i <
m_edge.size(); ++i)
151 if ((
m_edge[i]->m_n1->m_id == a->m_id &&
152 m_edge[i]->m_n2->m_id == b->m_id) ||
153 (
m_edge[i]->m_n1->m_id == b->m_id &&
154 m_edge[i]->m_n2->m_id == a->m_id))
156 faceEdges.push_back(
m_edge[i]);
157 face_edges[j][k] = i;
164 face_edges[j][k] = -1;
170 int face = j, facenodes;
177 face = (face + 4) % 6;
181 face = (face + 2) % 6;
187 facenodes = n * (n - 1) / 2;
190 for (
int i = 0; i < facenodes; ++i)
192 faceNodes.push_back(pNodeList[face_offset[face] + i]);
209 vector<EdgeSharedPtr> tmp(9);
210 ASSERTL1(face_edges[0][0] != -1,
"face_edges[0][0] == -1");
211 tmp[0] =
m_edge[face_edges[0][0]];
212 ASSERTL1(face_edges[0][1] != -1,
"face_edges[0][1] == -1");
213 tmp[1] =
m_edge[face_edges[0][1]];
214 ASSERTL1(face_edges[0][2] != -1,
"face_edges[0][2] == -1");
215 tmp[2] =
m_edge[face_edges[0][2]];
216 ASSERTL1(face_edges[0][3] != -1,
"face_edges[0][3] == -1");
217 tmp[3] =
m_edge[face_edges[0][3]];
218 ASSERTL1(face_edges[1][2] != -1,
"face_edges[1][2] == -1");
219 tmp[4] =
m_edge[face_edges[1][2]];
220 ASSERTL1(face_edges[1][1] != -1,
"face_edges[1][1] == -1");
221 tmp[5] =
m_edge[face_edges[1][1]];
222 ASSERTL1(face_edges[2][1] != -1,
"face_edges[2][1] == -1");
223 tmp[6] =
m_edge[face_edges[2][1]];
224 ASSERTL1(face_edges[3][2] != -1,
"face_edges[3][2] == -1");
225 tmp[7] =
m_edge[face_edges[3][2]];
226 ASSERTL1(face_edges[4][2] != -1,
"face_edges[4][2] == -1");
227 tmp[8] =
m_edge[face_edges[4][2]];
238 return (n + 1) * (n + 1) * (n + 2) / 2;
240 return 3 * (n + 1) * (n + 1) + 2 * (n + 1) * (n + 2) / 2 - 9 * (n + 1) +
243 return 9 * (n + 1) - 12;
251 for (
int i = 0; i < 5; ++i)
253 faces[i] =
m_face[i]->GetGeom(coordDim);
264 static int edgeVerts[9][2] = {
265 {0,1}, {1,2}, {3,2}, {0,3}, {0,4}, {1,4}, {2,5}, {3,5}, {4,5}
268 if (edge->m_n1 ==
m_vertex[edgeVerts[edgeId][0]])
272 else if (edge->m_n1 ==
m_vertex[edgeVerts[edgeId][1]])
278 ASSERTL1(
false,
"Edge is not connected to this quadrilateral.");
315 int nPoints = order + 1;
325 for (
int i = 0; i < coordDim; ++i)
328 xmap->BwdTrans(geom->GetCoeffs(i), phys[i]);
331 const int nPrismPts = nPoints * nPoints * (nPoints + 1) / 2;
332 const int nPrismIntPts = (nPoints - 2) * (nPoints - 3) * (nPoints - 2) / 2;
335 for (
int i = nPrismPts - nPrismIntPts, cnt = 0; i < nPrismPts; ++i, ++cnt)
343 for (
int j = 0; j < coordDim; ++j)
345 x[j] = xmap->PhysEvaluate(xp, phys[j]);
349 new Node(
id++, x[0], x[1], x[2]));
355 int n =
m_edge[0]->GetNodeCount();
356 nodeList.resize(n*n*(n+1)/2);
366 for(
int i = 0; i < 4; i++)
371 for(
int j = 0; j < n-2; j++)
373 nodeList[k++] =
m_edge[i]->m_edgeNodes[j];
378 for(
int j = n-3; j >= 0; j--)
380 nodeList[k++] =
m_edge[i]->m_edgeNodes[j];
385 for(
int i = 4; i < 8; i++)
390 for(
int j = 0; j < n-2; j++)
392 nodeList[k++] =
m_edge[i]->m_edgeNodes[j];
397 for(
int j = n-3; j >= 0; j--)
399 nodeList[k++] =
m_edge[i]->m_edgeNodes[j];
406 for(
int j = 0; j < n-2; j++)
408 nodeList[k++] =
m_edge[8]->m_edgeNodes[j];
413 for(
int j = n-3; j >= 0; j--)
415 nodeList[k++] =
m_edge[8]->m_edgeNodes[j];
419 vector<vector<int> > ts;
459 for(
int i = 0; i < ts.size(); i++)
461 if(ts[i].size() == 3)
464 fcid.push_back(
m_face[i]->m_vertexList[0]->
m_id);
465 fcid.push_back(
m_face[i]->m_vertexList[1]->
m_id);
466 fcid.push_back(
m_face[i]->m_vertexList[2]->
m_id);
474 nodeList.begin() + k);
480 fcid.push_back(
m_face[i]->m_vertexList[0]->
m_id);
481 fcid.push_back(
m_face[i]->m_vertexList[1]->
m_id);
482 fcid.push_back(
m_face[i]->m_vertexList[2]->
m_id);
483 fcid.push_back(
m_face[i]->m_vertexList[3]->
m_id);
491 nodeList.begin() + k);
498 nodeList.begin() + k);
527 for (
int i = 0; i < 6; ++i)
533 gid[0] = gid[3] = max(gid[0], gid[3]);
534 gid[1] = gid[2] = max(gid[1], gid[2]);
535 gid[4] = gid[5] = max(gid[4], gid[5]);
537 for (
int i = 1; i < 6; ++i)
541 swap(gid[i], gid[0]);
542 swap(lid[i], lid[0]);
546 if (lid[0] == 4 || lid[0] == 5)
550 else if (lid[0] == 1 || lid[0] == 2)
553 vector<NodeSharedPtr> vertexmap(6);
563 else if (lid[0] == 0 || lid[0] == 3)
566 vector<NodeSharedPtr> vertexmap(6);
578 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.
void Align(std::vector< int > vertId)
Align this surface to a given vertex ID.
unsigned int m_orientation
std::vector< T > surfVerts
The quadrilateral surface vertices – templated so that this can either be nodes or IDs...
Represents a face comprised of three or more edges.
static int m_faceIds[5][4]
Vertex IDs that make up prism faces.
std::vector< T > surfVerts
The triangle surface vertices – templated so that this can either be nodes or IDs.
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.
void OrientPrism()
Orient prism to align degenerate vertices.
virtual NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
get list of volume interior nodes
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.
1D Evenly-spaced points using Lagrange polynomial
virtual NEKMESHUTILS_EXPORT StdRegions::Orientation GetEdgeOrient(int edgeId, EdgeSharedPtr edge)
Get the edge orientation of edge with respect to the local element, which lies at edge index edgeId...
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.
unsigned int GetPointsDim() const
boost::shared_ptr< Node > NodeSharedPtr
PointsManagerT & PointsManager(void)
Defines a specification for a set of points.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
void Align(std::vector< int > vertId)
Align this surface to a given vertex ID.
A lightweight struct for dealing with high-order triangle alignment.
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
A lightweight struct for dealing with high-order quadrilateral alignment.
unsigned int m_id
ID of the element.
boost::shared_ptr< PrismGeom > PrismGeomSharedPtr
LibUtilities::PointsType m_curveType
Volume curve type.
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.
2D Evenly-spaced points on a Triangle
boost::shared_ptr< Face > FaceSharedPtr
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual NEKMESHUTILS_EXPORT void MakeOrder(int order, SpatialDomains::GeometrySharedPtr geom, LibUtilities::PointsType pType, int coordDim, int &id, bool justConfig=false)
Insert interior (i.e. volume) points into this element to make the geometry an order order representa...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< Geometry > GeometrySharedPtr
Base class for element definitions.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.