Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Nektar::StdRegions::StdExpansion3D Class Referenceabstract

#include <StdExpansion3D.h>

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

Public Member Functions

 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::BasisSharedPtrGetBasis (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.
 
const LibUtilities::BasisKey GetTraceBasisKey (const int i, int k=-1, bool UseGLL=false) const
 This function returns the basis key belonging to the i-th trace.
 
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 ()
 
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 NekDoubleGetStdFac (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 int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_\infty\) error \( |\epsilon|_\infty = \max |u - u_{exact}|\) where \( u_{exact}\) is given by the array sol.
 
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)
 

Protected Member Functions

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
 
virtual 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)=0
 
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
 
virtual int v_GetNedges (void) const
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
NekDouble BaryTensorDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 
virtual void v_GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
 
void v_GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient, int P, int Q) override
 
void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat) override
 
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 int v_GetNverts () const =0
 
virtual int v_GetNtraces () const =0
 
virtual int v_NumBndryCoeffs () const =0
 
virtual int v_NumDGBndryCoeffs () const =0
 
virtual int v_GetTraceNcoeffs (const int i) const =0
 
virtual int v_GetTraceIntNcoeffs (const int i) const =0
 
virtual int v_GetTraceNumPoints (const int i) const =0
 
virtual const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int k, bool UseGLL=false) const
 
virtual LibUtilities::PointsKey v_GetTracePointsKey (const int i, const int j) const
 
virtual const LibUtilities::PointsKey v_GetNodalPointsKey () const
 
virtual LibUtilities::ShapeType v_DetShapeType () const =0
 
virtual bool v_IsBoundaryInteriorExpansion () const
 
virtual bool v_IsNodalNonTensorialExp ()
 
virtual void v_NodalToModal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
 
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_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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 void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 
virtual NekDouble v_PhysEvalFirstDeriv (const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
 
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 NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode)
 
virtual void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 
virtual void v_LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
virtual DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey)
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey)
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
 
virtual void v_GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 
virtual int v_GetCoordim () const
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual void v_GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray)
 
