36 #include <loki/Singleton.h>
44 namespace NekMeshUtils
49 typedef Loki::SingletonHolder<
ElementFactory, Loki::CreateUsingNew,
50 Loki::NoDestroy> Type;
51 return Type::Instance();
54 Element::Element(
ElmtConfig pConf,
unsigned int pNumNodes,
55 unsigned int pGotNodes)
58 if (pNumNodes != pGotNodes)
60 cerr <<
"Number of modes mismatch for type " << pConf.
m_e
61 <<
"! Should be " << pNumNodes <<
" but got " << pGotNodes
81 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
83 if (
m_edge[i]->m_n1 == vOld)
87 else if (
m_edge[i]->m_n2 == vOld)
92 for (
unsigned int i = 0; i <
m_face.size(); ++i)
95 for (
unsigned int j = 0; j <
m_face[i]->m_vertexList.size(); ++j)
97 if (
m_face[i]->m_vertexList[j] == vOld)
99 m_face[i]->m_vertexList[j] = pNew;
102 for (
unsigned int j = 0; j <
m_face[i]->m_edgeList.size(); ++j)
104 if (
m_face[i]->m_edgeList[j]->m_n1 == vOld)
106 m_face[i]->m_edgeList[j]->m_n1 = pNew;
108 else if (
m_face[i]->m_edgeList[j]->m_n2 == vOld)
110 m_face[i]->m_edgeList[j]->m_n2 = pNew;
129 for (
unsigned int i = 0; i <
m_face.size(); ++i)
131 for (
unsigned int j = 0; j <
m_face[i]->m_edgeList.size(); ++j)
133 if (
m_face[i]->m_edgeList[j] == vOld)
135 m_face[i]->m_edgeList[j] = pNew;
161 for (i = 0; i <
m_edge.size(); ++i)
163 int edgeOrder =
m_edge[i]->GetNodeCount() - 1;
Basic information about an element.
NEKMESHUTILS_EXPORT int GetMaxOrder()
Obtain the order of an element by looking at edges.
ElementFactory & GetElementFactory()
NEKMESHUTILS_EXPORT void SetFace(unsigned int p, FaceSharedPtr pNew)
Replace a face with another face object.
1D Evenly-spaced points using Lagrange polynomial
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
NEKMESHUTILS_EXPORT void SetEdge(unsigned int p, EdgeSharedPtr pNew)
Replace an edge with another edge object.
std::vector< EdgeSharedPtr > m_edge
List of element edges.
boost::shared_ptr< Node > NodeSharedPtr
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
std::vector< FaceSharedPtr > m_face
List of element faces.
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.
NEKMESHUTILS_EXPORT void SetVertex(unsigned int p, NodeSharedPtr pNew)
Replace a vertex with another vertex object.
LibUtilities::ShapeType m_e
Element type (e.g. triangle, quad, etc).
Provides a generic Factory class.