Nektar++
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Nektar::StdRegions::StdPyrExp Class Reference

#include <StdPyrExp.h>

Inheritance diagram for Nektar::StdRegions::StdPyrExp:
[legend]

Public Member Functions

 StdPyrExp ()
 
 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 ()
 
- 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 ()
 
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)
 
- 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 GetNedges () const
 This function returns the number of edges of the expansion domain. More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
int GetTotalEdgeIntNcoeffs () const
 
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge. More...
 
int DetCartesianDirOfEdge (const int edge)
 
const LibUtilities::BasisKey DetEdgeBasisKey (const int i) const
 
const LibUtilities::BasisKey DetFaceBasisKey (const int i, const int k) const
 
int GetFaceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th face. More...
 
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face. More...
 
int GetFaceIntNcoeffs (const int i) const
 
int GetTotalFaceIntNcoeffs () const
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge/face. More...
 
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge. More...
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNfaces () const
 This function returns the number of faces of the expansion domain. More...
 
int GetNtrace () 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 (void) const
 
std::shared_ptr< StdExpansionGetLinStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion ()
 
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 FwdTrans_BndConstrained (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)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void SetUpPhysNormals (const int edge)
 
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)
 
StdRegions::Orientation GetForient (int face)
 
StdRegions::Orientation GetEorient (int edge)
 
void SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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 GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceNumModes (const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
 
void GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetEdgeToElementMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
 
void GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
void GetEdgePhysVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Extract the physical values along edge edge from inarray into outarray following the local edge orientation and point distribution defined by defined in EdgeExp. More...
 
void GetEdgePhysVals (const int edge, const std::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetTracePhysVals (const int edge, const std::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetEdgeQFactors (const int edge, 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 GetFacePhysVals (const int face, const std::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
 
void GetEdgePhysMap (const int edge, Array< OneD, int > &outarray)
 
void GetFacePhysMap (const int face, Array< OneD, int > &outarray)
 
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)
 
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
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, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point 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...
 
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals (void)
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void v_SetUpPhysNormals (const int edge)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual StdRegions::Orientation v_GetForient (int face)
 
virtual StdRegions::Orientation v_GetEorient (int edge)
 
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 NormalVectorGetEdgeNormal (const int edge) const
 
void ComputeEdgeNormal (const int edge)
 
void NegateEdgeNormal (const int edge)
 
bool EdgeNormalNegated (const int edge)
 
void ComputeFaceNormal (const int face)
 
void NegateFaceNormal (const int face)
 
bool FaceNormalNegated (const int face)
 
void ComputeVertexNormal (const int vertex)
 
void NegateVertexNormal (const int vertex)
 
bool VertexNormalNegated (const int vertex)
 
const NormalVectorGetFaceNormal (const int face) const
 
const NormalVectorGetVertexNormal (const int vertex) const
 
const NormalVectorGetSurfaceNormal (const int id) const
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=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)
 
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)
 

Protected Member Functions

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)
 Calculate the derivative of the physical points. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Calculate the derivative of the physical points in a given direction. More...
 
virtual void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 
virtual void v_StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Backward transformation is evaluated at the quadrature points. More...
 
virtual void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual 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)
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Forward transform from physical quadrature space stored in inarray and evaluate the expansion coefficients and store in outarray. More...
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Inner product of inarray over region with respect to the expansion basis m_base[0]->GetBdata(),m_base[1]->GetBdata(), m_base[2]->GetBdata() and return in outarray. More...
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
virtual 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)
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 
virtual void v_GetCoords (Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z)
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetFaceNumModes (const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
 
virtual int v_GetNverts () const
 
virtual int v_GetNedges () const
 
virtual int v_GetNfaces () const
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
virtual int v_GetFaceNcoeffs (const int i) const
 
virtual int v_GetFaceIntNcoeffs (const int i) const
 
virtual int v_GetFaceNumPoints (const int i) const
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual const LibUtilities::BasisKey v_DetFaceBasisKey (const int i, const int k) const
 
virtual LibUtilities::BasisType v_GetEdgeBasisType (const int i) const
 
virtual void v_GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual void v_GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
virtual void v_GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey)
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey)
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
virtual void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion3D
virtual NekDouble v_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...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 Integrates the specified function over the domain. More...
 
virtual void v_NegateFaceNormal (const int face)
 
virtual bool v_FaceNormalNegated (const int face)
 
virtual int v_GetTraceNcoeffs (const int i) const
 
- 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...
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 Create an IndexMap which contains mapping information linking any specific element shape with either its boundaries, edges, faces, verteces, etc. More...
 
void BwdTrans_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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 (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 

Private Member Functions

int GetMode (int I, int J, int K)
 Compute the mode number in the expansion for a particular tensorial combination. More...
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion3D
std::map< int, NormalVectorm_faceNormals
 
std::map< int, bool > m_negatedNormals
 
- 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
 
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_IndexMapManager
 

Detailed Description

Definition at line 81 of file StdPyrExp.h.

Constructor & Destructor Documentation

◆ StdPyrExp() [1/4]

Nektar::StdRegions::StdPyrExp::StdPyrExp ( )

Definition at line 47 of file StdPyrExp.cpp.

48  {
49  }

◆ StdPyrExp() [2/4]

Nektar::StdRegions::StdPyrExp::StdPyrExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc 
)

Definition at line 51 of file StdPyrExp.cpp.

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::eModifiedPyr_C, Nektar::LibUtilities::eOrthoPyr_C, Nektar::LibUtilities::BasisKey::GetBasisType(), and Nektar::LibUtilities::BasisKey::GetNumModes().

55  Ba.GetNumModes(),
56  Bb.GetNumModes(),
57  Bc.GetNumModes()),
58  3, Ba, Bb, Bc),
60  Ba.GetNumModes(),
61  Bb.GetNumModes(),
62  Bc.GetNumModes()),
63  Ba, Bb, Bc)
64  {
65 
66  ASSERTL0(Ba.GetNumModes() <= Bc.GetNumModes(), "order in 'a' direction is higher "
67  "than order in 'c' direction");
68  ASSERTL0(Bb.GetNumModes() <= Bc.GetNumModes(), "order in 'b' direction is higher "
69  "than order in 'c' direction");
70  ASSERTL1(Bc.GetBasisType() == LibUtilities::eModifiedPyr_C ||
71  Bc.GetBasisType() == LibUtilities::eOrthoPyr_C,
72  "Expected basis type in 'c' direction to be ModifiedPyr_C or OrthoPyr_C");
73 
74  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Principle Modified Functions .
Definition: BasisType.h:52
Principle Orthogonal Functions .
Definition: BasisType.h:51
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:240
StdExpansion()
Default Constructor.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250

◆ StdPyrExp() [3/4]

Nektar::StdRegions::StdPyrExp::StdPyrExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc,
NekDouble coeffs,
NekDouble phys 
)

◆ StdPyrExp() [4/4]

Nektar::StdRegions::StdPyrExp::StdPyrExp ( const StdPyrExp T)

Definition at line 76 of file StdPyrExp.cpp.

77  : StdExpansion (T),
79  {
80  }
StdExpansion()
Default Constructor.

◆ ~StdPyrExp()

Nektar::StdRegions::StdPyrExp::~StdPyrExp ( )

Definition at line 84 of file StdPyrExp.cpp.

85  {
86  }

Member Function Documentation

◆ GetMode()

int Nektar::StdRegions::StdPyrExp::GetMode ( int  I,
int  J,
int  K 
)
private

Compute the mode number in the expansion for a particular tensorial combination.

Modes are numbered with the r index travelling fastest, followed by q and then p, and each q-r plane is of size

(R+1-p)*(Q+1) - l(l+1)/2 where l = max(0,Q-p)

For example, when P=2, Q=3 and R=4 the indexing inside each q-r plane (with r increasing upwards and q to the right) is:

p = 0: p = 1: p = 2:

4 3 8 17 21 2 7 11 16 20 24 29 32 35 1 6 10 13 15 19 23 26 28 31 34 37 0 5 9 12 14 18 22 25 27 30 33 36

Note that in this element, we must have that \( P,Q \leq R\).

Definition at line 1850 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base.

Referenced by v_GetBoundaryMap(), v_GetEdgeInteriorMap(), v_GetFaceInteriorMap(), v_GetFaceToElementMap(), v_GetInteriorMap(), and v_GetVertexMap().

1851  {
1852  const int Q = m_base[1]->GetNumModes()-1;
1853  const int R = m_base[2]->GetNumModes()-1;
1854 
1855  int i,l;
1856  int cnt = 0;
1857 
1858  // Traverse to q-r plane number I
1859  for (i = 0; i < I; ++i)
1860  {
1861  // Size of triangle part
1862  l = max(0,Q-i);
1863 
1864  // Size of rectangle part
1865  cnt += (R+1-i)*(Q+1) - l*(l+1)/2;
1866  }
1867 
1868  // Traverse to q column J (Pretend this is a face of width J)
1869  l = max(0,J-1-I);
1870  cnt += (R+1-I)*J - l*(l+1)/2;
1871 
1872  // Traverse up stacks to K
1873  cnt += K;
1874 
1875  return cnt;
1876  }
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_BwdTrans()

void Nektar::StdRegions::StdPyrExp::v_BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Backward transformation is evaluated at the quadrature points.

\( u^{\delta} (\xi_{1i}, \xi_{2j}, \xi_{3k}) = \sum_{m(pqr)} \hat u_{pqr} \phi_{pqr} (\xi_{1i}, \xi_{2j}, \xi_{3k})\)

Backward transformation is three dimensional tensorial expansion

\( u (\xi_{1i}, \xi_{2j}, \xi_{3k}) = \sum_{p=0}^{Q_x} \psi_p^a (\xi_{1i}) \lbrace { \sum_{q=0}^{Q_y} \psi_{q}^a (\xi_{2j}) \lbrace { \sum_{r=0}^{Q_z} \hat u_{pqr} \psi_{pqr}^c (\xi_{3k}) \rbrace} \rbrace}. \)

