Nektar++
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::LocalRegions::QuadExp Class Reference

#include <QuadExp.h>

Inheritance diagram for Nektar::LocalRegions::QuadExp:
[legend]

Public Member Functions

 QuadExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const SpatialDomains::Geometry2DSharedPtr &geom)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 QuadExp (const QuadExp &T)
 
virtual ~QuadExp () override=default
 
- Public Member Functions inherited from Nektar::StdRegions::StdQuadExp
 StdQuadExp ()
 
 StdQuadExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 StdQuadExp (const StdQuadExp &T)
 Copy Constructor. More...
 
virtual ~StdQuadExp () override
 Destructor. More...
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion2D
 StdExpansion2D ()
 
 StdExpansion2D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb)
 
 StdExpansion2D (const StdExpansion2D &T)
 
virtual ~StdExpansion2D () override
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d0, Array< OneD, NekDouble > &outarray_d1)
 Calculate the 2D derivative in the local tensor/collapsed coordinate at the physical points. More...
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &w0, const Array< OneD, const NekDouble > &w1)
 
NekDouble BaryTensorDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
 
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor. More...
 
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor. More...
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor. More...
 
virtual ~StdExpansion ()
 Destructor. More...
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion. More...
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis. More...
 
const LibUtilities::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th trace. More...
 
int GetTraceIntNcoeffs (const int i) const
 
int GetTraceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th trace. More...
 
const LibUtilities::BasisKey GetTraceBasisKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
LibUtilities::PointsKey GetTracePointsKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNtraces () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
std::shared_ptr< StdExpansionGetStdExp () const
 
std::shared_ptr< StdExpansionGetLinStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion () const
 
bool IsNodalNonTensorialExp ()
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space. More...
 
void FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 This function integrates the specified function over the domain. More...
 
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion. More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 this function calculates the inner product of a given function f with the different modes of the expansion More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
 
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion More...
 
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point More...
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray)
 
void GetElmtTraceToTraceMap (const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
 
void GetTraceNumModes (const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix \(\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\) More...
 
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
void ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 This function evaluates the first derivative of the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs)
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode)
 This function evaluates the basis function mode mode at a point coords of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
void LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 Convert local collapsed coordinates eta into local cartesian coordinate xi. More...
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_\infty\) error \( |\epsilon|_\infty = \max |u - u_{exact}|\) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_2\) error, \( | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( H^1\) error, \( | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
 This function performs an interpolation from the physical space points provided at input into an array of equispaced points which are not the collapsed coordinate. So for a tetrahedron you will only get a tetrahedral number of values. More...
 
void GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 This function provides the connectivity of local simplices (triangles or tets) to connect the equispaced data points provided by PhysInterpToSimplexEquiSpaced. More...
 
void EquiSpacedToCoeffs (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs a projection/interpolation from the equispaced points sometimes used in post-processing onto the coefficient space. More...
 
template<class T >
std::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
void GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion2D
 Expansion2D (SpatialDomains::Geometry2DSharedPtr pGeom)
 
virtual ~Expansion2D () override=default
 
DNekScalMatSharedPtr CreateMatrix (const MatrixKey &mkey)
 
void SetTraceToGeomOrientation (Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &inout)
 
Array< OneD, unsigned int > GetTraceInverseBoundaryMap (int eid)
 
void AddNormTraceInt (const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
 
void AddNormTraceInt (const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs)
 
void AddEdgeBoundaryInt (const int edge, ExpansionSharedPtr &EdgeExp, Array< OneD, NekDouble > &edgePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
void AddHDGHelmholtzEdgeTerms (const NekDouble tau, const int edge, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &edgePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
 
void AddHDGHelmholtzTraceTerms (const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
 
SpatialDomains::Geometry2DSharedPtr GetGeom2D () const
 
void ReOrientEdgePhysMap (const int nvert, const StdRegions::Orientation orient, const int nq0, Array< OneD, int > &idmap)
 
virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_GenTraceExp (const int traceid, ExpansionSharedPtr &exp) override
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion
 Expansion (SpatialDomains::GeometrySharedPtr pGeom)
 
 Expansion (const Expansion &pSrc)
 
virtual ~Expansion ()
 
void SetTraceExp (const int traceid, ExpansionSharedPtr &f)
 
ExpansionSharedPtr GetTraceExp (const int traceid)
 
DNekScalMatSharedPtr GetLocMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocMatrix (const LocalRegions::MatrixKey &mkey)
 
DNekScalMatSharedPtr GetLocMatrix (const StdRegions::MatrixType mtype, const StdRegions::ConstFactorMap &factors=StdRegions::NullConstFactorMap, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
SpatialDomains::GeometrySharedPtr GetGeom () const
 
void Reset ()
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 
DNekScalBlkMatSharedPtr CreateStaticCondMatrix (const MatrixKey &mkey)
 
const SpatialDomains::GeomFactorsSharedPtrGetMetricInfo () const
 
DNekMatSharedPtr BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
DNekMatSharedPtr BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
void ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 
void AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
void AddFaceNormBoundaryInt (const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
void DGDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
 
NekDouble VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &vec)
 
void NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
void AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
ExpansionSharedPtr GetLeftAdjacentElementExp () const
 
ExpansionSharedPtr GetRightAdjacentElementExp () const
 
int GetLeftAdjacentElementTrace () const
 
int GetRightAdjacentElementTrace () const
 
void SetAdjacentElementExp (int traceid, ExpansionSharedPtr &e)
 
StdRegions::Orientation GetTraceOrient (int trace)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Divided by the metric jacobi and quadrature weights. More...
 
void GetTraceQFactors (const int trace, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetTracePhysVals (const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
 
void GetTracePhysMap (const int edge, Array< OneD, int > &outarray)
 
void ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1)
 
const NormalVectorGetTraceNormal (const int id)
 
void ComputeTraceNormal (const int id)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
void SetUpPhysNormals (const int trace)
 
void AddRobinMassMatrix (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void TraceNormLen (const int traceid, NekDouble &h, NekDouble &p)
 
void AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
 
const Array< OneD, const NekDouble > & GetElmtBndNormDirElmtLen (const int nbnd) const
 
void StdDerivBaseOnTraceMat (Array< OneD, DNekMatSharedPtr > &DerivMat)
 

Protected Member Functions

virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray) override
 Integrates the specified function over the domain. More...
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
 
virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
 Calculate the derivative of the physical points. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the derivative of the physical points in a given direction. More...
 
virtual void v_PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out) override
 Physical derivative along a direction vector. More...
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Transform a given function from physical quadrature space to coefficient space. More...
 
virtual void v_FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the inner product of inarray with respect to the basis B=base0*base1 and put into outarray. More...
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
 
virtual void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray) override
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray) override
 
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp (void) const override
 
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp (void) const override
 
virtual void v_GetCoord (const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
virtual void v_GetTracePhysVals (const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
 
virtual void v_GetTraceQFactors (const int edge, Array< OneD, NekDouble > &outarray) override
 
virtual void v_ComputeTraceNormal (const int edge) override
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
 
virtual StdRegions::Orientation v_GetTraceOrient (int edge) override
 
virtual void v_GetTracePhysMap (const int edge, Array< OneD, int > &outarray) override
 
virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey) override
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdRegions::StdMatrixKey &mkey) override
 
virtual DNekScalMatSharedPtr v_GetLocMatrix (const MatrixKey &mkey) override
 
void v_DropLocMatrix (const MatrixKey &mkey) override
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const MatrixKey &mkey) override
 
void v_DropLocStaticCondMatrix (const MatrixKey &mkey) override
 
virtual void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
 
virtual void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_ComputeLaplacianMetric () override
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors) override
 : This method gets all of the factors which are required as part of the Gradient Jump Penalty (GJP) stabilisation and involves the product of the normal and geometric factors along the element trace. More...
 
- Protected Member Functions inherited from Nektar::StdRegions::StdQuadExp
NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray) override
 Integrates the specified function over the domain. More...
 
void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
 Calculate the derivative of the physical points. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the derivative of the physical points in a given direction. More...
 
virtual void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
 
virtual void v_StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1) override
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Transform a given function from physical quadrature space to coefficient space. More...
 
void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the inner product of inarray with respect to the basis B=base0*base1 and put into outarray. More...
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
 
virtual void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1) override
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
 
virtual void v_LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &array) override
 Fill outarray with mode mode of expansion. More...
 
virtual int v_GetNverts () const final override
 
virtual int v_GetNtraces () const final override
 
virtual int v_GetTraceNcoeffs (const int i) const final override
 
virtual int v_GetTraceIntNcoeffs (const int i) const final override
 
virtual int v_GetTraceNumPoints (const int i) const final override
 
virtual int v_NumBndryCoeffs () const final override
 
virtual int v_NumDGBndryCoeffs () const final override
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset) override
 
virtual const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int j) const final override
 
virtual LibUtilities::ShapeType v_DetShapeType () const final override
 
virtual bool v_IsBoundaryInteriorExpansion () const override
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
 
virtual NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode) override
 This function evaluates the basis function mode mode at a point coords of the domain. More...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray) override
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray) override
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false) override
 
virtual void v_GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
 Get the map of the coefficient location to teh local trace coefficients. More...
 
void v_GetTraceInteriorToElementMap (const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation edgeOrient=eForwards) override
 
virtual DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey) override
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey) override
 
void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
virtual void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
virtual void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
virtual void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
virtual void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
 
virtual void v_ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff) override
 
virtual void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion2D
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals) override
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals) override
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
virtual void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1)=0
 
virtual void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1)=0
 
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
 
virtual void v_GetElmtTraceToTraceMap (const unsigned int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q) override
 Determine the mapping to re-orientate the coefficients along the element trace (assumed to align with the standard element) into the orientation of the local trace given by edgeOrient. More...
 
virtual void v_GetTraceToElementMap (const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient=eForwards, int P=-1, int Q=-1) override
 
virtual void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
virtual void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv, NekDouble &deriv2)
 This function performs the barycentric interpolation of the polynomial stored in coord at a point physvals using barycentric interpolation weights in direction. More...
 
template<int DIR>
NekDouble BaryEvaluateBasis (const NekDouble &coord, const int &mode)
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals)
 Helper function to pass an unused value by reference into BaryEvaluate. More...
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv)
 
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion2D
virtual void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &out_d) override
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray) override
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray) override
 
virtual void v_AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
 
virtual void v_AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs) override
 
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd) override
 
virtual void v_ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
 
virtual void v_SetUpPhysNormals (const int edge) override
 
virtual NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &vec) override
 
virtual void v_TraceNormLen (const int traceid, NekDouble &h, NekDouble &p) override
 
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion
void ComputeLaplacianMetric ()
 
void ComputeQuadratureMetric ()
 
void ComputeGmatcdotMF (const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble > > &dfdir)
 
Array< OneD, NekDoubleGetMF (const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
 
Array< OneD, NekDoubleGetMFDiv (const int dir, const StdRegions::VarCoeffMap &varcoeffs)
 
Array< OneD, NekDoubleGetMFMag (const int dir, const StdRegions::VarCoeffMap &varcoeffs)
 
virtual void v_MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_ComputeLaplacianMetric ()
 
virtual int v_GetCoordim () const override
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
 
virtual DNekScalMatSharedPtr v_GetLocMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual DNekMatSharedPtr v_BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddFaceNormBoundaryInt (const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
 
virtual NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &vec)
 
virtual void v_NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors)
 
