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 (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)=default
 
 ~StdPrismExp () override=default
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion3D
 StdExpansion3D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdExpansion3D ()=default
 
 StdExpansion3D (const StdExpansion3D &T)=default
 
 ~StdExpansion3D () override=default
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
 Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points. More...
 
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
int GetNedges () const
 return the number of edges in 3D expansion More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
void GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor. More...
 
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor. More...
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor. More...
 
virtual ~StdExpansion ()
 Destructor. More...
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion. More...
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis. More...
 
const LibUtilities::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th trace. More...
 
int GetTraceIntNcoeffs (const int i) const
 
int GetTraceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th trace. More...
 
const LibUtilities::BasisKey GetTraceBasisKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
LibUtilities::PointsKey GetTracePointsKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNtraces () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
std::shared_ptr< StdExpansionGetStdExp () const
 
std::shared_ptr< StdExpansionGetLinStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion () const
 
bool IsNodalNonTensorialExp ()
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space. More...
 
void FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 This function integrates the specified function over the domain. More...
 
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion. More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 this function calculates the inner product of a given function f with the different modes of the expansion More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
 
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion More...
 
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point More...
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray)
 
void GetElmtTraceToTraceMap (const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
 
void GetTraceNumModes (const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix \(\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\) More...
 
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
void ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 This function evaluates the first derivative of the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs)
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode)
 This function evaluates the basis function mode mode at a point coords of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
void LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 Convert local collapsed coordinates eta into local cartesian coordinate xi. More...
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_\infty\) error \( |\epsilon|_\infty = \max |u - u_{exact}|\) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_2\) error, \( | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( H^1\) error, \( | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
 This function performs an interpolation from the physical space points provided at input into an array of equispaced points which are not the collapsed coordinate. So for a tetrahedron you will only get a tetrahedral number of values. More...
 
void GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 This function provides the connectivity of local simplices (triangles or tets) to connect the equispaced data points provided by PhysInterpToSimplexEquiSpaced. More...
 
void EquiSpacedToCoeffs (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs a projection/interpolation from the equispaced points sometimes used in post-processing onto the coefficient space. More...
 
template<class T >
std::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
void GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 

Protected Member Functions

void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
 Calculate the derivative of the physical points. More...
 
void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the derivative of the physical points in a given direction. More...
 
void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
 
void v_StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2) override
 
void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Forward transform from physical quadrature space stored in inarray and evaluate the expansion coefficients and store in outarray. More...
 
void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into outarray: More...
 
void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
 
void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2) override
 
void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 Inner product of inarray over region with respect to the object's default expansion basis; output in outarray. More...
 
void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
 
void v_LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
 
void v_GetCoords (Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z) override
 
void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray) override
 
NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode) final
 
void v_GetTraceNumModes (const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2) override
 
NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
int v_GetNverts () const override
 
int v_GetNedges () const override
 
int v_GetNtraces () const override
 
LibUtilities::ShapeType v_DetShapeType () const override
 Return Shape of region, using ShapeType enum list; i.e. prism. More...
 
int v_NumBndryCoeffs () const override
 
int v_NumDGBndryCoeffs () const override
 
int v_GetTraceNcoeffs (const int i) const override
 
int v_GetTraceIntNcoeffs (const int i) const override
 
int v_GetTraceNumPoints (const int i) const override
 
int v_GetEdgeNcoeffs (const int i) const override
 
const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int k) const override
 
LibUtilities::PointsKey v_GetTracePointsKey (const int i, const int j) const override
 
int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset) override
 
bool v_IsBoundaryInteriorExpansion () const override
 
int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false) override
 
void v_GetInteriorMap (Array< OneD, unsigned int > &outarray) override
 
void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray) override
 
void v_GetTraceCoeffMap (const unsigned int fid, Array< OneD, unsigned int > &maparray) override
 
void v_GetElmtTraceToTraceMap (const unsigned int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q) override
 
void v_GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
 
void v_GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
 
DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey) override
 
DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey) override
 
void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
 
void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion3D
NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals) override
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals) override
 
NekDouble v_PhysEvaluate (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
virtual void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)=0
 
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)=0
 
void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
 
NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray) override
 Integrates the specified function over the domain. More...
 
virtual int v_GetNedges (void) const
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
NekDouble BaryTensorDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 
virtual void v_GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
 
void v_GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient, int P, int Q) override
 
void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat) override
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
virtual void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv, NekDouble &deriv2)
 This function performs the barycentric interpolation of the polynomial stored in coord at a point physvals using barycentric interpolation weights in direction. More...
 
template<int DIR>
NekDouble BaryEvaluateBasis (const NekDouble &coord, const int &mode)
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals)
 Helper function to pass an unused value by reference into BaryEvaluate. More...
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv)
 

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

Detailed Description

Class representing a prismatic element in reference space.

Definition at line 44 of file StdPrismExp.h.

Constructor & Destructor Documentation

◆ StdPrismExp() [1/3]

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

Definition at line 43 of file StdPrismExp.cpp.

47 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
48 3, Ba, Bb, Bc),
50 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
51 Ba, Bb, Bc)
52{
53 ASSERTL0(Ba.GetNumModes() <= Bc.GetNumModes(),
54 "order in 'a' direction is higher than order in 'c' direction");
55}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
StdExpansion()
Default Constructor.
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:279

References ASSERTL0, and Nektar::LibUtilities::BasisKey::GetNumModes().

◆ StdPrismExp() [2/3]

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

◆ StdPrismExp() [3/3]

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

◆ ~StdPrismExp()

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

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 1933 of file StdPrismExp.cpp.

1934{
1935 int Q = m_base[1]->GetNumModes() - 1;
1936 int R = m_base[2]->GetNumModes() - 1;
1937
1938 return r + // Skip along stacks (r-direction)
1939 q * (R + 1 - p) + // Skip along columns (q-direction)
1940 (Q + 1) * (p * R + 1 -
1941 (p - 2) * (p - 1) / 2); // Skip along rows (p-direction)
1942}
Array< OneD, LibUtilities::BasisSharedPtr > m_base
std::vector< double > q(NPUPPER *NPUPPER)

References Nektar::StdRegions::StdExpansion::m_base, CellMLToNektar.cellml_metadata::p, and Nektar::UnitTests::q().

Referenced by v_GetBoundaryMap(), v_GetEdgeInteriorToElementMap(), v_GetInteriorMap(), v_GetTraceCoeffMap(), v_GetTraceInteriorToElementMap(), v_GetVertexMap(), and v_IProductWRTBase_SumFacKernel().

◆ v_BwdTrans()

void Nektar::StdRegions::StdPrismExp::v_BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
overrideprotectedvirtual
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.

Definition at line 220 of file StdPrismExp.cpp.

222{
225 "Basis[1] is not a general tensor type");
226
229 "Basis[2] is not a general tensor type");
230
231 if (m_base[0]->Collocation() && m_base[1]->Collocation() &&
232 m_base[2]->Collocation())
233 {
235 m_base[2]->GetNumPoints(),
236 inarray, 1, outarray, 1);
237 }
238 else
239 {
240 StdPrismExp::v_BwdTrans_SumFac(inarray, outarray);
241 }
242}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:156
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:218
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
@ eModified_B
Principle Modified Functions .
Definition: BasisType.h:49
@ eModified_C
Principle Modified Functions .
Definition: BasisType.h:50
@ eOrtho_C
Principle Orthogonal Functions .
Definition: BasisType.h:46
@ eOrtho_B
Principle Orthogonal Functions .
Definition: BasisType.h:44
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

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

◆ v_BwdTrans_SumFac()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 244 of file StdPrismExp.cpp.

246{
247 int nquad1 = m_base[1]->GetNumPoints();
248 int nquad2 = m_base[2]->GetNumPoints();
249 int order0 = m_base[0]->GetNumModes();
250 int order1 = m_base[1]->GetNumModes();
251
252 Array<OneD, NekDouble> wsp(nquad2 * order1 * order0 +
253 nquad1 * nquad2 * order0);
254
255 BwdTrans_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetBdata(),
256 m_base[2]->GetBdata(), inarray, outarray, wsp, true,
257 true, true);
258}
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)

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

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

◆ 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 
)
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 260 of file StdPrismExp.cpp.

