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

#include <TriExp.h>

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

Public Member Functions

 TriExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const SpatialDomains::Geometry2DSharedPtr &geom)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 TriExp (const TriExp &T)
 
 ~TriExp () override=default
 
- Public Member Functions inherited from Nektar::StdRegions::StdTriExp
 StdTriExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb)
 
 StdTriExp ()=default
 
 StdTriExp (const StdTriExp &T)=default
 
 ~StdTriExp () override=default
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion2D
 StdExpansion2D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb)
 
 StdExpansion2D ()=default
 
 StdExpansion2D (const StdExpansion2D &T)=default
 
 ~StdExpansion2D () override=default
 
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)
 
 ~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)
 
DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey) override
 
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)
 
 ~Expansion () override
 
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

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...
 
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...
 
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...
 
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_FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
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[p]*base1[pq] and put into outarray. More...
 
void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
 
void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
 
void v_IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Directinoal Derivative in the modal space in the dir direction of varcoeffs. More...
 
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
 
void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray) override
 
StdRegions::StdExpansionSharedPtr v_GetStdExp (void) const override
 
StdRegions::StdExpansionSharedPtr v_GetLinStdExp (void) const override
 
void v_GetCoord (const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
 
void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
 
NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
 
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...
 
NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
void v_GetTracePhysVals (const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
 
void v_GetTraceQFactors (const int edge, Array< OneD, NekDouble > &outarray) override
 
void v_ComputeTraceNormal (const int edge) override
 
void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
 
StdRegions::Orientation v_GetTraceOrient (int edge) override
 
void v_GetTracePhysMap (const int edge, Array< OneD, int > &outarray) override
 
DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey) override
 
DNekMatSharedPtr v_CreateStdMatrix (const StdRegions::StdMatrixKey &mkey) override
 
DNekScalMatSharedPtr v_GetLocMatrix (const MatrixKey &mkey) override
 
void v_DropLocMatrix (const MatrixKey &mkey) override
 
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const MatrixKey &mkey) override
 
void v_DropLocStaticCondMatrix (const MatrixKey &mkey) override
 
void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
 
void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_ComputeLaplacianMetric () override
 
void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
 
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 stabilisation and involves the product of the normal and geometric factors along the element trace. More...
 
- Protected Member Functions inherited from Nektar::StdRegions::StdTriExp
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...
 
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...
 
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
 
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
 Backward tranform for triangular elements. More...
 
void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
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
 
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_FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
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[p]*base1[pq] and put into outarray. More...
 
void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
 
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
 
void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
 
void v_LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
 
void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray) override
 
NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode) final
 
NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
int v_GetNverts () const final
 
int v_GetNtraces () const final
 
LibUtilities::ShapeType v_DetShapeType () const final
 
int v_NumBndryCoeffs () const override
 
int v_NumDGBndryCoeffs () const override
 
int v_GetTraceNcoeffs (const int i) const override
 
int v_GetTraceIntNcoeffs (const int i) const override
 
int v_GetTraceNumPoints (const int i) const override
 
int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset) override
 
void v_GetCoords (Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z) override
 
bool v_IsBoundaryInteriorExpansion () const override
 
const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int j) const override
 
int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false) override
 
void v_GetInteriorMap (Array< OneD, unsigned int > &outarray) override
 
void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray) override
 
void v_GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
 
void v_GetTraceInteriorToElementMap (const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation edgeOrient=eForwards) override
 
DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey) override
 
DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey) override
 
void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
 
void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
 
void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion2D
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...
 
NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals) override
 
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
 
void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
 
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...
 
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
 
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
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
 
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
 
void v_AddEdgeNormBoundaryInt (const int edge, const ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray) override
 
void v_AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
 
void v_AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs) override
 
DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd) override
 
void v_ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
 
void v_SetUpPhysNormals (const int edge) override
 
NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &vec) override
 
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)
 
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 ()
 
int v_GetCoordim () const override
 
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)
 
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 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 48 of file TriExp.h.

Constructor & Destructor Documentation

◆ TriExp() [1/2]

Nektar::LocalRegions::TriExp::TriExp ( 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 45 of file TriExp.cpp.

49 Ba.GetNumModes(), (Bb.GetNumModes())),
50 2, Ba, Bb),
52 Ba.GetNumModes(), (Bb.GetNumModes())),
53 Ba, Bb),
54 StdTriExp(Ba, Bb), Expansion(geom), Expansion2D(geom),
56 std::bind(&Expansion2D::CreateMatrix, this, std::placeholders::_1),
57 std::string("TriExpMatrix")),
59 this, std::placeholders::_1),
60 std::string("TriExpStaticCondMatrix"))
61{
62}
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: Expansion2D.cpp:55
Expansion2D(SpatialDomains::Geometry2DSharedPtr pGeom)
Definition: Expansion2D.cpp:50
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: Expansion.cpp:272
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:43
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TriExp.h:245
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TriExp.h:247
StdExpansion()
Default Constructor.
int getNumberOfCoefficients(int Na, int Nb)
Definition: ShapeType.hpp:109

◆ TriExp() [2/2]

Nektar::LocalRegions::TriExp::TriExp ( const TriExp T)

Definition at line 64 of file TriExp.cpp.

66 Expansion2D(T), m_matrixManager(T.m_matrixManager),
67 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
68{
69}

◆ ~TriExp()

Nektar::LocalRegions::TriExp::~TriExp ( )
overridedefault

Member Function Documentation

◆ v_AlignVectorToCollapsedDir()

void Nektar::LocalRegions::TriExp::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 463 of file TriExp.cpp.

466{
467 ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
468 ASSERTL1((dir == 2) ? (m_geom->GetCoordim() == 3) : true,
469 "Invalid direction.");
470
471 int nquad0 = m_base[0]->GetNumPoints();
472 int nquad1 = m_base[1]->GetNumPoints();
473 int nqtot = nquad0 * nquad1;
474 int nmodes0 = m_base[0]->GetNumModes();
475 int wspsize = max(max(nqtot, m_ncoeffs), nquad1 * nmodes0);
476
477 const Array<TwoD, const NekDouble> &df =
478 m_metricinfo->GetDerivFactors(GetPointsKeys());
479
480 Array<OneD, NekDouble> tmp0(wspsize);
481 Array<OneD, NekDouble> tmp3(wspsize);
482 Array<OneD, NekDouble> gfac0(wspsize);
483 Array<OneD, NekDouble> gfac1(wspsize);
484
485 Array<OneD, NekDouble> tmp1 = outarray[0];
486 Array<OneD, NekDouble> tmp2 = outarray[1];
487
488 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
489 const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
490
491 // set up geometric factor: 2/(1-z1)
492 for (int i = 0; i < nquad1; ++i)
493 {
494 gfac0[i] = 2.0 / (1 - z1[i]);
495 }
496 for (int i = 0; i < nquad0; ++i)
497 {
498 gfac1[i] = 0.5 * (1 + z0[i]);
499 }
500
501 for (int i = 0; i < nquad1; ++i)
502 {
503 Vmath::Smul(nquad0, gfac0[i], &inarray[0] + i * nquad0, 1,
504 &tmp0[0] + i * nquad0, 1);
505 }
506
507 for (int i = 0; i < nquad1; ++i)
508 {
509 Vmath::Vmul(nquad0, &gfac1[0], 1, &tmp0[0] + i * nquad0, 1,
510 &tmp1[0] + i * nquad0, 1);
511 }
512
513 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
514 {
515 Vmath::Vmul(nqtot, &df[2 * dir][0], 1, &tmp0[0], 1, &tmp0[0], 1);
516 Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, &tmp1[0], 1, &tmp1[0], 1);
517 Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, &inarray[0], 1, &tmp2[0], 1);
518 }
519 else
520 {
521 Vmath::Smul(nqtot, df[2 * dir][0], tmp0, 1, tmp0, 1);
522 Vmath::Smul(nqtot, df[2 * dir + 1][0], tmp1, 1, tmp1, 1);
523 Vmath::Smul(nqtot, df[2 * dir + 1][0], inarray, 1, tmp2, 1);
524 }
525 Vmath::Vadd(nqtot, tmp0, 1, tmp1, 1, tmp1, 1);
526}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:273
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:274
const LibUtilities::PointsKeyVector GetPointsKeys() const
Array< OneD, LibUtilities::BasisSharedPtr > m_base
@ 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.hpp:72
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.hpp:180
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.hpp:100

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(), Vmath::Vadd(), and Vmath::Vmul().