virtual void v_GetElmtTraceToTraceMap (const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
virtual void v_GetTraceInteriorToElementMap (const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
 
virtual void v_GetTraceNumModes (const int fid, int &numModes0, int &numModes1, Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
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_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
virtual void v_ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
virtual void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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)
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
std::vector< Array< OneD, const NekDouble > > m_weights
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 
LibUtilities::NekManager< StdFacKey, Array< OneD, const NekDouble > > m_stdFacManager
 

Detailed Description

Definition at line 47 of file StdExpansion3D.h.

Constructor & Destructor Documentation

◆ StdExpansion3D() [1/3]

Nektar::StdRegions::StdExpansion3D::StdExpansion3D ( int  numcoeffs,
const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc 
)

Definition at line 54 of file StdExpansion3D.cpp.

59{
60}

◆ StdExpansion3D() [2/3]

Nektar::StdRegions::StdExpansion3D::StdExpansion3D ( )
default

◆ StdExpansion3D() [3/3]

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

◆ ~StdExpansion3D()

Nektar::StdRegions::StdExpansion3D::~StdExpansion3D ( )
overridedefault

Member Function Documentation

◆ BaryTensorDeriv()

NekDouble Nektar::StdRegions::StdExpansion3D::BaryTensorDeriv ( const Array< OneD, NekDouble > &  coord,
const Array< OneD, const NekDouble > &  inarray,
std::array< NekDouble, 3 > &  firstOrderDerivs 
)
inlineprotected

Performs tensor product evaluation in 3D to evaluate the physical and derivative values in each direction at input coordinate

Parameters
coordusing input physical values at quadrature points
inarray.Returns via reference the derivatives.
coordGlobal coordinate
inarrayPhys values
out_d0Return by reference parameter for 0th derivative
out_d1Return by reference parameter for 1st derivative
out_d2Return by reference parameter for 2nd derivative
Returns
Physical value at
Parameters
coord

Definition at line 216 of file StdExpansion3D.h.

220 {
221 const int nq0 = m_base[0]->GetNumPoints();
222 const int nq1 = m_base[1]->GetNumPoints();
223 const int nq2 = m_base[2]->GetNumPoints();
224
225 const NekDouble *ptr = &inarray[0];
226 Array<OneD, NekDouble> deriv0(nq1 * nq2, 0.0);
227 Array<OneD, NekDouble> phys0(nq1 * nq2, 0.0);
228 Array<OneD, NekDouble> deriv0phys1(nq1, 0.0);
229 Array<OneD, NekDouble> phys0deriv1(nq1, 0.0);
230 Array<OneD, NekDouble> phys0phys1(nq1, 0.0);
231
232 for (int j = 0; j < nq1 * nq2; ++j, ptr += nq0)
233 {
234 phys0[j] =
235 StdExpansion::BaryEvaluate<0, true>(coord[0], ptr, deriv0[j]);
236 }
237
238 for (int j = 0; j < nq2; ++j)
239 {
240 deriv0phys1[j] = StdExpansion::BaryEvaluate<1, false>(
241 coord[1], &deriv0[j * nq1]);
242 }
243 firstOrderDerivs[0] =
244 StdExpansion::BaryEvaluate<2, false>(coord[2], &deriv0phys1[0]);
245
246 for (int j = 0; j < nq2; ++j)
247 {
248 phys0phys1[j] = StdExpansion::BaryEvaluate<1, true>(
249 coord[1], &phys0[j * nq1], phys0deriv1[j]);
250 }
251 firstOrderDerivs[1] =
252 StdExpansion::BaryEvaluate<2, false>(coord[2], &phys0deriv1[0]);
253
254 return StdExpansion::BaryEvaluate<2, true>(coord[2], &phys0phys1[0],
255 firstOrderDerivs[2]);
256 }
Array< OneD, LibUtilities::BasisSharedPtr > m_base

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

Referenced by Nektar::StdRegions::StdHexExp::v_PhysEvalFirstDeriv(), Nektar::StdRegions::StdPrismExp::v_PhysEvalFirstDeriv(), Nektar::StdRegions::StdPyrExp::v_PhysEvalFirstDeriv(), and Nektar::StdRegions::StdTetExp::v_PhysEvalFirstDeriv().

◆ GetEdgeInteriorToElementMap()

void Nektar::StdRegions::StdExpansion3D::GetEdgeInteriorToElementMap ( const int  tid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
Orientation  traceOrient = eForwards 
)
inline

Definition at line 91 of file StdExpansion3D.h.

95 {
96 v_GetEdgeInteriorToElementMap(tid, maparray, signarray, traceOrient);
97 }
virtual void v_GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)

References v_GetEdgeInteriorToElementMap().

Referenced by Nektar::LocalRegions::Expansion3D::GetEdgeInverseBoundaryMap(), and Nektar::LocalRegions::Expansion3D::GetInverseBoundaryMaps().

◆ GetEdgeNcoeffs()

int Nektar::StdRegions::StdExpansion3D::GetEdgeNcoeffs ( const int  i) const
inline

This function returns the number of expansion coefficients belonging to the i-th edge.

This function is a wrapper around the virtual function v_GetEdgeNcoeffs()

Parameters
ispecifies which edge
Returns
returns the number of expansion coefficients belonging to the i-th edge

Definition at line 86 of file StdExpansion3D.h.

87 {
88 return v_GetEdgeNcoeffs(i);
89 }
virtual int v_GetEdgeNcoeffs(const int i) const

References v_GetEdgeNcoeffs().

Referenced by Nektar::LocalRegions::Expansion3D::GetEdgeInverseBoundaryMap(), Nektar::LocalRegions::Expansion3D::GetInverseBoundaryMaps(), Nektar::LocalRegions::Expansion3D::v_BuildInverseTransformationMatrix(), Nektar::MultiRegions::PreconditionerLowEnergy::v_BuildPreconditioner(), Nektar::LocalRegions::Expansion3D::v_BuildTransformationMatrix(), and Nektar::StdRegions::StdHexExp::v_GetEdgeInteriorToElementMap().

◆ GetNedges()

int Nektar::StdRegions::StdExpansion3D::GetNedges ( ) const
inline

◆ IProductWRTBaseKernel()

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

Definition at line 62 of file StdExpansion3D.cpp.

70{
71 v_IProductWRTBaseKernel(base0, base1, base2, inarray, outarray, jac,
72 Deformed, CollDir0, CollDir1, CollDir2);
73}
virtual 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)=0

References v_IProductWRTBaseKernel().

◆ PhysTensorDeriv()

void Nektar::StdRegions::StdExpansion3D::PhysTensorDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 
)
protected

Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points.

This function is independent of the expansion basis and can therefore be defined for all tensor product distribution of quadrature points in a generic manner. The key operations are:

  • \( \frac{d}{d\eta_1} \rightarrow {\bf D^T_0 u } \)
  • \( \frac{d}{d\eta_2} \rightarrow {\bf D_1 u } \)
  • \( \frac{d}{d\eta_3} \rightarrow {\bf D_2 u } \)
Parameters
inarrayarray of physical points to be differentiated
out_d0the resulting array of derivative in the \(\eta_1\) direction will be stored in out_d0 as output of the function
out_d1the resulting array of derivative in the \(\eta_2\) direction will be stored in out_d1 as output of the function
out_d2the resulting array of derivative in the \(\eta_3\) direction will be stored in out_d2 as output of the function

Recall that: \( \hspace{1cm} \begin{array}{llll} \mbox{Shape} & \mbox{Cartesian coordinate range} & \mbox{Collapsed coord.} & \mbox{Collapsed coordinate definition}\\ \mbox{Hexahedral} & -1 \leq \xi_1,\xi_2, \xi_3 \leq 1 & -1 \leq \eta_1,\eta_2, \eta_3 \leq 1 & \eta_1 = \xi_1, \eta_2 = \xi_2, \eta_3 = \xi_3 \\ \mbox{Tetrahedral} & -1 \leq \xi_1,\xi_2,\xi_3; \xi_1+\xi_2 +\xi_3 \leq -1 & -1 \leq \eta_1,\eta_2, \eta_3 \leq 1 & \eta_1 = \frac{2(1+\xi_1)}{-\xi_2 -\xi_3}-1, \eta_2 = \frac{2(1+\xi_2)}{1 - \xi_3}-1, \eta_3 = \xi_3 \\ \end{array} \)