269{
270 int i, mode;
271 int nquad0 = m_base[0]->GetNumPoints();
272 int nquad1 = m_base[1]->GetNumPoints();
273 int nquad2 = m_base[2]->GetNumPoints();
274 int nummodes0 = m_base[0]->GetNumModes();
275 int nummodes1 = m_base[1]->GetNumModes();
276 int nummodes2 = m_base[2]->GetNumModes();
277 Array<OneD, NekDouble> tmp0 = wsp;
278 Array<OneD, NekDouble> tmp1 = tmp0 + nquad2 * nummodes1 * nummodes0;
279
280 for (i = mode = 0; i < nummodes0; ++i)
281 {
282 Blas::Dgemm('N', 'N', nquad2, nummodes1, nummodes2 - i, 1.0,
283 base2.get() + mode * nquad2, nquad2,
284 inarray.get() + mode * nummodes1, nummodes2 - i, 0.0,
285 tmp0.get() + i * nquad2 * nummodes1, nquad2);
286 mode += nummodes2 - i;
287 }
288
290 {
291 for (i = 0; i < nummodes1; i++)
292 {
293 Blas::Daxpy(nquad2, inarray[1 + i * nummodes2],
294 base2.get() + nquad2, 1,
295 tmp0.get() + nquad2 * (nummodes1 + i), 1);
296 }
297 }
298
299 for (i = 0; i < nummodes0; i++)
300 {
301 Blas::Dgemm('N', 'T', nquad1, nquad2, nummodes1, 1.0, base1.get(),
302 nquad1, tmp0.get() + i * nquad2 * nummodes1, nquad2, 0.0,
303 tmp1.get() + i * nquad2 * nquad1, nquad1);
304 }
305
306 Blas::Dgemm('N', 'T', nquad0, nquad2 * nquad1, nummodes0, 1.0, base0.get(),
307 nquad0, tmp1.get(), nquad2 * nquad1, 0.0, outarray.get(),
308 nquad0);
309}
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 op(A)[m x k], op(B)[k x n], C[m x n] DGEMM perfo...
Definition: Blas.hpp:383
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:135
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48

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

◆ v_CalcNumberOfCoefficients()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 956 of file StdPrismExp.cpp.

958{
960 nummodes[modes_offset], nummodes[modes_offset + 1],
961 nummodes[modes_offset + 2]);
962
963 modes_offset += 3;
964 return nmodes;
965}

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

◆ v_CreateStdMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 1910 of file StdPrismExp.cpp.

1911{
1912 return v_GenMatrix(mkey);
1913}
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override

References v_GenMatrix().

◆ v_DetShapeType()

LibUtilities::ShapeType Nektar::StdRegions::StdPrismExp::v_DetShapeType ( ) const
overrideprotectedvirtual

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 798 of file StdPrismExp.cpp.

799{
801}

References Nektar::LibUtilities::ePrism.

◆ v_FillMode()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 681 of file StdPrismExp.cpp.

682{
683 Array<OneD, NekDouble> tmp(m_ncoeffs, 0.0);
684 tmp[mode] = 1.0;
685 StdPrismExp::v_BwdTrans(tmp, outarray);
686}
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override

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

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

◆ v_FwdTrans()

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

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

Inputs:

  • inarray: array of physical quadrature points to be transformed

Outputs:

  • outarray: updated array of expansion coefficients.

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 322 of file StdPrismExp.cpp.

324{
325 v_IProductWRTBase(inarray, outarray);
326
327 // Get Mass matrix inverse
328 StdMatrixKey masskey(eInvMass, DetShapeType(), *this);
329 DNekMatSharedPtr matsys = GetStdMatrix(masskey);
330
331 // copy inarray in case inarray == outarray
332 DNekVec in(m_ncoeffs, outarray);
333 DNekVec out(m_ncoeffs, outarray, eWrapper);
334
335 out = (*matsys) * in;
336}
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:603
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:367
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:48
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75

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

◆ v_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 1823 of file StdPrismExp.cpp.

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

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

◆ v_GetBoundaryMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1081 of file StdPrismExp.cpp.

1082{
1085 "BasisType is not a boundary interior form");
1088 "BasisType is not a boundary interior form");
1091 "BasisType is not a boundary interior form");
1092
1093 int P = m_base[0]->GetNumModes() - 1, p;
1094 int Q = m_base[1]->GetNumModes() - 1, q;
1095 int R = m_base[2]->GetNumModes() - 1, r;
1096 int idx = 0;
1097
1098 int nBnd = NumBndryCoeffs();
1099
1100 if (maparray.size() != nBnd)
1101 {
1102 maparray = Array<OneD, unsigned int>(nBnd);
1103 }
1104
1105 // Loop over all boundary modes (in ascending order).
1106 for (p = 0; p <= P; ++p)
1107 {
1108 // First two q-r planes are entirely boundary modes.
1109 if (p <= 1)
1110 {
1111 for (q = 0; q <= Q; ++q)
1112 {
1113 for (r = 0; r <= R - p; ++r)
1114 {
1115 maparray[idx++] = GetMode(p, q, r);
1116 }
1117 }
1118 }
1119 else
1120 {
1121 // Remaining q-r planes contain boundary modes on the two
1122 // left-hand sides and bottom edge.
1123 for (q = 0; q <= Q; ++q)
1124 {
1125 if (q <= 1)
1126 {
1127 for (r = 0; r <= R - p; ++r)
1128 {
1129 maparray[idx++] = GetMode(p, q, r);
1130 }
1131 }
1132 else
1133 {
1134 maparray[idx++] = GetMode(p, q, 0);
1135 }
1136 }
1137 }
1138 }
1139}
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
@ P
Monomial polynomials .
Definition: BasisType.h:62
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:56

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(), Nektar::LibUtilities::P, CellMLToNektar.cellml_metadata::p, and Nektar::UnitTests::q().

◆ v_GetCoords()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 608 of file StdPrismExp.cpp.

611{
612 Array<OneD, const NekDouble> etaBar_x = m_base[0]->GetZ();
613 Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
614 Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
615 int Qx = GetNumPoints(0);
616 int Qy = GetNumPoints(1);
617 int Qz = GetNumPoints(2);
618
619 // Convert collapsed coordinates into cartesian coordinates: eta --> xi
620 for (int k = 0; k < Qz; ++k)
621 {
622 for (int j = 0; j < Qy; ++j)
623 {
624 for (int i = 0; i < Qx; ++i)
625 {
626 int s = i + Qx * (j + Qy * k);
627 xi_x[s] = (1.0 - eta_z[k]) * (1.0 + etaBar_x[i]) / 2.0 - 1.0;
628 xi_y[s] = eta_y[j];
629 xi_z[s] = eta_z[k];
630 }
631 }
632 }
633}

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

◆ v_GetEdgeInteriorToElementMap()