virtual void v_AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual StdRegions::Orientation v_GetTraceOrient (int trace)
 
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_GetTraceQFactors (const int trace, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetTracePhysVals (const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
 
virtual void v_GetTracePhysMap (const int edge, Array< OneD, int > &outarray)
 
virtual void v_ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1=-1)
 
virtual void v_ComputeTraceNormal (const int id)
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals ()
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void v_SetUpPhysNormals (const int id)
 
virtual void v_AddRobinMassMatrix (const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
virtual void v_AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
 
virtual void v_TraceNormLen (const int traceid, NekDouble &h, NekDouble &p)
 
virtual void v_GenTraceExp (const int traceid, ExpansionSharedPtr &exp)
 

Private Member Functions

void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
 QuadExp ()
 

Private Attributes

LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLessm_matrixManager
 
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLessm_staticCondMatrixManager
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion2D
std::vector< bool > m_requireNeg
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_indexMapManager
 
std::map< int, ExpansionWeakPtrm_traceExp
 
SpatialDomains::GeometrySharedPtr m_geom
 
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
 
MetricMap m_metrics
 
std::map< int, NormalVectorm_traceNormals
 
ExpansionWeakPtr m_elementLeft
 
ExpansionWeakPtr m_elementRight
 
int m_elementTraceLeft = -1
 
int m_elementTraceRight = -1
 
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
 the element length in each element boundary(Vertex, edge or face) normal direction calculated based on the local m_metricinfo times the standard element length (which is 2.0) More...
 

Detailed Description

Definition at line 50 of file QuadExp.h.

Constructor & Destructor Documentation

◆ QuadExp() [1/3]

Nektar::LocalRegions::QuadExp::QuadExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const SpatialDomains::Geometry2DSharedPtr geom 
)

Constructor using BasisKey class for quadrature points and order definition.

Definition at line 51 of file QuadExp.cpp.

54 : StdExpansion(Ba.GetNumModes() * Bb.GetNumModes(), 2, Ba, Bb),
55 StdExpansion2D(Ba.GetNumModes() * Bb.GetNumModes(), Ba, Bb),
56 StdQuadExp(Ba, Bb), Expansion(geom), Expansion2D(geom),
58 std::bind(&Expansion2D::CreateMatrix, this, std::placeholders::_1),
59 std::string("QuadExpMatrix")),
61 this, std::placeholders::_1),
62 std::string("QuadExpStaticCondMatrix"))
63{
64}
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: Expansion2D.cpp:59
Expansion2D(SpatialDomains::Geometry2DSharedPtr pGeom)
Definition: Expansion2D.cpp:54
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: Expansion.cpp:277
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:47
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: QuadExp.h:247
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: QuadExp.h:249
StdExpansion()
Default Constructor.

◆ QuadExp() [2/3]

Nektar::LocalRegions::QuadExp::QuadExp ( const QuadExp T)

Definition at line 66 of file QuadExp.cpp.

68 Expansion2D(T), m_matrixManager(T.m_matrixManager),
69 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
70{
71}

◆ ~QuadExp()

virtual Nektar::LocalRegions::QuadExp::~QuadExp ( )
overridevirtualdefault

◆ QuadExp() [3/3]

Nektar::LocalRegions::QuadExp::QuadExp ( )
private

Member Function Documentation

◆ GetEdgeInterpVals()

void Nektar::LocalRegions::QuadExp::GetEdgeInterpVals ( const int  edge,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
private

Definition at line 661 of file QuadExp.cpp.

664{
665 int i;
666 int nq0 = m_base[0]->GetNumPoints();
667 int nq1 = m_base[1]->GetNumPoints();
668
671
672 StdRegions::StdMatrixKey key(StdRegions::eInterpGauss, DetShapeType(),
673 *this, factors);
674
675 DNekScalMatSharedPtr mat_gauss = m_matrixManager[key];
676
677 switch (edge)
678 {
679 case 0:
680 {
681 for (i = 0; i < nq0; i++)
682 {
683 outarray[i] =
684 Blas::Ddot(nq1, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
685 1, &inarray[i], nq0);
686 }
687 break;
688 }
689 case 1:
690 {
691 for (i = 0; i < nq1; i++)
692 {
693 outarray[i] =
694 Blas::Ddot(nq0, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
695 1, &inarray[i * nq0], 1);
696 }
697 break;
698 }
699 case 2:
700 {
701 for (i = 0; i < nq0; i++)
702 {
703 outarray[i] =
704 Blas::Ddot(nq1, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
705 1, &inarray[i], nq0);
706 }
707 break;
708 }
709 case 3:
710 {
711 for (i = 0; i < nq1; i++)
712 {
713 outarray[i] =
714 Blas::Ddot(nq0, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
715 1, &inarray[i * nq0], 1);
716 }
717 break;
718 }
719 default:
720 ASSERTL0(false, "edge value (< 3) is out of range");
721 break;
722 }
723}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:373
Array< OneD, LibUtilities::BasisSharedPtr > m_base
static double Ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: output = .
Definition: Blas.hpp:165
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:408
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr

References ASSERTL0, Blas::Ddot(), Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFactorGaussEdge, Nektar::StdRegions::eInterpGauss, Nektar::VarcoeffHashingTest::factors, Nektar::StdRegions::StdExpansion::m_base, and m_matrixManager.

Referenced by v_ComputeTraceNormal(), v_GetTracePhysVals(), and v_GetTraceQFactors().

◆ v_AlignVectorToCollapsedDir()

void Nektar::LocalRegions::QuadExp::v_AlignVectorToCollapsedDir ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 456 of file QuadExp.cpp.

459{
460 ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
461 ASSERTL1((dir == 2) ? (m_geom->GetCoordim() == 3) : true,
462 "Invalid direction.");
463
464 int nquad0 = m_base[0]->GetNumPoints();
465 int nquad1 = m_base[1]->GetNumPoints();
466 int nqtot = nquad0 * nquad1;
467 int nmodes0 = m_base[0]->GetNumModes();
468
469 const Array<TwoD, const NekDouble> &df =
470 m_metricinfo->GetDerivFactors(GetPointsKeys());
471
472 Array<OneD, NekDouble> tmp1 = outarray[0];
473 Array<OneD, NekDouble> tmp2 = outarray[1];
474 Array<OneD, NekDouble> tmp3(m_ncoeffs);
475 Array<OneD, NekDouble> tmp4(nmodes0 * nquad1);
476
477 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
478 {
479 Vmath::Vmul(nqtot, &df[2 * dir][0], 1, inarray.get(), 1, tmp1.get(), 1);
480 Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, inarray.get(), 1, tmp2.get(),
481 1);
482 }
483 else
484 {
485 Vmath::Smul(nqtot, df[2 * dir][0], inarray.get(), 1, tmp1.get(), 1);
486 Vmath::Smul(nqtot, df[2 * dir + 1][0], inarray.get(), 1, tmp2.get(), 1);
487 }
488}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:275
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:276
const LibUtilities::PointsKeyVector GetPointsKeys() const
@ eDeformed
Geometry is curved or has non-constant factors.
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.
Definition: Vmath.cpp:207
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:245

References ASSERTL1, Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Smul(), and Vmath::Vmul().

Referenced by v_IProductWRTDerivBase_SumFac().

◆ v_ComputeLaplacianMetric()

void Nektar::LocalRegions::QuadExp::v_ComputeLaplacianMetric ( )
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1557 of file QuadExp.cpp.

1558{
1559 if (m_metrics.count(eMetricQuadrature) == 0)
1560 {
1562 }
1563
1564 const SpatialDomains::GeomType type = m_metricinfo->GetGtype();
1565 const unsigned int nqtot = GetTotPoints();
1566 const unsigned int dim = 2;
1567 const MetricType m[3][3] = {
1571
1572 const Array<TwoD, const NekDouble> gmat =
1573 m_metricinfo->GetGmat(GetPointsKeys());
1574 for (unsigned int i = 0; i < dim; ++i)
1575 {
1576 for (unsigned int j = i; j < dim; ++j)
1577 {
1578 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
1579 if (type == SpatialDomains::eDeformed)
1580 {
1581 Vmath::Vcopy(nqtot, &gmat[i * dim + j][0], 1,
1582 &m_metrics[m[i][j]][0], 1);
1583 }
1584 else
1585 {
1586 Vmath::Fill(nqtot, gmat[i * dim + j][0], &m_metrics[m[i][j]][0],
1587 1);
1588 }
1590 }
1591 }
1592}
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:729
GeomType
Indicates the type of element geometry.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:43
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1191

References Nektar::LocalRegions::Expansion::ComputeQuadratureMetric(), Nektar::SpatialDomains::eDeformed, Nektar::LocalRegions::eMetricLaplacian00, Nektar::LocalRegions::eMetricLaplacian01, Nektar::LocalRegions::eMetricLaplacian02, Nektar::LocalRegions::eMetricLaplacian11, Nektar::LocalRegions::eMetricLaplacian12, Nektar::LocalRegions::eMetricLaplacian22, Nektar::LocalRegions::eMetricQuadrature, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::LocalRegions::Expansion::m_metrics, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), and Vmath::Vcopy().

◆ v_ComputeTraceNormal()

void Nektar::LocalRegions::QuadExp::v_ComputeTraceNormal ( const int  edge)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 981 of file QuadExp.cpp.