Referenced by v_IProductWRTDerivBase_SumFac().

◆ v_ComputeLaplacianMetric()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1210 of file TriExp.cpp.

1211{
1212 if (m_metrics.count(eMetricQuadrature) == 0)
1213 {
1215 }
1216
1217 unsigned int i, j;
1218 const SpatialDomains::GeomType type = m_metricinfo->GetGtype();
1219 const unsigned int nqtot = GetTotPoints();
1220 const unsigned int dim = 2;
1221 const MetricType m[3][3] = {
1225
1226 Array<OneD, NekDouble> dEta_dXi[2] = {Array<OneD, NekDouble>(nqtot, 1.0),
1227 Array<OneD, NekDouble>(nqtot, 1.0)};
1228
1229 for (i = 0; i < dim; ++i)
1230 {
1231 for (j = i; j < dim; ++j)
1232 {
1233 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
1234 }
1235 }
1236
1237 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
1238 const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
1239 const unsigned int nquad0 = m_base[0]->GetNumPoints();
1240 const unsigned int nquad1 = m_base[1]->GetNumPoints();
1241 const Array<TwoD, const NekDouble> &df =
1242 m_metricinfo->GetDerivFactors(GetPointsKeys());
1243
1244 for (i = 0; i < nquad1; i++)
1245 {
1246 Blas::Dscal(nquad0, 2.0 / (1 - z1[i]), &dEta_dXi[0][0] + i * nquad0, 1);
1247 Blas::Dscal(nquad0, 2.0 / (1 - z1[i]), &dEta_dXi[1][0] + i * nquad0, 1);
1248 }
1249 for (i = 0; i < nquad0; i++)
1250 {
1251 Blas::Dscal(nquad1, 0.5 * (1 + z0[i]), &dEta_dXi[1][0] + i, nquad0);
1252 }
1253
1254 Array<OneD, NekDouble> tmp(nqtot);
1255 if ((type == SpatialDomains::eRegular ||
1257 {
1258 Vmath::Smul(nqtot, df[0][0], &dEta_dXi[0][0], 1, &tmp[0], 1);
1259 Vmath::Svtvp(nqtot, df[1][0], &dEta_dXi[1][0], 1, &tmp[0], 1, &tmp[0],
1260 1);
1261
1262 Vmath::Vmul(nqtot, &tmp[0], 1, &tmp[0], 1,
1264 Vmath::Smul(nqtot, df[1][0], &tmp[0], 1,
1266
1267 Vmath::Smul(nqtot, df[2][0], &dEta_dXi[0][0], 1, &tmp[0], 1);
1268 Vmath::Svtvp(nqtot, df[3][0], &dEta_dXi[1][0], 1, &tmp[0], 1, &tmp[0],
1269 1);
1270
1271 Vmath::Vvtvp(nqtot, &tmp[0], 1, &tmp[0], 1,
1274 Vmath::Svtvp(nqtot, df[3][0], &tmp[0], 1,
1277
1278 if (GetCoordim() == 3)
1279 {
1280 Vmath::Smul(nqtot, df[4][0], &dEta_dXi[0][0], 1, &tmp[0], 1);
1281 Vmath::Svtvp(nqtot, df[5][0], &dEta_dXi[1][0], 1, &tmp[0], 1,
1282 &tmp[0], 1);
1283
1284 Vmath::Vvtvp(nqtot, &tmp[0], 1, &tmp[0], 1,
1287 Vmath::Svtvp(nqtot, df[5][0], &tmp[0], 1,
1290 }
1291
1292 NekDouble g2 = df[1][0] * df[1][0] + df[3][0] * df[3][0];
1293 if (GetCoordim() == 3)
1294 {
1295 g2 += df[5][0] * df[5][0];
1296 }
1297 Vmath::Fill(nqtot, g2, &m_metrics[eMetricLaplacian11][0], 1);
1298 }
1299 else
1300 {
1301
1302 Vmath::Vmul(nqtot, &df[0][0], 1, &dEta_dXi[0][0], 1, &tmp[0], 1);
1303 Vmath::Vvtvp(nqtot, &df[1][0], 1, &dEta_dXi[1][0], 1, &tmp[0], 1,
1304 &tmp[0], 1);
1305
1306 Vmath::Vmul(nqtot, &tmp[0], 1, &tmp[0], 1,
1308 Vmath::Vmul(nqtot, &df[1][0], 1, &tmp[0], 1,
1310 Vmath::Vmul(nqtot, &df[1][0], 1, &df[1][0], 1,
1312
1313 Vmath::Vmul(nqtot, &df[2][0], 1, &dEta_dXi[0][0], 1, &tmp[0], 1);
1314 Vmath::Vvtvp(nqtot, &df[3][0], 1, &dEta_dXi[1][0], 1, &tmp[0], 1,
1315 &tmp[0], 1);
1316
1317 Vmath::Vvtvp(nqtot, &tmp[0], 1, &tmp[0], 1,
1320 Vmath::Vvtvp(nqtot, &df[3][0], 1, &tmp[0], 1,
1323 Vmath::Vvtvp(nqtot, &df[3][0], 1, &df[3][0], 1,
1326
1327 if (GetCoordim() == 3)
1328 {
1329 Vmath::Vmul(nqtot, &df[4][0], 1, &dEta_dXi[0][0], 1, &tmp[0], 1);
1330 Vmath::Vvtvp(nqtot, &df[5][0], 1, &dEta_dXi[1][0], 1, &tmp[0], 1,
1331 &tmp[0], 1);
1332
1333 Vmath::Vvtvp(nqtot, &tmp[0], 1, &tmp[0], 1,
1336 Vmath::Vvtvp(nqtot, &df[5][0], 1, &tmp[0], 1,
1339 Vmath::Vvtvp(nqtot, &df[5][0], 1, &df[5][0], 1,
1342 }
1343 }
1344
1345 for (unsigned int i = 0; i < dim; ++i)
1346 {
1347 for (unsigned int j = i; j < dim; ++j)
1348 {
1350 }
1351 }
1352}
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:134
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:723
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:149
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
double NekDouble
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.hpp:396
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.hpp:366
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54

References Nektar::LocalRegions::Expansion::ComputeQuadratureMetric(), Blas::Dscal(), Nektar::LocalRegions::eMetricLaplacian00, Nektar::LocalRegions::eMetricLaplacian01, Nektar::LocalRegions::eMetricLaplacian02, Nektar::LocalRegions::eMetricLaplacian11, Nektar::LocalRegions::eMetricLaplacian12, Nektar::LocalRegions::eMetricLaplacian22, Nektar::LocalRegions::eMetricQuadrature, Nektar::SpatialDomains::eMovingRegular, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::LocalRegions::Expansion::m_metrics, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), Vmath::Smul(), Vmath::Svtvp(), Vmath::Vmul(), and Vmath::Vvtvp().

◆ v_ComputeTraceNormal()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 818 of file TriExp.cpp.

819{
820 int i;
821 const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
822 GetGeom()->GetMetricInfo();
823
825 for (i = 0; i < ptsKeys.size(); ++i)
826 {
827 // Need at least 2 points for computing normals
828 if (ptsKeys[i].GetNumPoints() == 1)
829 {
830 LibUtilities::PointsKey pKey(2, ptsKeys[i].GetPointsType());
831 ptsKeys[i] = pKey;
832 }
833 }
834
835 const SpatialDomains::GeomType type = geomFactors->GetGtype();
836 const Array<TwoD, const NekDouble> &df =
837 geomFactors->GetDerivFactors(ptsKeys);
838 const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
839
840 // The points of normals should follow trace basis, not local basis.
841 LibUtilities::BasisKey tobasis = GetTraceBasisKey(edge);
842
843 int nqe = tobasis.GetNumPoints();
844 int dim = GetCoordim();
845
846 m_traceNormals[edge] = Array<OneD, Array<OneD, NekDouble>>(dim);
847 Array<OneD, Array<OneD, NekDouble>> &normal = m_traceNormals[edge];
848 for (i = 0; i < dim; ++i)
849 {
850 normal[i] = Array<OneD, NekDouble>(nqe);
851 }
852
853 size_t nqb = nqe;
854 size_t nbnd = edge;
855 m_elmtBndNormDirElmtLen[nbnd] = Array<OneD, NekDouble>{nqb, 0.0};
856 Array<OneD, NekDouble> &length = m_elmtBndNormDirElmtLen[nbnd];
857
858 // Regular geometry case
859 if ((type == SpatialDomains::eRegular) ||
861 {
862 NekDouble fac;
863 // Set up normals
864 switch (edge)
865 {
866 case 0:
867 for (i = 0; i < GetCoordim(); ++i)
868 {
869 Vmath::Fill(nqe, -df[2 * i + 1][0], normal[i], 1);
870 }
871 break;
872 case 1:
873 for (i = 0; i < GetCoordim(); ++i)
874 {
875 Vmath::Fill(nqe, df[2 * i + 1][0] + df[2 * i][0], normal[i],
876 1);
877 }
878 break;
879 case 2:
880 for (i = 0; i < GetCoordim(); ++i)
881 {
882 Vmath::Fill(nqe, -df[2 * i][0], normal[i], 1);
883 }
884 break;
885 default:
886 ASSERTL0(false, "Edge is out of range (edge < 3)");
887 }
888
889 // normalise
890 fac = 0.0;
891 for (i = 0; i < GetCoordim(); ++i)
892 {
893 fac += normal[i][0] * normal[i][0];
894 }
895 fac = 1.0 / sqrt(fac);
896
897 Vmath::Fill(nqb, fac, length, 1);
898
899 for (i = 0; i < GetCoordim(); ++i)
900 {
901 Vmath::Smul(nqe, fac, normal[i], 1, normal[i], 1);
902 }
903 }
904 else // Set up deformed normals
905 {
906 int j;
907
908 int nquad0 = ptsKeys[0].GetNumPoints();
909 int nquad1 = ptsKeys[1].GetNumPoints();
910
911 LibUtilities::PointsKey from_key;
912
913 Array<OneD, NekDouble> normals(GetCoordim() * max(nquad0, nquad1), 0.0);
914 Array<OneD, NekDouble> edgejac(GetCoordim() * max(nquad0, nquad1), 0.0);
915
916 // Extract Jacobian along edges and recover local
917 // derivates (dx/dr) for polynomial interpolation by
918 // multiplying m_gmat by jacobian
919 switch (edge)
920 {
921 case 0:
922 for (j = 0; j < nquad0; ++j)
923 {
924 edgejac[j] = jac[j];
925 for (i = 0; i < GetCoordim(); ++i)
926 {
927 normals[i * nquad0 + j] =
928 -df[2 * i + 1][j] * edgejac[j];
929 }
930 }
931 from_key = ptsKeys[0];
932 break;
933 case 1:
934 for (j = 0; j < nquad1; ++j)
935 {
936 edgejac[j] = jac[nquad0 * j + nquad0 - 1];
937 for (i = 0; i < GetCoordim(); ++i)
938 {
939 normals[i * nquad1 + j] =
940 (df[2 * i][nquad0 * j + nquad0 - 1] +
941 df[2 * i + 1][nquad0 * j + nquad0 - 1]) *
942 edgejac[j];
943 }
944 }
945 from_key = ptsKeys[1];
946 break;
947 case 2:
948 for (j = 0; j < nquad1; ++j)
949 {
950 edgejac[j] = jac[nquad0 * j];
951 for (i = 0; i < GetCoordim(); ++i)
952 {
953 normals[i * nquad1 + j] =
954 -df[2 * i][nquad0 * j] * edgejac[j];
955 }
956 }
957 from_key = ptsKeys[1];
958 break;
959 default:
960 ASSERTL0(false, "edge is out of range (edge < 3)");
961 }
962
963 int nq = from_key.GetNumPoints();
964 Array<OneD, NekDouble> work(nqe, 0.0);
965
966 // interpolate Jacobian and invert
967 LibUtilities::Interp1D(from_key, jac, tobasis.GetPointsKey(), work);
968 Vmath::Sdiv(nqe, 1.0, &work[0], 1, &work[0], 1);
969
970 // interpolate
971 for (i = 0; i < GetCoordim(); ++i)
972 {
973 LibUtilities::Interp1D(from_key, &normals[i * nq],
974 tobasis.GetPointsKey(), &normal[i][0]);
975 Vmath::Vmul(nqe, work, 1, normal[i], 1, normal[i], 1);
976 }
977
978 // normalise normal vectors
979 Vmath::Zero(nqe, work, 1);
980 for (i = 0; i < GetCoordim(); ++i)
981 {
982 Vmath::Vvtvp(nqe, normal[i], 1, normal[i], 1, work, 1, work, 1);
983 }
984
985 Vmath::Vsqrt(nqe, work, 1, work, 1);
986 Vmath::Sdiv(nqe, 1.0, work, 1, work, 1);
987
988 Vmath::Vcopy(nqb, work, 1, length, 1);
989
990 for (i = 0; i < GetCoordim(); ++i)
991 {
992 Vmath::Vmul(nqe, normal[i], 1, work, 1, normal[i], 1);
993 }
994 }
995
996 if (GetGeom()->GetEorient(edge) == StdRegions::eBackwards)
997 {
998 for (i = 0; i < GetCoordim(); ++i)
999 {
1000 if (geomFactors->GetGtype() == SpatialDomains::eDeformed)
1001 {
1002 Vmath::Reverse(nqe, normal[i], 1, normal[i], 1);
1003 }
1004 }
1005 }
1006}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
std::map< int, NormalVector > m_traceNormals
Definition: Expansion.h:276
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:286
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:167
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
Definition: StdExpansion.h:299
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:205
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:218
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:47
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:231
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:60
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.hpp:340
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.hpp:154
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:844
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::eMovingRegular, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::LocalRegions::Expansion::GetGeom(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetTraceBasisKey(), Nektar::LibUtilities::Interp1D(), 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::TriExp::v_CreateStdMatrix ( const StdRegions::StdMatrixKey mkey)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1073 of file TriExp.cpp.

1074{
1075 LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
1076 LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
1079
1080 return tmp->GetStdMatrix(mkey);
1081}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< StdTriExp > StdTriExpSharedPtr
Definition: StdTriExp.h:219

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

◆ v_DropLocMatrix()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1088 of file TriExp.cpp.

1089{
1090 m_matrixManager.DeleteObject(mkey);
1091}

References m_matrixManager.

◆ v_DropLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1098 of file TriExp.cpp.

1099{
1100 m_staticCondMatrixManager.DeleteObject(mkey);
1101}

References m_staticCondMatrixManager.

◆ v_ExtractDataToCoeffs()

void Nektar::LocalRegions::TriExp::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 1008 of file TriExp.cpp.

1012{
1013 int data_order0 = nummodes[mode_offset];
1014 int fillorder0 = min(m_base[0]->GetNumModes(), data_order0);
1015 int data_order1 = nummodes[mode_offset + 1];
1016 int order1 = m_base[1]->GetNumModes();
1017 int fillorder1 = min(order1, data_order1);
1018
1019 switch (m_base[0]->GetBasisType())
1020 {
1023 {
1024 int i;
1025 int cnt = 0;
1026 int cnt1 = 0;
1027
1030 "Extraction routine not set up for this basis");
1031
1032 Vmath::Zero(m_ncoeffs, coeffs, 1);
1033 for (i = 0; i < fillorder0; ++i)
1034 {
1035 Vmath::Vcopy(fillorder1 - i, &data[cnt], 1, &coeffs[cnt1], 1);
1036 cnt += data_order1 - i;
1037 cnt1 += order1 - i;
1038 }
1039 }
1040 break;
1041 default:
1042 ASSERTL0(false, "basis is either not set up or not hierarchicial");
1043 }
1044}
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:156
@ eModified_B
Principle Modified Functions .
Definition: BasisType.h:49
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:42
@ eOrtho_B
Principle Orthogonal Functions .
Definition: BasisType.h:44
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrtho_B, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vcopy(), and Vmath::Zero().

◆ v_FwdTrans()

void Nektar::LocalRegions::TriExp::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::StdTriExp.

Definition at line 249 of file TriExp.cpp.

251{
252 IProductWRTBase(inarray, outarray);
253
254 // get Mass matrix inverse
255 MatrixKey masskey(StdRegions::eInvMass, DetShapeType(), *this);
256 DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
257
258 // copy inarray in case inarray == outarray
259 NekVector<NekDouble> in(m_ncoeffs, outarray, eCopy);
260 NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
261
262 out = (*matsys) * in;
263}
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:528
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:367
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr

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

◆ v_FwdTransBndConstrained()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 265 of file TriExp.cpp.

268{
269 int i, j;
270 int npoints[2] = {m_base[0]->GetNumPoints(), m_base[1]->GetNumPoints()};
271 int nmodes[2] = {m_base[0]->GetNumModes(), m_base[1]->GetNumModes()};
272
273 fill(outarray.get(), outarray.get() + m_ncoeffs, 0.0);
274
275 if (nmodes[0] == 1 && nmodes[1] == 1)
276 {
277 outarray[0] = inarray[0];
278 return;
279 }
280
281 Array<OneD, NekDouble> physEdge[3];
282 Array<OneD, NekDouble> coeffEdge[3];
283 for (i = 0; i < 3; i++)
284 {
285 // define physEdge and add 1 so can interpolate grl10 points if
286 // necessary
287 physEdge[i] = Array<OneD, NekDouble>(max(npoints[i != 0], npoints[0]));
288 coeffEdge[i] = Array<OneD, NekDouble>(nmodes[i != 0]);
289 }
290
291 for (i = 0; i < npoints[0]; i++)
292 {
293 physEdge[0][i] = inarray[i];
294 }
295
296 // extract data in cartesian directions
297 for (i = 0; i < npoints[1]; i++)
298 {
299 physEdge[1][i] = inarray[npoints[0] - 1 + i * npoints[0]];
300 physEdge[2][i] = inarray[i * npoints[0]];
301 }
302
303 SegExpSharedPtr segexp[3];
305 m_base[0]->GetBasisKey(), GetGeom2D()->GetEdge(0));
306
308 {
309 for (i = 1; i < 3; i++)
310 {
312 m_base[i != 0]->GetBasisKey(), GetGeom2D()->GetEdge(i));
313 }
314 }
315 else // interploate using edge 0 GLL distribution
316 {
317 for (i = 1; i < 3; i++)
318 {
320 m_base[0]->GetBasisKey(), GetGeom2D()->GetEdge(i));
321
322 LibUtilities::Interp1D(m_base[1]->GetPointsKey(), physEdge[i],
323 m_base[0]->GetPointsKey(), physEdge[i]);
324 }
325 npoints[1] = npoints[0];
326 }
327
328 Array<OneD, unsigned int> mapArray;
329 Array<OneD, int> signArray;
331 // define an orientation to get EdgeToElmtMapping from Cartesian data
332 StdRegions::Orientation orient[3] = {
334
335 for (i = 0; i < 3; i++)
336 {
337 segexp[i]->FwdTransBndConstrained(physEdge[i], coeffEdge[i]);
338
339 // this orient goes with the one above and so could
340 // probably set both to eForwards
341 GetTraceToElementMap(i, mapArray, signArray, orient[i]);
342 for (j = 0; j < nmodes[i != 0]; j++)
343 {
344 sign = (NekDouble)signArray[j];
345 outarray[mapArray[j]] = sign * coeffEdge[i][j];
346 }
347 }
348
349 int nBoundaryDofs = NumBndryCoeffs();
350 int nInteriorDofs = m_ncoeffs - nBoundaryDofs;
351
352 if (nInteriorDofs > 0)
353 {
354 Array<OneD, NekDouble> tmp0(m_ncoeffs);
355 Array<OneD, NekDouble> tmp1(m_ncoeffs);
356
357 StdRegions::StdMatrixKey stdmasskey(StdRegions::eMass, DetShapeType(),
358 *this);
359 MassMatrixOp(outarray, tmp0, stdmasskey);
360 IProductWRTBase(inarray, tmp1);
361
362 Vmath::Vsub(m_ncoeffs, tmp1, 1, tmp0, 1, tmp1, 1);
363
364 // get Mass matrix inverse (only of interior DOF)
365 // use block (1,1) of the static condensed system
366 // note: this block alreay contains the inverse matrix
367 MatrixKey masskey(StdRegions::eMass, DetShapeType(), *this);
368 DNekScalMatSharedPtr matsys =
369 (m_staticCondMatrixManager[masskey])->GetBlock(1, 1);
370
371 Array<OneD, NekDouble> rhs(nInteriorDofs);
372 Array<OneD, NekDouble> result(nInteriorDofs);
373
374 GetInteriorMap(mapArray);
375
376 for (i = 0; i < nInteriorDofs; i++)
377 {
378 rhs[i] = tmp1[mapArray[i]];
379 }
380
381 Blas::Dgemv('N', nInteriorDofs, nInteriorDofs, matsys->Scale(),
382 &((matsys->GetOwnedMatrix())->GetPtr())[0], nInteriorDofs,
383 rhs.get(), 1, 0.0, result.get(), 1);
384
385 for (i = 0; i < nInteriorDofs; i++)
386 {
387 outarray[mapArray[i]] = result[i];
388 }
389 }
390}
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:47
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:164
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:752
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:684
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:674
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:211
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51
std::shared_ptr< SegExp > SegExpSharedPtr
Definition: SegExp.h:248
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.hpp:220

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::StdRegions::eForwards, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::StdRegions::eMass, Nektar::LocalRegions::Expansion2D::GetGeom2D(), Nektar::StdRegions::StdExpansion::GetInteriorMap(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetTraceToElementMap(), Nektar::LibUtilities::Interp1D(), 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, and Vmath::Vsub().

◆ v_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1051 of file TriExp.cpp.

1052{
1053 DNekMatSharedPtr returnval;
1054 switch (mkey.GetMatrixType())
1055 {
1063 returnval = Expansion2D::v_GenMatrix(mkey);
1064 break;
1065 default:
1066 returnval = StdTriExp::v_GenMatrix(mkey);
1067 break;
1068 }
1069
1070 return returnval;
1071}
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::TriExp::v_GetCoord ( const Array< OneD, const NekDouble > &  Lcoords,
Array< OneD, NekDouble > &  coords 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 659 of file TriExp.cpp.

661{
662 int i;
663
664 ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[1] <= 1.0 && Lcoords[1] >= -1.0 &&
665 Lcoords[1] <= 1.0,
666 "Local coordinates are not in region [-1,1]");
667
668 m_geom->FillGeom();
669
670 for (i = 0; i < m_geom->GetCoordim(); ++i)
671 {
672 coords[i] = m_geom->GetCoord(i, Lcoords);
673 }
674}

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

◆ v_GetCoords()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 676 of file TriExp.cpp.

679{
680 Expansion::v_GetCoords(coords_0, coords_1, coords_2);
681}
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: Expansion.cpp:530

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

◆ v_GetLinStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 648 of file TriExp.cpp.

649{
650 LibUtilities::BasisKey bkey0(m_base[0]->GetBasisType(), 2,
651 m_base[0]->GetPointsKey());
652 LibUtilities::BasisKey bkey1(m_base[1]->GetBasisType(), 2,
653 m_base[1]->GetPointsKey());
654
656 bkey1);
657}

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

◆ v_GetLocMatrix()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1083 of file TriExp.cpp.

1084{
1085 return m_matrixManager[mkey];
1086}

References m_matrixManager.

◆ v_GetLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1093 of file TriExp.cpp.

1094{
1095 return m_staticCondMatrixManager[mkey];
1096}

References m_staticCondMatrixManager.

◆ v_GetStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 641 of file TriExp.cpp.

642{
643
645 m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey());
646}

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

◆ v_GetTraceOrient()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1046 of file TriExp.cpp.

1047{
1048 return GetGeom2D()->GetEorient(edge);
1049}

References Nektar::LocalRegions::Expansion2D::GetGeom2D().

◆ v_GetTracePhysMap()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 783 of file TriExp.cpp.

784{
785 int nquad0 = m_base[0]->GetNumPoints();
786 int nquad1 = m_base[1]->GetNumPoints();
787
788 // Get points in Cartesian orientation
789 switch (edge)
790 {
791 case 0:
792 outarray = Array<OneD, int>(nquad0);
793 for (int i = 0; i < nquad0; ++i)
794 {
795 outarray[i] = i;
796 }
797 break;
798 case 1:
799 outarray = Array<OneD, int>(nquad1);
800 for (int i = 0; i < nquad1; ++i)
801 {
802 outarray[i] = (nquad0 - 1) + i * nquad0;
803 }
804 break;
805 case 2:
806 outarray = Array<OneD, int>(nquad1);
807 for (int i = 0; i < nquad1; ++i)
808 {
809 outarray[i] = i * nquad0;
810 }
811 break;
812 default:
813 ASSERTL0(false, "edge value (< 3) is out of range");
814 break;
815 }
816}

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

◆ v_GetTracePhysVals()

void Nektar::LocalRegions::TriExp::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 717 of file TriExp.cpp.

721{
722 int nquad0 = m_base[0]->GetNumPoints();
723 int nquad1 = m_base[1]->GetNumPoints();
724 int nt = 0;
725 // Extract in Cartesian direction because we have to deal with
726 // e.g. Gauss-Radau points.
727 switch (edge)
728 {
729 case 0:
730 Vmath::Vcopy(nquad0, &(inarray[0]), 1, &(outarray[0]), 1);
731 nt = nquad0;
732 break;
733 case 1:
734 Vmath::Vcopy(nquad1, &(inarray[0]) + (nquad0 - 1), nquad0,
735 &(outarray[0]), 1);
736 nt = nquad1;
737 break;
738 case 2:
739 Vmath::Vcopy(nquad1, &(inarray[0]), nquad0, &(outarray[0]), 1);
740 nt = nquad1;
741 break;
742 default:
743 ASSERTL0(false, "edge value (< 3) is out of range");
744 break;
745 }
746
747 ASSERTL1(EdgeExp->GetBasis(0)->GetPointsType() ==
749 "Edge expansion should be GLL");
750
751 // Interpolate if required
752 if (m_base[edge ? 1 : 0]->GetPointsKey() !=
753 EdgeExp->GetBasis(0)->GetPointsKey())
754 {
755 Array<OneD, NekDouble> outtmp(max(nquad0, nquad1));
756
757 Vmath::Vcopy(nt, outarray, 1, outtmp, 1);
758
759 LibUtilities::Interp1D(m_base[edge ? 1 : 0]->GetPointsKey(), outtmp,
760 EdgeExp->GetBasis(0)->GetPointsKey(), outarray);
761 }
762
763 if (orient == StdRegions::eNoOrientation)
764 {
765 orient = GetTraceOrient(edge);
766 }
767
768 // Reverse data if necessary
769 if (orient == StdRegions::eBackwards)
770 {
771 Vmath::Reverse(EdgeExp->GetNumPoints(0), &outarray[0], 1, &outarray[0],
772 1);
773 }
774}
StdRegions::Orientation GetTraceOrient(int trace)
Definition: Expansion.h:168

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

◆ v_GetTraceQFactors()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 776 of file TriExp.cpp.

779{
780 ASSERTL0(false, "Routine not implemented for triangular elements");
781}

References ASSERTL0.

◆ v_HelmholtzMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1147 of file TriExp.cpp.

1150{
1151 TriExp::HelmholtzMatrixOp_MatFree(inarray, outarray, mkey);
1152}
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::TriExp::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::StdTriExp.

Definition at line 71 of file TriExp.cpp.

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

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::TriExp::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[p]*base1[pq] and put into outarray.

\( \begin{array}{rcl} I_{pq} = (\phi^A_q \phi^B_{pq}, u) &=& \sum_{i=0}^{nq_0}\sum_{j=0}^{nq_1} \phi^A_p(\eta_{0,i})\phi^B_{pq}(\eta_{1,j}) w^0_i w^1_j u(\xi_{0,i} \xi_{1,j}) \\ & = & \sum_{i=0}^{nq_0} \phi^A_p(\eta_{0,i}) \sum_{j=0}^{nq_1} \phi^B_{pq}(\eta_{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_{pj} = \sum_{i=0}^{nq_0} \phi^A_p(\eta_{0,i}) \tilde{u}_{i,j} \rightarrow {\bf B_1 U} \) \( I_{pq} = \sum_{j=0}^{nq_1} \phi^B_{pq}(\eta_{1,j}) f_{pj} \rightarrow {\bf B_2[p*skip] f[skip]} \)

Recall: \( \eta_{1} = \frac{2(1+\xi_1)}{(1-\xi_2)}-1, \, \eta_2 = \xi_2\)

Note: For the orthgonality of this expansion to be realised the 'q' ordering must run fastest in contrast to the Quad and Hex ordering where 'p' index runs fastest to be consistent with the quadrature ordering.

In the triangular space the i (i.e. \(\eta_1\) direction) ordering still runs fastest by convention.

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 392 of file TriExp.cpp.

394{
395 IProductWRTBase_SumFac(inarray, outarray);
396}
void IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)

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

◆ v_IProductWRTBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 405 of file TriExp.cpp.

408{
409 int nquad0 = m_base[0]->GetNumPoints();
410 int nquad1 = m_base[1]->GetNumPoints();
411 int order0 = m_base[0]->GetNumModes();
412
413 if (multiplybyweights)
414 {
415 Array<OneD, NekDouble> tmp(nquad0 * nquad1 + nquad1 * order0);
416 Array<OneD, NekDouble> wsp(tmp + nquad0 * nquad1);
417
418 MultiplyByQuadratureMetric(inarray, tmp);
420 m_base[1]->GetBdata(), tmp, outarray, wsp);
421 }
422 else
423 {
424 Array<OneD, NekDouble> wsp(+nquad1 * order0);
425
427 m_base[1]->GetBdata(), inarray, outarray,
428 wsp);
429 }
430}
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)

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

◆ v_IProductWRTDerivBase()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 398 of file TriExp.cpp.

401{
402 IProductWRTDerivBase_SumFac(dir, inarray, outarray);
403}
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::TriExp::v_IProductWRTDerivBase_SumFac ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 432 of file TriExp.cpp.

435{
436 int nquad0 = m_base[0]->GetNumPoints();
437 int nquad1 = m_base[1]->GetNumPoints();
438 int nqtot = nquad0 * nquad1;
439 int nmodes0 = m_base[0]->GetNumModes();
440 int wspsize = max(max(nqtot, m_ncoeffs), nquad1 * nmodes0);
441
442 Array<OneD, NekDouble> tmp0(4 * wspsize);
443 Array<OneD, NekDouble> tmp1(tmp0 + wspsize);
444 Array<OneD, NekDouble> tmp2(tmp0 + 2 * wspsize);
445 Array<OneD, NekDouble> tmp3(tmp0 + 3 * wspsize);
446
447 Array<OneD, Array<OneD, NekDouble>> tmp2D{2};
448 tmp2D[0] = tmp1;
449 tmp2D[1] = tmp2;
450
451 TriExp::v_AlignVectorToCollapsedDir(dir, inarray, tmp2D);
452
453 MultiplyByQuadratureMetric(tmp1, tmp1);
454 MultiplyByQuadratureMetric(tmp2, tmp2);
455
456 IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
457 tmp1, tmp3, tmp0);
458 IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
459 tmp2, outarray, tmp0);
460 Vmath::Vadd(m_ncoeffs, tmp3, 1, outarray, 1, outarray, 1);
461}
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition: TriExp.cpp:463

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

◆ v_IProductWRTDirectionalDerivBase()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 528 of file TriExp.cpp.

532{
533 IProductWRTDirectionalDerivBase_SumFac(direction, inarray, outarray);
534}
void IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)

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

◆ v_IProductWRTDirectionalDerivBase_SumFac()

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

Directinoal Derivative in the modal space in the dir direction of varcoeffs.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 540 of file TriExp.cpp.

544{
545 int i;
546 int shapedim = 2;
547 int nquad0 = m_base[0]->GetNumPoints();
548 int nquad1 = m_base[1]->GetNumPoints();
549 int nqtot = nquad0 * nquad1;
550 int nmodes0 = m_base[0]->GetNumModes();
551 int wspsize = max(max(nqtot, m_ncoeffs), nquad1 * nmodes0);
552
553 const Array<TwoD, const NekDouble> &df =
554 m_metricinfo->GetDerivFactors(GetPointsKeys());
555
556 Array<OneD, NekDouble> tmp0(6 * wspsize);
557 Array<OneD, NekDouble> tmp1(tmp0 + wspsize);
558 Array<OneD, NekDouble> tmp2(tmp0 + 2 * wspsize);
559 Array<OneD, NekDouble> tmp3(tmp0 + 3 * wspsize);
560 Array<OneD, NekDouble> gfac0(tmp0 + 4 * wspsize);
561 Array<OneD, NekDouble> gfac1(tmp0 + 5 * wspsize);
562
563 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
564 const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
565
566 // set up geometric factor: 2/(1-z1)
567 for (i = 0; i < nquad1; ++i)
568 {
569 gfac0[i] = 2.0 / (1 - z1[i]);
570 }
571 for (i = 0; i < nquad0; ++i)
572 {
573 gfac1[i] = 0.5 * (1 + z0[i]);
574 }
575 for (i = 0; i < nquad1; ++i)
576 {
577 Vmath::Smul(nquad0, gfac0[i], &inarray[0] + i * nquad0, 1,
578 &tmp0[0] + i * nquad0, 1);
579 }
580 for (i = 0; i < nquad1; ++i)
581 {
582 Vmath::Vmul(nquad0, &gfac1[0], 1, &tmp0[0] + i * nquad0, 1,
583 &tmp1[0] + i * nquad0, 1);
584 }
585
586 // Compute gmat \cdot e^j
587 Array<OneD, Array<OneD, NekDouble>> dfdir(shapedim);
588 Expansion::ComputeGmatcdotMF(df, direction, dfdir);
589
590 Vmath::Vmul(nqtot, &dfdir[0][0], 1, &tmp0[0], 1, &tmp0[0], 1);
591 Vmath::Vmul(nqtot, &dfdir[1][0], 1, &tmp1[0], 1, &tmp1[0], 1);
592 Vmath::Vmul(nqtot, &dfdir[1][0], 1, &inarray[0], 1, &tmp2[0], 1);
593
594 Vmath::Vadd(nqtot, &tmp0[0], 1, &tmp1[0], 1, &tmp1[0], 1);
595
596 MultiplyByQuadratureMetric(tmp1, tmp1);
597 MultiplyByQuadratureMetric(tmp2, tmp2);
598
599 IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
600 tmp1, tmp3, tmp0);
601 IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
602 tmp2, outarray, tmp0);
603 Vmath::Vadd(m_ncoeffs, tmp3, 1, outarray, 1, outarray, 1);
604}
void ComputeGmatcdotMF(const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble > > &dfdir)
Definition: Expansion.cpp:603

References Nektar::LocalRegions::Expansion::ComputeGmatcdotMF(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion2D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), Vmath::Smul(), Vmath::Vadd(), and Vmath::Vmul().

◆ v_LaplacianMatrixOp() [1/2]

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1110 of file TriExp.cpp.

1113{
1114 TriExp::LaplacianMatrixOp_MatFree(inarray, outarray, mkey);
1115}
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::TriExp::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::StdTriExp.

Definition at line 1117 of file TriExp.cpp.

1121{
1122 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
1123}

◆ v_LaplacianMatrixOp_MatFree_Kernel()

void Nektar::LocalRegions::TriExp::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 1154 of file TriExp.cpp.

1157{
1158 if (m_metrics.count(eMetricLaplacian00) == 0)
1159 {
1161 }
1162
1163 int nquad0 = m_base[0]->GetNumPoints();
1164 int nquad1 = m_base[1]->GetNumPoints();
1165 int nqtot = nquad0 * nquad1;
1166 int nmodes0 = m_base[0]->GetNumModes();
1167 int nmodes1 = m_base[1]->GetNumModes();
1168 int wspsize =
1169 max(max(max(nqtot, m_ncoeffs), nquad1 * nmodes0), nquad0 * nmodes1);
1170
1171 ASSERTL1(wsp.size() >= 3 * wspsize, "Workspace is of insufficient size.");
1172
1173 const Array<OneD, const NekDouble> &base0 = m_base[0]->GetBdata();
1174 const Array<OneD, const NekDouble> &base1 = m_base[1]->GetBdata();
1175 const Array<OneD, const NekDouble> &dbase0 = m_base[0]->GetDbdata();
1176 const Array<OneD, const NekDouble> &dbase1 = m_base[1]->GetDbdata();
1177 const Array<OneD, const NekDouble> &metric00 =
1179 const Array<OneD, const NekDouble> &metric01 =
1181 const Array<OneD, const NekDouble> &metric11 =
1183
1184 // Allocate temporary storage
1185 Array<OneD, NekDouble> wsp0(wsp);
1186 Array<OneD, NekDouble> wsp1(wsp + wspsize);
1187 Array<OneD, NekDouble> wsp2(wsp + 2 * wspsize);
1188
1189 StdExpansion2D::PhysTensorDeriv(inarray, wsp1, wsp2);
1190
1191 // wsp0 = k = g0 * wsp1 + g1 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1192 // wsp2 = l = g1 * wsp1 + g2 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1193 // where g0, g1 and g2 are the metric terms set up in the GeomFactors class
1194 // especially for this purpose
1195 Vmath::Vvtvvtp(nqtot, &metric00[0], 1, &wsp1[0], 1, &metric01[0], 1,
1196 &wsp2[0], 1, &wsp0[0], 1);
1197 Vmath::Vvtvvtp(nqtot, &metric01[0], 1, &wsp1[0], 1, &metric11[0], 1,
1198 &wsp2[0], 1, &wsp2[0], 1);
1199
1200 // outarray = m = (D_xi1 * B)^T * k
1201 // wsp1 = n = (D_xi2 * B)^T * l
1202 IProductWRTBase_SumFacKernel(dbase0, base1, wsp0, outarray, wsp1);
1203 IProductWRTBase_SumFacKernel(base0, dbase1, wsp2, wsp1, wsp0);
1204
1205 // outarray = outarray + wsp1
1206 // = L * u_hat
1207 Vmath::Vadd(m_ncoeffs, wsp1.get(), 1, outarray.get(), 1, outarray.get(), 1);
1208}
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.hpp:439

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::TriExp::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 1140 of file TriExp.cpp.

1143{
1144 StdExpansion::MassLevelCurvatureMatrixOp_MatFree(inarray, outarray, mkey);
1145}

◆ v_MassMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1103 of file TriExp.cpp.

1106{
1107 StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
1108}

◆ v_NormalTraceDerivFactors()

void Nektar::LocalRegions::TriExp::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 stabilisation and involves the product of the normal and geometric factors along the element trace.

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1454 of file TriExp.cpp.

1458{
1459 int nquad0 = GetNumPoints(0);
1460 int nquad1 = GetNumPoints(1);
1461
1462 const Array<TwoD, const NekDouble> &df =
1463 m_metricinfo->GetDerivFactors(GetPointsKeys());
1464
1465 if (d0factors.size() != 3)
1466 {
1467 d0factors = Array<OneD, Array<OneD, NekDouble>>(3);
1468 d1factors = Array<OneD, Array<OneD, NekDouble>>(3);
1469 }
1470
1471 if (d0factors[0].size() != nquad0)
1472 {
1473 d0factors[0] = Array<OneD, NekDouble>(nquad0);
1474 d1factors[0] = Array<OneD, NekDouble>(nquad0);
1475 }
1476
1477 if (d0factors[1].size() != nquad1)
1478 {
1479 d0factors[1] = Array<OneD, NekDouble>(nquad1);
1480 d0factors[2] = Array<OneD, NekDouble>(nquad1);
1481 d1factors[1] = Array<OneD, NekDouble>(nquad1);
1482 d1factors[2] = Array<OneD, NekDouble>(nquad1);
1483 }
1484
1485 // Outwards normals
1486 const Array<OneD, const Array<OneD, NekDouble>> &normal_0 =
1487 GetTraceNormal(0);
1488 const Array<OneD, const Array<OneD, NekDouble>> &normal_1 =
1489 GetTraceNormal(1);
1490 const Array<OneD, const Array<OneD, NekDouble>> &normal_2 =
1491 GetTraceNormal(2);
1492
1493 int ncoords = normal_0.size();
1494
1495 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1496 {
1497
1498 // d xi_2/dx n_x
1499 for (int i = 0; i < nquad0; ++i)
1500 {
1501 d1factors[0][i] = df[1][i] * normal_0[0][i];
1502 }
1503
1504 // d xi_1/dx n_x
1505 for (int i = 0; i < nquad1; ++i)
1506 {
1507 d0factors[1][i] = df[0][(i + 1) * nquad0 - 1] * normal_1[0][i];
1508 d0factors[2][i] = df[0][i * nquad0] * normal_2[0][i];
1509 }
1510
1511 for (int n = 1; n < ncoords; ++n)
1512 {
1513 // d xi_2/dy n_y
1514 // needs checking for 3D coords
1515 for (int i = 0; i < nquad0; ++i)
1516 {
1517 d1factors[0][i] += df[2 * n + 1][i] * normal_0[n][i];
1518 }
1519
1520 // d xi_1/dy n_y
1521 // needs checking for 3D coords
1522 for (int i = 0; i < nquad1; ++i)
1523 {
1524 d0factors[1][i] +=
1525 df[2 * n][(i + 1) * nquad0 - 1] * normal_1[n][i];
1526 d0factors[2][i] += df[2 * n][i * nquad0] * normal_2[n][i];
1527 }
1528 }
1529
1530 // d0 factors
1531 // d xi_1/dx n_x
1532 for (int i = 0; i < nquad0; ++i)
1533 {
1534 d0factors[0][i] = df[0][i] * normal_0[0][i];
1535 }
1536
1537 // d xi_2/dx n_x
1538 for (int i = 0; i < nquad1; ++i)
1539 {
1540 d1factors[1][i] = df[1][(i + 1) * nquad0 - 1] * normal_1[0][i];
1541 d1factors[2][i] = df[1][i * nquad0] * normal_2[0][i];
1542 }
1543
1544 for (int n = 1; n < ncoords; ++n)
1545 {
1546 // d xi_1/dy n_y
1547 // needs checking for 3D coords
1548 for (int i = 0; i < nquad0; ++i)
1549 {
1550 d0factors[0][i] += df[2 * n][i] * normal_0[n][i];
1551 }
1552
1553 // d xi_2/dy n_y
1554 // needs checking for 3D coords
1555 for (int i = 0; i < nquad1; ++i)
1556 {
1557 d1factors[1][i] +=
1558 df[2 * n + 1][(i + 1) * nquad0 - 1] * normal_1[n][i];
1559 d1factors[2][i] += df[2 * n + 1][i * nquad0] * normal_2[n][i];
1560 }
1561 }
1562 }
1563 else
1564 {
1565 // d xi_2/dx n_x
1566 for (int i = 0; i < nquad0; ++i)
1567 {
1568 d1factors[0][i] = df[1][0] * normal_0[0][i];
1569 }
1570
1571 // d xi_1/dx n_x
1572 for (int i = 0; i < nquad1; ++i)
1573 {
1574 d0factors[1][i] = df[0][0] * normal_1[0][i];
1575 d0factors[2][i] = df[0][0] * normal_2[0][i];
1576 }
1577
1578 for (int n = 1; n < ncoords; ++n)
1579 {
1580 // d xi_2/dy n_y
1581 // needs checking for 3D coords
1582 for (int i = 0; i < nquad0; ++i)
1583 {
1584 d1factors[0][i] += df[2 * n + 1][0] * normal_0[n][i];
1585 }
1586
1587 // d xi_1/dy n_y
1588 // needs checking for 3D coords
1589 for (int i = 0; i < nquad1; ++i)
1590 {
1591 d0factors[1][i] += df[2 * n][0] * normal_1[n][i];
1592 d0factors[2][i] += df[2 * n][0] * normal_2[n][i];
1593 }
1594 }
1595
1596 // d1factors
1597 // d xi_1/dx n_x
1598 for (int i = 0; i < nquad0; ++i)
1599 {
1600 d0factors[0][i] = df[0][0] * normal_0[0][i];
1601 }
1602
1603 // d xi_2/dx n_x
1604 for (int i = 0; i < nquad1; ++i)
1605 {
1606 d1factors[1][i] = df[1][0] * normal_1[0][i];
1607 d1factors[2][i] = df[1][0] * normal_2[0][i];
1608 }
1609
1610 for (int n = 1; n < ncoords; ++n)
1611 {
1612 // d xi_1/dy n_y
1613 // needs checking for 3D coords
1614 for (int i = 0; i < nquad0; ++i)
1615 {
1616 d0factors[0][i] += df[2 * n][0] * normal_0[n][i];
1617 }
1618
1619 // d xi_2/dy n_y
1620 // needs checking for 3D coords
1621 for (int i = 0; i < nquad1; ++i)
1622 {
1623 d1factors[1][i] += df[2 * n + 1][0] * normal_1[n][i];
1624 d1factors[2][i] += df[2 * n + 1][0] * normal_2[n][i];
1625 }
1626 }
1627 }
1628}
const NormalVector & GetTraceNormal(const int id)
Definition: Expansion.cpp:251

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::TriExp::v_NormVectorIProductWRTBase ( const Array< OneD, const Array< OneD, NekDouble > > &  Fvec,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 634 of file TriExp.cpp.

637{
638 NormVectorIProductWRTBase(Fvec[0], Fvec[1], Fvec[2], outarray);
639}
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:613

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

◆ v_NormVectorIProductWRTBase() [2/2]

void Nektar::LocalRegions::TriExp::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 606 of file TriExp.cpp.

610{
611 int nq = m_base[0]->GetNumPoints() * m_base[1]->GetNumPoints();
612 Array<OneD, NekDouble> Fn(nq);
613
614 const Array<OneD, const Array<OneD, NekDouble>> &normals =
615 GetLeftAdjacentElementExp()->GetTraceNormal(
617
618 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
619 {
620 Vmath::Vvtvvtp(nq, &normals[0][0], 1, &Fx[0], 1, &normals[1][0], 1,
621 &Fy[0], 1, &Fn[0], 1);
622 Vmath::Vvtvp(nq, &normals[2][0], 1, &Fz[0], 1, &Fn[0], 1, &Fn[0], 1);
623 }
624 else
625 {
626 Vmath::Svtsvtp(nq, normals[0][0], &Fx[0], 1, normals[1][0], &Fy[0], 1,
627 &Fn[0], 1);
628 Vmath::Svtvp(nq, normals[2][0], &Fz[0], 1, &Fn[0], 1, &Fn[0], 1);
629 }
630
631 IProductWRTBase(Fn, outarray);
632}
ExpansionSharedPtr GetLeftAdjacentElementExp() const
Definition: Expansion.h:441
int GetLeftAdjacentElementTrace() const
Definition: Expansion.h:454
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
Svtsvtp (scalar times vector plus scalar times vector):
Definition: Vmath.hpp:473

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::TriExp::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.

\( \frac{\partial u}{\partial x_1} = \left . \frac{2.0}{1-\eta_2} \frac{\partial u}{\partial d\eta_1} \right |_{\eta_2}\)

\( \frac{\partial u}{\partial x_2} = \left . \frac{1+\eta_1}{1-\eta_2} \frac{\partial u}{\partial d\eta_1} \right |_{\eta_2} + \left . \frac{\partial u}{\partial d\eta_2} \right |_{\eta_1} \)

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 94 of file TriExp.cpp.

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

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().

◆ v_PhysDeriv() [2/2]

void Nektar::LocalRegions::TriExp::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::StdTriExp.

Definition at line 152 of file TriExp.cpp.

155{
156 switch (dir)
157 {
158 case 0:
159 {
160 PhysDeriv(inarray, outarray, NullNekDouble1DArray,
162 }
163 break;
164 case 1:
165 {
166 PhysDeriv(inarray, NullNekDouble1DArray, outarray,
168 }
169 break;
170 case 2:
171 {
173 outarray);
174 }
175 break;
176 default:
177 {
178 ASSERTL1(false, "input dir is out of range");
179 }
180 break;
181 }
182}
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)
Definition: StdExpansion.h:849
static Array< OneD, NekDouble > NullNekDouble1DArray

References ASSERTL1, Nektar::NullNekDouble1DArray, and Nektar::StdRegions::StdExpansion::PhysDeriv().

◆ v_PhysDirectionalDeriv()

void Nektar::LocalRegions::TriExp::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^v_xi * du/d_xi + D^v_eta * du/d_eta

D_v = D^v_xi * du/d_xi + D^v_eta * du/d_eta

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 184 of file TriExp.cpp.

187{
188 if (!out.size())
189 {
190 return;
191 }
192
193 int nquad0 = m_base[0]->GetNumPoints();
194 int nquad1 = m_base[1]->GetNumPoints();
195 int nqtot = nquad0 * nquad1;
196
197 const Array<TwoD, const NekDouble> &df =
198 m_metricinfo->GetDerivFactors(GetPointsKeys());
199
200 Array<OneD, NekDouble> diff0(2 * nqtot);
201 Array<OneD, NekDouble> diff1(diff0 + nqtot);
202
203 // diff0 = du/d_xi, diff1 = du/d_eta
204 StdTriExp::v_PhysDeriv(inarray, diff0, diff1);
205
206 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
207 {
208 Array<OneD, Array<OneD, NekDouble>> tangmat(2);
209
210 // D^v_xi = v_x*d_xi/dx + v_y*d_xi/dy + v_z*d_xi/dz
211 // D^v_eta = v_x*d_eta/dx + v_y*d_eta/dy + v_z*d_eta/dz
212 for (int i = 0; i < 2; ++i)
213 {
214 tangmat[i] = Array<OneD, NekDouble>(nqtot, 0.0);
215 for (int k = 0; k < (m_geom->GetCoordim()); ++k)
216 {
217 Vmath::Vvtvp(nqtot, &df[2 * k + i][0], 1, &direction[k * nqtot],
218 1, &tangmat[i][0], 1, &tangmat[i][0], 1);
219 }
220 }
221
222 /// D_v = D^v_xi * du/d_xi + D^v_eta * du/d_eta
223 Vmath::Vmul(nqtot, &tangmat[0][0], 1, &diff0[0], 1, &out[0], 1);
224 Vmath::Vvtvp(nqtot, &tangmat[1][0], 1, &diff1[0], 1, &out[0], 1,
225 &out[0], 1);
226 }
227 else
228 {
229 Array<OneD, Array<OneD, NekDouble>> tangmat(2);
230
231 for (int i = 0; i < 2; ++i)
232 {
233 tangmat[i] = Array<OneD, NekDouble>(nqtot, 0.0);
234 for (int k = 0; k < (m_geom->GetCoordim()); ++k)
235 {
236 Vmath::Svtvp(nqtot, df[2 * k + i][0], &direction[k * nqtot], 1,
237 &tangmat[i][0], 1, &tangmat[i][0], 1);
238 }
239 }
240
241 /// D_v = D^v_xi * du/d_xi + D^v_eta * du/d_eta
242 Vmath::Vmul(nqtot, &tangmat[0][0], 1, &diff0[0], 1, &out[0], 1);
243
244 Vmath::Vvtvp(nqtot, &tangmat[1][0], 1, &diff1[0], 1, &out[0], 1,
245 &out[0], 1);
246 }
247}

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

◆ v_PhysEvaluate() [1/2]

NekDouble Nektar::LocalRegions::TriExp::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 696 of file TriExp.cpp.

698{
699 Array<OneD, NekDouble> Lcoord = Array<OneD, NekDouble>(2);
700
701 ASSERTL0(m_geom, "m_geom not defined");
702 m_geom->GetLocCoords(coord, Lcoord);
703
704 return StdExpansion2D::v_PhysEvaluate(Lcoord, physvals);
705}

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

◆ v_PhysEvaluate() [2/2]

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 707 of file TriExp.cpp.

710{
711 Array<OneD, NekDouble> Lcoord(2);
712 ASSERTL0(m_geom, "m_geom not defined");
713 m_geom->GetLocCoords(coord, Lcoord);
714 return StdTriExp::v_PhysEvaluate(Lcoord, inarray, firstOrderDerivs);
715}

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

◆ v_ReduceOrderCoeffs()

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

Function is used to compute exactly the advective numerical flux on theinterface of two elements with different expansions, hence an appropriate number of Gauss points has to be used. The number of Gauss points has to be equal to the number used by the highest polynomial degree of the two adjacent elements. Furthermore, this function is used to compute the sensor value in each element.

Parameters
numMinIs the reduced polynomial order
inarrayInput array of coefficients
dumpVarOutput array of reduced coefficients.

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1366 of file TriExp.cpp.

1369{
1370 int n_coeffs = inarray.size();
1371 int nquad0 = m_base[0]->GetNumPoints();
1372 int nquad1 = m_base[1]->GetNumPoints();
1373 int nqtot = nquad0 * nquad1;
1374 int nmodes0 = m_base[0]->GetNumModes();
1375 int nmodes1 = m_base[1]->GetNumModes();
1376 int numMin2 = nmodes0, i;
1377
1378 Array<OneD, NekDouble> coeff(n_coeffs, 0.0);
1379 Array<OneD, NekDouble> phys_tmp(nqtot, 0.0);
1380 Array<OneD, NekDouble> tmp, tmp2;
1381
1382 const LibUtilities::PointsKey Pkey0 = m_base[0]->GetPointsKey();
1383 const LibUtilities::PointsKey Pkey1 = m_base[1]->GetPointsKey();
1384
1385 LibUtilities::BasisKey b0(m_base[0]->GetBasisType(), nmodes0, Pkey0);
1386 LibUtilities::BasisKey b1(m_base[1]->GetBasisType(), nmodes1, Pkey1);
1387 LibUtilities::BasisKey bortho0(LibUtilities::eOrtho_A, nmodes0, Pkey0);
1388 LibUtilities::BasisKey bortho1(LibUtilities::eOrtho_B, nmodes1, Pkey1);
1389
1390 // Check if it is also possible to use the same InterCoeff routine
1391 // which is also used for Quadrilateral and Hexagonal shaped
1392 // elements
1393
1394 // For now, set up the used basis on the standard element to
1395 // calculate the phys values, set up the orthogonal basis to do a
1396 // forward transform, to obtain the coefficients in orthogonal
1397 // coefficient space
1398 StdRegions::StdTriExpSharedPtr m_OrthoTriExp;
1400
1403 bortho0, bortho1);
1404
1405 m_TriExp->BwdTrans(inarray, phys_tmp);
1406 m_OrthoTriExp->FwdTrans(phys_tmp, coeff);
1407
1408 for (i = 0; i < n_coeffs; i++)
1409 {
1410 if (i == numMin)
1411 {
1412 coeff[i] = 0.0;
1413 numMin += numMin2 - 1;
1414 numMin2 -= 1.0;
1415 }
1416 }
1417
1418 m_OrthoTriExp->BwdTrans(coeff, phys_tmp);
1419 m_TriExp->FwdTrans(phys_tmp, outarray);
1420}

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

◆ v_StdPhysEvaluate()

NekDouble Nektar::LocalRegions::TriExp::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 688 of file TriExp.cpp.

691{
692 // Evaluate point in local (eta) coordinates.
693 return StdExpansion2D::v_PhysEvaluate(Lcoord, physvals);
694}

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1422 of file TriExp.cpp.

1424{
1425 int nq = GetTotPoints();
1426
1427 // Calculate sqrt of the Jacobian
1428 Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
1429 Array<OneD, NekDouble> sqrt_jac(nq);
1430 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1431 {
1432 Vmath::Vsqrt(nq, jac, 1, sqrt_jac, 1);
1433 }
1434 else
1435 {
1436 Vmath::Fill(nq, sqrt(jac[0]), sqrt_jac, 1);
1437 }
1438
1439 // Multiply array by sqrt(Jac)
1440 Vmath::Vmul(nq, sqrt_jac, 1, array, 1, array, 1);
1441
1442 // Apply std region filter
1443 StdTriExp::v_SVVLaplacianFilter(array, mkey);
1444
1445 // Divide by sqrt(Jac)
1446 Vmath::Vdiv(nq, array, 1, sqrt_jac, 1, array, 1);
1447}
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.hpp:126

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::TriExp::v_WeakDerivMatrixOp ( const int  i,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdTriExp.

Definition at line 1125 of file TriExp.cpp.

1129{
1130 StdExpansion::WeakDerivMatrixOp_MatFree(i, inarray, outarray, mkey);
1131}

◆ v_WeakDirectionalDerivMatrixOp()

void Nektar::LocalRegions::TriExp::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 1133 of file TriExp.cpp.

1136{
1137 StdExpansion::WeakDirectionalDerivMatrixOp_MatFree(inarray, outarray, mkey);
1138}

Member Data Documentation

◆ m_matrixManager

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

Definition at line 245 of file TriExp.h.

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

◆ m_staticCondMatrixManager

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