void Nektar::StdRegions::StdPrismExp::v_GetEdgeInteriorToElementMap ( const int  tid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
const Orientation  traceOrient = eDir1FwdDir1_Dir2FwdDir2 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 1518 of file StdPrismExp.cpp.

1521{
1522 int i;
1523 bool signChange;
1524 const int P = m_base[0]->GetNumModes() - 1;
1525 const int Q = m_base[1]->GetNumModes() - 1;
1526 const int R = m_base[2]->GetNumModes() - 1;
1527 const int nEdgeIntCoeffs = v_GetEdgeNcoeffs(eid) - 2;
1528
1529 if (maparray.size() != nEdgeIntCoeffs)
1530 {
1531 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1532 }
1533
1534 if (signarray.size() != nEdgeIntCoeffs)
1535 {
1536 signarray = Array<OneD, int>(nEdgeIntCoeffs, 1);
1537 }
1538 else
1539 {
1540 fill(signarray.get(), signarray.get() + nEdgeIntCoeffs, 1);
1541 }
1542
1543 // If edge is oriented backwards, change sign of modes which have
1544 // degree 2n+1, n >= 1.
1545 signChange = edgeOrient == eBackwards;
1546
1547 switch (eid)
1548 {
1549 case 0:
1550 for (i = 2; i <= P; ++i)
1551 {
1552 maparray[i - 2] = GetMode(i, 0, 0);
1553 }
1554 break;
1555
1556 case 1:
1557 for (i = 2; i <= Q; ++i)
1558 {
1559 maparray[i - 2] = GetMode(1, i, 0);
1560 }
1561 break;
1562
1563 case 2:
1564 // Base quad; reverse direction.
1565 // signChange = !signChange;
1566 for (i = 2; i <= P; ++i)
1567 {
1568 maparray[i - 2] = GetMode(i, 1, 0);
1569 }
1570 break;
1571
1572 case 3:
1573 // Base quad; reverse direction.
1574 // signChange = !signChange;
1575 for (i = 2; i <= Q; ++i)
1576 {
1577 maparray[i - 2] = GetMode(0, i, 0);
1578 }
1579 break;
1580
1581 case 4:
1582 for (i = 2; i <= R; ++i)
1583 {
1584 maparray[i - 2] = GetMode(0, 0, i);
1585 }
1586 break;
1587
1588 case 5:
1589 for (i = 1; i <= R - 1; ++i)
1590 {
1591 maparray[i - 1] = GetMode(1, 0, i);
1592 }
1593 break;
1594
1595 case 6:
1596 for (i = 1; i <= R - 1; ++i)
1597 {
1598 maparray[i - 1] = GetMode(1, 1, i);
1599 }
1600 break;
1601
1602 case 7:
1603 for (i = 2; i <= R; ++i)
1604 {
1605 maparray[i - 2] = GetMode(0, 1, i);
1606 }
1607 break;
1608
1609 case 8:
1610 for (i = 2; i <= Q; ++i)
1611 {
1612 maparray[i - 2] = GetMode(0, i, 1);
1613 }
1614 break;
1615
1616 default:
1617 ASSERTL0(false, "Edge not defined.");
1618 break;
1619 }
1620
1621 if (signChange)
1622 {
1623 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1624 {
1625 signarray[i] = -1;
1626 }
1627 }
1628}
int v_GetEdgeNcoeffs(const int i) const override

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

◆ v_GetEdgeNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 757 of file StdPrismExp.cpp.

758{
759 ASSERTL2(i >= 0 && i <= 8, "edge id is out of range");
760
761 if (i == 0 || i == 2)
762 {
763 return GetBasisNumModes(0);
764 }
765 else if (i == 1 || i == 3 || i == 8)
766 {
767 return GetBasisNumModes(1);
768 }
769 else
770 {
771 return GetBasisNumModes(2);
772 }
773}
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:265
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:169

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

Referenced by v_GetEdgeInteriorToElementMap().

◆ v_GetElmtTraceToTraceMap()

void Nektar::StdRegions::StdPrismExp::v_GetElmtTraceToTraceMap ( const unsigned int  fid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
Orientation  faceOrient,
int  P,
int  Q 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1242 of file StdPrismExp.cpp.

1246{
1248 "Method only implemented if BasisType is identical"
1249 "in x and y directions");
1252 "Method only implemented for Modified_A BasisType"
1253 "(x and y direction) and Modified_B BasisType (z "
1254 "direction)");
1255
1256 int i, j, k, p, r, nFaceCoeffs, idx = 0;
1257 int nummodesA = 0, nummodesB = 0;
1258
1259 switch (fid)
1260 {
1261 case 0:
1262 nummodesA = m_base[0]->GetNumModes();
1263 nummodesB = m_base[1]->GetNumModes();
1264 break;
1265 case 1:
1266 case 3:
1267 nummodesA = m_base[0]->GetNumModes();
1268 nummodesB = m_base[2]->GetNumModes();
1269 break;
1270 case 2:
1271 case 4:
1272 nummodesA = m_base[1]->GetNumModes();
1273 nummodesB = m_base[2]->GetNumModes();
1274 break;
1275 default:
1276 ASSERTL0(false, "fid must be between 0 and 4");
1277 }
1278
1279 if (P == -1)
1280 {
1281 P = nummodesA;
1282 Q = nummodesB;
1283 nFaceCoeffs = GetTraceNcoeffs(fid);
1284 }
1285 else if (fid == 1 || fid == 3)
1286 {
1287 nFaceCoeffs = P * (2 * Q - P + 1) / 2;
1288 }
1289 else
1290 {
1291 nFaceCoeffs = P * Q;
1292 }
1293
1294 // Allocate the map array and sign array; set sign array to ones (+)
1295 if (maparray.size() != nFaceCoeffs)
1296 {
1297 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1298 }
1299
1300 if (signarray.size() != nFaceCoeffs)
1301 {
1302 signarray = Array<OneD, int>(nFaceCoeffs, 1);
1303 }
1304 else
1305 {
1306 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1307 }
1308
1309 int minPA = min(nummodesA, P);
1310 int minQB = min(nummodesB, Q);
1311 // triangular faces
1312 if (fid == 1 || fid == 3)
1313 {
1314 // zero signmap and set maparray to zero if elemental
1315 // modes are not as large as face modesl
1316 idx = 0;
1317 int cnt = 0;
1318
1319 for (j = 0; j < minPA; ++j)
1320 {
1321 // set maparray
1322 for (k = 0; k < minQB - j; ++k, ++cnt)
1323 {
1324 maparray[idx++] = cnt;
1325 }
1326
1327 cnt += nummodesB - minQB;
1328
1329 // idx += nummodesB-j;
1330 for (k = nummodesB - j; k < Q - j; ++k)
1331 {
1332 signarray[idx] = 0.0;
1333 maparray[idx++] = maparray[0];
1334 }
1335 }
1336#if 0 // no required?
1337 for (j = minPA; j < nummodesA; ++j)
1338 {
1339 // set maparray
1340 for (k = 0; k < minQB-j; ++k, ++cnt)
1341 {
1342 maparray[idx++] = cnt;
1343 }
1344
1345 cnt += nummodesB-minQB;
1346
1347 //idx += nummodesB-j;
1348 for (k = nummodesB-j; k < Q-j; ++k)
1349 {
1350 signarray[idx] = 0.0;
1351 maparray[idx++] = maparray[0];
1352 }
1353 }
1354#endif
1355 for (j = nummodesA; j < P; ++j)
1356 {
1357 for (k = 0; k < Q - j; ++k)
1358 {
1359 signarray[idx] = 0.0;
1360 maparray[idx++] = maparray[0];
1361 }
1362 }
1363
1364 // Triangles only have one possible orientation (base
1365 // direction reversed); swap edge modes.
1366 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2)
1367 {
1368 idx = 0;
1369 for (p = 0; p < P; ++p)
1370 {
1371 for (r = 0; r < Q - p; ++r, idx++)
1372 {
1373 if (p > 1)
1374 {
1375 signarray[idx] = p % 2 ? -1 : 1;
1376 }
1377 }
1378 }
1379
1380 swap(maparray[0], maparray[Q]);
1381 for (i = 1; i < Q - 1; ++i)
1382 {
1383 swap(maparray[i + 1], maparray[Q + i]);
1384 }
1385 }
1386 }
1387 else
1388 {
1389 // Set up an array indexing for quads, since the
1390 // ordering may need to be transposed.
1391 Array<OneD, int> arrayindx(nFaceCoeffs, -1);
1392
1393 for (i = 0; i < Q; i++)
1394 {
1395 for (j = 0; j < P; j++)
1396 {
1397 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1398 {
1399 arrayindx[i * P + j] = i * P + j;
1400 }
1401 else
1402 {
1403 arrayindx[i * P + j] = j * Q + i;
1404 }
1405 }
1406 }
1407
1408 // zero signmap and set maparray to zero if elemental
1409 // modes are not as large as face modesl
1410 for (j = 0; j < P; ++j)
1411 {
1412 // set up default maparray
1413 for (k = 0; k < Q; k++)
1414 {
1415 maparray[arrayindx[j + k * P]] = j + k * nummodesA;
1416 }
1417
1418 for (k = nummodesB; k < Q; ++k)
1419 {
1420 signarray[arrayindx[j + k * P]] = 0.0;
1421 maparray[arrayindx[j + k * P]] = maparray[0];
1422 }
1423 }
1424
1425 for (j = nummodesA; j < P; ++j)
1426 {
1427 for (k = 0; k < Q; ++k)
1428 {
1429 signarray[arrayindx[j + k * P]] = 0.0;
1430 maparray[arrayindx[j + k * P]] = maparray[0];
1431 }
1432 }
1433
1434 // The code below is exactly the same as that taken from
1435 // StdHexExp and reverses the 'b' and 'a' directions as
1436 // appropriate (1st and 2nd if statements respectively) in
1437 // quadrilateral faces.
1438 if (faceOrient == eDir1FwdDir1_Dir2BwdDir2 ||
1439 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1440 faceOrient == eDir1BwdDir2_Dir2FwdDir1 ||
1441 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1442 {
1443 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1444 {
1445 for (i = 3; i < Q; i += 2)
1446 {
1447 for (j = 0; j < P; j++)
1448 {
1449 signarray[arrayindx[i * P + j]] *= -1;
1450 }
1451 }
1452
1453 for (i = 0; i < P; i++)
1454 {
1455 swap(maparray[i], maparray[i + P]);
1456 swap(signarray[i], signarray[i + P]);
1457 }
1458 }
1459 else
1460 {
1461 for (i = 0; i < Q; i++)
1462 {
1463 for (j = 3; j < P; j += 2)
1464 {
1465 signarray[arrayindx[i * P + j]] *= -1;
1466 }
1467 }
1468
1469 for (i = 0; i < Q; i++)
1470 {
1471 swap(maparray[i], maparray[i + Q]);
1472 swap(signarray[i], signarray[i + Q]);
1473 }
1474 }
1475 }
1476
1477 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2 ||
1478 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1479 faceOrient == eDir1FwdDir2_Dir2BwdDir1 ||
1480 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1481 {
1482 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1483 {
1484 for (i = 0; i < Q; i++)
1485 {
1486 for (j = 3; j < P; j += 2)
1487 {
1488 signarray[arrayindx[i * P + j]] *= -1;
1489 }
1490 }
1491
1492 for (i = 0; i < Q; i++)
1493 {
1494 swap(maparray[i * P], maparray[i * P + 1]);
1495 swap(signarray[i * P], signarray[i * P + 1]);
1496 }
1497 }
1498 else
1499 {
1500 for (i = 3; i < Q; i += 2)
1501 {
1502 for (j = 0; j < P; j++)
1503 {
1504 signarray[arrayindx[i * P + j]] *= -1;
1505 }
1506 }
1507
1508 for (i = 0; i < P; i++)
1509 {
1510 swap(maparray[i * Q], maparray[i * Q + 1]);
1511 swap(signarray[i * Q], signarray[i * Q + 1]);
1512 }
1513 }
1514 }
1515 }
1516}
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
Definition: StdExpansion.h:261