982{
983 int i;
984 const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
985 GetGeom()->GetMetricInfo();
986 SpatialDomains::GeomType type = geomFactors->GetGtype();
987
989 for (i = 0; i < ptsKeys.size(); ++i)
990 {
991 // Need at least 2 points for computing normals
992 if (ptsKeys[i].GetNumPoints() == 1)
993 {
994 LibUtilities::PointsKey pKey(2, ptsKeys[i].GetPointsType());
995 ptsKeys[i] = pKey;
996 }
997 }
998
999 const Array<TwoD, const NekDouble> &df =
1000 geomFactors->GetDerivFactors(ptsKeys);
1001 const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
1002 int nqe;
1003 if (edge == 0 || edge == 2)
1004 {
1005 nqe = m_base[0]->GetNumPoints();
1006 }
1007 else
1008 {
1009 nqe = m_base[1]->GetNumPoints();
1010 }
1011 int vCoordDim = GetCoordim();
1012
1013 m_traceNormals[edge] = Array<OneD, Array<OneD, NekDouble>>(vCoordDim);
1014 Array<OneD, Array<OneD, NekDouble>> &normal = m_traceNormals[edge];
1015 for (i = 0; i < vCoordDim; ++i)
1016 {
1017 normal[i] = Array<OneD, NekDouble>(nqe);
1018 }
1019
1020 size_t nqb = nqe;
1021 size_t nbnd = edge;
1022 m_elmtBndNormDirElmtLen[nbnd] = Array<OneD, NekDouble>{nqb, 0.0};
1023 Array<OneD, NekDouble> &length = m_elmtBndNormDirElmtLen[nbnd];
1024
1025 // Regular geometry case
1026 if ((type == SpatialDomains::eRegular) ||
1028 {
1029 NekDouble fac;
1030 // Set up normals
1031 switch (edge)
1032 {
1033 case 0:
1034 for (i = 0; i < vCoordDim; ++i)
1035 {
1036 Vmath::Fill(nqe, -df[2 * i + 1][0], normal[i], 1);
1037 }
1038 break;
1039 case 1:
1040 for (i = 0; i < vCoordDim; ++i)
1041 {
1042 Vmath::Fill(nqe, df[2 * i][0], normal[i], 1);
1043 }
1044 break;
1045 case 2:
1046 for (i = 0; i < vCoordDim; ++i)
1047 {
1048 Vmath::Fill(nqe, df[2 * i + 1][0], normal[i], 1);
1049 }
1050 break;
1051 case 3:
1052 for (i = 0; i < vCoordDim; ++i)
1053 {
1054 Vmath::Fill(nqe, -df[2 * i][0], normal[i], 1);
1055 }
1056 break;
1057 default:
1058 ASSERTL0(false, "edge is out of range (edge < 4)");
1059 }
1060
1061 // normalise
1062 fac = 0.0;
1063 for (i = 0; i < vCoordDim; ++i)
1064 {
1065 fac += normal[i][0] * normal[i][0];
1066 }
1067 fac = 1.0 / sqrt(fac);
1068
1069 Vmath::Fill(nqb, fac, length, 1);
1070
1071 for (i = 0; i < vCoordDim; ++i)
1072 {
1073 Vmath::Smul(nqe, fac, normal[i], 1, normal[i], 1);
1074 }
1075 }
1076 else // Set up deformed normals
1077 {
1078 int j;
1079
1080 int nquad0 = ptsKeys[0].GetNumPoints();
1081 int nquad1 = ptsKeys[1].GetNumPoints();
1082
1083 LibUtilities::PointsKey from_key;
1084
1085 Array<OneD, NekDouble> normals(vCoordDim * max(nquad0, nquad1), 0.0);
1086 Array<OneD, NekDouble> edgejac(vCoordDim * max(nquad0, nquad1), 0.0);
1087
1088 // Extract Jacobian along edges and recover local
1089 // derivates (dx/dr) for polynomial interpolation by
1090 // multiplying m_gmat by jacobian
1091
1092 // Implementation for all the basis except Gauss points
1095 {
1096 switch (edge)
1097 {
1098 case 0:
1099 for (j = 0; j < nquad0; ++j)
1100 {
1101 edgejac[j] = jac[j];
1102 for (i = 0; i < vCoordDim; ++i)
1103 {
1104 normals[i * nquad0 + j] =
1105 -df[2 * i + 1][j] * edgejac[j];
1106 }
1107 }
1108 from_key = ptsKeys[0];
1109 break;
1110 case 1:
1111 for (j = 0; j < nquad1; ++j)
1112 {
1113 edgejac[j] = jac[nquad0 * j + nquad0 - 1];
1114 for (i = 0; i < vCoordDim; ++i)
1115 {
1116 normals[i * nquad1 + j] =
1117 df[2 * i][nquad0 * j + nquad0 - 1] * edgejac[j];
1118 }
1119 }
1120 from_key = ptsKeys[1];
1121 break;
1122 case 2:
1123 for (j = 0; j < nquad0; ++j)
1124 {
1125 edgejac[j] = jac[nquad0 * (nquad1 - 1) + j];
1126 for (i = 0; i < vCoordDim; ++i)
1127 {
1128 normals[i * nquad0 + j] =
1129 (df[2 * i + 1][nquad0 * (nquad1 - 1) + j]) *
1130 edgejac[j];
1131 }
1132 }
1133 from_key = ptsKeys[0];
1134 break;
1135 case 3:
1136 for (j = 0; j < nquad1; ++j)
1137 {
1138 edgejac[j] = jac[nquad0 * j];
1139 for (i = 0; i < vCoordDim; ++i)
1140 {
1141 normals[i * nquad1 + j] =
1142 -df[2 * i][nquad0 * j] * edgejac[j];
1143 }
1144 }
1145 from_key = ptsKeys[1];
1146 break;
1147 default:
1148 ASSERTL0(false, "edge is out of range (edge < 3)");
1149 }
1150 }
1151 else
1152 {
1153 int nqtot = nquad0 * nquad1;
1154 Array<OneD, NekDouble> tmp_gmat(nqtot, 0.0);
1155 Array<OneD, NekDouble> tmp_gmat_edge(nqe, 0.0);
1156
1157 switch (edge)
1158 {
1159 case 0:
1160 for (j = 0; j < nquad0; ++j)
1161 {
1162 for (i = 0; i < vCoordDim; ++i)
1163 {
1164 Vmath::Vmul(nqtot, &(df[2 * i + 1][0]), 1, &jac[0],
1165 1, &(tmp_gmat[0]), 1);
1166 QuadExp::GetEdgeInterpVals(edge, tmp_gmat,
1167 tmp_gmat_edge);
1168 normals[i * nquad0 + j] = -tmp_gmat_edge[j];
1169 }
1170 }
1171 from_key = ptsKeys[0];
1172 break;
1173 case 1:
1174 for (j = 0; j < nquad1; ++j)
1175 {
1176 for (i = 0; i < vCoordDim; ++i)
1177 {
1178 Vmath::Vmul(nqtot, &(df[2 * i][0]), 1, &jac[0], 1,
1179 &(tmp_gmat[0]), 1);
1180 QuadExp::GetEdgeInterpVals(edge, tmp_gmat,
1181 tmp_gmat_edge);
1182 normals[i * nquad1 + j] = tmp_gmat_edge[j];
1183 }
1184 }
1185 from_key = ptsKeys[1];
1186 break;
1187 case 2:
1188 for (j = 0; j < nquad0; ++j)
1189 {
1190 for (i = 0; i < vCoordDim; ++i)
1191 {
1192 Vmath::Vmul(nqtot, &(df[2 * i + 1][0]), 1, &jac[0],
1193 1, &(tmp_gmat[0]), 1);
1194 QuadExp::GetEdgeInterpVals(edge, tmp_gmat,
1195 tmp_gmat_edge);
1196 normals[i * nquad0 + j] = tmp_gmat_edge[j];
1197 }
1198 }
1199 from_key = ptsKeys[0];
1200 break;
1201 case 3:
1202 for (j = 0; j < nquad1; ++j)
1203 {
1204 for (i = 0; i < vCoordDim; ++i)
1205 {
1206 Vmath::Vmul(nqtot, &(df[2 * i][0]), 1, &jac[0], 1,
1207 &(tmp_gmat[0]), 1);
1208 QuadExp::GetEdgeInterpVals(edge, tmp_gmat,
1209 tmp_gmat_edge);
1210 normals[i * nquad1 + j] = -tmp_gmat_edge[j];
1211 }
1212 }
1213 from_key = ptsKeys[1];
1214 break;
1215 default:
1216 ASSERTL0(false, "edge is out of range (edge < 3)");
1217 }
1218 }
1219
1220 int nq = from_key.GetNumPoints();
1221 Array<OneD, NekDouble> work(nqe, 0.0);
1222
1223 // interpolate Jacobian and invert
1224 LibUtilities::Interp1D(from_key, jac, m_base[0]->GetPointsKey(), work);
1225 Vmath::Sdiv(nqe, 1.0, &work[0], 1, &work[0], 1);
1226
1227 // interpolate
1228 for (i = 0; i < GetCoordim(); ++i)
1229 {
1230 LibUtilities::Interp1D(from_key, &normals[i * nq],
1231 m_base[0]->GetPointsKey(), &normal[i][0]);
1232 Vmath::Vmul(nqe, work, 1, normal[i], 1, normal[i], 1);
1233 }
1234
1235 // normalise normal vectors
1236 Vmath::Zero(nqe, work, 1);
1237 for (i = 0; i < GetCoordim(); ++i)
1238 {
1239 Vmath::Vvtvp(nqe, normal[i], 1, normal[i], 1, work, 1, work, 1);
1240 }
1241
1242 Vmath::Vsqrt(nqe, work, 1, work, 1);
1243 Vmath::Sdiv(nqe, 1.0, work, 1, work, 1);
1244
1245 Vmath::Vcopy(nqb, work, 1, length, 1);
1246
1247 for (i = 0; i < GetCoordim(); ++i)
1248 {
1249 Vmath::Vmul(nqe, normal[i], 1, work, 1, normal[i], 1);
1250 }
1251 }
1252 if (GetGeom()->GetEorient(edge) == StdRegions::eBackwards)
1253 {
1254 for (i = 0; i < vCoordDim; ++i)
1255 {
1256 if (geomFactors->GetGtype() == SpatialDomains::eDeformed)
1257 {
1258 Vmath::Reverse(nqe, normal[i], 1, normal[i], 1);
1259 }
1260 }
1261 }
1262}
std::map< int, NormalVector > m_traceNormals
Definition: Expansion.h:278
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
Definition: Expansion.h:288
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:171
void GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:661
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:211
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:224
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Definition: Interp.cpp:49
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:236
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
double NekDouble
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:529
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
Definition: Vmath.cpp:569
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
Definition: Vmath.cpp:319
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:487
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1222
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::SpatialDomains::eDeformed, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::SpatialDomains::eMovingRegular, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetCoordim(), GetEdgeInterpVals(), Nektar::LocalRegions::Expansion::GetGeom(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::LibUtilities::Interp1D(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_elmtBndNormDirElmtLen, Nektar::LocalRegions::Expansion::m_traceNormals, Vmath::Reverse(), Vmath::Sdiv(), Vmath::Smul(), tinysimd::sqrt(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vsqrt(), Vmath::Vvtvp(), and Vmath::Zero().

◆ v_CreateStdMatrix()

DNekMatSharedPtr Nektar::LocalRegions::QuadExp::v_CreateStdMatrix ( const StdRegions::StdMatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1379 of file QuadExp.cpp.

1381{
1382 LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
1383 LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
1386 return tmp->GetStdMatrix(mkey);
1387}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< StdQuadExp > StdQuadExpSharedPtr
Definition: StdQuadExp.h:243

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_DropLocMatrix()

void Nektar::LocalRegions::QuadExp::v_DropLocMatrix ( const MatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1394 of file QuadExp.cpp.

1395{
1396 m_matrixManager.DeleteObject(mkey);
1397}

References m_matrixManager.

◆ v_DropLocStaticCondMatrix()

void Nektar::LocalRegions::QuadExp::v_DropLocStaticCondMatrix ( const MatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1404 of file QuadExp.cpp.

1405{
1406 m_staticCondMatrixManager.DeleteObject(mkey);
1407}

References m_staticCondMatrixManager.

◆ v_ExtractDataToCoeffs()

void Nektar::LocalRegions::QuadExp::v_ExtractDataToCoeffs ( const NekDouble data,
const std::vector< unsigned int > &  nummodes,
const int  mode_offset,
NekDouble coeffs,
std::vector< LibUtilities::BasisType > &  fromType 
)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1264 of file QuadExp.cpp.

1268{
1269 int data_order0 = nummodes[mode_offset];
1270 int fillorder0 = std::min(m_base[0]->GetNumModes(), data_order0);
1271
1272 int data_order1 = nummodes[mode_offset + 1];
1273 int order1 = m_base[1]->GetNumModes();
1274 int fillorder1 = min(order1, data_order1);
1275
1276 // Check if same basis
1277 if (fromType[0] != m_base[0]->GetBasisType() ||
1278 fromType[1] != m_base[1]->GetBasisType())
1279 {
1280 // Construct a quad with the appropriate basis type at our
1281 // quadrature points, and one more to do a forwards
1282 // transform. We can then copy the output to coeffs.
1283 StdRegions::StdQuadExp tmpQuad(
1284 LibUtilities::BasisKey(fromType[0], data_order0,
1285 m_base[0]->GetPointsKey()),
1286 LibUtilities::BasisKey(fromType[1], data_order1,
1287 m_base[1]->GetPointsKey()));
1288 StdRegions::StdQuadExp tmpQuad2(m_base[0]->GetBasisKey(),
1289 m_base[1]->GetBasisKey());
1290
1291 Array<OneD, const NekDouble> tmpData(tmpQuad.GetNcoeffs(), data);
1292 Array<OneD, NekDouble> tmpBwd(tmpQuad2.GetTotPoints());
1293 Array<OneD, NekDouble> tmpOut(tmpQuad2.GetNcoeffs());
1294
1295 tmpQuad.BwdTrans(tmpData, tmpBwd);
1296 tmpQuad2.FwdTrans(tmpBwd, tmpOut);
1297 Vmath::Vcopy(tmpOut.size(), &tmpOut[0], 1, coeffs, 1);
1298
1299 return;
1300 }
1301
1302 switch (m_base[0]->GetBasisType())
1303 {
1305 {
1306 int i;
1307 int cnt = 0;
1308 int cnt1 = 0;
1309
1311 "Extraction routine not set up for this basis");
1312
1313 Vmath::Zero(m_ncoeffs, coeffs, 1);
1314 for (i = 0; i < fillorder0; ++i)
1315 {
1316 Vmath::Vcopy(fillorder1, data + cnt, 1, coeffs + cnt1, 1);
1317 cnt += data_order1;
1318 cnt1 += order1;
1319 }
1320 }
1321 break;
1323 {
1324 LibUtilities::PointsKey p0(nummodes[0],
1326 LibUtilities::PointsKey p1(nummodes[1],
1328 LibUtilities::PointsKey t0(m_base[0]->GetNumModes(),
1330 LibUtilities::PointsKey t1(m_base[1]->GetNumModes(),
1332 LibUtilities::Interp2D(p0, p1, data, t0, t1, coeffs);
1333 }
1334 break;
1336 {
1337 // Assume that input is also Gll_Lagrange but no way to check;
1338 LibUtilities::PointsKey p0(nummodes[0],
1340 LibUtilities::PointsKey p1(nummodes[1],
1342 LibUtilities::PointsKey t0(m_base[0]->GetNumModes(),
1344 LibUtilities::PointsKey t1(m_base[1]->GetNumModes(),
1346 LibUtilities::Interp2D(p0, p1, data, t0, t1, coeffs);
1347 }
1348 break;
1349 default:
1350 ASSERTL0(false, "basis is either not set up or not hierarchicial");
1351 }
1352}
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:162
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,...
Definition: Interp.cpp:103
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:53
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
Definition: BasisType.h:59
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:58
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:50

References ASSERTL0, ASSERTL1, Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LibUtilities::Interp2D(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vcopy(), and Vmath::Zero().

◆ v_FwdTrans()

void Nektar::LocalRegions::QuadExp::v_FwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Transform a given function from physical quadrature space to coefficient space.

See also
StdExpansion::FwdTrans

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 231 of file QuadExp.cpp.

233{
234 if ((m_base[0]->Collocation()) && (m_base[1]->Collocation()))
235 {
236 Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
237 }
238 else
239 {
240 IProductWRTBase(inarray, outarray);
241
242 // get Mass matrix inverse
243 MatrixKey masskey(StdRegions::eInvMass, DetShapeType(), *this);
244 DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
245
246 // copy inarray in case inarray == outarray
247 NekVector<NekDouble> in(m_ncoeffs, outarray, eCopy);
248 NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
249
250 out = (*matsys) * in;
251 }
252}
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
Definition: StdExpansion.h:534

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::eCopy, Nektar::StdRegions::eInvMass, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::m_base, m_matrixManager, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

◆ v_FwdTransBndConstrained()

void Nektar::LocalRegions::QuadExp::v_FwdTransBndConstrained ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 254 of file QuadExp.cpp.

257{
258 if ((m_base[0]->Collocation()) && (m_base[1]->Collocation()))
259 {
260 Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
261 }
262 else
263 {
264 int i, j;
265 int npoints[2] = {m_base[0]->GetNumPoints(), m_base[1]->GetNumPoints()};
266 int nmodes[2] = {m_base[0]->GetNumModes(), m_base[1]->GetNumModes()};
267
268 fill(outarray.get(), outarray.get() + m_ncoeffs, 0.0);
269
270 if (nmodes[0] == 1 && nmodes[1] == 1)
271 {
272 outarray[0] = inarray[0];
273 return;
274 }
275
276 Array<OneD, NekDouble> physEdge[4];
277 Array<OneD, NekDouble> coeffEdge[4];
278 StdRegions::Orientation orient[4];
279 for (i = 0; i < 4; i++)
280 {
281 physEdge[i] = Array<OneD, NekDouble>(npoints[i % 2]);
282 coeffEdge[i] = Array<OneD, NekDouble>(nmodes[i % 2]);
283 orient[i] = GetTraceOrient(i);
284 }
285
286 for (i = 0; i < npoints[0]; i++)
287 {
288 physEdge[0][i] = inarray[i];
289 physEdge[2][i] = inarray[npoints[0] * (npoints[1] - 1) + i];
290 }
291
292 for (i = 0; i < npoints[1]; i++)
293 {
294 physEdge[1][i] = inarray[npoints[0] - 1 + i * npoints[0]];
295 physEdge[3][i] = inarray[i * npoints[0]];
296 }
297
298 for (i = 0; i < 4; i++)
299 {
300 if (orient[i] == StdRegions::eBackwards)
301 {
302 reverse((physEdge[i]).get(),
303 (physEdge[i]).get() + npoints[i % 2]);
304 }
305 }
306
307 SegExpSharedPtr segexp[4];
308 for (i = 0; i < 4; i++)
309 {
311 m_base[i % 2]->GetBasisKey(), GetGeom2D()->GetEdge(i));
312 }
313
314 Array<OneD, unsigned int> mapArray;
315 Array<OneD, int> signArray;
317
318 for (i = 0; i < 4; i++)
319 {
320 segexp[i % 2]->FwdTransBndConstrained(physEdge[i], coeffEdge[i]);
321
322 GetTraceToElementMap(i, mapArray, signArray, orient[i]);
323 for (j = 0; j < nmodes[i % 2]; j++)
324 {
325 sign = (NekDouble)signArray[j];
326 outarray[mapArray[j]] = sign * coeffEdge[i][j];
327 }
328 }
329
330 int nBoundaryDofs = NumBndryCoeffs();
331 int nInteriorDofs = m_ncoeffs - nBoundaryDofs;
332
333 if (nInteriorDofs > 0)
334 {
335 Array<OneD, NekDouble> tmp0(m_ncoeffs);
336 Array<OneD, NekDouble> tmp1(m_ncoeffs);
337
338 StdRegions::StdMatrixKey stdmasskey(StdRegions::eMass,
339 DetShapeType(), *this);
340 MassMatrixOp(outarray, tmp0, stdmasskey);
341 IProductWRTBase(inarray, tmp1);
342
343 Vmath::Vsub(m_ncoeffs, tmp1, 1, tmp0, 1, tmp1, 1);
344
345 // get Mass matrix inverse (only of interior DOF)
346 // use block (1,1) of the static condensed system
347 // note: this block alreay contains the inverse matrix
348 MatrixKey masskey(StdRegions::eMass, DetShapeType(), *this);
349 DNekScalMatSharedPtr matsys =
350 (m_staticCondMatrixManager[masskey])->GetBlock(1, 1);
351
352 Array<OneD, NekDouble> rhs(nInteriorDofs);
353 Array<OneD, NekDouble> result(nInteriorDofs);
354
355 GetInteriorMap(mapArray);
356
357 for (i = 0; i < nInteriorDofs; i++)
358 {
359 rhs[i] = tmp1[mapArray[i]];
360 }
361
362 Blas::Dgemv('N', nInteriorDofs, nInteriorDofs, matsys->Scale(),
363 &((matsys->GetOwnedMatrix())->GetPtr())[0],
364 nInteriorDofs, rhs.get(), 1, 0.0, result.get(), 1);
365
366 for (i = 0; i < nInteriorDofs; i++)
367 {
368 outarray[mapArray[i]] = result[i];
369 }
370 }
371 }
372}
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:49
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:172
StdRegions::Orientation GetTraceOrient(int trace)
Definition: Expansion.h:170
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:758
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
Definition: StdExpansion.h:690
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:680
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
Definition: Blas.hpp:213
std::shared_ptr< SegExp > SegExpSharedPtr
Definition: SegExp.h:251
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:414

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::StdRegions::eBackwards, Nektar::StdRegions::eMass, Nektar::LocalRegions::Expansion2D::GetGeom2D(), Nektar::StdRegions::StdExpansion::GetInteriorMap(), Nektar::LocalRegions::Expansion::GetTraceOrient(), Nektar::StdRegions::StdExpansion::GetTraceToElementMap(), Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, m_staticCondMatrixManager, Nektar::StdRegions::StdExpansion::MassMatrixOp(), Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), sign, Vmath::Vcopy(), and Vmath::Vsub().

◆ v_GenMatrix()

DNekMatSharedPtr Nektar::LocalRegions::QuadExp::v_GenMatrix ( const StdRegions::StdMatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1359 of file QuadExp.cpp.

1360{
1361 DNekMatSharedPtr returnval;
1362 switch (mkey.GetMatrixType())
1363 {
1371 returnval = Expansion2D::v_GenMatrix(mkey);
1372 break;
1373 default:
1374 returnval = StdQuadExp::v_GenMatrix(mkey);
1375 }
1376 return returnval;
1377}
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75

References Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToQ1, Nektar::StdRegions::eHybridDGLamToQ2, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvLaplacianWithUnityMean, Nektar::StdRegions::StdMatrixKey::GetMatrixType(), and Nektar::LocalRegions::Expansion2D::v_GenMatrix().

◆ v_GetCoord()

void Nektar::LocalRegions::QuadExp::v_GetCoord ( const Array< OneD, const NekDouble > &  Lcoords,
Array< OneD, NekDouble > &  coords 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 549 of file QuadExp.cpp.

551{
552 int i;
553
554 ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[1] <= 1.0 && Lcoords[1] >= -1.0 &&
555 Lcoords[1] <= 1.0,
556 "Local coordinates are not in region [-1,1]");
557
558 m_geom->FillGeom();
559 for (i = 0; i < m_geom->GetCoordim(); ++i)
560 {
561 coords[i] = m_geom->GetCoord(i, Lcoords);
562 }
563}

References ASSERTL1, and Nektar::LocalRegions::Expansion::m_geom.

◆ v_GetCoords()

void Nektar::LocalRegions::QuadExp::v_GetCoords ( Array< OneD, NekDouble > &  coords_1,
Array< OneD, NekDouble > &  coords_2,
Array< OneD, NekDouble > &  coords_3 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 542 of file QuadExp.cpp.

545{
546 Expansion::v_GetCoords(coords_0, coords_1, coords_2);
547}
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: Expansion.cpp:535

References Nektar::LocalRegions::Expansion::v_GetCoords().

◆ v_GetLinStdExp()

StdRegions::StdExpansionSharedPtr Nektar::LocalRegions::QuadExp::v_GetLinStdExp ( void  ) const
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 531 of file QuadExp.cpp.

532{
533 LibUtilities::BasisKey bkey0(m_base[0]->GetBasisType(), 2,
534 m_base[0]->GetPointsKey());
535 LibUtilities::BasisKey bkey1(m_base[1]->GetBasisType(), 2,
536 m_base[1]->GetPointsKey());
537
539 bkey1);
540}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_GetLocMatrix()

DNekScalMatSharedPtr Nektar::LocalRegions::QuadExp::v_GetLocMatrix ( const MatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1389 of file QuadExp.cpp.

1390{
1391 return m_matrixManager[mkey];
1392}

References m_matrixManager.

◆ v_GetLocStaticCondMatrix()

DNekScalBlkMatSharedPtr Nektar::LocalRegions::QuadExp::v_GetLocStaticCondMatrix ( const MatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1399 of file QuadExp.cpp.

1400{
1401 return m_staticCondMatrixManager[mkey];
1402}

References m_staticCondMatrixManager.

◆ v_GetStdExp()

StdRegions::StdExpansionSharedPtr Nektar::LocalRegions::QuadExp::v_GetStdExp ( void  ) const
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 525 of file QuadExp.cpp.

526{
528 m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey());
529}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_GetTraceOrient()

StdRegions::Orientation Nektar::LocalRegions::QuadExp::v_GetTraceOrient ( int  edge)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1354 of file QuadExp.cpp.

1355{
1356 return m_geom->GetEorient(edge);
1357}

References Nektar::LocalRegions::Expansion::m_geom.

◆ v_GetTracePhysMap()

void Nektar::LocalRegions::QuadExp::v_GetTracePhysMap ( const int  edge,
Array< OneD, int > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 725 of file QuadExp.cpp.

726{
727 int nquad0 = m_base[0]->GetNumPoints();
728 int nquad1 = m_base[1]->GetNumPoints();
729
730 // Get points in Cartesian orientation
731 switch (edge)
732 {
733 case 0:
734 outarray = Array<OneD, int>(nquad0);
735 for (int i = 0; i < nquad0; ++i)
736 {
737 outarray[i] = i;
738 }
739 break;
740 case 1:
741 outarray = Array<OneD, int>(nquad1);
742 for (int i = 0; i < nquad1; ++i)
743 {
744 outarray[i] = (nquad0 - 1) + i * nquad0;
745 }
746 break;
747 case 2:
748 outarray = Array<OneD, int>(nquad0);
749 for (int i = 0; i < nquad0; ++i)
750 {
751 outarray[i] = i + nquad0 * (nquad1 - 1);
752 }
753 break;
754 case 3:
755 outarray = Array<OneD, int>(nquad1);
756 for (int i = 0; i < nquad1; ++i)
757 {
758 outarray[i] = i * nquad0;
759 }
760 break;
761 default:
762 ASSERTL0(false, "edge value (< 3) is out of range");
763 break;
764 }
765}

References ASSERTL0, and Nektar::StdRegions::StdExpansion::m_base.

◆ v_GetTracePhysVals()

void Nektar::LocalRegions::QuadExp::v_GetTracePhysVals ( const int  edge,
const StdRegions::StdExpansionSharedPtr EdgeExp,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
StdRegions::Orientation  orient 
)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 599 of file QuadExp.cpp.

603{
604 int nquad0 = m_base[0]->GetNumPoints();
605 int nquad1 = m_base[1]->GetNumPoints();
606
607 // Implementation for all the basis except Gauss points
610 {
611 switch (edge)
612 {
613 case 0:
614 Vmath::Vcopy(nquad0, &(inarray[0]), 1, &(outarray[0]), 1);
615 break;
616 case 1:
617 Vmath::Vcopy(nquad1, &(inarray[0]) + (nquad0 - 1), nquad0,
618 &(outarray[0]), 1);
619 break;
620 case 2:
621 Vmath::Vcopy(nquad0, &(inarray[0]) + nquad0 * (nquad1 - 1), 1,
622 &(outarray[0]), 1);
623 break;
624 case 3:
625 Vmath::Vcopy(nquad1, &(inarray[0]), nquad0, &(outarray[0]), 1);
626 break;
627 default:
628 ASSERTL0(false, "edge value (< 3) is out of range");
629 break;
630 }
631 }
632 else
633 {
634 QuadExp::GetEdgeInterpVals(edge, inarray, outarray);
635 }
636
637 // Interpolate if required
638 if (m_base[edge % 2]->GetPointsKey() !=
639 EdgeExp->GetBasis(0)->GetPointsKey())
640 {
641 Array<OneD, NekDouble> outtmp(max(nquad0, nquad1));
642
643 outtmp = outarray;
644
645 LibUtilities::Interp1D(m_base[edge % 2]->GetPointsKey(), outtmp,
646 EdgeExp->GetBasis(0)->GetPointsKey(), outarray);
647 }
648
649 if (orient == StdRegions::eNoOrientation)
650 {
651 orient = GetTraceOrient(edge);
652 }
653 // Reverse data if necessary
654 if (orient == StdRegions::eBackwards)
655 {
656 Vmath::Reverse(EdgeExp->GetNumPoints(0), &outarray[0], 1, &outarray[0],
657 1);
658 }
659}

References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::StdRegions::eNoOrientation, GetEdgeInterpVals(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::LocalRegions::Expansion::GetTraceOrient(), Nektar::LibUtilities::Interp1D(), Nektar::StdRegions::StdExpansion::m_base, Vmath::Reverse(), and Vmath::Vcopy().

◆ v_GetTraceQFactors()

void Nektar::LocalRegions::QuadExp::v_GetTraceQFactors ( const int  edge,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 767 of file QuadExp.cpp.

769{
770 int i;
771 int nquad0 = m_base[0]->GetNumPoints();
772 int nquad1 = m_base[1]->GetNumPoints();
773
775 const Array<OneD, const NekDouble> &jac = m_metricinfo->GetJac(ptsKeys);
776 const Array<TwoD, const NekDouble> &df =
777 m_metricinfo->GetDerivFactors(ptsKeys);
778
779 Array<OneD, NekDouble> j(max(nquad0, nquad1), 0.0);
780 Array<OneD, NekDouble> g0(max(nquad0, nquad1), 0.0);
781 Array<OneD, NekDouble> g1(max(nquad0, nquad1), 0.0);
782 Array<OneD, NekDouble> g2(max(nquad0, nquad1), 0.0);
783 Array<OneD, NekDouble> g3(max(nquad0, nquad1), 0.0);
784
785 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
786 {
787 // Implementation for all the basis except Gauss points
790 {
791 switch (edge)
792 {
793 case 0:
794 Vmath::Vcopy(nquad0, &(df[1][0]), 1, &(g1[0]), 1);
795 Vmath::Vcopy(nquad0, &(df[3][0]), 1, &(g3[0]), 1);
796 Vmath::Vcopy(nquad0, &(jac[0]), 1, &(j[0]), 1);
797
798 for (i = 0; i < nquad0; ++i)
799 {
800 outarray[i] =
801 j[i] * sqrt(g1[i] * g1[i] + g3[i] * g3[i]);
802 }
803 break;
804 case 1:
805 Vmath::Vcopy(nquad1, &(df[0][0]) + (nquad0 - 1), nquad0,
806 &(g0[0]), 1);
807
808 Vmath::Vcopy(nquad1, &(df[2][0]) + (nquad0 - 1), nquad0,
809 &(g2[0]), 1);
810
811 Vmath::Vcopy(nquad1, &(jac[0]) + (nquad0 - 1), nquad0,
812 &(j[0]), 1);
813
814 for (i = 0; i < nquad1; ++i)
815 {
816 outarray[i] =
817 j[i] * sqrt(g0[i] * g0[i] + g2[i] * g2[i]);
818 }
819 break;
820 case 2:
821
822 Vmath::Vcopy(nquad0, &(df[1][0]) + (nquad0 * (nquad1 - 1)),
823 1, &(g1[0]), 1);
824
825 Vmath::Vcopy(nquad0, &(df[3][0]) + (nquad0 * (nquad1 - 1)),
826 1, &(g3[0]), 1);
827
828 Vmath::Vcopy(nquad0, &(jac[0]) + (nquad0 * (nquad1 - 1)), 1,
829 &(j[0]), 1);
830
831 for (i = 0; i < nquad0; ++i)
832 {
833 outarray[i] =
834 j[i] * sqrt(g1[i] * g1[i] + g3[i] * g3[i]);
835 }
836 break;
837 case 3:
838
839 Vmath::Vcopy(nquad1, &(df[0][0]), nquad0, &(g0[0]), 1);
840 Vmath::Vcopy(nquad1, &(df[2][0]), nquad0, &(g2[0]), 1);
841 Vmath::Vcopy(nquad1, &(jac[0]), nquad0, &(j[0]), 1);
842
843 for (i = 0; i < nquad1; ++i)
844 {
845 outarray[i] =
846 j[i] * sqrt(g0[i] * g0[i] + g2[i] * g2[i]);
847 }
848 break;
849 default:
850 ASSERTL0(false, "edge value (< 3) is out of range");
851 break;
852 }
853 }
854 else
855 {
856 int nqtot = nquad0 * nquad1;
857 Array<OneD, NekDouble> tmp_gmat0(nqtot, 0.0);
858 Array<OneD, NekDouble> tmp_gmat1(nqtot, 0.0);
859 Array<OneD, NekDouble> tmp_gmat2(nqtot, 0.0);
860 Array<OneD, NekDouble> tmp_gmat3(nqtot, 0.0);
861 Array<OneD, NekDouble> g0_edge(max(nquad0, nquad1), 0.0);
862 Array<OneD, NekDouble> g1_edge(max(nquad0, nquad1), 0.0);
863 Array<OneD, NekDouble> g2_edge(max(nquad0, nquad1), 0.0);
864 Array<OneD, NekDouble> g3_edge(max(nquad0, nquad1), 0.0);
865 Array<OneD, NekDouble> jac_edge(max(nquad0, nquad1), 0.0);
866
867 switch (edge)
868 {
869 case 0:
870 Vmath::Vmul(nqtot, &(df[1][0]), 1, &jac[0], 1,
871 &(tmp_gmat1[0]), 1);
872 Vmath::Vmul(nqtot, &(df[3][0]), 1, &jac[0], 1,
873 &(tmp_gmat3[0]), 1);
874 QuadExp::GetEdgeInterpVals(edge, tmp_gmat1, g1_edge);
875 QuadExp::GetEdgeInterpVals(edge, tmp_gmat3, g3_edge);
876
877 for (i = 0; i < nquad0; ++i)
878 {
879 outarray[i] = sqrt(g1_edge[i] * g1_edge[i] +
880 g3_edge[i] * g3_edge[i]);
881 }
882 break;
883
884 case 1:
885 Vmath::Vmul(nqtot, &(df[0][0]), 1, &jac[0], 1,
886 &(tmp_gmat0[0]), 1);
887 Vmath::Vmul(nqtot, &(df[2][0]), 1, &jac[0], 1,
888 &(tmp_gmat2[0]), 1);
889 QuadExp::GetEdgeInterpVals(edge, tmp_gmat0, g0_edge);
890 QuadExp::GetEdgeInterpVals(edge, tmp_gmat2, g2_edge);
891
892 for (i = 0; i < nquad1; ++i)
893 {
894 outarray[i] = sqrt(g0_edge[i] * g0_edge[i] +
895 g2_edge[i] * g2_edge[i]);
896 }
897
898 break;
899 case 2:
900
901 Vmath::Vmul(nqtot, &(df[1][0]), 1, &jac[0], 1,
902 &(tmp_gmat1[0]), 1);
903 Vmath::Vmul(nqtot, &(df[3][0]), 1, &jac[0], 1,
904 &(tmp_gmat3[0]), 1);
905 QuadExp::GetEdgeInterpVals(edge, tmp_gmat1, g1_edge);
906 QuadExp::GetEdgeInterpVals(edge, tmp_gmat3, g3_edge);
907
908 for (i = 0; i < nquad0; ++i)
909 {
910 outarray[i] = sqrt(g1_edge[i] * g1_edge[i] +
911 g3_edge[i] * g3_edge[i]);
912 }
913
914 Vmath::Reverse(nquad0, &outarray[0], 1, &outarray[0], 1);
915
916 break;
917 case 3:
918 Vmath::Vmul(nqtot, &(df[0][0]), 1, &jac[0], 1,
919 &(tmp_gmat0[0]), 1);
920 Vmath::Vmul(nqtot, &(df[2][0]), 1, &jac[0], 1,
921 &(tmp_gmat2[0]), 1);
922 QuadExp::GetEdgeInterpVals(edge, tmp_gmat0, g0_edge);
923 QuadExp::GetEdgeInterpVals(edge, tmp_gmat2, g2_edge);
924
925 for (i = 0; i < nquad1; ++i)
926 {
927 outarray[i] = sqrt(g0_edge[i] * g0_edge[i] +
928 g2_edge[i] * g2_edge[i]);
929 }
930
931 Vmath::Reverse(nquad1, &outarray[0], 1, &outarray[0], 1);
932
933 break;
934 default:
935 ASSERTL0(false, "edge value (< 3) is out of range");
936 break;
937 }
938 }
939 }
940 else
941 {
942
943 switch (edge)
944 {
945 case 0:
946
947 for (i = 0; i < nquad0; ++i)
948 {
949 outarray[i] = jac[0] * sqrt(df[1][0] * df[1][0] +
950 df[3][0] * df[3][0]);
951 }
952 break;
953 case 1:
954 for (i = 0; i < nquad1; ++i)
955 {
956 outarray[i] = jac[0] * sqrt(df[0][0] * df[0][0] +
957 df[2][0] * df[2][0]);
958 }
959 break;
960 case 2:
961 for (i = 0; i < nquad0; ++i)
962 {
963 outarray[i] = jac[0] * sqrt(df[1][0] * df[1][0] +
964 df[3][0] * df[3][0]);
965 }
966 break;
967 case 3:
968 for (i = 0; i < nquad1; ++i)
969 {
970 outarray[i] = jac[0] * sqrt(df[0][0] * df[0][0] +
971 df[2][0] * df[2][0]);
972 }
973 break;
974 default:
975 ASSERTL0(false, "edge value (< 3) is out of range");
976 break;
977 }
978 }
979}

References ASSERTL0, Nektar::SpatialDomains::eDeformed, Nektar::LibUtilities::eGaussGaussLegendre, GetEdgeInterpVals(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Reverse(), tinysimd::sqrt(), Vmath::Vcopy(), and Vmath::Vmul().

◆ v_HelmholtzMatrixOp()

void Nektar::LocalRegions::QuadExp::v_HelmholtzMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1453 of file QuadExp.cpp.

1456{
1457 QuadExp::HelmholtzMatrixOp_MatFree(inarray, outarray, mkey);
1458}
void HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion::HelmholtzMatrixOp_MatFree().

◆ v_Integral()

NekDouble Nektar::LocalRegions::QuadExp::v_Integral ( const Array< OneD, const NekDouble > &  inarray)
overrideprotectedvirtual

Integrates the specified function over the domain.

See also
StdRegions::StdExpansion::Integral.

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 73 of file QuadExp.cpp.

74{
75 int nquad0 = m_base[0]->GetNumPoints();
76 int nquad1 = m_base[1]->GetNumPoints();
77 Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
78 NekDouble ival;
79 Array<OneD, NekDouble> tmp(nquad0 * nquad1);
80
81 // multiply inarray with Jacobian
82 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
83 {
84 Vmath::Vmul(nquad0 * nquad1, jac, 1, inarray, 1, tmp, 1);
85 }
86 else
87 {
88 Vmath::Smul(nquad0 * nquad1, jac[0], inarray, 1, tmp, 1);
89 }
90
91 // call StdQuadExp version;
92 ival = StdQuadExp::v_Integral(tmp);
93 return ival;
94}

References Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Smul(), and Vmath::Vmul().

◆ v_IProductWRTBase()

void Nektar::LocalRegions::QuadExp::v_IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Calculate the inner product of inarray with respect to the basis B=base0*base1 and put into outarray.

\( \begin{array}{rcl} I_{pq} = (\phi_p \phi_q, u) & = & \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \phi_p(\xi_{0,i}) \phi_q(\xi_{1,j}) w^0_i w^1_j u(\xi_{0,i} \xi_{1,j}) \\ & = & \sum_{i=0}^{nq_0} \phi_p(\xi_{0,i}) \sum_{j=0}^{nq_1} \phi_q(\xi_{1,j}) \tilde{u}_{i,j} \end{array} \)

where

\( \tilde{u}_{i,j} = w^0_i w^1_j u(\xi_{0,i},\xi_{1,j}) \)

which can be implemented as

\( f_{qi} = \sum_{j=0}^{nq_1} \phi_q(\xi_{1,j}) \tilde{u}_{i,j} = {\bf B_1 U} \) \( I_{pq} = \sum_{i=0}^{nq_0} \phi_p(\xi_{0,i}) f_{qi} = {\bf B_0 F} \)

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 374 of file QuadExp.cpp.

376{
377 if (m_base[0]->Collocation() && m_base[1]->Collocation())
378 {
379 MultiplyByQuadratureMetric(inarray, outarray);
380 }
381 else
382 {
383 IProductWRTBase_SumFac(inarray, outarray);
384 }
385}
void IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)

References Nektar::StdRegions::StdExpansion::IProductWRTBase_SumFac(), Nektar::StdRegions::StdExpansion::m_base, and Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric().

◆ v_IProductWRTBase_SumFac()

void Nektar::LocalRegions::QuadExp::v_IProductWRTBase_SumFac ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  multiplybyweights = true 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 394 of file QuadExp.cpp.

397{
398 int nquad0 = m_base[0]->GetNumPoints();
399 int nquad1 = m_base[1]->GetNumPoints();
400 int order0 = m_base[0]->GetNumModes();
401
402 if (multiplybyweights)
403 {
404 Array<OneD, NekDouble> tmp(nquad0 * nquad1 + nquad1 * order0);
405 Array<OneD, NekDouble> wsp(tmp + nquad0 * nquad1);
406
407 MultiplyByQuadratureMetric(inarray, tmp);
408 StdQuadExp::IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
409 m_base[1]->GetBdata(), tmp,
410 outarray, wsp, true, true);
411 }
412 else
413 {
414 Array<OneD, NekDouble> wsp(nquad1 * order0);
415
416 StdQuadExp::IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
417 m_base[1]->GetBdata(), inarray,
418 outarray, wsp, true, true);
419 }
420}

References Nektar::StdRegions::StdExpansion::m_base, and Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric().

◆ v_IProductWRTDerivBase()

void Nektar::LocalRegions::QuadExp::v_IProductWRTDerivBase ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 387 of file QuadExp.cpp.

390{
391 IProductWRTDerivBase_SumFac(dir, inarray, outarray);
392}
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)

References Nektar::StdRegions::StdExpansion::IProductWRTDerivBase_SumFac().

◆ v_IProductWRTDerivBase_SumFac()

void Nektar::LocalRegions::QuadExp::v_IProductWRTDerivBase_SumFac ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 422 of file QuadExp.cpp.

425{
426 ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
427 ASSERTL1((dir == 2) ? (m_geom->GetCoordim() == 3) : true,
428 "Invalid direction.");
429
430 int nquad0 = m_base[0]->GetNumPoints();
431 int nquad1 = m_base[1]->GetNumPoints();
432 int nqtot = nquad0 * nquad1;
433 int nmodes0 = m_base[0]->GetNumModes();
434
435 Array<OneD, NekDouble> tmp1(2 * nqtot + m_ncoeffs + nmodes0 * nquad1);
436 Array<OneD, NekDouble> tmp2(tmp1 + nqtot);
437 Array<OneD, NekDouble> tmp3(tmp1 + 2 * nqtot);
438 Array<OneD, NekDouble> tmp4(tmp1 + 2 * nqtot + m_ncoeffs);
439
440 Array<OneD, Array<OneD, NekDouble>> tmp2D{2};
441 tmp2D[0] = tmp1;
442 tmp2D[1] = tmp2;
443
444 QuadExp::v_AlignVectorToCollapsedDir(dir, inarray, tmp2D);
445
446 MultiplyByQuadratureMetric(tmp1, tmp1);
447 MultiplyByQuadratureMetric(tmp2, tmp2);
448
449 IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
450 tmp1, tmp3, tmp4, false, true);
451 IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
452 tmp2, outarray, tmp4, true, false);
453 Vmath::Vadd(m_ncoeffs, tmp3, 1, outarray, 1, outarray, 1);
454}
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition: QuadExp.cpp:456
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:354

References ASSERTL1, Nektar::StdRegions::StdExpansion2D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), v_AlignVectorToCollapsedDir(), and Vmath::Vadd().

◆ v_LaplacianMatrixOp() [1/2]

void Nektar::LocalRegions::QuadExp::v_LaplacianMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1416 of file QuadExp.cpp.

1419{
1420 QuadExp::LaplacianMatrixOp_MatFree(inarray, outarray, mkey);
1421}
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion::LaplacianMatrixOp_MatFree().

◆ v_LaplacianMatrixOp() [2/2]

void Nektar::LocalRegions::QuadExp::v_LaplacianMatrixOp ( const int  k1,
const int  k2,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1423 of file QuadExp.cpp.

1427{
1428 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
1429}

◆ v_LaplacianMatrixOp_MatFree_Kernel()

void Nektar::LocalRegions::QuadExp::v_LaplacianMatrixOp_MatFree_Kernel ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
Array< OneD, NekDouble > &  wsp 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1500 of file QuadExp.cpp.

1503{
1504 if (m_metrics.count(eMetricLaplacian00) == 0)
1505 {
1507 }
1508
1509 int nquad0 = m_base[0]->GetNumPoints();
1510 int nquad1 = m_base[1]->GetNumPoints();
1511 int nqtot = nquad0 * nquad1;
1512 int nmodes0 = m_base[0]->GetNumModes();
1513 int nmodes1 = m_base[1]->GetNumModes();
1514 int wspsize =
1515 max(max(max(nqtot, m_ncoeffs), nquad1 * nmodes0), nquad0 * nmodes1);
1516
1517 ASSERTL1(wsp.size() >= 3 * wspsize, "Workspace is of insufficient size.");
1518
1519 const Array<OneD, const NekDouble> &base0 = m_base[0]->GetBdata();
1520 const Array<OneD, const NekDouble> &base1 = m_base[1]->GetBdata();
1521 const Array<OneD, const NekDouble> &dbase0 = m_base[0]->GetDbdata();
1522 const Array<OneD, const NekDouble> &dbase1 = m_base[1]->GetDbdata();
1523 const Array<OneD, const NekDouble> &metric00 =
1525 const Array<OneD, const NekDouble> &metric01 =
1527 const Array<OneD, const NekDouble> &metric11 =
1529
1530 // Allocate temporary storage
1531 Array<OneD, NekDouble> wsp0(wsp);
1532 Array<OneD, NekDouble> wsp1(wsp + wspsize);
1533 Array<OneD, NekDouble> wsp2(wsp + 2 * wspsize);
1534
1535 StdExpansion2D::PhysTensorDeriv(inarray, wsp1, wsp2);
1536
1537 // wsp0 = k = g0 * wsp1 + g1 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1538 // wsp2 = l = g1 * wsp1 + g2 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1539 // where g0, g1 and g2 are the metric terms set up in the GeomFactors class
1540 // especially for this purpose
1541 Vmath::Vvtvvtp(nqtot, &metric00[0], 1, &wsp1[0], 1, &metric01[0], 1,
1542 &wsp2[0], 1, &wsp0[0], 1);
1543 Vmath::Vvtvvtp(nqtot, &metric01[0], 1, &wsp1[0], 1, &metric11[0], 1,
1544 &wsp2[0], 1, &wsp2[0], 1);
1545
1546 // outarray = m = (D_xi1 * B)^T * k
1547 // wsp1 = n = (D_xi2 * B)^T * l
1548 IProductWRTBase_SumFacKernel(dbase0, base1, wsp0, outarray, wsp1, false,
1549 true);
1550 IProductWRTBase_SumFacKernel(base0, dbase1, wsp2, wsp1, wsp0, true, false);
1551
1552 // outarray = outarray + wsp1
1553 // = L * u_hat
1554 Vmath::Vadd(m_ncoeffs, wsp1.get(), 1, outarray.get(), 1, outarray.get(), 1);
1555}
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Definition: Vmath.cpp:687

References ASSERTL1, Nektar::LocalRegions::Expansion::ComputeLaplacianMetric(), Nektar::LocalRegions::eMetricLaplacian00, Nektar::LocalRegions::eMetricLaplacian01, Nektar::LocalRegions::eMetricLaplacian11, Nektar::StdRegions::StdExpansion2D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metrics, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vadd(), and Vmath::Vvtvvtp().

◆ v_MassLevelCurvatureMatrixOp()

void Nektar::LocalRegions::QuadExp::v_MassLevelCurvatureMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1446 of file QuadExp.cpp.

1449{
1450 StdExpansion::MassLevelCurvatureMatrixOp_MatFree(inarray, outarray, mkey);
1451}

◆ v_MassMatrixOp()

void Nektar::LocalRegions::QuadExp::v_MassMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1409 of file QuadExp.cpp.

1412{
1413 StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
1414}

◆ v_NormalTraceDerivFactors()

void Nektar::LocalRegions::QuadExp::v_NormalTraceDerivFactors ( Array< OneD, Array< OneD, NekDouble > > &  factors,
Array< OneD, Array< OneD, NekDouble > > &  d0factors,
Array< OneD, Array< OneD, NekDouble > > &  d1factors 
)
overrideprotectedvirtual

: This method gets all of the factors which are required as part of the Gradient Jump Penalty (GJP) stabilisation and involves the product of the normal and geometric factors along the element trace.

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1626 of file QuadExp.cpp.

1630{
1631 boost::ignore_unused(d2factors); // for 3D shapes
1632 int nquad0 = GetNumPoints(0);
1633 int nquad1 = GetNumPoints(1);
1634
1635 const Array<TwoD, const NekDouble> &df =
1636 m_metricinfo->GetDerivFactors(GetPointsKeys());
1637
1638 if (d0factors.size() != 4)
1639 {
1640 d0factors = Array<OneD, Array<OneD, NekDouble>>(4);
1641 d1factors = Array<OneD, Array<OneD, NekDouble>>(4);
1642 }
1643
1644 if (d0factors[0].size() != nquad0)
1645 {
1646 d0factors[0] = Array<OneD, NekDouble>(nquad0);
1647 d0factors[2] = Array<OneD, NekDouble>(nquad0);
1648 d1factors[0] = Array<OneD, NekDouble>(nquad0);
1649 d1factors[2] = Array<OneD, NekDouble>(nquad0);
1650 }
1651
1652 if (d0factors[1].size() != nquad1)
1653 {
1654 d0factors[1] = Array<OneD, NekDouble>(nquad1);
1655 d0factors[3] = Array<OneD, NekDouble>(nquad1);
1656 d1factors[1] = Array<OneD, NekDouble>(nquad1);
1657 d1factors[3] = Array<OneD, NekDouble>(nquad1);
1658 }
1659
1660 // Outwards normals
1661 const Array<OneD, const Array<OneD, NekDouble>> &normal_0 =
1662 GetTraceNormal(0);
1663 const Array<OneD, const Array<OneD, NekDouble>> &normal_1 =
1664 GetTraceNormal(1);
1665 const Array<OneD, const Array<OneD, NekDouble>> &normal_2 =
1666 GetTraceNormal(2);
1667 const Array<OneD, const Array<OneD, NekDouble>> &normal_3 =
1668 GetTraceNormal(3);
1669
1670 int ncoords = normal_0.size();
1671
1672 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1673 {
1674 // needs checking for 3D coords
1675
1676 // factors 0 and 2
1677 for (int i = 0; i < nquad0; ++i)
1678 {
1679 d0factors[0][i] = df[0][i] * normal_0[0][i];
1680 d0factors[2][i] = df[0][nquad0 * (nquad1 - 1) + i] * normal_2[0][i];
1681
1682 d1factors[0][i] = df[1][i] * normal_0[0][i];
1683 d1factors[2][i] = df[1][nquad0 * (nquad1 - 1) + i] * normal_2[0][i];
1684 }
1685
1686 for (int n = 1; n < ncoords; ++n)
1687 {
1688 // d xi_1/dy n_y
1689 // needs checking for 3D coords
1690 for (int i = 0; i < nquad0; ++i)
1691 {
1692 d0factors[0][i] += df[2 * n][i] * normal_0[n][i];
1693 d0factors[2][i] +=
1694 df[2 * n][nquad0 * (nquad1 - 1) + i] * normal_2[n][i];
1695
1696 d1factors[0][i] += df[2 * n + 1][i] * normal_0[n][i];
1697 d1factors[2][i] +=
1698 df[2 * n + 1][nquad0 * (nquad1 - 1) + i] * normal_2[n][i];
1699 }
1700 }
1701
1702 // faces 1 and 3
1703 for (int i = 0; i < nquad1; ++i)
1704 {
1705 d0factors[1][i] = df[0][(i + 1) * nquad0 - 1] * normal_1[0][i];
1706 d0factors[3][i] = df[0][i * nquad0] * normal_3[0][i];
1707
1708 d1factors[1][i] = df[1][(i + 1) * nquad0 - 1] * normal_1[0][i];
1709 d1factors[3][i] = df[1][i * nquad0] * normal_3[0][i];
1710 }
1711
1712 for (int n = 1; n < ncoords; ++n)
1713 {
1714 for (int i = 0; i < nquad1; ++i)
1715 {
1716 d0factors[1][i] +=
1717 df[2 * n][(i + 1) * nquad0 - 1] * normal_1[n][i];
1718 d0factors[3][i] += df[2 * n][i * nquad0] * normal_3[n][i];
1719
1720 d1factors[1][i] +=
1721 df[2 * n + 1][(i + 1) * nquad0 - 1] * normal_1[n][i];
1722 d1factors[3][i] += df[2 * n + 1][i * nquad0] * normal_3[n][i];
1723 }
1724 }
1725 }
1726 else
1727 {
1728 // d xi_2/dx n_x
1729 for (int i = 0; i < nquad0; ++i)
1730 {
1731 d1factors[0][i] = df[1][0] * normal_0[0][i];
1732 d1factors[2][i] = df[1][0] * normal_2[0][i];
1733 }
1734
1735 // d xi_1/dx n_x
1736 for (int i = 0; i < nquad1; ++i)
1737 {
1738 d0factors[1][i] = df[0][0] * normal_1[0][i];
1739 d0factors[3][i] = df[0][0] * normal_3[0][i];
1740 }
1741
1742 for (int n = 1; n < ncoords; ++n)
1743 {
1744 // d xi_2/dy n_y
1745 // needs checking for 3D coords
1746 for (int i = 0; i < nquad0; ++i)
1747 {
1748 d1factors[0][i] += df[2 * n + 1][0] * normal_0[n][i];
1749 d1factors[2][i] += df[2 * n + 1][0] * normal_2[n][i];
1750 }
1751
1752 // d xi_1/dy n_y
1753 // needs checking for 3D coords
1754 for (int i = 0; i < nquad1; ++i)
1755 {
1756 d0factors[1][i] += df[2 * n][0] * normal_1[n][i];
1757 d0factors[3][i] += df[2 * n][0] * normal_3[n][i];
1758 }
1759 }
1760
1761 // d1factors
1762 // d xi_1/dx n_x
1763 for (int i = 0; i < nquad0; ++i)
1764 {
1765 d0factors[0][i] = df[0][0] * normal_0[0][i];
1766 d0factors[2][i] = df[0][0] * normal_2[0][i];
1767 }
1768
1769 // d xi_2/dx n_x
1770 for (int i = 0; i < nquad1; ++i)
1771 {
1772 d1factors[1][i] = df[1][0] * normal_1[0][i];
1773 d1factors[3][i] = df[1][0] * normal_3[0][i];
1774 }
1775
1776 for (int n = 1; n < ncoords; ++n)
1777 {
1778 // d xi_1/dy n_y
1779 // needs checking for 3D coords
1780 for (int i = 0; i < nquad0; ++i)
1781 {
1782 d0factors[0][i] += df[2 * n][0] * normal_0[n][i];
1783 d0factors[2][i] += df[2 * n][0] * normal_2[n][i];
1784 }
1785
1786 // d xi_2/dy n_y
1787 // needs checking for 3D coords
1788 for (int i = 0; i < nquad1; ++i)
1789 {
1790 d1factors[1][i] += df[2 * n + 1][0] * normal_1[n][i];
1791 d1factors[3][i] += df[2 * n + 1][0] * normal_3[n][i];
1792 }
1793 }
1794 }
1795}
const NormalVector & GetTraceNormal(const int id)
Definition: Expansion.cpp:255

References Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::LocalRegions::Expansion::GetTraceNormal(), and Nektar::LocalRegions::Expansion::m_metricinfo.

◆ v_NormVectorIProductWRTBase() [1/2]

void Nektar::LocalRegions::QuadExp::v_NormVectorIProductWRTBase ( const Array< OneD, const Array< OneD, NekDouble > > &  Fvec,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 518 of file QuadExp.cpp.

521{
522 NormVectorIProductWRTBase(Fvec[0], Fvec[1], Fvec[2], outarray);
523}
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:619

References Nektar::StdRegions::StdExpansion::NormVectorIProductWRTBase().

◆ v_NormVectorIProductWRTBase() [2/2]

void Nektar::LocalRegions::QuadExp::v_NormVectorIProductWRTBase ( const Array< OneD, const NekDouble > &  Fx,
const Array< OneD, const NekDouble > &  Fy,
const Array< OneD, const NekDouble > &  Fz,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 490 of file QuadExp.cpp.

494{
495 int nq = m_base[0]->GetNumPoints() * m_base[1]->GetNumPoints();
496 Array<OneD, NekDouble> Fn(nq);
497
498 const Array<OneD, const Array<OneD, NekDouble>> &normals =
499 GetLeftAdjacentElementExp()->GetTraceNormal(
501
502 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
503 {
504 Vmath::Vvtvvtp(nq, &normals[0][0], 1, &Fx[0], 1, &normals[1][0], 1,
505 &Fy[0], 1, &Fn[0], 1);
506 Vmath::Vvtvp(nq, &normals[2][0], 1, &Fz[0], 1, &Fn[0], 1, &Fn[0], 1);
507 }
508 else
509 {
510 Vmath::Svtsvtp(nq, normals[0][0], &Fx[0], 1, normals[1][0], &Fy[0], 1,
511 &Fn[0], 1);
512 Vmath::Svtvp(nq, normals[2][0], &Fz[0], 1, &Fn[0], 1, &Fn[0], 1);
513 }
514
515 IProductWRTBase(Fn, outarray);
516}
ExpansionSharedPtr GetLeftAdjacentElementExp() const
Definition: Expansion.h:443
int GetLeftAdjacentElementTrace() const
Definition: Expansion.h:456
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
svtvvtp (scalar times vector plus scalar times vector):
Definition: Vmath.cpp:746
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:617

References Nektar::SpatialDomains::eDeformed, Nektar::LocalRegions::Expansion::GetLeftAdjacentElementExp(), Nektar::LocalRegions::Expansion::GetLeftAdjacentElementTrace(), Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Svtsvtp(), Vmath::Svtvp(), Vmath::Vvtvp(), and Vmath::Vvtvvtp().

◆ v_PhysDeriv() [1/2]

void Nektar::LocalRegions::QuadExp::v_PhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 = NullNekDouble1DArray 
)
overrideprotectedvirtual

Calculate the derivative of the physical points.

For quadrilateral region can use the Tensor_Deriv function defined under StdExpansion.

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 96 of file QuadExp.cpp.

100{
101 int nquad0 = m_base[0]->GetNumPoints();
102 int nquad1 = m_base[1]->GetNumPoints();
103 int nqtot = nquad0 * nquad1;
104 const Array<TwoD, const NekDouble> &df =
105 m_metricinfo->GetDerivFactors(GetPointsKeys());
106 Array<OneD, NekDouble> diff0(2 * nqtot);
107 Array<OneD, NekDouble> diff1(diff0 + nqtot);
108
109 StdQuadExp::v_PhysDeriv(inarray, diff0, diff1);
110
111 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
112 {
113 if (out_d0.size())
114 {
115 Vmath::Vmul(nqtot, df[0], 1, diff0, 1, out_d0, 1);
116 Vmath::Vvtvp(nqtot, df[1], 1, diff1, 1, out_d0, 1, out_d0, 1);
117 }
118
119 if (out_d1.size())
120 {
121 Vmath::Vmul(nqtot, df[2], 1, diff0, 1, out_d1, 1);
122 Vmath::Vvtvp(nqtot, df[3], 1, diff1, 1, out_d1, 1, out_d1, 1);
123 }
124
125 if (out_d2.size())
126 {
127 Vmath::Vmul(nqtot, df[4], 1, diff0, 1, out_d2, 1);
128 Vmath::Vvtvp(nqtot, df[5], 1, diff1, 1, out_d2, 1, out_d2, 1);
129 }
130 }
131 else // regular geometry
132 {
133 if (out_d0.size())
134 {
135 Vmath::Smul(nqtot, df[0][0], diff0, 1, out_d0, 1);
136 Blas::Daxpy(nqtot, df[1][0], diff1, 1, out_d0, 1);
137 }
138
139 if (out_d1.size())
140 {
141 Vmath::Smul(nqtot, df[2][0], diff0, 1, out_d1, 1);
142 Blas::Daxpy(nqtot, df[3][0], diff1, 1, out_d1, 1);
143 }
144
145 if (out_d2.size())
146 {
147 Vmath::Smul(nqtot, df[4][0], diff0, 1, out_d2, 1);
148 Blas::Daxpy(nqtot, df[5][0], diff1, 1, out_d2, 1);
149 }
150 }
151}
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:137

References Blas::Daxpy(), Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Smul(), Vmath::Vmul(), and Vmath::Vvtvp().

Referenced by v_PhysDeriv().

◆ v_PhysDeriv() [2/2]

void Nektar::LocalRegions::QuadExp::v_PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0 
)
overrideprotectedvirtual

Calculate the derivative of the physical points in a given direction.

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 153 of file QuadExp.cpp.

156{
157 switch (dir)
158 {
159 case 0:
160 {
161 v_PhysDeriv(inarray, outarray, NullNekDouble1DArray,
163 }
164 break;
165 case 1:
166 {
167 v_PhysDeriv(inarray, NullNekDouble1DArray, outarray,
169 }
170 break;
171 case 2:
172 {
174 outarray);
175 }
176 break;
177 default:
178 {
179 ASSERTL1(false, "input dir is out of range");
180 }
181 break;
182 }
183}
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Calculate the derivative of the physical points.
Definition: QuadExp.cpp:96
static Array< OneD, NekDouble > NullNekDouble1DArray

References ASSERTL1, Nektar::NullNekDouble1DArray, and v_PhysDeriv().

◆ v_PhysDirectionalDeriv()

void Nektar::LocalRegions::QuadExp::v_PhysDirectionalDeriv ( const Array< OneD, const NekDouble > &  inarray,
const Array< OneD, const NekDouble > &  direction,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Physical derivative along a direction vector.

See also
StdRegions::StdExpansion::PhysDirectionalDeriv

D_v = d/dx_v^s + d/dx_v^r

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 185 of file QuadExp.cpp.

188{
189 int nquad0 = m_base[0]->GetNumPoints();
190 int nquad1 = m_base[1]->GetNumPoints();
191 int nqtot = nquad0 * nquad1;
192
193 const Array<TwoD, const NekDouble> &df =
194 m_metricinfo->GetDerivFactors(GetPointsKeys());
195
196 Array<OneD, NekDouble> diff0(2 * nqtot);
197 Array<OneD, NekDouble> diff1(diff0 + nqtot);
198
199 StdQuadExp::v_PhysDeriv(inarray, diff0, diff1);
200
201 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
202 {
203 Array<OneD, Array<OneD, NekDouble>> tangmat(2);
204
205 // d/dx_v^s = v_x*ds/dx + v_y*ds/dy + v_z*dx/dz
206 for (int i = 0; i < 2; ++i)
207 {
208 tangmat[i] = Array<OneD, NekDouble>(nqtot, 0.0);
209 for (int k = 0; k < (m_geom->GetCoordim()); ++k)
210 {
211 Vmath::Vvtvp(nqtot, &df[2 * k + i][0], 1, &direction[k * nqtot],
212 1, &tangmat[i][0], 1, &tangmat[i][0], 1);
213 }
214 }
215
216 /// D_v = d/dx_v^s + d/dx_v^r
217 if (out.size())
218 {
219 Vmath::Vmul(nqtot, &tangmat[0][0], 1, &diff0[0], 1, &out[0], 1);
220 Vmath::Vvtvp(nqtot, &tangmat[1][0], 1, &diff1[0], 1, &out[0], 1,
221 &out[0], 1);
222 }
223 }
224 else
225 {
227 "Wrong route");
228 }
229}

References ASSERTL1, Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Vmul(), and Vmath::Vvtvp().

◆ v_PhysEvaluate() [1/2]

NekDouble Nektar::LocalRegions::QuadExp::v_PhysEvaluate ( const Array< OneD, const NekDouble > &  coords,
const Array< OneD, const NekDouble > &  physvals 
)
overrideprotectedvirtual

This function evaluates the expansion at a single (arbitrary) point of the domain.

This function is a wrapper around the virtual function v_PhysEvaluate()

Based on the value of the expansion at the quadrature points, this function calculates the value of the expansion at an arbitrary single points (with coordinates \( \mathbf{x_c}\) given by the pointer coords). This operation, equivalent to

\[ u(\mathbf{x_c}) = \sum_p \phi_p(\mathbf{x_c}) \hat{u}_p \]

is evaluated using Lagrangian interpolants through the quadrature points:

\[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\]

This function requires that the physical value array \(\mathbf{u}\) (implemented as the attribute #m_phys) is set.

Parameters
coordsthe coordinates of the single point
Returns
returns the value of the expansion at the single point

Reimplemented from Nektar::StdRegions::StdExpansion2D.

Definition at line 578 of file QuadExp.cpp.

580{
581 Array<OneD, NekDouble> Lcoord = Array<OneD, NekDouble>(2);
582
583 ASSERTL0(m_geom, "m_geom not defined");
584 m_geom->GetLocCoords(coord, Lcoord);
585
586 return StdExpansion2D::v_PhysEvaluate(Lcoord, physvals);
587}

References ASSERTL0, and Nektar::LocalRegions::Expansion::m_geom.

◆ v_PhysEvaluate() [2/2]

NekDouble Nektar::LocalRegions::QuadExp::v_PhysEvaluate ( const Array< OneD, NekDouble > &  coord,
const Array< OneD, const NekDouble > &  inarray,
std::array< NekDouble, 3 > &  firstOrderDerivs 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 589 of file QuadExp.cpp.

592{
593 Array<OneD, NekDouble> Lcoord(2);
594 ASSERTL0(m_geom, "m_geom not defined");
595 m_geom->GetLocCoords(coord, Lcoord);
596 return StdQuadExp::v_PhysEvaluate(Lcoord, inarray, firstOrderDerivs);
597}

References ASSERTL0, and Nektar::LocalRegions::Expansion::m_geom.

◆ v_ReduceOrderCoeffs()

void Nektar::LocalRegions::QuadExp::v_ReduceOrderCoeffs ( int  numMin,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1460 of file QuadExp.cpp.

1463{
1464 int n_coeffs = inarray.size();
1465
1466 Array<OneD, NekDouble> coeff(n_coeffs);
1467 Array<OneD, NekDouble> coeff_tmp(n_coeffs, 0.0);
1468 Array<OneD, NekDouble> tmp, tmp2;
1469
1470 int nmodes0 = m_base[0]->GetNumModes();
1471 int nmodes1 = m_base[1]->GetNumModes();
1472 int numMax = nmodes0;
1473
1474 Vmath::Vcopy(n_coeffs, inarray, 1, coeff_tmp, 1);
1475
1476 const LibUtilities::PointsKey Pkey0(nmodes0,
1478 const LibUtilities::PointsKey Pkey1(nmodes1,
1480 LibUtilities::BasisKey b0(m_base[0]->GetBasisType(), nmodes0, Pkey0);
1481 LibUtilities::BasisKey b1(m_base[1]->GetBasisType(), nmodes1, Pkey1);
1482 LibUtilities::BasisKey bortho0(LibUtilities::eOrtho_A, nmodes0, Pkey0);
1483 LibUtilities::BasisKey bortho1(LibUtilities::eOrtho_A, nmodes1, Pkey1);
1484
1485 LibUtilities::InterpCoeff2D(b0, b1, coeff_tmp, bortho0, bortho1, coeff);
1486
1487 Vmath::Zero(n_coeffs, coeff_tmp, 1);
1488
1489 int cnt = 0;
1490 for (int i = 0; i < numMin + 1; ++i)
1491 {
1492 Vmath::Vcopy(numMin, tmp = coeff + cnt, 1, tmp2 = coeff_tmp + cnt, 1);
1493
1494 cnt = i * numMax;
1495 }
1496
1497 LibUtilities::InterpCoeff2D(bortho0, bortho1, coeff_tmp, b0, b1, outarray);
1498}
void InterpCoeff2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
Definition: InterpCoeff.cpp:69
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:44

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eOrtho_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::LibUtilities::InterpCoeff2D(), Nektar::StdRegions::StdExpansion::m_base, Vmath::Vcopy(), and Vmath::Zero().

◆ v_StdPhysEvaluate()

NekDouble Nektar::LocalRegions::QuadExp::v_StdPhysEvaluate ( const Array< OneD, const NekDouble > &  Lcoord,
const Array< OneD, const NekDouble > &  physvals 
)
overrideprotectedvirtual

Given the local cartesian coordinate Lcoord evaluate the value of physvals at this point by calling through to the StdExpansion method

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 570 of file QuadExp.cpp.

573{
574 // Evaluate point in local (eta) coordinates.
575 return StdExpansion2D::v_PhysEvaluate(Lcoord, physvals);
576}

◆ v_SVVLaplacianFilter()

void Nektar::LocalRegions::QuadExp::v_SVVLaplacianFilter ( Array< OneD, NekDouble > &  array,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1594 of file QuadExp.cpp.

1596{
1597 int nq = GetTotPoints();
1598
1599 // Calculate sqrt of the Jacobian
1600 Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
1601 Array<OneD, NekDouble> sqrt_jac(nq);
1602 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1603 {
1604 Vmath::Vsqrt(nq, jac, 1, sqrt_jac, 1);
1605 }
1606 else
1607 {
1608 Vmath::Fill(nq, sqrt(jac[0]), sqrt_jac, 1);
1609 }
1610
1611 // Multiply array by sqrt(Jac)
1612 Vmath::Vmul(nq, sqrt_jac, 1, array, 1, array, 1);
1613
1614 // Apply std region filter
1615 StdQuadExp::v_SVVLaplacianFilter(array, mkey);
1616
1617 // Divide by sqrt(Jac)
1618 Vmath::Vdiv(nq, array, 1, sqrt_jac, 1, array, 1);
1619}
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:280

References Nektar::SpatialDomains::eDeformed, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LocalRegions::Expansion::m_metricinfo, tinysimd::sqrt(), Vmath::Vdiv(), Vmath::Vmul(), and Vmath::Vsqrt().

◆ v_WeakDerivMatrixOp()

void Nektar::LocalRegions::QuadExp::v_WeakDerivMatrixOp ( const int  i,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdQuadExp.

Definition at line 1431 of file QuadExp.cpp.

1435{
1436 StdExpansion::WeakDerivMatrixOp_MatFree(i, inarray, outarray, mkey);
1437}

◆ v_WeakDirectionalDerivMatrixOp()

void Nektar::LocalRegions::QuadExp::v_WeakDirectionalDerivMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1439 of file QuadExp.cpp.

1442{
1443 StdExpansion::WeakDirectionalDerivMatrixOp_MatFree(inarray, outarray, mkey);
1444}

Member Data Documentation

◆ m_matrixManager

LibUtilities::NekManager<MatrixKey, DNekScalMat, MatrixKey::opLess> Nektar::LocalRegions::QuadExp::m_matrixManager
private

Definition at line 247 of file QuadExp.h.

Referenced by GetEdgeInterpVals(), v_DropLocMatrix(), v_FwdTrans(), and v_GetLocMatrix().

◆ m_staticCondMatrixManager

LibUtilities::NekManager<MatrixKey, DNekScalBlkMat, MatrixKey::opLess> Nektar::LocalRegions::QuadExp::m_staticCondMatrixManager
private