Nektar++
Loading...
Searching...
No Matches
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 ()=default
 
 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 IProductWRTBaseKernel (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, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false, bool CollDir2=false)
 
int GetNedges () const
 return the number of edges in 3D expansion
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge.
 
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.
 
 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.
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor.
 
virtual ~StdExpansion ()
 Destructor.
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion.
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis.
 
const LibUtilities::BasisSharedPtr & GetBasis (int dir) const
 This function gets the shared point to basis in the dir direction.
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion.
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element.
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction.
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction.
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions.
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction.
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction.
 
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.
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain.
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th trace.
 
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.
 
std::shared_ptr< StdExpansion > GetStdTraceExp (const int traceid)
 This function returns the basis key belonging to the i-th trace.
 
const LibUtilities::BasisKey GetTraceBasisKey (const int i, int k=-1, bool UseGLL=false) const
 
LibUtilities::PointsKey GetTracePointsKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace.
 
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.
 
int GetNtraces () const
 Returns the number of trace elements connected to this element.
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain.
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion () const
 
bool IsNodalNonTensorialExp ()
 
bool StdInvMassIsDiagonal ()
 Whether the standard inverse mass matrix is diagonal.
 
bool InvMassIsDiagonal ()
 Whether the inverse mass matrix is diagonal: the standard one here, and on a local expansion the standard one over the Jacobian.
 
void NodalToModal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space.
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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.
 
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion.
 
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
 
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.
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id.
 
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
 
Array< OneD, Array< OneD, NekDouble > > GetCoords ()
 
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
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
Array< OneD, const NekDouble > GetStdFac (const StdFacKey &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}\)
 
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 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)
 
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.
 
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.
 
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.
 
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.
 
void ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1, bool Forwards=true)
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta.
 
void LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 Convert local collapsed coordinates eta into local cartesian coordinate xi.
 
void PhysInterp (std::shared_ptr< StdExpansion > fromExp, const Array< OneD, const NekDouble > &fromData, Array< OneD, NekDouble > &toData, bool Transpose=false)
 interpolate from one set of quadrature points available from FromExp to the set of quadrature points in the current expansion. If the points are the same this routine will just copy the data
 
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.
 
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.
 
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.
 
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.
 
void PhysInterpToGLL (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
 
void PhysInterpToPoints (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset, MatrixType distrib)
 
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.
 
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.
 
void EquiSpacedToPhys (const int nequi, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
template<class T >
std::shared_ptr< T > as ()
 
void GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
std::vector< Array< OneD, const NekDouble > > GetQuadratureWeights ()
 Return the quadrature weights stored in each std expandion.
 

Protected Member Functions

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
 Calculate the derivative of the physical points.
 
void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_IProductWRTBaseKernel (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, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false, bool CollDir2=false) override
 Inner product of inarray over region with respect to the expansion basis (this)->m_base[0] and return in outarray.
 
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.
 
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_PhysEvalFirstDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
 
int v_GetNverts () const final
 
int v_GetNedges () const final
 
int v_GetNtraces () const final
 
LibUtilities::ShapeType v_DetShapeType () const override
 Return Shape of region, using ShapeType enum list; i.e. prism.
 
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, bool UseGLL=false) 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_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
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points.
 
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.
 
NekDouble v_StdPhysEvaluate (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.
 
NekDouble v_PhysEvaluateInterp (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals) override
 
void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
void v_GenStdTraceExp (const int traceid, std::shared_ptr< StdExpansion > &exp) override
 
void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
 
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 BaryTensorDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 
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
 
void v_PhysInterp (std::shared_ptr< StdExpansion > fromExp, const Array< OneD, const NekDouble > &fromData, Array< OneD, NekDouble > &toData, bool Transpose) override
 
void v_ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1, bool Forwards) override
 This method produces a mapping.
 
int v_GetShapeDimension () const final
 
bool v_IsCollocatedBasis () const final
 
virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
 Calculate the derivative of the physical points.
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0)
 Calculate the derivative of the physical points in a given direction.
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
std::shared_ptr< Array< OneD, const NekDouble > > CreateStdFac (const StdFacKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition.
 
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)
 
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.
 
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.
 
template<int DIR, bool DERIV = false, bool DERIV2 = false>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals, NekDouble &deriv)
 
virtual const LibUtilities::PointsKey v_GetNodalPointsKey () const
 
virtual bool v_IsNodalNonTensorialExp ()
 
virtual bool v_InvMassIsDiagonal ()
 
virtual void v_NodalToModal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Transform a given function from physical quadrature space to coefficient space.
 
virtual void v_IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 Physical derivative along a direction vector.
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 
virtual NekDouble v_PhysEvalFirstSecondDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs)
 
virtual void v_GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 
virtual int v_GetCoordim () const
 
virtual void v_GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
virtual void v_MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
virtual void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LinearAdvectionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
virtual void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
virtual void v_GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 

Private Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtr > m_base
 
int m_elmt_id
 
int m_ncoeffs
 
std::vector< Array< OneD, const NekDouble > > m_weights
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLess > m_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLess > m_stdStaticCondMatrixManager
 
LibUtilities::NekManager< StdFacKey, Array< OneD, const NekDouble > > m_stdFacManager
 

Detailed Description

Class representing a prismatic element in reference space.

Definition at line 44 of file StdPrismExp.h.

Constructor & Destructor Documentation

◆ StdPrismExp() [1/4]

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

Definition at line 52 of file StdPrismExp.cpp.

56 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
57 3, Ba, Bb, Bc),
59 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
60 Ba, Bb, Bc)
61{
62 ASSERTL0(Ba.GetNumModes() <= Bc.GetNumModes(),
63 "order in 'a' direction is higher than order in 'c' direction");
64
65 // cache integration weights for future use
66 m_weights.push_back(m_base[0]->GetW());
67 m_weights.push_back(m_base[1]->GetW());
68
69 StdFacKey w2key(eWeights2, Bc);
70 // get weights[2] from manager where points are rescaled
71 m_weights.push_back(GetStdFac(w2key));
72}
#define ASSERTL0(condition, msg)
StdExpansion()
Default Constructor.
Array< OneD, const NekDouble > GetStdFac(const StdFacKey &mkey)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
std::vector< Array< OneD, const NekDouble > > m_weights
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)

References ASSERTL0, Nektar::StdRegions::eWeights2, Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::StdRegions::StdExpansion::GetStdFac(), Nektar::StdRegions::StdExpansion::m_base, and Nektar::StdRegions::StdExpansion::m_weights.

◆ StdPrismExp() [2/4]

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

◆ StdPrismExp() [3/4]

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

◆ StdPrismExp() [4/4]

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

1937{
1938 int Q = m_base[1]->GetNumModes() - 1;
1939 int R = m_base[2]->GetNumModes() - 1;
1940
1941 return r + // Skip along stacks (r-direction)
1942 q * (R + 1 - p) + // Skip along columns (q-direction)
1943 (Q + 1) * (p * R + 1 -
1944 (p - 2) * (p - 1) / 2); // Skip along rows (p-direction)
1945}
std::vector< double > p(NPUPPER)

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

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

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

