36 #ifndef UTILITY_PREPROCESSING_MESHCONVERT_MESHELEMENTS
37 #define UTILITY_PREPROCESSING_MESHCONVERT_MESHELEMENTS
44 #include <boost/shared_ptr.hpp>
45 #include <boost/unordered_set.hpp>
46 #include <boost/unordered_map.hpp>
197 bool operator==(NodeSharedPtr
const &p1, NodeSharedPtr
const &p2);
198 bool operator< (NodeSharedPtr
const &p1, NodeSharedPtr
const &p2);
199 std::ostream &
operator<<(std::ostream &os,
const NodeSharedPtr &n);
207 struct NodeHash : std::unary_function<NodeSharedPtr, std::size_t>
211 std::size_t seed = 0;
212 boost::hash_combine(seed, p->m_x);
213 boost::hash_combine(seed, p->m_y);
214 boost::hash_combine(seed, p->m_z);
218 typedef boost::unordered_set<NodeSharedPtr, NodeHash>
NodeSet;
230 Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2,
231 std::vector<NodeSharedPtr> pEdgeNodes,
253 s << std::scientific << std::setprecision(8) <<
" "
254 <<
m_n1->m_x <<
" " <<
m_n1->m_y <<
" " <<
m_n1->m_z <<
" ";
256 s << std::scientific << std::setprecision(8) <<
" "
260 s << std::scientific << std::setprecision(8) <<
" "
272 p[0] =
m_n1->GetGeom(coordDim);
273 p[1] =
m_n2->GetGeom(coordDim);
282 c->m_points.push_back(p[0]);
287 c->m_points.push_back(p[1]);
320 bool operator==(EdgeSharedPtr
const &p1, EdgeSharedPtr
const &p2);
321 bool operator< (EdgeSharedPtr
const &p1, EdgeSharedPtr
const &p2);
330 struct EdgeHash : std::unary_function<EdgeSharedPtr, std::size_t>
334 std::size_t seed = 0;
335 unsigned int id1 = p->m_n1->m_id;
336 unsigned int id2 = p->m_n2->m_id;
337 boost::hash_combine(seed, id1 < id2 ? id1 : id2);
338 boost::hash_combine(seed, id2 < id1 ? id1 : id2);
342 typedef boost::unordered_set<EdgeSharedPtr, EdgeHash>
EdgeSet;
355 Face(std::vector<NodeSharedPtr> pVertexList,
356 std::vector<NodeSharedPtr> pFaceNodes,
357 std::vector<EdgeSharedPtr> pEdgeList,
412 vector<NodeSharedPtr> tmp;
418 tmp.insert(tmp.end(),
m_edgeList[k]->m_edgeNodes.begin(),
424 std::reverse(tmp.begin() + 3 + k*(n-2),
425 tmp.begin() + 3 + (k+1)*(n-2));
430 for (
int k = 0; k < tmp.size(); ++k) {
431 s << std::scientific << std::setprecision(8) <<
" "
432 << tmp[k]->m_x <<
" " << tmp[k]->m_y
433 <<
" " << tmp[k]->m_z <<
" ";
442 "Face nodes of tensor product only supported "
443 "for quadrilaterals.");
446 vector<NodeSharedPtr> tmp(n*n);
457 int skips[4][2] = {{0,1}, {n-1,n}, {n*n-1,-1}, {n*(n-1),-n}};
458 for (
int i = 0; i < 4; ++i)
464 for (
int j = 1; j < n-1; ++j)
466 tmp[skips[i][0] + j*skips[i][1]] =
472 for (
int j = 1; j < n-1; ++j)
474 tmp[skips[i][0] + j*skips[i][1]] =
481 for (
int i = 1; i < n-1; ++i)
483 for (
int j = 1; j < n-1; ++j)
489 for (
int k = 0; k < tmp.size(); ++k) {
490 s << std::scientific << std::setprecision(8) <<
" "
491 << tmp[k]->m_x <<
" " << tmp[k]->m_y
492 <<
" " << tmp[k]->m_z <<
" ";
509 for (
int i = 0; i < nEdge; ++i)
514 for (
int i = 0; i < nEdge; ++i)
517 *edges[i], *edges[(i+1) % nEdge]);
552 bool operator==(FaceSharedPtr
const &p1, FaceSharedPtr
const &p2);
553 bool operator< (FaceSharedPtr
const &p1, FaceSharedPtr
const &p2);
555 struct FaceHash : std::unary_function<FaceSharedPtr, std::size_t>
559 unsigned int nVert = p->m_vertexList.size();
560 std::size_t seed = 0;
561 std::vector<unsigned int> ids(nVert);
563 for (
int i = 0; i < nVert; ++i)
565 ids[i] = p->m_vertexList[i]->m_id;
568 std::sort(ids.begin(), ids.end());
569 boost::hash_range(seed, ids.begin(), ids.end());
574 typedef boost::unordered_set<FaceSharedPtr, FaceHash>
FaceSet;
589 bool pReorient =
true,
598 m_reorient (pReorient),
599 m_edgeCurveType(pECt),
600 m_faceCurveType(pFCt)
607 m_volumeNodes (p.m_volumeNodes),
609 m_reorient (p.m_reorient),
610 m_edgeCurveType(p.m_edgeCurveType),
611 m_faceCurveType(p.m_faceCurveType)
650 unsigned int pNumNodes,
651 unsigned int pGotNodes);
656 if (m_faceLink.get() != 0)
return m_faceLink->m_id;
657 if (m_edgeLink.get() != 0)
return m_edgeLink->m_id;
670 if (m_faceLink.get() != 0)
return "F";
671 if (m_edgeLink.get() != 0)
return "E";
700 return m_volumeNodes;
703 m_volumeNodes = nodes;
715 unsigned int n = m_volumeNodes.size();
722 for (
int i = 0; i < m_edge.size(); ++i)
724 n += m_edge[i]->GetNodeCount();
726 n -= m_vertex.size();
730 cerr <<
"Not supported." << endl;
741 return m_vertex.size();
745 return m_edge.size();
749 return m_face.size();
756 void SetVertex(
unsigned int p, NodeSharedPtr pNew);
758 void SetEdge(
unsigned int p, EdgeSharedPtr pNew);
760 void SetFace(
unsigned int p, FaceSharedPtr pNew);
782 m_boundaryLinks[i] = j;
787 if (it == m_boundaryLinks.end())
808 for(
int j=0; j< m_vertex.size(); ++j)
810 s << std::setw(5) << m_vertex[j]->m_id <<
" ";
814 for(
int j=0; j< m_edge.size(); ++j)
816 s << std::setw(5) << m_edge[j]->m_id <<
" ";
820 for(
int j=0; j< m_face.size(); ++j)
822 s << std::setw(5) << m_face[j]->m_id <<
" ";
834 std::vector<NodeSharedPtr> nodeList;
838 if (m_vertex.size() == 2)
840 nodeList.push_back(m_vertex[0]);
841 for (
int i = 0; i < m_volumeNodes.size(); ++i)
843 nodeList.push_back(m_volumeNodes[i]);
845 nodeList.push_back(m_vertex[1]);
847 else if (m_vertex.size() == 3)
849 int n = m_edge[0]->GetNodeCount();
850 nodeList.resize(n*(n+1)/2);
853 std::copy(m_vertex.begin(), m_vertex.end(), nodeList.begin());
854 for (
int i = 0; i < 3; ++i)
856 std::copy(m_edge[i]->m_edgeNodes.begin(),
857 m_edge[i]->m_edgeNodes.end(),
858 nodeList.begin() + 3 + i*(n-2));
859 if (m_edge[i]->m_n1 != m_vertex[i])
863 std::reverse(nodeList.begin() + 3 + i*(n-2),
864 nodeList.begin() + 3 + (i+1)*(n-2));
869 std::copy(m_volumeNodes.begin(), m_volumeNodes.end(),
870 nodeList.begin() + 3*(n-1));
873 else if (m_dim == 2 && m_vertex.size() == 4)
875 int n = m_edge[0]->GetNodeCount();
876 nodeList.resize(n*n);
879 nodeList[0] = m_vertex[0];
880 nodeList[n-1] = m_vertex[1];
881 nodeList[n*n-1] = m_vertex[2];
882 nodeList[n*(n-1)] = m_vertex[3];
885 int skips[4][2] = {{0,1}, {n-1,n}, {n*n-1,-1}, {n*(n-1),-n}};
886 for (
int i = 0; i < 4; ++i)
888 bool reverseEdge = m_edge[i]->m_n1 == m_vertex[i];
892 for (
int j = 1; j < n-1; ++j)
894 nodeList[skips[i][0] + j*skips[i][1]] =
895 m_edge[i]->m_edgeNodes[n-2-j];
900 for (
int j = 1; j < n-1; ++j)
902 nodeList[skips[i][0] + j*skips[i][1]] =
903 m_edge[i]->m_edgeNodes[j-1];
909 for (
int i = 1; i < n-1; ++i)
911 for (
int j = 1; j < n-1; ++j)
913 nodeList[i*n+j] = m_volumeNodes[(i-1)*(n-2)+(j-1)];
919 cerr <<
"GetXmlCurveString for a " << m_vertex.size()
920 <<
"-vertex element is not yet implemented." << endl;
927 for (
int k = 0; k < nodeList.size(); ++k)
929 s << std::scientific << std::setprecision(8) <<
" "
930 << nodeList[k]->m_x <<
" " << nodeList[k]->m_y
931 <<
" " << nodeList[k]->m_z <<
" ";
940 ASSERTL0(
false,
"This function should be implemented at a shape level.");
941 return boost::shared_ptr<SpatialDomains::Geometry>();
947 ASSERTL0(
false,
"This function should be implemented at a shape level.");
952 for (i = 0; i < m_vertex.size(); ++i)
954 cout << m_vertex[i]->m_x <<
" " << m_vertex[i]->m_y <<
" " << m_vertex[i]->m_z << endl;
956 for (i = 0; i < m_edge.size(); ++i)
958 for (j = 0; j < m_edge[i]->m_edgeNodes.size(); ++j)
960 NodeSharedPtr n = m_edge[i]->m_edgeNodes[j];
961 cout << n->m_x <<
" " << n->m_y <<
" " << n->m_z << endl;
964 for (i = 0; i < m_face.size(); ++i)
966 for (j = 0; j < m_face[i]->m_faceNodes.size(); ++j)
968 NodeSharedPtr n = m_face[i]->m_faceNodes[j];
969 cout << n->m_x <<
" " << n->m_y <<
" " << n->m_z << endl;
1007 typedef std::map<unsigned int, std::vector<ElementSharedPtr> >
ElementMap;
1016 typedef boost::shared_ptr<Element>
pT;
1024 return b.get() != 0;
1026 else if (b.get() == 0)
1032 return a->GetId() < b->GetId();
1099 bool operator==(ConditionSharedPtr
const &c1, ConditionSharedPtr
const &c2);
1138 unsigned int GetNumElements();
1141 unsigned int GetNumBndryElements();
1143 unsigned int GetNumEntities();
1158 std::vector<NodeSharedPtr> pNodeList,
1159 std::vector<int> pTagList)
1161 return boost::shared_ptr<Element>(
1162 new Point(pConf, pNodeList, pTagList));
1168 std::vector<NodeSharedPtr> pNodeList,
1169 std::vector<int> pTagList);
1173 static unsigned int GetNumNodes(
ElmtConfig pConf);
1185 std::vector<NodeSharedPtr> pNodeList,
1186 std::vector<int> pTagList)
1188 return boost::shared_ptr<Element>(
1189 new Line(pConf, pNodeList, pTagList));
1195 std::vector<NodeSharedPtr> pNodeList,
1196 std::vector<int> pTagList);
1202 static unsigned int GetNumNodes(
ElmtConfig pConf);
1212 template<
typename T>
1216 vector<T> pSurfVerts) :
1217 vertId(pVertId), surfVerts(pSurfVerts) {}
1236 int np = ((int)sqrt(8.0*surfVerts.size()+1.0)-1)/2;
1237 vector<T> tmp(np*np);
1239 for (n = 0; n < nrot; ++n)
1241 for (cnt = i = 0; i < np; ++i)
1243 for (j = 0; j < np-i; ++j, cnt++)
1245 tmp[i*np+j] = surfVerts[cnt];
1248 for (cnt = i = 0; i < np; ++i)
1250 for (j = 0; j < np-i; ++j,cnt++)
1252 surfVerts[cnt] = tmp[(np-1-i-j)*np+i];
1272 int np = ((int)sqrt(8.0*surfVerts.size()+1.0)-1)/2;
1273 vector<T> tmp(np*np);
1275 for (cnt = i = 0; i < np; ++i)
1277 for (j = 0; j < np-i; ++j,cnt++)
1279 tmp[i*np+np-i-1-j] = surfVerts[cnt];
1283 for (cnt = i = 0; i < np; ++i)
1285 for(j = 0; j < np-i; ++j,cnt++)
1287 surfVerts[cnt] = tmp[i*np+j];
1297 if (vertId[0] == this->vertId[0])
1299 if (vertId[1] == this->vertId[1] ||
1300 vertId[1] == this->vertId[2])
1302 if (vertId[1] == this->vertId[2])
1309 else if (vertId[0] == this->vertId[1])
1311 if (vertId[1] == this->vertId[0] ||
1312 vertId[1] == this->vertId[2])
1314 if (vertId[1] == this->vertId[0])
1324 else if (vertId[0] == this->vertId[2])
1326 if (vertId[1] == this->vertId[0] ||
1327 vertId[1] == this->vertId[1])
1329 if (vertId[1] == this->vertId[1])
1351 std::vector<NodeSharedPtr> pNodeList,
1352 std::vector<int> pTagList)
1354 ElementSharedPtr e = boost::shared_ptr<Element>(
1355 new Triangle(pConf, pNodeList, pTagList));
1356 vector<EdgeSharedPtr> m_edges = e->GetEdgeList();
1357 for (
int i = 0; i < m_edges.size(); ++i)
1359 m_edges[i]->m_elLink.push_back(pair<ElementSharedPtr, int>(e,i));
1367 std::vector<NodeSharedPtr> pNodeList,
1368 std::vector<int> pTagList);
1373 virtual void Complete(
int order);
1375 static unsigned int GetNumNodes(
ElmtConfig pConf);
1387 std::vector<NodeSharedPtr> pNodeList,
1388 std::vector<int> pTagList)
1390 ElementSharedPtr e = boost::shared_ptr<Element>(
1392 vector<EdgeSharedPtr> m_edges = e->GetEdgeList();
1393 for (
int i = 0; i < m_edges.size(); ++i)
1395 m_edges[i]->m_elLink.push_back(pair<ElementSharedPtr, int>(e,i));
1403 std::vector<NodeSharedPtr> pNodeList,
1404 std::vector<int> pTagList);
1409 virtual void Complete(
int order);
1411 static unsigned int GetNumNodes(
ElmtConfig pConf);
1423 std::vector<NodeSharedPtr> pNodeList,
1424 std::vector<int> pTagList)
1426 ElementSharedPtr e = boost::shared_ptr<Element>(
1428 vector<FaceSharedPtr> faces = e->GetFaceList();
1429 for (
int i = 0; i < faces.size(); ++i)
1431 faces[i]->m_elLink.push_back(pair<ElementSharedPtr, int>(e,i));
1439 std::vector<NodeSharedPtr> pNodeList,
1440 std::vector<int> pTagList);
1445 virtual void Complete(
int order);
1447 static unsigned int GetNumNodes(
ElmtConfig pConf);
1449 int m_orientationMap[4];
1450 int m_origVertMap[4];
1465 std::vector<NodeSharedPtr> pNodeList,
1466 std::vector<int> pTagList)
1468 ElementSharedPtr e = boost::shared_ptr<Element>(
1469 new Pyramid(pConf, pNodeList, pTagList));
1470 vector<FaceSharedPtr> faces = e->GetFaceList();
1471 for (
int i = 0; i < faces.size(); ++i)
1473 faces[i]->m_elLink.push_back(pair<ElementSharedPtr, int>(e,i));
1478 static LibUtilities::ShapeType
type;
1481 std::vector<NodeSharedPtr> pNodeList,
1482 std::vector<int> pTagList);
1487 static unsigned int GetNumNodes(
ElmtConfig pConf);
1492 int orientationMap[5];
1504 std::vector<NodeSharedPtr> pNodeList,
1505 std::vector<int> pTagList)
1507 ElementSharedPtr e = boost::shared_ptr<Element>(
1508 new Prism(pConf, pNodeList, pTagList));
1509 vector<FaceSharedPtr> faces = e->GetFaceList();
1510 for (
int i = 0; i < faces.size(); ++i)
1512 faces[i]->m_elLink.push_back(pair<ElementSharedPtr, int>(e,i));
1520 std::vector<NodeSharedPtr> pNodeList,
1521 std::vector<int> pTagList);
1526 virtual void Complete(
int order);
1528 static unsigned int GetNumNodes(
ElmtConfig pConf);
1549 std::vector<NodeSharedPtr> pNodeList,
1550 std::vector<int> pTagList)
1552 ElementSharedPtr e = boost::shared_ptr<Element>(
1554 vector<FaceSharedPtr> faces = e->GetFaceList();
1555 for (
int i = 0; i < faces.size(); ++i)
1557 faces[i]->m_elLink.push_back(pair<ElementSharedPtr, int>(e,i));
1565 std::vector<NodeSharedPtr> pNodeList,
1566 std::vector<int> pTagList);
1572 static unsigned int GetNumNodes(
ElmtConfig pConf);
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
vector< pair< ElementSharedPtr, int > > m_elLink
Element(s) which are linked to this face.
vector< int > vertId
The triangle vertex IDs.
Define element ordering based on ID.
Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2, std::vector< NodeSharedPtr > pEdgeNodes, LibUtilities::PointsType pCurveType)
Creates a new edge.
std::vector< NodeSharedPtr > m_node
List of mesh nodes.
static LibUtilities::ShapeType m_type
Element type.
EdgeSet m_edgeSet
Set of element edges.
#define ASSERTL0(condition, msg)
bool m_volumeNodes
Denotes whether the element contains volume (i.e. interior) nodes. These are not supported by either ...
std::ostream & operator<<(std::ostream &os, const ModuleKey &rhs)
unsigned int GetVertexCount() const
Returns the number of vertices.
SpatialDomains::PointGeomSharedPtr m_geom
LibUtilities::PointsType m_curveType
Volume curve type.
map< int, string > m_faceLabels
List of face labels for composite annotation.
void SetVolumeNodes(std::vector< NodeSharedPtr > &nodes)
NodeSharedPtr m_n2
Second vertex node.
A 3-dimensional square-based pyramidic element.
Node operator*(const Node &pSrc) const
std::vector< NodeSharedPtr > GetVolumeNodes() const
Access the list of volume nodes.
void Rotate(int nrot)
Rotates the triangle of data points inside surfVerts counter-clockwise nrot times.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Represents an edge which joins two points.
Node operator*(const NekDouble &alpha) const
static LibUtilities::ShapeType type
Element type.
A composite is a collection of elements.
std::vector< std::string > field
ConditionMap m_condition
Boundary conditions maps tag to condition.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
unsigned int m_orientation
Face(const Face &pSrc)
Copy an existing face.
std::vector< int > m_taglist
List of integers specifying properties of the element.
std::map< unsigned int, CompositeSharedPtr > CompositeMap
Container of composites; key is the composite id, value is the composite.
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
SpatialDomains::Geometry2DSharedPtr GetGeom(int coordDim)
Generate either SpatialDomains::TriGeom or SpatialDomains::QuadGeom for this element.
Node curl(const Node &pSrc) const
SpatialDomains::SegGeomSharedPtr m_geom
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
unsigned int m_id
ID of edge.
std::vector< FaceSharedPtr > m_face
List of element faces.
ElmtConfig GetConf() const
Returns the configuration of the element.
EdgeSharedPtr GetEdge(unsigned int i) const
Access an edge.
boost::unordered_set< FaceSharedPtr, FaceHash > FaceSet
std::vector< ElementSharedPtr > m_items
List of elements in this composite.
Nektar::LibUtilities::NekFactory< LibUtilities::ShapeType, Element, ElmtConfig, std::vector< NodeSharedPtr >, std::vector< int > > ElementFactory
Element factory definition.
LibUtilities::PointsType m_curveType
Distribution of points in this face.
boost::shared_ptr< Face > FaceSharedPtr
Shared pointer to a face.
NodeSharedPtr GetVertex(unsigned int i) const
Access a vertex node.
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
EdgeSharedPtr GetEdgeLink()
Get correspondence between this element and an edge.
vector< T > surfVerts
The triangle surface vertices – templated so that this can either be nodes or IDs.
unsigned int GetNodeCount() const
Returns the total number of nodes (vertices, edge nodes and face nodes and volume nodes)...
void SetTagList(const std::vector< int > &tags)
Set the list of tags associated with this element.
FaceSet m_faceSet
Set of element faces.
Node operator+(const Node &pSrc) const
boost::shared_ptr< Node > NodeSharedPtr
Shared pointer to a Node.
unsigned int GetEdgeCount() const
Returns the number of edges.
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
void SetEdgeLink(EdgeSharedPtr pLink)
Set a correspondence between this element and an edge (2D boundary element).
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
unsigned int m_spaceDim
Dimension of the space in which the mesh is defined.
A 2-dimensional three-sided element.
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
std::vector< NodeSharedPtr > GetVertexList() const
Access the list of vertex nodes.
boost::shared_ptr< Curve > CurveSharedPtr
vector< pair< ElementSharedPtr, int > > m_elLink
Element(s) which are linked to this edge.
static LibUtilities::ShapeType m_type
Element type.
boost::shared_ptr< Composite > CompositeSharedPtr
Shared pointer to a composite.
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
NekDouble m_x
X-coordinate.
boost::shared_ptr< Condition > ConditionSharedPtr
boost::shared_ptr< Element > ElementSharedPtr
Shared pointer to an element.
bool operator==(Face &pSrc)
Equality is defined by matching all vertices.
1D Evenly-spaced points using Lagrange polynomial
std::vector< NodeSharedPtr > m_vertexList
List of vertex nodes.
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
NodeSet m_vertexSet
Set of element vertices.
bool m_reorient
Denotes whether the element needs to be re-orientated for a spectral element framework.
void operator+=(const Node &pSrc)
A 3-dimensional five-faced element (2 triangles, 3 quadrilaterals).
boost::unordered_set< NodeSharedPtr, NodeHash > NodeSet
HOTriangle(vector< int > pVertId, vector< T > pSurfVerts)
bool m_verbose
Verbose flag.
void operator/=(const NekDouble &alpha)
A 3-dimensional six-faced element.
LibUtilities::ShapeType m_e
Element type (e.g. triangle, quad, etc).
unsigned int m_order
Order of the element.
std::map< unsigned int, std::vector< ElementSharedPtr > > ElementMap
Container for elements; key is expansion dimension, value is vector of elements of that dimension...
string GetXmlString(char tag, vector< unsigned int > &ids)
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
Node operator/(const NekDouble &alpha) const
HOTriangle(vector< int > pVertId)
boost::shared_ptr< Element > pT
virtual SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
CompositeMap m_composite
Map for composites.
std::vector< ConditionType > type
void SetId(unsigned int p)
Change the ID of the element.
boost::shared_ptr< SegGeom > SegGeomSharedPtr
ElmtConfig(ElmtConfig const &p)
Face(std::vector< NodeSharedPtr > pVertexList, std::vector< NodeSharedPtr > pFaceNodes, std::vector< EdgeSharedPtr > pEdgeList, LibUtilities::PointsType pCurveType)
Create a new face.
unsigned int m_id
ID of the element.
std::size_t operator()(NodeSharedPtr const &p) const
std::string m_tag
Element type tag.
static LibUtilities::ShapeType m_type
Element type.
LibUtilities::PointsType m_faceCurveType
Distribution of points in faces.
A 1-dimensional line between two vertex nodes.
bool m_faceNodes
Denotes whether the element contains face nodes. For 2D elements, if this is true then the element co...
unsigned int GetFaceCount() const
Returns the number of faces.
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
SpatialDomains::PointGeomSharedPtr GetGeom(int coordDim)
Generate a SpatialDomains::PointGeom for this node.
static LibUtilities::ShapeType m_type
Element type.
Defines a hash function for nodes.
NekDouble m_y
Y-coordinate.
ElmtConfig(LibUtilities::ShapeType pE, unsigned int pOrder, bool pFn, bool pVn, bool pReorient=true, LibUtilities::PointsType pECt=LibUtilities::ePolyEvenlySpaced, LibUtilities::PointsType pFCt=LibUtilities::ePolyEvenlySpaced)
std::vector< std::string > m_fields
List of fields names.
bool operator<(NodeSharedPtr const &p1, NodeSharedPtr const &p2)
Defines ordering between two NodeSharedPtr objects.
static LibUtilities::ShapeType m_type
Element type.
Basic information about an element.
unsigned int GetId() const
Returns the ID of the element (or associated edge or face for boundary elements). ...
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
unsigned int GetNodeCount() const
Returns the total number of nodes defining the edge.
ElementMap m_element
Map for elements.
bool operator()(const pT a, const pT b) const
SpatialDomains::Geometry2DSharedPtr m_geom
Node operator-(const Node &pSrc) const
std::string m_tag
Tag character describing the element.
set< pair< int, int > > m_spherigonSurfs
Set of all pairs of element ID and edge/face number on which to apply spherigon surface smoothing...
static LibUtilities::ShapeType m_type
Element type.
FaceSharedPtr GetFace(unsigned int i) const
Access a face.
unsigned int m_dim
Dimension of the element.
Represents a point in the domain.
unsigned int m_expDim
Dimension of the expansion.
unsigned int m_id
ID of the face.
Node(const Node &pSrc)
Copy an existing node.
std::vector< NodeSharedPtr > m_faceNodes
List of face-interior nodes defining the shape of the face.
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
void SetCurveType(LibUtilities::PointsType cT)
std::vector< EdgeSharedPtr > GetEdgeList() const
Access the list of edges.
void SetFaceLink(FaceSharedPtr pLink)
Set a correspondence between this element and a face (3D boundary element).
2D Nodal Fekete Points on a Triangle
LibUtilities::PointsType m_curveType
Distributions of points along edge.
LibUtilities::PointsType m_edgeCurveType
Distribution of points in edges.
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
void operator*=(const NekDouble &alpha)
virtual void Complete(int order)
Complete this object.
boost::unordered_set< EdgeSharedPtr, EdgeHash > EdgeSet
static LibUtilities::ShapeType m_type
Element type.
std::vector< int > m_composite
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
bool operator==(TriFaceIDs const &p1, TriFaceIDs const &p2)
LibUtilities::PointsType GetCurveType() const
std::vector< FaceSharedPtr > GetFaceList() const
Access the list of faces.
std::map< int, ConditionSharedPtr > ConditionMap
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
NekDouble dot(const Node &pSrc) const
std::size_t operator()(EdgeSharedPtr const &p) const
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
A 2-dimensional four-sided element.
NekDouble m_z
Z-coordinate.
std::string m_label
boundary label
boost::unordered_map< int, Node > m_vertexNormals
Map of vertex normals.
Node(int pId, NekDouble pX, NekDouble pY, NekDouble pZ)
Create a new node at a specified coordinate.
virtual std::string GetXmlString() const
Generate a list of vertices (1D), edges (2D), or faces (3D).
std::vector< EdgeSharedPtr > m_edgeList
List of corresponding edges.
void SetBoundaryLink(int i, int j)
Set a correspondence between edge or face i and its representative boundary element m->element[expDim...
void Reflect()
Reflect data points inside surfVerts.
Defines a boundary condition.
FaceSharedPtr GetFaceLink()
Get correspondence between this element and a face.
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
std::string GetXmlCurveString() const
Generates a string listing the coordinates of all nodes associated with this face.
SpatialDomains::SegGeomSharedPtr GetGeom(int coordDim)
Generate a SpatialDomains::SegGeom object for this edge.
std::vector< std::string > value
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
unsigned int GetDim() const
Returns the expansion dimension of the element.
bool m_reorder
Determines whether items can be reordered.
2D Evenly-spaced points on a Triangle
std::vector< int > GetTagList() const
Access the list of tags associated with this element.
Edge(const Edge &pSrc)
Copies an existing edge.
Represents a face comprised of three or more edges.
void Align(vector< int > vertId)
Align this surface to a given vertex ID.
std::string GetTag() const
Returns the tag which defines the element shape.
int GetBoundaryLink(int i)
Get the location of the boundary face/edge i for this element.
std::string GetXmlCurveString() const
Creates a Nektar++ string listing the coordinates of all the nodes.
Defines a hash function for edges.
unsigned int GetNodeCount() const
Returns the total number of nodes (vertices, edge nodes and face nodes).
NodeSharedPtr m_n1
First vertex node.
std::size_t operator()(FaceSharedPtr const &p) const
static ElementSharedPtr create(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Creates an instance of this class.
A lightweight struct for dealing with high-order triangle alignment.
A 3-dimensional four-faced element.
std::vector< EdgeSharedPtr > m_edge
List of element edges.
boost::shared_ptr< Geometry > GeometrySharedPtr
std::string GetXmlCurveString() const
Generates a string listing the coordinates of all nodes associated with this element.
bool operator==(const Node &pSrc)
Define node equality based on coordinate.
ElementFactory & GetElementFactory()
boost::shared_ptr< PointGeom > PointGeomSharedPtr
2D Nodal Electrostatic Points on a Triangle
unsigned int m_id
ID of composite.
Base class for element definitions.
Provides a generic Factory class.
void SetID(int pId)
Reset the local id;.
bool operator<(const Node &pSrc)
Define node ordering based on ID.
int GetID(void)
Get the local id;.
ElmtConfig m_conf
Contains configuration of the element.