35 #ifndef NEKMESHUTILS_MESHELEMENTS_ELEMENT 36 #define NEKMESHUTILS_MESHELEMENTS_ELEMENT 38 #include <boost/core/ignore_unused.hpp> 50 namespace NekMeshUtils
64 ElmtConfig pConf,
unsigned int pNumNodes,
unsigned int pGotNodes);
266 std::vector<NodeSharedPtr> &nodeList)
const 268 boost::ignore_unused(nodeList);
270 "This function should be implemented at a shape level.");
280 boost::ignore_unused(coordDim);
282 "This function should be implemented at a shape level.");
283 return std::shared_ptr<SpatialDomains::Geometry>();
304 if (edge->m_edgeNodes.size() > 0)
312 if (face->m_faceNodes.size() > 0)
328 #define SWAP_NODE(a) \ 329 lower.m_x = std::min(lower.m_x, a->m_x); \ 330 lower.m_y = std::min(lower.m_y, a->m_y); \ 331 lower.m_z = std::min(lower.m_z, a->m_z); \ 332 upper.m_x = std::max(upper.m_x, a->m_x); \ 333 upper.m_y = std::max(upper.m_y, a->m_y); \ 334 upper.m_z = std::max(upper.m_z, a->m_z); 338 for (
int i = 1; i <
m_vertex.size(); ++i)
344 for (
auto &edgeNode : edge->m_edgeNodes)
351 for (
auto &faceNode : face->m_faceNodes)
357 return std::make_pair(lower, upper);
384 bool justConfig =
false)
386 boost::ignore_unused(order, geom, edgeType, coordDim,
id, justConfig);
388 "This function should be implemented at a shape level.");
398 boost::ignore_unused(edgeId, edge);
400 "This function should be implemented at a shape level.");
409 boost::ignore_unused(i, j);
411 "This function should be implemented at a shape level.");
418 for (i = 0; i <
m_vertex.size(); ++i)
423 for (i = 0; i <
m_edge.size(); ++i)
425 for (j = 0; j <
m_edge[i]->m_edgeNodes.size(); ++j)
428 std::cout << n->m_x <<
" " << n->m_y <<
" " << n->m_z
432 for (i = 0; i <
m_face.size(); ++i)
434 for (j = 0; j <
m_face[i]->m_faceNodes.size(); ++j)
437 std::cout << n->m_x <<
" " << n->m_y <<
" " << n->m_z
448 boost::ignore_unused(inward);
450 "This function should be implemented at a shape level.");
491 typedef std::map<unsigned int, std::vector<ElementSharedPtr> >
ElementMap;
496 std::vector<NodeSharedPtr>,
502 ElementSharedPtr
const &e2);
507 typedef std::shared_ptr<Element>
pT;
517 else if (b.get() == 0)
523 return a->GetId() < b->GetId();
CADObjectSharedPtr m_parentCAD
NEKMESHUTILS_EXPORT void SetEdge(unsigned int p, EdgeSharedPtr pNew, bool descend=true)
Replace an edge in the element.
Basic information about an element.
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
NEKMESHUTILS_EXPORT LibUtilities::PointsType GetCurveType() const
NEKMESHUTILS_EXPORT void SetFace(unsigned int p, FaceSharedPtr pNew)
Replace a face in the element.
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
NEKMESHUTILS_EXPORT void SetBoundaryLink(int i, int j)
Set a correspondence between edge or face i and its representative boundary element m->element[expDim...
bool operator()(const pT a, const pT b) const
NEKMESHUTILS_EXPORT std::string GetTag() const
Returns the tag which defines the element shape.
Define element ordering based on ID.
NEKMESHUTILS_EXPORT std::vector< int > GetTagList() const
Access the list of tags associated with this element.
NEKMESHUTILS_EXPORT bool IsDeformed()
Determines whether an element is deformed by inspecting whether there are any edge, face or volume interior nodes.
NEKMESHUTILS_EXPORT LibUtilities::ShapeType GetShapeType() const
returns the shapetype
NEKMESHUTILS_EXPORT unsigned int GetFaceCount() const
Returns the number of faces.
NEKMESHUTILS_EXPORT FaceSharedPtr GetFace(unsigned int i) const
Access a face.
NEKMESHUTILS_EXPORT void SetEdgeLink(EdgeSharedPtr pLink)
Set a correspondence between this element and an edge (2D boundary element).
std::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
NEKMESHUTILS_EXPORT std::vector< NodeSharedPtr > GetVertexList() const
Access the list of vertex nodes.
ElementFactory & GetElementFactory()
ElmtConfig m_conf
Contains configuration of the element.
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Represents a point in the domain.
std::shared_ptr< Node > NodeSharedPtr
NEKMESHUTILS_EXPORT std::vector< EdgeSharedPtr > GetEdgeList() const
Access the list of edges.
std::vector< int > m_taglist
List of integers specifying properties of the element.
NEKMESHUTILS_EXPORT EdgeSharedPtr GetEdge(unsigned int i) const
Access an edge.
bool operator==(ElmtConfig const &c1, ElmtConfig const &c2)
Compares two element config structs.
std::shared_ptr< Element > pT
NEKMESHUTILS_EXPORT ElmtConfig GetConf() const
Returns the configuration of the element.
std::shared_ptr< Face > FaceSharedPtr
NEKMESHUTILS_EXPORT int GetMaxOrder()
Obtain the order of an element by looking at edges.
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)
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.
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
unsigned int m_dim
Dimension of the element.
NEKMESHUTILS_EXPORT std::string GetXmlCurveString()
Generates a string listing the coordinates of all nodes associated with this element.
NEKMESHUTILS_EXPORT NodeSharedPtr GetVertex(unsigned int i) const
Access a vertex node.
virtual NEKMESHUTILS_EXPORT Array< OneD, NekDouble > Normal(bool inward=false)
returns the normal to the element
NEKMESHUTILS_EXPORT std::vector< NodeSharedPtr > GetVolumeNodes() const
Access the list of volume nodes.
std::shared_ptr< Element > ElementSharedPtr
std::vector< EdgeSharedPtr > m_edge
List of element edges.
std::shared_ptr< Geometry > GeometrySharedPtr
virtual NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
get list of volume interior nodes
NEKMESHUTILS_EXPORT unsigned int GetEdgeCount() const
Returns the number of edges.
NEKMESHUTILS_EXPORT int GetBoundaryLink(int i)
Get the location of the boundary face/edge i for this element.
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...
NEKMESHUTILS_EXPORT unsigned int GetDim() const
Returns the expansion dimension of the element.
NEKMESHUTILS_EXPORT unsigned int GetId() const
Returns the ID of the element (or associated edge or face for boundary elements). ...
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
NEKMESHUTILS_EXPORT void SetVolumeNodes(std::vector< NodeSharedPtr > &nodes)
NEKMESHUTILS_EXPORT bool HasBoundaryLinks()
Is this element connected to a boundary.
NEKMESHUTILS_EXPORT std::pair< Node, Node > GetBoundingBox()
Returns the approximate bounding box of this element based on the coordinates of all vertices...
std::string m_tag
Tag character describing the element.
NEKMESHUTILS_EXPORT EdgeSharedPtr GetEdgeLink()
Get correspondence between this element and an edge.
virtual NEKMESHUTILS_EXPORT std::string GetXmlString()
Generate a list of vertices (1D), edges (2D), or faces (3D).
NEKMESHUTILS_EXPORT void SetVertex(unsigned int p, NodeSharedPtr pNew, bool descend=true)
Replace a vertex in the element.
std::shared_ptr< CADObject > CADObjectSharedPtr
NEKMESHUTILS_EXPORT Element(ElmtConfig pConf, unsigned int pNumNodes, unsigned int pGotNodes)
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
NEKMESHUTILS_EXPORT void SetFaceLink(FaceSharedPtr pLink)
Set a correspondence between this element and a face (3D boundary element).
NEKMESHUTILS_EXPORT unsigned int GetVertexCount() const
Returns the number of vertices.
unsigned int m_id
ID of the element.
#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.
virtual NEKMESHUTILS_EXPORT void MakeOrder(int order, SpatialDomains::GeometrySharedPtr geom, LibUtilities::PointsType edgeType, int coordDim, int &id, bool justConfig=false)
Insert interior (i.e. volume) points into this element to make the geometry an order order representa...
LibUtilities::PointsType m_curveType
Volume curve type.
std::vector< FaceSharedPtr > m_face
List of element faces.
NEKMESHUTILS_EXPORT void Print()
NEKMESHUTILS_EXPORT std::vector< FaceSharedPtr > GetFaceList() const
Access the list of faces.
Nektar::LibUtilities::NekFactory< LibUtilities::ShapeType, Element, ElmtConfig, std::vector< NodeSharedPtr >, std::vector< int > > ElementFactory
Element factory definition.
NEKMESHUTILS_EXPORT FaceSharedPtr GetFaceLink()
Get correspondence between this element and a face.
LibUtilities::ShapeType m_e
Element type (e.g. triangle, quad, etc).
NEKMESHUTILS_EXPORT unsigned int GetNodeCount()
Returns the total number of nodes (vertices, edge nodes and face nodes and volume nodes)...
virtual NEKMESHUTILS_EXPORT int GetFaceVertex(int i, int j)
Returns the local index of vertex j of face i.
Base class for element definitions.
Provides a generic Factory class.