45 namespace NekMeshUtils
53 int Hexahedron::m_faceIds[6][4] = {
54 {0, 1, 2, 3}, {0, 1, 5, 4}, {1, 2, 6, 5},
55 {3, 2, 6, 7}, {0, 3, 7, 4}, {4, 5, 6, 7}
59 vector<NodeSharedPtr> pNodeList,
61 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
70 map<pair<int, int>,
int> edgeNodeMap;
72 edgeNodeMap[pair<int, int>(1, 2)] = 9;
73 edgeNodeMap[pair<int, int>(2, 3)] = 9 + n;
74 edgeNodeMap[pair<int, int>(3, 4)] = 9 + 2 * n;
75 edgeNodeMap[pair<int, int>(4, 1)] = 9 + 3 * n;
76 edgeNodeMap[pair<int, int>(1, 5)] = 9 + 4 * n;
77 edgeNodeMap[pair<int, int>(2, 6)] = 9 + 5 * n;
78 edgeNodeMap[pair<int, int>(3, 7)] = 9 + 6 * n;
79 edgeNodeMap[pair<int, int>(4, 8)] = 9 + 7 * n;
80 edgeNodeMap[pair<int, int>(5, 6)] = 9 + 8 * n;
81 edgeNodeMap[pair<int, int>(6, 7)] = 9 + 9 * n;
82 edgeNodeMap[pair<int, int>(7, 8)] = 9 + 10 * n;
83 edgeNodeMap[pair<int, int>(8, 5)] = 9 + 11 * n;
86 for (
int i = 0; i < 8; ++i)
92 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
94 vector<NodeSharedPtr> edgeNodes;
97 for (
int j = it->second; j < it->second + n; ++j)
99 edgeNodes.push_back(pNodeList[j - 1]);
103 pNodeList[it->first.second - 1],
109 int face_edges[6][4];
110 for (
int j = 0; j < 6; ++j)
112 vector<NodeSharedPtr> faceVertices;
113 vector<EdgeSharedPtr> faceEdges;
114 vector<NodeSharedPtr> faceNodes;
115 for (
int k = 0; k < 4; ++k)
120 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
122 if (((*(
m_edge[i]->m_n1) == *a) &&
123 (*(
m_edge[i]->m_n2) == *b)) ||
124 ((*(
m_edge[i]->m_n1) == *b) && (*(
m_edge[i]->m_n2) == *a)))
126 face_edges[j][k] = i;
127 faceEdges.push_back(
m_edge[i]);
135 int N = 8 + 12 * n + j * n * n;
136 for (
int i = 0; i < n * n; ++i)
138 faceNodes.push_back(pNodeList[N + i]);
146 vector<EdgeSharedPtr> tmp(12);
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][3]];
152 tmp[5] =
m_edge[face_edges[1][1]];
153 tmp[6] =
m_edge[face_edges[2][1]];
154 tmp[7] =
m_edge[face_edges[4][1]];
155 tmp[8] =
m_edge[face_edges[5][0]];
156 tmp[9] =
m_edge[face_edges[5][1]];
157 tmp[10] =
m_edge[face_edges[5][2]];
158 tmp[11] =
m_edge[face_edges[5][3]];
167 for (
int i = 0; i < 6; ++i)
170 m_face[i]->GetGeom(coordDim));
181 static int edgeVerts[12][2] = { {0,1}, {1,2}, {2,3}, {3,0}, {0,4}, {1,5},
182 {2,6}, {3,7}, {4,5}, {5,6}, {6,7}, {7,4} };
184 if (edge->m_n1 ==
m_vertex[edgeVerts[edgeId][0]])
188 else if (edge->m_n1 ==
m_vertex[edgeVerts[edgeId][1]])
194 ASSERTL1(
false,
"Edge is not connected to this hexahedron.");
225 int nPoints = order + 1;
235 for (
int i = 0; i < coordDim; ++i)
238 xmap->BwdTrans(geom->GetCoeffs(i), phys[i]);
241 int nHexIntPts = (nPoints - 2) * (nPoints - 2) * (nPoints - 2);
244 for (
int i = 1, cnt = 0; i < nPoints-1; ++i)
246 for (
int j = 1; j < nPoints-1; ++j)
248 for (
int k = 1; k < nPoints-1; ++k, ++cnt)
256 for (
int k = 0; k < coordDim; ++k)
258 x[k] = xmap->PhysEvaluate(xp, phys[k]);
262 new Node(
id++, x[0], x[1], x[2]));
275 return (n + 1) * (n + 1) * (n + 1);
277 return 6 * (n + 1) * (n + 1) - 12 * (n + 1) + 8;
279 return 12 * (n + 1) - 16;
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.
static int m_faceIds[6][4]
Vertex IDs that make up hexahedron faces.
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.
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...
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Represents a face comprised of three or more edges.
boost::shared_ptr< HexGeom > HexGeomSharedPtr
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.
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)
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...
Defines a specification for a set of points.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
static NEKMESHUTILS_EXPORT unsigned int GetNumNodes(ElmtConfig pConf)
Return the number of nodes defining a hexahedron.
std::string m_tag
Tag character describing the element.
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
LibUtilities::PointsType m_curveType
Volume curve type.
std::vector< FaceSharedPtr > m_face
List of element faces.
boost::shared_ptr< Face > FaceSharedPtr
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
#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.