References ASSERTL0, ASSERTL1, Nektar::StdRegions::eDir1BwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1BwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1BwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1BwdDir2_Dir2FwdDir1, Nektar::StdRegions::eDir1FwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1FwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetTraceNcoeffs(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LibUtilities::P, and CellMLToNektar.cellml_metadata::p.

◆ v_GetInteriorMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1043 of file StdPrismExp.cpp.

1044{
1047 "BasisType is not a boundary interior form");
1050 "BasisType is not a boundary interior form");
1053 "BasisType is not a boundary interior form");
1054
1055 int P = m_base[0]->GetNumModes() - 1, p;
1056 int Q = m_base[1]->GetNumModes() - 1, q;
1057 int R = m_base[2]->GetNumModes() - 1, r;
1058
1059 int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
1060
1061 if (outarray.size() != nIntCoeffs)
1062 {
1063 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1064 }
1065
1066 int idx = 0;
1067
1068 // Loop over all interior modes.
1069 for (p = 2; p <= P; ++p)
1070 {
1071 for (q = 2; q <= Q; ++q)
1072 {
1073 for (r = 1; r <= R - p; ++r)
1074 {
1075 outarray[idx++] = GetMode(p, q, r);
1076 }
1077 }
1078 }
1079}

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(), Nektar::LibUtilities::P, CellMLToNektar.cellml_metadata::p, and Nektar::UnitTests::q().

◆ v_GetNedges()

int Nektar::StdRegions::StdPrismExp::v_GetNedges ( void  ) const
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 784 of file StdPrismExp.cpp.

785{
786 return 9;
787}

◆ v_GetNtraces()

int Nektar::StdRegions::StdPrismExp::v_GetNtraces ( ) const
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 789 of file StdPrismExp.cpp.

790{
791 return 5;
792}

◆ v_GetNverts()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 779 of file StdPrismExp.cpp.

780{
781 return 6;
782}

◆ v_GetTraceBasisKey()

const LibUtilities::BasisKey Nektar::StdRegions::StdPrismExp::v_GetTraceBasisKey ( const int  i,
const int  k 
) const
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 921 of file StdPrismExp.cpp.

923{
924 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
925 ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
926
927 switch (i)
928 {
929 case 0:
930 {
932 m_base[k]->GetNumPoints(),
933 m_base[k]->GetNumModes());
934 }
935 case 2:
936 case 4:
937 {
938 return EvaluateQuadFaceBasisKey(k, m_base[k + 1]->GetBasisType(),
939 m_base[k + 1]->GetNumPoints(),
940 m_base[k + 1]->GetNumModes());
941 }
942 case 1:
943 case 3:
944 {
945 return EvaluateTriFaceBasisKey(k, m_base[2 * k]->GetBasisType(),
946 m_base[2 * k]->GetNumPoints(),
947 m_base[2 * k]->GetNumModes());
948 }
949 break;
950 }
951
952 // Should never get here.
954}
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
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)

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

◆ v_GetTraceCoeffMap()