And sumfactorizing step of the form is as:\ \ \( f_{pqr} (\xi_{3k}) = \sum_{r=0}^{Q_z} \hat u_{pqr} \psi_{pqr}^c (\xi_{3k}),\\ g_{p} (\xi_{2j}, \xi_{3k}) = \sum_{r=0}^{Q_y} \psi_{p}^a (\xi_{2j}) f_{pqr} (\xi_{3k}),\\ u(\xi_{1i}, \xi_{2j}, \xi_{3k}) = \sum_{p=0}^{Q_x} \psi_{p}^a (\xi_{1i}) g_{p} (\xi_{2j}, \xi_{3k}). \)

Implements Nektar::StdRegions::StdExpansion.

Definition at line 252 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::m_base, v_BwdTrans_SumFac(), and Vmath::Vcopy().

Referenced by v_FillMode().

254  {
255  if (m_base[0]->Collocation() &&
256  m_base[1]->Collocation() &&
257  m_base[2]->Collocation())
258  {
260  m_base[1]->GetNumPoints()*
261  m_base[2]->GetNumPoints(),
262  inarray, 1, outarray, 1);
263  }
264  else
265  {
266  StdPyrExp::v_BwdTrans_SumFac(inarray,outarray);
267  }
268  }
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:228
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:273
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ v_BwdTrans_SumFac()

void Nektar::StdRegions::StdPyrExp::v_BwdTrans_SumFac ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Sum-factorisation implementation of the BwdTrans operation.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 273 of file StdPyrExp.cpp.

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

Referenced by v_BwdTrans().

276  {
277  int nquad0 = m_base[0]->GetNumPoints();
278  int nquad1 = m_base[1]->GetNumPoints();
279  int nquad2 = m_base[2]->GetNumPoints();
280  int order0 = m_base[0]->GetNumModes();
281  int order1 = m_base[1]->GetNumModes();
282 
283  Array<OneD, NekDouble> wsp(nquad2*order0*order1+
284  nquad2*nquad1*nquad0);
285 
286  v_BwdTrans_SumFacKernel(m_base[0]->GetBdata(),
287  m_base[1]->GetBdata(),
288  m_base[2]->GetBdata(),
289  inarray,outarray,wsp,
290  true,true,true);
291  }
virtual 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)
Definition: StdPyrExp.cpp:293
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_BwdTrans_SumFacKernel()

void Nektar::StdRegions::StdPyrExp::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 
)
protectedvirtual

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 293 of file StdPyrExp.cpp.

References Blas::Daxpy(), Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

Referenced by v_BwdTrans_SumFac().

303  {
304  boost::ignore_unused(doCheckCollDir0, doCheckCollDir1,
305  doCheckCollDir2);
306 
307  int nquad0 = m_base[0]->GetNumPoints();
308  int nquad1 = m_base[1]->GetNumPoints();
309  int nquad2 = m_base[2]->GetNumPoints();
310 
311  int order0 = m_base[0]->GetNumModes();
312  int order1 = m_base[1]->GetNumModes();
313  int order2 = m_base[2]->GetNumModes();
314 
315  Array<OneD, NekDouble > tmp = wsp;
316  Array<OneD, NekDouble > tmp1 = tmp + nquad2*order0*order1;
317 
318  int i, j, mode, mode1, cnt;
319 
320  // Perform summation over '2' direction
321  mode = mode1 = cnt = 0;
322  for(i = 0; i < order0; ++i)
323  {
324  for(j = 0; j < order1; ++j, ++cnt)
325  {
326  int ijmax = max(i,j);
327  Blas::Dgemv('N', nquad2, order2-ijmax,
328  1.0, base2.get()+mode*nquad2, nquad2,
329  inarray.get()+mode1, 1,
330  0.0, tmp.get()+cnt*nquad2, 1);
331  mode += order2-ijmax;
332  mode1 += order2-ijmax;
333  }
334  //increment mode in case order1!=order2
335  for(j = order1; j < order2-i; ++j)
336  {
337  int ijmax = max(i,j);
338  mode += order2-ijmax;
339  }
340  }
341 
342  // fix for modified basis by adding split of top singular
343  // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
344  // component is evaluated
346  {
347 
348  // Not sure why we could not use basis as 1.0
349  // top singular vertex - (1+c)/2 x (1+b)/2 x (1-a)/2 component
350  Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
351  &tmp[0]+nquad2,1);
352 
353  // top singular vertex - (1+c)/2 x (1-b)/2 x (1+a)/2 component
354  Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
355  &tmp[0]+order1*nquad2,1);
356 
357  // top singular vertex - (1+c)/2 x (1+b)/2 x (1+a)/2 component
358  Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
359  &tmp[0]+order1*nquad2+nquad2,1);
360 }
361 
362  // Perform summation over '1' direction
363  mode = 0;
364  for(i = 0; i < order0; ++i)
365  {
366  Blas::Dgemm('N', 'T', nquad1, nquad2, order1,
367  1.0, base1.get(), nquad1,
368  tmp.get()+mode*nquad2, nquad2,
369  0.0, tmp1.get()+i*nquad1*nquad2, nquad1);
370  mode += order1;
371  }
372 
373  // Perform summation over '0' direction
374  Blas::Dgemm('N', 'T', nquad0, nquad1*nquad2, order0,
375  1.0, base0.get(), nquad0,
376  tmp1.get(), nquad1*nquad2,
377  0.0, outarray.get(), nquad0);
378 
379  }
Principle Modified Functions .
Definition: BasisType.h:48
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where A[m x n], B[n x k], C[m x k].
Definition: Blas.hpp:213
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = A x where A[m x n].
Definition: Blas.hpp:168
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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:110

◆ v_CalcNumberOfCoefficients()

int Nektar::StdRegions::StdPyrExp::v_CalcNumberOfCoefficients ( const std::vector< unsigned int > &  nummodes,
int &  modes_offset 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1003 of file StdPyrExp.cpp.

References Nektar::LibUtilities::StdPyrData::getNumberOfCoefficients().

1006  {
1008  nummodes[modes_offset],
1009  nummodes[modes_offset+1],
1010  nummodes[modes_offset+2]);
1011 
1012  modes_offset += 3;
1013  return nmodes;
1014  }
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:240

◆ v_CreateStdMatrix()

