46 namespace NekMeshUtils
57 vector<NodeSharedPtr> pNodeList,
59 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
70 map<pair<int, int>,
int> edgeNodeMap;
72 edgeNodeMap[pair<int, int>(1, 2)] = 4;
73 edgeNodeMap[pair<int, int>(2, 3)] = 4 + n;
74 edgeNodeMap[pair<int, int>(3, 1)] = 4 + 2 * n;
79 for (
int i = 0; i < 3; ++i)
83 sum += (pNodeList[o]->m_x - pNodeList[i]->m_x) *
84 (pNodeList[o]->m_y + pNodeList[i]->m_y);
88 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
90 vector<NodeSharedPtr> edgeNodes;
93 for (
int j = it->second; j < it->second + n; ++j)
95 edgeNodes.push_back(pNodeList[j - 1]);
99 pNodeList[it->first.second - 1],
126 for (
int i = 0; i < 3; ++i)
128 edges[i] =
m_edge[i]->GetGeom(coordDim);
129 verts[i] =
m_vertex[i]->GetGeom(coordDim);
138 m_id, verts, edges, edgeorient);
145 int locVert = edgeId;
146 if (edge->m_n1 ==
m_vertex[locVert])
150 else if (edge->m_n2 ==
m_vertex[locVert])
156 ASSERTL1(
false,
"Edge is not connected to this triangle.");
169 return (n + 1) + 2 * (n - 1) + 1;
171 return (n + 1) * (n + 2) / 2;
176 int n =
m_edge[0]->GetNodeCount();
177 nodeList.resize(n * (n + 1) / 2);
181 for (
int i = 0; i < 3; ++i)
184 m_edge[i]->m_edgeNodes.end(),
185 nodeList.begin() + 3 + i * (n - 2));
190 std::reverse(nodeList.begin() + 3 + i * (n - 2),
191 nodeList.begin() + 3 + (i + 1) * (n - 2));
198 nodeList.begin() + 3 * (n - 1));
215 if (order == 1 || order == 2)
228 int nPoints = order + 1;
238 for (
int i = 0; i < coordDim; ++i)
241 xmap->BwdTrans(geom->GetCoeffs(i), phys[i]);
244 const int nTriPts = nPoints * (nPoints + 1) / 2;
245 const int nTriIntPts = (nPoints - 3) * (nPoints - 2) / 2;
248 for (
int i = 3 + 3*(nPoints-2), cnt = 0; i < nTriPts; ++i, ++cnt)
255 for (
int j = 0; j < coordDim; ++j)
257 x[j] = xmap->PhysEvaluate(xp, phys[j]);
261 new Node(
id++, x[0], x[1], x[2]));
280 NekDouble mt = ret[0] * ret[0] + ret[1] * ret[1] + ret[2] * ret[2];
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
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.
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...
Represents an edge which joins two points.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
ElementFactory & GetElementFactory()
ElmtConfig m_conf
Contains configuration of the element.
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
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::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
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 ...
boost::shared_ptr< SegGeom > SegGeomSharedPtr
std::vector< EdgeSharedPtr > m_edge
List of element edges.
unsigned int GetPointsDim() const
PointsManagerT & PointsManager(void)
Defines a specification for a set of points.
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
static NEKMESHUTILS_EXPORT unsigned int GetNumNodes(ElmtConfig pConf)
Return the number of nodes defining a triangle.
std::string m_tag
Tag character describing the element.
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
NEKMESHUTILS_EXPORT Array< OneD, NekDouble > Normal(bool inward=false)
returns the normal to 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...
unsigned int m_id
ID of the element.
boost::shared_ptr< TriGeom > TriGeomSharedPtr
LibUtilities::PointsType m_curveType
Volume curve type.
bool m_reorient
Denotes whether the element needs to be re-orientated for a spectral element framework.
2D Evenly-spaced points on a Triangle
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< Geometry > GeometrySharedPtr
virtual NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
get list of volume interior nodes
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Base class for element definitions.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.