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

#include <PyrExp.h>

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

Public Member Functions

 PyrExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::PyrGeomSharedPtr &geom)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 PyrExp (const PyrExp &T)
 
virtual ~PyrExp () override=default
 
- Public Member Functions inherited from Nektar::StdRegions::StdPyrExp
 StdPyrExp ()=default
 
 StdPyrExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdPyrExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
 
 StdPyrExp (const StdPyrExp &T)
 
 ~StdPyrExp () override=default
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion3D
 StdExpansion3D ()
 
 StdExpansion3D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdExpansion3D (const StdExpansion3D &T)
 
virtual ~StdExpansion3D () override
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
 Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points. More...
 
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
int GetNedges () const
 return the number of edges in 3D expansion More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
void GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
 
- 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 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 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)
 
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::Expansion3D
 Expansion3D (SpatialDomains::Geometry3DSharedPtr pGeom)
 
virtual ~Expansion3D () override=default
 
void SetTraceToGeomOrientation (Array< OneD, NekDouble > &inout)
 Align trace orientation with the geometry orientation. More...
 
void SetFaceToGeomOrientation (const int face, Array< OneD, NekDouble > &inout)
 Align face orientation with the geometry orientation. More...
 
void AddHDGHelmholtzFaceTerms (const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
 
void AddNormTraceInt (const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble >> &faceCoeffs, Array< OneD, NekDouble > &outarray)
 
void AddNormTraceInt (const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs)
 
void AddFaceBoundaryInt (const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
SpatialDomains::Geometry3DSharedPtr GetGeom3D () const
 
void v_ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
 
void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble >> &Fvec, Array< OneD, NekDouble > &outarray) override
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetTraceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation, int P1=-1, int P2=-1)
 
void GetInverseBoundaryMaps (Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int >> &emap, Array< OneD, Array< OneD, unsigned int >> &fmap)
 
DNekScalMatSharedPtr CreateMatrix (const MatrixKey &mkey)
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion
 Expansion (SpatialDomains::GeometrySharedPtr pGeom)
 
 Expansion (const Expansion &pSrc)
 
virtual ~Expansion ()
 
void SetTraceExp (const int traceid, ExpansionSharedPtr &f)
 
ExpansionSharedPtr GetTraceExp (const int traceid)
 
DNekScalMatSharedPtr GetLocMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocMatrix (const LocalRegions::MatrixKey &mkey)
 
DNekScalMatSharedPtr GetLocMatrix (const StdRegions::MatrixType mtype, const StdRegions::ConstFactorMap &factors=StdRegions::NullConstFactorMap, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
SpatialDomains::GeometrySharedPtr GetGeom () const
 
void Reset ()
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 
DNekScalBlkMatSharedPtr CreateStaticCondMatrix (const MatrixKey &mkey)
 
const SpatialDomains::GeomFactorsSharedPtrGetMetricInfo () const
 
DNekMatSharedPtr BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
DNekMatSharedPtr BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
void ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 
void AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
void AddFaceNormBoundaryInt (const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
void DGDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble >> &coeffs, Array< OneD, NekDouble > &outarray)
 
NekDouble VectorFlux (const Array< OneD, Array< OneD, NekDouble >> &vec)
 
void NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble >> &factors, Array< OneD, Array< OneD, NekDouble >> &d0factors, Array< OneD, Array< OneD, NekDouble >> &d1factors)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
void AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
ExpansionSharedPtr GetLeftAdjacentElementExp () const
 
ExpansionSharedPtr GetRightAdjacentElementExp () const
 
int GetLeftAdjacentElementTrace () const
 
int GetRightAdjacentElementTrace () const
 
void SetAdjacentElementExp (int traceid, ExpansionSharedPtr &e)
 
StdRegions::Orientation GetTraceOrient (int trace)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Divided by the metric jacobi and quadrature weights. More...
 
void GetTraceQFactors (const int trace, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetTracePhysVals (const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
 
void GetTracePhysMap (const int edge, Array< OneD, int > &outarray)
 
void ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1)
 
const NormalVectorGetTraceNormal (const int id)
 
void ComputeTraceNormal (const int id)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
void SetUpPhysNormals (const int trace)
 
void AddRobinMassMatrix (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void TraceNormLen (const int traceid, NekDouble &h, NekDouble &p)
 
void AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
 
const Array< OneD, const NekDouble > & GetElmtBndNormDirElmtLen (const int nbnd) const
 
void StdDerivBaseOnTraceMat (Array< OneD, DNekMatSharedPtr > &DerivMat)
 

Protected Member Functions

virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray) override
 Integrate the physical point list inarray over pyramidic region and return the value. More...
 
virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
 Calculate the derivative of the physical points. More...
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Forward transform from physical quadrature space stored in inarray and evaluate the expansion coefficients and store in (this)->m_coeffs. More...
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into outarray: More...
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
 
void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculates the inner product \( I_{pqr} = (u, \partial_{x_i} \phi_{pqr}) \). More...
 
void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray) override
 
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp (void) const override
 
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp (void) const override
 
virtual void v_GetCoord (const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
 
NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
virtual void v_GetTracePhysMap (const int face, Array< OneD, int > &outarray) override
 
void v_ComputeTraceNormal (const int face) override
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
 
virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey) override
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdRegions::StdMatrixKey &mkey) override
 
virtual DNekScalMatSharedPtr v_GetLocMatrix (const MatrixKey &mkey) override
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const MatrixKey &mkey) override
 
void v_DropLocMatrix (const MatrixKey &mkey) override
 
void v_DropLocStaticCondMatrix (const MatrixKey &mkey) override
 
virtual void v_ComputeLaplacianMetric () override
 
virtual void v_NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble >> &d0factors, Array< OneD, Array< OneD, NekDouble >> &d1factors, Array< OneD, Array< OneD, NekDouble >> &d2factors) 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::StdPyrExp
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) override
 
void v_StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Backward transformation is evaluated at the quadrature points. 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 > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2) override
 
void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2) 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
 
void v_GetTraceNumModes (const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2) override
 
NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode) final
 
int v_GetNverts () const override
 
int v_GetNedges () const override
 
int v_GetNtraces () const override
 
LibUtilities::ShapeType v_DetShapeType () const override
 
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_GetEdgeNcoeffs (const int i) const override
 
int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset) override
 
const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int k) 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 fid, Array< OneD, unsigned int > &maparray) override
 
void v_GetElmtTraceToTraceMap (const unsigned int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q) override
 
void v_GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
 
void v_GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
 
void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion3D
virtual NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals) override
 
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
NekDouble BaryTensorDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 
virtual void v_GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient, int P, int Q) override
 
virtual void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void 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 (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
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::Expansion3D
virtual void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble >> &faceCoeffs, Array< OneD, NekDouble > &out_d) override
 Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs and the imposed boundary values in EdgeExp (which will have its phys space updated). More...
 
virtual void v_AddFaceNormBoundaryInt (const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray) override
 
virtual void v_AddRobinMassMatrix (const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
 
virtual StdRegions::Orientation v_GetTraceOrient (int face) override
 
virtual void v_GetTracePhysVals (const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
 Extract the physical values along face face from inarray into outarray following the local face orientation and point distribution defined by defined in FaceExp. More...
 
virtual void v_GenTraceExp (const int traceid, ExpansionSharedPtr &exp) override
 
void GetPhysFaceVarCoeffsFromElement (const int face, ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
 
virtual DNekMatSharedPtr v_BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType) override
 
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &transformationmatrix) override
 Build inverse and inverse transposed transformation matrix: \(\mathbf{R^{-1}}\) and \(\mathbf{R^{-T}}\). More...
 
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd) override
 
virtual void v_TraceNormLen (const int traceid, NekDouble &h, NekDouble &p) override
 
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion
void ComputeLaplacianMetric ()
 
void ComputeQuadratureMetric ()
 
void ComputeGmatcdotMF (const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble >> &dfdir)
 
Array< OneD, NekDoubleGetMF (const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
 
Array< OneD, NekDoubleGetMFDiv (const int dir, const StdRegions::VarCoeffMap &varcoeffs)
 
Array< OneD, NekDoubleGetMFMag (const int dir, const StdRegions::VarCoeffMap &varcoeffs)
 
virtual void v_MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual int v_GetCoordim () const override
 
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 NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble >> &vec)
 
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
virtual void v_GetTraceQFactors (const int trace, Array< OneD, NekDouble > &outarray)
 
virtual 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_AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
 

Private Member Functions

virtual void v_LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
 

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::Expansion3D
std::map< int, NormalVectorm_faceNormals
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_indexMapManager
 
std::map< int, ExpansionWeakPtrm_traceExp
 
SpatialDomains::GeometrySharedPtr m_geom
 
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
 
MetricMap m_metrics
 
std::map< int, NormalVectorm_traceNormals
 
ExpansionWeakPtr m_elementLeft
 
ExpansionWeakPtr m_elementRight
 
int m_elementTraceLeft = -1
 
int m_elementTraceRight = -1
 
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
 the element length in each element boundary(Vertex, edge or face) normal direction calculated based on the local m_metricinfo times the standard element length (which is 2.0) More...
 

Detailed Description

Definition at line 50 of file PyrExp.h.

Constructor & Destructor Documentation

◆ PyrExp() [1/2]

Nektar::LocalRegions::PyrExp::PyrExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc,
const SpatialDomains::PyrGeomSharedPtr geom 
)

Constructor using BasisKey class for quadrature points and order definition.

Definition at line 45 of file PyrExp.cpp.

