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

Class representing a prismatic element in reference space. More...

#include <StdPrismExp.h>

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

Public Member Functions

 StdPrismExp ()
 
 StdPrismExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdPrismExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
 
 StdPrismExp (const StdPrismExp &T)
 
 ~StdPrismExp ()
 
- 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)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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)
 Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into outarray: More...
 
virtual void v_IProductWRTBase_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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)
 Inner product of inarray over region with respect to the object's default expansion basis; output in outarray. More...
 
virtual void v_IProductWRTDerivBase_MatOp (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
 Return Shape of region, using ShapeType enum list; i.e. prism. More...
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
virtual int v_GetTotalEdgeIntNcoeffs () const
 
virtual int v_GetFaceNcoeffs (const int i) const
 
virtual int v_GetFaceNumPoints (const int i) const
 
virtual LibUtilities::PointsKey v_GetFacePointsKey (const int i, const int j) const
 
virtual const LibUtilities::BasisKey v_DetFaceBasisKey (const int i, const int k) const
 
virtual int v_GetFaceIntNcoeffs (const int i) const
 
virtual int v_GetTotalFaceIntNcoeffs () const
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual LibUtilities::BasisType v_GetEdgeBasisType (const int i) const
 
virtual bool v_IsBoundaryInteriorExpansion ()
 
virtual void v_GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1, int Q=-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_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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 local 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

Class representing a prismatic element in reference space.

Definition at line 48 of file StdPrismExp.h.

Constructor & Destructor Documentation

◆ StdPrismExp() [1/4]

Nektar::StdRegions::StdPrismExp::StdPrismExp ( )

Definition at line 47 of file StdPrismExp.cpp.

48  {
49  }

◆ StdPrismExp() [2/4]

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

Definition at line 51 of file StdPrismExp.cpp.

References ASSERTL0, 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  ASSERTL0(Ba.GetNumModes() <= Bc.GetNumModes(),
66  "order in 'a' direction is higher than order in 'c' direction");
67  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:287
StdExpansion()
Default Constructor.

◆ StdPrismExp() [3/4]

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

◆ StdPrismExp() [4/4]

Nektar::StdRegions::StdPrismExp::StdPrismExp ( const StdPrismExp T)

Definition at line 69 of file StdPrismExp.cpp.

70  : StdExpansion(T),
72  {
73  }
StdExpansion()
Default Constructor.

◆ ~StdPrismExp()

Nektar::StdRegions::StdPrismExp::~StdPrismExp ( )

Definition at line 77 of file StdPrismExp.cpp.

78  {
79  }

Member Function Documentation

◆ GetMode()

int Nektar::StdRegions::StdPrismExp::GetMode ( int  p,
int  q,
int  r 
)
private

Compute the local 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). For example, with P=1, Q=2, R=3, the indexing inside each q-r plane (with r increasing upwards and q to the right) is:

p = 0: p = 1:

3 7 11 2 6 10 14 17 20 1 5 9 13 16 19 0 4 8 12 15 18

Note that in this element, we must have that \( P <= R \).

Definition at line 1941 of file StdPrismExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base, and CellMLToNektar.cellml_metadata::p.

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

1942  {
1943  int Q = m_base[1]->GetNumModes() - 1;
1944  int R = m_base[2]->GetNumModes() - 1;
1945 
1946  return r + // Skip along stacks (r-direction)
1947  q*(R+1-p) + // Skip along columns (q-direction)
1948  (Q+1)*(p*R + 1-(p-2)*(p-1)/2); // Skip along rows (p-direction)
1949  }
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_BwdTrans()

void Nektar::StdRegions::StdPrismExp::v_BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual
Note
'r' (base[2]) runs fastest in this element.

Perform backwards transformation 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})\)

In the prism this expansion becomes:

\( 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_{pr}^b (\xi_{3k}) \rbrace} \rbrace}. \)

And sumfactorizing step of the form is as:\

\( f_{pr} (\xi_{3k}) = \sum_{r=0}^{Q_z} \hat u_{pqr} \psi_{pr}^b (\xi_{3k}),\\ g_{p} (\xi_{2j}, \xi_{3k}) = \sum_{r=0}^{Q_y} \psi_{p}^a (\xi_{2j}) f_{pr} (\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.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp.

Definition at line 243 of file StdPrismExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::m_base, v_BwdTrans_SumFac(), and Vmath::Vcopy().

Referenced by v_FillMode().

245  {
248  "Basis[1] is not a general tensor type");
249 
252  "Basis[2] is not a general tensor type");
253 
254  if(m_base[0]->Collocation() &&
255  m_base[1]->Collocation() &&
256  m_base[2]->Collocation())
257  {
259  m_base[1]->GetNumPoints()*
260  m_base[2]->GetNumPoints(),
261  inarray, 1, outarray, 1);
262  }
263  else
264  {
265  StdPrismExp::v_BwdTrans_SumFac(inarray,outarray);
266  }
267  }
Principle Modified Functions .
Definition: BasisType.h:50
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:228
Principle Orthogonal Functions .
Definition: BasisType.h:46
Principle Modified Functions .
Definition: BasisType.h:49
Principle Orthogonal Functions .
Definition: BasisType.h:47
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
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::StdPrismExp::v_BwdTrans_SumFac ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp.

Definition at line 269 of file StdPrismExp.cpp.

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

Referenced by v_BwdTrans(), and Nektar::StdRegions::StdNodalPrismExp::v_BwdTrans_SumFac().

271  {
272  int nquad1 = m_base[1]->GetNumPoints();
273  int nquad2 = m_base[2]->GetNumPoints();
274  int order0 = m_base[0]->GetNumModes();
275  int order1 = m_base[1]->GetNumModes();
276 
277  Array<OneD, NekDouble> wsp(nquad2*order1*order0 +
278  nquad1*nquad2*order0);
279 
280  BwdTrans_SumFacKernel(m_base[0]->GetBdata(),
281  m_base[1]->GetBdata(),
282  m_base[2]->GetBdata(),
283  inarray,outarray,wsp,true,true,true);
284  }
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)
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_BwdTrans_SumFacKernel()

void Nektar::StdRegions::StdPrismExp::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 287 of file StdPrismExp.cpp.

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