void Nektar::StdRegions::StdPrismExp::v_GetTraceCoeffMap ( const unsigned int  fid,
Array< OneD, unsigned int > &  maparray 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1141 of file StdPrismExp.cpp.

1143{
1145 "Method only implemented if BasisType is identical"
1146 "in x and y directions");
1149 "Method only implemented for Modified_A BasisType"
1150 "(x and y direction) and Modified_B BasisType (z "
1151 "direction)");
1152 int p, q, r, idx = 0;
1153 int P = 0, Q = 0;
1154
1155 switch (fid)
1156 {
1157 case 0:
1158 P = m_base[0]->GetNumModes();
1159 Q = m_base[1]->GetNumModes();
1160 break;
1161 case 1:
1162 case 3:
1163 P = m_base[0]->GetNumModes();
1164 Q = m_base[2]->GetNumModes();
1165 break;
1166 case 2:
1167 case 4:
1168 P = m_base[1]->GetNumModes();
1169 Q = m_base[2]->GetNumModes();
1170 break;
1171 default:
1172 ASSERTL0(false, "fid must be between 0 and 4");
1173 }
1174
1175 if (maparray.size() != P * Q)
1176 {
1177 maparray = Array<OneD, unsigned int>(P * Q);
1178 }
1179
1180 // Set up ordering inside each 2D face. Also for triangular faces,
1181 // populate signarray.
1182 switch (fid)
1183 {
1184 case 0: // Bottom quad
1185 for (q = 0; q < Q; ++q)
1186 {
1187 for (p = 0; p < P; ++p)
1188 {
1189 maparray[q * P + p] = GetMode(p, q, 0);
1190 }
1191 }
1192 break;
1193 case 1: // Left triangle
1194 for (p = 0; p < P; ++p)
1195 {
1196 for (r = 0; r < Q - p; ++r)
1197 {
1198 maparray[idx++] = GetMode(p, 0, r);
1199 }
1200 }
1201 break;
1202 case 2: // Slanted quad
1203 for (q = 0; q < P; ++q)
1204 {
1205 maparray[q] = GetMode(1, q, 0);
1206 }
1207 for (q = 0; q < P; ++q)
1208 {
1209 maparray[P + q] = GetMode(0, q, 1);
1210 }
1211 for (r = 1; r < Q - 1; ++r)
1212 {
1213 for (q = 0; q < P; ++q)
1214 {
1215 maparray[(r + 1) * P + q] = GetMode(1, q, r);
1216 }
1217 }
1218 break;
1219 case 3: // Right triangle
1220 for (p = 0; p < P; ++p)
1221 {
1222 for (r = 0; r < Q - p; ++r)
1223 {
1224 maparray[idx++] = GetMode(p, 1, r);
1225 }
1226 }
1227 break;
1228 case 4: // Rear quad
1229 for (r = 0; r < Q; ++r)
1230 {
1231 for (q = 0; q < P; ++q)
1232 {
1233 maparray[r * P + q] = GetMode(0, q, r);
1234 }
1235 }
1236 break;
1237 default:
1238 ASSERTL0(false, "Face to element map unavailable.");
1239 }
1240}

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::StdRegions::StdExpansion::GetBasisType(), GetMode(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LibUtilities::P, CellMLToNektar.cellml_metadata::p, and Nektar::UnitTests::q().

◆ v_GetTraceInteriorToElementMap()

void Nektar::StdRegions::StdPrismExp::v_GetTraceInteriorToElementMap ( const int  tid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
const Orientation  traceOrient = eDir1FwdDir1_Dir2FwdDir2 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1630 of file StdPrismExp.cpp.

1633{
1634 const int P = m_base[0]->GetNumModes() - 1;
1635 const int Q = m_base[1]->GetNumModes() - 1;
1636 const int R = m_base[2]->GetNumModes() - 1;
1637 const int nFaceIntCoeffs = v_GetTraceIntNcoeffs(fid);
1638 int p, q, r, idx = 0;
1639 int nummodesA = 0;
1640 int nummodesB = 0;
1641 int i = 0;
1642 int j = 0;
1643
1644 if (maparray.size() != nFaceIntCoeffs)
1645 {
1646 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1647 }
1648
1649 if (signarray.size() != nFaceIntCoeffs)
1650 {
1651 signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1652 }
1653 else
1654 {
1655 fill(signarray.get(), signarray.get() + nFaceIntCoeffs, 1);
1656 }
1657
1658 // Set up an array indexing for quad faces, since the ordering may
1659 // need to be transposed depending on orientation.
1660 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1661 if (fid != 1 && fid != 3)
1662 {
1663 if (fid == 0) // Base quad
1664 {
1665 nummodesA = P - 1;
1666 nummodesB = Q - 1;
1667 }
1668 else // front and back quad
1669 {
1670 nummodesA = Q - 1;
1671 nummodesB = R - 1;
1672 }
1673
1674 for (i = 0; i < nummodesB; i++)
1675 {
1676 for (j = 0; j < nummodesA; j++)
1677 {
1678 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1679 {
1680 arrayindx[i * nummodesA + j] = i * nummodesA + j;
1681 }
1682 else
1683 {
1684 arrayindx[i * nummodesA + j] = j * nummodesB + i;
1685 }
1686 }
1687 }
1688 }
1689
1690 switch (fid)
1691 {
1692 case 0: // Bottom quad
1693 for (q = 2; q <= Q; ++q)
1694 {
1695 for (p = 2; p <= P; ++p)
1696 {
1697 maparray[arrayindx[(q - 2) * nummodesA + (p - 2)]] =
1698 GetMode(p, q, 0);
1699 }
1700 }
1701 break;
1702
1703 case 1: // Left triangle
1704 for (p = 2; p <= P; ++p)
1705 {
1706 for (r = 1; r <= R - p; ++r)
1707 {
1708 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2)
1709 {
1710 signarray[idx] = p % 2 ? -1 : 1;
1711 }
1712 maparray[idx++] = GetMode(p, 0, r);
1713 }
1714 }
1715 break;
1716
1717 case 2: // Slanted quad
1718 for (r = 1; r <= R - 1; ++r)
1719 {
1720 for (q = 2; q <= Q; ++q)
1721 {
1722 maparray[arrayindx[(r - 1) * nummodesA + (q - 2)]] =
1723 GetMode(1, q, r);
1724 }
1725 }
1726 break;
1727
1728 case 3: // Right triangle
1729 for (p = 2; p <= P; ++p)
1730 {
1731 for (r = 1; r <= R - p; ++r)
1732 {
1733 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2)
1734 {
1735 signarray[idx] = p % 2 ? -1 : 1;
1736 }
1737 maparray[idx++] = GetMode(p, 1, r);
1738 }
1739 }
1740 break;
1741
1742 case 4: // Back quad
1743 for (r = 2; r <= R; ++r)
1744 {
1745 for (q = 2; q <= Q; ++q)
1746 {
1747 maparray[arrayindx[(r - 2) * nummodesA + (q - 2)]] =
1748 GetMode(0, q, r);
1749 }
1750 }
1751 break;
1752
1753 default:
1754 ASSERTL0(false, "Face interior map not available.");
1755 }
1756
1757 // Triangular faces are processed in the above switch loop; for
1758 // remaining quad faces, set up orientation if necessary.
1759 if (fid == 1 || fid == 3)
1760 {
1761 return;
1762 }
1763
1764 if (faceOrient == eDir1FwdDir1_Dir2BwdDir2 ||
1765 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1766 faceOrient == eDir1BwdDir2_Dir2FwdDir1 ||
1767 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1768 {
1769 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1770 {
1771 for (i = 1; i < nummodesB; i += 2)
1772 {
1773 for (j = 0; j < nummodesA; j++)
1774 {
1775 signarray[arrayindx[i * nummodesA + j]] *= -1;
1776 }
1777 }
1778 }
1779 else
1780 {
1781 for (i = 0; i < nummodesB; i++)
1782 {
1783 for (j = 1; j < nummodesA; j += 2)
1784 {
1785 signarray[arrayindx[i * nummodesA + j]] *= -1;
1786 }
1787 }
1788 }
1789 }
1790
1791 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2 ||
1792 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1793 faceOrient == eDir1FwdDir2_Dir2BwdDir1 ||
1794 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1795 {
1796 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1797 {
1798 for (i = 0; i < nummodesB; i++)
1799 {
1800 for (j = 1; j < nummodesA; j += 2)
1801 {
1802 signarray[arrayindx[i * nummodesA + j]] *= -1;
1803 }
1804 }
1805 }
1806 else
1807 {
1808 for (i = 1; i < nummodesB; i += 2)
1809 {
1810 for (j = 0; j < nummodesA; j++)
1811 {
1812 signarray[arrayindx[i * nummodesA + j]] *= -1;
1813 }
1814 }
1815 }
1816 }
1817}
int v_GetTraceIntNcoeffs(const int i) const override

References ASSERTL0, Nektar::StdRegions::eDir1BwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1BwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1BwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1BwdDir2_Dir2FwdDir1, Nektar::StdRegions::eDir1FwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1FwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, GetMode(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LibUtilities::P, CellMLToNektar.cellml_metadata::p, Nektar::UnitTests::q(), and v_GetTraceIntNcoeffs().

◆ v_GetTraceIntNcoeffs()

int Nektar::StdRegions::StdPrismExp::v_GetTraceIntNcoeffs ( const int  i) const
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 861 of file StdPrismExp.cpp.

862{
863 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
864
865 int Pi = GetBasisNumModes(0) - 2;
866 int Qi = GetBasisNumModes(1) - 2;
867 int Ri = GetBasisNumModes(2) - 2;
868
869 if (i == 0)
870 {
871 return Pi * Qi;
872 }
873 else if (i == 1 || i == 3)
874 {
875 return Pi * (2 * Ri - Pi - 1) / 2;
876 }
877 else
878 {
879 return Qi * Ri;
880 }
881}

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

Referenced by v_GetTraceInteriorToElementMap().

◆ v_GetTraceNcoeffs()

int Nektar::StdRegions::StdPrismExp::v_GetTraceNcoeffs ( const int  i) const
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 843 of file StdPrismExp.cpp.

844{
845 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
846 if (i == 0)
847 {
848 return GetBasisNumModes(0) * GetBasisNumModes(1);
849 }
850 else if (i == 1 || i == 3)
851 {
852 int P = GetBasisNumModes(0) - 1, Q = GetBasisNumModes(2) - 1;
853 return Q + 1 + (P * (1 + 2 * Q - P)) / 2;
854 }
855 else
856 {
857 return GetBasisNumModes(1) * GetBasisNumModes(2);
858 }
859}

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

◆ v_GetTraceNumModes()

void Nektar::StdRegions::StdPrismExp::v_GetTraceNumModes ( const int  fid,
int &  numModes0,
int &  numModes1,
Orientation  faceOrient = eDir1FwdDir1_Dir2FwdDir2 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 719 of file StdPrismExp.cpp.

721{
722 int nummodes[3] = {m_base[0]->GetNumModes(), m_base[1]->GetNumModes(),
723 m_base[2]->GetNumModes()};
724 switch (fid)
725 {
726 // base quad
727 case 0:
728 {
729 numModes0 = nummodes[0];
730 numModes1 = nummodes[1];
731 }
732 break;
733 // front and back quad
734 case 2:
735 case 4:
736 {
737 numModes0 = nummodes[1];
738 numModes1 = nummodes[2];
739 }
740 break;
741 // triangles
742 case 1:
743 case 3:
744 {
745 numModes0 = nummodes[0];
746 numModes1 = nummodes[2];
747 }
748 break;
749 }
750
751 if (faceOrient >= eDir1FwdDir2_Dir2FwdDir1)
752 {
753 std::swap(numModes0, numModes1);
754 }
755}

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

◆ v_GetTraceNumPoints()

int Nektar::StdRegions::StdPrismExp::v_GetTraceNumPoints ( const int  i) const
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 883 of file StdPrismExp.cpp.

884{
885 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
886
887 if (i == 0)
888 {
889 return m_base[0]->GetNumPoints() * m_base[1]->GetNumPoints();
890 }
891 else if (i == 1 || i == 3)
892 {
893 return m_base[0]->GetNumPoints() * m_base[2]->GetNumPoints();
894 }
895 else
896 {
897 return m_base[1]->GetNumPoints() * m_base[2]->GetNumPoints();
898 }
899}

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

◆ v_GetTracePointsKey()

LibUtilities::PointsKey Nektar::StdRegions::StdPrismExp::v_GetTracePointsKey ( const int  i,
const int  j 
) const
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 901 of file StdPrismExp.cpp.

903{
904 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
905 ASSERTL2(j == 0 || j == 1, "face direction is out of range");
906
907 if (i == 0)
908 {
909 return m_base[j]->GetPointsKey();
910 }
911 else if (i == 1 || i == 3)
912 {
913 return m_base[2 * j]->GetPointsKey();
914 }
915 else
916 {
917 return m_base[j + 1]->GetPointsKey();
918 }
919}

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

◆ v_GetVertexMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 978 of file StdPrismExp.cpp.

979{
983 "Mapping not defined for this type of basis");
984
985 int l = 0;
986
987 if (useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
988 {
989 switch (vId)
990 {
991 case 0:
992 l = GetMode(0, 0, 0);
993 break;
994 case 1:
995 l = GetMode(0, 0, 1);
996 break;
997 case 2:
998 l = GetMode(0, 1, 0);
999 break;
1000 case 3:
1001 l = GetMode(0, 1, 1);
1002 break;
1003 case 4:
1004 l = GetMode(1, 0, 0);
1005 break;
1006 case 5:
1007 l = GetMode(1, 1, 0);
1008 break;
1009 default:
1010 ASSERTL0(false, "local vertex id must be between 0 and 5");
1011 }
1012 }
1013 else
1014 {
1015 switch (vId)
1016 {
1017 case 0:
1018 l = GetMode(0, 0, 0);
1019 break;
1020 case 1:
1021 l = GetMode(1, 0, 0);
1022 break;
1023 case 2:
1024 l = GetMode(1, 1, 0);
1025 break;
1026 case 3:
1027 l = GetMode(0, 1, 0);
1028 break;
1029 case 4:
1030 l = GetMode(0, 0, 1);
1031 break;
1032 case 5:
1033 l = GetMode(0, 1, 1);
1034 break;
1035 default:
1036 ASSERTL0(false, "local vertex id must be between 0 and 5");
1037 }
1038 }
1039
1040 return l;
1041}

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

◆ v_IProductWRTBase()

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

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

\( \begin{array}{rcl} I_{pqr} = (\phi_{pqr}, u)_{\delta} & = & \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \sum_{k=0}^{nq_2} \psi_{p}^{a} (\bar \eta_{1i}) \psi_{q}^{a} (\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::LocalRegions::PrismExp.

Definition at line 368 of file StdPrismExp.cpp.

370{
373 "Basis[1] is not a general tensor type");
374
377 "Basis[2] is not a general tensor type");
378
379 if (m_base[0]->Collocation() && m_base[1]->Collocation())
380 {
381 MultiplyByQuadratureMetric(inarray, outarray);
382 }
383 else
384 {
385 StdPrismExp::v_IProductWRTBase_SumFac(inarray, outarray);
386 }
387}
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:723
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override

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

◆ v_IProductWRTBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 389 of file StdPrismExp.cpp.

392{
393 int nquad1 = m_base[1]->GetNumPoints();
394 int nquad2 = m_base[2]->GetNumPoints();
395 int order0 = m_base[0]->GetNumModes();
396 int order1 = m_base[1]->GetNumModes();
397
398 Array<OneD, NekDouble> wsp(order0 * nquad2 * (nquad1 + order1));
399
400 if (multiplybyweights)
401 {
402 Array<OneD, NekDouble> tmp(inarray.size());
403
404 MultiplyByQuadratureMetric(inarray, tmp);
406 m_base[0]->GetBdata(), m_base[1]->GetBdata(), m_base[2]->GetBdata(),
407 tmp, outarray, wsp, true, true, true);
408 }
409 else
410 {
412 m_base[0]->GetBdata(), m_base[1]->GetBdata(), m_base[2]->GetBdata(),
413 inarray, outarray, wsp, true, true, true);
414 }
415}
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)

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

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