50  Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
51  3, Ba, Bb, Bc),
53  Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
54  Ba, Bb, Bc),
55  StdPyrExp(Ba, Bb, Bc), Expansion(geom), Expansion3D(geom),
57  std::bind(&Expansion3D::CreateMatrix, this, std::placeholders::_1),
58  std::string("PyrExpMatrix")),
60  this, std::placeholders::_1),
61  std::string("PyrExpStaticCondMatrix"))
62 {
63 }
Expansion3D(SpatialDomains::Geometry3DSharedPtr pGeom)
Definition: Expansion3D.h:61
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: Expansion.cpp:277
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:47
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PyrExp.h:176
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PyrExp.h:178
StdExpansion()
Default Constructor.
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:237

◆ PyrExp() [2/2]

Nektar::LocalRegions::PyrExp::PyrExp ( const PyrExp T)

Definition at line 65 of file PyrExp.cpp.

67  Expansion3D(T), m_matrixManager(T.m_matrixManager),
68  m_staticCondMatrixManager(T.m_staticCondMatrixManager)
69 {
70 }

◆ ~PyrExp()

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

Member Function Documentation

◆ v_AlignVectorToCollapsedDir()

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

399 {
400  const int nquad0 = m_base[0]->GetNumPoints();
401  const int nquad1 = m_base[1]->GetNumPoints();
402  const int nquad2 = m_base[2]->GetNumPoints();
403  const int order0 = m_base[0]->GetNumModes();
404  const int order1 = m_base[1]->GetNumModes();
405  const int nqtot = nquad0 * nquad1 * nquad2;
406 
407  const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
408  const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
409  const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
410 
411  Array<OneD, NekDouble> gfac0(nquad0);
412  Array<OneD, NekDouble> gfac1(nquad1);
413  Array<OneD, NekDouble> gfac2(nquad2);
414  Array<OneD, NekDouble> tmp5(nqtot);
415  Array<OneD, NekDouble> wsp(
416  std::max(nqtot, order0 * nquad2 * (nquad1 + order1)));
417 
418  Array<OneD, NekDouble> tmp2 = outarray[0];
419  Array<OneD, NekDouble> tmp3 = outarray[1];
420  Array<OneD, NekDouble> tmp4 = outarray[2];
421 
422  const Array<TwoD, const NekDouble> &df =
423  m_metricinfo->GetDerivFactors(GetPointsKeys());
424 
425  Array<OneD, NekDouble> tmp1;
426  tmp1 = inarray;
427 
428  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
429  {
430  Vmath::Vmul(nqtot, &df[3 * dir][0], 1, tmp1.get(), 1, tmp2.get(), 1);
431  Vmath::Vmul(nqtot, &df[3 * dir + 1][0], 1, tmp1.get(), 1, tmp3.get(),
432  1);
433  Vmath::Vmul(nqtot, &df[3 * dir + 2][0], 1, tmp1.get(), 1, tmp4.get(),
434  1);
435  }
436  else
437  {
438  Vmath::Smul(nqtot, df[3 * dir][0], tmp1.get(), 1, tmp2.get(), 1);
439  Vmath::Smul(nqtot, df[3 * dir + 1][0], tmp1.get(), 1, tmp3.get(), 1);
440  Vmath::Smul(nqtot, df[3 * dir + 2][0], tmp1.get(), 1, tmp4.get(), 1);
441  }
442 
443  // set up geometric factor: (1+z0)/2
444  for (int i = 0; i < nquad0; ++i)
445  {
446  gfac0[i] = 0.5 * (1 + z0[i]);
447  }
448 
449  // set up geometric factor: (1+z1)/2
450  for (int i = 0; i < nquad1; ++i)
451  {
452  gfac1[i] = 0.5 * (1 + z1[i]);
453  }
454 
455  // Set up geometric factor: 2/(1-z2)
456  for (int i = 0; i < nquad2; ++i)
457  {
458  gfac2[i] = 2.0 / (1 - z2[i]);
459  }
460 
461  const int nq01 = nquad0 * nquad1;
462 
463  for (int i = 0; i < nquad2; ++i)
464  {
465  Vmath::Smul(nq01, gfac2[i], &tmp2[0] + i * nq01, 1, &tmp2[0] + i * nq01,
466  1); // 2/(1-z2) for d/dxi_0
467  Vmath::Smul(nq01, gfac2[i], &tmp3[0] + i * nq01, 1, &tmp3[0] + i * nq01,
468  1); // 2/(1-z2) for d/dxi_1
469  Vmath::Smul(nq01, gfac2[i], &tmp4[0] + i * nq01, 1, &tmp5[0] + i * nq01,
470  1); // 2/(1-z2) for d/dxi_2
471  }
472 
473  // (1+z0)/(1-z2) for d/d eta_0
474  for (int i = 0; i < nquad1 * nquad2; ++i)
475  {
476  Vmath::Vmul(nquad0, &gfac0[0], 1, &tmp5[0] + i * nquad0, 1,
477  &wsp[0] + i * nquad0, 1);
478  }
479 
480  Vmath::Vadd(nqtot, &tmp2[0], 1, &wsp[0], 1, &tmp2[0], 1);
481 
482  // (1+z1)/(1-z2) for d/d eta_1
483  for (int i = 0; i < nquad1 * nquad2; ++i)
484  {
485  Vmath::Smul(nquad0, gfac1[i % nquad1], &tmp5[0] + i * nquad0, 1,
486  &tmp5[0] + i * nquad0, 1);
487  }
488  Vmath::Vadd(nqtot, &tmp3[0], 1, &tmp5[0], 1, &tmp3[0], 1);
489 }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:276
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.cpp:209
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:359
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:248

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

Referenced by v_IProductWRTDerivBase_SumFac().

◆ v_ComputeLaplacianMetric()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1097 of file PyrExp.cpp.