297  {
298  boost::ignore_unused(doCheckCollDir0, doCheckCollDir1,
299  doCheckCollDir2);
300 
301  int i, mode;
302  int nquad0 = m_base[0]->GetNumPoints();
303  int nquad1 = m_base[1]->GetNumPoints();
304  int nquad2 = m_base[2]->GetNumPoints();
305  int nummodes0 = m_base[0]->GetNumModes();
306  int nummodes1 = m_base[1]->GetNumModes();
307  int nummodes2 = m_base[2]->GetNumModes();
308  Array<OneD, NekDouble> tmp0 = wsp;
309  Array<OneD, NekDouble> tmp1 = tmp0 + nquad2*nummodes1*nummodes0;
310 
311  for (i = mode = 0; i < nummodes0; ++i)
312  {
313  Blas::Dgemm('N', 'N', nquad2, nummodes1, nummodes2-i,
314  1.0, base2.get() + mode*nquad2, nquad2,
315  inarray.get() + mode*nummodes1, nummodes2-i,
316  0.0, tmp0.get() + i*nquad2*nummodes1, nquad2);
317  mode += nummodes2-i;
318  }
319 
321  {
322  for(i = 0; i < nummodes1; i++)
323  {
324  Blas::Daxpy(nquad2,inarray[1+i*nummodes2],base2.get()+nquad2,1,
325  tmp0.get()+nquad2*(nummodes1+i),1);
326  }
327  }
328 
329  for (i = 0; i < nummodes0; i++)
330  {
331  Blas::Dgemm('N', 'T', nquad1, nquad2, nummodes1,
332  1.0, base1.get(), nquad1,
333  tmp0.get() + i*nquad2*nummodes1, nquad2,
334  0.0, tmp1.get() + i*nquad2*nquad1, nquad1);
335  }
336 
337  Blas::Dgemm('N', 'T', nquad0, nquad2*nquad1, nummodes0,
338  1.0, base0.get(), nquad0,
339  tmp1.get(), nquad2*nquad1,
340  0.0, outarray.get(), nquad0);
341  }
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
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::StdPrismExp::v_CalcNumberOfCoefficients ( const std::vector< unsigned int > &  nummodes,
int &  modes_offset 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1007 of file StdPrismExp.cpp.

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

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

◆ v_CreateStdMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp, and Nektar::StdRegions::StdNodalPrismExp.

Definition at line 1916 of file StdPrismExp.cpp.

References v_GenMatrix().

1917  {
1918  return v_GenMatrix(mkey);
1919  }
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)

◆ v_DetFaceBasisKey()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 968 of file StdPrismExp.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().

970  {
971  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
972  ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
973 
974  switch(i)
975  {
976  case 0:
977  {
978  return EvaluateQuadFaceBasisKey(k,
979  m_base[k]->GetBasisType(),
980  m_base[k]->GetNumPoints(),
981  m_base[k]->GetNumModes());
982  }
983  case 2:
984  case 4:
985  {
986  return EvaluateQuadFaceBasisKey(k,
987  m_base[k+1]->GetBasisType(),
988  m_base[k+1]->GetNumPoints(),
989  m_base[k+1]->GetNumModes());
990  }
991  case 1:
992  case 3:
993  {
994  return EvaluateTriFaceBasisKey(k,
995  m_base[2*k]->GetBasisType(),
996  m_base[2*k]->GetNumPoints(),
997  m_base[2*k]->GetNumModes());
998 
999  }
1000  break;
1001  }
1002 
1003  // Should never get here.
1005  }
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::StdPrismExp::v_DetShapeType ( ) const
protectedvirtual

Return Shape of region, using ShapeType enum list; i.e. prism.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 803 of file StdPrismExp.cpp.

References Nektar::LibUtilities::ePrism.

804  {
805  return LibUtilities::ePrism;
806  }

◆ v_FillMode()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp.

Definition at line 731 of file StdPrismExp.cpp.

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

Referenced by Nektar::StdRegions::StdNodalPrismExp::GenNBasisTransMatrix().

732  {
733  Array<OneD, NekDouble> tmp(m_ncoeffs,0.0);
734  tmp[mode] = 1.0;
735  StdPrismExp::v_BwdTrans(tmp, outarray);
736  }
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)

◆ v_FwdTrans()

void Nektar::StdRegions::StdPrismExp::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::StdRegions::StdNodalPrismExp, and Nektar::LocalRegions::PrismExp.

Definition at line 354 of file StdPrismExp.cpp.

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

356  {
357  v_IProductWRTBase(inarray, outarray);
358 
359  // Get Mass matrix inverse
360  StdMatrixKey masskey(eInvMass,DetShapeType(),*this);
361  DNekMatSharedPtr matsys = GetStdMatrix(masskey);
362 
363  // copy inarray in case inarray == outarray
364  DNekVec in (m_ncoeffs, outarray);
365  DNekVec out(m_ncoeffs, outarray, eWrapper);
366 
367  out = (*matsys)*in;
368  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
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

◆ v_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp, and Nektar::StdRegions::StdNodalPrismExp.

Definition at line 1828 of file StdPrismExp.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::StdExpansion::CreateGeneralMatrix(), Nektar::StdRegions::eFactorConst, Nektar::StdRegions::ePhysInterpToEquiSpaced, Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::LibUtilities::StdPrismData::getNumberOfCoefficients(), Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::StdRegions::StdExpansion::m_base, Vmath::Smul(), and Vmath::Vcopy().

Referenced by v_CreateStdMatrix().

1829  {
1830 
1831  MatrixType mtype = mkey.GetMatrixType();
1832 
1833  DNekMatSharedPtr Mat;
1834 
1835  switch(mtype)
1836  {
1838  {
1839  int nq0 = m_base[0]->GetNumPoints();
1840  int nq1 = m_base[1]->GetNumPoints();
1841  int nq2 = m_base[2]->GetNumPoints();
1842  int nq;
1843 
1844  // take definition from key
1845  if(mkey.ConstFactorExists(eFactorConst))
1846  {
1847  nq = (int) mkey.GetConstFactor(eFactorConst);
1848  }
1849  else
1850  {
1851  nq = max(nq0,max(nq1,nq2));
1852  }
1853 
1855  getNumberOfCoefficients (nq,nq,nq);
1856  Array<OneD, Array<OneD, NekDouble> > coords (neq);
1857  Array<OneD, NekDouble> coll (3);
1858  Array<OneD, DNekMatSharedPtr> I (3);
1859  Array<OneD, NekDouble> tmp (nq0);
1860 
1862  AllocateSharedPtr(neq,nq0*nq1*nq2);
1863  int cnt = 0;
1864  for(int i = 0; i < nq; ++i)
1865  {
1866  for(int j = 0; j < nq; ++j)
1867  {
1868  for(int k = 0; k < nq-i; ++k,++cnt)
1869  {
1870  coords[cnt] = Array<OneD, NekDouble>(3);
1871  coords[cnt][0] = -1.0 + 2*k/(NekDouble)(nq-1);
1872  coords[cnt][1] = -1.0 + 2*j/(NekDouble)(nq-1);
1873  coords[cnt][2] = -1.0 + 2*i/(NekDouble)(nq-1);
1874  }
1875  }
1876  }
1877 
1878  for(int i = 0; i < neq; ++i)
1879  {
1880  LocCoordToLocCollapsed(coords[i],coll);
1881 
1882  I[0] = m_base[0]->GetI(coll );
1883  I[1] = m_base[1]->GetI(coll+1);
1884  I[2] = m_base[2]->GetI(coll+2);
1885 
1886  // interpolate first coordinate direction
1887  NekDouble fac;
1888  for( int k = 0; k < nq2; ++k)
1889  {
1890  for (int j = 0; j < nq1; ++j)
1891  {
1892 
1893  fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1894  Vmath::Smul(nq0,fac,I[0]->GetPtr(),1,tmp,1);
1895 
1896  Vmath::Vcopy(nq0, &tmp[0], 1,
1897  Mat->GetRawPtr() +
1898  k * nq0 * nq1 * neq +
1899  j * nq0 * neq + i,
1900  neq);
1901  }
1902  }
1903  }
1904  }
1905  break;
1906  default:
1907  {
1909  }
1910  break;
1911  }
1912 
1913  return Mat;
1914  }
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:287
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
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
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
double NekDouble
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_GetBoundaryMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp.

Definition at line 1762 of file StdPrismExp.cpp.

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

1763  {
1766  "BasisType is not a boundary interior form");
1769  "BasisType is not a boundary interior form");
1772  "BasisType is not a boundary interior form");
1773 
1774  int P = m_base[0]->GetNumModes() - 1, p;
1775  int Q = m_base[1]->GetNumModes() - 1, q;
1776  int R = m_base[2]->GetNumModes() - 1, r;
1777  int idx = 0;
1778 
1779  int nBnd = NumBndryCoeffs();
1780 
1781  if (maparray.num_elements() != nBnd)
1782  {
1783  maparray = Array<OneD, unsigned int>(nBnd);
1784  }
1785 
1786  // Loop over all boundary modes (in ascending order).
1787  for (p = 0; p <= P; ++p)
1788  {
1789  // First two q-r planes are entirely boundary modes.
1790  if (p <= 1)
1791  {
1792  for (q = 0; q <= Q; ++q)
1793  {
1794  for (r = 0; r <= R-p; ++r)
1795  {
1796  maparray[idx++] = GetMode(p,q,r);
1797  }
1798  }
1799  }
1800  else
1801  {
1802  // Remaining q-r planes contain boundary modes on the two
1803  // left-hand sides and bottom edge.
1804  for (q = 0; q <= Q; ++q)
1805  {
1806  if (q <= 1)
1807  {
1808  for (r = 0; r <= R-p; ++r)
1809  {
1810  maparray[idx++] = GetMode(p,q,r);
1811  }
1812  }
1813  else
1814  {
1815  maparray[idx++] = GetMode(p,q,0);
1816  }
1817  }
1818  }
1819  }
1820  }
Principle Modified Functions .
Definition: BasisType.h:48
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
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::StdPrismExp::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::PrismExp.

