36 #ifndef NEKMESHUTILS_MESHELEMENTS_FACE
37 #define NEKMESHUTILS_MESHELEMENTS_FACE
47 namespace NekMeshUtils
64 Face(std::vector<NodeSharedPtr> pVertexList,
65 std::vector<NodeSharedPtr> pFaceNodes,
66 std::vector<EdgeSharedPtr> pEdgeList,
127 nodeList.insert(nodeList.end(),
134 std::reverse(nodeList.begin() + 3 + k * (n - 2),
135 nodeList.begin() + 3 + (k + 1) * (n - 2));
145 "Face nodes of tensor product only supported "
146 "for quadrilaterals.");
149 nodeList.resize(n * n);
161 {0, 1}, {n - 1, n}, {n * n - 1, -1}, {n * (n - 1), -n}};
162 for (
int i = 0; i < 4; ++i)
168 for (
int j = 1; j < n - 1; ++j)
170 nodeList[skips[i][0] + j * skips[i][1]] =
176 for (
int j = 1; j < n - 1; ++j)
178 nodeList[skips[i][0] + j * skips[i][1]] =
185 for (
int i = 1; i < n - 1; ++i)
187 for (
int j = 1; j < n - 1; ++j)
189 nodeList[i * n + j] =
202 vector<NodeSharedPtr> nodeList;
208 for (
int k = 0; k < nodeList.size(); ++k)
210 s << std::scientific << std::setprecision(8) <<
" "
211 << nodeList[k]->m_x <<
" " << nodeList[k]->m_y <<
" "
212 << nodeList[k]->m_z <<
" ";
228 for (
int i = 0; i < nEdge; ++i)
233 for (
int i = 0; i < nEdge; ++i)
252 for (
int j = 0; j < nEdge; j++)
254 vector<NodeSharedPtr> ed =
m_edgeList[j]->m_edgeNodes;
257 for (
int k = ed.size() - 1; k >= 0; k--)
259 c->m_points.push_back(ed[k]->
GetGeom(coordDim));
264 for (
int k = 0; k < ed.size(); k++)
266 c->m_points.push_back(ed[k]->
GetGeom(coordDim));
276 m_id, edges, edgeo, c);
285 "Face nodes of tensor product only supported "
286 "for quadrilaterals.");
289 vector<NodeSharedPtr> tmp(n * n);
301 {0, 1}, {n - 1, n}, {n * n - 1, -1}, {n * (n - 1), -n}};
302 for (
int i = 0; i < 4; ++i)
308 for (
int j = 1; j < n - 1; ++j)
310 tmp[skips[i][0] + j * skips[i][1]] =
316 for (
int j = 1; j < n - 1; ++j)
318 tmp[skips[i][0] + j * skips[i][1]] =
325 for (
int i = 1; i < n - 1; ++i)
327 for (
int j = 1; j < n - 1; ++j)
334 for (
int k = 0; k < tmp.size(); ++k)
336 c->m_points.push_back(tmp[k]->
GetGeom(coordDim));
341 m_id, edges, edgeo, c);
381 FaceSharedPtr
const &p2);
383 FaceSharedPtr
const &p2);
385 struct FaceHash : std::unary_function<FaceSharedPtr, std::size_t>
389 unsigned int nVert = p->m_vertexList.size();
390 std::size_t seed = 0;
391 std::vector<unsigned int> ids(nVert);
393 for (
int i = 0; i < nVert; ++i)
395 ids[i] = p->m_vertexList[i]->m_id;
398 std::sort(ids.begin(), ids.end());
399 boost::hash_range(seed, ids.begin(), ids.end());
404 typedef boost::unordered_set<FaceSharedPtr, FaceHash>
FaceSet;
bool operator<(NodeSharedPtr const &p1, NodeSharedPtr const &p2)
Defines ordering between two NodeSharedPtr objects.
#define ASSERTL0(condition, msg)
void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
Assemble a list of nodes on curved face.
std::vector< NodeSharedPtr > m_faceNodes
List of face-interior nodes defining the shape of the face.
vector< pair< ElementSharedPtr, int > > m_elLink
Element(s) which are linked to this face.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
unsigned int GetNodeCount() const
Returns the total number of nodes (vertices, edge nodes and face nodes).
Represents a face comprised of three or more edges.
std::string GetXmlCurveString() const
Generates a string listing the coordinates of all nodes associated with this face.
Face(const Face &pSrc)
Copy an existing face.
std::vector< EdgeSharedPtr > m_edgeList
List of corresponding edges.
std::size_t operator()(FaceSharedPtr const &p) const
unsigned int m_id
ID of the face.
bool operator==(Face &pSrc)
Equality is defined by matching all vertices.
boost::shared_ptr< Curve > CurveSharedPtr
boost::unordered_set< FaceSharedPtr, FaceHash > FaceSet
Face(std::vector< NodeSharedPtr > pVertexList, std::vector< NodeSharedPtr > pFaceNodes, std::vector< EdgeSharedPtr > pEdgeList, LibUtilities::PointsType pCurveType)
Create a new face.
boost::shared_ptr< SegGeom > SegGeomSharedPtr
LibUtilities::PointsType m_curveType
Distribution of points in this face.
2D Nodal Fekete Points on a Triangle
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
SpatialDomains::Geometry2DSharedPtr GetGeom(int coordDim)
Generate either SpatialDomains::TriGeom or SpatialDomains::QuadGeom for this element.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
#define NEKMESHUTILS_EXPORT
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
2D Evenly-spaced points on a Triangle
boost::shared_ptr< Element > ElementSharedPtr
boost::shared_ptr< Face > FaceSharedPtr
Shared pointer to a face.
std::vector< NodeSharedPtr > m_vertexList
List of vertex nodes.
2D Nodal Electrostatic Points on a Triangle
SpatialDomains::Geometry2DSharedPtr m_geom
Nektar++ representation of geometry.