1098 {
1099  if (m_metrics.count(eMetricQuadrature) == 0)
1100  {
1102  }
1103 
1104  int i, j;
1105  const unsigned int nqtot = GetTotPoints();
1106  const unsigned int dim = 3;
1107  const MetricType m[3][3] = {
1111 
1112  for (unsigned int i = 0; i < dim; ++i)
1113  {
1114  for (unsigned int j = i; j < dim; ++j)
1115  {
1116  m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
1117  }
1118  }
1119 
1120  // Define shorthand synonyms for m_metrics storage
1121  Array<OneD, NekDouble> g0(m_metrics[m[0][0]]);
1122  Array<OneD, NekDouble> g1(m_metrics[m[1][1]]);
1123  Array<OneD, NekDouble> g2(m_metrics[m[2][2]]);
1124  Array<OneD, NekDouble> g3(m_metrics[m[0][1]]);
1125  Array<OneD, NekDouble> g4(m_metrics[m[0][2]]);
1126  Array<OneD, NekDouble> g5(m_metrics[m[1][2]]);
1127 
1128  // Allocate temporary storage
1129  Array<OneD, NekDouble> alloc(9 * nqtot, 0.0);
1130  Array<OneD, NekDouble> h0(nqtot, alloc);
1131  Array<OneD, NekDouble> h1(nqtot, alloc + 1 * nqtot);
1132  Array<OneD, NekDouble> h2(nqtot, alloc + 2 * nqtot);
1133  Array<OneD, NekDouble> wsp1(nqtot, alloc + 3 * nqtot);
1134  Array<OneD, NekDouble> wsp2(nqtot, alloc + 4 * nqtot);
1135  Array<OneD, NekDouble> wsp3(nqtot, alloc + 5 * nqtot);
1136  Array<OneD, NekDouble> wsp4(nqtot, alloc + 6 * nqtot);
1137  Array<OneD, NekDouble> wsp5(nqtot, alloc + 7 * nqtot);
1138  Array<OneD, NekDouble> wsp6(nqtot, alloc + 8 * nqtot);
1139 
1140  const Array<TwoD, const NekDouble> &df =
1141  m_metricinfo->GetDerivFactors(GetPointsKeys());
1142  const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
1143  const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
1144  const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
1145  const unsigned int nquad0 = m_base[0]->GetNumPoints();
1146  const unsigned int nquad1 = m_base[1]->GetNumPoints();
1147  const unsigned int nquad2 = m_base[2]->GetNumPoints();
1148 
1149  // Populate collapsed coordinate arrays h0, h1 and h2.
1150  for (j = 0; j < nquad2; ++j)
1151  {
1152  for (i = 0; i < nquad1; ++i)
1153  {
1154  Vmath::Fill(nquad0, 2.0 / (1.0 - z2[j]),
1155  &h0[0] + i * nquad0 + j * nquad0 * nquad1, 1);
1156  Vmath::Fill(nquad0, 1.0 / (1.0 - z2[j]),
1157  &h1[0] + i * nquad0 + j * nquad0 * nquad1, 1);
1158  Vmath::Fill(nquad0, (1.0 + z1[i]) / (1.0 - z2[j]),
1159  &h2[0] + i * nquad0 + j * nquad0 * nquad1, 1);
1160  }
1161  }
1162  for (i = 0; i < nquad0; i++)
1163  {
1164  Blas::Dscal(nquad1 * nquad2, 1 + z0[i], &h1[0] + i, nquad0);
1165  }
1166 
1167  // Step 3. Construct combined metric terms for physical space to
1168  // collapsed coordinate system.
1169  // Order of construction optimised to minimise temporary storage
1170  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1171  {
1172  // f_{1k}
1173  Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &df[2][0], 1, &h1[0], 1,
1174  &wsp1[0], 1);
1175  Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &df[5][0], 1, &h1[0], 1,
1176  &wsp2[0], 1);
1177  Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &df[8][0], 1, &h1[0], 1,
1178  &wsp3[0], 1);
1179 
1180  // g0
1181  Vmath::Vvtvvtp(nqtot, &wsp1[0], 1, &wsp1[0], 1, &wsp2[0], 1, &wsp2[0],
1182  1, &g0[0], 1);
1183  Vmath::Vvtvp(nqtot, &wsp3[0], 1, &wsp3[0], 1, &g0[0], 1, &g0[0], 1);
1184 
1185  // g4
1186  Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp1[0], 1, &df[5][0], 1, &wsp2[0],
1187  1, &g4[0], 1);
1188  Vmath::Vvtvp(nqtot, &df[8][0], 1, &wsp3[0], 1, &g4[0], 1, &g4[0], 1);
1189 
1190  // f_{2k}
1191  Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &h0[0], 1, &df[2][0], 1, &h2[0], 1,
1192  &wsp4[0], 1);
1193  Vmath::Vvtvvtp(nqtot, &df[4][0], 1, &h0[0], 1, &df[5][0], 1, &h2[0], 1,
1194  &wsp5[0], 1);
1195  Vmath::Vvtvvtp(nqtot, &df[7][0], 1, &h0[0], 1, &df[8][0], 1, &h2[0], 1,
1196  &wsp6[0], 1);
1197 
1198  // g1
1199  Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0],
1200  1, &g1[0], 1);
1201  Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp6[0], 1, &g1[0], 1, &g1[0], 1);
1202 
1203  // g3
1204  Vmath::Vvtvvtp(nqtot, &wsp1[0], 1, &wsp4[0], 1, &wsp2[0], 1, &wsp5[0],
1205  1, &g3[0], 1);
1206  Vmath::Vvtvp(nqtot, &wsp3[0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1207 
1208  // g5
1209  Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0],
1210  1, &g5[0], 1);
1211  Vmath::Vvtvp(nqtot, &df[8][0], 1, &wsp6[0], 1, &g5[0], 1, &g5[0], 1);
1212 
1213  // g2
1214  Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1,
1215  &df[5][0], 1, &g2[0], 1);
1216  Vmath::Vvtvp(nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1217  }
1218  else
1219  {
1220  // f_{1k}
1221  Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[2][0], &h1[0], 1,
1222  &wsp1[0], 1);
1223  Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[5][0], &h1[0], 1,
1224  &wsp2[0], 1);
1225  Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[8][0], &h1[0], 1,
1226  &wsp3[0], 1);
1227 
1228  // g0
1229  Vmath::Vvtvvtp(nqtot, &wsp1[0], 1, &wsp1[0], 1, &wsp2[0], 1, &wsp2[0],
1230  1, &g0[0], 1);
1231  Vmath::Vvtvp(nqtot, &wsp3[0], 1, &wsp3[0], 1, &g0[0], 1, &g0[0], 1);
1232 
1233  // g4
1234  Vmath::Svtsvtp(nqtot, df[2][0], &wsp1[0], 1, df[5][0], &wsp2[0], 1,
1235  &g4[0], 1);
1236  Vmath::Svtvp(nqtot, df[8][0], &wsp3[0], 1, &g4[0], 1, &g4[0], 1);
1237 
1238  // f_{2k}
1239  Vmath::Svtsvtp(nqtot, df[1][0], &h0[0], 1, df[2][0], &h2[0], 1,
1240  &wsp4[0], 1);
1241  Vmath::Svtsvtp(nqtot, df[4][0], &h0[0], 1, df[5][0], &h2[0], 1,
1242  &wsp5[0], 1);
1243  Vmath::Svtsvtp(nqtot, df[7][0], &h0[0], 1, df[8][0], &h2[0], 1,
1244  &wsp6[0], 1);
1245 
1246  // g1
1247  Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0],
1248  1, &g1[0], 1);
1249  Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp6[0], 1, &g1[0], 1, &g1[0], 1);
1250 
1251  // g3
1252  Vmath::Vvtvvtp(nqtot, &wsp1[0], 1, &wsp4[0], 1, &wsp2[0], 1, &wsp5[0],
1253  1, &g3[0], 1);
1254  Vmath::Vvtvp(nqtot, &wsp3[0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1255 
1256  // g5
1257  Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1,
1258  &g5[0], 1);
1259  Vmath::Svtvp(nqtot, df[8][0], &wsp6[0], 1, &g5[0], 1, &g5[0], 1);
1260 
1261  // g2
1262  Vmath::Fill(nqtot,
1263  df[2][0] * df[2][0] + df[5][0] * df[5][0] +
1264  df[8][0] * df[8][0],
1265  &g2[0], 1);
1266  }
1267 
1268  for (unsigned int i = 0; i < dim; ++i)
1269  {
1270  for (unsigned int j = i; j < dim; ++j)
1271  {
1272  MultiplyByQuadratureMetric(m_metrics[m[i][j]], m_metrics[m[i][j]]);
1273  }
1274  }
1275 }
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:729
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:168
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
svtvvtp (scalar times vector plus scalar times vector):
Definition: Vmath.cpp:751
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:622
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:574
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Definition: Vmath.cpp:692

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

◆ v_ComputeTraceNormal()

void Nektar::LocalRegions::PyrExp::v_ComputeTraceNormal ( const int  face)
overrideprotectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 731 of file PyrExp.cpp.