188{
191 "Basis[1] is not a general tensor type");
192
195 "Basis[2] is not a general tensor type");
196
197 const Array<OneD, const NekDouble> base0 = m_base[0]->GetBdata();
198 const Array<OneD, const NekDouble> base1 = m_base[1]->GetBdata();
199 const Array<OneD, const NekDouble> base2 = m_base[2]->GetBdata();
200
201 int nquad0 = m_base[0]->GetNumPoints();
202 int nquad1 = m_base[1]->GetNumPoints();
203 int nquad2 = m_base[2]->GetNumPoints();
204 int nmodes0 = m_base[0]->GetNumModes();
205 int nmodes1 = m_base[1]->GetNumModes();
206 int nmodes2 = m_base[2]->GetNumModes();
207
208 bool isModified = (m_base[0]->GetBasisType() == LibUtilities::eModified_A);
209
210 std::vector<vec_t, tinysimd::allocator<vec_t>> wsp0(nmodes0 * nmodes1),
211 wsp1(nmodes0);
212
213 // Switch statment using boost_pp and macros. This unfolls intwo a
214 // nested swtich statement where the outer swtich statement runs
215 // from SMIN to SMAX for modal order and the inner switch
216 // statemets run from the outer value of the case to 2*SMAX for
217 // the quadrature order. If you want to see it unwrapped compile
218 // in verbose mode and add --preprocess to the c++ command.
219 // Default case
220#undef BWDTRANS_DEF
221#define BWDTRANS_DEF \
222 BwdTransPrismKernel<false>( \
223 nmodes0, nmodes1, nmodes2, nquad0, nquad1, nquad2, isModified, \
224 base0.data(), base1.data(), base2.data(), wsp0.data(), wsp1.data(), \
225 (const vec_t *)inarray.data(), (vec_t *)outarray.data())
226
227 // Inner loop case over quarature points
228#undef BWDTRANS_Q
229#define BWDTRANS_Q(r, i) \
230 case NQ(i): \
231 BwdTransPrismKernel<false>(NM(i), NM(i), NM(i), NQ(i), NQ(i), \
232 NQ_M1(i), isModified, base0.data(), \
233 base1.data(), base2.data(), wsp0.data(), \
234 wsp1.data(), (const vec_t *)inarray.data(), \
235 (vec_t *)outarray.data()); \
236 break;
237
238 // outer loop case over modes
239#undef BWDTRANS_M
240#define BWDTRANS_M(r, i) \
241 case NM(i): \
242 { \
243 switch (nquad0) \
244 { \
245 BOOST_PP_FOR_##r((NM(i), NM_P1(i), BOOST_PP_MUL(2, NM(i))), \
246 STDLEV2TEST1, STDLEV2UPDATE1, BWDTRANS_Q) default \
247 : BWDTRANS_DEF; \
248 break; \
249 } \
250 } \
251 break;
252
253 // templated cases on equi-ordered modes and standard quad
254 // usage where quad order goes from mode order to 2(*mode
255 // order)
256 if ((nmodes0 == nmodes1) && (nmodes1 == nmodes2) && (nquad0 == nquad1) &&
257 (nquad1 == nquad2 + 1))
258 {
259 switch (nmodes0)
260 {
261 BOOST_PP_FOR((SMIN, 0, SMAX), STDLEV2TEST, STDLEV2UPDATE,
263 default:
265 break;
266 }
267 }
268 else
269 {
271 }
272}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define BWDTRANS_M(r, i)
#define BWDTRANS_DEF
#define STDLEV2TEST(r, state)
#define STDLEV2UPDATE(r, state)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
@ 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
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48

References ASSERTL1, BWDTRANS_DEF, BWDTRANS_M, Nektar::LibUtilities::eModified_A, 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, STDLEV2TEST, and STDLEV2UPDATE.

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

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

911{
913 nummodes[modes_offset], nummodes[modes_offset + 1],
914 nummodes[modes_offset + 2]);
915
916 modes_offset += 3;
917 return nmodes;
918}

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

◆ v_CreateStdMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1913 of file StdPrismExp.cpp.

1914{
1915 return v_GenMatrix(mkey);
1916}
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 756 of file StdPrismExp.cpp.

757{
759}

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

671{
672 Array<OneD, NekDouble> tmp(m_ncoeffs, 0.0);
673 tmp[mode] = 1.0;
674 StdPrismExp::v_BwdTrans(tmp, outarray);
675}
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_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1758 of file StdPrismExp.cpp.

1759{
1760
1761 MatrixType mtype = mkey.GetMatrixType();
1762
1763 DNekMatSharedPtr Mat;
1764
1765 switch (mtype)
1766 {
1768 {
1769 int nq0 = m_base[0]->GetNumPoints();
1770 int nq1 = m_base[1]->GetNumPoints();
1771 int nq2 = m_base[2]->GetNumPoints();
1772 int nq;
1773
1774 // take definition from key
1775 if (mkey.ConstFactorExists(eFactorConst))
1776 {
1777 nq = (int)mkey.GetConstFactor(eFactorConst);
1778 }
1779 else
1780 {
1781 nq = max(nq0, max(nq1, nq2));
1782 }
1783
1784 int neq =
1786 Array<OneD, Array<OneD, NekDouble>> coords(neq);
1787 Array<OneD, NekDouble> coll(3);
1788 Array<OneD, DNekMatSharedPtr> I(3);
1789 Array<OneD, NekDouble> tmp(nq0);
1790
1791 Mat =
1792 MemoryManager<DNekMat>::AllocateSharedPtr(neq, nq0 * nq1 * nq2);
1793 int cnt = 0;
1794 for (int i = 0; i < nq; ++i)
1795 {
1796 for (int j = 0; j < nq; ++j)
1797 {
1798 for (int k = 0; k < nq - i; ++k, ++cnt)
1799 {
1800 coords[cnt] = Array<OneD, NekDouble>(3);
1801 coords[cnt][0] = -1.0 + 2 * k / (NekDouble)(nq - 1);
1802 coords[cnt][1] = -1.0 + 2 * j / (NekDouble)(nq - 1);
1803 coords[cnt][2] = -1.0 + 2 * i / (NekDouble)(nq - 1);
1804 }
1805 }
1806 }
1807
1808 for (int i = 0; i < neq; ++i)
1809 {
1810 LocCoordToLocCollapsed(coords[i], coll);
1811
1812 I[0] = m_base[0]->GetI(coll);
1813 I[1] = m_base[1]->GetI(coll + 1);
1814 I[2] = m_base[2]->GetI(coll + 2);
1815
1816 // interpolate first coordinate direction
1817 NekDouble fac;
1818 for (int k = 0; k < nq2; ++k)
1819 {
1820 for (int j = 0; j < nq1; ++j)
1821 {
1822
1823 fac = (I[1]->GetPtr())[j] * (I[2]->GetPtr())[k];
1824 Vmath::Smul(nq0, fac, I[0]->GetPtr(), 1, tmp, 1);
1825
1826 Vmath::Vcopy(nq0, &tmp[0], 1,
1827 Mat->GetRawPtr() + k * nq0 * nq1 * neq +
1828 j * nq0 * neq + i,
1829 neq);
1830 }
1831 }
1832 }
1833 }
1834 break;
1835 case ePhysInterpToGLL:
1836 {
1837 int nq0 = m_base[0]->GetNumPoints();
1838 int nq1 = m_base[1]->GetNumPoints();
1839 int nq2 = m_base[2]->GetNumPoints();
1840 int nq;
1841
1842 // take definition from key
1843 if (mkey.ConstFactorExists(eFactorConst))
1844 {
1845 nq = (int)mkey.GetConstFactor(eFactorConst);
1846 }
1847 else
1848 {
1849 nq = max(nq0, max(nq1, nq2));
1850 }
1851
1852 int neq =
1854 Array<OneD, NekDouble> coords(3);
1855 Array<OneD, NekDouble> coll(3);
1856 Array<OneD, DNekMatSharedPtr> I(3);
1857 Array<OneD, NekDouble> tmp(nq0);
1858
1859 Mat =
1860 MemoryManager<DNekMat>::AllocateSharedPtr(neq, nq0 * nq1 * nq2);
1861
1862 const LibUtilities::PointsKey key(nq,
1864
1865 Array<OneD, const NekDouble> x, y, z;
1866 LibUtilities::PointsManager()[key]->GetPoints(x, y, z);
1867
1868 Array<OneD, int> sorted;
1870
1871 for (int i = 0; i < neq; ++i)
1872 {
1873 coords[0] = x[sorted[i]];
1874 coords[1] = y[sorted[i]];
1875 coords[2] = z[sorted[i]];
1876
1877 LocCoordToLocCollapsed(coords, coll);
1878
1879 I[0] = m_base[0]->GetI(coll);
1880 I[1] = m_base[1]->GetI(coll + 1);
1881 I[2] = m_base[2]->GetI(coll + 2);
1882
1883 // interpolate first coordinate direction
1884 NekDouble fac;
1885 for (int k = 0; k < nq2; ++k)
1886 {
1887 for (int j = 0; j < nq1; ++j)
1888 {
1889
1890 fac = (I[1]->GetPtr())[j] * (I[2]->GetPtr())[k];
1891 Vmath::Smul(nq0, fac, I[0]->GetPtr(), 1, tmp, 1);
1892
1893 Vmath::Vcopy(nq0, &tmp[0], 1,
1894 Mat->GetRawPtr() + k * nq0 * nq1 * neq +
1895 j * nq0 * neq + i,
1896 neq);
1897 }
1898 }
1899 }
1900 }
1901 break;
1902
1903 default:
1904 {
1906 }
1907 break;
1908 }
1909
1910 return Mat;
1911}
static void CartesianOrdering(const int nq, Array< OneD, int > &sorted)
Definition NodalUtil.h:362
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
PointsManagerT & PointsManager(void)
@ eNodalPrismElec
3D electrostatically spaced points on a Prism
Definition PointsType.h:87
std::shared_ptr< DNekMat > DNekMatSharedPtr
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:102
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:828
scalarT< T > max(scalarT< T > lhs, scalarT< T > rhs)
Definition scalar.hpp:304

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::NodalUtilPrism::CartesianOrdering(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::StdExpansion::CreateGeneralMatrix(), Nektar::StdRegions::eFactorConst, Nektar::LibUtilities::eNodalPrismElec, Nektar::StdRegions::ePhysInterpToEquiSpaced, Nektar::StdRegions::ePhysInterpToGLL, Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::LibUtilities::StdPrismData::getNumberOfCoefficients(), Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::StdRegions::StdExpansion::m_base, tinysimd::max(), Nektar::LibUtilities::PointsManager(), 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 1034 of file StdPrismExp.cpp.

1035{
1038 "BasisType is not a boundary interior form");
1041 "BasisType is not a boundary interior form");
1044 "BasisType is not a boundary interior form");
1045
1046 int P = m_base[0]->GetNumModes() - 1, p;
1047 int Q = m_base[1]->GetNumModes() - 1, q;
1048 int R = m_base[2]->GetNumModes() - 1, r;
1049 int idx = 0;
1050
1051 int nBnd = NumBndryCoeffs();
1052
1053 if (maparray.size() != nBnd)
1054 {
1055 maparray = Array<OneD, unsigned int>(nBnd);
1056 }
1057
1058 // Loop over all boundary modes (in ascending order).
1059 for (p = 0; p <= P; ++p)
1060 {
1061 // First two q-r planes are entirely boundary modes.
1062 if (p <= 1)
1063 {
1064 for (q = 0; q <= Q; ++q)
1065 {
1066 for (r = 0; r <= R - p; ++r)
1067 {
1068 maparray[idx++] = GetMode(p, q, r);
1069 }
1070 }
1071 }
1072 else
1073 {
1074 // Remaining q-r planes contain boundary modes on the two
1075 // left-hand sides and bottom edge.
1076 for (q = 0; q <= Q; ++q)
1077 {
1078 if (q <= 1)
1079 {
1080 for (r = 0; r <= R - p; ++r)
1081 {
1082 maparray[idx++] = GetMode(p, q, r);
1083 }
1084 }
1085 else
1086 {
1087 maparray[idx++] = GetMode(p, q, 0);
1088 }
1089 }
1090 }
1091 }
1092}
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
@ 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(), and Nektar::LibUtilities::P.