DNekMatSharedPtr Nektar::StdRegions::StdPyrExp::v_CreateStdMatrix ( const StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 1820 of file StdPyrExp.cpp.

References v_GenMatrix().

1821  {
1822  return v_GenMatrix(mkey);
1823  }
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
Definition: StdPyrExp.cpp:1815

◆ v_DetFaceBasisKey()

const LibUtilities::BasisKey Nektar::StdRegions::StdPyrExp::v_DetFaceBasisKey ( const int  i,
const int  k 
) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 965 of file StdPyrExp.cpp.

References ASSERTL2, Nektar::StdRegions::EvaluateQuadFaceBasisKey(), Nektar::StdRegions::EvaluateTriFaceBasisKey(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::m_base, and Nektar::LibUtilities::NullBasisKey().

967  {
968  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
969  ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
970 
971  switch(i)
972  {
973  case 0:
974  {
975  return EvaluateQuadFaceBasisKey(k,
976  m_base[k]->GetBasisType(),
977  m_base[k]->GetNumPoints(),
978  m_base[k]->GetNumModes());
979 
980  }
981  case 1:
982  case 3:
983  {
984  return EvaluateTriFaceBasisKey(k,
985  m_base[2*k]->GetBasisType(),
986  m_base[2*k]->GetNumPoints(),
987  m_base[2*k]->GetNumModes());
988  }
989  case 2:
990  case 4:
991  {
992  return EvaluateTriFaceBasisKey(k,
993  m_base[k+1]->GetBasisType(),
994  m_base[k+1]->GetNumPoints(),
995  m_base[k+1]->GetNumModes());
996  }
997  }
998 
999  // Should never get here.
1001  }
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:228
LibUtilities::BasisKey EvaluateTriFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_DetShapeType()

LibUtilities::ShapeType Nektar::StdRegions::StdPyrExp::v_DetShapeType ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 837 of file StdPyrExp.cpp.

References Nektar::LibUtilities::ePyramid.

◆ v_FillMode()

void Nektar::StdRegions::StdPyrExp::v_FillMode ( const int  mode,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 771 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::m_ncoeffs, and v_BwdTrans().

772  {
773  Array<OneD, NekDouble> tmp(m_ncoeffs, 0.0);
774  tmp[mode] = 1.0;
775  v_BwdTrans(tmp, outarray);
776  }
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Backward transformation is evaluated at the quadrature points.
Definition: StdPyrExp.cpp:252

◆ v_FwdTrans()

void Nektar::StdRegions::StdPyrExp::v_FwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Forward transform from physical quadrature space stored in inarray and evaluate the expansion coefficients and store in outarray.

Inputs:

  • inarray: array of physical quadrature points to be transformed

Outputs:

  • outarray: updated array of expansion coefficients.

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 394 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eInvMass, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdExpansion::m_ncoeffs, and v_IProductWRTBase().

396  {
397  v_IProductWRTBase(inarray,outarray);
398 
399  // get Mass matrix inverse
400  StdMatrixKey imasskey(eInvMass,DetShapeType(),*this);
401  DNekMatSharedPtr imatsys = GetStdMatrix(imasskey);
402 
403 
404  // copy inarray in case inarray == outarray
405  DNekVec in (m_ncoeffs, outarray);
406  DNekVec out(m_ncoeffs, outarray, eWrapper);
407 
408  out = (*imatsys)*in;
409  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:714
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:48
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis m_base[0]->GetBdata(),m_base[1]->GetBdata(), m_base[2]->GetBdata() and return in outarray.
Definition: StdPyrExp.cpp:430

◆ v_GenMatrix()

DNekMatSharedPtr Nektar::StdRegions::StdPyrExp::v_GenMatrix ( const StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 1815 of file StdPyrExp.cpp.

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

Referenced by v_CreateStdMatrix().

1816  {
1817  return CreateGeneralMatrix(mkey);
1818  }
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix

◆ v_GetBoundaryMap()

void Nektar::StdRegions::StdPyrExp::v_GetBoundaryMap ( Array< OneD, unsigned int > &  outarray)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1750 of file StdPyrExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::StdRegions::StdExpansion::GetBasisType(), GetMode(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), class_topology::P, and CellMLToNektar.cellml_metadata::p.

1751  {
1754  "BasisType is not a boundary interior form");
1757  "BasisType is not a boundary interior form");
1760  "BasisType is not a boundary interior form");
1761 
1762  int P = m_base[0]->GetNumModes() - 1, p;
1763  int Q = m_base[1]->GetNumModes() - 1, q;
1764  int R = m_base[2]->GetNumModes() - 1, r;
1765  int idx = 0;
1766 
1767  int nBnd = NumBndryCoeffs();
1768 
1769  if (maparray.num_elements() != nBnd)
1770  {
1771  maparray = Array<OneD, unsigned int>(nBnd);
1772  }
1773 
1774  // Loop over all boundary modes (in ascending order).
1775  for (p = 0; p <= P; ++p)
1776  {
1777  // First two q-r planes are entirely boundary modes.
1778  if (p <= 1)
1779  {
1780  for (q = 0; q <= Q; ++q)
1781  {
1782  int maxpq = max(p,q);
1783  for (r = 0; r <= R-maxpq; ++r)
1784  {
1785  maparray[idx++] = GetMode(p,q,r);
1786  }
1787  }
1788  }
1789  else
1790  {
1791  // Remaining q-r planes contain boundary modes on the two
1792  // front and back sides and edges 0 2.
1793  for (q = 0; q <= Q; ++q)
1794  {
1795  if (q <= 1)
1796  {
1797  for (r = 0; r <= R-p; ++r)
1798  {
1799  maparray[idx++] = GetMode(p,q,r);
1800  }
1801  }
1802  else
1803  {
1804  maparray[idx++] = GetMode(p,q,0);
1805  }
1806  }
1807  }
1808  }
1809  }
Principle Modified Functions .
Definition: BasisType.h:52
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1850
Principle Modified Functions .
Definition: BasisType.h:48
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Lagrange for SEM basis .
Definition: BasisType.h:54
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetCoords()

void Nektar::StdRegions::StdPyrExp::v_GetCoords ( Array< OneD, NekDouble > &  xi_x,
Array< OneD, NekDouble > &  xi_y,
Array< OneD, NekDouble > &  xi_z 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 743 of file StdPyrExp.cpp.

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

746  {
747  Array<OneD, const NekDouble> etaBar_x = m_base[0]->GetZ();
748  Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
749  Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
750  int Qx = GetNumPoints(0);
751  int Qy = GetNumPoints(1);
752  int Qz = GetNumPoints(2);
753 
754  // Convert collapsed coordinates into cartesian coordinates: eta --> xi
755  for (int k = 0; k < Qz; ++k )
756  {
757  for (int j = 0; j < Qy; ++j)
758  {
759  for (int i = 0; i < Qx; ++i)
760  {
761  int s = i + Qx*(j + Qy*k);
762 
763  xi_z[s] = eta_z[k];
764  xi_y[s] = (1.0 + eta_y[j]) * (1.0 - eta_z[k]) / 2.0 - 1.0;
765  xi_x[s] = (1.0 + etaBar_x[i]) * (1.0 - eta_z[k]) / 2.0 - 1.0;
766  }
767  }
768  }
769  }
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:228
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetEdgeBasisType()

LibUtilities::BasisType Nektar::StdRegions::StdPyrExp::v_GetEdgeBasisType ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1016 of file StdPyrExp.cpp.

References ASSERTL2, and Nektar::StdRegions::StdExpansion::GetBasisType().

1017  {
1018  ASSERTL2(i >= 0 && i <= 7, "edge id is out of range");
1019  if (i == 0 || i == 2)
1020  {
1021  return GetBasisType(0);
1022  }
1023  else if (i == 1 || i == 3)
1024  {
1025  return GetBasisType(1);
1026  }
1027  else
1028  {
1029  return GetBasisType(2);
1030  }
1031  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164

◆ v_GetEdgeInteriorMap()

void Nektar::StdRegions::StdPyrExp::v_GetEdgeInteriorMap ( const int  eid,
const Orientation  edgeOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1431 of file StdPyrExp.cpp.

References ASSERTL0, Nektar::StdRegions::eBackwards, GetMode(), Nektar::StdRegions::StdExpansion::m_base, class_topology::P, and v_GetEdgeNcoeffs().

1436  {
1437  int i;
1438  bool signChange;
1439  const int P = m_base[0]->GetNumModes() - 1;
1440  const int Q = m_base[1]->GetNumModes() - 1;
1441  const int R = m_base[2]->GetNumModes() - 1;
1442  const int nEdgeIntCoeffs = v_GetEdgeNcoeffs(eid) - 2;
1443 
1444  if (maparray.num_elements() != nEdgeIntCoeffs)
1445  {
1446  maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1447  }
1448 
1449  if(signarray.num_elements() != nEdgeIntCoeffs)
1450  {
1451  signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1452  }
1453  else
1454  {
1455  fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1456  }
1457 
1458  // If edge is oriented backwards, change sign of modes which have
1459  // degree 2n+1, n >= 1.
1460  signChange = edgeOrient == eBackwards;
1461 
1462  switch (eid)
1463  {
1464  case 0:
1465  for (i = 2; i <= P; ++i)
1466  {
1467  maparray[i-2] = GetMode(i,0,0);
1468  }
1469  break;
1470 
1471  case 1:
1472  for (i = 2; i <= Q; ++i)
1473  {
1474  maparray[i-2] = GetMode(1,i,0);
1475  }
1476  break;
1477  case 2:
1478  for (i = 2; i <= P; ++i)
1479  {
1480  maparray[i-2] = GetMode(i,1,0);
1481  }
1482  break;
1483 
1484  case 3:
1485  for (i = 2; i <= Q; ++i)
1486  {
1487  maparray[i-2] = GetMode(0,i,0);
1488  }
1489  break;
1490  case 4:
1491  for (i = 2; i <= R; ++i)
1492  {
1493  maparray[i-2] = GetMode(0,0,i);
1494  }
1495  break;
1496 
1497  case 5:
1498  for (i = 1; i <= R-1; ++i)
1499  {
1500  maparray[i-1] = GetMode(1,0,i);
1501  }
1502  break;
1503  case 6:
1504  for (i = 1; i <= R-1; ++i)
1505  {
1506  maparray[i-1] = GetMode(1,1,i);
1507  }
1508  break;
1509 
1510  case 7:
1511  for (i = 1; i <= R-1; ++i)
1512  {
1513  maparray[i-1] = GetMode(0,1,i);
1514  }
1515  break;
1516  default:
1517  ASSERTL0(false, "Edge not defined.");
1518  break;
1519  }
1520 
1521  if (signChange)
1522  {
1523  for (i = 1; i < nEdgeIntCoeffs; i += 2)
1524  {
1525  signarray[i] = -1;
1526  }
1527  }
1528  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1850
virtual int v_GetEdgeNcoeffs(const int i) const
Definition: StdPyrExp.cpp:883
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetEdgeNcoeffs()

int Nektar::StdRegions::StdPyrExp::v_GetEdgeNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 883 of file StdPyrExp.cpp.

References ASSERTL2, and Nektar::StdRegions::StdExpansion::GetBasisNumModes().

Referenced by v_GetEdgeInteriorMap().

884  {
885  ASSERTL2(i >= 0 && i <= 7, "edge id is out of range");
886 
887  if (i == 0 || i == 2)
888  {
889  return GetBasisNumModes(0);
890  }
891  else if (i == 1 || i == 3)
892  {
893  return GetBasisNumModes(1);
894  }
895  else
896  {
897  return GetBasisNumModes(2);
898  }
899  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:177
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274

◆ v_GetFaceInteriorMap()

void Nektar::StdRegions::StdPyrExp::v_GetFaceInteriorMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1530 of file StdPyrExp.cpp.

References ASSERTL0, GetMode(), Nektar::StdRegions::StdExpansion::m_base, class_topology::P, CellMLToNektar.cellml_metadata::p, and v_GetFaceIntNcoeffs().

1535  {
1536  const int P = m_base[0]->GetNumModes() - 1;
1537  const int Q = m_base[1]->GetNumModes() - 1;
1538  const int R = m_base[2]->GetNumModes() - 1;
1539  const int nFaceIntCoeffs = v_GetFaceIntNcoeffs(fid);
1540  int p, q, r, idx = 0;
1541  int nummodesA = 0;
1542  int nummodesB = 0;
1543  int i, j;
1544 
1545  if (maparray.num_elements() != nFaceIntCoeffs)
1546  {
1547  maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1548  }
1549 
1550  if (signarray.num_elements() != nFaceIntCoeffs)
1551  {
1552  signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1553  }
1554  else
1555  {
1556  fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1557  }
1558 
1559  // Set up an array indexing for quad faces, since the ordering may
1560  // need to be transposed depending on orientation.
1561  Array<OneD, int> arrayindx(nFaceIntCoeffs);
1562  if (fid == 0)
1563  {
1564  nummodesA = P-1;
1565  nummodesB = Q-1;
1566 
1567  for (i = 0; i < nummodesB; i++)
1568  {
1569  for (j = 0; j < nummodesA; j++)
1570  {
1571  if (faceOrient < 9)
1572  {
1573  arrayindx[i*nummodesA+j] = i*nummodesA+j;
1574  }
1575  else
1576  {
1577  arrayindx[i*nummodesA+j] = j*nummodesB+i;
1578  }
1579  }
1580  }
1581  }
1582 
1583  switch (fid)
1584  {
1585  case 0: // Bottom quad
1586  for (q = 2; q <= Q; ++q)
1587  {
1588  for (p = 2; p <= P; ++p)
1589  {
1590  maparray[arrayindx[(q-2)*nummodesA+(p-2)]] = GetMode(p,q,0);
1591  }
1592  }
1593  break;
1594  case 1: // Front triangle
1595  for (p = 2; p <= P; ++p)
1596  {
1597  for (r = 1; r <= R-p; ++r)
1598  {
1599  if ((int)faceOrient == 7)
1600  {
1601  signarray[idx] = p % 2 ? -1 : 1;
1602  }
1603  maparray[idx++] = GetMode(p,0,r);
1604  }
1605  }
1606  break;
1607  case 2: // Right triangle
1608  for (q = 2; q <= Q; ++q)
1609  {
1610  for (r = 1; r <= R-q; ++r)
1611  {
1612  if ((int)faceOrient == 7)
1613  {
1614  signarray[idx] = q % 2 ? -1 : 1;
1615  }
1616  maparray[idx++] = GetMode(1, q, r);
1617  }
1618  }
1619  break;
1620 
1621  case 3: // Rear triangle
1622  for (p = 2; p <= P; ++p)
1623  {
1624  for (r = 1; r <= R-p; ++r)
1625  {
1626  if ((int)faceOrient == 7)
1627  {
1628  signarray[idx] = p % 2 ? -1 : 1;
1629  }
1630  maparray[idx++] = GetMode(p, 1, r);
1631  }
1632  }
1633  break;
1634 
1635  case 4: // Left triangle
1636  for (q = 2; q <= Q; ++q)
1637  {
1638  for (r = 1; r <= R-q; ++r)
1639  {
1640  if ((int)faceOrient == 7)
1641  {
1642  signarray[idx] = q % 2 ? -1 : 1;
1643  }
1644  maparray[idx++] = GetMode(0, q, r);
1645  }
1646  }
1647  break;
1648  default:
1649  ASSERTL0(false, "Face interior map not available.");
1650  }
1651 
1652  // Triangular faces are processed in the above switch loop; for
1653  // remaining quad faces, set up orientation if necessary.
1654  if (fid > 0)
1655  {
1656  return;
1657  }
1658 
1659  if (faceOrient == 6 || faceOrient == 8 ||
1660  faceOrient == 11 || faceOrient == 12)
1661  {
1662  if (faceOrient < 9)
1663  {
1664  for (i = 1; i < nummodesB; i += 2)
1665  {
1666  for (j = 0; j < nummodesA; j++)
1667  {
1668  signarray[arrayindx[i*nummodesA+j]] *= -1;
1669  }
1670  }
1671  }
1672  else
1673  {
1674  for (i = 0; i < nummodesB; i++)
1675  {
1676  for (j = 1; j < nummodesA; j += 2)
1677  {
1678  signarray[arrayindx[i*nummodesA+j]] *= -1;
1679  }
1680  }
1681  }
1682  }
1683 
1684  if (faceOrient == 7 || faceOrient == 8 ||
1685  faceOrient == 10 || faceOrient == 12)
1686  {
1687  if (faceOrient < 9)
1688  {
1689  for (i = 0; i < nummodesB; i++)
1690  {
1691  for (j = 1; j < nummodesA; j += 2)
1692  {
1693  signarray[arrayindx[i*nummodesA+j]] *= -1;
1694  }
1695  }
1696  }
1697  else
1698  {
1699  for (i = 1; i < nummodesB; i += 2)
1700  {
1701  for (j = 0; j < nummodesA; j++)
1702  {
1703  signarray[arrayindx[i*nummodesA+j]] *= -1;
1704  }
1705  }
1706  }
1707  }
1708  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1850
virtual int v_GetFaceIntNcoeffs(const int i) const
Definition: StdPyrExp.cpp:921
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetFaceIntNcoeffs()

int Nektar::StdRegions::StdPyrExp::v_GetFaceIntNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 921 of file StdPyrExp.cpp.

References ASSERTL2, Nektar::StdRegions::StdExpansion::m_base, and class_topology::P.

Referenced by v_GetFaceInteriorMap().

922  {
923  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
924 
925  int P = m_base[0]->GetNumModes()-1;
926  int Q = m_base[1]->GetNumModes()-1;
927  int R = m_base[2]->GetNumModes()-1;
928 
929  if (i == 0)
930  {
931  return (P-1)*(Q-1);
932  }
933  else if (i == 1 || i == 3)
934  {
935  return (P-1) * (2*(R-1) - (P-1) - 1) / 2;
936  }
937  else
938  {
939  return (Q-1) * (2*(R-1) - (Q-1) - 1) / 2;
940  }
941  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetFaceNcoeffs()

int Nektar::StdRegions::StdPyrExp::v_GetFaceNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 901 of file StdPyrExp.cpp.

References ASSERTL2, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), and class_topology::P.

902  {
903  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
904 
905  if (i == 0)
906  {
907  return GetBasisNumModes(0)*GetBasisNumModes(1);
908  }
909  else if (i == 1 || i == 3)
910  {
911  int P = GetBasisNumModes(0)-1, Q = GetBasisNumModes(2)-1;
912  return Q+1 + (P*(1 + 2*Q - P))/2;
913  }
914  else
915  {
916  int P = GetBasisNumModes(1)-1, Q = GetBasisNumModes(2)-1;
917  return Q+1 + (P*(1 + 2*Q - P))/2;
918  }
919  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:177
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274

◆ v_GetFaceNumModes()

void Nektar::StdRegions::StdPyrExp::v_GetFaceNumModes ( const int  fid,
const Orientation  faceOrient,
int &  numModes0,
int &  numModes1 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 778 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base.

783  {
784  int nummodes [3] = {m_base[0]->GetNumModes(),
785  m_base[1]->GetNumModes(),
786  m_base[2]->GetNumModes()};
787  switch(fid)
788  {
789  // quad
790  case 0:
791  {
792  numModes0 = nummodes[0];
793  numModes1 = nummodes[1];
794  }
795  break;
796  case 1:
797  case 3:
798  {
799  numModes0 = nummodes[0];
800  numModes1 = nummodes[2];
801  }
802  break;
803  case 2:
804  case 4:
805  {
806  numModes0 = nummodes[1];
807  numModes1 = nummodes[2];
808  }
809  break;
810  }
811 
812  if ( faceOrient >= 9 )
813  {
814  std::swap(numModes0, numModes1);
815  }
816  }
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetFaceNumPoints()

int Nektar::StdRegions::StdPyrExp::v_GetFaceNumPoints ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 943 of file StdPyrExp.cpp.

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

944  {
945  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
946 
947  if (i == 0)
948  {
949  return m_base[0]->GetNumPoints()*
950  m_base[1]->GetNumPoints();
951  }
952  else if (i == 1 || i == 3)
953  {
954  return m_base[0]->GetNumPoints()*
955  m_base[2]->GetNumPoints();
956  }
957  else
958  {
959  return m_base[1]->GetNumPoints()*
960  m_base[2]->GetNumPoints();
961  }
962  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetFaceToElementMap()

void Nektar::StdRegions::StdPyrExp::v_GetFaceToElementMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
int  nummodesA = -1,
int  nummodesB = -1 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1038 of file StdPyrExp.cpp.

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::StdRegions::StdExpansion::GetEdgeBasisType(), Nektar::StdRegions::StdExpansion::GetFaceNcoeffs(), GetMode(), Nektar::StdRegions::StdExpansion::m_base, class_topology::P, and CellMLToNektar.cellml_metadata::p.

1045  {
1047  "Method only implemented if BasisType is identical"
1048  "in x and y directions");
1051  "Method only implemented for Modified_A BasisType"
1052  "(x and y direction) and ModifiedPyr_C BasisType (z "
1053  "direction)");
1054 
1055  int i, j, k, p, q, r, nFaceCoeffs, idx = 0;
1056  int nummodesA=0, nummodesB=0;
1057 
1058  int order0 = m_base[0]->GetNumModes();
1059  int order1 = m_base[1]->GetNumModes();
1060  int order2 = m_base[2]->GetNumModes();
1061 
1062  switch (fid)
1063  {
1064  case 0:
1065  nummodesA = order0;
1066  nummodesB = order1;
1067  break;
1068  case 1:
1069  case 3:
1070  nummodesA = order0;
1071  nummodesB = order2;
1072  break;
1073  case 2:
1074  case 4:
1075  nummodesA = order1;
1076  nummodesB = order2;
1077  break;
1078  default:
1079  ASSERTL0(false,"fid must be between 0 and 4");
1080  }
1081 
1082  bool CheckForZeroedModes = false;
1083 
1084  if (P == -1)
1085  {
1086  P = nummodesA;
1087  Q = nummodesB;
1088  nFaceCoeffs = GetFaceNcoeffs(fid);
1089  }
1090  else if (fid > 0)
1091  {
1092  nFaceCoeffs = P*(2*Q-P+1)/2;
1093  CheckForZeroedModes = true;
1094  }
1095  else
1096  {
1097  nFaceCoeffs = P*Q;
1098  CheckForZeroedModes = true;
1099  }
1100 
1101  // Allocate the map array and sign array; set sign array to ones (+)
1102  if (maparray.num_elements() != nFaceCoeffs)
1103  {
1104  maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1105  }
1106 
1107  if (signarray.num_elements() != nFaceCoeffs)
1108  {
1109  signarray = Array<OneD, int>(nFaceCoeffs,1);
1110  }
1111  else
1112  {
1113  fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1114  }
1115 
1116  // Set up an array indexing for quads, since the ordering may need
1117  // to be transposed.
1118  Array<OneD, int> arrayindx(nFaceCoeffs,-1);
1119 
1120  if (fid == 0)
1121  {
1122  for (i = 0; i < Q; i++)
1123  {
1124  for (j = 0; j < P; j++)
1125  {
1126  if (faceOrient < 9)
1127  {
1128  arrayindx[i*P+j] = i*P+j;
1129  }
1130  else
1131  {
1132  arrayindx[i*P+j] = j*Q+i;
1133  }
1134  }
1135  }
1136  }
1137 
1138  // Set up ordering inside each 2D face. Also for triangular faces,
1139  // populate signarray.
1140  switch (fid)
1141  {
1142  case 0: // Bottom quad
1143 
1144  for (q = 0; q < Q; ++q)
1145  {
1146  for (p = 0; p < P; ++p)
1147  {
1148  maparray[arrayindx[q*P+p]] = GetMode(p,q,0);
1149  }
1150  }
1151  break;
1152 
1153  case 1: // Front triangle
1154  for (p = 0; p < P; ++p)
1155  {
1156  for (r = 0; r < Q-p; ++r)
1157  {
1158  if ((int)faceOrient == 7 && p > 1)
1159  {
1160  signarray[idx] = p % 2 ? -1 : 1;
1161  }
1162  maparray[idx++] = GetMode(p,0,r);
1163  }
1164  }
1165  break;
1166 
1167  case 2: // Right triangle
1168  maparray[idx++] = GetMode(1,0,0);
1169  maparray[idx++] = GetMode(0,0,1);
1170  for (r = 1; r < Q-1; ++r)
1171  {
1172  maparray[idx++] = GetMode(1,0,r);
1173  }
1174 
1175  for (q = 1; q < P; ++q)
1176  {
1177  for (r = 0; r < Q-q; ++r)
1178  {
1179  if ((int)faceOrient == 7 && q > 1)
1180  {
1181  signarray[idx] = q % 2 ? -1 : 1;
1182  }
1183  maparray[idx++] = GetMode(1,q,r);
1184  }
1185  }
1186  break;
1187 
1188  case 3: // Rear triangle
1189  maparray[idx++] = GetMode(0,1,0);
1190  maparray[idx++] = GetMode(0,0,1);
1191  for (r = 1; r < Q-1; ++r)
1192  {
1193  maparray[idx++] = GetMode(0,1,r);
1194  }
1195 
1196  for (p = 1; p < P; ++p)
1197  {
1198  for (r = 0; r < Q-p; ++r)
1199  {
1200  if ((int)faceOrient == 7 && p > 1)
1201  {
1202  signarray[idx] = p % 2 ? -1 : 1;
1203  }
1204  maparray[idx++] = GetMode(p, 1, r);
1205  }
1206  }
1207  break;
1208 
1209  case 4: // Left triangle
1210  for (q = 0; q < P; ++q)
1211  {
1212  for (r = 0; r < Q-q; ++r)
1213  {
1214  if ((int)faceOrient == 7 && q > 1)
1215  {
1216  signarray[idx] = q % 2 ? -1 : 1;
1217  }
1218  maparray[idx++] = GetMode(0,q,r);
1219  }
1220  }
1221  break;
1222 
1223  default:
1224  ASSERTL0(false, "Face to element map unavailable.");
1225  }
1226 
1227  if (fid > 0)
1228  {
1229  if(CheckForZeroedModes)
1230  {
1231  // zero signmap and set maparray to zero if elemental
1232  // modes are not as large as face modesl
1233  int idx = 0;
1234  for (j = 0; j < P; ++j)
1235  {
1236  idx += Q-j;
1237  for (k = Q-j; k < Q-j; ++k)
1238  {
1239  signarray[idx] = 0.0;
1240  maparray[idx++] = maparray[0];
1241  }
1242  }
1243 
1244  for (j = P; j < P; ++j)
1245  {
1246  for (k = 0; k < Q-j; ++k)
1247  {
1248  signarray[idx] = 0.0;
1249  maparray[idx++] = maparray[0];
1250  }
1251  }
1252  }
1253 
1254  // Triangles only have one possible orientation (base
1255  // direction reversed); swap edge modes.
1256  if ((int)faceOrient == 7)
1257  {
1258  swap(maparray[0], maparray[Q]);
1259  for (i = 1; i < Q-1; ++i)
1260  {
1261  swap(maparray[i+1], maparray[Q+i]);
1262  }
1263  }
1264  }
1265  else
1266  {
1267  if(CheckForZeroedModes)
1268  {
1269  // zero signmap and set maparray to zero if elemental
1270  // modes are not as large as face modesl
1271  for (j = 0; j < P; ++j)
1272  {
1273  for (k = Q; k < Q; ++k)
1274  {
1275  signarray[arrayindx[j+k*P]] = 0.0;
1276  maparray[arrayindx[j+k*P]] = maparray[0];
1277  }
1278  }
1279 
1280  for (j = P; j < P; ++j)
1281  {
1282  for (k = 0; k < Q; ++k)
1283  {
1284  signarray[arrayindx[j+k*P]] = 0.0;
1285  maparray[arrayindx[j+k*P]] = maparray[0];
1286  }
1287  }
1288  }
1289 
1290  // The code below is exactly the same as that taken from
1291  // StdHexExp and reverses the 'b' and 'a' directions as
1292  // appropriate (1st and 2nd if statements respectively) in
1293  // quadrilateral faces.
1294  if (faceOrient == 6 || faceOrient == 8 ||
1295  faceOrient == 11 || faceOrient == 12)
1296  {
1297  if (faceOrient < 9)
1298  {
1299  for (i = 3; i < Q; i += 2)
1300  {
1301  for (j = 0; j < P; j++)
1302  {
1303  signarray[arrayindx[i*P+j]] *= -1;
1304  }
1305  }
1306 
1307  for (i = 0; i < P; i++)
1308  {
1309  swap(maparray [i], maparray [i+P]);
1310  swap(signarray[i], signarray[i+P]);
1311  }
1312  }
1313  else
1314  {
1315  for (i = 0; i < Q; i++)
1316  {
1317  for (j = 3; j < P; j += 2)
1318  {
1319  signarray[arrayindx[i*P+j]] *= -1;
1320  }
1321  }
1322 
1323  for (i = 0; i < Q; i++)
1324  {
1325  swap (maparray [i], maparray [i+Q]);
1326  swap (signarray[i], signarray[i+Q]);
1327  }
1328  }
1329  }
1330 
1331  if (faceOrient == 7 || faceOrient == 8 ||
1332  faceOrient == 10 || faceOrient == 12)
1333  {
1334  if (faceOrient < 9)
1335  {
1336  for (i = 0; i < Q; i++)
1337  {
1338  for (j = 3; j < P; j += 2)
1339  {
1340  signarray[arrayindx[i*P+j]] *= -1;
1341  }
1342  }
1343 
1344  for(i = 0; i < Q; i++)
1345  {
1346  swap(maparray [i*P], maparray [i*P+1]);
1347  swap(signarray[i*P], signarray[i*P+1]);
1348  }
1349  }
1350  else
1351  {
1352  for (i = 3; i < Q; i += 2)
1353  {
1354  for (j = 0; j < P; j++)
1355  {
1356  signarray[arrayindx[i*P+j]] *= -1;
1357  }
1358  }
1359 
1360  for (i = 0; i < P; i++)
1361  {
1362  swap(maparray [i*Q], maparray [i*Q+1]);
1363  swap(signarray[i*Q], signarray[i*Q+1]);
1364  }
1365  }
1366  }
1367  }
1368  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Principle Modified Functions .
Definition: BasisType.h:52
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1850
Principle Modified Functions .
Definition: BasisType.h:48
int GetFaceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th face.
Definition: StdExpansion.h:353
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base
LibUtilities::BasisType GetEdgeBasisType(const int i) const
This function returns the type of expansion basis on the i-th edge.
Definition: StdExpansion.h:412

◆ v_GetInteriorMap()

void Nektar::StdRegions::StdPyrExp::v_GetInteriorMap ( Array< OneD, unsigned int > &  outarray)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1710 of file StdPyrExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::StdRegions::StdExpansion::GetBasisType(), GetMode(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), class_topology::P, and CellMLToNektar.cellml_metadata::p.

1711  {
1714  "BasisType is not a boundary interior form");
1717  "BasisType is not a boundary interior form");
1720  "BasisType is not a boundary interior form");
1721 
1722 
1723  int P = m_base[0]->GetNumModes() - 1, p;
1724  int Q = m_base[1]->GetNumModes() - 1, q;
1725  int R = m_base[2]->GetNumModes() - 1, r;
1726 
1727  int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
1728 
1729  if(outarray.num_elements()!=nIntCoeffs)
1730  {
1731  outarray = Array<OneD, unsigned int>(nIntCoeffs);
1732  }
1733 
1734  int idx = 0;
1735 
1736  // Loop over all interior modes.
1737  for (p = 2; p <= P; ++p)
1738  {
1739  for (q = 2; q <= Q; ++q)
1740  {
1741  int maxpq = max(p,q);
1742  for (r = 1; r <= R-maxpq; ++r)
1743  {
1744  outarray[idx++] = GetMode(p,q,r);
1745  }
1746  }
1747  }
1748  }
Principle Modified Functions .
Definition: BasisType.h:52
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1850
Principle Modified Functions .
Definition: BasisType.h:48
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Lagrange for SEM basis .
Definition: BasisType.h:54
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetNedges()

int Nektar::StdRegions::StdPyrExp::v_GetNedges ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 827 of file StdPyrExp.cpp.

828  {
829  return 8;
830  }

◆ v_GetNfaces()

int Nektar::StdRegions::StdPyrExp::v_GetNfaces ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 832 of file StdPyrExp.cpp.

833  {
834  return 5;
835  }

◆ v_GetNverts()

int Nektar::StdRegions::StdPyrExp::v_GetNverts ( ) const
protectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 822 of file StdPyrExp.cpp.

823  {
824  return 5;
825  }

◆ v_GetVertexMap()

int Nektar::StdRegions::StdPyrExp::v_GetVertexMap ( int  localVertexId,
bool  useCoeffPacking = false 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1370 of file StdPyrExp.cpp.

References ASSERTL0, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::StdRegions::StdExpansion::GetEdgeBasisType(), and GetMode().

1371  {
1375  "Mapping not defined for this type of basis");
1376 
1377 
1378 
1379  int l = 0;
1380 
1381  if(useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
1382  {
1383  switch (vId)
1384  {
1385  case 0:
1386  l = GetMode(0,0,0);
1387  break;
1388  case 1:
1389  l = GetMode(0,0,1);
1390  break;
1391  case 2:
1392  l = GetMode(0,1,0);
1393  break;
1394  case 3:
1395  l = GetMode(1,0,0);
1396  break;
1397  case 4:
1398  l = GetMode(1,1,0);
1399  break;
1400  default:
1401  ASSERTL0(false, "local vertex id must be between 0 and 4");
1402  }
1403  }
1404  else
1405  {
1406  switch (vId)
1407  {
1408  case 0:
1409  l = GetMode(0,0,0);
1410  break;
1411  case 1:
1412  l = GetMode(1,0,0);
1413  break;
1414  case 2:
1415  l = GetMode(1,1,0);
1416  break;
1417  case 3:
1418  l = GetMode(0,1,0);
1419  break;
1420  case 4:
1421  l = GetMode(0,0,1);
1422  break;
1423  default:
1424  ASSERTL0(false, "local vertex id must be between 0 and 4");
1425  }
1426  }
1427 
1428  return l;
1429  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Principle Modified Functions .
Definition: BasisType.h:52
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1850
Principle Modified Functions .
Definition: BasisType.h:48
LibUtilities::BasisType GetEdgeBasisType(const int i) const
This function returns the type of expansion basis on the i-th edge.
Definition: StdExpansion.h:412

◆ v_IProductWRTBase()

void Nektar::StdRegions::StdPyrExp::v_IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Inner product of inarray over region with respect to the expansion basis m_base[0]->GetBdata(),m_base[1]->GetBdata(), m_base[2]->GetBdata() and return in outarray.

Wrapper call to StdPyrExp::IProductWRTBase

Input:

  • inarray: array of function evaluated at the physical collocation points

Output:

  • outarray: array of inner product with respect to each basis over region

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 430 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::MultiplyByStdQuadratureMetric(), and v_IProductWRTBase_SumFac().

Referenced by v_FwdTrans().

433  {
434  if (m_base[0]->Collocation() &&
435  m_base[1]->Collocation() &&
436  m_base[2]->Collocation())
437  {
438  MultiplyByStdQuadratureMetric(inarray, outarray);
439  }
440  else
441  {
442  StdPyrExp::v_IProductWRTBase_SumFac(inarray,outarray);
443  }
444  }
void MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:952
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: StdPyrExp.cpp:446
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_IProductWRTBase_SumFac()

void Nektar::StdRegions::StdPyrExp::v_IProductWRTBase_SumFac ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  multiplybyweights = true 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 446 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base, v_IProductWRTBase_SumFacKernel(), and v_MultiplyByStdQuadratureMetric().

Referenced by v_IProductWRTBase().

450  {
451 
452  int nquad1 = m_base[1]->GetNumPoints();
453  int nquad2 = m_base[2]->GetNumPoints();
454  int order0 = m_base[0]->GetNumModes();
455  int order1 = m_base[1]->GetNumModes();
456 
457  Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1 + order1));
458 
459  if(multiplybyweights)
460  {
461  Array<OneD, NekDouble> tmp(inarray.num_elements());
462 
463  v_MultiplyByStdQuadratureMetric(inarray, tmp);
464 
465  v_IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
466  m_base[1]->GetBdata(),
467  m_base[2]->GetBdata(),
468  tmp,outarray,wsp,
469  true,true,true);
470  }
471  else
472  {
473  v_IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
474  m_base[1]->GetBdata(),
475  m_base[2]->GetBdata(),
476  inarray,outarray,wsp,
477  true,true,true);
478  }
479  }
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:1879
virtual 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)
Definition: StdPyrExp.cpp:481
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_IProductWRTBase_SumFacKernel()

void Nektar::StdRegions::StdPyrExp::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 
)
protectedvirtual

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 481 of file StdPyrExp.cpp.

References ASSERTL1, Blas::Ddot(), Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

Referenced by v_IProductWRTBase_SumFac().

491  {
492  boost::ignore_unused(doCheckCollDir0, doCheckCollDir1,
493  doCheckCollDir2);
494 
495  int nquad0 = m_base[0]->GetNumPoints();
496  int nquad1 = m_base[1]->GetNumPoints();
497  int nquad2 = m_base[2]->GetNumPoints();
498 
499  int order0 = m_base[0]->GetNumModes();
500  int order1 = m_base[1]->GetNumModes();
501  int order2 = m_base[2]->GetNumModes();
502 
503  ASSERTL1(wsp.num_elements() >= nquad1*nquad2*order0 +
504  nquad2*order0*order1,
505  "Insufficient workspace size");
506 
507  Array<OneD, NekDouble > tmp1 = wsp;
508  Array<OneD, NekDouble > tmp2 = wsp + nquad1*nquad2*order0;
509 
510  int i,j, mode,mode1, cnt;
511 
512  // Inner product with respect to the '0' direction
513  Blas::Dgemm('T', 'N', nquad1*nquad2, order0, nquad0,
514  1.0, inarray.get(), nquad0,
515  base0.get(), nquad0,
516  0.0, tmp1.get(), nquad1*nquad2);
517 
518  // Inner product with respect to the '1' direction
519  for(mode=i=0; i < order0; ++i)
520  {
521  Blas::Dgemm('T', 'N', nquad2, order1, nquad1,
522  1.0, tmp1.get()+i*nquad1*nquad2, nquad1,
523  base1.get(), nquad1,
524  0.0, tmp2.get()+mode*nquad2, nquad2);
525  mode += order1;
526  }
527 
528 
529  // Inner product with respect to the '2' direction
530  mode = mode1 = cnt = 0;
531  for(i = 0; i < order0; ++i)
532  {
533  for(j = 0; j < order1; ++j, ++cnt)
534  {
535  int ijmax = max(i,j);
536 
537  Blas::Dgemv('T', nquad2, order2-ijmax,
538  1.0, base2.get()+mode*nquad2, nquad2,
539  tmp2.get()+cnt*nquad2, 1,
540  0.0, outarray.get()+mode1, 1);
541  mode += order2-ijmax;
542  mode1 += order2-ijmax;
543  }
544 
545  //increment mode in case order1!=order2
546  for(j = order1; j < order2; ++j)
547  {
548  int ijmax = max(i,j);
549  mode += order2-ijmax;
550  }
551  }
552 
553  // fix for modified basis for top singular vertex component
554  // Already have evaluated (1+c)/2 (1-b)/2 (1-a)/2
556  {
557  // add in (1+c)/2 (1+b)/2 (1-a)/2 component
558  outarray[1] += Blas::Ddot(nquad2,base2.get()+nquad2,1,
559  &tmp2[nquad2],1);
560 
561  // add in (1+c)/2 (1-b)/2 (1+a)/2 component
562  outarray[1] += Blas::Ddot(nquad2,base2.get()+nquad2,1,
563  &tmp2[nquad2*order1],1);
564 
565  // add in (1+c)/2 (1+b)/2 (1+a)/2 component
566  outarray[1] += Blas::Ddot(nquad2,base2.get()+nquad2,1,
567  &tmp2[nquad2*order1+nquad2],1);
568  }
569  }
Principle Modified Functions .
Definition: BasisType.h:48
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where A[m x n], B[n x k], C[m x k].
Definition: Blas.hpp:213
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = A x where A[m x n].
Definition: Blas.hpp:168
static double Ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: output = .
Definition: Blas.hpp:140
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_IProductWRTDerivBase()

void Nektar::StdRegions::StdPyrExp::v_IProductWRTDerivBase ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 571 of file StdPyrExp.cpp.

References v_IProductWRTDerivBase_SumFac().

575  {
576  StdPyrExp::v_IProductWRTDerivBase_SumFac(dir,inarray,outarray);
577  }
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:585

◆ v_IProductWRTDerivBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 585 of file StdPyrExp.cpp.

References ASSERTL1, Nektar::StdRegions::StdExpansion3D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::MultiplyByStdQuadratureMetric(), Vmath::Smul(), Vmath::Vadd(), and Vmath::Vmul().

Referenced by v_IProductWRTDerivBase().

589  {
590  int i;
591  int nquad0 = m_base[0]->GetNumPoints();
592  int nquad1 = m_base[1]->GetNumPoints();
593  int nquad2 = m_base[2]->GetNumPoints();
594  int nqtot = nquad0*nquad1*nquad2;
595 
596  Array<OneD, NekDouble> gfac0(nquad0);
597  Array<OneD, NekDouble> gfac1(nquad1);
598  Array<OneD, NekDouble> gfac2(nquad2);
599  Array<OneD, NekDouble> tmp0 (nqtot);
600 
601 
602  int order0 = m_base[0]->GetNumModes();
603  int order1 = m_base[1]->GetNumModes();
604 
605  Array<OneD, NekDouble> wsp(nquad1*nquad2*order0 +
606  nquad2*order0*order1);
607 
608  const Array<OneD, const NekDouble>& z0 = m_base[0]->GetZ();
609  const Array<OneD, const NekDouble>& z1 = m_base[1]->GetZ();
610  const Array<OneD, const NekDouble>& z2 = m_base[2]->GetZ();
611 
612  // set up geometric factor: (1+z0)/2
613  for(i = 0; i < nquad0; ++i)
614  {
615  gfac0[i] = 0.5*(1+z0[i]);
616  }
617 
618  // set up geometric factor: (1+z1)/2
619  for(i = 0; i < nquad1; ++i)
620  {
621  gfac1[i] = 0.5*(1+z1[i]);
622  }
623 
624  // Set up geometric factor: 2/(1-z2)
625  for(i = 0; i < nquad2; ++i)
626  {
627  gfac2[i] = 2.0/(1-z2[i]);
628  }
629 
630  // Derivative in first/second direction is always scaled as follows
631  const int nq01 = nquad0*nquad1;
632  for(i = 0; i < nquad2; ++i)
633  {
634  Vmath::Smul(nq01, gfac2[i],
635  &inarray[0] + i*nq01, 1,
636  &tmp0 [0] + i*nq01, 1);
637  }
638 
639  MultiplyByStdQuadratureMetric(tmp0, tmp0);
640 
641  switch(dir)
642  {
643  case 0:
644  {
645  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
646  m_base[1]->GetBdata (),
647  m_base[2]->GetBdata (),
648  tmp0, outarray, wsp,
649  false, true, true);
650  break;
651  }
652  case 1:
653  {
654  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata (),
655  m_base[1]->GetDbdata(),
656  m_base[2]->GetBdata (),
657  tmp0, outarray, wsp,
658  true, false, true);
659  break;
660  }
661  case 2:
662  {
663  Array<OneD, NekDouble> tmp3(m_ncoeffs);
664  Array<OneD, NekDouble> tmp4(m_ncoeffs);
665 
666  // Scale eta_1 derivative by gfac0
667  for(i = 0; i < nquad1*nquad2; ++i)
668  {
669  Vmath::Vmul(nquad0, tmp0 .get() + i*nquad0, 1,
670  gfac0.get(), 1,
671  tmp0 .get() + i*nquad0, 1);
672  }
673  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
674  m_base[1]->GetBdata(),
675  m_base[2]->GetBdata(),
676  tmp0, tmp3, wsp,
677  false, true, true);
678 
679  // Scale eta_2 derivative by gfac1*gfac2
680  for(i = 0; i < nquad2; ++i)
681  {
682  Vmath::Smul(nq01, gfac2[i],
683  &inarray[0] + i*nq01, 1,
684  &tmp0 [0] + i*nq01, 1);
685  }
686  for(i = 0; i < nquad1*nquad2; ++i)
687  {
688  Vmath::Smul(nquad0, gfac1[i%nquad1],
689  &tmp0[0] + i*nquad0, 1,
690  &tmp0[0] + i*nquad0, 1);
691  }
692 
693  MultiplyByStdQuadratureMetric(tmp0, tmp0);
694  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
695  m_base[1]->GetDbdata(),
696  m_base[2]->GetBdata(),
697  tmp0, tmp4, wsp,
698  true, false, true);
699 
700  MultiplyByStdQuadratureMetric(inarray,tmp0);
701  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
702  m_base[1]->GetBdata(),
703  m_base[2]->GetDbdata(),
704  tmp0,outarray,wsp,
705  true, true, false);
706 
707  Vmath::Vadd(m_ncoeffs,&tmp3[0],1,&outarray[0],1,&outarray[0],1);
708  Vmath::Vadd(m_ncoeffs,&tmp4[0],1,&outarray[0],1,&outarray[0],1);
709  break;
710  }
711  default:
712  {
713  ASSERTL1(false, "input dir is out of range");
714  break;
715  }
716  }
717  }
void MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:952
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)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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:302
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:186