732 {
733  const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
734  GetGeom()->GetMetricInfo();
735 
737  for (int i = 0; i < ptsKeys.size(); ++i)
738  {
739  // Need at least 2 points for computing normals
740  if (ptsKeys[i].GetNumPoints() == 1)
741  {
742  LibUtilities::PointsKey pKey(2, ptsKeys[i].GetPointsType());
743  ptsKeys[i] = pKey;
744  }
745  }
746 
747  SpatialDomains::GeomType type = geomFactors->GetGtype();
748  const Array<TwoD, const NekDouble> &df =
749  geomFactors->GetDerivFactors(ptsKeys);
750  const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
751 
752  LibUtilities::BasisKey tobasis0 = GetTraceBasisKey(face, 0);
753  LibUtilities::BasisKey tobasis1 = GetTraceBasisKey(face, 1);
754 
755  // Number of quadrature points in face expansion.
756  int nq_face = tobasis0.GetNumPoints() * tobasis1.GetNumPoints();
757 
758  int vCoordDim = GetCoordim();
759  int i;
760 
761  m_traceNormals[face] = Array<OneD, Array<OneD, NekDouble>>(vCoordDim);
762  Array<OneD, Array<OneD, NekDouble>> &normal = m_traceNormals[face];
763  for (i = 0; i < vCoordDim; ++i)
764  {
765  normal[i] = Array<OneD, NekDouble>(nq_face);
766  }
767 
768  size_t nqb = nq_face;
769  size_t nbnd = face;
770  m_elmtBndNormDirElmtLen[nbnd] = Array<OneD, NekDouble>{nqb, 0.0};
771  Array<OneD, NekDouble> &length = m_elmtBndNormDirElmtLen[nbnd];
772 
773  // Regular geometry case
774  if (type == SpatialDomains::eRegular ||
776  {
777  NekDouble fac;
778  // Set up normals
779  switch (face)
780  {
781  case 0:
782  {
783  for (i = 0; i < vCoordDim; ++i)
784  {
785  normal[i][0] = -df[3 * i + 2][0];
786  }
787  break;
788  }
789  case 1:
790  {
791  for (i = 0; i < vCoordDim; ++i)
792  {
793  normal[i][0] = -df[3 * i + 1][0];
794  }
795  break;
796  }
797  case 2:
798  {
799  for (i = 0; i < vCoordDim; ++i)
800  {
801  normal[i][0] = df[3 * i][0] + df[3 * i + 2][0];
802  }
803  break;
804  }
805  case 3:
806  {
807  for (i = 0; i < vCoordDim; ++i)
808  {
809  normal[i][0] = df[3 * i + 1][0] + df[3 * i + 2][0];
810  }
811  break;
812  }
813  case 4:
814  {
815  for (i = 0; i < vCoordDim; ++i)
816  {
817  normal[i][0] = -df[3 * i][0];
818  }
819  break;
820  }
821  default:
822  ASSERTL0(false, "face is out of range (face < 4)");
823  }
824 
825  // Normalise resulting vector.
826  fac = 0.0;
827  for (i = 0; i < vCoordDim; ++i)
828  {
829  fac += normal[i][0] * normal[i][0];
830  }
831  fac = 1.0 / sqrt(fac);
832 
833  Vmath::Fill(nqb, fac, length, 1);
834 
835  for (i = 0; i < vCoordDim; ++i)
836  {
837  Vmath::Fill(nq_face, fac * normal[i][0], normal[i], 1);
838  }
839  }
840  else
841  {
842  // Set up deformed normals.
843  int j, k;
844 
845  int nq0 = ptsKeys[0].GetNumPoints();
846  int nq1 = ptsKeys[1].GetNumPoints();
847  int nq2 = ptsKeys[2].GetNumPoints();
848  int nq01 = nq0 * nq1;
849  int nqtot;
850 
851  // Determine number of quadrature points on the face.
852  if (face == 0)
853  {
854  nqtot = nq0 * nq1;
855  }
856  else if (face == 1 || face == 3)
857  {
858  nqtot = nq0 * nq2;
859  }
860  else
861  {
862  nqtot = nq1 * nq2;
863  }
864 
865  LibUtilities::PointsKey points0;
866  LibUtilities::PointsKey points1;
867 
868  Array<OneD, NekDouble> faceJac(nqtot);
869  Array<OneD, NekDouble> normals(vCoordDim * nqtot, 0.0);
870 
871  // Extract Jacobian along face and recover local derivatives
872  // (dx/dr) for polynomial interpolation by multiplying m_gmat by
873  // jacobian
874  switch (face)
875  {
876  case 0:
877  {
878  for (j = 0; j < nq01; ++j)
879  {
880  normals[j] = -df[2][j] * jac[j];
881  normals[nqtot + j] = -df[5][j] * jac[j];
882  normals[2 * nqtot + j] = -df[8][j] * jac[j];
883  faceJac[j] = jac[j];
884  }
885 
886  points0 = ptsKeys[0];
887  points1 = ptsKeys[1];
888  break;
889  }
890 
891  case 1:
892  {
893  for (j = 0; j < nq0; ++j)
894  {
895  for (k = 0; k < nq2; ++k)
896  {
897  int tmp = j + nq01 * k;
898  normals[j + k * nq0] = -df[1][tmp] * jac[tmp];
899  normals[nqtot + j + k * nq0] = -df[4][tmp] * jac[tmp];
900  normals[2 * nqtot + j + k * nq0] =
901  -df[7][tmp] * jac[tmp];
902  faceJac[j + k * nq0] = jac[tmp];
903  }
904  }
905 
906  points0 = ptsKeys[0];
907  points1 = ptsKeys[2];
908  break;
909  }
910 
911  case 2:
912  {
913  for (j = 0; j < nq1; ++j)
914  {
915  for (k = 0; k < nq2; ++k)
916  {
917  int tmp = nq0 - 1 + nq0 * j + nq01 * k;
918  normals[j + k * nq1] =
919  (df[0][tmp] + df[2][tmp]) * jac[tmp];
920  normals[nqtot + j + k * nq1] =
921  (df[3][tmp] + df[5][tmp]) * jac[tmp];
922  normals[2 * nqtot + j + k * nq1] =
923  (df[6][tmp] + df[8][tmp]) * jac[tmp];
924  faceJac[j + k * nq1] = jac[tmp];
925  }
926  }
927 
928  points0 = ptsKeys[1];
929  points1 = ptsKeys[2];
930  break;
931  }
932 
933  case 3:
934  {
935  for (j = 0; j < nq0; ++j)
936  {
937  for (k = 0; k < nq2; ++k)
938  {
939  int tmp = nq0 * (nq1 - 1) + j + nq01 * k;
940  normals[j + k * nq0] =
941  (df[1][tmp] + df[2][tmp]) * jac[tmp];
942  normals[nqtot + j + k * nq0] =
943  (df[4][tmp] + df[5][tmp]) * jac[tmp];
944  normals[2 * nqtot + j + k * nq0] =
945  (df[7][tmp] + df[8][tmp]) * jac[tmp];
946  faceJac[j + k * nq0] = jac[tmp];
947  }
948  }
949 
950  points0 = ptsKeys[0];
951  points1 = ptsKeys[2];
952  break;
953  }
954 
955  case 4:
956  {
957  for (j = 0; j < nq1; ++j)
958  {
959  for (k = 0; k < nq2; ++k)
960  {
961  int tmp = j * nq0 + nq01 * k;
962  normals[j + k * nq1] = -df[0][tmp] * jac[tmp];
963  normals[nqtot + j + k * nq1] = -df[3][tmp] * jac[tmp];
964  normals[2 * nqtot + j + k * nq1] =
965  -df[6][tmp] * jac[tmp];
966  faceJac[j + k * nq1] = jac[tmp];
967  }
968  }
969 
970  points0 = ptsKeys[1];
971  points1 = ptsKeys[2];
972  break;
973  }
974 
975  default:
976  ASSERTL0(false, "face is out of range (face < 4)");
977  }
978 
979  Array<OneD, NekDouble> work(nq_face, 0.0);
980  // Interpolate Jacobian and invert
981  LibUtilities::Interp2D(points0, points1, faceJac,
982  tobasis0.GetPointsKey(), tobasis1.GetPointsKey(),
983  work);
984  Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
985 
986  // Interpolate normal and multiply by inverse Jacobian.
987  for (i = 0; i < vCoordDim; ++i)
988  {
989  LibUtilities::Interp2D(points0, points1, &normals[i * nqtot],
990  tobasis0.GetPointsKey(),
991  tobasis1.GetPointsKey(), &normal[i][0]);
992  Vmath::Vmul(nq_face, work, 1, normal[i], 1, normal[i], 1);
993  }
994 
995  // Normalise to obtain unit normals.
996  Vmath::Zero(nq_face, work, 1);
997  for (i = 0; i < GetCoordim(); ++i)
998  {
999  Vmath::Vvtvp(nq_face, normal[i], 1, normal[i], 1, work, 1, work, 1);
1000  }
1001 
1002  Vmath::Vsqrt(nq_face, work, 1, work, 1);
1003  Vmath::Sdiv(nq_face, 1.0, work, 1, work, 1);
1004 
1005  Vmath::Vcopy(nqb, work, 1, length, 1);
1006 
1007  for (i = 0; i < GetCoordim(); ++i)
1008  {
1009  Vmath::Vmul(nq_face, normal[i], 1, work, 1, normal[i], 1);
1010  }
1011  }
1012 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
std::map< int, NormalVector > m_traceNormals
Definition: Expansion.h:278
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
Definition: Expansion.h:288
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:171
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:305
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:211
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:224
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
Definition: Interp.cpp:106
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:250
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
double NekDouble
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:534
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
Definition: Vmath.cpp:324
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:492
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1255
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References ASSERTL0, Nektar::SpatialDomains::eMovingRegular, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::LocalRegions::Expansion::GetGeom(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetTraceBasisKey(), Nektar::LibUtilities::Interp2D(), Nektar::LocalRegions::Expansion::m_elmtBndNormDirElmtLen, Nektar::LocalRegions::Expansion::m_traceNormals, Vmath::Sdiv(), tinysimd::sqrt(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vsqrt(), Vmath::Vvtvp(), and Vmath::Zero().

◆ v_CreateStdMatrix()

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

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 1066 of file PyrExp.cpp.

1067 {
1068  LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
1069  LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
1070  LibUtilities::BasisKey bkey2 = m_base[2]->GetBasisKey();
1072  MemoryManager<StdPyrExp>::AllocateSharedPtr(bkey0, bkey1, bkey2);
1073 
1074  return tmp->GetStdMatrix(mkey);
1075 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< StdPyrExp > StdPyrExpSharedPtr
Definition: StdPyrExp.h:258

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

◆ v_DropLocMatrix()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1082 of file PyrExp.cpp.

1083 {
1084  m_matrixManager.DeleteObject(mkey);
1085 }

References m_matrixManager.

◆ v_DropLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1092 of file PyrExp.cpp.

1093 {
1094  m_staticCondMatrixManager.DeleteObject(mkey);
1095 }

References m_staticCondMatrixManager.

◆ v_ExtractDataToCoeffs()

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

547 {
548  int data_order0 = nummodes[mode_offset];
549  int fillorder0 = min(m_base[0]->GetNumModes(), data_order0);
550  int data_order1 = nummodes[mode_offset + 1];
551  int order1 = m_base[1]->GetNumModes();
552  int fillorder1 = min(order1, data_order1);
553  int data_order2 = nummodes[mode_offset + 2];
554  int order2 = m_base[2]->GetNumModes();
555  int fillorder2 = min(order2, data_order2);
556 
557  // Check if not same order or basis and if not make temp
558  // element to read in data
559  if (fromType[0] != m_base[0]->GetBasisType() ||
560  fromType[1] != m_base[1]->GetBasisType() ||
561  fromType[2] != m_base[2]->GetBasisType() || data_order0 != fillorder0 ||
562  data_order1 != fillorder1 || data_order2 != fillorder2)
563  {
564  // Construct a pyr with the appropriate basis type at our
565  // quadrature points, and one more to do a forwards
566  // transform. We can then copy the output to coeffs.
567  StdRegions::StdPyrExp tmpPyr(
568  LibUtilities::BasisKey(fromType[0], data_order0,
569  m_base[0]->GetPointsKey()),
570  LibUtilities::BasisKey(fromType[1], data_order1,
571  m_base[1]->GetPointsKey()),
572  LibUtilities::BasisKey(fromType[2], data_order2,
573  m_base[2]->GetPointsKey()));
574 
575  StdRegions::StdPyrExp tmpPyr2(m_base[0]->GetBasisKey(),
576  m_base[1]->GetBasisKey(),
577  m_base[2]->GetBasisKey());
578 
579  Array<OneD, const NekDouble> tmpData(tmpPyr.GetNcoeffs(), data);
580  Array<OneD, NekDouble> tmpBwd(tmpPyr2.GetTotPoints());
581  Array<OneD, NekDouble> tmpOut(tmpPyr2.GetNcoeffs());
582 
583  tmpPyr.BwdTrans(tmpData, tmpBwd);
584  tmpPyr2.FwdTrans(tmpBwd, tmpOut);
585  Vmath::Vcopy(tmpOut.size(), &tmpOut[0], 1, coeffs, 1);
586  }
587  else
588  {
589  Vmath::Vcopy(m_ncoeffs, &data[0], 1, coeffs, 1);
590  }
591 }
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:162

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

◆ v_FwdTrans()

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

Forward transform from physical quadrature space stored in inarray and evaluate the expansion coefficients and store in (this)->m_coeffs.

Inputs:

  • inarray: array of physical quadrature points to be transformed

Outputs:

  • (this)->_coeffs: updated array of expansion coefficients.

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 223 of file PyrExp.cpp.

225 {
226  if (m_base[0]->Collocation() && m_base[1]->Collocation() &&
227  m_base[2]->Collocation())
228  {
229  Vmath::Vcopy(GetNcoeffs(), &inarray[0], 1, &outarray[0], 1);
230  }
231  else
232  {
233  v_IProductWRTBase(inarray, outarray);
234 
235  // get Mass matrix inverse
236  MatrixKey masskey(StdRegions::eInvMass, DetShapeType(), *this);
237  DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
238 
239  // copy inarray in case inarray == outarray
240  DNekVec in(m_ncoeffs, outarray);
241  DNekVec out(m_ncoeffs, outarray, eWrapper);
242 
243  out = (*matsys) * in;
244  }
245 }
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
Definition: PyrExp.cpp:278
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:130
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:373
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:48

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

◆ v_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 1045 of file PyrExp.cpp.

1046 {
1047  DNekMatSharedPtr returnval;
1048 
1049  switch (mkey.GetMatrixType())
1050  {
1057  returnval = Expansion3D::v_GenMatrix(mkey);
1058  break;
1059  default:
1060  returnval = StdPyrExp::v_GenMatrix(mkey);
1061  }
1062 
1063  return returnval;
1064 }
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75

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

◆ v_GetCoord()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 519 of file PyrExp.cpp.

521 {
522  int i;
523 
524  ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 && Lcoords[1] <= -1.0 &&
525  Lcoords[1] >= 1.0 && Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
526  "Local coordinates are not in region [-1,1]");
527 
528  // m_geom->FillGeom(); // TODO: implement FillGeom()
529 
530  for (i = 0; i < m_geom->GetCoordim(); ++i)
531  {
532  coords[i] = m_geom->GetCoord(i, Lcoords);
533  }
534 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:275

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

◆ v_GetCoords()

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

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 536 of file PyrExp.cpp.

539 {
540  Expansion::v_GetCoords(coords_1, coords_2, coords_3);
541 }
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: Expansion.cpp:535

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

◆ v_GetLinStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 502 of file PyrExp.cpp.

503 {
504  LibUtilities::BasisKey bkey0(m_base[0]->GetBasisType(), 2,
505  m_base[0]->GetPointsKey());
506  LibUtilities::BasisKey bkey1(m_base[1]->GetBasisType(), 2,
507  m_base[1]->GetPointsKey());
508  LibUtilities::BasisKey bkey2(m_base[2]->GetBasisType(), 2,
509  m_base[2]->GetPointsKey());
510 
512  bkey2);
513 }

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

◆ v_GetLocMatrix()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1077 of file PyrExp.cpp.

1078 {
1079  return m_matrixManager[mkey];
1080 }

References m_matrixManager.

◆ v_GetLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1087 of file PyrExp.cpp.

1088 {
1089  return m_staticCondMatrixManager[mkey];
1090 }

References m_staticCondMatrixManager.

◆ v_GetStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 495 of file PyrExp.cpp.

496 {
498  m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey(),
499  m_base[2]->GetBasisKey());
500 }

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

◆ v_GetTracePhysMap()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 633 of file PyrExp.cpp.

634 {
635  int nquad0 = m_base[0]->GetNumPoints();
636  int nquad1 = m_base[1]->GetNumPoints();
637  int nquad2 = m_base[2]->GetNumPoints();
638 
639  int nq0 = 0;
640  int nq1 = 0;
641 
642  switch (face)
643  {
644  case 0:
645  nq0 = nquad0;
646  nq1 = nquad1;
647  if (outarray.size() != nq0 * nq1)
648  {
649  outarray = Array<OneD, int>(nq0 * nq1);
650  }
651 
652  // Directions A and B positive
653  for (int i = 0; i < nquad0 * nquad1; ++i)
654  {
655  outarray[i] = i;
656  }
657 
658  break;
659  case 1:
660  nq0 = nquad0;
661  nq1 = nquad2;
662  if (outarray.size() != nq0 * nq1)
663  {
664  outarray = Array<OneD, int>(nq0 * nq1);
665  }
666 
667  // Direction A and B positive
668  for (int k = 0; k < nquad2; k++)
669  {
670  for (int i = 0; i < nquad0; ++i)
671  {
672  outarray[k * nquad0 + i] = (nquad0 * nquad1 * k) + i;
673  }
674  }
675 
676  break;
677  case 2:
678  nq0 = nquad1;
679  nq1 = nquad2;
680  if (outarray.size() != nq0 * nq1)
681  {
682  outarray = Array<OneD, int>(nq0 * nq1);
683  }
684 
685  // Directions A and B positive
686  for (int j = 0; j < nquad1 * nquad2; ++j)
687  {
688  outarray[j] = nquad0 - 1 + j * nquad0;
689  }
690  break;
691  case 3:
692 
693  nq0 = nquad0;
694  nq1 = nquad2;
695  if (outarray.size() != nq0 * nq1)
696  {
697  outarray = Array<OneD, int>(nq0 * nq1);
698  }
699 
700  // Direction A and B positive
701  for (int k = 0; k < nquad2; k++)
702  {
703  for (int i = 0; i < nquad0; ++i)
704  {
705  outarray[k * nquad0 + i] =
706  nquad0 * (nquad1 - 1) + (nquad0 * nquad1 * k) + i;
707  }
708  }
709  break;
710  case 4:
711  nq0 = nquad1;
712  nq1 = nquad2;
713 
714  if (outarray.size() != nq0 * nq1)
715  {
716  outarray = Array<OneD, int>(nq0 * nq1);
717  }
718 
719  // Directions A and B positive
720  for (int j = 0; j < nquad1 * nquad2; ++j)
721  {
722  outarray[j] = j * nquad0;
723  }
724  break;
725  default:
726  ASSERTL0(false, "face value (> 4) is out of range");
727  break;
728  }
729 }

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

◆ v_Integral()

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

Integrate the physical point list inarray over pyramidic region and return the value.

Inputs:

  • inarray: definition of function to be returned at quadrature point of expansion.

Outputs:

  • returns \(\int^1_{-1}\int^1_{-1}\int^1_{-1} u(\bar \eta_1, \eta_2, \eta_3) J[i,j,k] d \bar \eta_1 d \eta_2 d \eta_3\)
    \(= \sum_{i=0}^{Q_1 - 1} \sum_{j=0}^{Q_2 - 1} \sum_{k=0}^{Q_3 - 1} u(\bar \eta_{1i}^{0,0}, \eta_{2j}^{0,0},\eta_{3k}^{2,0})w_{i}^{0,0} w_{j}^{0,0} \hat w_{k}^{2,0} \)
    where \(inarray[i,j, k] = u(\bar \eta_{1i},\eta_{2j}, \eta_{3k}) \),
    \(\hat w_{k}^{2,0} = \frac {w^{2,0}} {2} \)
    and \( J[i,j,k] \) is the Jacobian evaluated at the quadrature point.

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 96 of file PyrExp.cpp.

97 {
98  int nquad0 = m_base[0]->GetNumPoints();
99  int nquad1 = m_base[1]->GetNumPoints();
100  int nquad2 = m_base[2]->GetNumPoints();
101  Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
102  Array<OneD, NekDouble> tmp(nquad0 * nquad1 * nquad2);
103 
104  // multiply inarray with Jacobian
105  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
106  {
107  Vmath::Vmul(nquad0 * nquad1 * nquad2, &jac[0], 1,
108  (NekDouble *)&inarray[0], 1, &tmp[0], 1);
109  }
110  else
111  {
112  Vmath::Smul(nquad0 * nquad1 * nquad2, (NekDouble)jac[0],
113  (NekDouble *)&inarray[0], 1, &tmp[0], 1);
114  }
115 
116  // call StdPyrExp version;
117  return StdPyrExp::v_Integral(tmp);
118 }

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::PyrExp::v_IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual

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

\( \begin{array}{rcl} I_{pqr} = (\phi_{pqr}, u)_{\delta} & = & \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \sum_{k=0}^{nq_2} \psi_{p}^{a} (\bar \eta_{1i}) \psi_{q}^{a} (\eta_{2j}) \psi_{pqr}^{c} (\eta_{3k}) w_i w_j w_k u(\bar \eta_{1,i} \eta_{2,j} \eta_{3,k}) J_{i,j,k}\\ & = & \sum_{i=0}^{nq_0} \psi_p^a(\bar \eta_{1,i}) \sum_{j=0}^{nq_1} \psi_{q}^a(\eta_{2,j}) \sum_{k=0}^{nq_2} \psi_{pqr}^c u(\bar \eta_{1i},\eta_{2j},\eta_{3k}) J_{i,j,k} \end{array} \)
where

\(\phi_{pqr} (\xi_1 , \xi_2 , \xi_3) = \psi_p^a (\bar \eta_1) \psi_{q}^a (\eta_2) \psi_{pqr}^c (\eta_3) \)
which can be implemented as
\(f_{pqr} (\xi_{3k}) = \sum_{k=0}^{nq_3} \psi_{pqr}^c u(\bar \eta_{1i},\eta_{2j},\eta_{3k}) J_{i,j,k} = {\bf B_3 U} \)
\( g_{pq} (\xi_{3k}) = \sum_{j=0}^{nq_1} \psi_{q}^a (\xi_{2j}) f_{pqr} (\xi_{3k}) = {\bf B_2 F} \)
\( (\phi_{pqr}, u)_{\delta} = \sum_{k=0}^{nq_0} \psi_{p}^a (\xi_{3k}) g_{pq} (\xi_{3k}) = {\bf B_1 G} \)

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 278 of file PyrExp.cpp.

280 {
281  v_IProductWRTBase_SumFac(inarray, outarray);
282 }
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: PyrExp.cpp:284

References v_IProductWRTBase_SumFac().

Referenced by v_FwdTrans().

◆ v_IProductWRTBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 284 of file PyrExp.cpp.

287 {
288  const int nquad0 = m_base[0]->GetNumPoints();
289  const int nquad1 = m_base[1]->GetNumPoints();
290  const int nquad2 = m_base[2]->GetNumPoints();
291  const int order0 = m_base[0]->GetNumModes();
292  const int order1 = m_base[1]->GetNumModes();
293 
294  Array<OneD, NekDouble> wsp(order0 * nquad2 * (nquad1 + order1));
295 
296  if (multiplybyweights)
297  {
298  Array<OneD, NekDouble> tmp(nquad0 * nquad1 * nquad2);
299 
300  MultiplyByQuadratureMetric(inarray, tmp);
301 
303  m_base[0]->GetBdata(), m_base[1]->GetBdata(), m_base[2]->GetBdata(),
304  tmp, outarray, wsp, true, true, true);
305  }
306  else
307  {
309  m_base[0]->GetBdata(), m_base[1]->GetBdata(), m_base[2]->GetBdata(),
310  inarray, outarray, wsp, true, true, true);
311  }
312 }
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)

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