◆ 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.

Definition at line 564 of file StdPrismExp.cpp.

567{
568 Array<OneD, const NekDouble> etaBar_x = m_base[0]->GetZ();
569 Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
570 Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
571 int Qx = GetNumPoints(0);
572 int Qy = GetNumPoints(1);
573 int Qz = GetNumPoints(2);
574
575 // Convert collapsed coordinates into cartesian coordinates: eta --> xi
576 for (int k = 0; k < Qz; ++k)
577 {
578 for (int j = 0; j < Qy; ++j)
579 {
580 for (int i = 0; i < Qx; ++i)
581 {
582 int s = i + Qx * (j + Qy * k);
583 xi_x[s] = (1.0 - eta_z[k]) * (1.0 + etaBar_x[i]) / 2.0 - 1.0;
584 xi_y[s] = eta_y[j];
585 xi_z[s] = eta_z[k];
586 }
587 }
588 }
589}
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.

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

1456{
1457 int i;
1458 bool signChange;
1459 const int P = m_base[0]->GetNumModes() - 1;
1460 const int Q = m_base[1]->GetNumModes() - 1;
1461 const int R = m_base[2]->GetNumModes() - 1;
1462 const int nEdgeIntCoeffs = v_GetEdgeNcoeffs(eid) - 2;
1463
1464 if (maparray.size() != nEdgeIntCoeffs)
1465 {
1466 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1467 }
1468
1469 if (signarray.size() != nEdgeIntCoeffs)
1470 {
1471 signarray = Array<OneD, int>(nEdgeIntCoeffs, 1);
1472 }
1473 else
1474 {
1475 fill(signarray.data(), signarray.data() + nEdgeIntCoeffs, 1);
1476 }
1477
1478 // If edge is oriented backwards, change sign of modes which have
1479 // degree 2n+1, n >= 1.
1480 signChange = edgeOrient == eBackwards;
1481
1482 switch (eid)
1483 {
1484 case 0:
1485 for (i = 2; i <= P; ++i)
1486 {
1487 maparray[i - 2] = GetMode(i, 0, 0);
1488 }
1489 break;
1490
1491 case 1:
1492 for (i = 2; i <= Q; ++i)
1493 {
1494 maparray[i - 2] = GetMode(1, i, 0);
1495 }
1496 break;
1497
1498 case 2:
1499 // Base quad; reverse direction.
1500 // signChange = !signChange;
1501 for (i = 2; i <= P; ++i)
1502 {
1503 maparray[i - 2] = GetMode(i, 1, 0);
1504 }
1505 break;
1506
1507 case 3:
1508 // Base quad; reverse direction.
1509 // signChange = !signChange;
1510 for (i = 2; i <= Q; ++i)
1511 {
1512 maparray[i - 2] = GetMode(0, i, 0);
1513 }
1514 break;
1515
1516 case 4:
1517 for (i = 2; i <= R; ++i)
1518 {
1519 maparray[i - 2] = GetMode(0, 0, i);
1520 }
1521 break;
1522
1523 case 5:
1524 for (i = 1; i <= R - 1; ++i)
1525 {
1526 maparray[i - 1] = GetMode(1, 0, i);
1527 }
1528 break;
1529
1530 case 6:
1531 for (i = 1; i <= R - 1; ++i)
1532 {
1533 maparray[i - 1] = GetMode(1, 1, i);
1534 }
1535 break;
1536
1537 case 7:
1538 for (i = 2; i <= R; ++i)
1539 {
1540 maparray[i - 2] = GetMode(0, 1, i);
1541 }
1542 break;
1543
1544 case 8:
1545 for (i = 2; i <= Q; ++i)
1546 {
1547 maparray[i - 2] = GetMode(0, i, 1);
1548 }
1549 break;
1550
1551 default:
1552 ASSERTL0(false, "Edge not defined.");
1553 break;
1554 }
1555
1556 if (signChange)
1557 {
1558 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1559 {
1560 signarray[i] = -1;
1561 }
1562 }
1563}
int v_GetEdgeNcoeffs(const int i) const override
void fill(const TData &val, LibUtilities::MemoryRegion< TData > &x)
Definition Math.hpp:235

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

716{
717 ASSERTL2(i >= 0 && i <= 8, "edge id is out of range");
718
719 if (i == 0 || i == 2)
720 {
721 return GetBasisNumModes(0);
722 }
723 else if (i == 1 || i == 3 || i == 8)
724 {
725 return GetBasisNumModes(1);
726 }
727 else
728 {
729 return GetBasisNumModes(2);
730 }
731}
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.

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