Definition at line 707 of file StdPrismExp.cpp.

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

710  {
711  Array<OneD, const NekDouble> etaBar_x = m_base[0]->GetZ();
712  Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
713  Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
714  int Qx = GetNumPoints(0);
715  int Qy = GetNumPoints(1);
716  int Qz = GetNumPoints(2);
717 
718  // Convert collapsed coordinates into cartesian coordinates: eta --> xi
719  for (int k = 0; k < Qz; ++k) {
720  for (int j = 0; j < Qy; ++j) {
721  for (int i = 0; i < Qx; ++i) {
722  int s = i + Qx*(j + Qy*k);
723  xi_x[s] = (1.0 - eta_z[k])*(1.0 + etaBar_x[i]) / 2.0 - 1.0;
724  xi_y[s] = eta_y[j];
725  xi_z[s] = eta_z[k];
726  }
727  }
728  }
729  }
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::StdPrismExp::v_GetEdgeBasisType ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1019 of file StdPrismExp.cpp.

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

1020  {
1021  ASSERTL2(i >= 0 && i <= 8, "edge id is out of range");
1022  if (i == 0 || i == 2)
1023  {
1024  return GetBasisType(0);
1025  }
1026  else if (i == 1 || i == 3 || i == 8)
1027  {
1028  return GetBasisType(1);
1029  }
1030  else
1031  {
1032  return GetBasisType(2);
1033  }
1034  }
#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::StdPrismExp::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 1428 of file StdPrismExp.cpp.

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

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

◆ v_GetEdgeNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 849 of file StdPrismExp.cpp.

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

Referenced by v_GetEdgeInteriorMap().

850  {
851  ASSERTL2(i >= 0 && i <= 8, "edge id is out of range");
852 
853  if (i == 0 || i == 2)
854  {
855  return GetBasisNumModes(0);
856  }
857  else if (i == 1 || i == 3 || i == 8)
858  {
859  return GetBasisNumModes(1);
860  }
861  else
862  {
863  return GetBasisNumModes(2);
864  }
865  }
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::StdPrismExp::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 1542 of file StdPrismExp.cpp.

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

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

◆ v_GetFaceIntNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 894 of file StdPrismExp.cpp.

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

Referenced by v_GetFaceInteriorMap().

895  {
896  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
897 
898  int Pi = GetBasisNumModes(0) - 2;
899  int Qi = GetBasisNumModes(1) - 2;
900  int Ri = GetBasisNumModes(2) - 2;
901 
902  if (i == 0)
903  {
904  return Pi * Qi;
905  }
906  else if (i == 1 || i == 3)
907  {
908  return Pi * (2*Ri - Pi - 1) / 2;
909  }
910  else
911  {
912  return Qi * Ri;
913  }
914  }
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_GetFaceNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 876 of file StdPrismExp.cpp.

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