Referenced by v_IProductWRTBase().

◆ v_IProductWRTDerivBase()

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

Calculates the inner product \( I_{pqr} = (u, \partial_{x_i} \phi_{pqr}) \).

The derivative of the basis functions is performed using the chain rule in order to incorporate the geometric factors. Assuming that the basis functions are a tensor product \(\phi_{pqr}(\eta_1,\eta_2,\eta_3) = \phi_1(\eta_1)\phi_2(\eta_2)\phi_3(\eta_3)\), this yields the result

\[ I_{pqr} = \sum_{j=1}^3 \left(u, \frac{\partial u}{\partial \eta_j} \frac{\partial \eta_j}{\partial x_i}\right) \]

In the pyramid element, we must also incorporate a second set of geometric factors which incorporate the collapsed co-ordinate system, so that

\[ \frac{\partial\eta_j}{\partial x_i} = \sum_{k=1}^3 \frac{\partial\eta_j}{\partial\xi_k}\frac{\partial\xi_k}{\partial x_i} \]

These derivatives can be found on p152 of Sherwin & Karniadakis.

Parameters
dirDirection in which to take the derivative.
inarrayThe function \( u \).
outarrayValue of the inner product.

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 344 of file PyrExp.cpp.

347 {
348  v_IProductWRTDerivBase_SumFac(dir, inarray, outarray);
349 }
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: PyrExp.cpp:351