◆ v_LocCoordToLocCollapsed()

void Nektar::StdRegions::StdPyrExp::v_LocCoordToLocCollapsed ( const Array< OneD, const NekDouble > &  xi,
Array< OneD, NekDouble > &  eta 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 723 of file StdPyrExp.cpp.

References Nektar::NekConstants::kNekZeroTol.

726  {
727  if (fabs(xi[2]-1.0) < NekConstants::kNekZeroTol)
728  {
729  // Very top point of the pyramid
730  eta[0] = -1.0;
731  eta[1] = -1.0;
732  eta[2] = xi[2];
733  }
734  else
735  {
736  // Below the line-singularity -- Common case
737  eta[2] = xi[2]; // eta_z = xi_z
738  eta[1] = 2.0*(1.0 + xi[1])/(1.0 - xi[2]) - 1.0;
739  eta[0] = 2.0*(1.0 + xi[0])/(1.0 - xi[2]) - 1.0;
740  }
741  }
static const NekDouble kNekZeroTol

◆ v_MultiplyByStdQuadratureMetric()

void Nektar::StdRegions::StdPyrExp::v_MultiplyByStdQuadratureMetric ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1879 of file StdPyrExp.cpp.

References Blas::Dscal(), Nektar::LibUtilities::eGaussRadauMAlpha2Beta0, Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::m_base, and Vmath::Vmul().

Referenced by v_IProductWRTBase_SumFac().

1882  {
1883  int i, j;
1884 
1885  int nquad0 = m_base[0]->GetNumPoints();
1886  int nquad1 = m_base[1]->GetNumPoints();
1887  int nquad2 = m_base[2]->GetNumPoints();
1888 
1889  const Array<OneD, const NekDouble>& w0 = m_base[0]->GetW();
1890  const Array<OneD, const NekDouble>& w1 = m_base[1]->GetW();
1891  const Array<OneD, const NekDouble>& w2 = m_base[2]->GetW();
1892 
1893  const Array<OneD, const NekDouble>& z2 = m_base[2]->GetZ();
1894 
1895  // Multiply by integration constants in x-direction
1896  for(i = 0; i < nquad1*nquad2; ++i)
1897  {
1898  Vmath::Vmul(nquad0, inarray.get()+i*nquad0, 1,
1899  w0.get(), 1, outarray.get()+i*nquad0,1);
1900  }
1901 
1902  // Multiply by integration constants in y-direction
1903  for(j = 0; j < nquad2; ++j)
1904  {
1905  for(i = 0; i < nquad1; ++i)
1906  {
1907  Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1908  j*nquad0*nquad1,1);
1909  }
1910  }
1911 
1912  // Multiply by integration constants in z-direction; need to
1913  // incorporate factor [(1-eta_3)/2]^2 into weights, but only if
1914  // using GLL quadrature points.
1915  switch(m_base[2]->GetPointsType())
1916  {
1917  // (2,0) Jacobi inner product.
1919  for(i = 0; i < nquad2; ++i)
1920  {
1921  Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
1922  &outarray[0]+i*nquad0*nquad1, 1);
1923  }
1924  break;
1925 
1926  default:
1927  for(i = 0; i < nquad2; ++i)
1928  {
1929  Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
1930  &outarray[0]+i*nquad0*nquad1,1);
1931  }
1932  break;
1933  }
1934  }
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:125
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:215
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:59
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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:186

