45 namespace NekMeshUtils
56 vector<NodeSharedPtr> pNodeList,
58 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
69 map<pair<int, int>,
int> edgeNodeMap;
70 map<pair<int, int>,
int>::iterator it;
71 edgeNodeMap[pair<int, int>(1, 2)] = 4;
72 edgeNodeMap[pair<int, int>(2, 3)] = 4 + n;
73 edgeNodeMap[pair<int, int>(3, 1)] = 4 + 2 * n;
78 for (
int i = 0; i < 3; ++i)
82 sum += (pNodeList[o]->m_x - pNodeList[i]->m_x) *
83 (pNodeList[o]->m_y + pNodeList[i]->m_y);
87 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
89 vector<NodeSharedPtr> edgeNodes;
92 for (
int j = it->second; j < it->second + n; ++j)
94 edgeNodes.push_back(pNodeList[j - 1]);
98 pNodeList[it->first.second - 1],
125 for (
int i = 0; i < 3; ++i)
127 edges[i] =
m_edge[i]->GetGeom(coordDim);
139 int locVert = edgeId;
140 if (edge->m_n1 ==
m_vertex[locVert])
144 else if (edge->m_n2 ==
m_vertex[locVert])
150 ASSERTL1(
false,
"Edge is not connected to this triangle.");
163 return (n + 1) + 2 * (n - 1) + 1;
165 return (n + 1) * (n + 2) / 2;
170 int n =
m_edge[0]->GetNodeCount();
171 nodeList.resize(n * (n + 1) / 2);
175 for (
int i = 0; i < 3; ++i)
178 m_edge[i]->m_edgeNodes.end(),
179 nodeList.begin() + 3 + i * (n - 2));
184 std::reverse(nodeList.begin() + 3 + i * (n - 2),
185 nodeList.begin() + 3 + (i + 1) * (n - 2));
192 nodeList.begin() + 3 * (n - 1));
209 if (order == 1 || order == 2)
222 int nPoints = order + 1;
232 for (
int i = 0; i < coordDim; ++i)
235 xmap->BwdTrans(geom->GetCoeffs(i), phys[i]);
238 const int nTriPts = nPoints * (nPoints + 1) / 2;
239 const int nTriIntPts = (nPoints - 3) * (nPoints - 2) / 2;
242 for (
int i = 3 + 3*(nPoints-2), cnt = 0; i < nTriPts; ++i, ++cnt)
249 for (
int j = 0; j < coordDim; ++j)
251 x[j] = xmap->PhysEvaluate(xp, phys[j]);
255 new Node(
id++, x[0], x[1], x[2]));
274 NekDouble mt = ret[0] * ret[0] + ret[1] * ret[1] + ret[2] * ret[2];
bool m_faceNodes
Denotes whether the element contains face nodes. For 2D elements, if this is true then the element co...
CADObjectSharedPtr m_parentCAD
Basic information about an element.
Represents an edge which joins two points.
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
unsigned int GetPointsDim() const
std::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
ElementFactory & GetElementFactory()
ElmtConfig m_conf
Contains configuration of the element.
virtual NEKMESHUTILS_EXPORT void MakeOrder(int order, SpatialDomains::GeometrySharedPtr geom, LibUtilities::PointsType pType, int coordDim, int &id, bool justConfig=false)
Insert interior (i.e. volume) points into this element to make the geometry an order order representa...
std::vector< int > m_taglist
List of integers specifying properties of the element.
LibUtilities::PointsType m_edgeCurveType
Distribution of points in edges.
unsigned int m_order
Order of the element.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
std::shared_ptr< TriGeom > TriGeomSharedPtr
unsigned int m_dim
Dimension of the element.
bool m_volumeNodes
Denotes whether the element contains volume (i.e. interior) nodes. These are not supported by either ...
std::vector< EdgeSharedPtr > m_edge
List of element edges.
std::shared_ptr< Geometry > GeometrySharedPtr
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
PointsManagerT & PointsManager(void)
virtual NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
get list of volume interior nodes
static NEKMESHUTILS_EXPORT unsigned int GetNumNodes(ElmtConfig pConf)
Return the number of nodes defining a triangle.
Defines a specification for a set of points.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
std::string m_tag
Tag character describing the element.
unsigned int m_id
ID of the 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...
LibUtilities::PointsType m_curveType
Volume curve type.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
bool m_reorient
Denotes whether the element needs to be re-orientated for a spectral element framework.
NEKMESHUTILS_EXPORT Array< OneD, NekDouble > Normal(bool inward=false)
returns the normal to the element
2D Evenly-spaced points on a Triangle
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
std::shared_ptr< SegGeom > SegGeomSharedPtr
Base class for element definitions.