◆ 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 
)
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 417 of file StdPrismExp.cpp.

426{
427 // Interior prism implementation based on Spen's book page
428 // 119. and 608.
429 const int nquad0 = m_base[0]->GetNumPoints();
430 const int nquad1 = m_base[1]->GetNumPoints();
431 const int nquad2 = m_base[2]->GetNumPoints();
432 const int order0 = m_base[0]->GetNumModes();
433 const int order1 = m_base[1]->GetNumModes();
434 const int order2 = m_base[2]->GetNumModes();
435
436 int i, mode;
437
438 ASSERTL1(wsp.size() >= nquad1 * nquad2 * order0 + nquad2 * order0 * order1,
439 "Insufficient workspace size");
440
441 Array<OneD, NekDouble> tmp0 = wsp;
442 Array<OneD, NekDouble> tmp1 = wsp + nquad1 * nquad2 * order0;
443
444 // Inner product with respect to the '0' direction
445 Blas::Dgemm('T', 'N', nquad1 * nquad2, order0, nquad0, 1.0, inarray.get(),
446 nquad0, base0.get(), nquad0, 0.0, tmp0.get(), nquad1 * nquad2);
447
448 // Inner product with respect to the '1' direction
449 Blas::Dgemm('T', 'N', nquad2 * order0, order1, nquad1, 1.0, tmp0.get(),
450 nquad1, base1.get(), nquad1, 0.0, tmp1.get(), nquad2 * order0);
451
452 // Inner product with respect to the '2' direction
453 for (mode = i = 0; i < order0; ++i)
454 {
455 Blas::Dgemm('T', 'N', order2 - i, order1, nquad2, 1.0,
456 base2.get() + mode * nquad2, nquad2,
457 tmp1.get() + i * nquad2, nquad2 * order0, 0.0,
458 outarray.get() + mode * order1, order2 - i);
459 mode += order2 - i;
460 }
461
462 // Fix top singular vertices; performs phi_{0,q,1} +=
463 // phi_1(xi_1)*phi_q(xi_2)*phi_{01}*phi_r(xi_2).
465 {
466 for (i = 0; i < order1; ++i)
467 {
468 mode = GetMode(0, i, 1);
469 outarray[mode] +=
470 Blas::Ddot(nquad2, base2.get() + nquad2, 1,
471 tmp1.get() + i * order0 * nquad2 + nquad2, 1);
472 }
473 }
474}
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:163

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

◆ v_IProductWRTDerivBase()

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

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::LocalRegions::PrismExp.

Definition at line 480 of file StdPrismExp.cpp.

483{
484 v_IProductWRTDerivBase_SumFac(dir, inarray, outarray);
485}
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override

References v_IProductWRTDerivBase_SumFac().

◆ v_IProductWRTDerivBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 487 of file StdPrismExp.cpp.