877  {
878  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
879  if (i == 0)
880  {
881  return GetBasisNumModes(0)*GetBasisNumModes(1);
882  }
883  else if (i == 1 || i == 3)
884  {
885  int P = GetBasisNumModes(0)-1, Q = GetBasisNumModes(2)-1;
886  return Q+1 + (P*(1 + 2*Q - P))/2;
887  }
888  else
889  {
890  return GetBasisNumModes(1)*GetBasisNumModes(2);
891  }
892  }
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::StdPrismExp::v_GetFaceNumModes ( const int  fid,
const Orientation  faceOrient,
int &  numModes0,
int &  numModes1 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 738 of file StdPrismExp.cpp.

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

743  {
744  int nummodes [3] = {m_base[0]->GetNumModes(),
745  m_base[1]->GetNumModes(),
746  m_base[2]->GetNumModes()};
747  switch(fid)
748  {
749  // base quad
750  case 0:
751  {
752  numModes0 = nummodes[0];
753  numModes1 = nummodes[1];
754  }
755  break;
756  // front and back quad
757  case 2:
758  case 4:
759  {
760  numModes0 = nummodes[1];
761  numModes1 = nummodes[2];
762  }
763  break;
764  // triangles
765  case 1:
766  case 3:
767  {
768  numModes0 = nummodes[0];
769  numModes1 = nummodes[2];
770  }
771  break;
772  }
773 
774  if ( faceOrient >= 9 )
775  {
776  std::swap(numModes0, numModes1);
777  }
778  }
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetFaceNumPoints()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 927 of file StdPrismExp.cpp.

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

928  {
929  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
930 
931  if (i == 0)
932  {
933  return m_base[0]->GetNumPoints()*
934  m_base[1]->GetNumPoints();
935  }
936  else if (i == 1 || i == 3)
937  {
938  return m_base[0]->GetNumPoints()*
939  m_base[2]->GetNumPoints();
940  }
941  else
942  {
943  return m_base[1]->GetNumPoints()*
944  m_base[2]->GetNumPoints();
945  }
946  }
#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_GetFacePointsKey()

LibUtilities::PointsKey Nektar::StdRegions::StdPrismExp::v_GetFacePointsKey ( const int  i,
const int  j 
) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 948 of file StdPrismExp.cpp.

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

950  {
951  ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
952  ASSERTL2(j == 0 || j == 1, "face direction is out of range");
953 
954  if (i == 0)
955  {
956  return m_base[j]->GetPointsKey();
957  }
958  else if (i == 1 || i == 3)
959  {
960  return m_base[2*j]->GetPointsKey();
961  }
962  else
963  {
964  return m_base[j+1]->GetPointsKey();
965  }
966  }
#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::StdPrismExp::v_GetFaceToElementMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
int  P = -1,
int  Q = -1 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1048 of file StdPrismExp.cpp.

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

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp.

Definition at line 1724 of file StdPrismExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, 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.

1725  {
1728  "BasisType is not a boundary interior form");
1731  "BasisType is not a boundary interior form");
1734  "BasisType is not a boundary interior form");
1735 
1736  int P = m_base[0]->GetNumModes() - 1, p;
1737  int Q = m_base[1]->GetNumModes() - 1, q;
1738  int R = m_base[2]->GetNumModes() - 1, r;
1739 
1740  int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
1741 
1742  if(outarray.num_elements()!=nIntCoeffs)
1743  {
1744  outarray = Array<OneD, unsigned int>(nIntCoeffs);
1745  }
1746 
1747  int idx = 0;
1748 
1749  // Loop over all interior modes.
1750  for (p = 2; p <= P; ++p)
1751  {
1752  for (q = 2; q <= Q; ++q)
1753  {
1754  for (r = 1; r <= R-p; ++r)
1755  {
1756  outarray[idx++] = GetMode(p,q,r);
1757  }
1758  }
1759  }
1760  }
Principle Modified Functions .
Definition: BasisType.h:48
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
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::StdPrismExp::v_GetNedges ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 789 of file StdPrismExp.cpp.

790  {
791  return 9;
792  }

◆ v_GetNfaces()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 794 of file StdPrismExp.cpp.

795  {
796  return 5;
797  }

◆ v_GetNverts()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 784 of file StdPrismExp.cpp.

785  {
786  return 6;
787  }

◆ v_GetTotalEdgeIntNcoeffs()

int Nektar::StdRegions::StdPrismExp::v_GetTotalEdgeIntNcoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 867 of file StdPrismExp.cpp.

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

868  {
869  int P = GetBasisNumModes(0)-2;
870  int Q = GetBasisNumModes(1)-2;
871  int R = GetBasisNumModes(2)-2;
872 
873  return 2*P+3*Q+3*R;
874  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:177

◆ v_GetTotalFaceIntNcoeffs()

int Nektar::StdRegions::StdPrismExp::v_GetTotalFaceIntNcoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 916 of file StdPrismExp.cpp.

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

917  {
918  int Pi = GetBasisNumModes(0) - 2;
919  int Qi = GetBasisNumModes(1) - 2;
920  int Ri = GetBasisNumModes(2) - 2;
921 
922  return Pi * Qi +
923  Pi * (2*Ri - Pi - 1) +
924  2* Qi * Ri;
925  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:177

◆ v_GetVertexMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp.

Definition at line 1363 of file StdPrismExp.cpp.

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

1364  {
1368  "Mapping not defined for this type of basis");
1369 
1370  int l = 0;
1371 
1372  if(useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
1373  {
1374  switch (vId)
1375  {
1376  case 0:
1377  l = GetMode(0,0,0);
1378  break;
1379  case 1:
1380  l = GetMode(0,0,1);
1381  break;
1382  case 2:
1383  l = GetMode(0,1,0);
1384  break;
1385  case 3:
1386  l = GetMode(0,1,1);
1387  break;
1388  case 4:
1389  l = GetMode(1,0,0);
1390  break;
1391  case 5:
1392  l = GetMode(1,1,0);
1393  break;
1394  default:
1395  ASSERTL0(false, "local vertex id must be between 0 and 5");
1396  }
1397  }
1398  else
1399  {
1400  switch (vId)
1401  {
1402  case 0:
1403  l = GetMode(0,0,0);
1404  break;
1405  case 1:
1406  l = GetMode(1,0,0);
1407  break;
1408  case 2:
1409  l = GetMode(1,1,0);
1410  break;
1411  case 3:
1412  l = GetMode(0,1,0);
1413  break;
1414  case 4:
1415  l = GetMode(0,0,1);
1416  break;
1417  case 5:
1418  l = GetMode(0,1,1);
1419  break;
1420  default:
1421  ASSERTL0(false, "local vertex id must be between 0 and 5");
1422  }
1423  }
1424 
1425  return l;
1426  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Principle Modified Functions .
Definition: BasisType.h:48
Principle Modified Functions .
Definition: BasisType.h:49
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
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::StdPrismExp::v_IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

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

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

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

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp, and Nektar::LocalRegions::PrismExp.

Definition at line 401 of file StdPrismExp.cpp.

References ASSERTL1, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), and v_IProductWRTBase_SumFac().

Referenced by v_FwdTrans().

404  {
407  "Basis[1] is not a general tensor type");
408 
411  "Basis[2] is not a general tensor type");
412 
413  if(m_base[0]->Collocation() && m_base[1]->Collocation())
414  {
415  MultiplyByQuadratureMetric(inarray,outarray);
416  }
417  else
418  {
419  StdPrismExp::v_IProductWRTBase_SumFac(inarray,outarray);
420  }
421  }
Principle Modified Functions .
Definition: BasisType.h:50
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:945
Principle Orthogonal Functions .
Definition: BasisType.h:46
Principle Modified Functions .
Definition: BasisType.h:49
Principle Orthogonal Functions .
Definition: BasisType.h:47
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
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_IProductWRTBase_MatOp()

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

Implementation of the local matrix inner product operation.