Definition at line 132 of file StdExpansion3D.cpp.

135{
136 const int nquad0 = m_base[0]->GetNumPoints();
137 const int nquad1 = m_base[1]->GetNumPoints();
138 const int nquad2 = m_base[2]->GetNumPoints();
139
140 bool Deriv0 = (out_d0.size() > 0);
141 bool Deriv1 = (out_d1.size() > 0);
142 bool Deriv2 = (out_d2.size() > 0);
143 const NekDouble *D0 = m_base[0]->GetD()->GetRawPtr();
144 const NekDouble *D1 = m_base[1]->GetD()->GetRawPtr();
145 const NekDouble *D2 = m_base[2]->GetD()->GetRawPtr();
146
147 Array<OneD, const NekDouble> intmp;
148 // copy inarray data if inarray and outarray are the same.
149 if ((inarray.data() == out_d0.data()) ||
150 (inarray.data() == out_d1.data()) || (inarray.data() == out_d2.data()))
151 {
152 Array<OneD, NekDouble> wsp(nquad0 * nquad1 * nquad2);
153 CopyArray(inarray, wsp);
154 intmp = wsp;
155 }
156 else
157 {
158 intmp = inarray;
159 }
160
161 // Switch statment using boost_pp and macros. This unfolls into a
162 // nested switch statement which runs from SMIN to SMAX for quadratrure
163 // order. If you want to see it unwrapped compile in verbose mode and add
164 // --preprocess to the c++ command. Default case
165#undef PHYSDERIV_DEF
166#define PHYSDERIV_DEF \
167 PhysDerivTensor3DKernel(nquad0, nquad1, nquad2, \
168 (const vec_t *)intmp.data(), (const vec_t *)D0, \
169 (const vec_t *)D1, (const vec_t *)D2, \
170 (vec_t *)out_d0.data(), (vec_t *)out_d1.data(), \
171 (vec_t *)out_d2.data(), Deriv0, Deriv1, Deriv2)
172
173 // Loop case over quarature points
174#undef PHYSDERIV_Q
175#define PHYSDERIV_Q(r, i) \
176 case NQ1(i): \
177 PhysDerivTensor3DKernel( \
178 NQ1(i), NQ1(i), NQ1(i), (const vec_t *)intmp.data(), \
179 (const vec_t *)D0, (const vec_t *)D1, (const vec_t *)D2, \
180 (vec_t *)out_d0.data(), (vec_t *)out_d1.data(), \
181 (vec_t *)out_d2.data(), Deriv0, Deriv1, Deriv2); \
182 break;
183
184 // templated cases on standard quadrature
185 // usage where quad order goes from SMIN to SMAX
186 if ((nquad0 == nquad1) && (nquad1 == nquad2))
187 {
188 switch (nquad0)
189 {
190 BOOST_PP_FOR((SMIN, SMAX), STDLEV1TEST, STDLEV1UPDATE, PHYSDERIV_Q);
191 default:
193 break;
194 }
195 }
196 else
197 {
199 }
200}
#define PHYSDERIV_Q(r, i)
#define PHYSDERIV_DEF
#define STDLEV1UPDATE(r, state)
#define STDLEV1TEST(r, state)
void CopyArray(const Array< OneD, ConstDataType > &source, Array< OneD, DataType > &dest)

References Nektar::CopyArray(), Nektar::StdRegions::StdExpansion::m_base, PHYSDERIV_DEF, PHYSDERIV_Q, STDLEV1TEST, and STDLEV1UPDATE.

Referenced by Nektar::LocalRegions::HexExp::v_LaplacianMatrixOp_MatFree_Kernel(), Nektar::LocalRegions::PrismExp::v_LaplacianMatrixOp_MatFree_Kernel(), Nektar::StdRegions::StdHexExp::v_StdPhysDeriv(), Nektar::StdRegions::StdPrismExp::v_StdPhysDeriv(), Nektar::StdRegions::StdPyrExp::v_StdPhysDeriv(), and Nektar::StdRegions::StdTetExp::v_StdPhysDeriv().

◆ v_GenStdMatBwdDeriv()