490{
491 ASSERTL0(dir >= 0 && dir <= 2, "input dir is out of range");
492
493 int i;
494 int order0 = m_base[0]->GetNumModes();
495 int order1 = m_base[1]->GetNumModes();
496 int nquad0 = m_base[0]->GetNumPoints();
497 int nquad1 = m_base[1]->GetNumPoints();
498 int nquad2 = m_base[2]->GetNumPoints();
499
500 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
501 const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
502 Array<OneD, NekDouble> gfac0(nquad0);
503 Array<OneD, NekDouble> gfac2(nquad2);
504 Array<OneD, NekDouble> tmp0(nquad0 * nquad1 * nquad2);
505 Array<OneD, NekDouble> wsp(order0 * nquad2 * (nquad1 + order1));
506
507 // set up geometric factor: (1+z0)/2
508 for (i = 0; i < nquad0; ++i)
509 {
510 gfac0[i] = 0.5 * (1 + z0[i]);
511 }
512
513 // Set up geometric factor: 2/(1-z2)
514 for (i = 0; i < nquad2; ++i)
515 {
516 gfac2[i] = 2.0 / (1 - z2[i]);
517 }
518
519 // Scale first derivative term by gfac2.
520 if (dir != 1)
521 {
522 for (i = 0; i < nquad2; ++i)
523 {
524 Vmath::Smul(nquad0 * nquad1, gfac2[i],
525 &inarray[0] + i * nquad0 * nquad1, 1,
526 &tmp0[0] + i * nquad0 * nquad1, 1);
527 }
528 MultiplyByQuadratureMetric(tmp0, tmp0);
529 }
530
531 switch (dir)
532 {
533 case 0:
534 {
536 m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
537 m_base[2]->GetBdata(), tmp0, outarray, wsp, true, true, true);
538 break;
539 }
540 case 1:
541 {
542 MultiplyByQuadratureMetric(inarray, tmp0);
544 m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
545 m_base[2]->GetBdata(), tmp0, outarray, wsp, true, true, true);
546 break;
547 }
548
549 case 2:
550 {
551 Array<OneD, NekDouble> tmp1(m_ncoeffs);
552
553 // Scale eta_1 derivative with gfac0.
554 for (i = 0; i < nquad1 * nquad2; ++i)
555 {
556 Vmath::Vmul(nquad0, &gfac0[0], 1, &tmp0[0] + i * nquad0, 1,
557 &tmp0[0] + i * nquad0, 1);
558 }
559
561 m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
562 m_base[2]->GetBdata(), tmp0, tmp1, wsp, true, true, true);
563
564 MultiplyByQuadratureMetric(inarray, tmp0);
566 m_base[0]->GetBdata(), m_base[1]->GetBdata(),
567 m_base[2]->GetDbdata(), tmp0, outarray, wsp, true, true, true);
568
569 Vmath::Vadd(m_ncoeffs, &tmp1[0], 1, &outarray[0], 1, &outarray[0],
570 1);
571 break;
572 }
573 }
574}
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.hpp:72
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.hpp:180

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

◆ v_IsBoundaryInteriorExpansion()

bool Nektar::StdRegions::StdPrismExp::v_IsBoundaryInteriorExpansion ( ) const
overrideprotectedvirtual

◆ v_LocCollapsedToLocCoord()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 600 of file StdPrismExp.cpp.

602{
603 xi[0] = (1.0 + eta[0]) * (1.0 - eta[2]) * 0.5 - 1.0;
604 xi[1] = eta[1];
605 xi[2] = eta[2];
606}

◆ v_LocCoordToLocCollapsed()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 580 of file StdPrismExp.cpp.

582{
583 NekDouble d2 = 1.0 - xi[2];
584 if (fabs(d2) < NekConstants::kNekZeroTol)
585 {
586 if (d2 >= 0.)
587 {
589 }
590 else
591 {
593 }
594 }
595 eta[2] = xi[2]; // eta_z = xi_z
596 eta[1] = xi[1]; // eta_y = xi_y
597 eta[0] = 2.0 * (1.0 + xi[0]) / d2 - 1.0;
598}
static const NekDouble kNekZeroTol

References Nektar::NekConstants::kNekZeroTol.

◆ v_MultiplyByStdQuadratureMetric()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1944 of file StdPrismExp.cpp.

1947{
1948 int i, j;
1949 int nquad0 = m_base[0]->GetNumPoints();
1950 int nquad1 = m_base[1]->GetNumPoints();
1951 int nquad2 = m_base[2]->GetNumPoints();
1952
1953 const Array<OneD, const NekDouble> &w0 = m_base[0]->GetW();
1954 const Array<OneD, const NekDouble> &w1 = m_base[1]->GetW();
1955 const Array<OneD, const NekDouble> &w2 = m_base[2]->GetW();
1956
1957 const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
1958
1959 // Multiply by integration constants in x-direction
1960 for (i = 0; i < nquad1 * nquad2; ++i)
1961 {
1962 Vmath::Vmul(nquad0, inarray.get() + i * nquad0, 1, w0.get(), 1,
1963 outarray.get() + i * nquad0, 1);
1964 }
1965
1966 // Multiply by integration constants in y-direction
1967 for (j = 0; j < nquad2; ++j)
1968 {
1969 for (i = 0; i < nquad1; ++i)
1970 {
1971 Blas::Dscal(nquad0, w1[i],
1972 &outarray[0] + i * nquad0 + j * nquad0 * nquad1, 1);
1973 }
1974 }
1975
1976 // Multiply by integration constants in z-direction; need to
1977 // incorporate factor (1-eta_3)/2 into weights, but only if using
1978 // GLL quadrature points.
1979 switch (m_base[2]->GetPointsType())
1980 {
1981 // (1,0) Jacobi inner product.
1982 case LibUtilities::eGaussRadauMAlpha1Beta0:
1983 for (i = 0; i < nquad2; ++i)
1984 {
1985 Blas::Dscal(nquad0 * nquad1, 0.5 * w2[i],
1986 &outarray[0] + i * nquad0 * nquad1, 1);
1987 }
1988 break;
1989
1990 default:
1991 for (i = 0; i < nquad2; ++i)
1992 {
1993 Blas::Dscal(nquad0 * nquad1, 0.5 * (1 - z2[i]) * w2[i],
1994 &outarray[0] + i * nquad0 * nquad1, 1);
1995 }
1996 break;
1997 }
1998}
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:205
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:149

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

◆ v_NumBndryCoeffs()

int Nektar::StdRegions::StdPrismExp::v_NumBndryCoeffs ( ) const
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 803 of file StdPrismExp.cpp.

804{
807 "BasisType is not a boundary interior form");
810 "BasisType is not a boundary interior form");
813 "BasisType is not a boundary interior form");
814
815 int P = m_base[0]->GetNumModes();
816 int Q = m_base[1]->GetNumModes();
817 int R = m_base[2]->GetNumModes();
818
820}
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:290

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 Nektar::LibUtilities::P.

◆ v_NumDGBndryCoeffs()

int Nektar::StdRegions::StdPrismExp::v_NumDGBndryCoeffs ( ) const
overrideprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 822 of file StdPrismExp.cpp.

823{
826 "BasisType is not a boundary interior form");
829 "BasisType is not a boundary interior form");
832 "BasisType is not a boundary interior form");
833
834 int P = m_base[0]->GetNumModes() - 1;
835 int Q = m_base[1]->GetNumModes() - 1;
836 int R = m_base[2]->GetNumModes() - 1;
837
838 return (P + 1) * (Q + 1) // 1 rect. face on base
839 + 2 * (Q + 1) * (R + 1) // other 2 rect. faces
840 + 2 * (R + 1) + P * (1 + 2 * R - P); // 2 tri. faces
841}

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

◆ 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 
)
overrideprotectedvirtual

Calculate the derivative of the physical points.

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

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 75 of file StdPrismExp.cpp.