References v_IProductWRTDerivBase_SumFac().

◆ v_IProductWRTDerivBase_SumFac()

void Nektar::LocalRegions::PyrExp::v_IProductWRTDerivBase_SumFac ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual
Parameters
inarrayFunction evaluated at physical collocation points.
outarrayInner product with respect to each basis function over the element.

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 351 of file PyrExp.cpp.

354 {
355  const int nquad0 = m_base[0]->GetNumPoints();
356  const int nquad1 = m_base[1]->GetNumPoints();
357  const int nquad2 = m_base[2]->GetNumPoints();
358  const int order0 = m_base[0]->GetNumModes();
359  const int order1 = m_base[1]->GetNumModes();
360  const int nqtot = nquad0 * nquad1 * nquad2;
361 
362  Array<OneD, NekDouble> tmp1(nqtot);
363  Array<OneD, NekDouble> tmp2(nqtot);
364  Array<OneD, NekDouble> tmp3(nqtot);
365  Array<OneD, NekDouble> tmp4(nqtot);
366  Array<OneD, NekDouble> tmp6(m_ncoeffs);
367  Array<OneD, NekDouble> wsp(
368  std::max(nqtot, order0 * nquad2 * (nquad1 + order1)));
369 
370  MultiplyByQuadratureMetric(inarray, tmp1);
371 
372  Array<OneD, Array<OneD, NekDouble>> tmp2D{3};
373  tmp2D[0] = tmp2;
374  tmp2D[1] = tmp3;
375  tmp2D[2] = tmp4;
376 
377  PyrExp::v_AlignVectorToCollapsedDir(dir, tmp1, tmp2D);
378 
379  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
380  m_base[2]->GetBdata(), tmp2, outarray, wsp,
381  false, true, true);
382 
383  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
384  m_base[2]->GetBdata(), tmp3, tmp6, wsp, true,
385  false, true);
386 
387  Vmath::Vadd(m_ncoeffs, tmp6, 1, outarray, 1, outarray, 1);
388 
389  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetBdata(),
390  m_base[2]->GetDbdata(), tmp4, tmp6, wsp, true,
391  true, false);
392 
393  Vmath::Vadd(m_ncoeffs, tmp6, 1, outarray, 1, outarray, 1);
394 }
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray) override
Definition: PyrExp.cpp:396

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

Referenced by v_IProductWRTDerivBase().

◆ v_LaplacianMatrixOp_MatFree_Kernel()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1277 of file PyrExp.cpp.

1280 {
1281  // This implementation is only valid when there are no coefficients
1282  // associated to the Laplacian operator
1283  if (m_metrics.count(eMetricLaplacian00) == 0)
1284  {
1286  }
1287 
1288  int nquad0 = m_base[0]->GetNumPoints();
1289  int nquad1 = m_base[1]->GetNumPoints();
1290  int nq2 = m_base[2]->GetNumPoints();
1291  int nqtot = nquad0 * nquad1 * nq2;
1292 
1293  ASSERTL1(wsp.size() >= 6 * nqtot, "Insufficient workspace size.");
1294  ASSERTL1(m_ncoeffs <= nqtot, "Workspace not set up for ncoeffs > nqtot");
1295 
1296  const Array<OneD, const NekDouble> &base0 = m_base[0]->GetBdata();
1297  const Array<OneD, const NekDouble> &base1 = m_base[1]->GetBdata();
1298  const Array<OneD, const NekDouble> &base2 = m_base[2]->GetBdata();
1299  const Array<OneD, const NekDouble> &dbase0 = m_base[0]->GetDbdata();
1300  const Array<OneD, const NekDouble> &dbase1 = m_base[1]->GetDbdata();
1301  const Array<OneD, const NekDouble> &dbase2 = m_base[2]->GetDbdata();
1302  const Array<OneD, const NekDouble> &metric00 =
1303  m_metrics[eMetricLaplacian00];
1304  const Array<OneD, const NekDouble> &metric01 =
1305  m_metrics[eMetricLaplacian01];
1306  const Array<OneD, const NekDouble> &metric02 =
1307  m_metrics[eMetricLaplacian02];
1308  const Array<OneD, const NekDouble> &metric11 =
1309  m_metrics[eMetricLaplacian11];
1310  const Array<OneD, const NekDouble> &metric12 =
1311  m_metrics[eMetricLaplacian12];
1312  const Array<OneD, const NekDouble> &metric22 =
1313  m_metrics[eMetricLaplacian22];
1314 
1315  // Allocate temporary storage
1316  Array<OneD, NekDouble> wsp0(2 * nqtot, wsp);
1317  Array<OneD, NekDouble> wsp1(nqtot, wsp + 1 * nqtot);
1318  Array<OneD, NekDouble> wsp2(nqtot, wsp + 2 * nqtot);
1319  Array<OneD, NekDouble> wsp3(nqtot, wsp + 3 * nqtot);
1320  Array<OneD, NekDouble> wsp4(nqtot, wsp + 4 * nqtot);
1321  Array<OneD, NekDouble> wsp5(nqtot, wsp + 5 * nqtot);
1322 
1323  // LAPLACIAN MATRIX OPERATION
1324  // wsp1 = du_dxi1 = D_xi1 * inarray = D_xi1 * u
1325  // wsp2 = du_dxi2 = D_xi2 * inarray = D_xi2 * u
1326  // wsp2 = du_dxi3 = D_xi3 * inarray = D_xi3 * u
1327  StdExpansion3D::PhysTensorDeriv(inarray, wsp0, wsp1, wsp2);
1328 
1329  // wsp0 = k = g0 * wsp1 + g1 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1330  // wsp2 = l = g1 * wsp1 + g2 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1331  // where g0, g1 and g2 are the metric terms set up in the GeomFactors class
1332  // especially for this purpose
1333  Vmath::Vvtvvtp(nqtot, &metric00[0], 1, &wsp0[0], 1, &metric01[0], 1,
1334  &wsp1[0], 1, &wsp3[0], 1);
1335  Vmath::Vvtvp(nqtot, &metric02[0], 1, &wsp2[0], 1, &wsp3[0], 1, &wsp3[0], 1);
1336  Vmath::Vvtvvtp(nqtot, &metric01[0], 1, &wsp0[0], 1, &metric11[0], 1,
1337  &wsp1[0], 1, &wsp4[0], 1);
1338  Vmath::Vvtvp(nqtot, &metric12[0], 1, &wsp2[0], 1, &wsp4[0], 1, &wsp4[0], 1);
1339  Vmath::Vvtvvtp(nqtot, &metric02[0], 1, &wsp0[0], 1, &metric12[0], 1,
1340  &wsp1[0], 1, &wsp5[0], 1);
1341  Vmath::Vvtvp(nqtot, &metric22[0], 1, &wsp2[0], 1, &wsp5[0], 1, &wsp5[0], 1);
1342 
1343  // outarray = m = (D_xi1 * B)^T * k
1344  // wsp1 = n = (D_xi2 * B)^T * l
1345  IProductWRTBase_SumFacKernel(dbase0, base1, base2, wsp3, outarray, wsp0,
1346  false, true, true);
1347  IProductWRTBase_SumFacKernel(base0, dbase1, base2, wsp4, wsp2, wsp0, true,
1348  false, true);
1349  Vmath::Vadd(m_ncoeffs, wsp2.get(), 1, outarray.get(), 1, outarray.get(), 1);
1350  IProductWRTBase_SumFacKernel(base0, base1, dbase2, wsp5, wsp2, wsp0, true,
1351  true, false);
1352  Vmath::Vadd(m_ncoeffs, wsp2.get(), 1, outarray.get(), 1, outarray.get(), 1);
1353 }

References ASSERTL1, Nektar::LocalRegions::Expansion::ComputeLaplacianMetric(), Nektar::LocalRegions::eMetricLaplacian00, Nektar::StdRegions::StdExpansion::m_base, and Nektar::LocalRegions::Expansion::m_metrics.

◆ v_NormalTraceDerivFactors()

void Nektar::LocalRegions::PyrExp::v_NormalTraceDerivFactors ( Array< OneD, Array< OneD, NekDouble >> &  d0factors,
Array< OneD, Array< OneD, NekDouble >> &  d1factors,
Array< OneD, Array< OneD, NekDouble >> &  d2factors 
)
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 1360 of file PyrExp.cpp.