void Nektar::StdRegions::StdExpansion3D::v_GenStdMatBwdDeriv ( const int  dir,
DNekMatSharedPtr mat 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 75 of file StdExpansion3D.cpp.

76{
77 ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
78
79 const int nq0 = m_base[0]->GetNumPoints();
80 const int nq1 = m_base[1]->GetNumPoints();
81 const int nq2 = m_base[2]->GetNumPoints();
82 const int nq = nq0 * nq1 * nq2;
83
84 const bool CollDir0 = m_base[0]->Collocation();
85 const bool CollDir1 = m_base[1]->Collocation();
86 const bool CollDir2 = m_base[2]->Collocation();
87
88 Array<OneD, NekDouble> in(nq, 0.0);
89 Array<OneD, NekDouble> out(m_ncoeffs);
90 Array<OneD, NekDouble> one(1, 1.0);
91
92 for (int i = 0; i < nq; i++)
93 {
94 int l = i % nq0;
95 int m = (i / nq0) % nq1;
96 int n = i / (nq0 * nq1);
97
98 // initialise with inverse of weights t
99 in[i] = 1.0 / (m_weights[0][l] * m_weights[1][m] * m_weights[2][n]);
100
101 // do standard iproduct
102 if (dir == 0)
103 {
104 v_IProductWRTBaseKernel(m_base[0]->GetDbdata(),
105 m_base[1]->GetBdata(),
106 m_base[2]->GetBdata(), in, out, one, false,
107 false, CollDir1, CollDir2);
108 }
109 else if (dir == 1)
110 {
111 v_IProductWRTBaseKernel(m_base[0]->GetBdata(),
112 m_base[1]->GetDbdata(),
113 m_base[2]->GetBdata(), in, out, one, false,
114 CollDir0, false, CollDir2);
115 }
116 else // dir == 2
117 {
118 v_IProductWRTBaseKernel(m_base[0]->GetBdata(),
119 m_base[1]->GetBdata(),
120 m_base[2]->GetDbdata(), in, out, one, false,
121 CollDir0, CollDir1, false);
122 }
123 in[i] = 0.0;
124
125 for (int j = 0; j < m_ncoeffs; j++)
126 {
127 (*mat)(j, i) = out[j];
128 }
129 }
130}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
std::vector< Array< OneD, const NekDouble > > m_weights

References ASSERTL1, Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::m_weights, and v_IProductWRTBaseKernel().

◆ v_GetEdgeInteriorToElementMap()

void Nektar::StdRegions::StdExpansion3D::v_GetEdgeInteriorToElementMap ( const int  tid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
Orientation  traceOrient = eForwards 
)
protectedvirtual

Reimplemented in Nektar::StdRegions::StdHexExp, Nektar::StdRegions::StdPrismExp, Nektar::StdRegions::StdPyrExp, and Nektar::StdRegions::StdTetExp.

Definition at line 499 of file StdExpansion3D.cpp.

504{
505 NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
506}
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetEdgeInteriorToElementMap().

◆ v_GetEdgeNcoeffs()

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

Reimplemented in Nektar::StdRegions::StdHexExp, Nektar::StdRegions::StdPrismExp, Nektar::StdRegions::StdPyrExp, and Nektar::StdRegions::StdTetExp.

Definition at line 493 of file StdExpansion3D.cpp.

494{
495 NEKERROR(ErrorUtil::efatal, "This function is not valid or not defined");
496 return 0;
497}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetEdgeNcoeffs().

◆ v_GetNedges()

int Nektar::StdRegions::StdExpansion3D::v_GetNedges ( void  ) const
protectedvirtual

Reimplemented in Nektar::StdRegions::StdPrismExp, Nektar::StdRegions::StdHexExp, Nektar::StdRegions::StdPyrExp, and Nektar::StdRegions::StdTetExp.

Definition at line 487 of file StdExpansion3D.cpp.

488{
489 NEKERROR(ErrorUtil::efatal, "This function is not valid or not defined");
490 return 0;
491}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNedges().

◆ v_GetShapeDimension()

int Nektar::StdRegions::StdExpansion3D::v_GetShapeDimension ( ) const
inlinefinalprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 279 of file StdExpansion3D.h.

280 {
281 return 3;
282 }

◆ v_GetTraceToElementMap()

void Nektar::StdRegions::StdExpansion3D::v_GetTraceToElementMap ( const int  tid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
Orientation  traceOrient,
int  P,
int  Q 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 508 of file StdExpansion3D.cpp.

513{
514 Array<OneD, unsigned int> map1, map2;
515 GetTraceCoeffMap(tid, map1);
516 GetElmtTraceToTraceMap(tid, map2, signarray, traceOrient, P, Q);
517
518 if (maparray.size() != map2.size())
519 {
520 maparray = Array<OneD, unsigned int>(map2.size());
521 }
522
523 for (int i = 0; i < map2.size(); ++i)
524 {
525 maparray[i] = map1[map2[i]];
526 }
527}
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 GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray)

References Nektar::StdRegions::StdExpansion::GetElmtTraceToTraceMap(), Nektar::StdRegions::StdExpansion::GetTraceCoeffMap(), and Nektar::LibUtilities::P.

◆ v_HelmholtzMatrixOp_MatFree()

void Nektar::StdRegions::StdExpansion3D::v_HelmholtzMatrixOp_MatFree ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 430 of file StdExpansion3D.cpp.

433{
434 if (mkey.GetNVarCoeff() == 0 &&
435 !mkey.ConstFactorExists(StdRegions::eFactorCoeffD00))
436 {
437 using std::max;
438
439 int nquad0 = m_base[0]->GetNumPoints();
440 int nquad1 = m_base[1]->GetNumPoints();
441 int nquad2 = m_base[2]->GetNumPoints();
442 int nmodes0 = m_base[0]->GetNumModes();
443 int nmodes1 = m_base[1]->GetNumModes();
444 int nmodes2 = m_base[2]->GetNumModes();
445 int wspsize = max(nquad0 * nmodes2 * (nmodes1 + nquad1),
446 nquad0 * nquad1 * (nquad2 + nmodes0) +
447 nmodes0 * nmodes1 * nquad2);
448
449 NekDouble lambda = mkey.GetConstFactor(StdRegions::eFactorLambda);
450
451 Array<OneD, NekDouble> wsp0(8 * wspsize);
452 Array<OneD, NekDouble> wsp1(wsp0 + 1 * wspsize);
453 Array<OneD, NekDouble> wsp2(wsp0 + 2 * wspsize);
454
455 if (!(m_base[0]->Collocation() && m_base[1]->Collocation() &&
456 m_base[2]->Collocation()))
457 {
458 // MASS MATRIX OPERATION
459 // The following is being calculated:
460 // wsp0 = B * u_hat = u
461 // wsp1 = W * wsp0
462 // outarray = B^T * wsp1 = B^T * W * B * u_hat = M * u_hat
463 BwdTrans(inarray, wsp0);
464 IProductWRTBase(wsp0, outarray);
465 LaplacianMatrixOp_MatFree_Kernel(wsp0, wsp1, wsp2);
466 }
467 else
468 {
469 // specialised implementation for the classical spectral
470 // element method
471 MultiplyByQuadratureMetric(inarray, outarray);
472 LaplacianMatrixOp_MatFree_Kernel(inarray, wsp1, wsp2);
473 }
474
475 // outarray = lambda * outarray + wsp1
476 // = (lambda * M + L ) * u_hat
477 Vmath::Svtvp(m_ncoeffs, lambda, &outarray[0], 1, &wsp1[0], 1,
478 &outarray[0], 1);
479 }
480 else
481 {
483 mkey);
484 }
485}
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 expa...
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 MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void HelmholtzMatrixOp_MatFree_GenericImpl(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 Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
Definition Vmath.hpp:396
scalarT< T > max(scalarT< T > lhs, scalarT< T > rhs)
Definition scalar.hpp:305

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::eFactorCoeffD00, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetNVarCoeff(), Nektar::StdRegions::StdExpansion::HelmholtzMatrixOp_MatFree_GenericImpl(), Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::LaplacianMatrixOp_MatFree_Kernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, tinysimd::max(), Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), and Vmath::Svtvp().