Definition at line 426 of file StdPrismExp.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::StdRegions::eIProductWRTBase, Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdExpansion::GetTotPoints(), and Nektar::StdRegions::StdExpansion::m_ncoeffs.

429  {
430  int nq = GetTotPoints();
431  StdMatrixKey iprodmatkey(eIProductWRTBase,DetShapeType(),*this);
432  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
433 
434  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
435  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
436  }
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
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
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140

◆ v_IProductWRTBase_SumFac()

void Nektar::StdRegions::StdPrismExp::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::StdRegions::StdNodalPrismExp, and Nektar::LocalRegions::PrismExp.

Definition at line 438 of file StdPrismExp.cpp.

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

Referenced by v_IProductWRTBase(), and Nektar::StdRegions::StdNodalPrismExp::v_IProductWRTBase_SumFac().

442  {
443  int nquad1 = m_base[1]->GetNumPoints();
444  int nquad2 = m_base[2]->GetNumPoints();
445  int order0 = m_base[0]->GetNumModes();
446  int order1 = m_base[1]->GetNumModes();
447 
448  Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
449 
450  if(multiplybyweights)
451  {
452  Array<OneD, NekDouble> tmp(inarray.num_elements());
453 
454  MultiplyByQuadratureMetric(inarray,tmp);
455  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
456  m_base[1]->GetBdata(),
457  m_base[2]->GetBdata(),
458  tmp,outarray,wsp,
459  true,true,true);
460  }
461  else
462  {
463  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
464  m_base[1]->GetBdata(),
465  m_base[2]->GetBdata(),
466  inarray,outarray,wsp,
467  true,true,true);
468  }
469  }
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:945
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)
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_IProductWRTBase_SumFacKernel()

void Nektar::StdRegions::StdPrismExp::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 471 of file StdPrismExp.cpp.

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

481  {
482  boost::ignore_unused(doCheckCollDir0, doCheckCollDir1,
483  doCheckCollDir2);
484 
485  // Interior prism implementation based on Spen's book page
486  // 119. and 608.
487  const int nquad0 = m_base[0]->GetNumPoints();
488  const int nquad1 = m_base[1]->GetNumPoints();
489  const int nquad2 = m_base[2]->GetNumPoints();
490  const int order0 = m_base[0]->GetNumModes ();
491  const int order1 = m_base[1]->GetNumModes ();
492  const int order2 = m_base[2]->GetNumModes ();
493 
494  int i, mode;
495 
496  ASSERTL1(wsp.num_elements() >= nquad1*nquad2*order0 +
497  nquad2*order0*order1,
498  "Insufficient workspace size");
499 
500  Array<OneD, NekDouble> tmp0 = wsp;
501  Array<OneD, NekDouble> tmp1 = wsp + nquad1*nquad2*order0;
502 
503  // Inner product with respect to the '0' direction
504  Blas::Dgemm('T', 'N', nquad1*nquad2, order0, nquad0,
505  1.0, inarray.get(), nquad0,
506  base0.get(), nquad0,
507  0.0, tmp0.get(), nquad1*nquad2);
508 
509  // Inner product with respect to the '1' direction
510  Blas::Dgemm('T', 'N', nquad2*order0, order1, nquad1,
511  1.0, tmp0.get(), nquad1,
512  base1.get(), nquad1,
513  0.0, tmp1.get(), nquad2*order0);
514 
515  // Inner product with respect to the '2' direction
516  for (mode=i=0; i < order0; ++i)
517  {
518  Blas::Dgemm('T', 'N', order2-i, order1, nquad2,
519  1.0, base2.get() + mode*nquad2, nquad2,
520  tmp1.get() + i*nquad2, nquad2*order0,
521  0.0, outarray.get()+mode*order1, order2-i);
522  mode += order2-i;
523  }
524 
525  // Fix top singular vertices; performs phi_{0,q,1} +=
526  // phi_1(xi_1)*phi_q(xi_2)*phi_{01}*phi_r(xi_2).
528  {
529  for (i = 0; i < order1; ++i)
530  {
531  mode = GetMode(0,i,1);
532  outarray[mode] += Blas::Ddot(
533  nquad2, base2.get()+nquad2, 1,
534  tmp1.get()+i*order0*nquad2+nquad2, 1);
535  }
536  }
537  }
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 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
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
#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::StdPrismExp::v_IProductWRTDerivBase ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Inner product of inarray over region with respect to the object's default expansion basis; output in outarray.

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp, and Nektar::LocalRegions::PrismExp.

Definition at line 543 of file StdPrismExp.cpp.

References v_IProductWRTDerivBase_SumFac().

547  {
548  v_IProductWRTDerivBase_SumFac(dir,inarray,outarray);
549  }
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)

◆ v_IProductWRTDerivBase_MatOp()

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

Definition at line 551 of file StdPrismExp.cpp.

References ASSERTL0, Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::StdRegions::eIProductWRTDerivBase0, Nektar::StdRegions::eIProductWRTDerivBase1, Nektar::StdRegions::eIProductWRTDerivBase2, Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdExpansion::GetTotPoints(), and Nektar::StdRegions::StdExpansion::m_ncoeffs.

