36 #ifndef NekMeshUtils_MESHELEMENTS_ELEMENT
37 #define NekMeshUtils_MESHELEMENTS_ELEMENT
50 namespace NekMeshUtils
64 bool pReorient =
true,
119 ElmtConfig pConf,
unsigned int pNumNodes,
unsigned int pGotNodes);
208 for (
int i = 0; i <
m_edge.size(); ++i)
210 n +=
m_edge[i]->GetNodeCount();
216 std::cerr <<
"Not supported." << std::endl;
305 for (
int j = 0; j <
m_vertex.size(); ++j)
307 s << std::setw(5) <<
m_vertex[j]->m_id <<
" ";
311 for (
int j = 0; j <
m_edge.size(); ++j)
313 s << std::setw(5) <<
m_edge[j]->m_id <<
" ";
317 for (
int j = 0; j <
m_face.size(); ++j)
319 s << std::setw(5) <<
m_face[j]->m_id <<
" ";
327 std::vector<NodeSharedPtr> &nodeList)
const
342 int n =
m_edge[0]->GetNodeCount();
343 nodeList.resize(n * (n + 1) / 2);
347 for (
int i = 0; i < 3; ++i)
349 std::copy(
m_edge[i]->m_edgeNodes.begin(),
350 m_edge[i]->m_edgeNodes.end(),
351 nodeList.begin() + 3 + i * (n - 2));
356 std::reverse(nodeList.begin() + 3 + i * (n - 2),
357 nodeList.begin() + 3 + (i + 1) * (n - 2));
364 nodeList.begin() + 3 * (n - 1));
369 int n =
m_edge[0]->GetNodeCount();
370 nodeList.resize(n * n);
376 nodeList[n * (n - 1)] =
m_vertex[3];
380 {0, 1}, {n - 1, n}, {n * n - 1, -1}, {n * (n - 1), -n}};
381 for (
int i = 0; i < 4; ++i)
387 for (
int j = 1; j < n - 1; ++j)
389 nodeList[skips[i][0] + j * skips[i][1]] =
390 m_edge[i]->m_edgeNodes[n - 2 - j];
395 for (
int j = 1; j < n - 1; ++j)
397 nodeList[skips[i][0] + j * skips[i][1]] =
398 m_edge[i]->m_edgeNodes[j - 1];
404 for (
int i = 1; i < n - 1; ++i)
406 for (
int j = 1; j < n - 1; ++j)
408 nodeList[i * n + j] =
415 std::cerr <<
"GetXmlCurveString for a " <<
m_vertex.size()
416 <<
"-vertex element is not yet implemented."
426 std::vector<NodeSharedPtr> nodeList;
434 for (
int k = 0; k < nodeList.size(); ++k)
436 s << std::scientific << std::setprecision(8) <<
" "
437 << nodeList[k]->m_x <<
" " << nodeList[k]->m_y <<
" "
438 << nodeList[k]->m_z <<
" ";
448 "This function should be implemented at a shape level.");
449 return boost::shared_ptr<SpatialDomains::Geometry>();
456 "This function should be implemented at a shape level.");
461 for (i = 0; i <
m_vertex.size(); ++i)
466 for (i = 0; i <
m_edge.size(); ++i)
468 for (j = 0; j <
m_edge[i]->m_edgeNodes.size(); ++j)
471 std::cout << n->m_x <<
" " << n->m_y <<
" " << n->m_z
475 for (i = 0; i <
m_face.size(); ++i)
477 for (j = 0; j <
m_face[i]->m_faceNodes.size(); ++j)
480 std::cout << n->m_x <<
" " << n->m_y <<
" " << n->m_z
486 #ifdef NEKTAR_USE_MESHGEN
525 typedef std::map<unsigned int, std::vector<ElementSharedPtr> >
ElementMap;
530 std::vector<NodeSharedPtr>,
538 typedef boost::shared_ptr<Element>
pT;
548 else if (b.get() == 0)
554 return a->GetId() < b->GetId();
bool m_faceNodes
Denotes whether the element contains face nodes. For 2D elements, if this is true then the element co...
NEKMESHUTILS_EXPORT unsigned int GetDim() const
Returns the expansion dimension of the element.
NEKMESHUTILS_EXPORT std::string GetTag() const
Returns the tag which defines the element shape.
#define ASSERTL0(condition, msg)
Basic information about an element.
LibUtilities::PointsType m_faceCurveType
Distribution of points in faces.
NEKMESHUTILS_EXPORT unsigned int GetEdgeCount() const
Returns the number of edges.
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
NEKMESHUTILS_EXPORT unsigned int GetNodeCount() const
Returns the total number of nodes (vertices, edge nodes and face nodes and volume nodes)...
NEKMESHUTILS_EXPORT void SetBoundaryLink(int i, int j)
Set a correspondence between edge or face i and its representative boundary element m->element[expDim...
NEKMESHUTILS_EXPORT int GetMaxOrder()
Obtain the order of an element by looking at edges.
ElmtConfig(ElmtConfig const &p)
NEKMESHUTILS_EXPORT LibUtilities::PointsType GetCurveType() const
Define element ordering based on ID.
NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
NEKMESHUTILS_EXPORT void SetEdgeLink(EdgeSharedPtr pLink)
Set a correspondence between this element and an edge (2D boundary element).
virtual NEKMESHUTILS_EXPORT void Complete(int order)
Complete this object.
ElementFactory & GetElementFactory()
ElmtConfig m_conf
Contains configuration of the element.
NEKMESHUTILS_EXPORT unsigned int GetId() const
Returns the ID of the element (or associated edge or face for boundary elements). ...
NEKMESHUTILS_EXPORT void SetFace(unsigned int p, FaceSharedPtr pNew)
Replace a face with another face object.
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
NEKMESHUTILS_EXPORT EdgeSharedPtr GetEdge(unsigned int i) const
Access an edge.
std::vector< int > m_taglist
List of integers specifying properties of the element.
bool operator()(const pT a, const pT b) const
bool operator==(ElmtConfig const &c1, ElmtConfig const &c2)
LibUtilities::PointsType m_edgeCurveType
Distribution of points in edges.
unsigned int m_order
Order of the element.
NEKMESHUTILS_EXPORT unsigned int GetFaceCount() const
Returns the number of faces.
1D Evenly-spaced points using Lagrange polynomial
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
NEKMESHUTILS_EXPORT void SetCurveType(LibUtilities::PointsType cT)
boost::shared_ptr< Element > pT
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
NEKMESHUTILS_EXPORT void SetTagList(const std::vector< int > &tags)
Set the list of tags associated with this element.
NEKMESHUTILS_EXPORT std::vector< NodeSharedPtr > GetVertexList() const
Access the list of vertex nodes.
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
unsigned int m_dim
Dimension of the element.
NEKMESHUTILS_EXPORT NodeSharedPtr GetVertex(unsigned int i) const
Access a vertex node.
bool m_volumeNodes
Denotes whether the element contains volume (i.e. interior) nodes. These are not supported by either ...
NEKMESHUTILS_EXPORT void SetEdge(unsigned int p, EdgeSharedPtr pNew)
Replace an edge with another edge object.
NEKMESHUTILS_EXPORT FaceSharedPtr GetFace(unsigned int i) const
Access a face.
std::vector< EdgeSharedPtr > m_edge
List of element edges.
boost::shared_ptr< Node > NodeSharedPtr
NEKMESHUTILS_EXPORT int GetBoundaryLink(int i)
Get the location of the boundary face/edge i for this element.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
NEKMESHUTILS_EXPORT void SetVolumeNodes(std::vector< NodeSharedPtr > &nodes)
std::string m_tag
Tag character describing the element.
NEKMESHUTILS_EXPORT EdgeSharedPtr GetEdgeLink()
Get correspondence between this element and an edge.
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
NEKMESHUTILS_EXPORT std::string GetXmlCurveString() const
Generates a string listing the coordinates of all nodes associated with this element.
ElmtConfig(LibUtilities::ShapeType pE, unsigned int pOrder, bool pFn, bool pVn, bool pReorient=true, LibUtilities::PointsType pECt=LibUtilities::ePolyEvenlySpaced, LibUtilities::PointsType pFCt=LibUtilities::ePolyEvenlySpaced)
NEKMESHUTILS_EXPORT void SetFaceLink(FaceSharedPtr pLink)
Set a correspondence between this element and a face (3D boundary element).
NEKMESHUTILS_EXPORT std::vector< EdgeSharedPtr > GetEdgeList() const
Access the list of edges.
NEKMESHUTILS_EXPORT Element(ElmtConfig pConf, unsigned int pNumNodes, unsigned int pGotNodes)
unsigned int m_id
ID of the element.
NEKMESHUTILS_EXPORT std::vector< NodeSharedPtr > GetVolumeNodes() const
Access the list of volume nodes.
#define NEKMESHUTILS_EXPORT
std::map< unsigned int, std::vector< ElementSharedPtr > > ElementMap
Container for elements; key is expansion dimension, value is vector of elements of that dimension...
NEKMESHUTILS_EXPORT void SetId(unsigned int p)
Change the ID of the element.
LibUtilities::PointsType m_curveType
Volume curve type.
std::vector< FaceSharedPtr > m_face
List of element faces.
NEKMESHUTILS_EXPORT std::vector< FaceSharedPtr > GetFaceList() const
Access the list of faces.
NEKMESHUTILS_EXPORT void Print()
NEKMESHUTILS_EXPORT std::vector< int > GetTagList() const
Access the list of tags associated with this element.
bool m_reorient
Denotes whether the element needs to be re-orientated for a spectral element framework.
boost::shared_ptr< Element > ElementSharedPtr
NEKMESHUTILS_EXPORT ElmtConfig GetConf() const
Returns the configuration of the element.
boost::shared_ptr< Face > FaceSharedPtr
Shared pointer to a face.
Nektar::LibUtilities::NekFactory< LibUtilities::ShapeType, Element, ElmtConfig, std::vector< NodeSharedPtr >, std::vector< int > > ElementFactory
Element factory definition.
virtual NEKMESHUTILS_EXPORT std::string GetXmlString() const
Generate a list of vertices (1D), edges (2D), or faces (3D).
NEKMESHUTILS_EXPORT void SetVertex(unsigned int p, NodeSharedPtr pNew)
Replace a vertex with another vertex object.
boost::shared_ptr< Geometry > GeometrySharedPtr
NEKMESHUTILS_EXPORT FaceSharedPtr GetFaceLink()
Get correspondence between this element and a face.
LibUtilities::ShapeType m_e
Element type (e.g. triangle, quad, etc).
Base class for element definitions.
Provides a generic Factory class.
NEKMESHUTILS_EXPORT unsigned int GetVertexCount() const
Returns the number of vertices.