◆ v_IProductWRTBase()

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

\( \begin{array}{rcl} I_{pqr} = (\phi_{pqr}, u)_{\delta} & = & \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \sum_{k=0}^{nq_2} \psi_{p}^{a}(\xi_{1i}) \psi_{q}^{a}(\xi_{2j}) \psi_{r}^{a}(\xi_{3k}) w_i w_j w_k u(\xi_{1,i} \xi_{2,j} \xi_{3,k}) J_{i,j,k}\\ & = & \sum_{i=0}^{nq_0} \psi_p^a(\xi_{1,i}) \sum_{j=0}^{nq_1} \psi_{q}^a(\xi_{2,j}) \sum_{k=0}^{nq_2} \psi_{r}^a u(\xi_{1i},\xi_{2j},\xi_{3k}) J_{i,j,k} \end{array} \)
where \( \phi_{pqr} (\xi_1 , \xi_2 , \xi_3) = \psi_p^a( \xi_1) \psi_{q}^a(\xi_2) \psi_{r}^a(\xi_3) \)
which can be implemented as
\(f_{r} (\xi_{3k}) = \sum_{k=0}^{nq_3} \psi_{r}^a u(\xi_{1i},\xi_{2j}, \xi_{3k}) J_{i,j,k} = {\bf B_3 U} \)
\( g_{q} (\xi_{3k}) = \sum_{j=0}^{nq_1} \psi_{q}^a(\xi_{2j}) f_{r}(\xi_{3k}) = {\bf B_2 F} \)
\( (\phi_{pqr}, u)_{\delta} = \sum_{k=0}^{nq_0} \psi_{p}^a (\xi_{3k}) g_{q} (\xi_{3k}) = {\bf B_1 G} \)

Parameters
inarrayPhysical space function definition
outarrayInner product with respect to basis

This is a wrapper function around IProductWRTBaseKernel()

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::StdRegions::StdNodalPrismExp, and Nektar::StdRegions::StdNodalTetExp.

Definition at line 307 of file StdExpansion3D.cpp.

310{
311 const bool CollDir0 = m_base[0]->Collocation();
312 const bool CollDir1 = m_base[1]->Collocation();
313 const bool CollDir2 = m_base[2]->Collocation();
314
315 if (CollDir0 && CollDir1 && CollDir2)
316 {
317 MultiplyByStdQuadratureMetric(inarray, outarray);
318 }
319 else
320 {
321 const Array<OneD, const NekDouble> one(1, 1.0);
322 v_IProductWRTBaseKernel(m_base[0]->GetBdata(), m_base[1]->GetBdata(),
323 m_base[2]->GetBdata(), inarray, outarray, one,
324 false, CollDir0, CollDir1, CollDir2);
325 }
326}
void MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)

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

◆ v_IProductWRTBaseKernel()

virtual void Nektar::StdRegions::StdExpansion3D::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 
)
protectedpure virtual

◆ v_IsCollocatedBasis()

bool Nektar::StdRegions::StdExpansion3D::v_IsCollocatedBasis ( ) const
inlinefinalprotectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 283 of file StdExpansion3D.h.

284 {
285 return ((m_base[0]->Collocation()) && (m_base[1]->Collocation()) &&
286 (m_base[2]->Collocation()));
287 }

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