1199{
1201 "Method only implemented if BasisType is identical"
1202 "in x and y directions");
1205 "Method only implemented for Modified_A BasisType"
1206 "(x and y direction) and Modified_B BasisType (z "
1207 "direction)");
1208
1209 int i, j, k, p, r, nFaceCoeffs, idx = 0;
1210 int nummodesA = 0, nummodesB = 0;
1211
1212 switch (fid)
1213 {
1214 case 0:
1215 nummodesA = m_base[0]->GetNumModes();
1216 nummodesB = m_base[1]->GetNumModes();
1217 break;
1218 case 1:
1219 case 3:
1220 nummodesA = m_base[0]->GetNumModes();
1221 nummodesB = m_base[2]->GetNumModes();
1222 break;
1223 case 2:
1224 case 4:
1225 nummodesA = m_base[1]->GetNumModes();
1226 nummodesB = m_base[2]->GetNumModes();
1227 break;
1228 default:
1229 ASSERTL0(false, "fid must be between 0 and 4");
1230 }
1231
1232 if (P == -1)
1233 {
1234 P = nummodesA;
1235 Q = nummodesB;
1236 nFaceCoeffs = GetTraceNcoeffs(fid);
1237 }
1238 else if (fid == 1 || fid == 3)
1239 {
1240 nFaceCoeffs = P * (2 * Q - P + 1) / 2;
1241 }
1242 else
1243 {
1244 nFaceCoeffs = P * Q;
1245 }
1246
1247 // Allocate the map array and sign array; set sign array to ones (+)
1248 if (maparray.size() != nFaceCoeffs)
1249 {
1250 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1251 }
1252
1253 if (signarray.size() != nFaceCoeffs)
1254 {
1255 signarray = Array<OneD, int>(nFaceCoeffs, 1);
1256 }
1257 else
1258 {
1259 fill(signarray.data(), signarray.data() + nFaceCoeffs, 1);
1260 }
1261
1262 int minPA = min(nummodesA, P);
1263 int minQB = min(nummodesB, Q);
1264 // triangular faces
1265 if (fid == 1 || fid == 3)
1266 {
1267 // zero signmap and set maparray to zero if elemental
1268 // modes are not as large as face modesl
1269 idx = 0;
1270 int cnt = 0;
1271
1272 for (j = 0; j < minPA; ++j)
1273 {
1274 // set maparray
1275 for (k = 0; k < minQB - j; ++k, ++cnt)
1276 {
1277 maparray[idx++] = cnt;
1278 }
1279
1280 cnt += nummodesB - minQB;
1281
1282 // idx += nummodesB-j;
1283 for (k = nummodesB - j; k < Q - j; ++k)
1284 {
1285 signarray[idx] = 0.0;
1286 maparray[idx++] = maparray[0];
1287 }
1288 }
1289
1290 for (j = nummodesA; j < P; ++j)
1291 {
1292 for (k = 0; k < Q - j; ++k)
1293 {
1294 signarray[idx] = 0.0;
1295 maparray[idx++] = maparray[0];
1296 }
1297 }
1298
1299 // Triangles only have one possible orientation (base
1300 // direction reversed); swap edge modes.
1301 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2)
1302 {
1303 idx = 0;
1304 for (p = 0; p < P; ++p)
1305 {
1306 for (r = 0; r < Q - p; ++r, idx++)
1307 {
1308 if (p > 1)
1309 {
1310 signarray[idx] = p % 2 ? -1 : 1;
1311 }
1312 }
1313 }
1314
1315 swap(maparray[0], maparray[Q]);
1316 for (i = 1; i < Q - 1; ++i)
1317 {
1318 swap(maparray[i + 1], maparray[Q + i]);
1319 }
1320 }
1321 }
1322 else
1323 {
1324 // Set up an array indexing for quads, since the
1325 // ordering may need to be transposed.
1326 Array<OneD, int> arrayindx(nFaceCoeffs, -1);
1327
1328 for (i = 0; i < Q; i++)
1329 {
1330 for (j = 0; j < P; j++)
1331 {
1332 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1333 {
1334 arrayindx[i * P + j] = i * P + j;
1335 }
1336 else
1337 {
1338 arrayindx[i * P + j] = j * Q + i;
1339 }
1340 }
1341 }
1342
1343 // zero signmap and set maparray to zero if elemental
1344 // modes are not as large as face modesl
1345 for (j = 0; j < P; ++j)
1346 {
1347 // set up default maparray
1348 for (k = 0; k < Q; k++)
1349 {
1350 maparray[arrayindx[j + k * P]] = j + k * nummodesA;
1351 }
1352
1353 for (k = nummodesB; k < Q; ++k)
1354 {
1355 signarray[arrayindx[j + k * P]] = 0.0;
1356 maparray[arrayindx[j + k * P]] = maparray[0];
1357 }
1358 }
1359
1360 for (j = nummodesA; j < P; ++j)
1361 {
1362 for (k = 0; k < Q; ++k)
1363 {
1364 signarray[arrayindx[j + k * P]] = 0.0;
1365 maparray[arrayindx[j + k * P]] = maparray[0];
1366 }
1367 }
1368
1369 // The code below is exactly the same as that taken from
1370 // StdHexExp and reverses the 'b' and 'a' directions as
1371 // appropriate (1st and 2nd if statements respectively) in
1372 // quadrilateral faces.
1373 if (faceOrient == eDir1FwdDir1_Dir2BwdDir2 ||
1374 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1375 faceOrient == eDir1BwdDir2_Dir2FwdDir1 ||
1376 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1377 {
1378 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1379 {
1380 for (i = 3; i < Q; i += 2)
1381 {
1382 for (j = 0; j < P; j++)
1383 {
1384 signarray[arrayindx[i * P + j]] *= -1;
1385 }
1386 }
1387
1388 for (i = 0; i < P; i++)
1389 {
1390 swap(maparray[i], maparray[i + P]);
1391 swap(signarray[i], signarray[i + P]);
1392 }
1393 }
1394 else
1395 {
1396 for (i = 0; i < Q; i++)
1397 {
1398 for (j = 3; j < P; j += 2)
1399 {
1400 signarray[arrayindx[i * P + j]] *= -1;
1401 }
1402 }
1403
1404 for (i = 0; i < Q; i++)
1405 {
1406 swap(maparray[i], maparray[i + Q]);
1407 swap(signarray[i], signarray[i + Q]);
1408 }
1409 }
1410 }
1411
1412 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2 ||
1413 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1414 faceOrient == eDir1FwdDir2_Dir2BwdDir1 ||
1415 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1416 {
1417 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1418 {
1419 for (i = 0; i < Q; i++)
1420 {
1421 for (j = 3; j < P; j += 2)
1422 {
1423 signarray[arrayindx[i * P + j]] *= -1;
1424 }
1425 }
1426
1427 for (i = 0; i < Q; i++)
1428 {
1429 swap(maparray[i * P], maparray[i * P + 1]);
1430 swap(signarray[i * P], signarray[i * P + 1]);
1431 }
1432 }
1433 else
1434 {
1435 for (i = 3; i < Q; i += 2)
1436 {
1437 for (j = 0; j < P; j++)
1438 {
1439 signarray[arrayindx[i * P + j]] *= -1;
1440 }
1441 }
1442
1443 for (i = 0; i < P; i++)
1444 {
1445 swap(maparray[i * Q], maparray[i * Q + 1]);
1446 swap(signarray[i * Q], signarray[i * Q + 1]);
1447 }
1448 }
1449 }
1450 }
1451}
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
scalarT< T > min(scalarT< T > lhs, scalarT< T > rhs)
Definition scalar.hpp:299

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, tinysimd::min(), and Nektar::LibUtilities::P.

◆ v_GetInteriorMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 996 of file StdPrismExp.cpp.

997{
1000 "BasisType is not a boundary interior form");
1003 "BasisType is not a boundary interior form");
1006 "BasisType is not a boundary interior form");
1007
1008 int P = m_base[0]->GetNumModes() - 1, p;
1009 int Q = m_base[1]->GetNumModes() - 1, q;
1010 int R = m_base[2]->GetNumModes() - 1, r;
1011
1012 int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
1013
1014 if (outarray.size() != nIntCoeffs)
1015 {
1016 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1017 }
1018
1019 int idx = 0;
1020
1021 // Loop over all interior modes.
1022 for (p = 2; p <= P; ++p)
1023 {
1024 for (q = 2; q <= Q; ++q)
1025 {
1026 for (r = 1; r <= R - p; ++r)
1027 {
1028 outarray[idx++] = GetMode(p, q, r);
1029 }
1030 }
1031 }
1032}

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(), and Nektar::LibUtilities::P.

◆ v_GetNedges()

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

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 742 of file StdPrismExp.cpp.

743{
744 return 9;
745}

◆ v_GetNtraces()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 747 of file StdPrismExp.cpp.

748{
749 return 5;
750}

◆ v_GetNverts()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 737 of file StdPrismExp.cpp.

738{
739 return 6;
740}

◆ v_GetTraceBasisKey()

const LibUtilities::BasisKey Nektar::StdRegions::StdPrismExp::v_GetTraceBasisKey ( const int  i,
const int  k,
bool  UseGLL = false 
) const
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 879 of file StdPrismExp.cpp.

882{
883 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
884 ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
885
886 switch (i)
887 {
888 case 0:
889 {
890 return EvaluateQuadFaceBasisKey(k, m_base[k]);
891 }
892 case 2:
893 case 4:
894 {
895 return EvaluateQuadFaceBasisKey(k, m_base[k + 1]);
896 }
897 case 1:
898 case 3:
899 {
900 return EvaluateTriFaceBasisKey(k, m_base[2 * k], UseGLL);
901 }
902 break;
903 }
904
905 // Should never get here.
907}
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisSharedPtr &faceDirBasis)
LibUtilities::BasisKey EvaluateTriFaceBasisKey(const int facedir, const LibUtilities::BasisSharedPtr &faceDirBasis, bool UseGLL)