◆ v_NumBndryCoeffs()

int Nektar::StdRegions::StdPyrExp::v_NumBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 842 of file StdPyrExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::LibUtilities::StdPyrData::getNumberOfBndCoefficients(), Nektar::StdRegions::StdExpansion::m_base, and class_topology::P.

843  {
846  "BasisType is not a boundary interior form");
849  "BasisType is not a boundary interior form");
852  "BasisType is not a boundary interior form");
853 
854  int P = m_base[0]->GetNumModes();
855  int Q = m_base[1]->GetNumModes();
856  int R = m_base[2]->GetNumModes();
857 
860  }
Principle Modified Functions .
Definition: BasisType.h:52
Principle Modified Functions .
Definition: BasisType.h:48
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:267
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Lagrange for SEM basis .
Definition: BasisType.h:54
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_NumDGBndryCoeffs()

int Nektar::StdRegions::StdPyrExp::v_NumDGBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 862 of file StdPyrExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, and class_topology::P.

863  {
866  "BasisType is not a boundary interior form");
869  "BasisType is not a boundary interior form");
872  "BasisType is not a boundary interior form");
873 
874  int P = m_base[0]->GetNumModes()-1;
875  int Q = m_base[1]->GetNumModes()-1;
876  int R = m_base[2]->GetNumModes()-1;
877 
878  return (P+1)*(Q+1) // 1 rect. face on base
879  + 2*(R+1) + P*(1 + 2*R - P) // 2 tri. (P,R) faces
880  + 2*(R+1) + Q*(1 + 2*R - Q); // 2 tri. (Q,R) faces
881  }
Principle Modified Functions .
Definition: BasisType.h:52
Principle Modified Functions .
Definition: BasisType.h:48
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Lagrange for SEM basis .
Definition: BasisType.h:54
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_PhysDeriv() [1/2]