Referenced by Nektar::LocalRegions::Expansion3D::v_IProductWRTBase().

◆ v_LaplacianMatrixOp_MatFree()

void Nektar::StdRegions::StdExpansion3D::v_LaplacianMatrixOp_MatFree ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
overrideprotectedvirtual
Parameters
inarrayInput coefficients.
outputOutput coefficients.
mkeyMatrix key

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 392 of file StdExpansion3D.cpp.

395{
396 if (mkey.GetNVarCoeff() == 0 &&
397 !mkey.ConstFactorExists(StdRegions::eFactorCoeffD00) &&
398 !mkey.ConstFactorExists(eFactorSVVCutoffRatio))
399 {
400 // This implementation is only valid when there are no
401 // coefficients associated to the Laplacian operator
402 int nqtot = GetTotPoints();
403
404 // Allocate temporary storage
405 Array<OneD, NekDouble> wsp0(7 * nqtot);
406 Array<OneD, NekDouble> wsp1(wsp0 + nqtot);
407
408 if (!(m_base[0]->Collocation() && m_base[1]->Collocation() &&
409 m_base[2]->Collocation()))
410 {
411 // LAPLACIAN MATRIX OPERATION
412 // wsp0 = u = B * u_hat
413 // wsp1 = du_dxi1 = D_xi1 * wsp0 = D_xi1 * u
414 // wsp2 = du_dxi2 = D_xi2 * wsp0 = D_xi2 * u
415 BwdTrans(inarray, wsp0);
416 LaplacianMatrixOp_MatFree_Kernel(wsp0, outarray, wsp1);
417 }
418 else
419 {
420 LaplacianMatrixOp_MatFree_Kernel(inarray, outarray, wsp1);
421 }
422 }
423 else
424 {
426 mkey);
427 }
428}
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
void LaplacianMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::eFactorCoeffD00, Nektar::StdRegions::eFactorSVVCutoffRatio, Nektar::StdRegions::StdMatrixKey::GetNVarCoeff(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdExpansion::LaplacianMatrixOp_MatFree_GenericImpl(), Nektar::StdRegions::StdExpansion::LaplacianMatrixOp_MatFree_Kernel(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_MultiplyByStdQuadratureMetric()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 364 of file StdExpansion3D.cpp.

367{
368 int nquad0 = m_base[0]->GetNumPoints();
369 int nquad1 = m_base[1]->GetNumPoints();
370 int nquad2 = m_base[2]->GetNumPoints();
371
372 int cnt = 0;
373 for (int i = 0; i < nquad2; ++i)
374 {
375 NekDouble w2 = m_weights[2][i];
376 for (int j = 0; j < nquad1; ++j)
377 {
378 NekDouble w1w2 = m_weights[1][j] * w2;
379 for (int k = 0; k < nquad0; ++k, ++cnt)
380 {
381 outarray[cnt] = inarray[cnt] * m_weights[0][k] * w1w2;
382 }
383 }
384 }
385}

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

Referenced by Nektar::LocalRegions::Expansion3D::v_IProductWRTBase().

◆ v_PhysDeriv() [1/3]

void Nektar::StdRegions::StdExpansion::v_PhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2,
Array< OneD, NekDouble > &  out_d3 
)
protectedvirtual

Calculate the derivative of the physical points.

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1636 of file StdExpansion.cpp.

1471{
1472 v_StdPhysDeriv(inarray, out_d1, out_d2, out_d3);
1473}
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)

◆ v_PhysDeriv() [2/3]

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

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

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1641 of file StdExpansion.cpp.

1485{
1486 NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1487 "specific element types");
1488}

◆ v_PhysDeriv() [3/3]

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

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

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 202 of file StdExpansion3D.cpp.