References ASSERTL2, Nektar::StdRegions::EvaluateQuadFaceBasisKey(), Nektar::StdRegions::EvaluateTriFaceBasisKey(), 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 1094 of file StdPrismExp.cpp.

1096{
1098 "Method only implemented if BasisType is identical"
1099 "in x and y directions");
1102 "Method only implemented for Modified_A BasisType"
1103 "(x and y direction) and Modified_B BasisType (z "
1104 "direction)");
1105 int p, q, r, idx = 0;
1106 int P = 0, Q = 0;
1107
1108 switch (fid)
1109 {
1110 case 0:
1111 P = m_base[0]->GetNumModes();
1112 Q = m_base[1]->GetNumModes();
1113 break;
1114 case 1:
1115 case 3:
1116 P = m_base[0]->GetNumModes();
1117 Q = m_base[2]->GetNumModes();
1118 break;
1119 case 2:
1120 case 4:
1121 P = m_base[1]->GetNumModes();
1122 Q = m_base[2]->GetNumModes();
1123 break;
1124 default:
1125 ASSERTL0(false, "fid must be between 0 and 4");
1126 }
1127
1128 if (maparray.size() != P * Q)
1129 {
1130 maparray = Array<OneD, unsigned int>(P * Q);
1131 }
1132
1133 // Set up ordering inside each 2D face. Also for triangular faces,
1134 // populate signarray.
1135 switch (fid)
1136 {
1137 case 0: // Bottom quad
1138 for (q = 0; q < Q; ++q)
1139 {
1140 for (p = 0; p < P; ++p)
1141 {
1142 maparray[q * P + p] = GetMode(p, q, 0);
1143 }
1144 }
1145 break;
1146 case 1: // Left triangle
1147 for (p = 0; p < P; ++p)
1148 {
1149 for (r = 0; r < Q - p; ++r)
1150 {
1151 maparray[idx++] = GetMode(p, 0, r);
1152 }
1153 }
1154 break;
1155 case 2: // Slanted quad
1156 for (q = 0; q < P; ++q)
1157 {
1158 maparray[q] = GetMode(1, q, 0);
1159 }
1160 for (q = 0; q < P; ++q)
1161 {
1162 maparray[P + q] = GetMode(0, q, 1);
1163 }
1164 for (r = 1; r < Q - 1; ++r)
1165 {
1166 for (q = 0; q < P; ++q)
1167 {
1168 maparray[(r + 1) * P + q] = GetMode(1, q, r);
1169 }
1170 }
1171 break;
1172 case 3: // Right triangle
1173 for (p = 0; p < P; ++p)
1174 {
1175 for (r = 0; r < Q - p; ++r)
1176 {
1177 maparray[idx++] = GetMode(p, 1, r);
1178 }
1179 }
1180 break;
1181 case 4: // Rear quad
1182 for (r = 0; r < Q; ++r)
1183 {
1184 for (q = 0; q < P; ++q)
1185 {
1186 maparray[r * P + q] = GetMode(0, q, r);
1187 }
1188 }
1189 break;
1190 default:
1191 ASSERTL0(false, "Face to element map unavailable.");
1192 }
1193}

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

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

1568{
1569 const int P = m_base[0]->GetNumModes() - 1;
1570 const int Q = m_base[1]->GetNumModes() - 1;
1571 const int R = m_base[2]->GetNumModes() - 1;
1572 const int nFaceIntCoeffs = v_GetTraceIntNcoeffs(fid);
1573 int p, q, r, idx = 0;
1574 int nummodesA = 0;
1575 int nummodesB = 0;
1576 int i = 0;
1577 int j = 0;
1578
1579 if (maparray.size() != nFaceIntCoeffs)
1580 {
1581 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1582 }
1583
1584 if (signarray.size() != nFaceIntCoeffs)
1585 {
1586 signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1587 }
1588 else
1589 {
1590 fill(signarray.data(), signarray.data() + nFaceIntCoeffs, 1);
1591 }
1592
1593 // Set up an array indexing for quad faces, since the ordering may
1594 // need to be transposed depending on orientation.
1595 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1596 if (fid != 1 && fid != 3)
1597 {
1598 if (fid == 0) // Base quad
1599 {
1600 nummodesA = P - 1;
1601 nummodesB = Q - 1;
1602 }
1603 else // front and back quad
1604 {
1605 nummodesA = Q - 1;
1606 nummodesB = R - 1;
1607 }
1608
1609 for (i = 0; i < nummodesB; i++)
1610 {
1611 for (j = 0; j < nummodesA; j++)
1612 {
1613 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1614 {
1615 arrayindx[i * nummodesA + j] = i * nummodesA + j;
1616 }
1617 else
1618 {
1619 arrayindx[i * nummodesA + j] = j * nummodesB + i;
1620 }
1621 }
1622 }
1623 }
1624
1625 switch (fid)
1626 {
1627 case 0: // Bottom quad
1628 for (q = 2; q <= Q; ++q)
1629 {
1630 for (p = 2; p <= P; ++p)
1631 {
1632 maparray[arrayindx[(q - 2) * nummodesA + (p - 2)]] =
1633 GetMode(p, q, 0);
1634 }
1635 }
1636 break;
1637
1638 case 1: // Left triangle
1639 for (p = 2; p <= P; ++p)
1640 {
1641 for (r = 1; r <= R - p; ++r)
1642 {
1643 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2)
1644 {
1645 signarray[idx] = p % 2 ? -1 : 1;
1646 }
1647 maparray[idx++] = GetMode(p, 0, r);
1648 }
1649 }
1650 break;
1651
1652 case 2: // Slanted quad
1653 for (r = 1; r <= R - 1; ++r)
1654 {
1655 for (q = 2; q <= Q; ++q)
1656 {
1657 maparray[arrayindx[(r - 1) * nummodesA + (q - 2)]] =
1658 GetMode(1, q, r);
1659 }
1660 }
1661 break;
1662
1663 case 3: // Right triangle
1664 for (p = 2; p <= P; ++p)
1665 {
1666 for (r = 1; r <= R - p; ++r)
1667 {
1668 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2)
1669 {
1670 signarray[idx] = p % 2 ? -1 : 1;
1671 }
1672 maparray[idx++] = GetMode(p, 1, r);
1673 }
1674 }
1675 break;
1676
1677 case 4: // Back quad
1678 for (r = 2; r <= R; ++r)
1679 {
1680 for (q = 2; q <= Q; ++q)
1681 {
1682 maparray[arrayindx[(r - 2) * nummodesA + (q - 2)]] =
1683 GetMode(0, q, r);
1684 }
1685 }
1686 break;
1687
1688 default:
1689 ASSERTL0(false, "Face interior map not available.");
1690 }
1691
1692 // Triangular faces are processed in the above switch loop; for
1693 // remaining quad faces, set up orientation if necessary.
1694 if (fid == 1 || fid == 3)
1695 {
1696 return;
1697 }
1698
1699 if (faceOrient == eDir1FwdDir1_Dir2BwdDir2 ||
1700 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1701 faceOrient == eDir1BwdDir2_Dir2FwdDir1 ||
1702 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1703 {
1704 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1705 {
1706 for (i = 1; i < nummodesB; i += 2)
1707 {
1708 for (j = 0; j < nummodesA; j++)
1709 {
1710 signarray[arrayindx[i * nummodesA + j]] *= -1;
1711 }
1712 }
1713 }
1714 else
1715 {
1716 for (i = 0; i < nummodesB; i++)
1717 {
1718 for (j = 1; j < nummodesA; j += 2)
1719 {
1720 signarray[arrayindx[i * nummodesA + j]] *= -1;
1721 }
1722 }
1723 }
1724 }
1725
1726 if (faceOrient == eDir1BwdDir1_Dir2FwdDir2 ||
1727 faceOrient == eDir1BwdDir1_Dir2BwdDir2 ||
1728 faceOrient == eDir1FwdDir2_Dir2BwdDir1 ||
1729 faceOrient == eDir1BwdDir2_Dir2BwdDir1)
1730 {
1731 if (faceOrient < eDir1FwdDir2_Dir2FwdDir1)
1732 {
1733 for (i = 0; i < nummodesB; i++)
1734 {
1735 for (j = 1; j < nummodesA; j += 2)
1736 {
1737 signarray[arrayindx[i * nummodesA + j]] *= -1;
1738 }
1739 }
1740 }
1741 else
1742 {
1743 for (i = 1; i < nummodesB; i += 2)
1744 {
1745 for (j = 0; j < nummodesA; j++)
1746 {
1747 signarray[arrayindx[i * nummodesA + j]] *= -1;
1748 }
1749 }
1750 }
1751 }
1752}
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, and v_GetTraceIntNcoeffs().

