61 :
Geometry2D(edges[0]->GetVertex(0)->GetCoordim(), curve)
83 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
101 for (
int i = 0; i <
kNedges; i++)
117 int i0 = 1, i1 = 0, direction = 1;
118 for (
size_t i = 0; i <
m_verts.size(); ++i)
133 for (
size_t i = 0; i <
m_verts.size(); ++i)
150 for (
size_t i = 0; i <
m_verts.size(); ++i)
162 for (
size_t i = 0; i <
m_verts.size(); ++i)
164 int i1 = (i + 1) %
m_verts.size();
171 m_verts[i1]->GetCoords(vertex);
204 return m_xmap->PhysEvaluate(Lcoord, tmp);
218 std::array<PointGeom *, 3> face1, std::array<PointGeom *, 3> face2,
221 int i, j, vmap[3] = {-1, -1, -1};
227 for (i = 0; i < 3; ++i)
229 rotPt.Rotate((*face1[i]), dir, angle);
230 for (j = 0; j < 3; ++j)
232 if (rotPt.dist(*face2[j]) < tol)
243 NekDouble x, y,
z, x1, y1, z1, cx = 0.0, cy = 0.0, cz = 0.0;
249 for (i = 0; i < 3; ++i)
251 cx += (*face2[i])(0) - (*face1[i])(0);
252 cy += (*face2[i])(1) - (*face1[i])(1);
253 cz += (*face2[i])(2) - (*face1[i])(2);
262 for (i = 0; i < 3; ++i)
267 for (j = 0; j < 3; ++j)
269 x1 = (*face2[j])(0) - cx;
270 y1 = (*face2[j])(1) - cy;
271 z1 = (*face2[j])(2) - cz;
272 if (
sqrt((x1 - x) * (x1 - x) + (y1 - y) * (y1 - y) +
273 (z1 - z) * (z1 -
z)) < 1e-8)
282 if (vmap[1] == (vmap[0] + 1) % 3)
327 if (
m_xmap->GetBasisNumModes(0) != 2 ||
m_xmap->GetBasisNumModes(1) != 2)
342 double tmp = std::fabs(norm[0]);
343 if (tmp < fabs(norm[1]))
348 if (tmp < fabs(norm[2]))
359 for (
int i = 0; i <
m_verts.size(); ++i)
362 m_verts[i]->GetCoords(verts[i]);
367 for (
int i = 0; i < 2; ++i)
411 int nEdgeCoeffs =
m_xmap->GetTraceNcoeffs(0);
428 ASSERTL0(nEdgePts * (nEdgePts + 1) / 2 == N,
429 "NUMPOINTS should be a triangle number for"
430 " triangle curved face " +
435 for (i = 0; i < 3; ++i)
440 std::stringstream ss;
441 ss <<
"Curved vertex " << i <<
" of triangle " <<
m_globalID
442 <<
" is separated from expansion vertex by"
444 <<
" (dist = " << dist <<
")";
456 "Number of edge points does not correspond "
457 "to number of face points in triangle " +
460 const int offset = 3 + i * (nEdgePts - 2);
476 for (j = 0; j < nEdgePts - 2; ++j)
480 maxDist = dist > maxDist ? dist : maxDist;
485 for (j = 0; j < nEdgePts - 2; ++j)
488 *(edgeCurve->
m_points[nEdgePts - 2 - j]));
489 maxDist = dist > maxDist ? dist : maxDist;
495 std::stringstream ss;
496 ss <<
"Curved edge " << i <<
" of triangle " <<
m_globalID
497 <<
" has a point separated from edge interior"
498 <<
" points by more than "
500 <<
" (maxdist = " << maxDist <<
")";
508 nEdgePts, LibUtilities::eGaussRadauMAlpha1Beta0);
514 std::max(nEdgePts * nEdgePts,
m_xmap->GetTotPoints()));
524 for (j = 0; j < N; ++j)
529 t->BwdTrans(phys, tmp);
533 P0, P1, tmp,
m_xmap->GetBasis(0)->GetPointsKey(),
534 m_xmap->GetBasis(1)->GetPointsKey(), phys);
551 ASSERTL0(nEdgePts * nEdgePts == npts,
552 "NUMPOINTS should be a square number for"
559 "Number of edge points does not correspond to "
560 "number of face points in triangle " +
566 for (j = 0; j < npts; ++j)
574 m_xmap->GetBasis(0)->GetPointsKey(),
575 m_xmap->GetBasis(1)->GetPointsKey(),
597 nEdgeCoeffs =
m_edges[i]->GetXmap()->GetNcoeffs();
601 for (k = 0; k < nEdgeCoeffs; k++)
604 signArray[k] *
m_edges[i]->GetCoeffs(j)[k];
614 return i == 0 ? 0 : 1;
620 CurveMap::iterator it = curvedFaces.find(
m_globalID);
622 if (it != curvedFaces.end())
627 for (
int i = 0; i < 3; ++i)
629 m_edges[i]->Reset(curvedEdges, curvedFaces);
640 for (
int i = 0; i < 3; ++i)
649 if (
m_xmap->GetBasisNumModes(0) != 2 ||
650 m_xmap->GetBasisNumModes(1) != 2)
661 int order0 =
m_edges[0]->GetXmap()->GetBasis(0)->GetNumModes();
662 int order1 = std::max(
663 order0, std::max(
m_edges[1]->
GetXmap()->GetBasis(0)->GetNumModes(),
666 std::array<LibUtilities::BasisKey, 2> basis = {
674 LibUtilities::eGaussRadauMAlpha1Beta0))};
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Describes the specification for a Basis.
Defines a specification for a set of points.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)
Array< OneD, int > m_manifold
Array< OneD, Array< OneD, NekDouble > > m_edgeNormal
void v_CalculateInverseIsoParam() override
bool m_setupState
Wether or not the setup routines have been run.
GeomState m_state
Enumeration to dictate whether coefficients are filled.
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
int GetGlobalID(void) const
Get the ID of this object.
std::vector< Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
LibUtilities::ShapeType m_shapeType
Type of shape.
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
int m_coordim
Coordinate dimension of this geometry object.
void Sub(PointGeom &a, PointGeom &b)
void Mult(PointGeom &a, PointGeom &b)
_this = a x b
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
std::array< PointGeom *, kNverts > m_verts
int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
static StdRegions::Orientation GetFaceOrientation(const TriGeom &face1, const TriGeom &face2, bool doRot, int dir, NekDouble angle, NekDouble tol)
Get the orientation of face1.
int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord) override
void v_FillGeom() override
std::array< SegGeom *, kNedges > m_edges
NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord) override
Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i.
void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt) override
Used by Expansion to generate associated GeomFactors.
GeomType v_CalcGeomType() override
std::array< StdRegions::Orientation, kNedges > m_eorient
A simple factory for Xmap objects that is based on the element type, the basis and quadrature selecti...
PointsManagerT & PointsManager(void)
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
std::vector< PointsKey > PointsKeyVector
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModified_B
Principle Modified Functions .
@ eOrtho_A
Principle Orthogonal Functions .
@ eOrtho_B
Principle Orthogonal Functions .
@ eModified_A
Principle Modified Functions .
static const NekDouble kVertexTheSameDouble
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
std::map< int, CurveUniquePtr > CurveMap
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eDeformed
Geometry is curved or has non-constant factors.
XmapFactory< StdRegions::StdTriExp, 2 > & GetStdTriFactory()
@ ePtsFilled
Geometric information has been generated.
std::shared_ptr< StdNodalTriExp > StdNodalTriExpSharedPtr
@ eDir1BwdDir2_Dir2BwdDir1
@ eDir1FwdDir1_Dir2FwdDir2
@ eDir1BwdDir1_Dir2BwdDir2
@ eDir1BwdDir1_Dir2FwdDir2
@ eDir1FwdDir2_Dir2FwdDir1
@ eDir1FwdDir2_Dir2BwdDir1
std::vector< double > z(NPUPPER)
scalarT< T > sqrt(scalarT< T > in)
LibUtilities::PointsType m_ptype
Points distribution of this curve.
std::vector< PointGeom * > m_points
Points along the curve.