555  {
556  ASSERTL0(dir >= 0 && dir <= 2, "input dir is out of range");
557 
558  int nq = GetTotPoints();
560 
561  switch (dir)
562  {
563  case 0:
564  mtype = eIProductWRTDerivBase0;
565  break;
566  case 1:
567  mtype = eIProductWRTDerivBase1;
568  break;
569  case 2:
570  mtype = eIProductWRTDerivBase2;
571  break;
572  }
573 
574  StdMatrixKey iprodmatkey(mtype,DetShapeType(),*this);
575  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
576 
577  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
578  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
579  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
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
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
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140

◆ v_IProductWRTDerivBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp, and Nektar::LocalRegions::PrismExp.

Definition at line 581 of file StdPrismExp.cpp.

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

Referenced by v_IProductWRTDerivBase(), and Nektar::StdRegions::StdNodalPrismExp::v_IProductWRTDerivBase_SumFac().

585  {
586  ASSERTL0(dir >= 0 && dir <= 2, "input dir is out of range");
587 
588  int i;
589  int order0 = m_base[0]->GetNumModes ();
590  int order1 = m_base[1]->GetNumModes ();
591  int nquad0 = m_base[0]->GetNumPoints();
592  int nquad1 = m_base[1]->GetNumPoints();
593  int nquad2 = m_base[2]->GetNumPoints();
594 
595  const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
596  const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
597  Array<OneD, NekDouble> gfac0(nquad0);
598  Array<OneD, NekDouble> gfac2(nquad2);
599  Array<OneD, NekDouble> tmp0 (nquad0*nquad1*nquad2);
600  Array<OneD, NekDouble> wsp (order0*nquad2*(nquad1+order1));
601 
602  // set up geometric factor: (1+z0)/2
603  for (i = 0; i < nquad0; ++i)
604  {
605  gfac0[i] = 0.5*(1+z0[i]);
606  }
607 
608  // Set up geometric factor: 2/(1-z2)
609  for (i = 0; i < nquad2; ++i)
610  {
611  gfac2[i] = 2.0/(1-z2[i]);
612  }
613 
614  // Scale first derivative term by gfac2.
615  if (dir != 1)
616  {
617  for (i = 0; i < nquad2; ++i)
618  {
619  Vmath::Smul(nquad0*nquad1,gfac2[i],
620  &inarray[0]+i*nquad0*nquad1,1,
621  &tmp0 [0]+i*nquad0*nquad1,1);
622  }
623  MultiplyByQuadratureMetric(tmp0,tmp0);
624  }
625 
626  switch (dir)
627  {
628  case 0:
629  {
630  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
631  m_base[1]->GetBdata (),
632  m_base[2]->GetBdata (),
633  tmp0,outarray,wsp,
634  true,true,true);
635  break;
636  }
637 
638  case 1:
639  {
640  MultiplyByQuadratureMetric(inarray,tmp0);
641  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata (),
642  m_base[1]->GetDbdata(),
643  m_base[2]->GetBdata (),
644  tmp0,outarray,wsp,
645  true,true,true);
646  break;
647  }
648 
649  case 2:
650  {
651  Array<OneD, NekDouble> tmp1(m_ncoeffs);
652 
653  // Scale eta_1 derivative with gfac0.
654  for(i = 0; i < nquad1*nquad2; ++i)
655  {
656  Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
657  }
658 
659  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
660  m_base[1]->GetBdata(),
661  m_base[2]->GetBdata(),
662  tmp0,tmp1,wsp,
663  true,true,true);
664 
665  MultiplyByQuadratureMetric(inarray, tmp0);
666  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
667  m_base[1]->GetBdata(),
668  m_base[2]->GetDbdata(),
669  tmp0,outarray,wsp,
670  true,true,true);
671 
672  Vmath::Vadd(m_ncoeffs,&tmp1[0],1,&outarray[0],1,&outarray[0],1);
673  break;
674  }
675  }
676  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:945
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
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_IsBoundaryInteriorExpansion()

bool Nektar::StdRegions::StdPrismExp::v_IsBoundaryInteriorExpansion ( )
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1036 of file StdPrismExp.cpp.

References Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

1037  {
1038  return (m_base[0]->GetBasisType() == LibUtilities::eModified_A) &&
1039  (m_base[1]->GetBasisType() == LibUtilities::eModified_A) &&
1041  }
Principle Modified Functions .
Definition: BasisType.h:48
Principle Modified Functions .
Definition: BasisType.h:49
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

◆ v_LocCoordToLocCollapsed()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 685 of file StdPrismExp.cpp.

References Nektar::NekConstants::kNekZeroTol.

688  {
689 
690  if( fabs(xi[2]-1.0) < NekConstants::kNekZeroTol)
691  {
692  // Very top point of the prism
693  eta[0] = -1.0;
694  eta[1] = xi[1];
695  eta[2] = 1.0;
696  }
697  else
698  {
699  // Third basis function collapsed to "pr" direction instead of
700  // "qr" direction
701  eta[2] = xi[2]; // eta_z = xi_z
702  eta[1] = xi[1]; //eta_y = xi_y
703  eta[0] = 2.0*(1.0 + xi[0])/(1.0 - xi[2]) - 1.0;
704  }
705  }
static const NekDouble kNekZeroTol

◆ v_MultiplyByStdQuadratureMetric()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1951 of file StdPrismExp.cpp.

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

1954  {
1955  int i, j;
1956  int nquad0 = m_base[0]->GetNumPoints();
1957  int nquad1 = m_base[1]->GetNumPoints();
1958  int nquad2 = m_base[2]->GetNumPoints();
1959 
1960  const Array<OneD, const NekDouble>& w0 = m_base[0]->GetW();
1961  const Array<OneD, const NekDouble>& w1 = m_base[1]->GetW();
1962  const Array<OneD, const NekDouble>& w2 = m_base[2]->GetW();
1963 
1964  const Array<OneD, const NekDouble>& z2 = m_base[2]->GetZ();
1965 
1966  // Multiply by integration constants in x-direction
1967  for(i = 0; i < nquad1*nquad2; ++i)
1968  {
1969  Vmath::Vmul(nquad0, inarray.get()+i*nquad0, 1,
1970  w0.get(), 1, outarray.get()+i*nquad0,1);
1971  }
1972 
1973  // Multiply by integration constants in y-direction
1974  for(j = 0; j < nquad2; ++j)
1975  {
1976  for(i = 0; i < nquad1; ++i)
1977  {
1978  Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1979  j*nquad0*nquad1,1);
1980  }
1981  }
1982 
1983  // Multiply by integration constants in z-direction; need to
1984  // incorporate factor (1-eta_3)/2 into weights, but only if using
1985  // GLL quadrature points.
1986  switch(m_base[2]->GetPointsType())
1987  {
1988  // (1,0) Jacobi inner product.
1990  for(i = 0; i < nquad2; ++i)
1991  {
1992  Blas::Dscal(nquad0*nquad1, 0.5*w2[i],
1993  &outarray[0]+i*nquad0*nquad1, 1);
1994  }
1995  break;
1996 
1997  default:
1998  for(i = 0; i < nquad2; ++i)
1999  {
2000  Blas::Dscal(nquad0*nquad1,0.5*(1-z2[i])*w2[i],
2001  &outarray[0]+i*nquad0*nquad1,1);
2002  }
2003  break;
2004  }
2005 
2006  }
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:58
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
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::StdPrismExp::v_NumBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 808 of file StdPrismExp.cpp.

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

809  {
812  "BasisType is not a boundary interior form");
815  "BasisType is not a boundary interior form");
818  "BasisType is not a boundary interior form");
819 
820  int P = m_base[0]->GetNumModes();
821  int Q = m_base[1]->GetNumModes();
822  int R = m_base[2]->GetNumModes();
823 
826  }
Principle Modified Functions .
Definition: BasisType.h:48
Principle Modified Functions .
Definition: BasisType.h:49
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:298
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::StdPrismExp::v_NumDGBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 828 of file StdPrismExp.cpp.

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

829  {
832  "BasisType is not a boundary interior form");
835  "BasisType is not a boundary interior form");
838  "BasisType is not a boundary interior form");
839 
840  int P = m_base[0]->GetNumModes()-1;
841  int Q = m_base[1]->GetNumModes()-1;
842  int R = m_base[2]->GetNumModes()-1;
843 
844  return (P+1)*(Q+1) // 1 rect. face on base
845  + 2*(Q+1)*(R+1) // other 2 rect. faces
846  + 2*(R+1) + P*(1 + 2*R - P); // 2 tri. faces
847  }
Principle Modified Functions .
Definition: BasisType.h:48
Principle Modified Functions .
Definition: BasisType.h:49
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::StdPrismExp::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::PrismExp.

