48namespace SpatialDomains
58 :
Geometry2D(edges[0]->GetVertex(0)->GetCoordim(), curve)
81 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
96 for (
int i = 0; i <
kNedges; i++)
114 return m_xmap->PhysEvaluate(Lcoord, tmp);
131 int i, j, vmap[3] = {-1, -1, -1};
137 for (i = 0; i < 3; ++i)
139 rotPt.
Rotate((*face1[i]), dir, angle);
140 for (j = 0; j < 3; ++j)
142 if (rotPt.
dist(*face2[j]) < tol)
153 NekDouble x, y,
z, x1, y1, z1, cx = 0.0, cy = 0.0, cz = 0.0;
159 for (i = 0; i < 3; ++i)
161 cx += (*face2[i])(0) - (*face1[i])(0);
162 cy += (*face2[i])(1) - (*face1[i])(1);
163 cz += (*face2[i])(2) - (*face1[i])(2);
172 for (i = 0; i < 3; ++i)
177 for (j = 0; j < 3; ++j)
179 x1 = (*face2[j])(0) - cx;
180 y1 = (*face2[j])(1) - cy;
181 z1 = (*face2[j])(2) - cz;
182 if (
sqrt((x1 - x) * (x1 - x) + (y1 - y) * (y1 - y) +
183 (z1 -
z) * (z1 -
z)) < 1e-8)
192 if (vmap[1] == (vmap[0] + 1) % 3)
223 ASSERTL0(
false,
"Unable to determine triangle orientation");
242 if (
m_xmap->GetBasisNumModes(0) != 2 ||
243 m_xmap->GetBasisNumModes(1) != 2)
259 double tmp = std::fabs(norm[0]);
260 if (tmp < fabs(norm[1]))
265 if (tmp < fabs(norm[2]))
275 for (
int i = 0; i <
m_verts.size(); ++i)
278 m_verts[i]->GetCoords(verts[i]);
283 for (
int i = 0; i < 2; ++i)
318 int nEdgeCoeffs =
m_xmap->GetTraceNcoeffs(0);
331 int N =
m_curve->m_points.size();
335 ASSERTL0(nEdgePts * (nEdgePts + 1) / 2 == N,
336 "NUMPOINTS should be a triangle number for"
337 " triangle curved face " +
342 for (i = 0; i < 3; ++i)
347 std::stringstream ss;
348 ss <<
"Curved vertex " << i <<
" of triangle " <<
m_globalID
349 <<
" is separated from expansion vertex by"
351 <<
" (dist = " << dist <<
")";
362 ASSERTL0(edgeCurve->m_points.size() == nEdgePts,
363 "Number of edge points does not correspond "
364 "to number of face points in triangle " +
367 const int offset = 3 + i * (nEdgePts - 2);
383 for (j = 0; j < nEdgePts - 2; ++j)
386 *(edgeCurve->m_points[j + 1]));
387 maxDist = dist > maxDist ? dist : maxDist;
392 for (j = 0; j < nEdgePts - 2; ++j)
395 *(edgeCurve->m_points[nEdgePts - 2 - j]));
396 maxDist = dist > maxDist ? dist : maxDist;
402 std::stringstream ss;
403 ss <<
"Curved edge " << i <<
" of triangle " <<
m_globalID
404 <<
" has a point separated from edge interior"
405 <<
" points by more than "
407 <<
" (maxdist = " << maxDist <<
")";
415 nEdgePts, LibUtilities::eGaussRadauMAlpha1Beta0);
421 max(nEdgePts * nEdgePts,
m_xmap->GetTotPoints()));
431 for (j = 0; j < N; ++j)
433 phys[j] = (
m_curve->m_points[j]->GetPtr())[i];
436 t->BwdTrans(phys, tmp);
440 P0, P1, tmp,
m_xmap->GetBasis(0)->GetPointsKey(),
441 m_xmap->GetBasis(1)->GetPointsKey(), phys);
449 int npts =
m_curve->m_points.size();
458 ASSERTL0(nEdgePts * nEdgePts == npts,
459 "NUMPOINTS should be a square number for"
466 "Number of edge points does not correspond to "
467 "number of face points in triangle " +
473 for (j = 0; j < npts; ++j)
475 tmp[j] = (
m_curve->m_points[j]->GetPtr())[i];
481 m_xmap->GetBasis(0)->GetPointsKey(),
482 m_xmap->GetBasis(1)->GetPointsKey(),
491 ASSERTL0(
false,
"Only 1D/2D points distributions "
504 nEdgeCoeffs =
m_edges[i]->GetXmap()->GetNcoeffs();
508 for (k = 0; k < nEdgeCoeffs; k++)
511 signArray[k] *
m_edges[i]->GetCoeffs(j)[k];
521 boost::ignore_unused(j);
523 return i == 0 ? 0 : 1;
529 CurveMap::iterator it = curvedFaces.find(
m_globalID);
531 if (it != curvedFaces.end())
536 for (
int i = 0; i < 3; ++i)
538 m_edges[i]->Reset(curvedEdges, curvedFaces);
549 for (
int i = 0; i < 3; ++i)
561 int order0 =
m_edges[0]->GetXmap()->GetBasis(0)->GetNumModes();
563 max(order0, max(
m_edges[1]->
GetXmap()->GetBasis(0)->GetNumModes(),
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG 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.
Array< OneD, int > m_manifold
std::vector< StdRegions::Orientation > m_eorient
virtual void v_CalculateInverseIsoParam() override
bool m_setupState
Wether or not the setup routines have been run.
PointGeomSharedPtr GetVertex(int i) const
Returns vertex i of this object.
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...
LibUtilities::ShapeType m_shapeType
Type of shape.
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
GeomState m_geomFactorsState
State of the geometric factors.
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...
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
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
void Rotate(PointGeom &a, int dir, NekDouble angle)
_this = rotation of a by angle 'angle' around axis dir
NekDouble dist(PointGeom &a)
return distance between this and input a
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
static const int kNedges
Get the orientation of face1.
virtual void v_GenGeomFactors() override
virtual 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)
virtual void v_FillGeom() override
virtual 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.
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
virtual void v_Setup() override
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,...
@ 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
std::vector< PointGeomSharedPtr > PointGeomVector
std::shared_ptr< Curve > CurveSharedPtr
std::unordered_map< int, CurveSharedPtr > 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.
std::shared_ptr< SegGeom > SegGeomSharedPtr
@ 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)
std::vector< double > d(NPUPPER *NPUPPER)
The above copyright notice and this permission notice shall be included.
scalarT< T > sqrt(scalarT< T > in)