void Nektar::StdRegions::StdPyrExp::v_PhysDeriv ( const Array< OneD, const NekDouble > &  u_physical,
Array< OneD, NekDouble > &  out_dxi1,
Array< OneD, NekDouble > &  out_dxi2,
Array< OneD, NekDouble > &  out_dxi3 
)
protectedvirtual

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

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 106 of file StdPyrExp.cpp.

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

Referenced by v_PhysDeriv(), and v_StdPhysDeriv().

111  {
112  // PhysDerivative implementation based on Spen's book page 152.
113  int Qx = m_base[0]->GetNumPoints();
114  int Qy = m_base[1]->GetNumPoints();
115  int Qz = m_base[2]->GetNumPoints();
116 
117  Array<OneD, NekDouble> dEta_bar1(Qx*Qy*Qz,0.0);
118  Array<OneD, NekDouble> dXi2 (Qx*Qy*Qz,0.0);
119  Array<OneD, NekDouble> dEta3 (Qx*Qy*Qz,0.0);
120  PhysTensorDeriv(u_physical, dEta_bar1, dXi2, dEta3);
121 
122  Array<OneD, const NekDouble> eta_x, eta_y, eta_z;
123  eta_x = m_base[0]->GetZ();
124  eta_y = m_base[1]->GetZ();
125  eta_z = m_base[2]->GetZ();
126 
127  int i, j, k, n;
128 
129  if (out_dxi1.num_elements() > 0)
130  {
131  for (k = 0, n = 0; k < Qz; ++k)
132  {
133  NekDouble fac = 2.0/(1.0 - eta_z[k]);
134  for (j = 0; j < Qy; ++j)
135  {
136  for (i = 0; i < Qx; ++i, ++n)
137  {
138  out_dxi1[n] = fac * dEta_bar1[n];
139  }
140  }
141  }
142  }
143 
144  if (out_dxi2.num_elements() > 0)
145  {
146  for (k = 0, n = 0; k < Qz; ++k)
147  {
148  NekDouble fac = 2.0/(1.0 - eta_z[k]);
149  for (j = 0; j < Qy; ++j)
150  {
151  for (i = 0; i < Qx; ++i, ++n)
152  {
153  out_dxi2[n] = fac * dXi2[n];
154  }
155  }
156  }
157  }
158 
159  if (out_dxi3.num_elements() > 0)
160  {
161  for (k = 0, n = 0; k < Qz; ++k)
162  {
163  NekDouble fac = 1.0/(1.0 - eta_z[k]);
164  for (j = 0; j < Qy; ++j)
165  {
166  NekDouble fac1 = (1.0+eta_y[j]);
167  for (i = 0; i < Qx; ++i, ++n)
168  {
169  out_dxi3[n] = (1.0+eta_x[i])*fac*dEta_bar1[n] +
170  fac1*fac*dXi2[n] + dEta3[n];
171  }
172  }
173  }
174  }
175  }
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...
double NekDouble
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_PhysDeriv() [2/2]