◆ v_GetTraceIntNcoeffs()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 819 of file StdPrismExp.cpp.

820{
821 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
822
823 int Pi = GetBasisNumModes(0) - 2;
824 int Qi = GetBasisNumModes(1) - 2;
825 int Ri = GetBasisNumModes(2) - 2;
826
827 if (i == 0)
828 {
829 return Pi * Qi;
830 }
831 else if (i == 1 || i == 3)
832 {
833 return Pi * (2 * Ri - Pi - 1) / 2;
834 }
835 else
836 {
837 return Qi * Ri;
838 }
839}

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

802{
803 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
804 if (i == 0)
805 {
806 return GetBasisNumModes(0) * GetBasisNumModes(1);
807 }
808 else if (i == 1 || i == 3)
809 {
810 int P = GetBasisNumModes(0) - 1, Q = GetBasisNumModes(2) - 1;
811 return Q + 1 + (P * (1 + 2 * Q - P)) / 2;
812 }
813 else
814 {
815 return GetBasisNumModes(1) * GetBasisNumModes(2);
816 }
817}

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

679{
680 int nummodes[3] = {m_base[0]->GetNumModes(), m_base[1]->GetNumModes(),
681 m_base[2]->GetNumModes()};
682 switch (fid)
683 {
684 // base quad
685 case 0:
686 {
687 numModes0 = nummodes[0];
688 numModes1 = nummodes[1];
689 }
690 break;
691 // front and back quad
692 case 2:
693 case 4:
694 {
695 numModes0 = nummodes[1];
696 numModes1 = nummodes[2];
697 }
698 break;
699 // triangles
700 case 1:
701 case 3:
702 {
703 numModes0 = nummodes[0];
704 numModes1 = nummodes[2];
705 }
706 break;
707 }
708
709 if (faceOrient >= eDir1FwdDir2_Dir2FwdDir1)
710 {
711 std::swap(numModes0, numModes1);
712 }
713}

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

842{
843 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
844
845 if (i == 0)
846 {
847 return m_base[0]->GetNumPoints() * m_base[1]->GetNumPoints();
848 }
849 else if (i == 1 || i == 3)
850 {
851 return m_base[0]->GetNumPoints() * m_base[2]->GetNumPoints();
852 }
853 else
854 {
855 return m_base[1]->GetNumPoints() * m_base[2]->GetNumPoints();
856 }
857}

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

861{
862 ASSERTL2(i >= 0 && i <= 4, "face id is out of range");
863 ASSERTL2(j == 0 || j == 1, "face direction is out of range");
864
865 if (i == 0)
866 {
867 return m_base[j]->GetPointsKey();
868 }
869 else if (i == 1 || i == 3)
870 {
871 return m_base[2 * j]->GetPointsKey();
872 }
873 else
874 {
875 return m_base[j + 1]->GetPointsKey();
876 }
877}

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

932{
936 "Mapping not defined for this type of basis");
937
938 int l = 0;
939
940 if (useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
941 {
942 switch (vId)
943 {
944 case 0:
945 l = GetMode(0, 0, 0);
946 break;
947 case 1:
948 l = GetMode(0, 0, 1);
949 break;
950 case 2:
951 l = GetMode(0, 1, 0);
952 break;
953 case 3:
954 l = GetMode(0, 1, 1);
955 break;
956 case 4:
957 l = GetMode(1, 0, 0);
958 break;
959 case 5:
960 l = GetMode(1, 1, 0);
961 break;
962 default:
963 ASSERTL0(false, "local vertex id must be between 0 and 5");
964 }
965 }
966 else
967 {
968 switch (vId)
969 {
970 case 0:
971 l = GetMode(0, 0, 0);
972 break;
973 case 1:
974 l = GetMode(1, 0, 0);
975 break;
976 case 2:
977 l = GetMode(1, 1, 0);
978 break;
979 case 3:
980 l = GetMode(0, 1, 0);
981 break;
982 case 4:
983 l = GetMode(0, 0, 1);
984 break;
985 case 5:
986 l = GetMode(0, 1, 1);
987 break;
988 default:
989 ASSERTL0(false, "local vertex id must be between 0 and 5");
990 }
991 }
992
993 return l;
994}

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

◆ v_IProductWRTBaseKernel()

void Nektar::StdRegions::StdPrismExp::v_IProductWRTBaseKernel ( 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,
const Array< OneD, NekDouble > &  jac,
const bool  Deformed,
bool  CollDir0 = false,
bool  CollDir1 = false,
bool  CollDir2 = false 
)
overrideprotectedvirtual

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

Parameters
base0- An array containing the values of the basis in the 0-direction at the quarature poitns
base1- An array containing the values of the basis in the 1-direction at the quarature poitns
base2- An array containing the values of the basis in the 2-direction at the quarature poitns
inarray- Array of values evaluated at the physical quadrature points
outarraythe values of the inner product with respect to each basis over region will be stored in the array outarray as output of the function
jac- An array of size 1 if not deformed or the number of quadrature points if deformed holding the values of the jacobian
Deformed- a bool identifying if the inner product is to be treated as a deformed or regular integration which just relates to how the
jacarray is treated

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 297 of file StdPrismExp.cpp.

305{
308 "Basis[1] is not a general tensor type");
309
312 "Basis[2] is not a general tensor type");
313
314 int nquad0 = m_base[0]->GetNumPoints();
315 int nquad1 = m_base[1]->GetNumPoints();
316 int nquad2 = m_base[2]->GetNumPoints();
317
318 int order0 = m_base[0]->GetNumModes();
319 int order1 = m_base[1]->GetNumModes();
320 int order2 = m_base[2]->GetNumModes();
321
322 const bool isModified =
323 (m_base[0]->GetBasisType() == LibUtilities::eModified_A);
324
325 std::vector<vec_t, tinysimd::allocator<vec_t>> wsp0(nquad1 * nquad2),
326 wsp1(nquad2), wsp2(order1);
327
328 // Swith statment using boost_pp and macros. This unfolls intwo a
329 // nested swtich statement where the outer swtich statement runs
330 // from SMIN to SMAX for modal order and the inner switch
331 // statemets run from the outer value of the case to 2*SMAX for
332 // the quadrature order. If you want to see it unwrapped compile
333 // in verbose mode and add --preprocess to the c++ command.
334 if (Deformed)
335 {
336 // Default case
337#undef IPRODUCTWRTBASE_DEF
338#define IPRODUCTWRTBASE_DEF \
339 IProductPrismKernel<false, false, true>( \
340 order0, order1, order2, nquad0, nquad1, nquad2, isModified, \
341 (const vec_t *)inarray.data(), base0.data(), base1.data(), \
342 base2.data(), m_weights[0].data(), m_weights[1].data(), \
343 m_weights[2].data(), (const vec_t *)jac.data(), (vec_t *)wsp0.data(), \
344 (vec_t *)wsp1.data(), (vec_t *)wsp2.data(), (vec_t *)outarray.data())
345
346 // Inner loop case over quarature points
347#undef IPRODUCTWRTBASE_Q
348#define IPRODUCTWRTBASE_Q(r, i) \
349 case NQ(i): \
350 IProductPrismKernel<false, false, true>( \
351 NM(i), NM(i), NM(i), NQ(i), NQ(i), NQ_M1(i), isModified, \
352 (const vec_t *)inarray.data(), base0.data(), base1.data(), \
353 base2.data(), m_weights[0].data(), m_weights[1].data(), \
354 m_weights[2].data(), (const vec_t *)jac.data(), \
355 (vec_t *)wsp0.data(), (vec_t *)wsp1.data(), (vec_t *)wsp2.data(), \
356 (vec_t *)outarray.data()); \
357 break;
358
359 // outer loop case over modes
360#undef IPRODUCTWRTBASE_M
361#define IPRODUCTWRTBASE_M(r, i) \
362 case NM(i): \
363 { \
364 switch (nquad0) \
365 { \
366 BOOST_PP_FOR_##r((NM(i), NM_P1(i), BOOST_PP_MUL(2, NM(i))), \
367 STDLEV2TEST1, STDLEV2UPDATE1, \
368 IPRODUCTWRTBASE_Q) default : IPRODUCTWRTBASE_DEF; \
369 break; \
370 } \
371 } \
372 break;
373
374 // templated cases on equi-ordered modes and standard quad usage
375 // where quad order goes from mode order to 2(*mode order)
376 if ((order0 == order1) && (order1 == order2) && (nquad0 == nquad1) &&
377 (nquad1 == nquad2 + 1))
378 {
379 switch (order0)
380 {
381 BOOST_PP_FOR((SMIN, 0, SMAX), STDLEV2TEST, STDLEV2UPDATE,
383 default:
385 break;
386 }
387 }
388 else
389 {
391 }
392 }
393 else // non-deformed case
394 {
395 // Default case
396#undef IPRODUCTWRTBASE_DEF
397#define IPRODUCTWRTBASE_DEF \
398 IProductPrismKernel<false, false, false>( \
399 order0, order1, order2, nquad0, nquad1, nquad2, isModified, \
400 (const vec_t *)inarray.data(), base0.data(), base1.data(), \
401 base2.data(), m_weights[0].data(), m_weights[1].data(), \
402 m_weights[2].data(), (const vec_t *)jac.data(), (vec_t *)wsp0.data(), \
403 (vec_t *)wsp1.data(), (vec_t *)wsp2.data(), (vec_t *)outarray.data())
404
405 // Inner loop case over quarature points
406#undef IPRODUCTWRTBASE_Q
407#define IPRODUCTWRTBASE_Q(r, i) \
408 case NQ(i): \
409 IProductPrismKernel<false, false, false>( \
410 NM(i), NM(i), NM(i), NQ(i), NQ(i), NQ_M1(i), isModified, \
411 (const vec_t *)inarray.data(), base0.data(), base1.data(), \
412 base2.data(), m_weights[0].data(), m_weights[1].data(), \
413 m_weights[2].data(), (const vec_t *)jac.data(), \
414 (vec_t *)wsp0.data(), (vec_t *)wsp1.data(), (vec_t *)wsp2.data(), \
415 (vec_t *)outarray.data()); \
416 break;
417
418 // outer loop case over modes
419#undef IPRODUCTWRTBASE_M
420#define IPRODUCTWRTBASE_M(r, i) \
421 case NM(i): \
422 { \
423 switch (nquad0) \
424 { \
425 BOOST_PP_FOR_##r((NM(i), NM_P1(i), BOOST_PP_MUL(2, NM(i))), \
426 STDLEV2TEST1, STDLEV2UPDATE1, \
427 IPRODUCTWRTBASE_Q) default : IPRODUCTWRTBASE_DEF; \
428 break; \
429 } \
430 } \
431 break;
432
433 // templated cases on equi-ordered modes and standard quad usage
434 // where quad order goes from mode order to 2(*mode order)
435 if ((order0 == order1) && (order1 == order2) && (nquad0 == nquad1) &&
436 (nquad1 == nquad2 + 1))
437 {
438 switch (order0)
439 {
440 BOOST_PP_FOR((SMIN, 0, SMAX), STDLEV2TEST, STDLEV2UPDATE,
442 default:
444 break;
445 }
446 }
447 else
448 {
450 }
451 }
452}
#define IPRODUCTWRTBASE_DEF
#define IPRODUCTWRTBASE_M(r, i)