1364 {
1365  int nquad0 = GetNumPoints(0);
1366  int nquad1 = GetNumPoints(1);
1367  int nquad2 = GetNumPoints(2);
1368 
1369  const Array<TwoD, const NekDouble> &df =
1370  m_metricinfo->GetDerivFactors(GetPointsKeys());
1371 
1372  if (d0factors.size() != 5)
1373  {
1374  d0factors = Array<OneD, Array<OneD, NekDouble>>(5);
1375  d1factors = Array<OneD, Array<OneD, NekDouble>>(5);
1376  d2factors = Array<OneD, Array<OneD, NekDouble>>(5);
1377  }
1378 
1379  if (d0factors[0].size() != nquad0 * nquad1)
1380  {
1381  d0factors[0] = Array<OneD, NekDouble>(nquad0 * nquad1);
1382  d1factors[0] = Array<OneD, NekDouble>(nquad0 * nquad1);
1383  d2factors[0] = Array<OneD, NekDouble>(nquad0 * nquad1);
1384  }
1385 
1386  if (d0factors[1].size() != nquad0 * nquad2)
1387  {
1388  d0factors[1] = Array<OneD, NekDouble>(nquad0 * nquad2);
1389  d0factors[3] = Array<OneD, NekDouble>(nquad0 * nquad2);
1390  d1factors[1] = Array<OneD, NekDouble>(nquad0 * nquad2);
1391  d1factors[3] = Array<OneD, NekDouble>(nquad0 * nquad2);
1392  d2factors[1] = Array<OneD, NekDouble>(nquad0 * nquad2);
1393  d2factors[3] = Array<OneD, NekDouble>(nquad0 * nquad2);
1394  }
1395 
1396  if (d0factors[2].size() != nquad1 * nquad2)
1397  {
1398  d0factors[2] = Array<OneD, NekDouble>(nquad1 * nquad2);
1399  d0factors[4] = Array<OneD, NekDouble>(nquad1 * nquad2);
1400  d1factors[2] = Array<OneD, NekDouble>(nquad1 * nquad2);
1401  d1factors[4] = Array<OneD, NekDouble>(nquad1 * nquad2);
1402  d2factors[2] = Array<OneD, NekDouble>(nquad1 * nquad2);
1403  d2factors[4] = Array<OneD, NekDouble>(nquad1 * nquad2);
1404  }
1405 
1406  // Outwards normals
1407  const Array<OneD, const Array<OneD, NekDouble>> &normal_0 =
1408  GetTraceNormal(0);
1409  const Array<OneD, const Array<OneD, NekDouble>> &normal_1 =
1410  GetTraceNormal(1);
1411  const Array<OneD, const Array<OneD, NekDouble>> &normal_2 =
1412  GetTraceNormal(2);
1413  const Array<OneD, const Array<OneD, NekDouble>> &normal_3 =
1414  GetTraceNormal(3);
1415  const Array<OneD, const Array<OneD, NekDouble>> &normal_4 =
1416  GetTraceNormal(4);
1417 
1418  int ncoords = normal_0.size();
1419 
1420  // first gather together standard cartesian inner products
1421  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1422  {
1423  // face 0
1424  for (int i = 0; i < nquad0 * nquad1; ++i)
1425  {
1426  d0factors[0][i] = df[0][i] * normal_0[0][i];
1427  d1factors[0][i] = df[1][i] * normal_0[0][i];
1428  d2factors[0][i] = df[2][i] * normal_0[0][i];
1429  }
1430 
1431  for (int n = 1; n < ncoords; ++n)
1432  {
1433  for (int i = 0; i < nquad0 * nquad1; ++i)
1434  {
1435  d0factors[0][i] += df[3 * n][i] * normal_0[n][i];
1436  d1factors[0][i] += df[3 * n + 1][i] * normal_0[n][i];
1437  d2factors[0][i] += df[3 * n + 2][i] * normal_0[n][i];
1438  }
1439  }
1440 
1441  // faces 1 and 3
1442  for (int j = 0; j < nquad2; ++j)
1443  {
1444  for (int i = 0; i < nquad0; ++i)
1445  {
1446  d0factors[1][i] = df[0][j * nquad0 * nquad1 + i] *
1447  normal_1[0][j * nquad0 + i];
1448  d0factors[3][i] =
1449  df[0][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1450  normal_3[0][j * nquad0 + i];
1451  d1factors[1][i] = df[1][j * nquad0 * nquad1 + i] *
1452  normal_1[0][j * nquad0 + i];
1453  d1factors[3][i] =
1454  df[1][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1455  normal_3[0][j * nquad0 + i];
1456  d2factors[1][i] = df[2][j * nquad0 * nquad1 + i] *
1457  normal_1[0][j * nquad0 + i];
1458  d2factors[3][i] =
1459  df[2][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1460  normal_3[0][j * nquad0 + i];
1461  }
1462  }
1463 
1464  for (int n = 1; n < ncoords; ++n)
1465  {
1466  for (int j = 0; j < nquad2; ++j)
1467  {
1468  for (int i = 0; i < nquad0; ++i)
1469  {
1470  d0factors[1][i] = df[3 * n][j * nquad0 * nquad1 + i] *
1471  normal_1[0][j * nquad0 + i];
1472  d0factors[3][i] =
1473  df[3 * n][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1474  normal_3[0][j * nquad0 + i];
1475  d1factors[1][i] = df[3 * n + 1][j * nquad0 * nquad1 + i] *
1476  normal_1[0][j * nquad0 + i];
1477  d1factors[3][i] =
1478  df[3 * n + 1][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1479  normal_3[0][j * nquad0 + i];
1480  d2factors[1][i] = df[3 * n + 2][j * nquad0 * nquad1 + i] *
1481  normal_1[0][j * nquad0 + i];
1482  d2factors[3][i] =
1483  df[3 * n + 2][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1484  normal_3[0][j * nquad0 + i];
1485  }
1486  }
1487  }
1488 
1489  // faces 2 and 4
1490  for (int j = 0; j < nquad2; ++j)
1491  {
1492  for (int i = 0; i < nquad1; ++i)
1493  {
1494  d0factors[2][j * nquad1 + i] =
1495  df[0][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1496  normal_2[0][j * nquad1 + i];
1497  d0factors[4][j * nquad1 + i] =
1498  df[0][j * nquad0 * nquad1 + i * nquad0] *
1499  normal_4[0][j * nquad1 + i];
1500  d1factors[2][j * nquad1 + i] =
1501  df[1][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1502  normal_2[0][j * nquad1 + i];
1503  d1factors[4][j * nquad1 + i] =
1504  df[1][j * nquad0 * nquad1 + i * nquad0] *
1505  normal_4[0][j * nquad1 + i];
1506  d2factors[2][j * nquad1 + i] =
1507  df[2][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1508  normal_2[0][j * nquad1 + i];
1509  d2factors[4][j * nquad1 + i] =
1510  df[2][j * nquad0 * nquad1 + i * nquad0] *
1511  normal_4[0][j * nquad1 + i];
1512  }
1513  }
1514 
1515  for (int n = 1; n < ncoords; ++n)
1516  {
1517  for (int j = 0; j < nquad2; ++j)
1518  {
1519  for (int i = 0; i < nquad1; ++i)
1520  {
1521  d0factors[2][j * nquad1 + i] +=
1522  df[3 * n][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1523  normal_2[n][j * nquad0 + i];
1524  d0factors[4][j * nquad0 + i] +=
1525  df[3 * n][i * nquad0 + j * nquad0 * nquad1] *
1526  normal_4[n][j * nquad0 + i];
1527  d1factors[2][j * nquad1 + i] +=
1528  df[3 * n + 1]
1529  [j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1530  normal_2[n][j * nquad0 + i];
1531  d1factors[4][j * nquad0 + i] +=
1532  df[3 * n + 1][i * nquad0 + j * nquad0 * nquad1] *
1533  normal_4[n][j * nquad0 + i];
1534  d2factors[2][j * nquad1 + i] +=
1535  df[3 * n + 2]
1536  [j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1537  normal_2[n][j * nquad0 + i];
1538  d2factors[4][j * nquad0 + i] +=
1539  df[3 * n + 2][i * nquad0 + j * nquad0 * nquad1] *
1540  normal_4[n][j * nquad0 + i];
1541  }
1542  }
1543  }
1544  }
1545  else
1546  {
1547  // Face 0
1548  for (int i = 0; i < nquad0 * nquad1; ++i)
1549  {
1550  d0factors[0][i] = df[0][0] * normal_0[0][i];
1551  d1factors[0][i] = df[1][0] * normal_0[0][i];
1552  d2factors[0][i] = df[2][0] * normal_0[0][i];
1553  }
1554 
1555  for (int n = 1; n < ncoords; ++n)
1556  {
1557  for (int i = 0; i < nquad0 * nquad1; ++i)
1558  {
1559  d0factors[0][i] += df[3 * n][0] * normal_0[n][i];
1560  d1factors[0][i] += df[3 * n + 1][0] * normal_0[n][i];
1561  d2factors[0][i] += df[3 * n + 2][0] * normal_0[n][i];
1562  }
1563  }
1564 
1565  // faces 1 and 3
1566  for (int i = 0; i < nquad0 * nquad2; ++i)
1567  {
1568  d0factors[1][i] = df[0][0] * normal_1[0][i];
1569  d0factors[3][i] = df[0][0] * normal_3[0][i];
1570 
1571  d1factors[1][i] = df[1][0] * normal_1[0][i];
1572  d1factors[3][i] = df[1][0] * normal_3[0][i];
1573 
1574  d2factors[1][i] = df[2][0] * normal_1[0][i];
1575  d2factors[3][i] = df[2][0] * normal_3[0][i];
1576  }
1577 
1578  for (int n = 1; n < ncoords; ++n)
1579  {
1580  for (int i = 0; i < nquad0 * nquad2; ++i)
1581  {
1582  d0factors[1][i] += df[3 * n][0] * normal_1[n][i];
1583  d0factors[3][i] += df[3 * n][0] * normal_3[n][i];
1584 
1585  d1factors[1][i] += df[3 * n + 1][0] * normal_1[n][i];
1586  d1factors[3][i] += df[3 * n + 1][0] * normal_3[n][i];
1587 
1588  d2factors[1][i] += df[3 * n + 2][0] * normal_1[n][i];
1589  d2factors[3][i] += df[3 * n + 2][0] * normal_3[n][i];
1590  }
1591  }
1592 
1593  // faces 2 and 4
1594  for (int i = 0; i < nquad1 * nquad2; ++i)
1595  {
1596  d0factors[2][i] = df[0][0] * normal_2[0][i];
1597  d0factors[4][i] = df[0][0] * normal_4[0][i];
1598 
1599  d1factors[2][i] = df[1][0] * normal_2[0][i];
1600  d1factors[4][i] = df[1][0] * normal_4[0][i];
1601 
1602  d2factors[2][i] = df[2][0] * normal_2[0][i];
1603  d2factors[4][i] = df[2][0] * normal_4[0][i];
1604  }
1605 
1606  for (int n = 1; n < ncoords; ++n)
1607  {
1608  for (int i = 0; i < nquad1 * nquad2; ++i)
1609  {
1610  d0factors[2][i] += df[3 * n][0] * normal_2[n][i];
1611  d0factors[4][i] += df[3 * n][0] * normal_4[n][i];
1612 
1613  d1factors[2][i] += df[3 * n + 1][0] * normal_2[n][i];
1614  d1factors[4][i] += df[3 * n + 1][0] * normal_4[n][i];
1615 
1616  d2factors[2][i] += df[3 * n + 2][0] * normal_2[n][i];
1617  d2factors[4][i] += df[3 * n + 2][0] * normal_4[n][i];
1618  }
1619  }
1620  }
1621 }
const NormalVector & GetTraceNormal(const int id)
Definition: Expansion.cpp:255

◆ v_PhysDeriv()

void Nektar::LocalRegions::PyrExp::v_PhysDeriv ( const Array< OneD, const NekDouble > &  u_physical,
Array< OneD, NekDouble > &  out_dxi1,
Array< OneD, NekDouble > &  out_dxi2,
Array< OneD, NekDouble > &  out_dxi3 
)
overrideprotectedvirtual

Calculate the derivative of the physical points.

The derivative is evaluated at the nodal physical points. Derivatives with respect to the local Cartesian coordinates.

\(\begin{Bmatrix} \frac {\partial} {\partial \xi_1} \\ \frac {\partial} {\partial \xi_2} \\ \frac {\partial} {\partial \xi_3} \end{Bmatrix} = \begin{Bmatrix} \frac 2 {(1-\eta_3)} \frac \partial {\partial \bar \eta_1} \\ \frac {\partial} {\partial \xi_2} \ \ \frac {(1 + \bar \eta_1)} {(1 - \eta_3)} \frac \partial {\partial \bar \eta_1} + \frac {\partial} {\partial \eta_3} \end{Bmatrix}\)

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 124 of file PyrExp.cpp.

128 {
129  int nquad0 = m_base[0]->GetNumPoints();
130  int nquad1 = m_base[1]->GetNumPoints();
131  int nquad2 = m_base[2]->GetNumPoints();
132  Array<TwoD, const NekDouble> gmat =
133  m_metricinfo->GetDerivFactors(GetPointsKeys());
134  Array<OneD, NekDouble> diff0(nquad0 * nquad1 * nquad2);
135  Array<OneD, NekDouble> diff1(nquad0 * nquad1 * nquad2);
136  Array<OneD, NekDouble> diff2(nquad0 * nquad1 * nquad2);
137 
138  StdPyrExp::v_PhysDeriv(inarray, diff0, diff1, diff2);
139 
140  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
141  {
142  if (out_d0.size())
143  {
144  Vmath::Vmul(nquad0 * nquad1 * nquad2, &gmat[0][0], 1, &diff0[0], 1,
145  &out_d0[0], 1);
146  Vmath::Vvtvp(nquad0 * nquad1 * nquad2, &gmat[1][0], 1, &diff1[0], 1,
147  &out_d0[0], 1, &out_d0[0], 1);
148  Vmath::Vvtvp(nquad0 * nquad1 * nquad2, &gmat[2][0], 1, &diff2[0], 1,
149  &out_d0[0], 1, &out_d0[0], 1);
150  }
151 
152  if (out_d1.size())
153  {
154  Vmath::Vmul(nquad0 * nquad1 * nquad2, &gmat[3][0], 1, &diff0[0], 1,
155  &out_d1[0], 1);
156  Vmath::Vvtvp(nquad0 * nquad1 * nquad2, &gmat[4][0], 1, &diff1[0], 1,
157  &out_d1[0], 1, &out_d1[0], 1);
158  Vmath::Vvtvp(nquad0 * nquad1 * nquad2, &gmat[5][0], 1, &diff2[0], 1,
159  &out_d1[0], 1, &out_d1[0], 1);
160  }
161 
162  if (out_d2.size())
163  {
164  Vmath::Vmul(nquad0 * nquad1 * nquad2, &gmat[6][0], 1, &diff0[0], 1,
165  &out_d2[0], 1);
166  Vmath::Vvtvp(nquad0 * nquad1 * nquad2, &gmat[7][0], 1, &diff1[0], 1,
167  &out_d2[0], 1, &out_d2[0], 1);
168  Vmath::Vvtvp(nquad0 * nquad1 * nquad2, &gmat[8][0], 1, &diff2[0], 1,
169  &out_d2[0], 1, &out_d2[0], 1);
170  }
171  }
172  else // regular geometry
173  {
174  if (out_d0.size())
175  {
176  Vmath::Smul(nquad0 * nquad1 * nquad2, gmat[0][0], &diff0[0], 1,
177  &out_d0[0], 1);
178  Blas::Daxpy(nquad0 * nquad1 * nquad2, gmat[1][0], &diff1[0], 1,
179  &out_d0[0], 1);
180  Blas::Daxpy(nquad0 * nquad1 * nquad2, gmat[2][0], &diff2[0], 1,
181  &out_d0[0], 1);
182  }
183 
184  if (out_d1.size())
185  {
186  Vmath::Smul(nquad0 * nquad1 * nquad2, gmat[3][0], &diff0[0], 1,
187  &out_d1[0], 1);
188  Blas::Daxpy(nquad0 * nquad1 * nquad2, gmat[4][0], &diff1[0], 1,
189  &out_d1[0], 1);
190  Blas::Daxpy(nquad0 * nquad1 * nquad2, gmat[5][0], &diff2[0], 1,
191  &out_d1[0], 1);
192  }
193 
194  if (out_d2.size())
195  {
196  Vmath::Smul(nquad0 * nquad1 * nquad2, gmat[6][0], &diff0[0], 1,
197  &out_d2[0], 1);
198  Blas::Daxpy(nquad0 * nquad1 * nquad2, gmat[7][0], &diff1[0], 1,
199  &out_d2[0], 1);
200  Blas::Daxpy(nquad0 * nquad1 * nquad2, gmat[8][0], &diff2[0], 1,
201  &out_d2[0], 1);
202  }
203  }
204 }
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:154

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_PhysEvaluate() [1/2]

NekDouble Nektar::LocalRegions::PyrExp::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.

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 #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::StdExpansion3D.

Definition at line 606 of file PyrExp.cpp.

608 {
609  Array<OneD, NekDouble> Lcoord(3);
610 
611  ASSERTL0(m_geom, "m_geom not defined");
612 
613  // TODO: check GetLocCoords()
614  m_geom->GetLocCoords(coord, Lcoord);
615 
616  return StdExpansion3D::v_PhysEvaluate(Lcoord, physvals);
617 }

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

◆ v_PhysEvaluate() [2/2]

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

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 619 of file PyrExp.cpp.

622 {
623  Array<OneD, NekDouble> Lcoord(3);
624  ASSERTL0(m_geom, "m_geom not defined");
625  m_geom->GetLocCoords(coord, Lcoord);
626  return StdPyrExp::v_PhysEvaluate(Lcoord, inarray, firstOrderDerivs);
627 }

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

◆ v_StdPhysEvaluate()

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

601 {
602  // Evaluate point in local coordinates.
603  return StdExpansion3D::v_PhysEvaluate(Lcoord, physvals);
604 }

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdPyrExp.

Definition at line 1014 of file PyrExp.cpp.

1016 {
1017  int nq = GetTotPoints();
1018 
1019  // Calculate sqrt of the Jacobian
1020  Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
1021  Array<OneD, NekDouble> sqrt_jac(nq);
1022  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1023  {
1024  Vmath::Vsqrt(nq, jac, 1, sqrt_jac, 1);
1025  }
1026  else
1027  {
1028  Vmath::Fill(nq, sqrt(jac[0]), sqrt_jac, 1);
1029  }
1030 
1031  // Multiply array by sqrt(Jac)
1032  Vmath::Vmul(nq, sqrt_jac, 1, array, 1, array, 1);
1033 
1034  // Apply std region filter
1035  StdPyrExp::v_SVVLaplacianFilter(array, mkey);
1036 
1037  // Divide by sqrt(Jac)
1038  Vmath::Vdiv(nq, array, 1, sqrt_jac, 1, array, 1);
1039 }
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:284

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

Member Data Documentation

◆ m_matrixManager

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

Definition at line 176 of file PyrExp.h.

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

◆ m_staticCondMatrixManager

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

Definition at line 178 of file PyrExp.h.

Referenced by v_DropLocStaticCondMatrix(), and v_GetLocStaticCondMatrix().