Definition at line 99 of file StdPrismExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base, Nektar::NullNekDouble1DArray, Nektar::StdRegions::StdExpansion3D::PhysTensorDeriv(), Vmath::Smul(), and Vmath::Svtvp().

Referenced by v_PhysDeriv(), and v_StdPhysDeriv().

103  {
104  int Qx = m_base[0]->GetNumPoints();
105  int Qy = m_base[1]->GetNumPoints();
106  int Qz = m_base[2]->GetNumPoints();
107  int Qtot = Qx*Qy*Qz;
108 
109  Array<OneD, NekDouble> dEta_bar1(Qtot,0.0);
110 
111  Array<OneD, const NekDouble> eta_x, eta_z;
112  eta_x = m_base[0]->GetZ();
113  eta_z = m_base[2]->GetZ();
114 
115  int i, k;
116 
117  bool Do_1 = (out_dxi1.num_elements() > 0)? true:false;
118  bool Do_3 = (out_dxi3.num_elements() > 0)? true:false;
119 
120  // out_dXi2 is just a tensor derivative so is just passed through
121  if(Do_3)
122  {
123  PhysTensorDeriv(u_physical, dEta_bar1, out_dxi2, out_dxi3);
124  }
125  else if(Do_1)
126  {
127  PhysTensorDeriv(u_physical, dEta_bar1, out_dxi2, NullNekDouble1DArray);
128  }
129  else // case if just require 2nd direction
130  {
132  out_dxi2, NullNekDouble1DArray);
133  }
134 
135  if(Do_1)
136  {
137  for (k = 0; k < Qz; ++k)
138  {
139  Vmath::Smul(Qx*Qy,2.0/(1.0-eta_z[k]),&dEta_bar1[0] + k*Qx*Qy,1,
140  &out_dxi1[0] + k*Qx*Qy,1);
141  }
142  }
143 
144  if(Do_3)
145  {
146  // divide dEta_Bar1 by (1-eta_z)
147  for (k = 0; k < Qz; ++k)
148  {
149  Vmath::Smul(Qx*Qy, 1.0/(1.0-eta_z[k]),&dEta_bar1[0]+k*Qx*Qy,1,
150  &dEta_bar1[0]+k*Qx*Qy,1);
151  }
152 
153  // Multiply dEta_Bar1 by (1+eta_x) and add ot out_dxi3
154  for (i = 0; i < Qx; ++i)
155  {
156  Vmath::Svtvp(Qz*Qy,1.0+eta_x[i],&dEta_bar1[0]+i,Qx,
157  &out_dxi3[0]+i,Qx,&out_dxi3[0]+i,Qx);
158  }
159 
160  }
161  }
static Array< OneD, NekDouble > NullNekDouble1DArray
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:488
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...
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
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_PhysDeriv() [2/2]

void Nektar::StdRegions::StdPrismExp::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 163 of file StdPrismExp.cpp.

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

