49 namespace SpatialDomains
63 QuadGeom::QuadGeom(
const int id,
87 "Cannot call function with dim == 1");
101 Geometry2D(edges[0]->GetVertex(0)->GetCoordim()),
131 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
133 "Cannot call function with dim == 1");
146 Geometry2D(edges[0]->GetVertex(0)->GetCoordim()),
174 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
176 "Cannot call function with dim == 1");
195 std::list<CompToElmt>::const_iterator def;
204 for (
int i = 0; i <
kNedges; i++)
246 "Geometry is not in physical space");
251 return m_xmap->PhysEvaluate(Lcoord, tmp);
269 int i, j, vmap[4] = {-1,-1,-1,-1};
270 NekDouble x, y, z, x1, y1, z1, cx = 0.0, cy = 0.0, cz = 0.0;
276 for (i = 0; i < 4; ++i)
278 cx += (*face2[i])(0) - (*face1[i])(0);
279 cy += (*face2[i])(1) - (*face1[i])(1);
280 cz += (*face2[i])(2) - (*face1[i])(2);
289 for (i = 0; i < 4; ++i)
294 for (j = 0; j < 4; ++j)
296 x1 = (*face2[j])(0)-cx;
297 y1 = (*face2[j])(1)-cy;
298 z1 = (*face2[j])(2)-cz;
299 if (sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y)+(z1-z)*(z1-z)) < 1e-8)
309 if (vmap[1] == (vmap[0]+1) % 4)
346 ASSERTL0(
false,
"unable to determine face orientation");
375 std::list<CompToElmt>::const_iterator def;
413 return m_xmap->GetBasis(i);
422 ASSERTL1(i <= 3,
"edge is out of range");
424 if (i == 0 || i == 2)
426 return m_xmap->GetBasis(0);
430 return m_xmap->GetBasis(1);
464 if((
m_xmap->GetBasisNumModes(0) != 2)||
465 (
m_xmap->GetBasisNumModes(1) != 2))
539 int nEdgePts = (int)sqrt(static_cast<NekDouble>(npts));
548 ASSERTL0(nEdgePts * nEdgePts == npts,
549 "NUMPOINTS should be a square number in"
557 "Number of edge points does not correspond to "
558 "number of face points in quadrilateral "
564 for (j = 0; j <
npts; ++j)
566 tmp[j] = (
m_curve->m_points[j]->GetPtr())[i];
571 curveKey, curveKey, tmp,
572 m_xmap->GetBasis(0)->GetPointsKey(),
573 m_xmap->GetBasis(1)->GetPointsKey(),
591 nEdgeCoeffs =
m_edges[i]->GetXmap()->GetNcoeffs();
595 for(k = 0; k < nEdgeCoeffs; k++)
598 = signArray[k]*(
m_edges[i]->GetCoeffs(j))[k];
628 orth1.
Mult(norm,dv1);
629 orth2.
Mult(norm,dv2);
636 Lcoords[0] = xin.
dot(orth2)/dv1.
dot(orth2);
637 Lcoords[0] = 2*Lcoords[0]-1;
638 Lcoords[1] = xin.
dot(orth1)/dv2.
dot(orth1);
639 Lcoords[1] = 2*Lcoords[1]-1;
664 Lcoords[0] = za[min_i%za.num_elements()];
665 Lcoords[1] = zb[min_i/za.num_elements()];
679 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
689 ASSERTL2((i >=0) && (i <= 3),
"Verted id must be between 0 and 3");
699 ASSERTL2((i >=0) && (i <= 3),
"Vertex id must be between 0 and 3");
709 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
719 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
729 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
758 for (i=0,edgeIter =
m_edges.begin(); edgeIter !=
m_edges.end(); ++edgeIter,++i)
760 if (*edgeIter == edge)
812 ASSERTL1(gloCoord.num_elements() >= 2,
813 "Two dimensional geometry expects at least two coordinates.");
816 if (stdCoord[0] >= -(1+tol) && stdCoord[1] >= -(1+tol)
817 && stdCoord[0] <= (1+tol) && stdCoord[1] <= (1+tol))
830 if (it != curvedFaces.end())
835 for (
int i = 0; i < 4; ++i)
837 m_edges[i]->Reset(curvedEdges, curvedFaces);
StdRegions::StdExpansionSharedPtr m_xmap
virtual const Geometry1DSharedPtr v_GetEdge(int i) const
#define ASSERTL0(condition, msg)
virtual int v_GetCoordim() const
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
std::vector< PointGeomSharedPtr > PointGeomVector
GeomFactorsSharedPtr m_geomFactors
virtual void v_SetOwnData()
Structure holding graphvertexobject id and local element facet id.
NekDouble dot(PointGeom &a)
int Imin(int n, const T *x, const int incx)
Return the index of the minimum element in x.
virtual int v_NumElmtConnected() const
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
virtual PointGeomSharedPtr v_GetVertex(int i) const
Principle Modified Functions .
void Sub(PointGeom &a, PointGeom &b)
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
StdRegions::StdExpansionSharedPtr GetXmap() const
GeomState m_geomFactorsState
boost::shared_ptr< Curve > CurveSharedPtr
virtual bool v_IsElmtConnected(int gvo_id, int locid) const
virtual int v_GetVid(int i) const
const LibUtilities::BasisSharedPtr GetBasis(const int i)
Return the j-th basis of the i-th co-ordinate dimension.
virtual int v_GetNumEdges() const
std::list< CompToElmt > m_elmtMap
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...
NekDouble GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
static StdRegions::Orientation GetFaceOrientation(const QuadGeom &face1, const QuadGeom &face2)
Get the orientation of face1.
static const NekDouble kNekZeroTol
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
virtual void v_AddElmtConnected(int gvo_id, int locid)
boost::shared_ptr< SegGeom > SegGeomSharedPtr
void NewtonIterationForLocCoord(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, Array< OneD, NekDouble > &Lcoords, NekDouble &resid)
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
virtual StdRegions::Orientation v_GetCartesianEorient(const int i) const
virtual const LibUtilities::BasisSharedPtr v_GetEdgeBasis(const int i)
virtual int v_GetNumVerts() const
virtual int v_GetFid() const
Defines a specification for a set of points.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
PointGeomSharedPtr GetVertex(int i) const
virtual int v_WhichEdge(SegGeomSharedPtr edge)
Return the edge number of the given edge.
void Mult(PointGeom &a, PointGeom &b)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_FillGeom()
Put all quadrature information into edge structure.
Array< OneD, Array< OneD, NekDouble > > m_coeffs
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Geometry is straight-sided with constant geometric factors.
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
NekDouble GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
LibUtilities::ShapeType m_shapeType
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
virtual int v_GetEid(int i) const
boost::unordered_map< int, CurveSharedPtr > CurveMap
Geometric information has been generated.
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
StdRegions::Orientation m_eorient[kNedges]
GeomFactorsSharedPtr GetMetricInfo()
GeomType
Indicates the type of element geometry.
bool m_ownData
Boolean indicating whether object owns the data.
boost::shared_ptr< Basis > BasisSharedPtr
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
GeomState m_state
enum identifier to determine if quad points are filled
virtual StdRegions::Orientation v_GetEorient(const int i) const
virtual const LibUtilities::BasisSharedPtr v_GetBasis(const int i)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Geometry is curved or has non-constant factors.
int m_coordim
coordinate dimension
Describes the specification for a Basis.
boost::shared_ptr< PointGeom > PointGeomSharedPtr
1D Gauss-Lobatto-Legendre quadrature points
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.