205{
206 switch (dir)
207 {
208 case 0:
209 {
210 v_PhysDeriv(inarray, outarray, NullNekDouble1DArray,
212 break;
213 }
214
215 case 1:
216 {
217 v_PhysDeriv(inarray, NullNekDouble1DArray, outarray,
219 break;
220 }
221
222 case 2:
223 {
225 outarray);
226 break;
227 }
228
229 default:
230 {
231 ASSERTL1(false, "input dir is out of range");
232 }
233 break;
234 }
235}
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.
static Array< OneD, NekDouble > NullNekDouble1DArray

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

Referenced by v_PhysDeriv(), Nektar::StdRegions::StdPrismExp::v_PhysEvalFirstDeriv(), Nektar::StdRegions::StdPyrExp::v_PhysEvalFirstDeriv(), and Nektar::StdRegions::StdTetExp::v_PhysEvalFirstDeriv().

◆ v_PhysEvaluateInterp()

NekDouble Nektar::StdRegions::StdExpansion3D::v_PhysEvaluateInterp ( const Array< OneD, DNekMatSharedPtr > &  I,
const Array< OneD, const NekDouble > &  physvals 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 328 of file StdExpansion3D.cpp.

331{
332 NekDouble value;
333
334 int Qx = m_base[0]->GetNumPoints();
335 int Qy = m_base[1]->GetNumPoints();
336 int Qz = m_base[2]->GetNumPoints();
337
338 Array<OneD, NekDouble> sumFactorization_qr =
339 Array<OneD, NekDouble>(Qy * Qz);
340 Array<OneD, NekDouble> sumFactorization_r = Array<OneD, NekDouble>(Qz);
341
342 // Lagrangian interpolation matrix
343 NekDouble *interpolatingNodes = nullptr;
344
345 // Interpolate first coordinate direction
346 interpolatingNodes = &I[0]->GetPtr()[0];
347
348 Blas::Dgemv('T', Qx, Qy * Qz, 1.0, &physvals[0], Qx, &interpolatingNodes[0],
349 1, 0.0, &sumFactorization_qr[0], 1);
350
351 // Interpolate in second coordinate direction
352 interpolatingNodes = &I[1]->GetPtr()[0];
353
354 Blas::Dgemv('T', Qy, Qz, 1.0, &sumFactorization_qr[0], Qy,
355 &interpolatingNodes[0], 1, 0.0, &sumFactorization_r[0], 1);
356
357 // Interpolate in third coordinate direction
358 interpolatingNodes = &I[2]->GetPtr()[0];
359 value = Vmath::Dot(Qz, interpolatingNodes, 1, &sumFactorization_r[0], 1);
360
361 return value;
362}
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
Definition Blas.hpp:152
T Dot(int n, const T *w, const T *x)
dot product
Definition Vmath.hpp:761

References Blas::Dgemv(), Vmath::Dot(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_PhysInterp()

void Nektar::StdRegions::StdExpansion3D::v_PhysInterp ( std::shared_ptr< StdExpansion fromExp,
const Array< OneD, const NekDouble > &  fromData,
Array< OneD, NekDouble > &  toData,
bool  Transpose 
)
overrideprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 992 of file StdExpansion3D.cpp.

996{
997
998 LibUtilities::Interp3D(fromExp->GetBasis(0)->GetPointsKey(),
999 fromExp->GetBasis(1)->GetPointsKey(),
1000 fromExp->GetBasis(2)->GetPointsKey(), fromData,
1001 m_base[0]->GetPointsKey(), m_base[1]->GetPointsKey(),
1002 m_base[2]->GetPointsKey(), toData);
1003}
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis,...
Definition Interp.cpp:162

References Nektar::LibUtilities::Interp3D(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_ReOrientTracePhysMap()

void Nektar::StdRegions::StdExpansion3D::v_ReOrientTracePhysMap ( const StdRegions::Orientation  orient,
Array< OneD, int > &  idmap,
const int  nq0,
const int  nq1,
bool  Forwards 
)
overrideprotectedvirtual

This method produces a mapping.

Parameters
idmapwhich reorientates face data according to the input parameter
Orient.The sign convention is assumed to take the element local face to a global trace face and this is denoted by the boolean Forwards, i..e globaltrace[i] = localtrace[idmap[i]]. If the boolean is set to Forwards == false then a mapping is produced which maps the gloabl trace back to the local elemental trace such that localtrace[i] = globaltrace[idmap[i]].

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 539 of file StdExpansion3D.cpp.

542{
543 if (idmap.size() != nq0 * nq1)
544 {
545 idmap = Array<OneD, int>(nq0 * nq1);
546 }
547
548 switch (orient)
549 {
550 case StdRegions::eDir1FwdDir1_Dir2FwdDir2: // Used in Tri & Quad faces
551 // eseentially straight copy
552 for (int i = 0; i < nq0 * nq1; ++i)
553 {
554 idmap[i] = i;
555 }
556 break;
557 case StdRegions::eDir1BwdDir1_Dir2FwdDir2: // Used in Tri & Quad faces
558 {
559 // Direction A negative and B positive
560 for (int j = 0; j < nq1; j++)
561 {
562 for (int i = 0; i < nq0; ++i)
563 {
564 idmap[j * nq0 + i] = nq0 - 1 - i + j * nq0;
565 }
566 }
567 }
568 break;
570 {
571 // Direction A positive and B negative
572 for (int j = 0; j < nq1; j++)
573 {
574 for (int i = 0; i < nq0; ++i)
575 {
576 idmap[j * nq0 + i] = nq0 * (nq1 - 1 - j) + i;
577 }
578 }
579 }
580 break;
582 {
583 // Direction A negative and B negative
584 for (int j = 0; j < nq1; j++)
585 {
586 for (int i = 0; i < nq0; ++i)
587 {
588 idmap[j * nq0 + i] = nq0 * nq1 - 1 - j * nq0 - i;
589 }
590 }
591 }
592 break;
594 {
595 // Transposed, Direction A and B positive
596 if (Forwards)
597 {
598 for (int i = 0; i < nq0; ++i)
599 {
600 for (int j = 0; j < nq1; ++j)
601 {
602 idmap[i * nq1 + j] = i + j * nq0;
603 }
604 }
605 }
606 else // inverse case - different if nq0 != nq1
607 {
608 for (int j = 0; j < nq1; ++j)
609 {
610 for (int i = 0; i < nq0; ++i)
611 {
612 idmap[j * nq0 + i] = i * nq1 + j;
613 }
614 }
615 }
616 }
617 break;
619 {
620 // Transposed, Direction A positive with mapped direction
621 // B and direction B negative with mapped direction A
622 if (Forwards)
623 {
624 for (int i = 0; i < nq0; ++i)
625 {
626 for (int j = 0; j < nq1; ++j)
627 {
628 idmap[i * nq1 + j] = i + nq0 * (nq1 - 1) - j * nq0;
629 }
630 }
631 }
632 else
633 {
634 for (int j = 0; j < nq1; ++j)
635 {
636 for (int i = 0; i < nq0; ++i)
637 {
638 idmap[j * nq0 + i] = nq1 - 1 - j + i * nq1;
639 }
640 }
641 }
642 }
643 break;
645 {
646 // Transposed, Direction A negative with mapped directon B and
647 // direction B positive with mapped direction A
648 if (Forwards)
649 {
650 for (int i = 0; i < nq0; ++i)
651 {
652 for (int j = 0; j < nq1; ++j)
653 {
654 idmap[i * nq1 + j] = nq0 - 1 - i + j * nq0;
655 }
656 }
657 }
658 else
659 {
660 for (int j = 0; j < nq1; ++j)
661 {
662 for (int i = 0; i < nq0; ++i)
663 {
664 idmap[j * nq0 + i] = nq1 * (nq0 - 1) - i * nq1 + j;
665 }
666 }
667 }
668 }
669 break;
671 {
672 // Transposed, Direction A and B negative
673 if (Forwards)
674 {
675 for (int i = 0; i < nq0; ++i)
676 {
677 for (int j = 0; j < nq1; ++j)
678 {
679 idmap[i * nq1 + j] = nq0 * nq1 - 1 - i - j * nq0;
680 }
681 }
682 }
683 else
684 {
685 for (int j = 0; j < nq1; ++j)
686 {
687 for (int i = 0; i < nq0; ++i)
688 {
689 idmap[j * nq0 + i] = nq0 * nq1 - 1 - j - i * nq1;
690 }
691 }
692 }
693 }
694 break;
695 default:
696 ASSERTL0(false, "Unknow orientation");
697 break;
698 }
699}
#define ASSERTL0(condition, msg)

References ASSERTL0, Nektar::StdRegions::eDir1BwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1BwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1BwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1BwdDir2_Dir2FwdDir1, Nektar::StdRegions::eDir1FwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1FwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1FwdDir2_Dir2BwdDir1, and Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1.

◆ v_StdPhysEvaluate()

NekDouble Nektar::StdRegions::StdExpansion3D::v_StdPhysEvaluate ( const Array< OneD, const NekDouble > &  coords,
const Array< OneD, const NekDouble > &  physvals 
)
overrideprotectedvirtual

This function evaluates the expansion at a single (arbitrary) point of the domain.

Based on the value of the expansion at the quadrature points, this function calculates the value of the expansion at an arbitrary single points (with coordinates \( \mathbf{x_c}\) given by the pointer coords). This operation, equivalent to

\[ u(\mathbf{x_c}) = \sum_p \phi_p(\mathbf{x_c}) \hat{u}_p \]

is evaluated using Lagrangian interpolants through the quadrature points:

\[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\]

This function requires that the physical value array \(\mathbf{u}\) (implemented as the attribute #phys) is set.

Parameters
coordsthe coordinates of the single point
Returns
returns the value of the expansion at the single point

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 237 of file StdExpansion3D.cpp.

240{
241 Array<OneD, NekDouble> eta(3);
242
243 WARNINGL2(coords[0] >= -1 - NekConstants::kNekZeroTol, "coord[0] < -1");
244 WARNINGL2(coords[0] <= 1 + NekConstants::kNekZeroTol, "coord[0] > 1");
245 WARNINGL2(coords[1] >= -1 - NekConstants::kNekZeroTol, "coord[1] < -1");
246 WARNINGL2(coords[1] <= 1 + NekConstants::kNekZeroTol, "coord[1] > 1");
247 WARNINGL2(coords[2] >= -1 - NekConstants::kNekZeroTol, "coord[2] < -1");
248 WARNINGL2(coords[2] <= 1 + NekConstants::kNekZeroTol, "coord[2] > 1");
249
250 // Obtain local collapsed coordinate from Cartesian coordinate.
251 LocCoordToLocCollapsed(coords, eta);
252
253 const int nq0 = m_base[0]->GetNumPoints();
254 const int nq1 = m_base[1]->GetNumPoints();
255 const int nq2 = m_base[2]->GetNumPoints();
256
257 Array<OneD, NekDouble> wsp1(nq1 * nq2), wsp2(nq2);
258
259 // Construct the 2D square...
260 const NekDouble *ptr = &physvals[0];
261 for (int i = 0; i < nq1 * nq2; ++i, ptr += nq0)
262 {
263 wsp1[i] = StdExpansion::BaryEvaluate<0>(eta[0], ptr);
264 }
265
266 for (int i = 0; i < nq2; ++i)
267 {
268 wsp2[i] = StdExpansion::BaryEvaluate<1>(eta[1], &wsp1[i * nq1]);
269 }
270
271 return StdExpansion::BaryEvaluate<2>(eta[2], &wsp2[0]);
272}
#define WARNINGL2(condition, msg)
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
static const NekDouble kNekZeroTol

References Nektar::NekConstants::kNekZeroTol, Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::StdRegions::StdExpansion::m_base, and WARNINGL2.