References ASSERTL1, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, Nektar::StdRegions::StdExpansion::GetBasisType(), IPRODUCTWRTBASE_DEF, IPRODUCTWRTBASE_M, Nektar::StdRegions::StdExpansion::m_base, STDLEV2TEST, and STDLEV2UPDATE.

Referenced by Nektar::LocalRegions::PrismExp::v_IProductWRTDerivBase(), v_IProductWRTDerivBase(), and Nektar::LocalRegions::PrismExp::v_LaplacianMatrixOp_MatFree_Kernel().

◆ 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.

Definition at line 458 of file StdPrismExp.cpp.

461{
462 ASSERTL0(dir >= 0 && dir <= 2, "input dir is out of range");
463
464 int i;
465 int nquad0 = m_base[0]->GetNumPoints();
466 int nquad1 = m_base[1]->GetNumPoints();
467 int nquad2 = m_base[2]->GetNumPoints();
468
469 Array<OneD, NekDouble> tmp0(nquad0 * nquad1 * nquad2);
470
471 StdFacKey fackey2(eTwoOverOneMinusZ2, m_base[2]->GetBasisKey());
472 Array<OneD, const NekDouble> gfac2 = GetStdFac(fackey2);
473
474 const Array<OneD, const NekDouble> one(1, 1.0);
475
476 // Scale first derivative term by gfac2.
477 if (dir != 1)
478 {
479 for (i = 0; i < nquad2; ++i)
480 {
481 Vmath::Smul(nquad0 * nquad1, gfac2[i],
482 &inarray[0] + i * nquad0 * nquad1, 1,
483 &tmp0[0] + i * nquad0 * nquad1, 1);
484 }
485 }
486
487 switch (dir)
488 {
489 case 0:
490 {
492 m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
493 m_base[2]->GetBdata(), tmp0, outarray, one, false);
494 }
495 break;
496 case 1:
497 {
499 m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
500 m_base[2]->GetBdata(), inarray, outarray, one, false);
501 }
502 break;
503 case 2:
504 {
505 Array<OneD, NekDouble> tmp1(m_ncoeffs);
506
507 StdFacKey fackey0(eHalfMultOnePlusZ0, m_base[0]->GetBasisKey());
508 Array<OneD, const NekDouble> gfac0 = GetStdFac(fackey0);
509
510 // Scale eta_1 derivative with gfac0.
511 for (i = 0; i < nquad1 * nquad2; ++i)
512 {
513 Vmath::Vmul(nquad0, &gfac0[0], 1, &tmp0[0] + i * nquad0, 1,
514 &tmp0[0] + i * nquad0, 1);
515 }
516
518 m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
519 m_base[2]->GetBdata(), tmp0, tmp1, one, false);
520
522 m_base[0]->GetBdata(), m_base[1]->GetBdata(),
523 m_base[2]->GetDbdata(), inarray, outarray, one, false);
524
525 Vmath::Vadd(m_ncoeffs, &tmp1[0], 1, &outarray[0], 1, &outarray[0],
526 1);
527 break;
528 }
529 }
530}
void v_IProductWRTBaseKernel(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, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false, bool CollDir2=false) override
Inner product of inarray over region with respect to the expansion basis (this)->m_base[0] and return...
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:74
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:182

References ASSERTL0, Nektar::StdRegions::eHalfMultOnePlusZ0, Nektar::StdRegions::eTwoOverOneMinusZ2, Nektar::StdRegions::StdExpansion::GetStdFac(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Smul(), v_IProductWRTBaseKernel(), Vmath::Vadd(), and Vmath::Vmul().

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

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

558{
559 xi[0] = (1.0 + eta[0]) * (1.0 - eta[2]) * 0.5 - 1.0;
560 xi[1] = eta[1];
561 xi[2] = eta[2];
562}

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

538{
539 NekDouble d2 = 1.0 - xi[2];
540 if (fabs(d2) < NekConstants::kNekZeroTol)
541 {
542 if (d2 >= 0.)
543 {
545 }
546 else
547 {
549 }
550 }
551 eta[2] = xi[2]; // eta_z = xi_z
552 eta[1] = xi[1]; // eta_y = xi_y
553 eta[0] = 2.0 * (1.0 + xi[0]) / d2 - 1.0;
554}
static const NekDouble kNekZeroTol

References Nektar::NekConstants::kNekZeroTol.

◆ v_NumBndryCoeffs()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 761 of file StdPrismExp.cpp.

762{
765 "BasisType is not a boundary interior form");
768 "BasisType is not a boundary interior form");
771 "BasisType is not a boundary interior form");
772
773 int P = m_base[0]->GetNumModes();
774 int Q = m_base[1]->GetNumModes();
775 int R = m_base[2]->GetNumModes();
776
778}
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)

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

781{
784 "BasisType is not a boundary interior form");
787 "BasisType is not a boundary interior form");
790 "BasisType is not a boundary interior form");
791
792 int P = m_base[0]->GetNumModes() - 1;
793 int Q = m_base[1]->GetNumModes() - 1;
794 int R = m_base[2]->GetNumModes() - 1;
795
796 return (P + 1) * (Q + 1) // 1 rect. face on base
797 + 2 * (Q + 1) * (R + 1) // other 2 rect. faces
798 + 2 * (R + 1) + P * (1 + 2 * R - P); // 2 tri. faces
799}

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

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 622 of file StdPrismExp.cpp.