void Nektar::StdRegions::StdPyrExp::v_PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0 
)
protectedvirtual

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

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 177 of file StdPyrExp.cpp.

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

180  {
181  switch(dir)
182  {
183  case 0:
184  {
185  v_PhysDeriv(inarray, outarray, NullNekDouble1DArray,
187  break;
188  }
189 
190  case 1:
191  {
192  v_PhysDeriv(inarray, NullNekDouble1DArray, outarray,
194  break;
195  }
196 
197  case 2:
198  {
200  NullNekDouble1DArray, outarray);
201  break;
202  }
203 
204  default:
205  {
206  ASSERTL1(false,"input dir is out of range");
207  }
208  break;
209  }
210  }
static Array< OneD, NekDouble > NullNekDouble1DArray
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)
Calculate the derivative of the physical points.
Definition: StdPyrExp.cpp:106
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250

◆ v_ReduceOrderCoeffs()

void Nektar::StdRegions::StdPyrExp::v_ReduceOrderCoeffs ( int  numMin,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2072 of file StdPyrExp.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrthoPyr_C, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

2076  {
2077  int nquad0 = m_base[0]->GetNumPoints();
2078  int nquad1 = m_base[1]->GetNumPoints();
2079  int nquad2 = m_base[2]->GetNumPoints();
2080  int nqtot = nquad0*nquad1*nquad2;
2081  int nmodes0 = m_base[0]->GetNumModes();
2082  int nmodes1 = m_base[1]->GetNumModes();
2083  int nmodes2 = m_base[2]->GetNumModes();
2084  int numMax = nmodes0;
2085 
2086  Array<OneD, NekDouble> coeff (m_ncoeffs);
2087  Array<OneD, NekDouble> coeff_tmp1(m_ncoeffs, 0.0);
2088  Array<OneD, NekDouble> phys_tmp (nqtot, 0.0);
2089  Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
2090 
2091 
2092  const LibUtilities::PointsKey Pkey0 = m_base[0]->GetPointsKey();
2093  const LibUtilities::PointsKey Pkey1 = m_base[1]->GetPointsKey();
2094  const LibUtilities::PointsKey Pkey2 = m_base[2]->GetPointsKey();
2095 
2096  LibUtilities::BasisKey bortho0(
2097  LibUtilities::eOrtho_A, nmodes0, Pkey0);
2098  LibUtilities::BasisKey bortho1(
2099  LibUtilities::eOrtho_A, nmodes1, Pkey1);
2100  LibUtilities::BasisKey bortho2(
2101  LibUtilities::eOrthoPyr_C, nmodes2, Pkey2);
2102 
2103  int cnt = 0;
2104  int u = 0;
2105  int i = 0;
2106  StdRegions::StdPyrExpSharedPtr OrthoPyrExp;
2107 
2109  ::AllocateSharedPtr(bortho0, bortho1, bortho2);
2110 
2111  BwdTrans(inarray,phys_tmp);
2112  OrthoPyrExp->FwdTrans(phys_tmp, coeff);
2113 
2114  // filtering
2115  for (u = 0; u < numMin; ++u)
2116  {
2117  for (i = 0; i < numMin; ++i)
2118  {
2119 
2120  int maxui = max(u,i);
2121  Vmath::Vcopy(numMin - maxui, tmp = coeff + cnt, 1,
2122  tmp2 = coeff_tmp1 + cnt, 1);
2123  cnt += nmodes2 - maxui;
2124  }
2125 
2126  for (i = numMin; i < nmodes1; ++i)
2127  {
2128  int maxui = max(u,i);
2129  cnt += numMax - maxui;
2130  }
2131  }
2132 
2133  OrthoPyrExp->BwdTrans(coeff_tmp1, phys_tmp);
2134  StdPyrExp::FwdTrans(phys_tmp, outarray);
2135  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Principle Orthogonal Functions .
Definition: BasisType.h:45
Principle Orthogonal Functions .
Definition: BasisType.h:51
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space...
Definition: StdExpansion.h:530
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
std::shared_ptr< StdPyrExp > StdPyrExpSharedPtr
Definition: StdPyrExp.h:270
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space...

◆ v_StdPhysDeriv() [1/2]

void Nektar::StdRegions::StdPyrExp::v_StdPhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 212 of file StdPyrExp.cpp.

References v_PhysDeriv().

216  {
217  StdPyrExp::v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
218  }
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)
Calculate the derivative of the physical points.
Definition: StdPyrExp.cpp:106

◆ v_StdPhysDeriv() [2/2]

void Nektar::StdRegions::StdPyrExp::v_StdPhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 220 of file StdPyrExp.cpp.

References v_PhysDeriv().

223  {
224  StdPyrExp::v_PhysDeriv(dir, inarray, outarray);
225  }
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)
Calculate the derivative of the physical points.
Definition: StdPyrExp.cpp:106