166  {
167  switch(dir)
168  {
169  case 0:
170  {
171  v_PhysDeriv(inarray, outarray, NullNekDouble1DArray,
173  break;
174  }
175 
176  case 1:
177  {
178  v_PhysDeriv(inarray, NullNekDouble1DArray, outarray,
180  break;
181  }
182 
183  case 2:
184  {
186  NullNekDouble1DArray, outarray);
187  break;
188  }
189 
190  default:
191  {
192  ASSERTL1(false,"input dir is out of range");
193  }
194  break;
195  }
196  }
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: StdPrismExp.cpp:99
#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::StdPrismExp::v_ReduceOrderCoeffs ( int  numMin,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2144 of file StdPrismExp.cpp.

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

2148  {
2149  int nquad0 = m_base[0]->GetNumPoints();
2150  int nquad1 = m_base[1]->GetNumPoints();
2151  int nquad2 = m_base[2]->GetNumPoints();
2152  int nqtot = nquad0*nquad1*nquad2;
2153  int nmodes0 = m_base[0]->GetNumModes();
2154  int nmodes1 = m_base[1]->GetNumModes();
2155  int nmodes2 = m_base[2]->GetNumModes();
2156  int numMax = nmodes0;
2157 
2158  Array<OneD, NekDouble> coeff (m_ncoeffs);
2159  Array<OneD, NekDouble> coeff_tmp1(m_ncoeffs, 0.0);
2160  Array<OneD, NekDouble> phys_tmp (nqtot, 0.0);
2161  Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
2162 
2163 
2164  const LibUtilities::PointsKey Pkey0 = m_base[0]->GetPointsKey();
2165  const LibUtilities::PointsKey Pkey1 = m_base[1]->GetPointsKey();
2166  const LibUtilities::PointsKey Pkey2 = m_base[2]->GetPointsKey();
2167 
2168  LibUtilities::BasisKey bortho0(
2169  LibUtilities::eOrtho_A, nmodes0, Pkey0);
2170  LibUtilities::BasisKey bortho1(
2171  LibUtilities::eOrtho_A, nmodes1, Pkey1);
2172  LibUtilities::BasisKey bortho2(
2173  LibUtilities::eOrtho_B, nmodes2, Pkey2);
2174 
2175  int cnt = 0;
2176  int u = 0;
2177  int i = 0;
2178  StdRegions::StdPrismExpSharedPtr OrthoPrismExp;
2179 
2181  ::AllocateSharedPtr(bortho0, bortho1, bortho2);
2182 
2183  BwdTrans(inarray,phys_tmp);
2184  OrthoPrismExp->FwdTrans(phys_tmp, coeff);
2185 
2186  // filtering
2187  for (u = 0; u < numMin; ++u)
2188  {
2189  for (i = 0; i < numMin; ++i)
2190  {
2191  Vmath::Vcopy(numMin - u, tmp = coeff + cnt, 1,
2192  tmp2 = coeff_tmp1 + cnt, 1);
2193  cnt += numMax - u;
2194  }
2195 
2196  for (i = numMin; i < numMax; ++i)
2197  {
2198  cnt += numMax - u;
2199  }
2200  }
2201 
2202  OrthoPrismExp->BwdTrans(coeff_tmp1, phys_tmp);
2203  StdPrismExp::FwdTrans(phys_tmp, outarray);
2204  }
Principle Orthogonal Functions .
Definition: BasisType.h:46
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
Definition: StdPrismExp.h:257
Principle Orthogonal Functions .
Definition: BasisType.h:45
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
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::StdPrismExp::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 198 of file StdPrismExp.cpp.

References v_PhysDeriv().

202  {
203  StdPrismExp::v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
204  }
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: StdPrismExp.cpp:99

◆ v_StdPhysDeriv() [2/2]

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 206 of file StdPrismExp.cpp.

References v_PhysDeriv().

209  {
210  StdPrismExp::v_PhysDeriv(dir, inarray, outarray);
211  }
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: StdPrismExp.cpp:99

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 2008 of file StdPrismExp.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::eOrtho_B, 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.

2010  {
2011  // Generate an orthonogal expansion
2012  int qa = m_base[0]->GetNumPoints();
2013  int qb = m_base[1]->GetNumPoints();
2014  int qc = m_base[2]->GetNumPoints();
2015  int nmodes_a = m_base[0]->GetNumModes();
2016  int nmodes_b = m_base[1]->GetNumModes();
2017  int nmodes_c = m_base[2]->GetNumModes();
2018  // Declare orthogonal basis.
2019  LibUtilities::PointsKey pa(qa,m_base[0]->GetPointsType());
2020  LibUtilities::PointsKey pb(qb,m_base[1]->GetPointsType());
2021  LibUtilities::PointsKey pc(qc,m_base[2]->GetPointsType());
2022 
2023  LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A,nmodes_a,pa);
2024  LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A,nmodes_b,pb);
2025  LibUtilities::BasisKey Bc(LibUtilities::eOrtho_B,nmodes_c,pc);
2026  StdPrismExp OrthoExp(Ba,Bb,Bc);
2027 
2028  Array<OneD, NekDouble> orthocoeffs(OrthoExp.GetNcoeffs());
2029  int i,j,k,cnt = 0;
2030 
2031  // project onto modal space.
2032  OrthoExp.FwdTrans(array,orthocoeffs);
2033 
2034  if(mkey.ConstFactorExists(eFactorSVVPowerKerDiffCoeff))
2035  {
2036  // Rodrigo's power kernel
2037  NekDouble cutoff = mkey.GetConstFactor(eFactorSVVCutoffRatio);
2038  NekDouble SvvDiffCoeff =
2039  mkey.GetConstFactor(eFactorSVVPowerKerDiffCoeff)*
2040  mkey.GetConstFactor(eFactorSVVDiffCoeff);
2041 
2042  for(int i = 0; i < nmodes_a; ++i)
2043  {
2044  for(int j = 0; j < nmodes_b; ++j)
2045  {
2046  NekDouble fac1 = std::max(
2047  pow((1.0*i)/(nmodes_a-1),cutoff*nmodes_a),
2048  pow((1.0*j)/(nmodes_b-1),cutoff*nmodes_b));
2049 
2050  for(int k = 0; k < nmodes_c-i; ++k)
2051  {
2052  NekDouble fac = std::max(fac1,
2053  pow((1.0*k)/(nmodes_c-1),cutoff*nmodes_c));
2054 
2055  orthocoeffs[cnt] *= SvvDiffCoeff * fac;
2056  cnt++;
2057  }
2058  }
2059  }
2060  }
2061  else if(mkey.ConstFactorExists(eFactorSVVDGKerDiffCoeff)) // Rodrigo/Mansoor's DG Kernel
2062  {
2063  NekDouble SvvDiffCoeff =
2064  mkey.GetConstFactor(eFactorSVVDGKerDiffCoeff)*
2065  mkey.GetConstFactor(eFactorSVVDiffCoeff);
2066 
2067  int max_abc = max(nmodes_a-kSVVDGFiltermodesmin,
2068  nmodes_b-kSVVDGFiltermodesmin);
2069  max_abc = max(max_abc, nmodes_c-kSVVDGFiltermodesmin);
2070  // clamp max_abc
2071  max_abc = max(max_abc,0);
2072  max_abc = min(max_abc,kSVVDGFiltermodesmax-kSVVDGFiltermodesmin);
2073 
2074  for(int i = 0; i < nmodes_a; ++i)
2075  {
2076  for(int j = 0; j < nmodes_b; ++j)
2077  {
2078  int maxij = max(i,j);
2079 
2080  for(int k = 0; k < nmodes_c-i; ++k)
2081  {
2082  int maxijk = max(maxij,k);
2083  maxijk = min(maxijk,kSVVDGFiltermodesmax-1);
2084 
2085  orthocoeffs[cnt] *= SvvDiffCoeff *
2086  kSVVDGFilter[max_abc][maxijk];
2087  cnt++;
2088  }
2089  }
2090  }
2091  }
2092  else
2093  {
2094  // SVV filter paramaters (how much added diffusion relative
2095  // to physical one and fraction of modes from which you
2096  // start applying this added diffusion)
2097  //
2098  NekDouble SvvDiffCoeff = mkey.GetConstFactor(StdRegions::eFactorSVVDiffCoeff);
2099  NekDouble SVVCutOff = mkey.GetConstFactor(StdRegions::eFactorSVVCutoffRatio);
2100 
2101  //Defining the cut of mode
2102  int cutoff_a = (int) (SVVCutOff*nmodes_a);
2103  int cutoff_b = (int) (SVVCutOff*nmodes_b);
2104  int cutoff_c = (int) (SVVCutOff*nmodes_c);
2105  //To avoid the fac[j] from blowing up
2106  NekDouble epsilon = 1;
2107 
2108  int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
2109  NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
2110 
2111  //------"New" Version August 22nd '13--------------------
2112  for(i = 0; i < nmodes_a; ++i)//P
2113  {
2114  for(j = 0; j < nmodes_b; ++j) //Q
2115  {
2116  for(k = 0; k < nmodes_c-i; ++k) //R
2117  {
2118  if(j >= cutoff || i + k >= cutoff)
2119  {
2120  orthocoeffs[cnt] *=
2121  (SvvDiffCoeff*exp(-(i+k-nmodes)*(i+k-nmodes)/
2122  ((NekDouble)((i+k-cutoff+epsilon)*
2123  (i+k-cutoff+epsilon))))*
2124  exp(-(j-nmodes)*(j-nmodes)/
2125  ((NekDouble)((j-cutoff+epsilon)*
2126  (j-cutoff+epsilon)))));
2127  }
2128  else
2129  {
2130  orthocoeffs[cnt] *= 0.0;
2131  }
2132  cnt++;
2133  }
2134  }
2135  }
2136  }
2137 
2138  // backward transform to physical space
2139  OrthoExp.BwdTrans(orthocoeffs,array);
2140  }
const int kSVVDGFiltermodesmax
Definition: StdRegions.hpp:385
const int kSVVDGFiltermodesmin
Definition: StdRegions.hpp:384
Principle Orthogonal Functions .
Definition: BasisType.h:46
Principle Orthogonal Functions .
Definition: BasisType.h:45
double NekDouble
const NekDouble kSVVDGFilter[9][11]
Definition: StdRegions.hpp:387
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