79{
80 int Qx = m_base[0]->GetNumPoints();
81 int Qy = m_base[1]->GetNumPoints();
82 int Qz = m_base[2]->GetNumPoints();
83 int Qtot = Qx * Qy * Qz;
84
85 Array<OneD, NekDouble> dEta_bar1(Qtot, 0.0);
86
87 Array<OneD, const NekDouble> eta_x, eta_z;
88 eta_x = m_base[0]->GetZ();
89 eta_z = m_base[2]->GetZ();
90
91 int i, k;
92
93 bool Do_1 = (out_dxi1.size() > 0) ? true : false;
94 bool Do_3 = (out_dxi3.size() > 0) ? true : false;
95
96 // out_dXi2 is just a tensor derivative so is just passed through
97 if (Do_3)
98 {
99 PhysTensorDeriv(u_physical, dEta_bar1, out_dxi2, out_dxi3);
100 }
101 else if (Do_1)
102 {
103 PhysTensorDeriv(u_physical, dEta_bar1, out_dxi2, NullNekDouble1DArray);
104 }
105 else // case if just require 2nd direction
106 {
107 PhysTensorDeriv(u_physical, NullNekDouble1DArray, out_dxi2,
109 }
110
111 if (Do_1)
112 {
113 for (k = 0; k < Qz; ++k)
114 {
115 Vmath::Smul(Qx * Qy, 2.0 / (1.0 - eta_z[k]),
116 &dEta_bar1[0] + k * Qx * Qy, 1,
117 &out_dxi1[0] + k * Qx * Qy, 1);
118 }
119 }
120
121 if (Do_3)
122 {
123 // divide dEta_Bar1 by (1-eta_z)
124 for (k = 0; k < Qz; ++k)
125 {
126 Vmath::Smul(Qx * Qy, 1.0 / (1.0 - eta_z[k]),
127 &dEta_bar1[0] + k * Qx * Qy, 1,
128 &dEta_bar1[0] + k * Qx * Qy, 1);
129 }
130
131 // Multiply dEta_Bar1 by (1+eta_x) and add ot out_dxi3
132 for (i = 0; i < Qx; ++i)
133 {
134 Vmath::Svtvp(Qz * Qy, 1.0 + eta_x[i], &dEta_bar1[0] + i, Qx,
135 &out_dxi3[0] + i, Qx, &out_dxi3[0] + i, Qx);
136 }
137 }
138}
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.
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.hpp:396

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

Referenced by v_PhysDeriv(), and v_StdPhysDeriv().

◆ v_PhysDeriv() [2/2]

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

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

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 140 of file StdPrismExp.cpp.

143{
144 switch (dir)
145 {
146 case 0:
147 {
148 v_PhysDeriv(inarray, outarray, NullNekDouble1DArray,
150 break;
151 }
152
153 case 1:
154 {
155 v_PhysDeriv(inarray, NullNekDouble1DArray, outarray,
157 break;
158 }
159
160 case 2:
161 {
163 outarray);
164 break;
165 }
166
167 default:
168 {
169 ASSERTL1(false, "input dir is out of range");
170 }
171 break;
172 }
173}
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
Calculate the derivative of the physical points.
Definition: StdPrismExp.cpp:75

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

◆ v_PhysEvaluate()

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

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 635 of file StdPrismExp.cpp.

639{
640 // Collapse coordinates
641 Array<OneD, NekDouble> coll(3, 0.0);
642 LocCoordToLocCollapsed(coord, coll);
643
644 // If near singularity do the old interpolation matrix method
645 if ((1 - coll[2]) < 1e-5)
646 {
647 int totPoints = GetTotPoints();
648 Array<OneD, NekDouble> EphysDeriv0(totPoints), EphysDeriv1(totPoints),
649 EphysDeriv2(totPoints);
650 PhysDeriv(inarray, EphysDeriv0, EphysDeriv1, EphysDeriv2);
651
652 Array<OneD, DNekMatSharedPtr> I(3);
653 I[0] = GetBase()[0]->GetI(coll);
654 I[1] = GetBase()[1]->GetI(coll + 1);
655 I[2] = GetBase()[2]->GetI(coll + 2);
656
657 firstOrderDerivs[0] = PhysEvaluate(I, EphysDeriv0);
658 firstOrderDerivs[1] = PhysEvaluate(I, EphysDeriv1);
659 firstOrderDerivs[2] = PhysEvaluate(I, EphysDeriv2);
660 return PhysEvaluate(I, inarray);
661 }
662
663 NekDouble val = BaryTensorDeriv(coll, inarray, firstOrderDerivs);
664
665 NekDouble dEta_bar1 = firstOrderDerivs[0];
666
667 NekDouble fac = 2.0 / (1.0 - coll[2]);
668 firstOrderDerivs[0] = fac * dEta_bar1;
669
670 // divide dEta_Bar1 by (1-eta_z)
671 fac = 1.0 / (1.0 - coll[2]);
672 dEta_bar1 = fac * dEta_bar1;
673
674 // Multiply dEta_Bar1 by (1+eta_x) and add ot out_dxi3
675 fac = 1.0 + coll[0];
676 firstOrderDerivs[2] += fac * dEta_bar1;
677
678 return val;
679}
NekDouble BaryTensorDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:134
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase() const
This function gets the shared point to basis.
Definition: StdExpansion.h:100
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.
Definition: StdExpansion.h:919
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Definition: StdExpansion.h:849

References Nektar::StdRegions::StdExpansion3D::BaryTensorDeriv(), Nektar::StdRegions::StdExpansion::GetBase(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::StdRegions::StdExpansion::PhysDeriv(), and Nektar::StdRegions::StdExpansion::PhysEvaluate().

◆ v_PhysEvaluateBasis()

NekDouble Nektar::StdRegions::StdPrismExp::v_PhysEvaluateBasis ( const Array< OneD, const NekDouble > &  coords,
int  mode 
)
finalprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 688 of file StdPrismExp.cpp.

690{
691 Array<OneD, NekDouble> coll(3);
692 LocCoordToLocCollapsed(coords, coll);
693
694 const int nm1 = m_base[1]->GetNumModes();
695 const int nm2 = m_base[2]->GetNumModes();
696 const int b = 2 * nm2 + 1;
697
698 const int mode0 = floor(0.5 * (b - sqrt(b * b - 8.0 * mode / nm1)));
699 const int tmp =
700 mode - nm1 * (mode0 * (nm2 - 1) + 1 - (mode0 - 2) * (mode0 - 1) / 2);
701 const int mode1 = tmp / (nm2 - mode0);
702 const int mode2 = tmp % (nm2 - mode0);
703
704 if (mode0 == 0 && mode2 == 1 &&
706 {
707 // handle collapsed top edge to remove mode0 terms
708 return StdExpansion::BaryEvaluateBasis<1>(coll[1], mode1) *
709 StdExpansion::BaryEvaluateBasis<2>(coll[2], mode2);
710 }
711 else
712 {
713 return StdExpansion::BaryEvaluateBasis<0>(coll[0], mode0) *
714 StdExpansion::BaryEvaluateBasis<1>(coll[1], mode1) *
715 StdExpansion::BaryEvaluateBasis<2>(coll[2], mode2);
716 }
717}
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::StdRegions::StdExpansion::m_base, and tinysimd::sqrt().

◆ v_ReduceOrderCoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2138 of file StdPrismExp.cpp.

2141{
2142 int nquad0 = m_base[0]->GetNumPoints();
2143 int nquad1 = m_base[1]->GetNumPoints();
2144 int nquad2 = m_base[2]->GetNumPoints();
2145 int nqtot = nquad0 * nquad1 * nquad2;
2146 int nmodes0 = m_base[0]->GetNumModes();
2147 int nmodes1 = m_base[1]->GetNumModes();
2148 int nmodes2 = m_base[2]->GetNumModes();
2149 int numMax = nmodes0;
2150
2151 Array<OneD, NekDouble> coeff(m_ncoeffs);
2152 Array<OneD, NekDouble> coeff_tmp1(m_ncoeffs, 0.0);
2153 Array<OneD, NekDouble> phys_tmp(nqtot, 0.0);
2154 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
2155
2156 const LibUtilities::PointsKey Pkey0 = m_base[0]->GetPointsKey();
2157 const LibUtilities::PointsKey Pkey1 = m_base[1]->GetPointsKey();
2158 const LibUtilities::PointsKey Pkey2 = m_base[2]->GetPointsKey();
2159
2160 LibUtilities::BasisKey bortho0(LibUtilities::eOrtho_A, nmodes0, Pkey0);
2161 LibUtilities::BasisKey bortho1(LibUtilities::eOrtho_A, nmodes1, Pkey1);
2162 LibUtilities::BasisKey bortho2(LibUtilities::eOrtho_B, nmodes2, Pkey2);
2163
2164 int cnt = 0;
2165 int u = 0;
2166 int i = 0;
2168
2170 bortho0, bortho1, bortho2);
2171
2172 BwdTrans(inarray, phys_tmp);
2173 OrthoPrismExp->FwdTrans(phys_tmp, coeff);
2174
2175 // filtering
2176 for (u = 0; u < numMin; ++u)
2177 {
2178 for (i = 0; i < numMin; ++i)
2179 {
2180 Vmath::Vcopy(numMin - u, tmp = coeff + cnt, 1,
2181 tmp2 = coeff_tmp1 + cnt, 1);
2182 cnt += numMax - u;
2183 }
2184
2185 for (i = numMin; i < numMax; ++i)
2186 {
2187 cnt += numMax - u;
2188 }
2189 }
2190
2191 OrthoPrismExp->BwdTrans(coeff_tmp1, phys_tmp);
2192 StdPrismExp::FwdTrans(phys_tmp, outarray);
2193}
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:424
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space.
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:42
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
Definition: StdPrismExp.h:218

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

◆ 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 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 175 of file StdPrismExp.cpp.

179{
180 StdPrismExp::v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
181}

References v_PhysDeriv().

◆ v_StdPhysDeriv() [2/2]

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 183 of file StdPrismExp.cpp.

186{
187 StdPrismExp::v_PhysDeriv(dir, inarray, outarray);
188}

References v_PhysDeriv().

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::PrismExp.

Definition at line 2000 of file StdPrismExp.cpp.

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

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.