◆ v_SVVLaplacianFilter()

void Nektar::StdRegions::StdPyrExp::v_SVVLaplacianFilter ( Array< OneD, NekDouble > &  array,
const StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PyrExp.

Definition at line 1937 of file StdPyrExp.cpp.

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::eFactorSVVCutoffRatio, Nektar::StdRegions::eFactorSVVDGKerDiffCoeff, Nektar::StdRegions::eFactorSVVDiffCoeff, Nektar::StdRegions::eFactorSVVPowerKerDiffCoeff, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrthoPyr_C, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::kSVVDGFilter, Nektar::StdRegions::kSVVDGFiltermodesmax, Nektar::StdRegions::kSVVDGFiltermodesmin, and Nektar::StdRegions::StdExpansion::m_base.

1939  {
1940  // Generate an orthonogal expansion
1941  int qa = m_base[0]->GetNumPoints();
1942  int qb = m_base[1]->GetNumPoints();
1943  int qc = m_base[2]->GetNumPoints();
1944  int nmodes_a = m_base[0]->GetNumModes();
1945  int nmodes_b = m_base[1]->GetNumModes();
1946  int nmodes_c = m_base[2]->GetNumModes();
1947  // Declare orthogonal basis.
1948  LibUtilities::PointsKey pa(qa,m_base[0]->GetPointsType());
1949  LibUtilities::PointsKey pb(qb,m_base[1]->GetPointsType());
1950  LibUtilities::PointsKey pc(qc,m_base[2]->GetPointsType());
1951 
1952  LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A,nmodes_a,pa);
1953  LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A,nmodes_b,pb);
1954  LibUtilities::BasisKey Bc(LibUtilities::eOrthoPyr_C,nmodes_c,pc);
1955  StdPyrExp OrthoExp(Ba,Bb,Bc);
1956 
1957  Array<OneD, NekDouble> orthocoeffs(OrthoExp.GetNcoeffs());
1958  int i,j,k,cnt = 0;
1959 
1960  // project onto modal space.
1961  OrthoExp.FwdTrans(array,orthocoeffs);
1962 
1963  if(mkey.ConstFactorExists(eFactorSVVPowerKerDiffCoeff))
1964  {
1965  // Rodrigo's power kernel
1966  NekDouble cutoff = mkey.GetConstFactor(eFactorSVVCutoffRatio);
1967  NekDouble SvvDiffCoeff =
1968  mkey.GetConstFactor(eFactorSVVPowerKerDiffCoeff)*
1969  mkey.GetConstFactor(eFactorSVVDiffCoeff);
1970 
1971  for(int i = 0; i < nmodes_a; ++i)
1972  {
1973  for(int j = 0; j < nmodes_b; ++j)
1974  {
1975  int maxij = max(i,j);
1976  NekDouble fac1 = std::max(
1977  pow((1.0*i)/(nmodes_a-1),cutoff*nmodes_a),
1978  pow((1.0*j)/(nmodes_b-1),cutoff*nmodes_b));
1979 
1980  for(int k = 0; k < nmodes_c-maxij; ++k)
1981  {
1982  NekDouble fac = std::max(fac1,
1983  pow((1.0*k)/(nmodes_c-1),cutoff*nmodes_c));
1984 
1985  orthocoeffs[cnt] *= SvvDiffCoeff * fac;
1986  cnt++;
1987  }
1988  }
1989  }
1990  }
1991  else if(mkey.ConstFactorExists(eFactorSVVDGKerDiffCoeff)) // Rodrigo/Mansoor's DG Kernel
1992  {
1993  NekDouble SvvDiffCoeff =
1994  mkey.GetConstFactor(eFactorSVVDGKerDiffCoeff)*
1995  mkey.GetConstFactor(eFactorSVVDiffCoeff);
1996 
1997  int max_abc = max(nmodes_a-kSVVDGFiltermodesmin,
1998  nmodes_b-kSVVDGFiltermodesmin);
1999  max_abc = max(max_abc, nmodes_c-kSVVDGFiltermodesmin);
2000  // clamp max_abc
2001  max_abc = max(max_abc,0);
2002  max_abc = min(max_abc,kSVVDGFiltermodesmax-kSVVDGFiltermodesmin);
2003 
2004  for(int i = 0; i < nmodes_a; ++i)
2005  {
2006  for(int j = 0; j < nmodes_b; ++j)
2007  {
2008  int maxij = max(i,j);
2009 
2010  for(int k = 0; k < nmodes_c-maxij; ++k)
2011  {
2012  int maxijk = max(maxij,k);
2013  maxijk = min(maxijk,kSVVDGFiltermodesmax-1);
2014 
2015  orthocoeffs[cnt] *= SvvDiffCoeff *
2016  kSVVDGFilter[max_abc][maxijk];
2017  cnt++;
2018  }
2019  }
2020  }
2021  }
2022  else
2023  {
2024  //SVV filter paramaters (how much added diffusion relative
2025  // to physical one and fraction of modes from which you
2026  // start applying this added diffusion)
2027  //
2028  NekDouble SvvDiffCoeff = mkey.GetConstFactor(StdRegions::eFactorSVVDiffCoeff);
2029  NekDouble SVVCutOff = mkey.GetConstFactor(StdRegions::eFactorSVVCutoffRatio);
2030 
2031  //Defining the cut of mode
2032  int cutoff_a = (int) (SVVCutOff*nmodes_a);
2033  int cutoff_b = (int) (SVVCutOff*nmodes_b);
2034  int cutoff_c = (int) (SVVCutOff*nmodes_c);
2035  //To avoid the fac[j] from blowing up
2036  NekDouble epsilon = 1;
2037 
2038  int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
2039  NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
2040 
2041  for(i = 0; i < nmodes_a; ++i)//P
2042  {
2043  for(j = 0; j < nmodes_b; ++j) //Q
2044  {
2045  int maxij = max(i,j);
2046  for(k = 0; k < nmodes_c-maxij; ++k) //R
2047  {
2048  if(j + k >= cutoff || i + k >= cutoff)
2049  {
2050  orthocoeffs[cnt] *=
2051  (SvvDiffCoeff*exp(-(i+k-nmodes)*(i+k-nmodes)/
2052  ((NekDouble)((i+k-cutoff+epsilon)*
2053  (i+k-cutoff+epsilon))))*
2054  exp(-(j-nmodes)*(j-nmodes)/
2055  ((NekDouble)((j-cutoff+epsilon)*
2056  (j-cutoff+epsilon)))));
2057  }
2058  else
2059  {
2060  orthocoeffs[cnt] *= 0.0;
2061  }
2062  cnt++;
2063  }
2064  }
2065  }
2066  }
2067 
2068  // backward transform to physical space
2069  OrthoExp.BwdTrans(orthocoeffs,array);
2070  }
const int kSVVDGFiltermodesmax
Definition: StdRegions.hpp:385
const int kSVVDGFiltermodesmin
Definition: StdRegions.hpp:384
Principle Orthogonal Functions .
Definition: BasisType.h:45
double NekDouble
const NekDouble kSVVDGFilter[9][11]
Definition: StdRegions.hpp:387
Principle Orthogonal Functions .
Definition: BasisType.h:51
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:215
Array< OneD, LibUtilities::BasisSharedPtr > m_base