626{
627 // Collapse coordinates
628 Array<OneD, NekDouble> coll(3, 0.0);
629 LocCoordToLocCollapsed(coord, coll);
630
631 // If near singularity do the old interpolation matrix method
632 // @TODO: Dave thinks there might be a way in the Barycentric to
633 // mathematically remove this singularity?
634 if ((1 - coll[2]) < 1e-5)
635 {
636 int totPoints = GetTotPoints();
637 Array<OneD, NekDouble> EphysDeriv0(totPoints), EphysDeriv1(totPoints),
638 EphysDeriv2(totPoints);
639 v_PhysDeriv(inarray, EphysDeriv0, EphysDeriv1, EphysDeriv2);
640
641 Array<OneD, DNekMatSharedPtr> I(3);
642 I[0] = GetBase()[0]->GetI(coll);
643 I[1] = GetBase()[1]->GetI(coll + 1);
644 I[2] = GetBase()[2]->GetI(coll + 2);
645
646 firstOrderDerivs[0] = PhysEvaluate(I, EphysDeriv0);
647 firstOrderDerivs[1] = PhysEvaluate(I, EphysDeriv1);
648 firstOrderDerivs[2] = PhysEvaluate(I, EphysDeriv2);
649 return PhysEvaluate(I, inarray);
650 }
651
652 NekDouble val = BaryTensorDeriv(coll, inarray, firstOrderDerivs);
653
654 NekDouble dEta_bar1 = firstOrderDerivs[0];
655
656 NekDouble fac = 2.0 / (1.0 - coll[2]);
657 firstOrderDerivs[0] = fac * dEta_bar1;
658
659 // divide dEta_Bar1 by (1-eta_z)
660 fac = 1.0 / (1.0 - coll[2]);
661 dEta_bar1 = fac * dEta_bar1;
662
663 // Multiply dEta_Bar1 by (1+eta_x) and add ot out_dxi3
664 fac = 1.0 + coll[0];
665 firstOrderDerivs[2] += fac * dEta_bar1;
666
667 return val;
668}
NekDouble BaryTensorDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
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.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase() const
This function gets the shared point to basis.
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.

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

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

593{
594 Array<OneD, NekDouble> coll(3);
595 LocCoordToLocCollapsed(coords, coll);
596
597 const int nm1 = m_base[1]->GetNumModes();
598 const int nm2 = m_base[2]->GetNumModes();
599 const int b = 2 * nm2 + 1;
600
601 const int mode0 = floor(0.5 * (b - sqrt(b * b - 8.0 * mode / nm1)));
602 const int tmp =
603 mode - nm1 * (mode0 * (nm2 - 1) + 1 - (mode0 - 2) * (mode0 - 1) / 2);
604 const int mode1 = tmp / (nm2 - mode0);
605 const int mode2 = tmp % (nm2 - mode0);
606
607 if (mode0 == 0 && mode2 == 1 &&
609 {
610 // handle collapsed top edge to remove mode0 terms
611 return StdExpansion::BaryEvaluateBasis<1>(coll[1], mode1) *
612 StdExpansion::BaryEvaluateBasis<2>(coll[2], mode2);
613 }
614 else
615 {
616 return StdExpansion::BaryEvaluateBasis<0>(coll[0], mode0) *
617 StdExpansion::BaryEvaluateBasis<1>(coll[1], mode1) *
618 StdExpansion::BaryEvaluateBasis<2>(coll[2], mode2);
619 }
620}
scalarT< T > sqrt(scalarT< T > in)
Definition scalar.hpp:289

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

2088{
2089 int nquad0 = m_base[0]->GetNumPoints();
2090 int nquad1 = m_base[1]->GetNumPoints();
2091 int nquad2 = m_base[2]->GetNumPoints();
2092 int nqtot = nquad0 * nquad1 * nquad2;
2093 int nmodes0 = m_base[0]->GetNumModes();
2094 int nmodes1 = m_base[1]->GetNumModes();
2095 int nmodes2 = m_base[2]->GetNumModes();
2096 int numMax = nmodes0;
2097
2098 Array<OneD, NekDouble> coeff(m_ncoeffs);
2099 Array<OneD, NekDouble> coeff_tmp1(m_ncoeffs, 0.0);
2100 Array<OneD, NekDouble> phys_tmp(nqtot, 0.0);
2101 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
2102
2103 const LibUtilities::PointsKey Pkey0 = m_base[0]->GetPointsKey();
2104 const LibUtilities::PointsKey Pkey1 = m_base[1]->GetPointsKey();
2105 const LibUtilities::PointsKey Pkey2 = m_base[2]->GetPointsKey();
2106
2107 LibUtilities::BasisKey bortho0(LibUtilities::eOrtho_A, nmodes0, Pkey0);
2108 LibUtilities::BasisKey bortho1(LibUtilities::eOrtho_A, nmodes1, Pkey1);
2109 LibUtilities::BasisKey bortho2(LibUtilities::eOrtho_B, nmodes2, Pkey2);
2110
2111 int cnt = 0;
2112 int u = 0;
2113 int i = 0;
2115
2117 bortho0, bortho1, bortho2);
2118
2119 BwdTrans(inarray, phys_tmp);
2120 OrthoPrismExp->FwdTrans(phys_tmp, coeff);
2121
2122 // filtering
2123 for (u = 0; u < numMin; ++u)
2124 {
2125 for (i = 0; i < numMin; ++i)
2126 {
2127 Vmath::Vcopy(numMin - u, tmp = coeff + cnt, 1,
2128 tmp2 = coeff_tmp1 + cnt, 1);
2129 cnt += numMax - u;
2130 }
2131
2132 for (i = numMin; i < numMax; ++i)
2133 {
2134 cnt += numMax - u;
2135 }
2136 }
2137
2138 OrthoPrismExp->BwdTrans(coeff_tmp1, phys_tmp);
2139 StdPrismExp::FwdTrans(phys_tmp, outarray);
2140}
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space.
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
@ eOrtho_A
Principle Orthogonal Functions .
Definition BasisType.h:42
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr

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

void Nektar::StdRegions::StdPrismExp::v_StdPhysDeriv ( 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.

Definition at line 91 of file StdPrismExp.cpp.

95{
96 int Qx = m_base[0]->GetNumPoints();
97 int Qy = m_base[1]->GetNumPoints();
98 int Qz = m_base[2]->GetNumPoints();
99 int Qtot = Qx * Qy * Qz;
100
101 Array<OneD, NekDouble> dEta_bar1(Qtot, 0.0);
102
103 Array<OneD, const NekDouble> eta_x, eta_z;
104 eta_x = m_base[0]->GetZ();
105 eta_z = m_base[2]->GetZ();
106
107 int i, k;
108
109 bool Do_1 = (out_dxi1.size() > 0) ? true : false;
110 bool Do_3 = (out_dxi3.size() > 0) ? true : false;
111
112 // out_dXi2 is just a tensor derivative so is just passed through
113 if (Do_3)
114 {
115 PhysTensorDeriv(u_physical, dEta_bar1, out_dxi2, out_dxi3);
116 }
117 else if (Do_1)
118 {
119 PhysTensorDeriv(u_physical, dEta_bar1, out_dxi2, NullNekDouble1DArray);
120 }
121 else // case if just require 2nd direction
122 {
123 PhysTensorDeriv(u_physical, NullNekDouble1DArray, out_dxi2,
125 }
126
127 if (Do_1)
128 {
129 for (k = 0; k < Qz; ++k)
130 {
131 Vmath::Smul(Qx * Qy, 2.0 / (1.0 - eta_z[k]),
132 &dEta_bar1[0] + k * Qx * Qy, 1,
133 &out_dxi1[0] + k * Qx * Qy, 1);
134 }
135 }
136
137 if (Do_3)
138 {
139 // divide dEta_Bar1 by (1-eta_z)
140 for (k = 0; k < Qz; ++k)
141 {
142 Vmath::Smul(Qx * Qy, 1.0 / (1.0 - eta_z[k]),
143 &dEta_bar1[0] + k * Qx * Qy, 1,
144 &dEta_bar1[0] + k * Qx * Qy, 1);
145 }
146
147 // Multiply dEta_Bar1 by (1+eta_x) and add ot out_dxi3
148 for (i = 0; i < Qx; ++i)
149 {
150 Vmath::Svtvp(Qz * Qy, 1.0 + eta_x[i], &dEta_bar1[0] + i, Qx,
151 &out_dxi3[0] + i, Qx, &out_dxi3[0] + i, Qx);
152 }
153 }
154}
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
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:398

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

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1947 of file StdPrismExp.cpp.

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

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, Nektar::StdRegions::StdExpansion::m_base, tinysimd::max(), and tinysimd::min().