Nektar++
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Nektar::MultiRegions::ExpList Class Reference

Base class for all multi-elemental spectral/hp expansions. More...

#include <ExpList.h>

Inheritance diagram for Nektar::MultiRegions::ExpList:
[legend]

Public Member Functions

 ExpList (const ExpansionType Type=eNoType)
 The default constructor using a type. More...
 
 ExpList (const ExpList &in, const bool DeclareCoeffPhysArrays=true)
 The copy constructor. More...
 
 ExpList (const ExpList &in, const std::vector< unsigned int > &eIDs, const bool DeclareCoeffPhysArrays=true, const Collections::ImplementationType ImpType=Collections::eNoImpType)
 Constructor copying only elements defined in eIds. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph, const bool DeclareCoeffPhysArrays=true, const std::string &var="DefaultVar", const Collections::ImplementationType ImpType=Collections::eNoImpType)
 Generate an ExpList from a meshgraph graph and session file. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::ExpansionInfoMap &expansions, const bool DeclareCoeffPhysArrays=true, const Collections::ImplementationType ImpType=Collections::eNoImpType)
 Sets up a list of local expansions based on an expansion Map. More...
 
 ExpList (const SpatialDomains::PointGeomSharedPtr &geom)
 Specialised constructors for 0D Expansions Wrapper around LocalRegion::PointExp - used in PrePacing.cpp. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const ExpListSharedPtr > &bndConstraint, const Array< OneD, const SpatialDomains ::BoundaryConditionShPtr > &bndCond, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph, const LibUtilities::CommSharedPtr &comm, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar", const Collections::ImplementationType ImpType=Collections::eNoImpType)
 Generate expansions for the trace space expansions used in DisContField. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph, const bool DeclareCoeffPhysArrays, const std::string variable, const Collections::ImplementationType ImpType=Collections::eNoImpType)
 Generate an trace ExpList from a meshgraph graph and session file. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::CompositeMap &domain, const SpatialDomains::MeshGraphSharedPtr &graph, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar", bool SetToOneSpaceDimension=false, const LibUtilities::CommSharedPtr comm=LibUtilities::CommSharedPtr(), const Collections::ImplementationType ImpType=Collections::eNoImpType)
 Constructor based on domain information only for 1D & 2D boundary conditions. More...
 
virtual ~ExpList ()
 The default destructor. More...
 
int GetNcoeffs (void) const
 Returns the total number of local degrees of freedom \(N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\). More...
 
int GetNcoeffs (const int eid) const
 Returns the total number of local degrees of freedom for element eid. More...
 
ExpansionType GetExpType (void)
 Returns the type of the expansion. More...
 
void SetExpType (ExpansionType Type)
 Returns the type of the expansion. More...
 
int EvalBasisNumModesMax (void) const
 Evaulates the maximum number of modes in the elemental basis order over all elements. More...
 
const Array< OneD, int > EvalBasisNumModesMaxPerExp (void) const
 Returns the vector of the number of modes in the elemental basis order over all elements. More...
 
int GetTotPoints (void) const
 Returns the total number of quadrature points m_npoints \(=Q_{\mathrm{tot}}\). More...
 
int GetTotPoints (const int eid) const
 Returns the total number of quadrature points for eid's element \(=Q_{\mathrm{tot}}\). More...
 
int GetNpoints (void) const
 Returns the total number of quadrature points m_npoints \(=Q_{\mathrm{tot}}\). More...
 
int Get1DScaledTotPoints (const NekDouble scale) const
 Returns the total number of qudature points scaled by the factor scale on each 1D direction. More...
 
void SetWaveSpace (const bool wavespace)
 Sets the wave space to the one of the possible configuration true or false. More...
 
void SetModifiedBasis (const bool modbasis)
 Set Modified Basis for the stability analysis. More...
 
bool GetWaveSpace (void) const
 This function returns the third direction expansion condition, which can be in wave space (coefficient) or not It is stored in the variable m_WaveSpace. More...
 
void SetPhys (int i, NekDouble val)
 Set the i th value of m_phys to value val. More...
 
void SetPhys (const Array< OneD, const NekDouble > &inarray)
 Fills the array m_phys. More...
 
void SetPhysArray (Array< OneD, NekDouble > &inarray)
 Sets the array m_phys. More...
 
void SetPhysState (const bool physState)
 This function manually sets whether the array of physical values \(\boldsymbol{u}_l\) (implemented as m_phys) is filled or not. More...
 
bool GetPhysState (void) const
 This function indicates whether the array of physical values \(\boldsymbol{u}_l\) (implemented as m_phys) is filled or not. More...
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 multiply the metric jacobi and quadrature weights More...
 
void DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Divided by the metric jacobi and quadrature weights. More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function calculates the inner product of a function \(f(\boldsymbol{x})\) with respect to all local expansion modes \(\phi_n^e(\boldsymbol{x})\). More...
 
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function calculates the inner product of a function \(f(\boldsymbol{x})\) with respect to the derivative (in direction. More...
 
void IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Directional derivative along a given direction. More...
 
void IProductWRTDerivBase (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
 This function calculates the inner product of a function \(f(\boldsymbol{x})\) with respect to the derivative of all local expansion modes \(\phi_n^e(\boldsymbol{x})\). More...
 
void FwdTransLocalElmt (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function elementally evaluates the forward transformation of a function \(u(\boldsymbol{x})\) onto the global spectral/hp expansion. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
void MultiplyByElmtInvMass (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function elementally mulplies the coefficient space of Sin my the elemental inverse of the mass matrix. More...
 
void MultiplyByInvMassMatrix (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByMassMatrix (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SmoothField (Array< OneD, NekDouble > &field)
 Smooth a field across elements. More...
 
GlobalLinSysKey HelmSolve (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const MultiRegions::VarFactorsMap &varfactors=MultiRegions::NullVarFactorsMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const bool PhysSpaceForcing=true)
 Solve helmholtz problem. More...
 
GlobalLinSysKey LinearAdvectionDiffusionReactionSolve (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const MultiRegions::VarFactorsMap &varfactors=MultiRegions::NullVarFactorsMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const bool PhysSpaceForcing=true)
 Solve Advection Diffusion Reaction. More...
 
void LinearAdvectionReactionSolve (const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 Solve Advection Diffusion Reaction. More...
 
void FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function elementally evaluates the backward transformation of the global spectral/hp element expansion. More...
 
void GetCoords (Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
 This function calculates the coordinates of all the elemental quadrature points \(\boldsymbol{x}_i\). More...
 
void GetCoords (const int eid, Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
 
void HomogeneousFwdTrans (const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
void HomogeneousBwdTrans (const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
void DealiasedProd (const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
 
void DealiasedDotProd (const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
void GetBCValues (Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
 
void NormVectorIProductWRTBase (Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
 
void NormVectorIProductWRTBase (Array< OneD, Array< OneD, NekDouble > > &V, Array< OneD, NekDouble > &outarray)
 
void ApplyGeomInfo ()
 Apply geometry information to each expansion. More...
 
void Reset ()
 Reset geometry information and reset matrices. More...
 
void ResetMatrices ()
 Reset matrices. More...
 
void WriteTecplotHeader (std::ostream &outfile, std::string var="")
 
void WriteTecplotZone (std::ostream &outfile, int expansion=-1)
 
void WriteTecplotField (std::ostream &outfile, int expansion=-1)
 
void WriteTecplotConnectivity (std::ostream &outfile, int expansion=-1)
 
void WriteVtkHeader (std::ostream &outfile)
 
void WriteVtkFooter (std::ostream &outfile)
 
void WriteVtkPieceHeader (std::ostream &outfile, int expansion, int istrip=0)
 
void WriteVtkPieceFooter (std::ostream &outfile, int expansion)
 
void WriteVtkPieceData (std::ostream &outfile, int expansion, std::string var="v")
 
int GetCoordim (int eid)
 This function returns the dimension of the coordinates of the element eid. More...
 
void SetCoeff (int i, NekDouble val)
 Set the i th coefficiient in m_coeffs to value val. More...
 
void SetCoeffs (int i, NekDouble val)
 Set the i th coefficiient in m_coeffs to value val. More...
 
void SetCoeffsArray (Array< OneD, NekDouble > &inarray)
 Set the m_coeffs array to inarray. More...
 
int GetShapeDimension ()
 This function returns the dimension of the shape of the element eid. More...
 
const Array< OneD, const NekDouble > & GetCoeffs () const
 This function returns (a reference to) the array \(\boldsymbol{\hat{u}}_l\) (implemented as m_coeffs) containing all local expansion coefficients. More...
 
void ImposeDirichletConditions (Array< OneD, NekDouble > &outarray)
 Impose Dirichlet Boundary Conditions onto Array. More...
 
void FillBndCondFromField (const Array< OneD, NekDouble > coeffs)
 Fill Bnd Condition expansion from the values stored in expansion. More...
 
void FillBndCondFromField (const int nreg, const Array< OneD, NekDouble > coeffs)
 Fill Bnd Condition expansion in nreg from the values stored in expansion. More...
 
void LocalToGlobal (bool useComm=true)
 Gathers the global coefficients \(\boldsymbol{\hat{u}}_g\) from the local coefficients \(\boldsymbol{\hat{u}}_l\). More...
 
void LocalToGlobal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool useComm=true)
 
void GlobalToLocal (void)
 Scatters from the global coefficients \(\boldsymbol{\hat{u}}_g\) to the local coefficients \(\boldsymbol{\hat{u}}_l\). More...
 
void GlobalToLocal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble GetCoeff (int i)
 Get the i th value (coefficient) of m_coeffs. More...
 
NekDouble GetCoeffs (int i)
 Get the i th value (coefficient) of m_coeffs. More...
 
const Array< OneD, const NekDouble > & GetPhys () const
 This function returns (a reference to) the array \(\boldsymbol{u}_l\) (implemented as m_phys) containing the function \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points. More...
 
NekDouble Linf (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
 This function calculates the \(L_\infty\) error of the global spectral/hp element approximation. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
 This function calculates the \(L_\infty\) error of the global This function calculates the \(L_2\) error with respect to soln of the global spectral/hp element approximation. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
 Calculates the \(H^1\) error of the global spectral/hp element approximation. More...
 
NekDouble Integral ()
 Calculates the \(H^1\) error of the global spectral/hp element approximation. More...
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 
NekDouble VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &inarray)
 
Array< OneD, const NekDoubleHomogeneousEnergy (void)
 This function calculates the energy associated with each one of the modesof a 3D homogeneous nD expansion. More...
 
void SetHomo1DSpecVanVisc (Array< OneD, NekDouble > visc)
 This function sets the Spectral Vanishing Viscosity in homogeneous1D expansion. More...
 
Array< OneD, const unsigned int > GetZIDs (void)
 This function returns a vector containing the wave numbers in z-direction associated with the 3D homogenous expansion. Required if a parellelisation is applied in the Fourier direction. More...
 
LibUtilities::TranspositionSharedPtr GetTransposition (void)
 This function returns the transposition class associated with the homogeneous expansion. More...
 
NekDouble GetHomoLen (void)
 This function returns the Width of homogeneous direction associated with the homogeneous expansion. More...
 
void SetHomoLen (const NekDouble lhom)
 This function sets the Width of homogeneous direction associated with the homogeneous expansion. More...
 
Array< OneD, const unsigned int > GetYIDs (void)
 This function returns a vector containing the wave numbers in y-direction associated with the 3D homogenous expansion. Required if a parellelisation is applied in the Fourier direction. More...
 
void PhysInterp1DScaled (const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function interpolates the physical space points in inarray to outarray using the same points defined in the expansion but where the number of points are rescaled by 1DScale. More...
 
void PhysGalerkinProjection1DScaled (const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function Galerkin projects the physical space points in inarray to outarray where inarray is assumed to be defined in the expansion but where the number of points are rescaled by 1DScale. More...
 
int GetExpSize (void)
 This function returns the number of elements in the expansion. More...
 
size_t GetNumElmts (void)
 This function returns the number of elements in the expansion which may be different for a homogeoenous extended expansionp. More...
 
const std::shared_ptr< LocalRegions::ExpansionVectorGetExp () const
 This function returns the vector of elements in the expansion. More...
 
LocalRegions::ExpansionSharedPtrGetExp (int n) const
 This function returns (a shared pointer to) the local elemental expansion of the \(n^{\mathrm{th}}\) element. More...
 
LocalRegions::ExpansionSharedPtrGetExpFromGeomId (int n)
 This function returns (a shared pointer to) the local elemental expansion of the \(n^{\mathrm{th}}\) element given a global geometry ID. More...
 
LocalRegions::ExpansionSharedPtrGetExp (const Array< OneD, const NekDouble > &gloCoord)
 This function returns (a shared pointer to) the local elemental expansion containing the arbitrary point given by gloCoord. More...
 
int GetExpIndex (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
 This function returns the index of the local elemental expansion containing the arbitrary point given by gloCoord, within a distance tolerance of tol. More...
 
int GetExpIndex (const Array< OneD, const NekDouble > &gloCoords, Array< OneD, NekDouble > &locCoords, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &phys)
 
int GetCoeff_Offset (int n) const
 Get the start offset position for a local contiguous list of coeffs correspoinding to element n. More...
 
int GetPhys_Offset (int n) const
 Get the start offset position for a local contiguous list of quadrature points in a full array correspoinding to element n. More...
 
Array< OneD, NekDouble > & UpdateCoeffs ()
 This function returns (a reference to) the array \(\boldsymbol{\hat{u}}_l\) (implemented as m_coeffs) containing all local expansion coefficients. More...
 
Array< OneD, NekDouble > & UpdatePhys ()
 This function returns (a reference to) the array \(\boldsymbol{u}_l\) (implemented as m_phys) containing the function \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points. More...
 
void PhysDeriv (Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
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)
 This function discretely evaluates the derivative of a function \(f(\boldsymbol{x})\) on the domain consisting of all elements of the expansion. More...
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
void CurlCurl (Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetMovingFrames (const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions ()
 
const Array< OneD, const NekDouble > & GetBndCondBwdWeight ()
 Get the weight value for boundary conditions. More...
 
void SetBndCondBwdWeight (const int index, const NekDouble value)
 Set the weight value for boundary conditions. More...
 
std::shared_ptr< ExpList > & UpdateBndCondExpansion (int i)
 
void Upwind (const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
void Upwind (const Array< OneD, const Array< OneD, NekDouble > > &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
std::shared_ptr< ExpList > & GetTrace ()
 
std::shared_ptr< AssemblyMapDG > & GetTraceMap (void)
 
std::shared_ptr< InterfaceMapDG > & GetInterfaceMap (void)
 
const Array< OneD, const int > & GetTraceBndMap (void)
 
void GetNormals (Array< OneD, Array< OneD, NekDouble > > &normals)
 
void GetElmtNormalLength (Array< OneD, NekDouble > &lengthsFwd, Array< OneD, NekDouble > &lengthsBwd)
 Get the length of elements in boundary normal direction. More...
 
void GetBwdWeight (Array< OneD, NekDouble > &weightAver, Array< OneD, NekDouble > &weightJump)
 Get the weight value for boundary conditions for boundary average and jump calculations. More...
 
void AddTraceIntegral (const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
void AddFwdBwdTraceIntegral (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
 
void GetFwdBwdTracePhys (Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 
void GetFwdBwdTracePhys (const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool FillBnd=true, bool PutFwdInBwdOnBCs=false, bool DoExchange=true)
 
void FillBwdWithBoundCond (const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs=false)
 
void AddTraceQuadPhysToField (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
 Add Fwd and Bwd value to field, a reverse procedure of GetFwdBwdTracePhys. More...
 
void AddTraceQuadPhysToOffDiag (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
 
void GetLocTraceFromTracePts (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
 
void FillBwdWithBwdWeight (Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
 Fill Bwd with boundary conditions. More...
 
void PeriodicBwdCopy (const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 Copy and fill the Periodic boundaries. More...
 
const std::vector< bool > & GetLeftAdjacentFaces (void) const
 
void ExtractTracePhys (Array< OneD, NekDouble > &outarray)
 
void ExtractTracePhys (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions ()
 
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions ()
 
void EvaluateBoundaryConditions (const NekDouble time=0.0, const std::string varName="", const NekDouble=NekConstants::kNekUnsetDouble, const NekDouble=NekConstants::kNekUnsetDouble)
 
void GeneralMatrixOp (const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function calculates the result of the multiplication of a matrix of type specified by mkey with a vector given by inarray. More...
 
void SetUpPhysNormals ()
 
void GetBoundaryToElmtMap (Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
 
virtual void GetBndElmtExpansion (int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays=true)
 
void ExtractElmtToBndPhys (int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
 
void ExtractPhysToBndElmt (int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
 
void ExtractPhysToBnd (int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
 
void GetBoundaryNormals (int i, Array< OneD, Array< OneD, NekDouble > > &normals)
 
void GeneralGetFieldDefinitions (std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef, int NumHomoDir=0, Array< OneD, LibUtilities::BasisSharedPtr > &HomoBasis=LibUtilities::NullBasisSharedPtr1DArray, std::vector< NekDouble > &HomoLen=LibUtilities::NullNekDoubleVector, bool homoStrips=false, std::vector< unsigned int > &HomoSIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoZIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoYIDs=LibUtilities::NullUnsignedIntVector)
 
std::map< int, RobinBCInfoSharedPtrGetRobinBCInfo ()
 
void GetPeriodicEntities (PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces=NullPeriodicMap)
 
std::vector< LibUtilities::FieldDefinitionsSharedPtrGetFieldDefinitions ()
 
void GetFieldDefinitions (std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
 
void AppendFieldData (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
 Append the element data listed in elements fielddef->m_ElementIDs onto fielddata. More...
 
void AppendFieldData (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, Array< OneD, NekDouble > &coeffs)
 Append the data in coeffs listed in elements fielddef->m_ElementIDs onto fielddata. More...
 
void ExtractElmtDataToCoeffs (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
 Extract the data in fielddata into the coeffs using the basic ExpList Elemental expansions rather than planes in homogeneous case. More...
 
void ExtractCoeffsToCoeffs (const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
 Extract the data from fromField using fromExpList the coeffs using the basic ExpList Elemental expansions rather than planes in homogeneous case. More...
 
void ExtractDataToCoeffs (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane=std::unordered_map< int, int >())
 Extract the data in fielddata into the coeffs. More...
 
void ExtractCoeffsFromFile (const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, Array< OneD, NekDouble > &coeffs)
 
void GenerateElementVector (const int ElementID, const NekDouble scalar1, const NekDouble scalar2, Array< OneD, NekDouble > &outarray)
 Generate vector v such that v[i] = scalar1 if i is in the element < ElementID. Otherwise, v[i] = scalar2. More...
 
std::shared_ptr< ExpListGetSharedThisPtr ()
 Returns a shared pointer to the current object. More...
 
std::shared_ptr< LibUtilities::SessionReaderGetSession () const
 Returns the session object. More...
 
std::shared_ptr< LibUtilities::CommGetComm () const
 Returns the comm object. More...
 
SpatialDomains::MeshGraphSharedPtr GetGraph ()
 
LibUtilities::BasisSharedPtr GetHomogeneousBasis (void)
 
std::shared_ptr< ExpList > & GetPlane (int n)
 
void CreateCollections (Collections::ImplementationType ImpType=Collections::eNoImpType)
 Construct collections of elements containing a single element type and polynomial order from the list of expansions. More...
 
void ClearGlobalLinSysManager (void)
 
int GetPoolCount (std::string)
 
void UnsetGlobalLinSys (GlobalLinSysKey, bool)
 
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & GetGlobalLinSysManager (void)
 
const Array< OneD, const std::pair< int, int > > & GetCoeffsToElmt () const
 Get m_coeffs to elemental value map. More...
 
void AddTraceJacToElmtJac (const Array< OneD, const DNekMatSharedPtr > &FwdMat, const Array< OneD, const DNekMatSharedPtr > &BwdMat, Array< OneD, DNekMatSharedPtr > &fieldMat)
 inverse process of v_GetFwdBwdTracePhys. Given Trace integration of Fwd and Bwd Jacobian, with dimension NtotalTrace*TraceCoef*TracePhys. return Elemental Jacobian matrix with dimension NtotalElement*ElementCoef*ElementPhys. More...
 
void GetMatIpwrtDeriveBase (const Array< OneD, const Array< OneD, NekDouble > > &inarray, const int nDirctn, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
 
void GetMatIpwrtDeriveBase (const TensorOfArray3D< NekDouble > &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
 
void GetDiagMatIpwrtBase (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
 
void AddTraceIntegralToOffDiag (const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
 
void AddRightIPTPhysDerivBase (const int dir, const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
 
void AddRightIPTBaseMatrix (const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
 
const LocTraceToTraceMapSharedPtrGetLocTraceToTraceMap () const
 
std::vector< bool > & GetLeftAdjacentTraces (void)
 
const std::unordered_map< int, int > & GetElmtToExpId (void)
 This function returns the map of index inside m_exp to geom id. More...
 
int GetElmtToExpId (int elmtId)
 This function returns the index inside m_exp for a given geom id. More...
 

Protected Member Functions

std::shared_ptr< DNekMatGenGlobalMatrixFull (const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
 
const DNekScalBlkMatSharedPtr GenBlockMatrix (const GlobalMatrixKey &gkey)
 This function assembles the block diagonal matrix of local matrices of the type mtype. More...
 
const DNekScalBlkMatSharedPtrGetBlockMatrix (const GlobalMatrixKey &gkey)
 
void MultiplyByBlockMatrix (const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
std::shared_ptr< GlobalMatrixGenGlobalMatrix (const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
 Generates a global matrix from the given key and map. More...
 
void GlobalEigenSystem (const std::shared_ptr< DNekMat > &Gmat, Array< OneD, NekDouble > &EigValsReal, Array< OneD, NekDouble > &EigValsImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray)
 
std::shared_ptr< GlobalLinSysGenGlobalLinSys (const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
 This operation constructs the global linear system of type mkey. More...
 
std::shared_ptr< GlobalLinSysGenGlobalBndLinSys (const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
 Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocToGloBaseMap. More...
 
virtual size_t v_GetNumElmts (void)
 
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions (void)
 
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight ()
 
virtual void v_SetBndCondBwdWeight (const int index, const NekDouble value)
 
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion (int i)
 
virtual void v_Upwind (const Array< OneD, const Array< OneD, NekDouble > > &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
virtual void v_Upwind (const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
virtual std::shared_ptr< ExpList > & v_GetTrace ()
 
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap ()
 
virtual std::shared_ptr< InterfaceMapDG > & v_GetInterfaceMap ()
 
virtual const Array< OneD, const int > & v_GetTraceBndMap ()
 
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap (void) const
 
virtual std::vector< bool > & v_GetLeftAdjacentTraces (void)
 
virtual void v_GetNormals (Array< OneD, Array< OneD, NekDouble > > &normals)
 Populate normals with the normals of all expansions. More...
 
virtual void v_AddTraceIntegral (const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddFwdBwdTraceIntegral (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetFwdBwdTracePhys (Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 
virtual void v_GetFwdBwdTracePhys (const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool FillBnd=true, bool PutFwdInBwdOnBCs=false, bool DoExchange=true)
 
virtual void v_FillBwdWithBoundCond (const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
 
virtual void v_AddTraceQuadPhysToField (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
 
virtual void v_AddTraceQuadPhysToOffDiag (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
 
virtual void v_GetLocTraceFromTracePts (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
 
virtual void v_FillBwdWithBwdWeight (Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
 
virtual void v_PeriodicBwdCopy (const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 
virtual const std::vector< bool > & v_GetLeftAdjacentFaces (void) const
 
virtual void v_ExtractTracePhys (Array< OneD, NekDouble > &outarray)
 
virtual void v_ExtractTracePhys (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_MultiplyByInvMassMatrix (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual GlobalLinSysKey v_HelmSolve (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
 
virtual GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
 
virtual void v_LinearAdvectionReactionSolve (const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 
virtual void v_ImposeDirichletConditions (Array< OneD, NekDouble > &outarray)
 
virtual void v_FillBndCondFromField (const Array< OneD, NekDouble > coeffs)
 
virtual void v_FillBndCondFromField (const int nreg, const Array< OneD, NekDouble > coeffs)
 
virtual void v_Reset ()
 Reset geometry information, metrics, matrix managers and geometry information. More...
 
virtual void v_LocalToGlobal (bool UseComm)
 
virtual void v_LocalToGlobal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseComm)
 
virtual void v_GlobalToLocal (void)
 
virtual void v_GlobalToLocal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_FwdTransLocalElmt (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_SmoothField (Array< OneD, NekDouble > &field)
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTDerivBase (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
 
virtual void v_GetCoords (const int eid, Array< OneD, NekDouble > &xc0, Array< OneD, NekDouble > &xc1, Array< OneD, NekDouble > &xc2)
 
virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
virtual void v_PhysDeriv (Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
virtual void v_Curl (Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
 
virtual void v_CurlCurl (Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
 
virtual void v_PhysDirectionalDeriv (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetMovingFrames (const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual void v_HomogeneousFwdTrans (const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
virtual void v_HomogeneousBwdTrans (const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
virtual void v_DealiasedProd (const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
 
virtual void v_DealiasedDotProd (const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual void v_GetBCValues (Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
 
virtual void v_NormVectorIProductWRTBase (Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
 
virtual void v_NormVectorIProductWRTBase (Array< OneD, Array< OneD, NekDouble > > &V, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetUpPhysNormals ()
 : Set up a normal along the trace elements between two elements at elemental level More...
 
virtual void v_GetBoundaryToElmtMap (Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
 
virtual void v_GetBndElmtExpansion (int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
 
virtual void v_ExtractElmtToBndPhys (const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
 
virtual void v_ExtractPhysToBndElmt (const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
 
virtual void v_ExtractPhysToBnd (const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
 
virtual void v_GetBoundaryNormals (int i, Array< OneD, Array< OneD, NekDouble > > &normals)
 
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtrv_GetFieldDefinitions (void)
 
virtual void v_GetFieldDefinitions (std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
 
virtual void v_AppendFieldData (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
 
virtual void v_AppendFieldData (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, Array< OneD, NekDouble > &coeffs)
 
virtual void v_ExtractDataToCoeffs (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane)
 Extract data from raw field data into expansion list. More...
 
virtual void v_ExtractCoeffsToCoeffs (const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
 
virtual void v_WriteTecplotHeader (std::ostream &outfile, std::string var="")
 
virtual void v_WriteTecplotZone (std::ostream &outfile, int expansion)
 
virtual void v_WriteTecplotField (std::ostream &outfile, int expansion)
 
virtual void v_WriteTecplotConnectivity (std::ostream &outfile, int expansion)
 
virtual void v_WriteVtkPieceData (std::ostream &outfile, int expansion, std::string var)
 
virtual void v_WriteVtkPieceHeader (std::ostream &outfile, int expansion, int istrip)
 
virtual NekDouble v_L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
 
virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 
virtual NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &inarray)
 
virtual Array< OneD, const NekDoublev_HomogeneousEnergy (void)
 
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition (void)
 
virtual NekDouble v_GetHomoLen (void)
 
virtual void v_SetHomoLen (const NekDouble lhom)
 
virtual Array< OneD, const unsigned int > v_GetZIDs (void)
 
virtual Array< OneD, const unsigned int > v_GetYIDs (void)
 
virtual void v_PhysInterp1DScaled (const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_PhysGalerkinProjection1DScaled (const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_ClearGlobalLinSysManager (void)
 
virtual int v_GetPoolCount (std::string)
 
virtual void v_UnsetGlobalLinSys (GlobalLinSysKey, bool)
 
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager (void)
 
void ExtractFileBCs (const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
 
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions ()
 
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions ()
 
virtual void v_EvaluateBoundaryConditions (const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
 
virtual std::map< int, RobinBCInfoSharedPtrv_GetRobinBCInfo (void)
 
virtual void v_GetPeriodicEntities (PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
 
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis (void)
 
virtual void v_SetHomo1DSpecVanVisc (Array< OneD, NekDouble > visc)
 
virtual std::shared_ptr< ExpList > & v_GetPlane (int n)
 
virtual void v_AddTraceIntegralToOffDiag (const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
 

Static Protected Member Functions

static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition (const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
 

Protected Attributes

ExpansionType m_expType
 Expansion type. More...
 
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
LibUtilities::SessionReaderSharedPtr m_session
 Session. More...
 
SpatialDomains::MeshGraphSharedPtr m_graph
 Mesh associated with this expansion list. More...
 
int m_ncoeffs
 The total number of local degrees of freedom. m_ncoeffs \(=N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_l\). More...
 
int m_npoints
 
Array< OneD, NekDoublem_coeffs
 Concatenation of all local expansion coefficients. More...
 
Array< OneD, NekDoublem_phys
 The global expansion evaluated at the quadrature points. More...
 
bool m_physState
 The state of the array m_phys. More...
 
std::shared_ptr< LocalRegions::ExpansionVectorm_exp
 The list of local expansions. More...
 
Collections::CollectionVector m_collections
 
std::vector< bool > m_collectionsDoInit
 Vector of bools to act as an initialise on first call flag. More...
 
Array< OneD, int > m_coeff_offset
 Offset of elemental data into the array m_coeffs. More...
 
Array< OneD, int > m_phys_offset
 Offset of elemental data into the array m_phys. More...
 
Array< OneD, std::pair< int, int > > m_coeffsToElmt
 m_coeffs to elemental value map More...
 
BlockMatrixMapShPtr m_blockMat
 
bool m_WaveSpace
 
std::unordered_map< int, int > m_elmtToExpId
 Mapping from geometry ID of element to index inside m_exp. More...
 

Private Member Functions

void SetupCoeffPhys (bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
 Definition of the total number of degrees of freedom and quadrature points and offsets to access data. More...
 
void InitialiseExpVector (const SpatialDomains::ExpansionInfoMap &expmap)
 Define a list of elements using the geometry and basis key information in expmap;. More...
 

Detailed Description

Base class for all multi-elemental spectral/hp expansions.

All multi-elemental expansions \(u^{\delta}(\boldsymbol{x})\) can be considered as the assembly of the various elemental contributions. On a discrete level, this yields,

\[u^{\delta}(\boldsymbol{x}_i)=\sum_{e=1}^{{N_{\mathrm{el}}}} \sum_{n=0}^{N^{e}_m-1}\hat{u}_n^e\phi_n^e(\boldsymbol{x}_i).\]

where \({N_{\mathrm{el}}}\) is the number of elements and \(N^{e}_m\) is the local elemental number of expansion modes. As it is the lowest level class, it contains the definition of the common data and common routines to all multi-elemental expansions.

The class stores a vector of expansions, m_exp, (each derived from StdRegions::StdExpansion) which define the constituent components of the domain.

Definition at line 98 of file ExpList.h.

Constructor & Destructor Documentation

◆ ExpList() [1/9]

Nektar::MultiRegions::ExpList::ExpList ( const ExpansionType  type = eNoType)

The default constructor using a type.

Creates an empty expansion list.

Definition at line 91 of file ExpList.cpp.

92 : m_expType(type), m_ncoeffs(0), m_npoints(0), m_physState(false),
95 m_WaveSpace(false)
96{
97}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1128
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1107
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1118
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1063
ExpansionType m_expType
Expansion type.
Definition: ExpList.h:1051

◆ ExpList() [2/9]

Nektar::MultiRegions::ExpList::ExpList ( const ExpList in,
const bool  DeclareCoeffPhysArrays = true 
)

The copy constructor.

Copies an existing expansion list.

Parameters
inSource expansion list.

Definition at line 107 of file ExpList.cpp.

108 : std::enable_shared_from_this<ExpList>(in), m_expType(in.m_expType),
109
110 m_comm(in.m_comm), m_session(in.m_session), m_graph(in.m_graph),
111 m_ncoeffs(in.m_ncoeffs), m_npoints(in.m_npoints), m_physState(false),
112 m_exp(in.m_exp), m_collections(in.m_collections),
113 m_collectionsDoInit(in.m_collectionsDoInit),
114 m_coeff_offset(in.m_coeff_offset), m_phys_offset(in.m_phys_offset),
115 m_blockMat(in.m_blockMat), m_WaveSpace(false),
116 m_elmtToExpId(in.m_elmtToExpId)
117{
118 // Set up m_coeffs, m_phys and offset arrays.
119 // use this to keep memory declaration in one place
120 SetupCoeffPhys(DeclareCoeffPhysArrays, false);
121}
void SetupCoeffPhys(bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList.cpp:1615
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1123
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition: ExpList.h:1121
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1056
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1060
Collections::CollectionVector m_collections
Definition: ExpList.h:1119
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1135
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1058
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1125

References SetupCoeffPhys().

◆ ExpList() [3/9]

Nektar::MultiRegions::ExpList::ExpList ( const ExpList in,
const std::vector< unsigned int > &  eIDs,
const bool  DeclareCoeffPhysArrays = true,
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Constructor copying only elements defined in eIds.

Copies the eIds elements from an existing expansion list.

Parameters
inSource expansion list.
inelements that will be in the new exp list.

Definition at line 128 of file ExpList.cpp.

131 : m_expType(in.m_expType), m_comm(in.m_comm), m_session(in.m_session),
132 m_graph(in.m_graph), m_physState(false),
135 m_WaveSpace(false)
136{
137 for (int i = 0; i < eIDs.size(); ++i)
138 {
139 (*m_exp).push_back((*(in.m_exp))[eIDs[i]]);
140 }
141
142 // Set up m_coeffs, m_phys and offset arrays.
143 SetupCoeffPhys(DeclareCoeffPhysArrays);
144
145 // set up collections
146 CreateCollections(ImpType);
147}
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:5784

References CreateCollections(), m_exp, and SetupCoeffPhys().

◆ ExpList() [4/9]

Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr graph,
const bool  DeclareCoeffPhysArrays = true,
const std::string &  var = "DefaultVar",
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Generate an ExpList from a meshgraph graph and session file.

Given a meshgraph graph, containing information about the domain and the spectral/hp element expansion, this constructor fills the list of local expansions \texttt{m_exp} with the proper expansions, calculates the total number of quadrature points \(x_i\) and local expansion coefficients \(\hat{u}^e_n\) and

Parameters
pSessionA session within information about expansion
graphA meshgraph, containing information about the domain and the spectral/hp element expansion.
DeclareCoeffPhysArraysDeclare the coefficient and phys space arrays
ImpTypeDetail about the implementation type to use in operators

Definition at line 168 of file ExpList.cpp.

172 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
173 m_physState(false),
176 m_WaveSpace(false)
177{
178 // Retrieve the list of expansions
179 const SpatialDomains::ExpansionInfoMap &expansions =
180 graph->GetExpansionInfo(var);
181
182 // Initialise Expansion Vector
183 InitialiseExpVector(expansions);
184
185 // Setup phys coeff space
186 SetupCoeffPhys(DeclareCoeffPhysArrays);
187
188 // Initialise collection
189 CreateCollections(ImpType);
190}
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
Definition: ExpList.cpp:1672
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition: MeshGraph.h:141

References CreateCollections(), InitialiseExpVector(), and SetupCoeffPhys().

◆ ExpList() [5/9]

Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::ExpansionInfoMap expansions,
const bool  DeclareCoeffPhysArrays = true,
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Sets up a list of local expansions based on an expansion Map.

Given an expansion vector expansions, containing information about the domain and the spectral/hp element expansion, this constructor fills the list of local expansions \texttt{m_exp} with the proper expansions, calculates the total number of quadrature points \(\boldsymbol{x}_i\) and local expansion coefficients \(\hat{u}^e_n\).

Parameters
pSessionA session within information about expansion
expansionsA vector containing information about the domain and the spectral/hp element expansion.
DeclareCoeffPhysArraysDeclare the coefficient and phys space arrays
ImpTypeDetail about the implementation type to use in operators

Definition at line 210 of file ExpList.cpp.

214 : m_comm(pSession->GetComm()), m_session(pSession), m_physState(false),
217 m_WaveSpace(false)
218{
219 // Initialise expansion vector
220 InitialiseExpVector(expansions);
221
222 // Set up m_coeffs, m_phys and offset arrays.
223 SetupCoeffPhys(DeclareCoeffPhysArrays);
224
225 // Setup Collection
226 CreateCollections(ImpType);
227}

References CreateCollections(), InitialiseExpVector(), and SetupCoeffPhys().

◆ ExpList() [6/9]

Nektar::MultiRegions::ExpList::ExpList ( const SpatialDomains::PointGeomSharedPtr geom)

Specialised constructors for 0D Expansions Wrapper around LocalRegion::PointExp - used in PrePacing.cpp.

Definition at line 232 of file ExpList.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::Point, and SetupCoeffPhys().

◆ ExpList() [7/9]

Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession,
const Array< OneD, const ExpListSharedPtr > &  bndConstraint,
const Array< OneD, const SpatialDomains ::BoundaryConditionShPtr > &  bndCond,
const LocalRegions::ExpansionVector locexp,
const SpatialDomains::MeshGraphSharedPtr graph,
const LibUtilities::CommSharedPtr comm,
const bool  DeclareCoeffPhysArrays = true,
const std::string  variable = "DefaultVar",
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Generate expansions for the trace space expansions used in DisContField.

◆ ExpList() [8/9]

Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession,
const LocalRegions::ExpansionVector locexp,
const SpatialDomains::MeshGraphSharedPtr graph,
const bool  DeclareCoeffPhysArrays,
const std::string  variable,
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Generate an trace ExpList from a meshgraph graph and session file.

Set expansions for localtrace space expansions used in DisContField as part of Gradient Jump Penalisation

Parameters
pSessionA session within information about expansion
locexpComplete domain expansion list.
graphmesh corresponding to the expansion list.
DeclareCoeffPhysArraysDeclare the coefficient and phys space arrays
variableThe variable name associated with the expansion
ImpTypeDetail about the implementation type to use in operators

Definition at line 1105 of file ExpList.cpp.

1111 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
1112 m_physState(false),
1115 m_WaveSpace(false)
1116{
1117 int i, j, elmtid = 0;
1118
1125
1131
1132 for (i = 0; i < locexp.size(); ++i)
1133 {
1134 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
1135 locexp[i])))
1136 {
1137 m_expType = e0D;
1138
1139 for (j = 0; j < 2; ++j)
1140 {
1141 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
1142
1144 PointGeom);
1145 exp->SetElmtId(elmtid++);
1146 (*m_exp).push_back(exp);
1147 }
1148 }
1149 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
1150 locexp[i])))
1151 {
1152 m_expType = e1D;
1153 LibUtilities::BasisKey edgeKey0 =
1154 locexp[i]->GetBasis(0)->GetBasisKey();
1155
1156 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
1157 {
1158 segGeom = exp2D->GetGeom2D()->GetEdge(j);
1159
1160 int dir = exp2D->GetGeom2D()->GetDir(j);
1161
1162 if (locexp[i]->GetNtraces() == 3)
1163 {
1164 LibUtilities::BasisKey edgeKey =
1165 locexp[i]->GetBasis(dir)->GetBasisKey();
1166
1167 LibUtilities::BasisKey nEdgeKey(edgeKey0.GetBasisType(),
1168 edgeKey.GetNumModes(),
1169 edgeKey.GetPointsKey());
1170
1171 exp =
1173 nEdgeKey, segGeom);
1174 }
1175 else
1176 {
1177 exp =
1179 locexp[i]->GetBasis(dir)->GetBasisKey(), segGeom);
1180 }
1181
1182 exp->SetElmtId(elmtid++);
1183 (*m_exp).push_back(exp);
1184 }
1185 }
1186 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
1187 locexp[i])))
1188 {
1189 m_expType = e2D;
1190
1191 LibUtilities::BasisKey face0_dir0 =
1192 locexp[i]->GetBasis(0)->GetBasisKey();
1193 LibUtilities::BasisKey face0_dir1 =
1194 locexp[i]->GetBasis(1)->GetBasisKey();
1195
1196 for (j = 0; j < exp3D->GetNtraces(); ++j)
1197 {
1198 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
1199
1200 int dir0 = exp3D->GetGeom3D()->GetDir(j, 0);
1201 int dir1 = exp3D->GetGeom3D()->GetDir(j, 1);
1202
1203 LibUtilities::BasisKey face_dir0 =
1204 locexp[i]->GetBasis(dir0)->GetBasisKey();
1205 LibUtilities::BasisKey face_dir1 =
1206 locexp[i]->GetBasis(dir1)->GetBasisKey();
1207
1208 if ((QuadGeom =
1209 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1210 FaceGeom)))
1211 {
1212 exp =
1214 face_dir0, face_dir1, QuadGeom);
1215 }
1216 else if ((TriGeom = std::dynamic_pointer_cast<
1217 SpatialDomains::TriGeom>(FaceGeom)))
1218 {
1219 LibUtilities::BasisKey nface_dir0(face0_dir0.GetBasisType(),
1220 face_dir0.GetNumModes(),
1221 face_dir0.GetPointsKey());
1222 LibUtilities::BasisKey nface_dir1(face0_dir1.GetBasisType(),
1223 face_dir1.GetNumModes(),
1224 face_dir1.GetPointsKey());
1225 exp =
1227 nface_dir0, nface_dir1, TriGeom);
1228 }
1229 exp->SetElmtId(elmtid++);
1230 (*m_exp).push_back(exp);
1231 }
1232 }
1233 }
1234
1235 // Set up m_coeffs, m_phys and offset arrays.
1236 SetupCoeffPhys(DeclareCoeffPhysArrays);
1237
1238 // Set up collections
1239 if (m_expType != e0D)
1240 {
1241 CreateCollections(ImpType);
1242 }
1243}
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:66
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:46
std::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:47
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:50
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:47
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:45
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:57
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:62
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:56
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:61

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), CreateCollections(), Nektar::MultiRegions::e0D, Nektar::MultiRegions::e1D, Nektar::MultiRegions::e2D, Nektar::LibUtilities::BasisKey::GetBasisType(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetPointsKey(), m_expType, and SetupCoeffPhys().

◆ ExpList() [9/9]

Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::CompositeMap domain,
const SpatialDomains::MeshGraphSharedPtr graph,
const bool  DeclareCoeffPhysArrays = true,
const std::string  variable = "DefaultVar",
bool  SetToOneSpaceDimension = false,
const LibUtilities::CommSharedPtr  comm = LibUtilities::CommSharedPtr(),
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Constructor based on domain information only for 1D & 2D boundary conditions.

Fills the list of local expansions with the trace from the mesh specified by domain. This CompositeMap contains a list of Composites which define the boundary. It is also used to set up expansion domains in the 1D Pulse Wave solver.

Parameters
pSessionA session within information about expansion
domainA domain, comprising of one or more composite regions,
graphA mesh, containing information about the domain and the spectral/hp element expansion.
DeclareCoeffPhysArraysDeclare the coefficient and phys space arrays. Default is true.
variableThe variable name associated with the expansion
SetToOneSpaceDimensionReduce to one space dimension expansion
commAn optional communicator that can be used with the boundary expansion in case of more global parallel operations. Default to a Null Communicator
ImpTypeDetail about the implementation type to use in operators. Default is eNoImpType.

By default the routine will try and order the expansions in a manner which is optimal for collection type operations. This can be disabled by the command line option –no-exp-opt

Definition at line 1270 of file ExpList.cpp.

1277 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
1280 m_WaveSpace(false)
1281{
1282 int j, elmtid = 0;
1287
1289
1291
1292 int meshdim = graph->GetMeshDimension();
1293
1294 // Retrieve the list of expansions (element exp)
1295 const SpatialDomains::ExpansionInfoMap &expansions =
1296 graph->GetExpansionInfo(variable);
1297 map<int, vector<SpatialDomains::ExpansionInfoShPtr>> ExpOrder;
1299
1300 bool DoOptOnCollection =
1301 m_session->DefinesCmdLineArgument("no-exp-opt") ? false : true;
1302 int cnt = 0;
1303 for (auto &compIt : domain)
1304 {
1305 bool IsNot0D = true; // Cehck for 0D expansion
1306 // Process each expansion in the region.
1307 for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
1308 {
1312 compIt.second->m_geomVec[j], PtBvec);
1313
1314 if ((SegGeom = std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1315 compIt.second->m_geomVec[j])))
1316 {
1317 if (meshdim == 1)
1318 {
1319 auto expInfo = expansions.find(SegGeom->GetGlobalID());
1320 eInfo = expInfo->second;
1321 }
1322 else // get bkey from Tri or Quad
1323 {
1324 // First, create the element stdExp that the edge belongs to
1326 graph->GetElementsFromEdge(SegGeom);
1327 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1328 // Currently we assume the elements adjacent to the edge
1329 // have the same type. So we directly fetch the first
1330 // element.
1331 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1332 int edge_id = elmts->at(0).second;
1334 graph->GetExpansionInfo(geom, variable);
1335 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1336 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1338
1339 if (geom->GetShapeType() == LibUtilities::eTriangle)
1340 {
1341 elmtStdExp = MemoryManager<
1342 StdRegions::StdTriExp>::AllocateSharedPtr(Ba, Bb);
1343 }
1344 else if (geom->GetShapeType() ==
1346 {
1347 elmtStdExp = MemoryManager<
1348 StdRegions::StdQuadExp>::AllocateSharedPtr(Ba, Bb);
1349 }
1350 else
1351 {
1353 "Fail to cast geom to a known 2D shape.");
1354 }
1355 // Then, get the trace basis key from the element stdExp,
1356 // which may be different from Ba and Bb.
1357 eInfo->m_basisKeyVector.push_back(
1358 elmtStdExp->GetTraceBasisKey(edge_id));
1359 }
1360 }
1361 else if ((TriGeom =
1362 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1363 compIt.second->m_geomVec[j])))
1364 {
1365 // First, create the element stdExp that the face belongs to
1367 graph->GetElementsFromFace(TriGeom);
1368 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1369 // Currently we assume the elements adjacent to the face have
1370 // the same type. So we directly fetch the first element.
1371 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1372 int face_id = elmts->at(0).second;
1373 auto expInfo = expansions.find(geom->GetGlobalID());
1374 ASSERTL0(expInfo != expansions.end(),
1375 "Failed to find expansion info");
1376 LibUtilities::BasisKey Ba =
1377 expInfo->second->m_basisKeyVector[0];
1378 LibUtilities::BasisKey Bb =
1379 expInfo->second->m_basisKeyVector[1];
1380 LibUtilities::BasisKey Bc =
1381 expInfo->second->m_basisKeyVector[2];
1383
1384 if (geom->GetShapeType() == LibUtilities::ePrism)
1385 {
1386 elmtStdExp = MemoryManager<
1387 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1388 }
1389 else if (geom->GetShapeType() == LibUtilities::eTetrahedron)
1390 {
1391 elmtStdExp =
1393 Ba, Bb, Bc);
1394 }
1395 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1396 {
1397 elmtStdExp =
1399 Ba, Bb, Bc);
1400 }
1401 else // hex cannot have tri surface
1402 {
1404 "Fail to cast geom to a known 3D shape.");
1405 }
1406 // Then, get the trace basis key from the element stdExp,
1407 // which may be different from Ba, Bb and Bc.
1408 LibUtilities::BasisKey TriBa =
1409 elmtStdExp->GetTraceBasisKey(face_id, 0);
1410 LibUtilities::BasisKey TriBb =
1411 elmtStdExp->GetTraceBasisKey(face_id, 1);
1412 // swap TriBa and TriBb orientation is transposed
1413 if (geom->GetForient(face_id) >= 9)
1414 {
1415 std::swap(TriBa, TriBb);
1416 }
1417
1418 eInfo->m_basisKeyVector.push_back(TriBa);
1419 eInfo->m_basisKeyVector.push_back(TriBb);
1420 }
1421 else if ((QuadGeom =
1422 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1423 compIt.second->m_geomVec[j])))
1424 {
1425 // First, create the element stdExp that the face belongs to
1427 graph->GetElementsFromFace(QuadGeom);
1428 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1429 // Currently we assume the elements adjacent to the face have
1430 // the same type. So we directly fetch the first element.
1431 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1432 int face_id = elmts->at(0).second;
1433 auto expInfo = expansions.find(geom->GetGlobalID());
1434 ASSERTL0(expInfo != expansions.end(),
1435 "Failed to find expansion info");
1436 LibUtilities::BasisKey Ba =
1437 expInfo->second->m_basisKeyVector[0];
1438 LibUtilities::BasisKey Bb =
1439 expInfo->second->m_basisKeyVector[1];
1440 LibUtilities::BasisKey Bc =
1441 expInfo->second->m_basisKeyVector[2];
1443
1444 if (geom->GetShapeType() == LibUtilities::ePrism)
1445 {
1446 elmtStdExp = MemoryManager<
1447 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1448 }
1449 else if (geom->GetShapeType() == LibUtilities::eHexahedron)
1450 {
1451 elmtStdExp =
1453 Ba, Bb, Bc);
1454 }
1455 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1456 {
1457 elmtStdExp =
1459 Ba, Bb, Bc);
1460 }
1461 else // Tet cannot have quad surface
1462 {
1464 "Fail to cast geom to a known 3D shape.");
1465 }
1466 // Then, get the trace basis key from the element stdExp,
1467 // which may be different from Ba, Bb and Bc.
1468 LibUtilities::BasisKey QuadBa =
1469 elmtStdExp->GetTraceBasisKey(face_id, 0);
1470 LibUtilities::BasisKey QuadBb =
1471 elmtStdExp->GetTraceBasisKey(face_id, 1);
1472 // swap Ba and Bb if the orientation is transposed
1473 if (geom->GetForient(face_id) >= 9)
1474 {
1475 std::swap(QuadBa, QuadBb);
1476 }
1477
1478 eInfo->m_basisKeyVector.push_back(QuadBa);
1479 eInfo->m_basisKeyVector.push_back(QuadBb);
1480 }
1481 else
1482 {
1483 IsNot0D = false;
1484 }
1485
1486 if (DoOptOnCollection && IsNot0D)
1487 {
1488 int i;
1489 for (i = 0; i < cnt; ++i)
1490 {
1491 if ((eInfo->m_basisKeyVector ==
1492 ExpOrder[i][0]->m_basisKeyVector) &&
1493 (eInfo->m_geomShPtr->GetGeomFactors()->GetGtype() ==
1494 ExpOrder[i][0]
1495 ->m_geomShPtr->GetGeomFactors()
1496 ->GetGtype()))
1497 {
1498 ExpOrder[i].push_back(eInfo);
1499 break;
1500 }
1501 }
1502
1503 if (i == cnt)
1504 {
1505 ExpOrder[cnt++].push_back(eInfo);
1506 }
1507 }
1508 else
1509 {
1510 ExpOrder[0].push_back(eInfo);
1511 }
1512 }
1513 }
1514
1515 // decalare expansions in provided order using geom and basis info
1516 for (auto &ordIt : ExpOrder)
1517 {
1518 for (auto &eit : ordIt.second)
1519 {
1520 // Process each expansion in the region.
1521 if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
1522 eit->m_geomShPtr)))
1523 {
1524 m_expType = e0D;
1525
1527 PtGeom);
1528 }
1529 else if ((SegGeom =
1530 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1531 eit->m_geomShPtr)))
1532 {
1533 m_expType = e1D;
1534
1535 if (SetToOneSpaceDimension)
1536 {
1537 SpatialDomains::SegGeomSharedPtr OneDSegmentGeom =
1538 SegGeom->GenerateOneSpaceDimGeom();
1539
1540 exp =
1542 eit->m_basisKeyVector[0], OneDSegmentGeom);
1543 }
1544 else
1545 {
1546 exp =
1548 eit->m_basisKeyVector[0], SegGeom);
1549 }
1550 }
1551 else if ((TriGeom =
1552 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1553 eit->m_geomShPtr)))
1554 {
1555 m_expType = e2D;
1556
1557 if (eit->m_basisKeyVector[0].GetBasisType() ==
1559 {
1561
1563 AllocateSharedPtr(eit->m_basisKeyVector[0],
1564 eit->m_basisKeyVector[1], TriNb,
1565 TriGeom);
1566 }
1567 else
1568 {
1569 exp =
1571 eit->m_basisKeyVector[0], eit->m_basisKeyVector[1],
1572 TriGeom);
1573 }
1574 }
1575 else if ((QuadGeom =
1576 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1577 eit->m_geomShPtr)))
1578 {
1579 m_expType = e2D;
1580
1582 eit->m_basisKeyVector[0], eit->m_basisKeyVector[1],
1583 QuadGeom);
1584 }
1585 else
1586 {
1588 "dynamic cast to a Geom (possibly 3D) failed");
1589 }
1590
1591 exp->SetElmtId(elmtid++);
1592 (*m_exp).push_back(exp);
1593 }
1594 }
1595
1596 // Set up m_coeffs, m_phys and offset arrays.
1597 SetupCoeffPhys(DeclareCoeffPhysArrays);
1598
1599 if (m_expType != e0D)
1600 {
1601 CreateCollections(ImpType);
1602 }
1603}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
std::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
Definition: PointsType.h:81
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:56
std::shared_ptr< std::vector< std::pair< GeometrySharedPtr, int > > > GeometryLinkSharedPtr
Definition: MeshGraph.h:166
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:59
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
Definition: MeshGraph.h:140
std::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:51
std::shared_ptr< StdExpansion > StdExpansionSharedPtr

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, CreateCollections(), Nektar::MultiRegions::e0D, Nektar::MultiRegions::e1D, Nektar::MultiRegions::e2D, Nektar::ErrorUtil::efatal, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::eNodalTriElec, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::ePyramid, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, m_expType, m_session, NEKERROR, and SetupCoeffPhys().

◆ ~ExpList()

Nektar::MultiRegions::ExpList::~ExpList ( )
virtual

The default destructor.

Definition at line 1893 of file ExpList.cpp.

1894{
1895}

Member Function Documentation

◆ AddFwdBwdTraceIntegral()

void Nektar::MultiRegions::ExpList::AddFwdBwdTraceIntegral ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 2178 of file ExpList.h.

2181{
2182 v_AddFwdBwdTraceIntegral(Fwd, Bwd, outarray);
2183}
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5071

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

void Nektar::MultiRegions::ExpList::AddRightIPTBaseMatrix ( const Array< OneD, const DNekMatSharedPtr ElmtJacQuad,
Array< OneD, DNekMatSharedPtr ElmtJacCoef 
)

Definition at line 6545 of file ExpList.cpp.

6548{
6549 int nelmt;
6550 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6551
6552 nelmtcoef = GetNcoeffs(0);
6553 nelmtpnts = GetTotPoints(0);
6554
6555 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6556 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6557
6558 Array<OneD, NekDouble> MatQ_data;
6559 Array<OneD, NekDouble> MatC_data;
6560
6561 DNekMatSharedPtr tmpMatQ, tmpMatC;
6562
6563 nelmtcoef0 = nelmtcoef;
6564 nelmtpnts0 = nelmtpnts;
6565
6566 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6567 {
6568 nelmtcoef = GetNcoeffs(nelmt);
6569 nelmtpnts = GetTotPoints(nelmt);
6570
6571 tmpMatQ = ElmtJacQuad[nelmt];
6572 tmpMatC = ElmtJacCoef[nelmt];
6573
6574 MatQ_data = tmpMatQ->GetPtr();
6575 MatC_data = tmpMatC->GetPtr();
6576
6577 if (nelmtcoef != nelmtcoef0)
6578 {
6579 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6580 nelmtcoef0 = nelmtcoef;
6581 }
6582
6583 if (nelmtpnts != nelmtpnts0)
6584 {
6585 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6586 nelmtpnts0 = nelmtpnts;
6587 }
6588
6589 for (int np = 0; np < nelmtcoef; np++)
6590 {
6591 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6592 1);
6593 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6594 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
6595
6596 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6597 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6598 }
6599 }
6600}
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1512
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1557
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.hpp:180
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References GetNcoeffs(), GetTotPoints(), Vmath::Vadd(), and Vmath::Vcopy().

◆ AddRightIPTPhysDerivBase()

void Nektar::MultiRegions::ExpList::AddRightIPTPhysDerivBase ( const int  dir,
const Array< OneD, const DNekMatSharedPtr ElmtJacQuad,
Array< OneD, DNekMatSharedPtr ElmtJacCoef 
)

Definition at line 6488 of file ExpList.cpp.

6491{
6492 int nelmt;
6493 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6494
6495 nelmtcoef = GetNcoeffs(0);
6496 nelmtpnts = GetTotPoints(0);
6497
6498 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6499 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6500
6501 Array<OneD, NekDouble> MatQ_data;
6502 Array<OneD, NekDouble> MatC_data;
6503
6504 DNekMatSharedPtr tmpMatQ, tmpMatC;
6505
6506 nelmtcoef0 = nelmtcoef;
6507 nelmtpnts0 = nelmtpnts;
6508
6509 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6510 {
6511 nelmtcoef = GetNcoeffs(nelmt);
6512 nelmtpnts = GetTotPoints(nelmt);
6513
6514 tmpMatQ = ElmtJacQuad[nelmt];
6515 tmpMatC = ElmtJacCoef[nelmt];
6516
6517 MatQ_data = tmpMatQ->GetPtr();
6518 MatC_data = tmpMatC->GetPtr();
6519
6520 if (nelmtcoef != nelmtcoef0)
6521 {
6522 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6523 nelmtcoef0 = nelmtcoef;
6524 }
6525
6526 if (nelmtpnts != nelmtpnts0)
6527 {
6528 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6529 nelmtpnts0 = nelmtpnts;
6530 }
6531
6532 for (int np = 0; np < nelmtcoef; np++)
6533 {
6534 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6535 1);
6536 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6537 (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
6538
6539 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6540 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6541 }
6542 }
6543}

References GetNcoeffs(), GetTotPoints(), Vmath::Vadd(), and Vmath::Vcopy().

◆ AddTraceIntegral()

void Nektar::MultiRegions::ExpList::AddTraceIntegral ( const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 2173 of file ExpList.h.

2175{
2176 v_AddTraceIntegral(Fn, outarray);
2177}
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5063

References v_AddTraceIntegral().

◆ AddTraceIntegralToOffDiag()

void Nektar::MultiRegions::ExpList::AddTraceIntegralToOffDiag ( const Array< OneD, const NekDouble > &  FwdFlux,
const Array< OneD, const NekDouble > &  BwdFlux,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1011 of file ExpList.h.

1015 {
1016 v_AddTraceIntegralToOffDiag(FwdFlux, BwdFlux, outarray);
1017 }
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:6030

References v_AddTraceIntegralToOffDiag().

◆ AddTraceJacToElmtJac()

void Nektar::MultiRegions::ExpList::AddTraceJacToElmtJac ( const Array< OneD, const DNekMatSharedPtr > &  FwdMat,
const Array< OneD, const DNekMatSharedPtr > &  BwdMat,
Array< OneD, DNekMatSharedPtr > &  fieldMat 
)

inverse process of v_GetFwdBwdTracePhys. Given Trace integration of Fwd and Bwd Jacobian, with dimension NtotalTrace*TraceCoef*TracePhys. return Elemental Jacobian matrix with dimension NtotalElement*ElementCoef*ElementPhys.

Parameters
fieldis a NekDouble array which contains the 2D data from which we wish to extract the backward and forward orientated trace/edge arrays.
FwdThe resulting forwards space.
BwdThe resulting backwards space.

Definition at line 6252 of file ExpList.cpp.

6256{
6258 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
6259 tracelist->GetExp();
6260 int ntotTrace = (*traceExp).size();
6261 int nTracePnt, nTraceCoef;
6262
6263 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp = GetExp();
6264 int nElmtCoef;
6265
6266 const MultiRegions::LocTraceToTraceMapSharedPtr locTraceToTraceMap =
6268 const Array<OneD, const Array<OneD, int>> LRAdjExpid =
6269 locTraceToTraceMap->GetLeftRightAdjacentExpId();
6270 const Array<OneD, const Array<OneD, bool>> LRAdjflag =
6271 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
6272
6273 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRMap =
6274 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
6275 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRSign =
6276 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
6277 DNekMatSharedPtr ElmtMat;
6278 Array<OneD, NekDouble> ElmtMat_data;
6279 // int nclAdjExp;
6280 int nrwAdjExp;
6281 int MatIndex, nPnts;
6282 NekDouble sign = 1.0;
6283
6284 int nTracePntsTtl = tracelist->GetTotPoints();
6285 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
6286 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
6287 int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
6288
6289 Array<OneD, int> nlocTracePtsLR(2);
6290 nlocTracePtsLR[0] = nlocTracePtsFwd;
6291 nlocTracePtsLR[1] = nlocTracePtsBwd;
6292
6293 size_t nFwdBwdNonZero = 0;
6294 Array<OneD, int> tmpIndex{2, -1};
6295 for (int i = 0; i < 2; ++i)
6296 {
6297 if (nlocTracePtsLR[i] > 0)
6298 {
6299 tmpIndex[nFwdBwdNonZero] = i;
6300 nFwdBwdNonZero++;
6301 }
6302 }
6303
6304 Array<OneD, int> nlocTracePtsNonZeroIndex{nFwdBwdNonZero};
6305 for (int i = 0; i < nFwdBwdNonZero; ++i)
6306 {
6307 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
6308 }
6309
6310 Array<OneD, NekDouble> TraceFwdPhy(nTracePntsTtl);
6311 Array<OneD, NekDouble> TraceBwdPhy(nTracePntsTtl);
6312 Array<OneD, Array<OneD, NekDouble>> tmplocTrace(2);
6313 for (int k = 0; k < 2; ++k)
6314 {
6315 tmplocTrace[k] = NullNekDouble1DArray;
6316 }
6317
6318 for (int k = 0; k < nFwdBwdNonZero; ++k)
6319 {
6320 size_t i = nlocTracePtsNonZeroIndex[k];
6321 tmplocTrace[i] = Array<OneD, NekDouble>(nlocTracePtsLR[i]);
6322 }
6323
6324 int nNumbElmt = fieldMat.size();
6325 Array<OneD, Array<OneD, NekDouble>> ElmtMatDataArray(nNumbElmt);
6326 Array<OneD, int> ElmtCoefArray(nNumbElmt);
6327 for (int i = 0; i < nNumbElmt; i++)
6328 {
6329 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
6330 ElmtCoefArray[i] = GetNcoeffs(i);
6331 }
6332
6333 int nTraceCoefMax = 0;
6334 int nTraceCoefMin = std::numeric_limits<int>::max();
6335 Array<OneD, int> TraceCoefArray(ntotTrace);
6336 Array<OneD, int> TracePntArray(ntotTrace);
6337 Array<OneD, int> TraceOffArray(ntotTrace);
6338 Array<OneD, Array<OneD, NekDouble>> FwdMatData(ntotTrace);
6339 Array<OneD, Array<OneD, NekDouble>> BwdMatData(ntotTrace);
6340 for (int nt = 0; nt < ntotTrace; nt++)
6341 {
6342 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
6343 nTracePnt = tracelist->GetTotPoints(nt);
6344 int noffset = tracelist->GetPhys_Offset(nt);
6345 TraceCoefArray[nt] = nTraceCoef;
6346 TracePntArray[nt] = nTracePnt;
6347 TraceOffArray[nt] = noffset;
6348 FwdMatData[nt] = FwdMat[nt]->GetPtr();
6349 BwdMatData[nt] = BwdMat[nt]->GetPtr();
6350 if (nTraceCoef > nTraceCoefMax)
6351 {
6352 nTraceCoefMax = nTraceCoef;
6353 }
6354 if (nTraceCoef < nTraceCoefMin)
6355 {
6356 nTraceCoefMin = nTraceCoef;
6357 }
6358 }
6359 WARNINGL1(nTraceCoefMax == nTraceCoefMin,
6360 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
6361
6362 int traceID, nfieldPnts, ElmtId, noffset;
6363 const Array<OneD, const Array<OneD, int>> LocTracephysToTraceIDMap =
6364 locTraceToTraceMap->GetLocTracephysToTraceIDMap();
6365 const Array<OneD, const int> fieldToLocTraceMap =
6366 locTraceToTraceMap->GetLocTraceToFieldMap();
6367 Array<OneD, Array<OneD, int>> fieldToLocTraceMapLR(2);
6368 noffset = 0;
6369 for (int k = 0; k < nFwdBwdNonZero; ++k)
6370 {
6371 size_t i = nlocTracePtsNonZeroIndex[k];
6372 fieldToLocTraceMapLR[i] = Array<OneD, int>(nlocTracePtsLR[i]);
6373 Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
6374 &fieldToLocTraceMapLR[i][0], 1);
6375 noffset += nlocTracePtsLR[i];
6376 }
6377
6378 Array<OneD, Array<OneD, int>> MatIndexArray(2);
6379 for (int k = 0; k < nFwdBwdNonZero; ++k)
6380 {
6381 size_t nlr = nlocTracePtsNonZeroIndex[k];
6382 MatIndexArray[nlr] = Array<OneD, int>(nlocTracePtsLR[nlr]);
6383 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6384 {
6385 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6386 nTraceCoef = TraceCoefArray[traceID];
6387 ElmtId = LRAdjExpid[nlr][traceID];
6388 noffset = GetPhys_Offset(ElmtId);
6389 nElmtCoef = ElmtCoefArray[ElmtId];
6390 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
6391 nPnts = nfieldPnts - noffset;
6392
6393 MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
6394 }
6395 }
6396
6397 for (int nc = 0; nc < nTraceCoefMin; nc++)
6398 {
6399 for (int nt = 0; nt < ntotTrace; nt++)
6400 {
6401 nTraceCoef = TraceCoefArray[nt];
6402 nTracePnt = TracePntArray[nt];
6403 noffset = TraceOffArray[nt];
6404 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6405 &TraceFwdPhy[noffset], 1);
6406 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6407 &TraceBwdPhy[noffset], 1);
6408 }
6409
6410 for (int k = 0; k < nFwdBwdNonZero; ++k)
6411 {
6412 size_t i = nlocTracePtsNonZeroIndex[k];
6413 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6414 }
6415
6416 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6417 tmplocTrace[1]);
6418
6419 for (int k = 0; k < nFwdBwdNonZero; ++k)
6420 {
6421 size_t nlr = nlocTracePtsNonZeroIndex[k];
6422 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6423 {
6424 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6425 nTraceCoef = TraceCoefArray[traceID];
6426 ElmtId = LRAdjExpid[nlr][traceID];
6427 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6428 sign = elmtLRSign[nlr][traceID][nc];
6429 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6430
6431 ElmtMatDataArray[ElmtId][MatIndex] -=
6432 sign * tmplocTrace[nlr][nloc];
6433 }
6434 }
6435 }
6436
6437 for (int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
6438 {
6439 for (int nt = 0; nt < ntotTrace; nt++)
6440 {
6441 nTraceCoef = TraceCoefArray[nt];
6442 nTracePnt = TracePntArray[nt];
6443 noffset = TraceOffArray[nt];
6444 if (nc < nTraceCoef)
6445 {
6446 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6447 &TraceFwdPhy[noffset], 1);
6448 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6449 &TraceBwdPhy[noffset], 1);
6450 }
6451 else
6452 {
6453 Vmath::Zero(nTracePnt, &TraceFwdPhy[noffset], 1);
6454 Vmath::Zero(nTracePnt, &TraceBwdPhy[noffset], 1);
6455 }
6456 }
6457
6458 for (int k = 0; k < nFwdBwdNonZero; ++k)
6459 {
6460 size_t i = nlocTracePtsNonZeroIndex[k];
6461 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6462 }
6463 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6464 tmplocTrace[1]);
6465
6466 for (int k = 0; k < nFwdBwdNonZero; ++k)
6467 {
6468 size_t nlr = nlocTracePtsNonZeroIndex[k];
6469 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6470 {
6471 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6472 nTraceCoef = TraceCoefArray[traceID];
6473 if (nc < nTraceCoef)
6474 {
6475 ElmtId = LRAdjExpid[nlr][traceID];
6476 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6477 sign = -elmtLRSign[nlr][traceID][nc];
6478 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6479
6480 ElmtMatDataArray[ElmtId][MatIndex] +=
6481 sign * tmplocTrace[nlr][nloc];
6482 }
6483 }
6484 }
6485 }
6486}
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:243
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:47
std::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2153
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition: ExpList.h:2123
void GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
Definition: ExpList.h:2209
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2070
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
Definition: ExpList.h:2085
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
double NekDouble
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

References GetExp(), GetLocTraceFromTracePts(), GetLocTraceToTraceMap(), GetNcoeffs(), GetPhys_Offset(), GetTrace(), Nektar::NullNekDouble1DArray, sign, Vmath::Vcopy(), WARNINGL1, and Vmath::Zero().

◆ AddTraceQuadPhysToField()

void Nektar::MultiRegions::ExpList::AddTraceQuadPhysToField ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  field 
)
inline

Add Fwd and Bwd value to field, a reverse procedure of GetFwdBwdTracePhys.

Definition at line 2203 of file ExpList.h.

2206{
2208}
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:5106

References FilterPython_Function::field, and v_AddTraceQuadPhysToField().

◆ AddTraceQuadPhysToOffDiag()

void Nektar::MultiRegions::ExpList::AddTraceQuadPhysToOffDiag ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  field 
)
inline

Definition at line 815 of file ExpList.h.

818 {
820 }
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:5115

References FilterPython_Function::field, and v_AddTraceQuadPhysToOffDiag().

◆ AppendFieldData() [1/2]

void Nektar::MultiRegions::ExpList::AppendFieldData ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata 
)
inline

Append the element data listed in elements fielddef->m_ElementIDs onto fielddata.

Definition at line 910 of file ExpList.h.

912 {
913 v_AppendFieldData(fielddef, fielddata);
914 }
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:4205

References v_AppendFieldData().

◆ AppendFieldData() [2/2]

void Nektar::MultiRegions::ExpList::AppendFieldData ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata,
Array< OneD, NekDouble > &  coeffs 
)
inline

Append the data in coeffs listed in elements fielddef->m_ElementIDs onto fielddata.

Definition at line 917 of file ExpList.h.

920 {
921 v_AppendFieldData(fielddef, fielddata, coeffs);
922 }

References v_AppendFieldData().

◆ ApplyGeomInfo()

void Nektar::MultiRegions::ExpList::ApplyGeomInfo ( )

Apply geometry information to each expansion.

Configures geometric info, such as tangent direction, on each expansion.

Parameters
graph2DMesh

Definition at line 3320 of file ExpList.cpp.

3321{
3322}

Referenced by Nektar::MultiRegions::DisContField::DisContField().

◆ BwdTrans()

void Nektar::MultiRegions::ExpList::BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function elementally evaluates the backward transformation of the global spectral/hp element expansion.

Given the coefficients of an expansion, this function evaluates the spectral/hp expansion \(u^{\delta}(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).

Definition at line 1717 of file ExpList.h.

1719{
1720 v_BwdTrans(inarray, outarray);
1721}
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:3125

References v_BwdTrans().

Referenced by Nektar::MultiRegions::DisContField::L2_DGDeriv(), MultiplyByMassMatrix(), Nektar::MultiRegions::ContField::v_HelmSolve(), Nektar::MultiRegions::ContField::v_LinearAdvectionDiffusionReactionSolve(), Nektar::MultiRegions::ContField::v_SmoothField(), and v_WriteTecplotField().

◆ ClearGlobalLinSysManager()

void Nektar::MultiRegions::ExpList::ClearGlobalLinSysManager ( void  )

Definition at line 5955 of file ExpList.cpp.

5956{
5958}
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3978

References v_ClearGlobalLinSysManager().

◆ CreateCollections()

void Nektar::MultiRegions::ExpList::CreateCollections ( Collections::ImplementationType  ImpType = Collections::eNoImpType)

Construct collections of elements containing a single element type and polynomial order from the list of expansions.

Definition at line 5784 of file ExpList.cpp.

5785{
5786 // Set up initialisation flags
5788 std::vector<bool>(Collections::SIZE_OperatorType, true);
5789
5790 // Figure out optimisation parameters if provided in
5791 // session file or default given
5792 Collections::CollectionOptimisation colOpt(
5793 m_session, (*m_exp)[0]->GetShapeDimension(), ImpType);
5794
5795 // turn on autotuning if explicitly specified in xml file
5796 // or command line option is set but only do optimisation
5797 // for volumetric elements (not boundary condition)
5798 bool autotuning = colOpt.IsUsingAutotuning();
5799 if ((autotuning == false) && (ImpType == Collections::eNoImpType))
5800 {
5801 // turn on autotuning if write-opt-file specified
5802 // if m_graph available
5803 if (m_session->GetUpdateOptFile() && m_graph)
5804 {
5805 // only turn on autotuning for volumetric elements
5806 // where Mesh Dimension is equal to the Shape
5807 // Dimension of element.
5808 if (m_graph->GetMeshDimension() == (*m_exp)[0]->GetShapeDimension())
5809 {
5810 autotuning = true;
5811 }
5812 }
5813 }
5814 bool verbose = (m_session->DefinesCmdLineArgument("verbose")) &&
5815 (m_session->GetComm()->GetRank() == 0);
5816
5817 // clear vectors in case previously called
5818 m_collections.clear();
5819
5820 /*-------------------------------------------------------------------------
5821 Dividing m_exp into sub groups (collections): original exp order is kept.
5822 Use 3 basiskey + deformed flag to determine if two exp belong to the same
5823 collection or not.
5824 -------------------------------------------------------------------------*/
5825 // the maximum size is either explicitly specified, or set to very large
5826 // value which will not affect the actual collection size
5827 int collmax =
5828 (colOpt.GetMaxCollectionSize() > 0 ? colOpt.GetMaxCollectionSize()
5829 : 2 * m_exp->size());
5830
5831 vector<StdRegions::StdExpansionSharedPtr> collExp;
5832 LocalRegions::ExpansionSharedPtr exp = (*m_exp)[0];
5833 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(exp);
5834
5835 // add the first element to the collection - initialization
5836 collExp.push_back(exp);
5837 // collcnt is the number of elements in current collection
5838 int collcnt = 1;
5839 // initialize the basisKeys to NullBasisKey
5840 std::vector<LibUtilities::BasisKey> thisbasisKeys(
5842 std::vector<LibUtilities::BasisKey> prevbasisKeys(
5844 // fetch basiskeys of the first element
5845 for (int d = 0; d < exp->GetNumBases(); d++)
5846 {
5847 prevbasisKeys[d] = exp->GetBasis(d)->GetBasisKey();
5848 }
5849
5850 // initialize the deformed flag based on the first element
5851 bool prevDef =
5852 exp->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed;
5853 // collsize is the maximum size among all collections
5854 int collsize = 0;
5855 int mincol = (*m_exp).size();
5856 int maxcol = -1;
5857 int meancol = 0;
5858
5859 for (int i = 1; i < (*m_exp).size(); i++)
5860 {
5861 exp = (*m_exp)[i];
5862
5863 // fetch basiskeys of current element
5864 for (int d = 0; d < exp->GetNumBases(); d++)
5865 {
5866 thisbasisKeys[d] = exp->GetBasis(d)->GetBasisKey();
5867 }
5868 // fetch deformed flag of current element
5869 bool Deformed =
5870 (exp->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed);
5871
5872 // Check if this element is the same type as the previous one or
5873 // if we have reached the maximum collection size
5874 if (thisbasisKeys != prevbasisKeys || prevDef != Deformed ||
5875 collcnt >= collmax)
5876 {
5877 // if no Imp Type provided and No
5878 // setting in xml file. reset
5879 // impTypes using timings
5880 if (autotuning)
5881 {
5882 // if current collection is larger than previous one
5883 // update impTypes; otherwise, use previous impTypes
5884 if (collExp.size() > collsize)
5885 {
5886 impTypes =
5887 colOpt.SetWithTimings(collExp, impTypes, verbose);
5888 collsize = collExp.size();
5889 }
5890 }
5892 colOpt.GetOperatorImpMap(exp);
5893
5894 Collections::Collection tmp(collExp, impTypes);
5895 m_collections.push_back(tmp);
5896 mincol = min(mincol, (int)collExp.size());
5897 maxcol = max(maxcol, (int)collExp.size());
5898 meancol += collExp.size();
5899
5900 // for the new collection calling the optimization routine based on
5901 // its first element
5902 impTypes = colOpt.GetOperatorImpMap((*m_exp)[i]);
5903
5904 // clean-up current element list - temporary collection
5905 collExp.clear();
5906 collcnt = 0;
5907 collsize = 0;
5908 }
5909
5910 // insert exp and increment count
5911 collExp.push_back(exp);
5912 collcnt++;
5913 // update previous info
5914 prevbasisKeys = thisbasisKeys;
5915 prevDef = Deformed;
5916 }
5917
5918 // execute autotuning for the last collection
5919 if (autotuning)
5920 {
5921 if (collExp.size() > collsize)
5922 {
5923 impTypes = colOpt.SetWithTimings(collExp, impTypes, verbose);
5924 collsize = collExp.size();
5925 }
5926 }
5927 Collections::Collection tmp(collExp, impTypes);
5928 m_collections.push_back(tmp);
5929 if (verbose)
5930 {
5931 mincol = min(mincol, (int)collExp.size());
5932 maxcol = max(maxcol, (int)collExp.size());
5933 meancol += collExp.size();
5934 meancol /= m_collections.size();
5935 cout << "Collection group: num. = " << m_collections.size()
5936 << "; mean len = " << meancol << " (min = " << mincol
5937 << ", max = " << maxcol << ")" << endl;
5938 }
5939
5940 // clean-up current element list - temporary collection
5941 collExp.clear();
5942 collcnt = 0;
5943 collsize = 0;
5944
5945 // update optimisation file
5946 if ((m_session->GetUpdateOptFile()) && (ImpType == Collections::eNoImpType))
5947 {
5948 colOpt.UpdateOptFile(m_session->GetSessionName(), m_comm);
5949 // turn off write-opt-file option so only first
5950 // instance is timed
5951 m_session->SetUpdateOptFile(false);
5952 }
5953}
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition: ExpList.h:1912
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:131
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
@ eDeformed
Geometry is curved or has non-constant factors.
std::vector< double > d(NPUPPER *NPUPPER)

References Nektar::UnitTests::d(), Nektar::SpatialDomains::eDeformed, Nektar::Collections::eNoImpType, Nektar::Collections::CollectionOptimisation::GetMaxCollectionSize(), Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), GetShapeDimension(), Nektar::Collections::CollectionOptimisation::IsUsingAutotuning(), m_collections, m_collectionsDoInit, m_comm, m_exp, m_graph, m_session, Nektar::LibUtilities::NullBasisKey(), Nektar::Collections::CollectionOptimisation::SetWithTimings(), Nektar::Collections::SIZE_OperatorType, and Nektar::Collections::CollectionOptimisation::UpdateOptFile().

Referenced by ExpList(), and v_Reset().

◆ CurlCurl()

void Nektar::MultiRegions::ExpList::CurlCurl ( Array< OneD, Array< OneD, NekDouble > > &  Vel,
Array< OneD, Array< OneD, NekDouble > > &  Q 
)
inline

Definition at line 1832 of file ExpList.h.

1834{
1835 v_CurlCurl(Vel, Q);
1836}
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
Definition: ExpList.cpp:2289

References v_CurlCurl().

◆ DealiasedDotProd()

void Nektar::MultiRegions::ExpList::DealiasedDotProd ( const int  num_dofs,
const Array< OneD, Array< OneD, NekDouble > > &  inarray1,
const Array< OneD, Array< OneD, NekDouble > > &  inarray2,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
inline

Definition at line 1868 of file ExpList.h.

1872{
1873 v_DealiasedDotProd(num_dofs, inarray1, inarray2, outarray);
1874}
virtual void v_DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: ExpList.cpp:5248

References v_DealiasedDotProd().

◆ DealiasedProd()

void Nektar::MultiRegions::ExpList::DealiasedProd ( const int  num_dofs,
const Array< OneD, NekDouble > &  inarray1,
const Array< OneD, NekDouble > &  inarray2,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1858 of file ExpList.h.

1862{
1863 v_DealiasedProd(num_dofs, inarray1, inarray2, outarray);
1864}
virtual void v_DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5238

References v_DealiasedProd().

Referenced by Nektar::MultiRegions::ExpListHomogeneous2D::v_DealiasedDotProd().

◆ DivideByQuadratureMetric()

void Nektar::MultiRegions::ExpList::DivideByQuadratureMetric ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

Divided by the metric jacobi and quadrature weights.

Divided by the metric jacobi and quadrature weights

Definition at line 1942 of file ExpList.cpp.

1945{
1946 Array<OneD, NekDouble> e_outarray;
1947
1948 for (int i = 0; i < (*m_exp).size(); ++i)
1949 {
1950 (*m_exp)[i]->DivideByQuadratureMetric(inarray + m_phys_offset[i],
1951 e_outarray =
1952 outarray + m_phys_offset[i]);
1953 }
1954}

References m_phys_offset.

◆ EvalBasisNumModesMax()

int Nektar::MultiRegions::ExpList::EvalBasisNumModesMax ( void  ) const
inline

Evaulates the maximum number of modes in the elemental basis order over all elements.

Evaulates the maximum number of modes in the elemental basis order over all elements

Definition at line 1526 of file ExpList.h.

1527{
1528 int returnval = 0;
1529
1530 for (size_t i = 0; i < (*m_exp).size(); ++i)
1531 {
1532 returnval = (std::max)(returnval, (*m_exp)[i]->EvalBasisNumModesMax());
1533 }
1534
1535 return returnval;
1536}

References m_exp.

◆ EvalBasisNumModesMaxPerExp()

const Array< OneD, int > Nektar::MultiRegions::ExpList::EvalBasisNumModesMaxPerExp ( void  ) const
inline

Returns the vector of the number of modes in the elemental basis order over all elements.

Definition at line 1541 of file ExpList.h.

1542{
1543 Array<OneD, int> returnval((*m_exp).size(), 0);
1544
1545 for (size_t i = 0; i < (*m_exp).size(); ++i)
1546 {
1547 returnval[i] =
1548 (std::max)(returnval[i], (*m_exp)[i]->EvalBasisNumModesMax());
1549 }
1550
1551 return returnval;
1552}

References m_exp.

◆ EvaluateBoundaryConditions()

void Nektar::MultiRegions::ExpList::EvaluateBoundaryConditions ( const NekDouble  time = 0.0,
const std::string  varName = "",
const NekDouble  x2_in = NekConstants::kNekUnsetDouble,
const NekDouble  x3_in = NekConstants::kNekUnsetDouble 
)
inline

Definition at line 2250 of file ExpList.h.

2254{
2255 v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2256}
virtual void v_EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
Definition: ExpList.cpp:5722

References v_EvaluateBoundaryConditions().

Referenced by Nektar::MultiRegions::DisContField::DisContField(), and Nektar::MultiRegions::DisContField3DHomogeneous2D::v_EvaluateBoundaryConditions().

◆ ExponentialFilter()

void Nektar::MultiRegions::ExpList::ExponentialFilter ( Array< OneD, NekDouble > &  array,
const NekDouble  alpha,
const NekDouble  exponent,
const NekDouble  cutoff 
)

Definition at line 2387 of file ExpList.cpp.

2390{
2391 Array<OneD, NekDouble> e_array;
2392
2393 for (int i = 0; i < (*m_exp).size(); ++i)
2394 {
2395 (*m_exp)[i]->ExponentialFilter(e_array = array + m_phys_offset[i],
2396 alpha, exponent, cutoff);
2397 }
2398}

References m_phys_offset.

◆ ExtractCoeffsFromFile()

void Nektar::MultiRegions::ExpList::ExtractCoeffsFromFile ( const std::string &  fileName,
LibUtilities::CommSharedPtr  comm,
const std::string &  varName,
Array< OneD, NekDouble > &  coeffs 
)

Definition at line 4005 of file ExpList.cpp.

4009{
4010 string varString = fileName.substr(0, fileName.find_last_of("."));
4011 int j, k, len = varString.length();
4012 varString = varString.substr(len - 1, len);
4013
4014 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
4015 std::vector<std::vector<NekDouble>> FieldData;
4016
4017 std::string ft = LibUtilities::FieldIO::GetFileType(fileName, comm);
4020 ft, comm, m_session->GetSharedFilesystem());
4021
4022 f->Import(fileName, FieldDef, FieldData);
4023
4024 bool found = false;
4025 for (j = 0; j < FieldDef.size(); ++j)
4026 {
4027 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
4028 {
4029 if (FieldDef[j]->m_fields[k] == varName)
4030 {
4031 // Copy FieldData into locExpList
4032 ExtractDataToCoeffs(FieldDef[j], FieldData[j],
4033 FieldDef[j]->m_fields[k], coeffs);
4034 found = true;
4035 }
4036 }
4037 }
4038
4039 ASSERTL0(found, "Could not find variable '" + varName +
4040 "' in file boundary condition " + fileName);
4041}
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
Definition: FieldIO.cpp:95
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane=std::unordered_map< int, int >())
Extract the data in fielddata into the coeffs.
Definition: ExpList.cpp:4237
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:322
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
Definition: FieldIO.cpp:70

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), ExtractDataToCoeffs(), Nektar::LibUtilities::GetFieldIOFactory(), Nektar::LibUtilities::FieldIO::GetFileType(), and m_session.

◆ ExtractCoeffsToCoeffs()

void Nektar::MultiRegions::ExpList::ExtractCoeffsToCoeffs ( const std::shared_ptr< ExpList > &  fromExpList,
const Array< OneD, const NekDouble > &  fromCoeffs,
Array< OneD, NekDouble > &  toCoeffs 
)

Extract the data from fromField using fromExpList the coeffs using the basic ExpList Elemental expansions rather than planes in homogeneous case.

Definition at line 4245 of file ExpList.cpp.

4249{
4250 v_ExtractCoeffsToCoeffs(fromExpList, fromCoeffs, toCoeffs);
4251}
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:4349

References v_ExtractCoeffsToCoeffs().

◆ ExtractDataToCoeffs()

void Nektar::MultiRegions::ExpList::ExtractDataToCoeffs ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata,
std::string &  field,
Array< OneD, NekDouble > &  coeffs,
std::unordered_map< int, int >  zIdToPlane = std::unordered_map<int, int>() 
)

Extract the data in fielddata into the coeffs.

Definition at line 4237 of file ExpList.cpp.

4241{
4242 v_ExtractDataToCoeffs(fielddef, fielddata, field, coeffs, zIdToPlane);
4243}
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane)
Extract data from raw field data into expansion list.
Definition: ExpList.cpp:4261

References FilterPython_Function::field, and v_ExtractDataToCoeffs().

Referenced by ExtractCoeffsFromFile().

◆ ExtractElmtDataToCoeffs()

void Nektar::MultiRegions::ExpList::ExtractElmtDataToCoeffs ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata,
std::string &  field,
Array< OneD, NekDouble > &  coeffs 
)

Extract the data in fielddata into the coeffs using the basic ExpList Elemental expansions rather than planes in homogeneous case.

◆ ExtractElmtToBndPhys()

void Nektar::MultiRegions::ExpList::ExtractElmtToBndPhys ( int  i,
const Array< OneD, NekDouble > &  elmt,
Array< OneD, NekDouble > &  boundary 
)
inline

Definition at line 2273 of file ExpList.h.

2276{
2277 v_ExtractElmtToBndPhys(i, elmt, boundary);
2278}
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:5519

References v_ExtractElmtToBndPhys().

◆ ExtractFileBCs()

void Nektar::MultiRegions::ExpList::ExtractFileBCs ( const std::string &  fileName,
LibUtilities::CommSharedPtr  comm,
const std::string &  varName,
const std::shared_ptr< ExpList locExpList 
)
protected

◆ ExtractPhysToBnd()

void Nektar::MultiRegions::ExpList::ExtractPhysToBnd ( int  i,
const Array< OneD, const NekDouble > &  phys,
Array< OneD, NekDouble > &  bnd 
)
inline

Definition at line 2287 of file ExpList.h.

2290{
2291 v_ExtractPhysToBnd(i, phys, bnd);
2292}
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.cpp:5596

References v_ExtractPhysToBnd().

◆ ExtractPhysToBndElmt()

void Nektar::MultiRegions::ExpList::ExtractPhysToBndElmt ( int  i,
const Array< OneD, const NekDouble > &  phys,
Array< OneD, NekDouble > &  bndElmt 
)
inline

Definition at line 2280 of file ExpList.h.

2283{
2284 v_ExtractPhysToBndElmt(i, phys, bndElmt);
2285}
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:5557

References v_ExtractPhysToBndElmt().

◆ ExtractTracePhys() [1/2]

void Nektar::MultiRegions::ExpList::ExtractTracePhys ( Array< OneD, NekDouble > &  outarray)
inline

Definition at line 2230 of file ExpList.h.

2231{
2232 v_ExtractTracePhys(outarray);
2233}
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5157

References v_ExtractTracePhys().

◆ ExtractTracePhys() [2/2]

void Nektar::MultiRegions::ExpList::ExtractTracePhys ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 2234 of file ExpList.h.

2237{
2238 v_ExtractTracePhys(inarray, outarray);
2239}

References v_ExtractTracePhys().

◆ FillBndCondFromField() [1/2]

void Nektar::MultiRegions::ExpList::FillBndCondFromField ( const Array< OneD, NekDouble coeffs)
inline

Fill Bnd Condition expansion from the values stored in expansion.

Definition at line 1952 of file ExpList.h.

1953{
1954 v_FillBndCondFromField(coeffs);
1955}
virtual void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
Definition: ExpList.cpp:5329

References v_FillBndCondFromField().

◆ FillBndCondFromField() [2/2]

void Nektar::MultiRegions::ExpList::FillBndCondFromField ( const int  nreg,
const Array< OneD, NekDouble coeffs 
)
inline

Fill Bnd Condition expansion in nreg from the values stored in expansion.

Definition at line 1956 of file ExpList.h.

1958{
1959 v_FillBndCondFromField(nreg, coeffs);
1960}

References v_FillBndCondFromField().

◆ FillBwdWithBoundCond()

void Nektar::MultiRegions::ExpList::FillBwdWithBoundCond ( const Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd,
bool  PutFwdInBwdOnBCs = false 
)
inline

Definition at line 2197 of file ExpList.h.

2200{
2201 v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2202}
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
Definition: ExpList.cpp:5097

References v_FillBwdWithBoundCond().

◆ FillBwdWithBwdWeight()

void Nektar::MultiRegions::ExpList::FillBwdWithBwdWeight ( Array< OneD, NekDouble > &  weightave,
Array< OneD, NekDouble > &  weightjmp 
)
inline

Fill Bwd with boundary conditions.

Definition at line 2216 of file ExpList.h.

2218{
2219 v_FillBwdWithBwdWeight(weightave, weightjmp);
2220}
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Definition: ExpList.cpp:5684

References v_FillBwdWithBwdWeight().

Referenced by GetBwdWeight().

◆ FwdTrans()

void Nektar::MultiRegions::ExpList::FwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1679 of file ExpList.h.

1681{
1682 v_FwdTrans(inarray, outarray);
1683}
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5375

References v_FwdTrans().

◆ FwdTransBndConstrained()

void Nektar::MultiRegions::ExpList::FwdTransBndConstrained ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1696 of file ExpList.h.

1699{
1700 v_FwdTransBndConstrained(inarray, outarray);
1701}
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2455

References v_FwdTransBndConstrained().

◆ FwdTransLocalElmt()

void Nektar::MultiRegions::ExpList::FwdTransLocalElmt ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function elementally evaluates the forward transformation of a function \(u(\boldsymbol{x})\) onto the global spectral/hp expansion.

Definition at line 1687 of file ExpList.h.

1690{
1691 v_FwdTransLocalElmt(inarray, outarray);
1692}
virtual void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2446

References v_FwdTransLocalElmt().

◆ GenBlockMatrix()

const DNekScalBlkMatSharedPtr Nektar::MultiRegions::ExpList::GenBlockMatrix ( const GlobalMatrixKey gkey)
protected

This function assembles the block diagonal matrix of local matrices of the type mtype.

This function assembles the block diagonal matrix \(\underline{\boldsymbol{M}}^e\), which is the concatenation of the local matrices \(\boldsymbol{M}^e\) of the type mtype, that is

\[ \underline{\boldsymbol{M}}^e = \left[ \begin{array}{cccc} \boldsymbol{M}^1 & 0 & \hspace{3mm}0 \hspace{3mm}& 0 \\ 0 & \boldsymbol{M}^2 & 0 & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & 0 & \boldsymbol{M}^{N_{\mathrm{el}}} \end{array}\right].\]

Parameters
mtypethe type of matrix to be assembled
scalaran optional parameter
constantan optional parameter

Definition at line 2517 of file ExpList.cpp.

2519{
2520 int i, cnt1;
2521 int n_exp = 0;
2522 DNekScalMatSharedPtr loc_mat;
2523 DNekScalBlkMatSharedPtr BlkMatrix;
2524 map<int, int> elmt_id;
2525 LibUtilities::ShapeType ShapeType = gkey.GetShapeType();
2526
2528 {
2529 for (i = 0; i < (*m_exp).size(); ++i)
2530 {
2531 if ((*m_exp)[i]->DetShapeType() == ShapeType)
2532 {
2533 elmt_id[n_exp++] = i;
2534 }
2535 }
2536 }
2537 else
2538 {
2539 n_exp = (*m_exp).size();
2540 for (i = 0; i < n_exp; ++i)
2541 {
2542 elmt_id[i] = i;
2543 }
2544 }
2545
2546 Array<OneD, unsigned int> nrows(n_exp);
2547 Array<OneD, unsigned int> ncols(n_exp);
2548
2549 switch (gkey.GetMatrixType())
2550 {
2552 {
2553 // set up an array of integers for block matrix construction
2554 for (i = 0; i < n_exp; ++i)
2555 {
2556 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2557 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2558 }
2559 }
2560 break;
2562 {
2563 // set up an array of integers for block matrix construction
2564 for (i = 0; i < n_exp; ++i)
2565 {
2566 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2567 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2568 }
2569 }
2570 break;
2571 case StdRegions::eMass:
2576 {
2577 // set up an array of integers for block matrix construction
2578 for (i = 0; i < n_exp; ++i)
2579 {
2580 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2581 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2582 }
2583 }
2584 break;
2585
2587 {
2588 // set up an array of integers for block matrix construction
2589 for (i = 0; i < n_exp; ++i)
2590 {
2591 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2592 ncols[i] =
2593 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2594 }
2595 }
2596 break;
2598 {
2599 // set up an array of integers for block matrix construction
2600 for (i = 0; i < n_exp; ++i)
2601 {
2602 nrows[i] =
2603 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2604 ncols[i] =
2605 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2606 }
2607 }
2608 break;
2609 default:
2610 {
2612 "Global Matrix creation not defined for this "
2613 "type of matrix");
2614 }
2615 }
2616
2617 MatrixStorage blkmatStorage = eDIAGONAL;
2618 BlkMatrix = MemoryManager<DNekScalBlkMat>::AllocateSharedPtr(nrows, ncols,
2619 blkmatStorage);
2620
2621 int nvarcoeffs = gkey.GetNVarCoeffs();
2622 int eid;
2623 Array<OneD, NekDouble> varcoeffs_wk;
2624
2625 for (i = cnt1 = 0; i < n_exp; ++i)
2626 {
2627 // need to be initialised with zero size for non
2628 // variable coefficient case
2629 StdRegions::VarCoeffMap varcoeffs;
2630
2631 eid = elmt_id[i];
2632 if (nvarcoeffs > 0)
2633 {
2634 varcoeffs = StdRegions::RestrictCoeffMap(
2635 gkey.GetVarCoeffs(), m_phys_offset[i],
2636 (*m_exp)[i]->GetTotPoints());
2637 }
2638
2639 LocalRegions::MatrixKey matkey(
2640 gkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(), *(*m_exp)[eid],
2641 gkey.GetConstFactors(), varcoeffs);
2642
2643 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>(
2644 (*m_exp)[elmt_id.find(i)->second])
2645 ->GetLocMatrix(matkey);
2646 BlkMatrix->SetBlock(i, i, loc_mat);
2647 }
2648
2649 return BlkMatrix;
2650}
VarCoeffMap RestrictCoeffMap(const VarCoeffMap &m, size_t offset, size_t cnt)
Definition: StdRegions.hpp:378
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:375
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBwdTrans, Nektar::eDIAGONAL, Nektar::ErrorUtil::efatal, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eIProductWRTBase, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eMass, Nektar::LibUtilities::eNoShapeType, Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), Nektar::MultiRegions::GlobalMatrixKey::GetShapeType(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_exp, m_phys_offset, NEKERROR, and Nektar::StdRegions::RestrictCoeffMap().

Referenced by GetBlockMatrix().

◆ GeneralGetFieldDefinitions()

void Nektar::MultiRegions::ExpList::GeneralGetFieldDefinitions ( std::vector< LibUtilities::FieldDefinitionsSharedPtr > &  fielddef,
int  NumHomoDir = 0,
Array< OneD, LibUtilities::BasisSharedPtr > &  HomoBasis = LibUtilities::NullBasisSharedPtr1DArray,
std::vector< NekDouble > &  HomoLen = LibUtilities::NullNekDoubleVector,
bool  homoStrips = false,
std::vector< unsigned int > &  HomoSIDs = LibUtilities::NullUnsignedIntVector,
std::vector< unsigned int > &  HomoZIDs = LibUtilities::NullUnsignedIntVector,
std::vector< unsigned int > &  HomoYIDs = LibUtilities::NullUnsignedIntVector 
)

Definition at line 4078 of file ExpList.cpp.

4084{
4085 int startenum = (int)LibUtilities::eSegment;
4086 int endenum = (int)LibUtilities::eHexahedron;
4087 int s = 0;
4089
4090 ASSERTL1(NumHomoDir == HomoBasis.size(),
4091 "Homogeneous basis is not the same length as NumHomoDir");
4092 ASSERTL1(NumHomoDir == HomoLen.size(),
4093 "Homogeneous length vector is not the same length as NumHomDir");
4094
4095 // count number of shapes
4096 switch ((*m_exp)[0]->GetShapeDimension())
4097 {
4098 case 1:
4099 startenum = (int)LibUtilities::eSegment;
4100 endenum = (int)LibUtilities::eSegment;
4101 break;
4102 case 2:
4103 startenum = (int)LibUtilities::eTriangle;
4104 endenum = (int)LibUtilities::eQuadrilateral;
4105 break;
4106 case 3:
4107 startenum = (int)LibUtilities::eTetrahedron;
4108 endenum = (int)LibUtilities::eHexahedron;
4109 break;
4110 }
4111
4112 for (s = startenum; s <= endenum; ++s)
4113 {
4114 std::vector<unsigned int> elementIDs;
4115 std::vector<LibUtilities::BasisType> basis;
4116 std::vector<unsigned int> numModes;
4117 std::vector<std::string> fields;
4118
4119 bool first = true;
4120 bool UniOrder = true;
4121 int n;
4122
4123 shape = (LibUtilities::ShapeType)s;
4124
4125 for (int i = 0; i < (*m_exp).size(); ++i)
4126 {
4127 if ((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
4128 {
4129 elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
4130 if (first)
4131 {
4132 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
4133 {
4134 basis.push_back(
4135 (*m_exp)[i]->GetBasis(j)->GetBasisType());
4136 numModes.push_back(
4137 (*m_exp)[i]->GetBasis(j)->GetNumModes());
4138 }
4139
4140 // add homogeneous direction details if defined
4141 for (n = 0; n < NumHomoDir; ++n)
4142 {
4143 basis.push_back(HomoBasis[n]->GetBasisType());
4144 numModes.push_back(HomoBasis[n]->GetNumModes());
4145 }
4146
4147 first = false;
4148 }
4149 else
4150 {
4151 ASSERTL0(
4152 (*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
4153 "Routine is not set up for multiple bases definitions");
4154
4155 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
4156 {
4157 numModes.push_back(
4158 (*m_exp)[i]->GetBasis(j)->GetNumModes());
4159 if (numModes[j] !=
4160 (*m_exp)[i]->GetBasis(j)->GetNumModes())
4161 {
4162 UniOrder = false;
4163 }
4164 }
4165 // add homogeneous direction details if defined
4166 for (n = 0; n < NumHomoDir; ++n)
4167 {
4168 numModes.push_back(HomoBasis[n]->GetNumModes());
4169 }
4170 }
4171 }
4172 }
4173
4174 if (elementIDs.size() > 0)
4175 {
4178 AllocateSharedPtr(shape, elementIDs, basis, UniOrder,
4179 numModes, fields, NumHomoDir, HomoLen,
4180 homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
4181 fielddef.push_back(fdef);
4182 }
4183 }
4184}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:184

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, GetShapeDimension(), and m_exp.

Referenced by v_GetFieldDefinitions().

◆ GeneralMatrixOp()

void Nektar::MultiRegions::ExpList::GeneralMatrixOp ( const GlobalMatrixKey gkey,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

This function calculates the result of the multiplication of a matrix of type specified by mkey with a vector given by inarray.

This operation is equivalent to the evaluation of \(\underline{\boldsymbol{M}}^e\boldsymbol{\hat{u}}_l\), that is,

\[ \left[ \begin{array}{cccc} \boldsymbol{M}^1 & 0 & \hspace{3mm}0 \hspace{3mm}& 0 \\ 0 & \boldsymbol{M}^2 & 0 & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & 0 & \boldsymbol{M}^{N_{\mathrm{el}}} \end{array} \right] *\left [ \begin{array}{c} \boldsymbol{\hat{u}}^{1} \\ \boldsymbol{\hat{u}}^{2} \\ \vdots \\ \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ]\]

where \(\boldsymbol{M}^e\) are the local matrices of type specified by the key mkey. The decoupling of the local matrices allows for a local evaluation of the operation. However, rather than a local matrix-vector multiplication, the local operations are evaluated as implemented in the function StdRegions::StdExpansion::GeneralMatrixOp.

Parameters
mkeyThis key uniquely defines the type matrix required for the operation.
inarrayThe vector \(\boldsymbol{\hat{u}}_l\) of size \(N_{\mathrm{eof}}\).
outarrayThe resulting vector of size \(N_{\mathrm{eof}}\).

Definition at line 2696 of file ExpList.cpp.

2699{
2700 int nvarcoeffs = gkey.GetNVarCoeffs();
2701
2702 if (gkey.GetMatrixType() == StdRegions::eHelmholtz ||
2703 gkey.GetMatrixType() == StdRegions::eLinearAdvectionDiffusionReaction)
2704 {
2705 // Map operator type based on matrix type
2707 (gkey.GetMatrixType() == StdRegions::eHelmholtz)
2710
2711 // initialise if required
2712 if (m_collections.size() && m_collectionsDoInit[opType])
2713 {
2714 for (int i = 0; i < m_collections.size(); ++i)
2715 {
2716 m_collections[i].Initialise(opType, gkey.GetConstFactors());
2717 }
2718 m_collectionsDoInit[opType] = false;
2719 }
2720
2721 // Update factors and varoeffs
2722 int cnt{0};
2723 for (int i = 0; i < m_collections.size(); ++i)
2724 {
2725 m_collections[i].UpdateFactors(opType, gkey.GetConstFactors());
2726
2727 // Restrict varcoeffs to collection size and update
2728 StdRegions::VarCoeffMap varcoeffs;
2729 if (nvarcoeffs)
2730 {
2731 varcoeffs = StdRegions::RestrictCoeffMap(
2732 gkey.GetVarCoeffs(), m_phys_offset[cnt],
2733 m_collections[i].GetInputSize(opType, false));
2734 cnt += m_collections[i].GetNumElmt(opType);
2735 }
2736 m_collections[i].UpdateVarcoeffs(opType, varcoeffs);
2737 }
2738
2739 Array<OneD, NekDouble> tmp;
2740 int input_offset{0};
2741 int output_offset{0};
2742 for (int i = 0; i < m_collections.size(); ++i)
2743 {
2744 // the input_offset is equal to the output_offset - this is
2745 // happenning inside the Helmholtz_Helper or LinearADR_Helper class
2746 m_collections[i].ApplyOperator(opType, inarray + input_offset,
2747 tmp = outarray + output_offset);
2748 input_offset += m_collections[i].GetInputSize(opType);
2749 output_offset += m_collections[i].GetOutputSize(opType);
2750 }
2751 }
2752 else
2753 {
2754 Array<OneD, NekDouble> tmp_outarray;
2755 for (int i = 0; i < (*m_exp).size(); ++i)
2756 {
2757 // need to be initialised with zero size for non
2758 // variable coefficient case
2759 StdRegions::VarCoeffMap varcoeffs;
2760
2761 if (nvarcoeffs > 0)
2762 {
2763 varcoeffs = StdRegions::RestrictCoeffMap(
2764 gkey.GetVarCoeffs(), m_phys_offset[i],
2765 (*m_exp)[i]->GetTotPoints());
2766 }
2767
2768 StdRegions::StdMatrixKey mkey(
2769 gkey.GetMatrixType(), (*m_exp)[i]->DetShapeType(),
2770 *((*m_exp)[i]), gkey.GetConstFactors(), varcoeffs);
2771
2772 (*m_exp)[i]->GeneralMatrixOp(
2773 inarray + m_coeff_offset[i],
2774 tmp_outarray = outarray + m_coeff_offset[i], mkey);
2775 }
2776 }
2777}
@ eLinearAdvectionDiffusionReaction
Definition: Operator.h:66

References Nektar::Collections::eHelmholtz, Nektar::StdRegions::eHelmholtz, Nektar::Collections::eLinearAdvectionDiffusionReaction, Nektar::StdRegions::eLinearAdvectionDiffusionReaction, Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_coeff_offset, m_collections, m_collectionsDoInit, m_exp, m_phys_offset, and Nektar::StdRegions::RestrictCoeffMap().

◆ GenerateElementVector()

void Nektar::MultiRegions::ExpList::GenerateElementVector ( const int  ElementID,
const NekDouble  scalar1,
const NekDouble  scalar2,
Array< OneD, NekDouble > &  outarray 
)

Generate vector v such that v[i] = scalar1 if i is in the element < ElementID. Otherwise, v[i] = scalar2.

Definition at line 4443 of file ExpList.cpp.

4447{
4448 int npoints_e;
4449 NekDouble coeff;
4450
4451 Array<OneD, NekDouble> outarray_e;
4452
4453 for (int i = 0; i < (*m_exp).size(); ++i)
4454 {
4455 npoints_e = (*m_exp)[i]->GetTotPoints();
4456
4457 if (i <= ElementID)
4458 {
4459 coeff = scalar1;
4460 }
4461 else
4462 {
4463 coeff = scalar2;
4464 }
4465
4466 outarray_e = Array<OneD, NekDouble>(npoints_e, coeff);
4467 Vmath::Vcopy(npoints_e, &outarray_e[0], 1, &outarray[m_phys_offset[i]],
4468 1);
4469 }
4470}

References m_phys_offset, and Vmath::Vcopy().

◆ GenGlobalBndLinSys()

GlobalLinSysSharedPtr Nektar::MultiRegions::ExpList::GenGlobalBndLinSys ( const GlobalLinSysKey mkey,
const AssemblyMapSharedPtr locToGloMap 
)
protected

Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocToGloBaseMap.

Definition at line 3089 of file ExpList.cpp.

3091{
3092 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
3093 const map<int, RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
3094
3095 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
3096
3097 if (vType >= eSIZE_GlobalSysSolnType)
3098 {
3099 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
3100 }
3101 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
3102
3103 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
3104 locToGloMap);
3105}
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:956
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:885
const char *const GlobalSysSolnTypeMap[]
GlobalLinSysFactory & GetGlobalLinSysFactory()

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::ErrorUtil::efatal, Nektar::MultiRegions::eSIZE_GlobalSysSolnType, Nektar::MultiRegions::GetGlobalLinSysFactory(), Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), GetRobinBCInfo(), GetSharedThisPtr(), Nektar::MultiRegions::GlobalSysSolnTypeMap, and NEKERROR.

Referenced by Nektar::MultiRegions::DisContField::GetGlobalBndLinSys().

◆ GenGlobalLinSys()

GlobalLinSysSharedPtr Nektar::MultiRegions::ExpList::GenGlobalLinSys ( const GlobalLinSysKey mkey,
const std::shared_ptr< AssemblyMapCG > &  locToGloMap 
)
protected

This operation constructs the global linear system of type mkey.

Consider a linear system \(\boldsymbol{M\hat{u}}_g=\boldsymbol{f}\) to be solved. Dependent on the solution method, this function constructs

  • The full linear system
    A call to the function #GenGlobalLinSysFullDirect
  • The statically condensed linear system
    A call to the function #GenGlobalLinSysStaticCond
Parameters
mkeyA key which uniquely defines the global matrix to be constructed.
locToGloMapContains the mapping array and required information for the transformation from local to global degrees of freedom.
Returns
(A shared pointer to) the global linear system in required format.

Definition at line 3071 of file ExpList.cpp.

3073{
3074 GlobalLinSysSharedPtr returnlinsys;
3075 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
3076
3077 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
3078
3079 if (vType >= eSIZE_GlobalSysSolnType)
3080 {
3081 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
3082 }
3083 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
3084
3085 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
3086 locToGloMap);
3087}
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:51

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::ErrorUtil::efatal, Nektar::MultiRegions::eSIZE_GlobalSysSolnType, Nektar::MultiRegions::GetGlobalLinSysFactory(), Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), GetSharedThisPtr(), Nektar::MultiRegions::GlobalSysSolnTypeMap, and NEKERROR.

Referenced by Nektar::MultiRegions::ContField::GenGlobalLinSys().

◆ GenGlobalMatrix()

GlobalMatrixSharedPtr Nektar::MultiRegions::ExpList::GenGlobalMatrix ( const GlobalMatrixKey mkey,
const std::shared_ptr< AssemblyMapCG > &  locToGloMap 
)
protected

Generates a global matrix from the given key and map.

Retrieves local matrices from each expansion in the expansion list and combines them together to generate a global matrix system.

Parameters
mkeyMatrix key for the matrix to be generated.
locToGloMapLocal to global mapping.
Returns
Shared pointer to the generated global matrix.

Definition at line 2786 of file ExpList.cpp.

2788{
2789 int i, j, n, gid1, gid2, cntdim1, cntdim2;
2790 NekDouble sign1, sign2;
2791 DNekScalMatSharedPtr loc_mat;
2792
2793 unsigned int glob_rows = 0;
2794 unsigned int glob_cols = 0;
2795 unsigned int loc_rows = 0;
2796 unsigned int loc_cols = 0;
2797
2798 bool assembleFirstDim = false;
2799 bool assembleSecondDim = false;
2800
2801 switch (mkey.GetMatrixType())
2802 {
2804 {
2805 glob_rows = m_npoints;
2806 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2807
2808 assembleFirstDim = false;
2809 assembleSecondDim = true;
2810 }
2811 break;
2813 {
2814 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2815 glob_cols = m_npoints;
2816
2817 assembleFirstDim = true;
2818 assembleSecondDim = false;
2819 }
2820 break;
2821 case StdRegions::eMass:
2825 {
2826 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2827 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2828
2829 assembleFirstDim = true;
2830 assembleSecondDim = true;
2831 }
2832 break;
2833 default:
2834 {
2836 "Global Matrix creation not defined for this "
2837 "type of matrix");
2838 }
2839 }
2840
2841 COOMatType spcoomat;
2842 CoordType coord;
2843
2844 int nvarcoeffs = mkey.GetNVarCoeffs();
2845 int eid;
2846
2847 // fill global matrix
2848 for (n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2849 {
2850 // need to be initialised with zero size for non
2851 // variable coefficient case
2852 StdRegions::VarCoeffMap varcoeffs;
2853
2854 eid = n;
2855 if (nvarcoeffs > 0)
2856 {
2857 varcoeffs = StdRegions::RestrictCoeffMap(
2858 mkey.GetVarCoeffs(), m_phys_offset[eid],
2859 (*m_exp)[eid]->GetTotPoints());
2860 }
2861
2862 LocalRegions::MatrixKey matkey(
2863 mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2864 *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2865
2866 loc_mat =
2867 std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2868 ->GetLocMatrix(matkey);
2869
2870 loc_rows = loc_mat->GetRows();
2871 loc_cols = loc_mat->GetColumns();
2872
2873 for (i = 0; i < loc_rows; ++i)
2874 {
2875 if (assembleFirstDim)
2876 {
2877 gid1 = locToGloMap->GetLocalToGlobalMap(cntdim1 + i);
2878 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2879 }
2880 else
2881 {
2882 gid1 = cntdim1 + i;
2883 sign1 = 1.0;
2884 }
2885
2886 for (j = 0; j < loc_cols; ++j)
2887 {
2888 if (assembleSecondDim)
2889 {
2890 gid2 = locToGloMap->GetLocalToGlobalMap(cntdim2 + j);
2891 sign2 = locToGloMap->GetLocalToGlobalSign(cntdim2 + j);
2892 }
2893 else
2894 {
2895 gid2 = cntdim2 + j;
2896 sign2 = 1.0;
2897 }
2898
2899 // sparse matrix fill
2900 coord = make_pair(gid1, gid2);
2901 if (spcoomat.count(coord) == 0)
2902 {
2903 spcoomat[coord] = sign1 * sign2 * (*loc_mat)(i, j);
2904 }
2905 else
2906 {
2907 spcoomat[coord] += sign1 * sign2 * (*loc_mat)(i, j);
2908 }
2909 }
2910 }
2911 cntdim1 += loc_rows;
2912 cntdim2 += loc_cols;
2913 }
2914
2916 glob_cols, spcoomat);
2917}
std::pair< IndexType, IndexType > CoordType
std::map< CoordType, NekDouble > COOMatType

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBwdTrans, Nektar::ErrorUtil::efatal, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eIProductWRTBase, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eMass, Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_exp, m_npoints, m_phys_offset, m_session, NEKERROR, and Nektar::StdRegions::RestrictCoeffMap().

Referenced by Nektar::MultiRegions::ContField::GetGlobalMatrix().

◆ GenGlobalMatrixFull()

DNekMatSharedPtr Nektar::MultiRegions::ExpList::GenGlobalMatrixFull ( const GlobalLinSysKey mkey,
const std::shared_ptr< AssemblyMapCG > &  locToGloMap 
)
protected

Definition at line 2919 of file ExpList.cpp.

2921{
2922 int i, j, n, gid1, gid2, loc_lda, eid;
2923 NekDouble sign1, sign2, value;
2924 DNekScalMatSharedPtr loc_mat;
2925
2926 int totDofs = locToGloMap->GetNumGlobalCoeffs();
2927 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2928
2929 unsigned int rows = totDofs - NumDirBCs;
2930 unsigned int cols = totDofs - NumDirBCs;
2931 NekDouble zero = 0.0;
2932
2933 DNekMatSharedPtr Gmat;
2934 int bwidth = locToGloMap->GetFullSystemBandWidth();
2935
2936 int nvarcoeffs = mkey.GetNVarCoeffs();
2937 MatrixStorage matStorage;
2938
2939 map<int, RobinBCInfoSharedPtr> RobinBCInfo = GetRobinBCInfo();
2940
2941 switch (mkey.GetMatrixType())
2942 {
2943 // case for all symmetric matices
2946 if ((2 * (bwidth + 1)) < rows)
2947 {
2950 rows, cols, zero, matStorage, bwidth, bwidth);
2951 }
2952 else
2953 {
2954 matStorage = ePOSITIVE_DEFINITE_SYMMETRIC;
2956 rows, cols, zero, matStorage);
2957 }
2958
2959 break;
2960 default: // Assume general matrix - currently only set up
2961 // for full invert
2962 {
2963 matStorage = eFULL;
2965 rows, cols, zero, matStorage);
2966 }
2967 }
2968
2969 // fill global symmetric matrix
2970 for (n = 0; n < (*m_exp).size(); ++n)
2971 {
2972 // need to be initialised with zero size for non
2973 // variable coefficient case
2974 StdRegions::VarCoeffMap varcoeffs;
2975
2976 eid = n;
2977 if (nvarcoeffs > 0)
2978 {
2979 varcoeffs = StdRegions::RestrictCoeffMap(
2980 mkey.GetVarCoeffs(), m_phys_offset[eid],
2981 (*m_exp)[eid]->GetTotPoints());
2982 }
2983
2984 LocalRegions::MatrixKey matkey(
2985 mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2986 *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2987
2988 loc_mat =
2989 std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2990 ->GetLocMatrix(matkey);
2991
2992 if (RobinBCInfo.count(n) != 0) // add robin mass matrix
2993 {
2995
2996 // declare local matrix from scaled matrix.
2997 int rows = loc_mat->GetRows();
2998 int cols = loc_mat->GetColumns();
2999 const NekDouble *dat = loc_mat->GetRawPtr();
3000 DNekMatSharedPtr new_mat =
3002 Blas::Dscal(rows * cols, loc_mat->Scale(), new_mat->GetRawPtr(), 1);
3003
3004 // add local matrix contribution
3005 for (rBC = RobinBCInfo.find(n)->second; rBC; rBC = rBC->next)
3006 {
3007 (*m_exp)[n]->AddRobinMassMatrix(
3008 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, new_mat);
3009 }
3010
3011 NekDouble one = 1.0;
3012 // redeclare loc_mat to point to new_mat plus the scalar.
3013 loc_mat =
3015 }
3016
3017 loc_lda = loc_mat->GetColumns();
3018
3019 for (i = 0; i < loc_lda; ++i)
3020 {
3021 gid1 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + i) -
3022 NumDirBCs;
3023 sign1 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + i);
3024 if (gid1 >= 0)
3025 {
3026 for (j = 0; j < loc_lda; ++j)
3027 {
3028 gid2 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] +
3029 j) -
3030 NumDirBCs;
3031 sign2 = locToGloMap->GetLocalToGlobalSign(
3032 m_coeff_offset[n] + j);
3033 if (gid2 >= 0)
3034 {
3035 // When global matrix is symmetric,
3036 // only add the value for the upper
3037 // triangular part in order to avoid
3038 // entries to be entered twice
3039 if ((matStorage == eFULL) || (gid2 >= gid1))
3040 {
3041 value = Gmat->GetValue(gid1, gid2) +
3042 sign1 * sign2 * (*loc_mat)(i, j);
3043 Gmat->SetValue(gid1, gid2, value);
3044 }
3045 }
3046 }
3047 }
3048 }
3049 }
3050
3051 return Gmat;
3052}
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:149
std::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Blas::Dscal(), Nektar::eFULL, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eLaplacian, Nektar::ePOSITIVE_DEFINITE_SYMMETRIC, Nektar::ePOSITIVE_DEFINITE_SYMMETRIC_BANDED, Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), GetRobinBCInfo(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_coeff_offset, m_exp, m_phys_offset, Nektar::MultiRegions::RobinBCInfo::next, and Nektar::StdRegions::RestrictCoeffMap().

Referenced by Nektar::MultiRegions::ContField::LinearAdvectionEigs().

◆ Get1DScaledTotPoints()

int Nektar::MultiRegions::ExpList::Get1DScaledTotPoints ( const NekDouble  scale) const
inline

Returns the total number of qudature points scaled by the factor scale on each 1D direction.

Definition at line 1567 of file ExpList.h.

1568{
1569 int returnval = 0;
1570 size_t cnt;
1571 size_t nbase = (*m_exp)[0]->GetNumBases();
1572
1573 for (size_t i = 0; i < (*m_exp).size(); ++i)
1574 {
1575 cnt = 1;
1576 for (size_t j = 0; j < nbase; ++j)
1577 {
1578 cnt *= scale * ((*m_exp)[i]->GetNumPoints(j));
1579 }
1580 returnval += cnt;
1581 }
1582 return returnval;
1583}

◆ GetBCValues()

void Nektar::MultiRegions::ExpList::GetBCValues ( Array< OneD, NekDouble > &  BndVals,
const Array< OneD, NekDouble > &  TotField,
int  BndID 
)
inline

Definition at line 1878 of file ExpList.h.

1881{
1882 v_GetBCValues(BndVals, TotField, BndID);
1883}
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:5258

References v_GetBCValues().

◆ GetBlockMatrix()

const DNekScalBlkMatSharedPtr & Nektar::MultiRegions::ExpList::GetBlockMatrix ( const GlobalMatrixKey gkey)
protected

Definition at line 2652 of file ExpList.cpp.

2654{
2655 auto matrixIter = m_blockMat->find(gkey);
2656
2657 if (matrixIter == m_blockMat->end())
2658 {
2659 return ((*m_blockMat)[gkey] = GenBlockMatrix(gkey));
2660 }
2661 else
2662 {
2663 return matrixIter->second;
2664 }
2665}
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:2517

References GenBlockMatrix(), and m_blockMat.

Referenced by MultiplyByBlockMatrix(), MultiplyByElmtInvMass(), and Nektar::MultiRegions::DisContField::v_HelmSolve().

◆ GetBndCondBwdWeight()

const Array< OneD, const NekDouble > & Nektar::MultiRegions::ExpList::GetBndCondBwdWeight ( )
inline

Get the weight value for boundary conditions.

Definition at line 2127 of file ExpList.h.

2128{
2129 return v_GetBndCondBwdWeight();
2130}
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
Definition: ExpList.cpp:5134

References v_GetBndCondBwdWeight().

◆ GetBndCondExpansions()

const Array< OneD, const std::shared_ptr< ExpList > > & Nektar::MultiRegions::ExpList::GetBndCondExpansions ( )
inline

Definition at line 2111 of file ExpList.h.

2113{
2114 return v_GetBndCondExpansions();
2115}
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:4473

References v_GetBndCondExpansions().

Referenced by v_ExtractElmtToBndPhys(), v_ExtractPhysToBnd(), v_ExtractPhysToBndElmt(), v_GetBoundaryNormals(), and Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals().

◆ GetBndConditions()

const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::GetBndConditions ( )
inline

Definition at line 2240 of file ExpList.h.

2242{
2243 return v_GetBndConditions();
2244}
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:5701

References v_GetBndConditions().

◆ GetBndElmtExpansion()

void Nektar::MultiRegions::ExpList::GetBndElmtExpansion ( int  i,
std::shared_ptr< ExpList > &  result,
const bool  DeclareCoeffPhysArrays = true 
)
inlinevirtual

Definition at line 2266 of file ExpList.h.

2269{
2270 v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2271}
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
Definition: ExpList.cpp:5509

References v_GetBndElmtExpansion().

◆ GetBoundaryCondition()

SpatialDomains::BoundaryConditionShPtr Nektar::MultiRegions::ExpList::GetBoundaryCondition ( const SpatialDomains::BoundaryConditionCollection collection,
unsigned int  index,
const std::string &  variable 
)
staticprotected

Definition at line 5752 of file ExpList.cpp.

5755{
5756 auto collectionIter = collection.find(regionId);
5757 ASSERTL1(collectionIter != collection.end(),
5758 "Unable to locate collection " +
5759 boost::lexical_cast<string>(regionId));
5760
5762 (*collectionIter).second;
5763 auto conditionMapIter = bndCondMap->find(variable);
5764 ASSERTL1(conditionMapIter != bndCondMap->end(),
5765 "Unable to locate condition map.");
5766
5767 const SpatialDomains::BoundaryConditionShPtr boundaryCondition =
5768 (*conditionMapIter).second;
5769
5770 return boundaryCondition;
5771}
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:212
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
Definition: Conditions.h:218

References ASSERTL1.

Referenced by Nektar::MultiRegions::DisContField::FindPeriodicTraces(), Nektar::MultiRegions::DisContField::GenerateBoundaryConditionExpansion(), and Nektar::MultiRegions::DisContField3DHomogeneous1D::SetupBoundaryConditions().

◆ GetBoundaryNormals()

void Nektar::MultiRegions::ExpList::GetBoundaryNormals ( int  i,
Array< OneD, Array< OneD, NekDouble > > &  normals 
)
inline

Definition at line 2294 of file ExpList.h.

2296{
2297 v_GetBoundaryNormals(i, normals);
2298}
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:5633

References v_GetBoundaryNormals().

◆ GetBoundaryToElmtMap()

void Nektar::MultiRegions::ExpList::GetBoundaryToElmtMap ( Array< OneD, int > &  ElmtID,
Array< OneD, int > &  EdgeID 
)
inline

◆ GetBwdWeight()

void Nektar::MultiRegions::ExpList::GetBwdWeight ( Array< OneD, NekDouble > &  weightAver,
Array< OneD, NekDouble > &  weightJump 
)

Get the weight value for boundary conditions for boundary average and jump calculations.

Get the weight value on boundaries

Definition at line 4386 of file ExpList.cpp.

4388{
4389 size_t nTracePts = weightAver.size();
4390 // average for interior traces
4391 for (int i = 0; i < nTracePts; ++i)
4392 {
4393 weightAver[i] = 0.5;
4394 weightJump[i] = 1.0;
4395 }
4396 FillBwdWithBwdWeight(weightAver, weightJump);
4397}
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition: ExpList.h:2216

References FillBwdWithBwdWeight().

◆ GetCoeff()

NekDouble Nektar::MultiRegions::ExpList::GetCoeff ( int  i)
inline

Get the i th value (coefficient) of m_coeffs.

Parameters
iThe index of m_coeffs to be returned
Returns
The NekDouble held in m_coeffs[i].

Definition at line 2010 of file ExpList.h.

2011{
2012 return m_coeffs[i];
2013}
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1083

References m_coeffs.

Referenced by Nektar::MultiRegions::DisContField::v_EvaluateBoundaryConditions().

◆ GetCoeff_Offset()

int Nektar::MultiRegions::ExpList::GetCoeff_Offset ( int  n) const
inline

◆ GetCoeffs() [1/2]

const Array< OneD, const NekDouble > & Nektar::MultiRegions::ExpList::GetCoeffs ( void  ) const
inline

This function returns (a reference to) the array \(\boldsymbol{\hat{u}}_l\) (implemented as m_coeffs) containing all local expansion coefficients.

As the function returns a constant reference to a const Array, it is not possible to modify the underlying data of the array m_coeffs. In order to do so, use the function UpdateCoeffs instead.

Returns
(A constant reference to) the array m_coeffs.

Definition at line 1944 of file ExpList.h.

1945{
1946 return m_coeffs;
1947}

References m_coeffs.

Referenced by Nektar::MultiRegions::ContField::LaplaceSolve(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_EvaluateBoundaryConditions(), Nektar::MultiRegions::DisContField::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::ContField::v_HelmSolve(), Nektar::MultiRegions::ExpList3DHomogeneous1D::v_HomogeneousEnergy(), Nektar::MultiRegions::ContField::v_ImposeDirichletConditions(), and Nektar::MultiRegions::ContField::v_LinearAdvectionDiffusionReactionSolve().

◆ GetCoeffs() [2/2]

NekDouble Nektar::MultiRegions::ExpList::GetCoeffs ( int  i)
inline

Get the i th value (coefficient) of m_coeffs.

Parameters
iThe index of m_coeffs to be returned
Returns
The NekDouble held in m_coeffs[i].

Definition at line 2018 of file ExpList.h.

2019{
2020 return m_coeffs[i];
2021}

References m_coeffs.

◆ GetCoeffsToElmt()

const Array< OneD, const std::pair< int, int > > & Nektar::MultiRegions::ExpList::GetCoeffsToElmt ( ) const
inline

Get m_coeffs to elemental value map.

Definition at line 2117 of file ExpList.h.

2119{
2120 return m_coeffsToElmt;
2121}
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition: ExpList.h:1127

References m_coeffsToElmt.

Referenced by Nektar::MultiRegions::LocTraceToTraceMap::TraceLocToElmtLocCoeffMap().

◆ GetComm()

std::shared_ptr< LibUtilities::Comm > Nektar::MultiRegions::ExpList::GetComm ( ) const
inline

Returns the comm object.

Definition at line 966 of file ExpList.h.

967 {
968 return m_comm;
969 }

References m_comm.

Referenced by Nektar::MultiRegions::AssemblyCommDG::AssemblyCommDG(), and Nektar::MultiRegions::AssemblyMapCG::v_LinearSpaceMap().

◆ GetCoordim()

int Nektar::MultiRegions::ExpList::GetCoordim ( int  eid)
inline

This function returns the dimension of the coordinates of the element eid.

Parameters
eidThe index of the element to be checked.
Returns
The dimension of the coordinates of the specific element.

Definition at line 1903 of file ExpList.h.

1904{
1905 ASSERTL2(eid <= (*m_exp).size(), "eid is larger than number of elements");
1906 return (*m_exp)[eid]->GetCoordim();
1907}
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:265

References ASSERTL2, and m_exp.

Referenced by GetExpIndex(), PhysEvaluate(), v_GetBoundaryNormals(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetCoords(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetCoords(), v_GetNormals(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetNormals(), v_IProductWRTDerivBase(), v_NormVectorIProductWRTBase(), v_Upwind(), v_WriteTecplotZone(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_WriteTecplotZone(), and Nektar::MultiRegions::ExpList2DHomogeneous2D::v_WriteTecplotZone().

◆ GetCoords() [1/2]

void Nektar::MultiRegions::ExpList::GetCoords ( Array< OneD, NekDouble > &  coord_0,
Array< OneD, NekDouble > &  coord_1 = NullNekDouble1DArray,
Array< OneD, NekDouble > &  coord_2 = NullNekDouble1DArray 
)
inline

This function calculates the coordinates of all the elemental quadrature points \(\boldsymbol{x}_i\).

Definition at line 1770 of file ExpList.h.

1773{
1774 v_GetCoords(coord_0, coord_1, coord_2);
1775}
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:5436

References v_GetCoords().

Referenced by v_WriteTecplotZone(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_WriteTecplotZone(), Nektar::MultiRegions::ExpList2DHomogeneous2D::v_WriteTecplotZone(), Nektar::MultiRegions::ExpList3DHomogeneous2D::v_WriteTecplotZone(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_WriteVtkPieceHeader(), Nektar::MultiRegions::ExpList2DHomogeneous2D::v_WriteVtkPieceHeader(), and Nektar::MultiRegions::ExpList3DHomogeneous2D::v_WriteVtkPieceHeader().

◆ GetCoords() [2/2]

void Nektar::MultiRegions::ExpList::GetCoords ( const int  eid,
Array< OneD, NekDouble > &  coord_0,
Array< OneD, NekDouble > &  coord_1 = NullNekDouble1DArray,
Array< OneD, NekDouble > &  coord_2 = NullNekDouble1DArray 
)
inline

Definition at line 1777 of file ExpList.h.

1780{
1781 v_GetCoords(eid, xc0, xc1, xc2);
1782}

References v_GetCoords().

◆ GetDiagMatIpwrtBase()

void Nektar::MultiRegions::ExpList::GetDiagMatIpwrtBase ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, DNekMatSharedPtr > &  mtxPerVar 
)

Definition at line 6181 of file ExpList.cpp.

6184{
6186 int nElmtPntPrevious = 0;
6187 int nElmtCoefPrevious = 0;
6188 int nTotElmt = (*m_exp).size();
6189 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
6190 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
6191
6192 Array<OneD, NekDouble> tmpPhys;
6193 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
6194 Array<OneD, NekDouble> stdMat_data;
6195
6196 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6197 {
6198 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6199 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6200 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
6201
6202 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
6203 (ElmtTypeNow != ElmtTypePrevious))
6204 {
6206 stdExp = (*m_exp)[nelmt]->GetStdExp();
6207 StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
6208 stdExp->DetShapeType(), *stdExp);
6209
6210 DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
6211 stdMat_data = BwdMat->GetPtr();
6212
6213 if (nElmtPntPrevious != nElmtPnt)
6214 {
6215 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6216 }
6217
6218 ElmtTypePrevious = ElmtTypeNow;
6219 nElmtPntPrevious = nElmtPnt;
6220 nElmtCoefPrevious = nElmtCoef;
6221 }
6222
6223 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
6224 inarray[nelmt],
6225 tmpPhys); // weight with metric
6226
6227 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
6228
6229 for (int np = 0; np < nElmtPnt; np++)
6230 {
6231 NekDouble factor = tmpPhys[np];
6232 clmnArray = MatDataArray + np * nElmtCoef;
6233 clmnStdMatArray = stdMat_data + np * nElmtCoef;
6234 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
6235 }
6236 }
6237}
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100

References Nektar::StdRegions::eBwdMat, Nektar::LibUtilities::eNoShapeType, and Vmath::Smul().

◆ GetElmtNormalLength()

void Nektar::MultiRegions::ExpList::GetElmtNormalLength ( Array< OneD, NekDouble > &  lengthsFwd,
Array< OneD, NekDouble > &  lengthsBwd 
)

Get the length of elements in boundary normal direction.

Returns the element normal length for each trace expansion. The array has the same size as trace phys space. This function should only be called by a trace explist, which has setup the left and right adjacent elements. This function is only used by DiffusionIP to commpute the penalty. However, it's a question whether we need to calculate the lengthFwd and lengthBwd separately, since in most cases, they are equavalent. Same logic applies to v_GetNormals().

Parameters
lengthsFwdOutput array of normal lengths for left side.
lengthsBwdOutput array of normal lengths for right side.

Definition at line 4916 of file ExpList.cpp.

4918{
4919 int e_npoints;
4920
4921 Array<OneD, NekDouble> locLeng;
4922 Array<OneD, Array<OneD, NekDouble>> lengintp(2);
4923 Array<OneD, Array<OneD, NekDouble>> lengAdd(2);
4924 Array<OneD, int> LRbndnumbs(2);
4925 Array<OneD, Array<OneD, NekDouble>> lengLR(2);
4926 lengLR[0] = lengthsFwd;
4927 lengLR[1] = lengthsBwd;
4928 Array<OneD, LocalRegions::ExpansionSharedPtr> LRelmts(2);
4931 int e_npoints0 = -1;
4932 if (m_expType == e1D)
4933 {
4934 for (int i = 0; i < m_exp->size(); ++i)
4935 {
4936 loc_exp = (*m_exp)[i];
4937 int offset = m_phys_offset[i];
4938
4939 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4940 if (e_npoints0 < e_npoints)
4941 {
4942 for (int nlr = 0; nlr < 2; nlr++)
4943 {
4944 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4945 }
4946 e_npoints0 = e_npoints;
4947 }
4948
4949 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4950 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4951
4952 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4953 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4954 for (int nlr = 0; nlr < 2; ++nlr)
4955 {
4956 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4957 lengAdd[nlr] = lengintp[nlr];
4958 int bndNumber = LRbndnumbs[nlr];
4959 loc_elmt = LRelmts[nlr];
4960 if (bndNumber >= 0)
4961 {
4962 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4963
4964 LibUtilities::PointsKey to_key =
4965 loc_exp->GetBasis(0)->GetPointsKey();
4966 LibUtilities::PointsKey from_key =
4967 loc_elmt->GetTraceBasisKey(bndNumber).GetPointsKey();
4968
4969 // For unknown reason, GetTraceNormal(2D) returns normals
4970 // that has been reoriented to trace order.
4971 // So here we don't need to reorient them again.
4972
4973 // Always do interpolation
4974 LibUtilities::Interp1D(from_key, locLeng, to_key,
4975 lengintp[nlr]);
4976 lengAdd[nlr] = lengintp[nlr];
4977 }
4978
4979 for (int j = 0; j < e_npoints; ++j)
4980 {
4981 lengLR[nlr][offset + j] = lengAdd[nlr][j];
4982 }
4983 }
4984 }
4985 }
4986 else if (m_expType == e2D)
4987 {
4988 for (int i = 0; i < m_exp->size(); ++i)
4989 {
4990 loc_exp = (*m_exp)[i];
4991 int offset = m_phys_offset[i];
4992
4993 LibUtilities::BasisKey traceBasis0 =
4994 loc_exp->GetBasis(0)->GetBasisKey();
4995 LibUtilities::BasisKey traceBasis1 =
4996 loc_exp->GetBasis(1)->GetBasisKey();
4997 const int TraceNq0 = traceBasis0.GetNumPoints();
4998 const int TraceNq1 = traceBasis1.GetNumPoints();
4999 e_npoints = TraceNq0 * TraceNq1;
5000 if (e_npoints0 < e_npoints)
5001 {
5002 for (int nlr = 0; nlr < 2; nlr++)
5003 {
5004 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
5005 }
5006 e_npoints0 = e_npoints;
5007 }
5008
5009 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
5010 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
5011
5012 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
5013 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
5014 for (int nlr = 0; nlr < 2; ++nlr)
5015 {
5016 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
5017 int bndNumber = LRbndnumbs[nlr];
5018 loc_elmt = LRelmts[nlr];
5019 if (bndNumber >= 0)
5020 {
5021 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
5022 // Project normals from 3D element onto the
5023 // same orientation as the trace expansion.
5025 loc_elmt->GetTraceOrient(bndNumber);
5026
5027 int fromid0, fromid1;
5029 {
5030 fromid0 = 0;
5031 fromid1 = 1;
5032 }
5033 else
5034 {
5035 fromid0 = 1;
5036 fromid1 = 0;
5037 }
5038
5039 LibUtilities::BasisKey faceBasis0 =
5040 loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
5041 LibUtilities::BasisKey faceBasis1 =
5042 loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
5043 const int faceNq0 = faceBasis0.GetNumPoints();
5044 const int faceNq1 = faceBasis1.GetNumPoints();
5045 Array<OneD, NekDouble> alignedLeng(faceNq0 * faceNq1);
5046
5047 AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
5049 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
5050 alignedLeng, traceBasis0.GetPointsKey(),
5051 traceBasis1.GetPointsKey(), lengintp[nlr]);
5052 }
5053
5054 for (int j = 0; j < e_npoints; ++j)
5055 {
5056 lengLR[nlr][offset + j] = lengintp[nlr][j];
5057 }
5058 }
5059 }
5060 }
5061}
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Definition: Interp.cpp:47
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
Definition: Interp.cpp:101
void AlignFace(const StdRegions::Orientation orient, const int nquad1, const int nquad2, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Helper function to re-align face to a given orientation.
Definition: ExpList.cpp:4638

References Nektar::MultiRegions::AlignFace(), Nektar::MultiRegions::e1D, Nektar::MultiRegions::e2D, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::LibUtilities::Interp1D(), Nektar::LibUtilities::Interp2D(), m_exp, m_expType, m_phys_offset, and Vmath::Zero().

◆ GetElmtToExpId() [1/2]

int Nektar::MultiRegions::ExpList::GetElmtToExpId ( int  elmtId)
inline

This function returns the index inside m_exp for a given geom id.

Definition at line 1039 of file ExpList.h.

1040 {
1041 auto it = m_elmtToExpId.find(elmtId);
1042 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
1043 std::to_string(elmtId) +
1044 " not found in element ID to "
1045 "expansion ID map.")
1046 return it->second;
1047 }

References ASSERTL0, and m_elmtToExpId.

◆ GetElmtToExpId() [2/2]

const std::unordered_map< int, int > & Nektar::MultiRegions::ExpList::GetElmtToExpId ( void  )
inline

This function returns the map of index inside m_exp to geom id.

Definition at line 1032 of file ExpList.h.

1034 {
1035 return m_elmtToExpId;
1036 }

References m_elmtToExpId.

◆ GetExp() [1/3]

const std::shared_ptr< LocalRegions::ExpansionVector > Nektar::MultiRegions::ExpList::GetExp ( void  ) const
inline

This function returns the vector of elements in the expansion.

Returns
(A const shared pointer to) the local expansion vector m_exp

Definition at line 2070 of file ExpList.h.

2072{
2073 return m_exp;
2074}

References m_exp.

Referenced by AddTraceJacToElmtJac(), Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), Nektar::MultiRegions::ContField3DHomogeneous2D::ContField3DHomogeneous2D(), Nektar::MultiRegions::AssemblyMapCG::CreateGraph(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous2D::DisContField3DHomogeneous2D(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList2DHomogeneous2D::ExpList2DHomogeneous2D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), Nektar::MultiRegions::LocTraceToTraceMap::FindElmtNeighbors(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), GetExp(), GetExpIndex(), Nektar::MultiRegions::AssemblyCommDG::InitialiseStructure(), Nektar::MultiRegions::LocTraceToTraceMap::LocTraceToTraceMap(), Nektar::MultiRegions::LocTraceToTraceMap::Setup(), Nektar::MultiRegions::AssemblyMapCG::SetUpUniversalC0ContMap(), Nektar::MultiRegions::AssemblyMapDG::SetUpUniversalDGMap(), v_ExtractElmtToBndPhys(), v_ExtractPhysToBnd(), v_ExtractPhysToBndElmt(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBCValues(), Nektar::MultiRegions::DisContField::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion(), v_GetBoundaryNormals(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetCoords(), Nektar::MultiRegions::ExpList3DHomogeneous1D::v_HomogeneousEnergy(), Nektar::MultiRegions::AssemblyMapCG::v_LinearSpaceMap(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_NormVectorIProductWRTBase(), and v_WriteTecplotHeader().

◆ GetExp() [2/3]

LocalRegions::ExpansionSharedPtr & Nektar::MultiRegions::ExpList::GetExp ( const Array< OneD, const NekDouble > &  gloCoord)

This function returns (a shared pointer to) the local elemental expansion containing the arbitrary point given by gloCoord.

Definition at line 3170 of file ExpList.cpp.

3172{
3173 return GetExp(GetExpIndex(gloCoord));
3174}
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
This function returns the index of the local elemental expansion containing the arbitrary point given...
Definition: ExpList.cpp:3181

References GetExp(), and GetExpIndex().

◆ GetExp() [3/3]

LocalRegions::ExpansionSharedPtr & Nektar::MultiRegions::ExpList::GetExp ( int  n) const
inline

This function returns (a shared pointer to) the local elemental expansion of the \(n^{\mathrm{th}}\) element.

Parameters
nThe index of the element concerned.
Returns
(A shared pointer to) the local expansion of the \(n^{\mathrm{th}}\) element.

Definition at line 2048 of file ExpList.h.

2049{
2050 return (*m_exp)[n];
2051}

References m_exp.

◆ GetExpFromGeomId()

LocalRegions::ExpansionSharedPtr & Nektar::MultiRegions::ExpList::GetExpFromGeomId ( int  n)
inline

This function returns (a shared pointer to) the local elemental expansion of the \(n^{\mathrm{th}}\) element given a global geometry ID.

Parameters
nThe global id of the element concerned.
Returns
(A shared pointer to) the local expansion of the \(n^{\mathrm{th}}\) element.

Definition at line 2058 of file ExpList.h.

2059{
2060 auto it = m_elmtToExpId.find(n);
2061 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
2062 std::to_string(n) +
2063 " not found in element ID to "
2064 "expansion ID map.")
2065 return (*m_exp)[it->second];
2066}

References ASSERTL0, m_elmtToExpId, and m_exp.

◆ GetExpIndex() [1/2]

int Nektar::MultiRegions::ExpList::GetExpIndex ( const Array< OneD, const NekDouble > &  gloCoord,
NekDouble  tol = 0.0,
bool  returnNearestElmt = false,
int  cachedId = -1,
NekDouble  maxDistance = 1e6 
)

This function returns the index of the local elemental expansion containing the arbitrary point given by gloCoord, within a distance tolerance of tol.

If returnNearestElmt is true and no element contains the point, this function returns the nearest element whose bounding box contains the point. The bounding box has a 10% margin in each direction.

Parameters
gloCoord(input) coordinate in physics space
locCoords(output) local coordinate xi in the returned element
toldistance tolerance to judge if a point lies in an element
returnNearestElmtif true and no element contains this point, the nearest element whose bounding box contains this point is returned
cachedIdan initial guess of the most possible element index
maxDistanceif returnNearestElmt is set as true, the nearest element will be returned. But the distance of the nearest element and this point should be <= maxDistance.
Returns
element index; if no element is found, -1 is returned.
Todo:
need a smarter search here that first just looks at bounding vertices - suggest first seeing if point is within 10% of region defined by vertices. The do point search.

Definition at line 3181 of file ExpList.cpp.

3184{
3185 Array<OneD, NekDouble> Lcoords(gloCoord.size());
3186
3187 return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
3188 maxDistance);
3189}

References GetExpIndex().

Referenced by GetExp(), GetExpIndex(), and PhysEvaluate().

◆ GetExpIndex() [2/2]

int Nektar::MultiRegions::ExpList::GetExpIndex ( const Array< OneD, const NekDouble > &  gloCoords,
Array< OneD, NekDouble > &  locCoords,
NekDouble  tol = 0.0,
bool  returnNearestElmt = false,
int  cachedId = -1,
NekDouble  maxDistance = 1e6 
)

This function returns the index and the Local Cartesian Coordinates locCoords of the local elemental expansion containing the arbitrary point given by gloCoords.

Definition at line 3191 of file ExpList.cpp.

3195{
3196 if (GetNumElmts() == 0)
3197 {
3198 return -1;
3199 }
3200
3201 if (m_elmtToExpId.size() == 0)
3202 {
3203 // Loop in reverse order so that in case where using a
3204 // Homogeneous expansion it sets geometry ids to first part of
3205 // m_exp list. Otherwise will set to second (complex) expansion
3206 for (int i = (*m_exp).size() - 1; i >= 0; --i)
3207 {
3208 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3209 }
3210 }
3211
3212 NekDouble nearpt = 1e6;
3213 NekDouble nearpt_min = 1e6;
3214 int min_id = -1;
3215 Array<OneD, NekDouble> savLocCoords(locCoords.size());
3216
3217 if (cachedId >= 0 && cachedId < (*m_exp).size())
3218 {
3219 nearpt = 1e12;
3220 if ((*m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords, locCoords,
3221 tol, nearpt))
3222 {
3223 return cachedId;
3224 }
3225 else if (returnNearestElmt && (nearpt < nearpt_min))
3226 {
3227 // If it does not lie within, keep track of which element
3228 // is nearest.
3229 min_id = cachedId;
3230 nearpt_min = nearpt;
3231 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
3232 }
3233 }
3234
3235 NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
3236 NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
3237 NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
3240 GetExp(0)->GetCoordim(), -1, x, y, z);
3241
3242 // Get the list of elements whose bounding box contains the desired
3243 // point.
3244 std::vector<int> elmts = m_graph->GetElementsContainingPoint(p);
3245
3246 // Check each element in turn to see if point lies within it.
3247 for (int i = 0; i < elmts.size(); ++i)
3248 {
3249 int id = m_elmtToExpId[elmts[i]];
3250 if (id == cachedId)
3251 {
3252 continue;
3253 }
3254 if ((*m_exp)[id]->GetGeom()->ContainsPoint(gloCoords, locCoords, tol,
3255 nearpt))
3256 {
3257 return id;
3258 }
3259 else if (returnNearestElmt && (nearpt < nearpt_min))
3260 {
3261 // If it does not lie within, keep track of which element
3262 // is nearest.
3263 min_id = id;
3264 nearpt_min = nearpt;
3265 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
3266 }
3267 }
3268
3269 // If the calling function is with just the nearest element, return
3270 // that. Otherwise return -1 to indicate no matching elemenet found.
3271 if (returnNearestElmt && nearpt_min <= maxDistance)
3272 {
3273
3274 std::string msg = "Failed to find point within element to "
3275 "tolerance of " +
3276 boost::lexical_cast<std::string>(tol) +
3277 " using local point (" +
3278 boost::lexical_cast<std::string>(locCoords[0]) + "," +
3279 boost::lexical_cast<std::string>(locCoords[1]) + "," +
3280 boost::lexical_cast<std::string>(locCoords[1]) +
3281 ") in element: " + std::to_string(min_id);
3282 WARNINGL1(false, msg.c_str());
3283
3284 Vmath::Vcopy(locCoords.size(), savLocCoords, 1, locCoords, 1);
3285 return min_id;
3286 }
3287 else
3288 {
3289 return -1;
3290 }
3291}
size_t GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:653
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1903
std::vector< double > z(NPUPPER)

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), GetCoordim(), GetExp(), GetNumElmts(), m_elmtToExpId, m_exp, m_graph, CellMLToNektar.pycml::msg, CellMLToNektar.cellml_metadata::p, Vmath::Vcopy(), WARNINGL1, and Nektar::UnitTests::z().

◆ GetExpSize()

int Nektar::MultiRegions::ExpList::GetExpSize ( void  )
inline

◆ GetExpType()

ExpansionType Nektar::MultiRegions::ExpList::GetExpType ( void  )

Returns the type of the expansion.

Definition at line 1888 of file ExpList.cpp.

1889{
1890 return m_expType;
1891}

References m_expType.

Referenced by v_CurlCurl().

◆ GetFieldDefinitions() [1/2]

std::vector< LibUtilities::FieldDefinitionsSharedPtr > Nektar::MultiRegions::ExpList::GetFieldDefinitions ( )
inline

Definition at line 897 of file ExpList.h.

898 {
899 return v_GetFieldDefinitions();
900 }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:4190

References v_GetFieldDefinitions().

◆ GetFieldDefinitions() [2/2]

void Nektar::MultiRegions::ExpList::GetFieldDefinitions ( std::vector< LibUtilities::FieldDefinitionsSharedPtr > &  fielddef)
inline

Definition at line 902 of file ExpList.h.

904 {
905 v_GetFieldDefinitions(fielddef);
906 }

References v_GetFieldDefinitions().

◆ GetFwdBwdTracePhys() [1/2]

void Nektar::MultiRegions::ExpList::GetFwdBwdTracePhys ( Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
inline

Definition at line 2184 of file ExpList.h.

2186{
2187 v_GetFwdBwdTracePhys(Fwd, Bwd);
2188}
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:5080

References v_GetFwdBwdTracePhys().

◆ GetFwdBwdTracePhys() [2/2]

void Nektar::MultiRegions::ExpList::GetFwdBwdTracePhys ( const Array< OneD, const NekDouble > &  field,
Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd,
bool  FillBnd = true,
bool  PutFwdInBwdOnBCs = false,
bool  DoExchange = true 
)
inline

Definition at line 2189 of file ExpList.h.

2193{
2194 v_GetFwdBwdTracePhys(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
2195 DoExchange);
2196}

References FilterPython_Function::field, and v_GetFwdBwdTracePhys().

◆ GetGlobalLinSysManager()

LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & Nektar::MultiRegions::ExpList::GetGlobalLinSysManager ( void  )

Definition at line 5975 of file ExpList.cpp.

5977{
5978 return v_GetGlobalLinSysManager();
5979}
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Definition: ExpList.cpp:3998

References v_GetGlobalLinSysManager().

◆ GetGraph()

SpatialDomains::MeshGraphSharedPtr Nektar::MultiRegions::ExpList::GetGraph ( )
inline

Definition at line 970 of file ExpList.h.

971 {
972 return m_graph;
973 }

References m_graph.

◆ GetHomogeneousBasis()

LibUtilities::BasisSharedPtr Nektar::MultiRegions::ExpList::GetHomogeneousBasis ( void  )
inline

Definition at line 975 of file ExpList.h.

976 {
977 return v_GetHomogeneousBasis();
978 }
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1464

References v_GetHomogeneousBasis().

◆ GetHomoLen()

NekDouble Nektar::MultiRegions::ExpList::GetHomoLen ( void  )
inline

This function returns the Width of homogeneous direction associated with the homogeneous expansion.

Definition at line 604 of file ExpList.h.

605 {
606 return v_GetHomoLen();
607 }
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:3948

References v_GetHomoLen().

◆ GetInterfaceMap()

std::shared_ptr< InterfaceMapDG > & Nektar::MultiRegions::ExpList::GetInterfaceMap ( void  )
inline

Definition at line 2161 of file ExpList.h.

2162{
2163 return v_GetInterfaceMap();
2164}
virtual std::shared_ptr< InterfaceMapDG > & v_GetInterfaceMap()
Definition: ExpList.cpp:4614

References v_GetInterfaceMap().

◆ GetLeftAdjacentFaces()

const std::vector< bool > & Nektar::MultiRegions::ExpList::GetLeftAdjacentFaces ( void  ) const
inline

Definition at line 2226 of file ExpList.h.

2227{
2228 return v_GetLeftAdjacentFaces();
2229}
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:5149

References v_GetLeftAdjacentFaces().

◆ GetLeftAdjacentTraces()

std::vector< bool > & Nektar::MultiRegions::ExpList::GetLeftAdjacentTraces ( void  )
inline

Definition at line 2300 of file ExpList.h.

2301{
2302 return v_GetLeftAdjacentTraces();
2303}
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
Definition: ExpList.cpp:4627

References v_GetLeftAdjacentTraces().

◆ GetLocTraceFromTracePts()

void Nektar::MultiRegions::ExpList::GetLocTraceFromTracePts ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  locTraceFwd,
Array< OneD, NekDouble > &  locTraceBwd 
)
inline

Definition at line 2209 of file ExpList.h.

2213{
2214 v_GetLocTraceFromTracePts(Fwd, Bwd, locTraceFwd, locTraceBwd);
2215}
virtual void v_GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
Definition: ExpList.cpp:5124

References v_GetLocTraceFromTracePts().

Referenced by AddTraceJacToElmtJac().

◆ GetLocTraceToTraceMap()

const LocTraceToTraceMapSharedPtr & Nektar::MultiRegions::ExpList::GetLocTraceToTraceMap ( ) const
inline

Definition at line 2122 of file ExpList.h.

2124{
2125 return v_GetLocTraceToTraceMap();
2126}
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
Definition: ExpList.cpp:6677

References v_GetLocTraceToTraceMap().

Referenced by AddTraceJacToElmtJac().

◆ GetMatIpwrtDeriveBase() [1/2]

void Nektar::MultiRegions::ExpList::GetMatIpwrtDeriveBase ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
const int  nDirctn,
Array< OneD, DNekMatSharedPtr > &  mtxPerVar 
)

Definition at line 6038 of file ExpList.cpp.

6041{
6042 int nTotElmt = (*m_exp).size();
6043 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
6044 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
6045
6046 Array<OneD, NekDouble> tmpCoef(nElmtCoef, 0.0);
6047 Array<OneD, NekDouble> tmpPhys(nElmtPnt, 0.0);
6048
6049 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6050 {
6051 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6052 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6053
6054 if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
6055 {
6056 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6057 tmpCoef = Array<OneD, NekDouble>(nElmtCoef, 0.0);
6058 }
6059
6060 for (int ncl = 0; ncl < nElmtPnt; ncl++)
6061 {
6062 tmpPhys[ncl] = inarray[nelmt][ncl];
6063
6064 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
6065
6066 for (int nrw = 0; nrw < nElmtCoef; nrw++)
6067 {
6068 (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
6069 }
6070 // to maintain all the other columes are zero.
6071 tmpPhys[ncl] = 0.0;
6072 }
6073 }
6074}

◆ GetMatIpwrtDeriveBase() [2/2]

void Nektar::MultiRegions::ExpList::GetMatIpwrtDeriveBase ( const TensorOfArray3D< NekDouble > &  inarray,
Array< OneD, DNekMatSharedPtr > &  mtxPerVar 
)

Definition at line 6076 of file ExpList.cpp.

6078{
6079 int nTotElmt = (*m_exp).size();
6080
6081 int nspacedim = m_graph->GetSpaceDimension();
6082 Array<OneD, Array<OneD, NekDouble>> projectedpnts(nspacedim);
6083 Array<OneD, Array<OneD, NekDouble>> tmppnts(nspacedim);
6084 Array<OneD, DNekMatSharedPtr> ArrayStdMat(nspacedim);
6085 Array<OneD, Array<OneD, NekDouble>> ArrayStdMat_data(nspacedim);
6086
6087 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
6088
6090 int nElmtPntPrevious = 0;
6091 int nElmtCoefPrevious = 0;
6092
6093 int nElmtPnt, nElmtCoef;
6094 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6095 {
6096 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6097 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6098 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
6099
6100 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
6101 (ElmtTypeNow != ElmtTypePrevious))
6102 {
6103 if (nElmtPntPrevious != nElmtPnt)
6104 {
6105 for (int ndir = 0; ndir < nspacedim; ndir++)
6106 {
6107 projectedpnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6108 tmppnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6109 }
6110 }
6112 stdExp = (*m_exp)[nelmt]->GetStdExp();
6113 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase0,
6114 stdExp->DetShapeType(), *stdExp);
6115
6116 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
6117 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
6118
6119 if (nspacedim > 1)
6120 {
6121 StdRegions::StdMatrixKey matkey(
6122 StdRegions::eDerivBase1, stdExp->DetShapeType(), *stdExp);
6123
6124 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
6125 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
6126
6127 if (nspacedim > 2)
6128 {
6129 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase2,
6130 stdExp->DetShapeType(),
6131 *stdExp);
6132
6133 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
6134 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
6135 }
6136 }
6137
6138 ElmtTypePrevious = ElmtTypeNow;
6139 nElmtPntPrevious = nElmtPnt;
6140 nElmtCoefPrevious = nElmtCoef;
6141 }
6142 else
6143 {
6144 for (int ndir = 0; ndir < nspacedim; ndir++)
6145 {
6146 Vmath::Zero(nElmtPnt, projectedpnts[ndir], 1);
6147 }
6148 }
6149
6150 for (int ndir = 0; ndir < nspacedim; ndir++)
6151 {
6152 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
6153 ndir, inarray[ndir][nelmt], tmppnts);
6154 for (int n = 0; n < nspacedim; n++)
6155 {
6156 Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
6157 projectedpnts[n], 1);
6158 }
6159 }
6160
6161 for (int ndir = 0; ndir < nspacedim; ndir++)
6162 {
6163 // weight with metric
6164 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
6165 projectedpnts[ndir]);
6166 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
6167
6168 for (int np = 0; np < nElmtPnt; np++)
6169 {
6170 NekDouble factor = projectedpnts[ndir][np];
6171 clmnArray = MatDataArray + np * nElmtCoef;
6172 clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
6173 Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
6174 1, clmnArray, 1);
6175 }
6176 }
6177 }
6178}
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
Definition: Vmath.hpp:396

References Nektar::StdRegions::eDerivBase0, Nektar::StdRegions::eDerivBase1, Nektar::StdRegions::eDerivBase2, Nektar::LibUtilities::eNoShapeType, m_graph, Vmath::Svtvp(), Vmath::Vadd(), and Vmath::Zero().

◆ GetMovingFrames()

void Nektar::MultiRegions::ExpList::GetMovingFrames ( const SpatialDomains::GeomMMF  MMFdir,
const Array< OneD, const NekDouble > &  CircCentre,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
inline

Definition at line 1787 of file ExpList.h.

1791{
1792 v_GetMovingFrames(MMFdir, CircCentre, outarray);
1793}
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: ExpList.cpp:4399

References v_GetMovingFrames().

◆ GetNcoeffs() [1/2]

int Nektar::MultiRegions::ExpList::GetNcoeffs ( const int  eid) const
inline

Returns the total number of local degrees of freedom for element eid.

Definition at line 1517 of file ExpList.h.

1518{
1519 return (*m_exp)[eid]->GetNcoeffs();
1520}

References m_exp.

◆ GetNcoeffs() [2/2]

int Nektar::MultiRegions::ExpList::GetNcoeffs ( void  ) const
inline

◆ GetNormals()

void Nektar::MultiRegions::ExpList::GetNormals ( Array< OneD, Array< OneD, NekDouble > > &  normals)
inline

Definition at line 2169 of file ExpList.h.

2170{
2171 v_GetNormals(normals);
2172}
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList.cpp:4707

References v_GetNormals().

◆ GetNpoints()

int Nektar::MultiRegions::ExpList::GetNpoints ( void  ) const
inline

Returns the total number of quadrature points m_npoints \(=Q_{\mathrm{tot}}\).

Definition at line 1588 of file ExpList.h.

1589{
1590 return m_npoints;
1591}

References m_npoints.

Referenced by MultiplyByMassMatrix().

◆ GetNumElmts()

size_t Nektar::MultiRegions::ExpList::GetNumElmts ( void  )
inline

This function returns the number of elements in the expansion which may be different for a homogeoenous extended expansionp.

Definition at line 653 of file ExpList.h.

654 {
655 return v_GetNumElmts();
656 }
virtual size_t v_GetNumElmts(void)
Definition: ExpList.h:1162

References v_GetNumElmts().

Referenced by GetExpIndex(), v_GetCoords(), and v_WriteTecplotHeader().

◆ GetPeriodicEntities()

void Nektar::MultiRegions::ExpList::GetPeriodicEntities ( PeriodicMap periodicVerts,
PeriodicMap periodicEdges,
PeriodicMap periodicFaces = NullPeriodicMap 
)
inline

Definition at line 890 of file ExpList.h.

893 {
894 v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
895 }
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:5744

References v_GetPeriodicEntities().

◆ GetPhys()

const Array< OneD, const NekDouble > & Nektar::MultiRegions::ExpList::GetPhys ( void  ) const
inline

This function returns (a reference to) the array \(\boldsymbol{u}_l\) (implemented as m_phys) containing the function \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points.

As the function returns a constant reference to a const Array it is not possible to modify the underlying data of the array m_phys. In order to do so, use the function UpdatePhys instead.

Returns
(A constant reference to) the array m_phys.

Definition at line 2030 of file ExpList.h.

2031{
2032 return m_phys;
2033}
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1099

References m_phys.

Referenced by Nektar::MultiRegions::DisContField::FillBwdWithBoundCond(), Nektar::MultiRegions::DisContField::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), and Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion().

◆ GetPhys_Offset()

int Nektar::MultiRegions::ExpList::GetPhys_Offset ( int  n) const
inline

◆ GetPhysState()

bool Nektar::MultiRegions::ExpList::GetPhysState ( void  ) const
inline

This function indicates whether the array of physical values \(\boldsymbol{u}_l\) (implemented as m_phys) is filled or not.

Returns
physState true (=filled) or false (=not filled).

Definition at line 1643 of file ExpList.h.

1644{
1645 return m_physState;
1646}

References m_physState.

◆ GetPlane()

std::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::GetPlane ( int  n)
inline

Definition at line 979 of file ExpList.h.

980 {
981 return v_GetPlane(n);
982 }
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:5773

References v_GetPlane().

◆ GetPoolCount()

int Nektar::MultiRegions::ExpList::GetPoolCount ( std::string  poolName)

Added for access to the pool count by external code (e.g. UnitTests) which can't access the static pool across compilation units on Windows builds.

Definition at line 5965 of file ExpList.cpp.

5966{
5967 return v_GetPoolCount(poolName);
5968}
virtual int v_GetPoolCount(std::string)
Definition: ExpList.cpp:3984

References v_GetPoolCount().

◆ GetRobinBCInfo()

std::map< int, RobinBCInfoSharedPtr > Nektar::MultiRegions::ExpList::GetRobinBCInfo ( )
inline

Definition at line 885 of file ExpList.h.

886 {
887 return v_GetRobinBCInfo();
888 }
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:5734

References v_GetRobinBCInfo().

Referenced by GenGlobalBndLinSys(), and GenGlobalMatrixFull().

◆ GetSession()

std::shared_ptr< LibUtilities::SessionReader > Nektar::MultiRegions::ExpList::GetSession ( ) const
inline

◆ GetShapeDimension()

int Nektar::MultiRegions::ExpList::GetShapeDimension ( )
inline

This function returns the dimension of the shape of the element eid.

Parameters
eidThe index of the element to be checked.
Returns
The dimension of the shape of the specific element.

Definition at line 1912 of file ExpList.h.

1913{
1914 return (*m_exp)[0]->GetShapeDimension();
1915}

References m_exp.

Referenced by CreateCollections(), and GeneralGetFieldDefinitions().

◆ GetSharedThisPtr()

std::shared_ptr< ExpList > Nektar::MultiRegions::ExpList::GetSharedThisPtr ( )
inline

Returns a shared pointer to the current object.

Definition at line 956 of file ExpList.h.

957 {
958 return shared_from_this();
959 }

Referenced by GenGlobalBndLinSys(), GenGlobalLinSys(), Nektar::MultiRegions::ContField::GetGJPForcing(), Nektar::MultiRegions::ContField::v_HelmSolve(), and Nektar::MultiRegions::ContField::v_LinearAdvectionDiffusionReactionSolve().

◆ GetTotPoints() [1/2]

int Nektar::MultiRegions::ExpList::GetTotPoints ( const int  eid) const
inline

Returns the total number of quadrature points for eid's element \(=Q_{\mathrm{tot}}\).

Definition at line 1562 of file ExpList.h.

1563{
1564 return (*m_exp)[eid]->GetTotPoints();
1565}

References m_exp.

◆ GetTotPoints() [2/2]

int Nektar::MultiRegions::ExpList::GetTotPoints ( void  ) const
inline

◆ GetTrace()

std::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::GetTrace ( )
inline

Return a reference to the trace space associated with this expansion list.

Definition at line 2153 of file ExpList.h.

2154{
2155 return v_GetTrace();
2156}
virtual std::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:4598

References v_GetTrace().

Referenced by AddTraceJacToElmtJac(), and Nektar::MultiRegions::DisContField::v_AddTraceIntegral().

◆ GetTraceBndMap()

const Array< OneD, const int > & Nektar::MultiRegions::ExpList::GetTraceBndMap ( void  )
inline

Definition at line 2165 of file ExpList.h.

2166{
2167 return v_GetTraceBndMap();
2168}
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:4622

References v_GetTraceBndMap().

◆ GetTraceMap()

std::shared_ptr< AssemblyMapDG > & Nektar::MultiRegions::ExpList::GetTraceMap ( void  )
inline

Definition at line 2157 of file ExpList.h.

2158{
2159 return v_GetTraceMap();
2160}
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:4606

References v_GetTraceMap().

Referenced by v_GetTraceBndMap().

◆ GetTransposition()

LibUtilities::TranspositionSharedPtr Nektar::MultiRegions::ExpList::GetTransposition ( void  )
inline

This function returns the transposition class associated with the homogeneous expansion.

Definition at line 597 of file ExpList.h.

598 {
599 return v_GetTransposition();
600 }
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:3940

References v_GetTransposition().

◆ GetWaveSpace()

bool Nektar::MultiRegions::ExpList::GetWaveSpace ( void  ) const
inline

This function returns the third direction expansion condition, which can be in wave space (coefficient) or not It is stored in the variable m_WaveSpace.

Definition at line 1604 of file ExpList.h.

1605{
1606 return m_WaveSpace;
1607}

References m_WaveSpace.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), and Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion().

◆ GetYIDs()

Array< OneD, const unsigned int > Nektar::MultiRegions::ExpList::GetYIDs ( void  )
inline

This function returns a vector containing the wave numbers in y-direction associated with the 3D homogenous expansion. Required if a parellelisation is applied in the Fourier direction.

Definition at line 620 of file ExpList.h.

621 {
622 return v_GetYIDs();
623 }
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:3970

References v_GetYIDs().

◆ GetZIDs()

Array< OneD, const unsigned int > Nektar::MultiRegions::ExpList::GetZIDs ( void  )
inline

This function returns a vector containing the wave numbers in z-direction associated with the 3D homogenous expansion. Required if a parellelisation is applied in the Fourier direction.

Definition at line 590 of file ExpList.h.

591 {
592 return v_GetZIDs();
593 }
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:3962

References v_GetZIDs().

Referenced by v_WriteTecplotZone().

◆ GlobalEigenSystem()

void Nektar::MultiRegions::ExpList::GlobalEigenSystem ( const std::shared_ptr< DNekMat > &  Gmat,
Array< OneD, NekDouble > &  EigValsReal,
Array< OneD, NekDouble > &  EigValsImag,
Array< OneD, NekDouble > &  EigVecs = NullNekDouble1DArray 
)
protected

◆ GlobalToLocal() [1/2]

void Nektar::MultiRegions::ExpList::GlobalToLocal ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This operation is evaluated as:

\begin{tabbing} \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\ \> \> Do \= $i=$ $0,N_m^e-1$ \\ \> \> \> $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\ \> \> continue \\ \> continue \end{tabbing}

where map \([e][i]\) is the mapping array and sign \([e][i]\) is an array of similar dimensions ensuring the correct modal connectivity between the different elements (both these arrays are contained in the data member #m_locToGloMap). This operation is equivalent to the scatter operation \(\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\), where \(\mathcal{A}\) is the \(N_{\mathrm{eof}}\times N_{\mathrm{dof}}\) permutation matrix.

Parameters
inarrayAn array of size \(N_\mathrm{dof}\) containing the global degrees of freedom \(\boldsymbol{x}_g\).
outarrayThe resulting local degrees of freedom \(\boldsymbol{x}_l\) will be stored in this array of size \(N_\mathrm{eof}\).

Definition at line 2001 of file ExpList.h.

2003{
2004 v_GlobalToLocal(inarray, outarray);
2005}
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:5361

References v_GlobalToLocal().

◆ GlobalToLocal() [2/2]

void Nektar::MultiRegions::ExpList::GlobalToLocal ( void  )
inline

Scatters from the global coefficients \(\boldsymbol{\hat{u}}_g\) to the local coefficients \(\boldsymbol{\hat{u}}_l\).

Definition at line 1971 of file ExpList.h.

1972{
1974}

References v_GlobalToLocal().

◆ H1()

NekDouble Nektar::MultiRegions::ExpList::H1 ( const Array< OneD, const NekDouble > &  inarray,
const Array< OneD, const NekDouble > &  soln = NullNekDouble1DArray 
)

Calculates the \(H^1\) error of the global spectral/hp element approximation.

Given a spectral/hp approximation \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points (which should be contained in m_phys), this function calculates the \(H^1_2\) error of this approximation with respect to an exact solution. The local distribution of the quadrature points allows an elemental evaluation of this operation through the functions StdRegions::StdExpansion::H1.

The exact solution, also evaluated at the quadrature points, should be contained in the variable m_phys of the ExpList object Sol.

Parameters
solnAn 1D array, containing the discrete evaluation of the exact solution at the quadrature points.
Returns
The \(H^1_2\) error of the approximation.

Definition at line 4060 of file ExpList.cpp.

4062{
4063 NekDouble err = 0.0, errh1;
4064 int i;
4065
4066 for (i = 0; i < (*m_exp).size(); ++i)
4067 {
4068 errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
4069 soln + m_phys_offset[i]);
4070 err += errh1 * errh1;
4071 }
4072
4073 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
4074
4075 return sqrt(err);
4076}
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References m_comm, m_phys_offset, Nektar::LibUtilities::ReduceSum, and tinysimd::sqrt().

◆ HelmSolve()

GlobalLinSysKey Nektar::MultiRegions::ExpList::HelmSolve ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::ConstFactorMap factors,
const StdRegions::VarCoeffMap varcoeff = StdRegions::NullVarCoeffMap,
const MultiRegions::VarFactorsMap varfactors = MultiRegions::NullVarFactorsMap,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray,
const bool  PhysSpaceForcing = true 
)
inline

Solve helmholtz problem.

Definition at line 1734 of file ExpList.h.

1740{
1741 return v_HelmSolve(inarray, outarray, factors, varcoeff, varfactors,
1742 dirForcing, PhysSpaceForcing);
1743}
virtual GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Definition: ExpList.cpp:5180
StdRegions::ConstFactorMap factors

References Nektar::VarcoeffHashingTest::factors, and v_HelmSolve().

◆ HomogeneousBwdTrans()

void Nektar::MultiRegions::ExpList::HomogeneousBwdTrans ( const int  npts,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  Shuff = true,
bool  UnShuff = true 
)
inline

◆ HomogeneousEnergy()

Array< OneD, const NekDouble > Nektar::MultiRegions::ExpList::HomogeneousEnergy ( void  )
inline

This function calculates the energy associated with each one of the modesof a 3D homogeneous nD expansion.

Definition at line 574 of file ExpList.h.

575 {
576 return v_HomogeneousEnergy();
577 }
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:3932

References v_HomogeneousEnergy().

◆ HomogeneousFwdTrans()

void Nektar::MultiRegions::ExpList::HomogeneousFwdTrans ( const int  npts,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  Shuff = true,
bool  UnShuff = true 
)
inline

Definition at line 1840 of file ExpList.h.

1843{
1844 v_HomogeneousFwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1845}
virtual void v_HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:5218

References v_HomogeneousFwdTrans().

Referenced by Nektar::MultiRegions::ExpListHomogeneous1D::v_DealiasedDotProd(), Nektar::MultiRegions::ExpListHomogeneous1D::v_DealiasedProd(), Nektar::MultiRegions::ExpListHomogeneous2D::v_DealiasedProd(), Nektar::MultiRegions::ExpList2DHomogeneous2D::v_FwdTrans(), Nektar::MultiRegions::ExpListHomogeneous1D::v_FwdTrans(), Nektar::MultiRegions::ExpListHomogeneous2D::v_FwdTrans(), Nektar::MultiRegions::ExpListHomogeneous1D::v_FwdTransBndConstrained(), Nektar::MultiRegions::ExpListHomogeneous2D::v_FwdTransBndConstrained(), Nektar::MultiRegions::ExpListHomogeneous1D::v_FwdTransLocalElmt(), Nektar::MultiRegions::ExpListHomogeneous2D::v_FwdTransLocalElmt(), Nektar::MultiRegions::ContField3DHomogeneous1D::v_HelmSolve(), Nektar::MultiRegions::ContField3DHomogeneous2D::v_HelmSolve(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_HelmSolve(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_HelmSolve(), Nektar::MultiRegions::ExpListHomogeneous1D::v_IProductWRTBase(), Nektar::MultiRegions::ExpListHomogeneous1D::v_IProductWRTDerivBase(), Nektar::MultiRegions::ExpListHomogeneous1D::v_PhysDeriv(), and Nektar::MultiRegions::ExpListHomogeneous2D::v_PhysDeriv().

◆ ImposeDirichletConditions()

void Nektar::MultiRegions::ExpList::ImposeDirichletConditions ( Array< OneD, NekDouble > &  outarray)
inline

Impose Dirichlet Boundary Conditions onto Array.

Definition at line 1948 of file ExpList.h.

1949{
1951}
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5320

References v_ImposeDirichletConditions().

◆ InitialiseExpVector()

void Nektar::MultiRegions::ExpList::InitialiseExpVector ( const SpatialDomains::ExpansionInfoMap expmap)
private

Define a list of elements using the geometry and basis key information in expmap;.

Initialise an expansion vector (m_exp) given an expansion map expmap which contains a list of basiskeys and geometries pointers. This routine is called from a number of ExpList constructors mainly handling the domain definitions. Boundary condition expansions are handled with specialised operators.

Parameters
expmapThe expansion info map contaiining map of basiskeys and geometry pointers

By default the routine will try and order the expansions in a manner which is optimal for collection type operations. This can be disabled by the command line option –no-exp-opt

Definition at line 1672 of file ExpList.cpp.

1674{
1677 SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
1682
1683 int id = 0;
1685
1686 bool DoOptOnCollection =
1687 m_session->DefinesCmdLineArgument("no-exp-opt") ? false : true;
1688 map<int, vector<int>> ExpOrder;
1689 if (DoOptOnCollection)
1690 {
1691 auto expIt = expmap.begin();
1692 int cnt = 0;
1693
1694 ExpOrder[cnt++].push_back(expIt->first);
1695 expIt++;
1696
1697 // sort base on basis key and deformed or regular
1698 for (; expIt != expmap.end(); ++expIt)
1699 {
1700 int i;
1701 for (i = 0; i < cnt; ++i)
1702 {
1704 expmap.find(ExpOrder[i][0])->second;
1705
1706 if ((expIt->second->m_basisKeyVector ==
1707 expInfo->m_basisKeyVector) &&
1708 (expIt->second->m_geomShPtr->GetGeomFactors()->GetGtype() ==
1709 expInfo->m_geomShPtr->GetGeomFactors()->GetGtype()))
1710 {
1711 ExpOrder[i].push_back(expIt->first);
1712 break;
1713 }
1714 }
1715
1716 if (i == cnt) // new expansion
1717 {
1718 ExpOrder[cnt++].push_back(expIt->first);
1719 }
1720 }
1721 }
1722 else
1723 {
1724 for (auto &expIt : expmap) // process in order or global id
1725 {
1726 ExpOrder[0].push_back(expIt.first);
1727 }
1728 }
1729
1731
1732 // Process each expansion in the graph
1733 for (auto &it : ExpOrder)
1734 {
1735 for (int c = 0; c < it.second.size(); ++c)
1736 {
1737 auto expIt = expmap.find(it.second[c]);
1738
1739 const SpatialDomains::ExpansionInfoShPtr expInfo = expIt->second;
1740
1741 switch (expInfo->m_basisKeyVector.size())
1742 {
1743 case 1: // Segment Expansions
1744 {
1746 "Cannot mix expansion dimensions in one vector");
1747 m_expType = e1D;
1748
1749 if ((SegmentGeom =
1750 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1751 expInfo->m_geomShPtr)))
1752 {
1753 // Retrieve basis key from expansion
1754 LibUtilities::BasisKey bkey =
1755 expInfo->m_basisKeyVector[0];
1756
1758 AllocateSharedPtr(bkey, SegmentGeom);
1759 }
1760 else
1761 {
1763 "dynamic cast to a 1D Geom failed");
1764 }
1765 }
1766 break;
1767 case 2:
1768 {
1770 "Cannot mix expansion dimensions in one vector");
1771 m_expType = e2D;
1772
1773 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1774 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1775
1776 if ((TriangleGeom = std::dynamic_pointer_cast<
1777 SpatialDomains ::TriGeom>(expInfo->m_geomShPtr)))
1778 {
1779 // This is not elegantly implemented needs re-thinking.
1780 if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange)
1781 {
1782 LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
1783 Ba.GetNumModes(),
1784 Ba.GetPointsKey());
1785
1789 AllocateSharedPtr(newBa, Bb, TriNb,
1790 TriangleGeom);
1791 }
1792 else
1793 {
1795 AllocateSharedPtr(Ba, Bb, TriangleGeom);
1796 }
1797 }
1798 else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1799 SpatialDomains::QuadGeom>(
1800 expInfo->m_geomShPtr)))
1801 {
1803 AllocateSharedPtr(Ba, Bb, QuadrilateralGeom);
1804 }
1805 else
1806 {
1808 "dynamic cast to a 2D Geom failed");
1809 }
1810 }
1811 break;
1812 case 3:
1813 {
1815 "Cannot mix expansion dimensions in one vector");
1816 m_expType = e3D;
1817
1818 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1819 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1820 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1821
1822 if ((TetGeom =
1823 std::dynamic_pointer_cast<SpatialDomains::TetGeom>(
1824 expInfo->m_geomShPtr)))
1825 {
1826 if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange ||
1827 Ba.GetBasisType() == LibUtilities::eGauss_Lagrange)
1828 {
1829 NEKERROR(
1831 "LocalRegions::NodalTetExp is not implemented "
1832 "yet");
1833 }
1834 else
1835 {
1837 AllocateSharedPtr(Ba, Bb, Bc, TetGeom);
1838 }
1839 }
1840 else if ((PrismGeom = std::dynamic_pointer_cast<
1841 SpatialDomains ::PrismGeom>(
1842 expInfo->m_geomShPtr)))
1843 {
1845 AllocateSharedPtr(Ba, Bb, Bc, PrismGeom);
1846 }
1847 else if ((PyrGeom = std::dynamic_pointer_cast<
1848 SpatialDomains::PyrGeom>(
1849 expInfo->m_geomShPtr)))
1850 {
1851 exp = MemoryManager<
1852 LocalRegions::PyrExp>::AllocateSharedPtr(Ba, Bb, Bc,
1853 PyrGeom);
1854 }
1855 else if ((HexGeom = std::dynamic_pointer_cast<
1856 SpatialDomains::HexGeom>(
1857 expInfo->m_geomShPtr)))
1858 {
1859 exp = MemoryManager<
1860 LocalRegions::HexExp>::AllocateSharedPtr(Ba, Bb, Bc,
1861 HexGeom);
1862 }
1863 else
1864 {
1866 "dynamic cast to a Geom failed");
1867 }
1868 }
1869 break;
1870 default:
1872 "Dimension of basis key is greater than 3");
1873 }
1874
1875 // Assign next id
1876 m_elmtToExpId[exp->GetGeom()->GetGlobalID()] = id;
1877 exp->SetElmtId(id++);
1878
1879 // Add the expansion
1880 (*m_exp).push_back(exp);
1881 }
1882 }
1883}
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
Definition: BasisType.h:57
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:42
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
Definition: PrismGeom.h:82
std::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:84
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:75
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:82

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL1, Nektar::MultiRegions::e1D, Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, Nektar::ErrorUtil::efatal, Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eNodalTriElec, Nektar::MultiRegions::eNoType, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::BasisKey::GetBasisType(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetPointsKey(), m_elmtToExpId, m_expType, m_session, and NEKERROR.

Referenced by ExpList().

◆ Integral() [1/2]

NekDouble Nektar::MultiRegions::ExpList::Integral ( )
inline

Calculates the \(H^1\) error of the global spectral/hp element approximation.

The integration is evaluated locally, that is

\[\int f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}} \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \]

where the integration over the separate elements is done by the function StdRegions::StdExpansion::Integral, which discretely evaluates the integral using Gaussian quadrature.

Note that the array m_phys should be filled with the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).

Returns
The value of the discretely evaluated integral \(\int f(\boldsymbol{x})d\boldsymbol{x}\).

Definition at line 543 of file ExpList.h.

544 {
545 ASSERTL1(m_physState == true, "local physical space is not true ");
546 return Integral(m_phys);
547 }
NekDouble Integral()
Calculates the error of the global spectral/hp element approximation.
Definition: ExpList.h:543

References ASSERTL1, Integral(), m_phys, and m_physState.

Referenced by Integral().

◆ Integral() [2/2]

NekDouble Nektar::MultiRegions::ExpList::Integral ( const Array< OneD, const NekDouble > &  inarray)
inline

The integration is evaluated locally, that is

\[\int f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}} \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \]

where the integration over the separate elements is done by the function StdRegions::StdExpansion::Integral, which discretely evaluates the integral using Gaussian quadrature.

Parameters
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
Returns
The value of the discretely evaluated integral \(\int f(\boldsymbol{x})d\boldsymbol{x}\).

Definition at line 564 of file ExpList.h.

565 {
566 return v_Integral(inarray);
567 }
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:3898

References v_Integral().

◆ IProductWRTBase()

void Nektar::MultiRegions::ExpList::IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function calculates the inner product of a function \(f(\boldsymbol{x})\) with respect to all local expansion modes \(\phi_n^e(\boldsymbol{x})\).

Definition at line 1650 of file ExpList.h.

1653{
1654 v_IProductWRTBase(inarray, outarray);
1655}
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5392

References v_IProductWRTBase().

Referenced by Nektar::MultiRegions::ContField::LaplaceSolve(), MultiplyByMassMatrix(), Nektar::MultiRegions::ContField::v_FwdTrans(), v_FwdTransLocalElmt(), Nektar::MultiRegions::ContField::v_HelmSolve(), Nektar::MultiRegions::DisContField::v_HelmSolve(), Nektar::MultiRegions::ContField::v_LinearAdvectionDiffusionReactionSolve(), Nektar::MultiRegions::ContField::v_LinearAdvectionReactionSolve(), and Nektar::MultiRegions::ContField::v_SmoothField().

◆ IProductWRTDerivBase() [1/2]

void Nektar::MultiRegions::ExpList::IProductWRTDerivBase ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function calculates the inner product of a function \(f(\boldsymbol{x})\) with respect to the derivative of all local expansion modes \(\phi_n^e(\boldsymbol{x})\).

Definition at line 1669 of file ExpList.h.

1672{
1673 v_IProductWRTDerivBase(inarray, outarray);
1674}
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1969

References v_IProductWRTDerivBase().

◆ IProductWRTDerivBase() [2/2]

void Nektar::MultiRegions::ExpList::IProductWRTDerivBase ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function calculates the inner product of a function \(f(\boldsymbol{x})\) with respect to the derivative (in direction.

Parameters
dir)of all local expansion modes \(\phi_n^e(\boldsymbol{x})\).

Definition at line 1659 of file ExpList.h.

1662{
1663 v_IProductWRTDerivBase(dir, inarray, outarray);
1664}

References v_IProductWRTDerivBase().

◆ IProductWRTDirectionalDerivBase()

void Nektar::MultiRegions::ExpList::IProductWRTDirectionalDerivBase ( const Array< OneD, const NekDouble > &  direction,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

Directional derivative along a given direction.

Definition at line 1988 of file ExpList.cpp.

1992{
1993 int npts_e;
1994 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1995 int nq = direction.size() / coordim;
1996
1997 Array<OneD, NekDouble> e_outarray;
1998 Array<OneD, NekDouble> e_MFdiv;
1999
2000 Array<OneD, NekDouble> locdir;
2001
2002 for (int i = 0; i < (*m_exp).size(); ++i)
2003 {
2004 npts_e = (*m_exp)[i]->GetTotPoints();
2005 locdir = Array<OneD, NekDouble>(npts_e * coordim);
2006
2007 for (int k = 0; k < coordim; ++k)
2008 {
2009 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
2010 &locdir[k * npts_e], 1);
2011 }
2012
2013 (*m_exp)[i]->IProductWRTDirectionalDerivBase(
2014 locdir, inarray + m_phys_offset[i],
2015 e_outarray = outarray + m_coeff_offset[i]);
2016 }
2017}

References m_coeff_offset, m_phys_offset, and Vmath::Vcopy().

◆ L2()

NekDouble Nektar::MultiRegions::ExpList::L2 ( const Array< OneD, const NekDouble > &  inarray,
const Array< OneD, const NekDouble > &  soln = NullNekDouble1DArray 
)
inline

This function calculates the \(L_\infty\) error of the global This function calculates the \(L_2\) error with respect to soln of the global spectral/hp element approximation.

Definition at line 514 of file ExpList.h.

517 {
518 return v_L2(inarray, soln);
519 }
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:3853

References v_L2().

Referenced by Nektar::MultiRegions::DisContField::L2_DGDeriv(), and Nektar::MultiRegions::ExpList3DHomogeneous2D::v_L2().

◆ LinearAdvectionDiffusionReactionSolve()

GlobalLinSysKey Nektar::MultiRegions::ExpList::LinearAdvectionDiffusionReactionSolve ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::ConstFactorMap factors,
const StdRegions::VarCoeffMap varcoeff = StdRegions::NullVarCoeffMap,
const MultiRegions::VarFactorsMap varfactors = MultiRegions::NullVarFactorsMap,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray,
const bool  PhysSpaceForcing = true 
)
inline

Solve Advection Diffusion Reaction.

Definition at line 1747 of file ExpList.h.

1753{
1755 inarray, outarray, factors, varcoeff, varfactors, dirForcing,
1756 PhysSpaceForcing);
1757}
virtual GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Definition: ExpList.cpp:5193

References Nektar::VarcoeffHashingTest::factors, and v_LinearAdvectionDiffusionReactionSolve().

◆ LinearAdvectionReactionSolve()

void Nektar::MultiRegions::ExpList::LinearAdvectionReactionSolve ( const Array< OneD, Array< OneD, NekDouble > > &  velocity,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const NekDouble  lambda,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray 
)
inline

Solve Advection Diffusion Reaction.

Definition at line 1758 of file ExpList.h.

1763{
1764 v_LinearAdvectionReactionSolve(velocity, inarray, outarray, lambda,
1765 dirForcing);
1766}
virtual void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:5207

References v_LinearAdvectionReactionSolve().

◆ Linf()

NekDouble Nektar::MultiRegions::ExpList::Linf ( const Array< OneD, const NekDouble > &  inarray,
const Array< OneD, const NekDouble > &  soln = NullNekDouble1DArray 
)

This function calculates the \(L_\infty\) error of the global spectral/hp element approximation.

Given a spectral/hp approximation \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points (which should be contained in m_phys), this function calculates the \(L_\infty\) error of this approximation with respect to an exact solution. The local distribution of the quadrature points allows an elemental evaluation of this operation through the functions StdRegions::StdExpansion::Linf.

The exact solution, also evaluated at the quadrature points, should be contained in the variable m_phys of the ExpList object Sol.

Parameters
solnA 1D array, containing the discrete evaluation of the exact solution at the quadrature points in its array m_phys.
Returns
The \(L_\infty\) error of the approximation.

Definition at line 3815 of file ExpList.cpp.

3817{
3818 NekDouble err = 0.0;
3819
3820 if (soln == NullNekDouble1DArray)
3821 {
3822 err = Vmath::Vmax(m_npoints, inarray, 1);
3823 }
3824 else
3825 {
3826 for (int i = 0; i < m_npoints; ++i)
3827 {
3828 err = max(err, abs(inarray[i] - soln[i]));
3829 }
3830 }
3831
3832 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
3833
3834 return err;
3835}
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.hpp:644
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:298

References tinysimd::abs(), m_comm, m_npoints, Nektar::NullNekDouble1DArray, Nektar::LibUtilities::ReduceMax, and Vmath::Vmax().

◆ LocalToGlobal() [1/2]

void Nektar::MultiRegions::ExpList::LocalToGlobal ( bool  useComm = true)
inline

Gathers the global coefficients \(\boldsymbol{\hat{u}}_g\) from the local coefficients \(\boldsymbol{\hat{u}}_l\).

Definition at line 1961 of file ExpList.h.

1962{
1963 v_LocalToGlobal(useComm);
1964}
virtual void v_LocalToGlobal(bool UseComm)
Definition: ExpList.cpp:5346

References v_LocalToGlobal().

◆ LocalToGlobal() [2/2]

void Nektar::MultiRegions::ExpList::LocalToGlobal ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  useComm = true 
)
inline

Definition at line 1965 of file ExpList.h.

1968{
1969 v_LocalToGlobal(inarray, outarray, useComm);
1970}

References v_LocalToGlobal().

◆ MultiplyByBlockMatrix()

void Nektar::MultiRegions::ExpList::MultiplyByBlockMatrix ( const GlobalMatrixKey gkey,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protected

Retrieves the block matrix specified by bkey, and computes \( y=Mx \).

Parameters
gkeyGlobalMatrixKey specifying the block matrix to use in the matrix-vector multiply.
inarrayInput vector \( x \).
outarrayOutput vector \( y \).

Definition at line 1905 of file ExpList.cpp.

1908{
1909 // Retrieve the block matrix using the given key.
1910 const DNekScalBlkMatSharedPtr &blockmat = GetBlockMatrix(gkey);
1911 int nrows = blockmat->GetRows();
1912 int ncols = blockmat->GetColumns();
1913
1914 // Create NekVectors from the given data arrays
1915 NekVector<NekDouble> in(ncols, inarray, eWrapper);
1916 NekVector<NekDouble> out(nrows, outarray, eWrapper);
1917
1918 // Perform matrix-vector multiply.
1919 out = (*blockmat) * in;
1920}
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:2652

References Nektar::eWrapper, and GetBlockMatrix().

◆ MultiplyByElmtInvMass()

void Nektar::MultiRegions::ExpList::MultiplyByElmtInvMass ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

This function elementally mulplies the coefficient space of Sin my the elemental inverse of the mass matrix.

The coefficients of the function to be acted upon should be contained in the

Parameters
inarray.The resulting coefficients are stored in
outarray
inarrayAn array of size \(N_{\mathrm{eof}}\) containing the inner product.

Definition at line 2408 of file ExpList.cpp.

2410{
2411 GlobalMatrixKey mkey(StdRegions::eInvMass);
2412 const DNekScalBlkMatSharedPtr &InvMass = GetBlockMatrix(mkey);
2413
2414 // Inverse mass matrix
2415 NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
2416 if (inarray.get() == outarray.get())
2417 {
2418 NekVector<NekDouble> in(m_ncoeffs, inarray); // copy data
2419 out = (*InvMass) * in;
2420 }
2421 else
2422 {
2423 NekVector<NekDouble> in(m_ncoeffs, inarray, eWrapper);
2424 out = (*InvMass) * in;
2425 }
2426}

References Nektar::StdRegions::eInvMass, Nektar::eWrapper, GetBlockMatrix(), and m_ncoeffs.

Referenced by v_FwdTransLocalElmt().

◆ MultiplyByInvMassMatrix()

void Nektar::MultiRegions::ExpList::MultiplyByInvMassMatrix ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1725 of file ExpList.h.

1728{
1729 v_MultiplyByInvMassMatrix(inarray, outarray);
1730}
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5172

References v_MultiplyByInvMassMatrix().

Referenced by Nektar::MultiRegions::ContField::v_SmoothField().

◆ MultiplyByMassMatrix()

void Nektar::MultiRegions::ExpList::MultiplyByMassMatrix ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 299 of file ExpList.h.

302 {
303 Array<OneD, NekDouble> tmp(GetNpoints(), 0.0);
304 BwdTrans(inarray, tmp);
305 IProductWRTBase(tmp, outarray);
306 }
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all local expansion modes .
Definition: ExpList.h:1650
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1588
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the backward transformation of the global spectral/hp element exp...
Definition: ExpList.h:1717

References BwdTrans(), GetNpoints(), and IProductWRTBase().

◆ MultiplyByQuadratureMetric()

void Nektar::MultiRegions::ExpList::MultiplyByQuadratureMetric ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

multiply the metric jacobi and quadrature weights

multiply the metric jacobi and quadrature weights

Definition at line 1925 of file ExpList.cpp.

1928{
1929 Array<OneD, NekDouble> e_outarray;
1930
1931 for (int i = 0; i < (*m_exp).size(); ++i)
1932 {
1933 (*m_exp)[i]->MultiplyByQuadratureMetric(inarray + m_phys_offset[i],
1934 e_outarray = outarray +
1935 m_phys_offset[i]);
1936 }
1937}

References m_phys_offset.

◆ NormVectorIProductWRTBase() [1/2]

void Nektar::MultiRegions::ExpList::NormVectorIProductWRTBase ( Array< OneD, Array< OneD, NekDouble > > &  V,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1894 of file ExpList.h.

1896{
1897 v_NormVectorIProductWRTBase(V, outarray);
1898}
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:5267

References v_NormVectorIProductWRTBase().

◆ NormVectorIProductWRTBase() [2/2]

void Nektar::MultiRegions::ExpList::NormVectorIProductWRTBase ( Array< OneD, const NekDouble > &  V1,
Array< OneD, const NekDouble > &  V2,
Array< OneD, NekDouble > &  outarray,
int  BndID 
)
inline

Definition at line 1887 of file ExpList.h.

1891{
1892 v_NormVectorIProductWRTBase(V1, V2, outarray, BndID);
1893}

References v_NormVectorIProductWRTBase().

◆ PeriodicBwdCopy()

void Nektar::MultiRegions::ExpList::PeriodicBwdCopy ( const Array< OneD, const NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
inline

Copy and fill the Periodic boundaries.

Definition at line 2221 of file ExpList.h.

2223{
2224 v_PeriodicBwdCopy(Fwd, Bwd);
2225}
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:5691

References v_PeriodicBwdCopy().

◆ PhysDeriv() [1/3]

void Nektar::MultiRegions::ExpList::PhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1 = NullNekDouble1DArray,
Array< OneD, NekDouble > &  out_d2 = NullNekDouble1DArray 
)
inline

This function discretely evaluates the derivative of a function \(f(\boldsymbol{x})\) on the domain consisting of all elements of the expansion.

Definition at line 1797 of file ExpList.h.

1801{
1802 v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
1803}
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
Definition: ExpList.cpp:2142

References v_PhysDeriv().

◆ PhysDeriv() [2/3]

void Nektar::MultiRegions::ExpList::PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d 
)
inline

Definition at line 1807 of file ExpList.h.

1810{
1811 v_PhysDeriv(dir, inarray, out_d);
1812}

References v_PhysDeriv().

◆ PhysDeriv() [3/3]

void Nektar::MultiRegions::ExpList::PhysDeriv ( Direction  edir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d 
)
inline

Definition at line 1813 of file ExpList.h.

1816{
1817 v_PhysDeriv(edir, inarray, out_d);
1818}

References v_PhysDeriv().

Referenced by v_Curl(), and v_CurlCurl().

◆ PhysDirectionalDeriv()

void Nektar::MultiRegions::ExpList::PhysDirectionalDeriv ( const Array< OneD, const NekDouble > &  direction,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1822 of file ExpList.h.

1826{
1827 v_PhysDirectionalDeriv(direction, inarray, outarray);
1828}
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2357

References v_PhysDirectionalDeriv().

◆ PhysEvaluate()

NekDouble Nektar::MultiRegions::ExpList::PhysEvaluate ( const Array< OneD, const NekDouble > &  coords,
const Array< OneD, const NekDouble > &  phys 
)

This function return the expansion field value at the coordinates given as input.

Given some coordinates, output the expansion field value at that point

Definition at line 3297 of file ExpList.cpp.

3299{
3300 int dim = GetCoordim(0);
3301 ASSERTL0(dim == coords.size(), "Invalid coordinate dimension.");
3302
3303 // Grab the element index corresponding to coords.
3304 Array<OneD, NekDouble> xi(dim);
3305 int elmtIdx = GetExpIndex(coords, xi);
3306 ASSERTL0(elmtIdx > 0, "Unable to find element containing point.");
3307
3308 // Grab that element's physical storage.
3309 Array<OneD, NekDouble> elmtPhys = phys + m_phys_offset[elmtIdx];
3310
3311 // Evaluate the element at the appropriate point.
3312 return (*m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
3313}

References ASSERTL0, GetCoordim(), GetExpIndex(), m_exp, and m_phys_offset.

◆ PhysGalerkinProjection1DScaled()

void Nektar::MultiRegions::ExpList::PhysGalerkinProjection1DScaled ( const NekDouble  scale,
const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function Galerkin projects the physical space points in inarray to outarray where inarray is assumed to be defined in the expansion but where the number of points are rescaled by 1DScale.

Definition at line 640 of file ExpList.h.

643 {
644 v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
645 }
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:6602

References v_PhysGalerkinProjection1DScaled().

◆ PhysInterp1DScaled()

void Nektar::MultiRegions::ExpList::PhysInterp1DScaled ( const NekDouble  scale,
const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

This function interpolates the physical space points in inarray to outarray using the same points defined in the expansion but where the number of points are rescaled by 1DScale.

Definition at line 629 of file ExpList.h.

632 {
633 v_PhysInterp1DScaled(scale, inarray, outarray);
634 }
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5981

References v_PhysInterp1DScaled().

◆ Reset()

void Nektar::MultiRegions::ExpList::Reset ( )
inline

Reset geometry information and reset matrices.

Definition at line 387 of file ExpList.h.

388 {
389 v_Reset();
390 }
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:3332

References v_Reset().

◆ ResetMatrices()

void Nektar::MultiRegions::ExpList::ResetMatrices ( )

Reset matrices.

Definition at line 3360 of file ExpList.cpp.

3361{
3362 // Reset matrix managers.
3363 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3364 LocalRegions::MatrixKey::opLess>::ClearManager();
3365 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3366 LocalRegions::MatrixKey::opLess>::ClearManager();
3367
3368 // Reset block matrix map
3369 m_blockMat->clear();
3370}
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
Definition: NekTypeDefs.hpp:68
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat

References m_blockMat.

◆ SetBndCondBwdWeight()

void Nektar::MultiRegions::ExpList::SetBndCondBwdWeight ( const int  index,
const NekDouble  value 
)
inline

Set the weight value for boundary conditions.

Definition at line 2131 of file ExpList.h.

2132{
2133 v_SetBndCondBwdWeight(index, value);
2134}
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
Definition: ExpList.cpp:5142

References v_SetBndCondBwdWeight().

◆ SetCoeff()

void Nektar::MultiRegions::ExpList::SetCoeff ( int  i,
NekDouble  val 
)
inline

Set the i th coefficiient in m_coeffs to value val.

Parameters
iThe index of m_coeffs to be set
valThe value which m_coeffs[i] is to be set to.

Definition at line 1920 of file ExpList.h.

1921{
1922 m_coeffs[i] = val;
1923}

References m_coeffs.

◆ SetCoeffs()

void Nektar::MultiRegions::ExpList::SetCoeffs ( int  i,
NekDouble  val 
)
inline

Set the i th coefficiient in m_coeffs to value val.

Parameters
iThe index of m_coeffs to be set.
valThe value which m_coeffs[i] is to be set to.

Definition at line 1928 of file ExpList.h.

1929{
1930 m_coeffs[i] = val;
1931}

References m_coeffs.

◆ SetCoeffsArray()

void Nektar::MultiRegions::ExpList::SetCoeffsArray ( Array< OneD, NekDouble > &  inarray)
inline

Set the m_coeffs array to inarray.

Definition at line 1932 of file ExpList.h.

1933{
1934 m_coeffs = inarray;
1935}

References m_coeffs.

◆ SetExpType()

void Nektar::MultiRegions::ExpList::SetExpType ( ExpansionType  Type)

Returns the type of the expansion.

◆ SetHomo1DSpecVanVisc()

void Nektar::MultiRegions::ExpList::SetHomo1DSpecVanVisc ( Array< OneD, NekDouble visc)
inline

This function sets the Spectral Vanishing Viscosity in homogeneous1D expansion.

Definition at line 581 of file ExpList.h.

582 {
584 }
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1472

References v_SetHomo1DSpecVanVisc().

◆ SetHomoLen()

void Nektar::MultiRegions::ExpList::SetHomoLen ( const NekDouble  lhom)
inline

This function sets the Width of homogeneous direction associated with the homogeneous expansion.

Definition at line 611 of file ExpList.h.

612 {
613 return v_SetHomoLen(lhom);
614 }
virtual void v_SetHomoLen(const NekDouble lhom)
Definition: ExpList.cpp:3956

References v_SetHomoLen().

◆ SetModifiedBasis()

void Nektar::MultiRegions::ExpList::SetModifiedBasis ( const bool  modbasis)
inline

Set Modified Basis for the stability analysis.

◆ SetPhys() [1/2]

void Nektar::MultiRegions::ExpList::SetPhys ( const Array< OneD, const NekDouble > &  inarray)
inline

Fills the array m_phys.

This function fills the array \(\boldsymbol{u}_l\), the evaluation of the expansion at the quadrature points (implemented as m_phys), with the values of the array inarray.

Parameters
inarrayThe array containing the values where m_phys should be filled with.

Definition at line 1622 of file ExpList.h.

1623{
1624 ASSERTL0((int)inarray.size() == m_npoints,
1625 "Input array does not have correct number of elements.");
1626 Vmath::Vcopy(m_npoints, &inarray[0], 1, &m_phys[0], 1);
1627 m_physState = true;
1628}

References ASSERTL0, m_npoints, m_phys, m_physState, and Vmath::Vcopy().

◆ SetPhys() [2/2]

void Nektar::MultiRegions::ExpList::SetPhys ( int  i,
NekDouble  val 
)
inline

Set the i th value of m_phys to value val.

Set the i th value ofm_phys to value val.

Definition at line 1610 of file ExpList.h.

1611{
1612 m_phys[i] = val;
1613}

References m_phys.

◆ SetPhysArray()

void Nektar::MultiRegions::ExpList::SetPhysArray ( Array< OneD, NekDouble > &  inarray)
inline

Sets the array m_phys.

Definition at line 1629 of file ExpList.h.

1630{
1631 m_phys = inarray;
1632}

References m_phys.

◆ SetPhysState()

void Nektar::MultiRegions::ExpList::SetPhysState ( const bool  physState)
inline

This function manually sets whether the array of physical values \(\boldsymbol{u}_l\) (implemented as m_phys) is filled or not.

Parameters
physStatetrue (=filled) or false (=not filled).

Definition at line 1636 of file ExpList.h.

1637{
1638 m_physState = physState;
1639}

References m_physState.

◆ SetupCoeffPhys()

void Nektar::MultiRegions::ExpList::SetupCoeffPhys ( bool  DeclareCoeffPhysArrays = true,
bool  SetupOffsets = true 
)
private

Definition of the total number of degrees of freedom and quadrature points and offsets to access data.

Each expansion (local element) is processed in turn to determine the number of coefficients and physical data points it contributes to the domain. Two arrays, m_coeff_offset are m_phys_offset are also initialised and updated to store the data offsets of each element in the m_coeffs and m_phys arrays, and the element id that each consecutive block is associated respectively. Finally we initialise m_coeffs and m_phys

Definition at line 1615 of file ExpList.cpp.

1616{
1617 if (SetupOffsets)
1618 {
1619 int i;
1620
1621 // Set up offset information and array sizes
1622 m_coeff_offset = Array<OneD, int>(m_exp->size());
1623 m_phys_offset = Array<OneD, int>(m_exp->size());
1624
1625 m_ncoeffs = m_npoints = 0;
1626
1627 for (i = 0; i < m_exp->size(); ++i)
1628 {
1631 m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
1632 m_npoints += (*m_exp)[i]->GetTotPoints();
1633 }
1634 }
1635
1636 if (DeclareCoeffPhysArrays)
1637 {
1638 m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
1639 m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
1640 }
1641
1642 m_coeffsToElmt = Array<OneD, pair<int, int>>{size_t(m_ncoeffs)};
1643
1644 for (int i = 0; i < m_exp->size(); ++i)
1645 {
1646 int coeffs_offset = m_coeff_offset[i];
1647
1648 int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1649
1650 for (int j = 0; j < loccoeffs; ++j)
1651 {
1652 m_coeffsToElmt[coeffs_offset + j].first = i;
1653 m_coeffsToElmt[coeffs_offset + j].second = j;
1654 }
1655 }
1656}

References m_coeff_offset, m_coeffs, m_coeffsToElmt, m_exp, m_ncoeffs, m_npoints, m_phys, and m_phys_offset.

Referenced by ExpList().

◆ SetUpPhysNormals()

void Nektar::MultiRegions::ExpList::SetUpPhysNormals ( )
inline

Definition at line 2257 of file ExpList.h.

2258{
2260}
virtual void v_SetUpPhysNormals()
: Set up a normal along the trace elements between two elements at elemental level
Definition: ExpList.cpp:5496

References v_SetUpPhysNormals().

Referenced by Nektar::MultiRegions::DisContField::DisContField(), Nektar::MultiRegions::DisContField::GenerateBoundaryConditionExpansion(), and Nektar::MultiRegions::DisContField::SetUpDG().

◆ SetWaveSpace()

void Nektar::MultiRegions::ExpList::SetWaveSpace ( const bool  wavespace)
inline

Sets the wave space to the one of the possible configuration true or false.

Definition at line 1596 of file ExpList.h.

1597{
1598 m_WaveSpace = wavespace;
1599}

References m_WaveSpace.

◆ SmoothField()

void Nektar::MultiRegions::ExpList::SmoothField ( Array< OneD, NekDouble > &  field)
inline

Smooth a field across elements.

Definition at line 1705 of file ExpList.h.

1706{
1708}
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:2478

References FilterPython_Function::field, and v_SmoothField().

◆ UnsetGlobalLinSys()

void Nektar::MultiRegions::ExpList::UnsetGlobalLinSys ( GlobalLinSysKey  key,
bool  clearLocalMatrices 
)

Definition at line 5970 of file ExpList.cpp.

5971{
5972 v_UnsetGlobalLinSys(key, clearLocalMatrices);
5973}
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:3990

References v_UnsetGlobalLinSys().

◆ UpdateBndCondExpansion()

std::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::UpdateBndCondExpansion ( int  i)
inline

Definition at line 2135 of file ExpList.h.

2136{
2137 return v_UpdateBndCondExpansion(i);
2138}
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:4481

References v_UpdateBndCondExpansion().

◆ UpdateBndConditions()

Array< OneD, SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::UpdateBndConditions ( )
inline

Definition at line 2245 of file ExpList.h.

2247{
2248 return v_UpdateBndConditions();
2249}
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:5712

References v_UpdateBndConditions().

◆ UpdateCoeffs()

Array< OneD, NekDouble > & Nektar::MultiRegions::ExpList::UpdateCoeffs ( void  )
inline

This function returns (a reference to) the array \(\boldsymbol{\hat{u}}_l\) (implemented as m_coeffs) containing all local expansion coefficients.

If one wants to get hold of the underlying data without modifying them, rather use the function GetCoeffs instead.

Returns
(A reference to) the array m_coeffs.

Definition at line 2095 of file ExpList.h.

2096{
2097 return m_coeffs;
2098}

References m_coeffs.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous2D::v_EvaluateBoundaryConditions().

◆ UpdatePhys()

Array< OneD, NekDouble > & Nektar::MultiRegions::ExpList::UpdatePhys ( void  )
inline

This function returns (a reference to) the array \(\boldsymbol{u}_l\) (implemented as m_phys) containing the function \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points.

If one wants to get hold of the underlying data without modifying them, rather use the function GetPhys instead.

Returns
(A reference to) the array m_phys.

Definition at line 2105 of file ExpList.h.

2106{
2107 m_physState = true;
2108 return m_phys;
2109}

References m_phys, and m_physState.

◆ Upwind() [1/2]

void Nektar::MultiRegions::ExpList::Upwind ( const Array< OneD, const Array< OneD, NekDouble > > &  Vec,
const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  Upwind 
)
inline

Definition at line 2139 of file ExpList.h.

2143{
2144 v_Upwind(Vec, Fwd, Bwd, Upwind);
2145}
virtual void v_Upwind(const Array< OneD, const Array< OneD, NekDouble > > &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Definition: ExpList.cpp:4500
void Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Definition: ExpList.h:2146

References Upwind(), and v_Upwind().

◆ Upwind() [2/2]

void Nektar::MultiRegions::ExpList::Upwind ( const Array< OneD, const NekDouble > &  Vn,
const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  Upwind 
)
inline

Definition at line 2146 of file ExpList.h.

2150{
2151 v_Upwind(Vn, Fwd, Bwd, Upwind);
2152}

References Upwind(), and v_Upwind().

Referenced by Upwind(), and v_Upwind().

◆ v_AddFwdBwdTraceIntegral()

void Nektar::MultiRegions::ExpList::v_AddFwdBwdTraceIntegral ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5071 of file ExpList.cpp.

5075{
5077 "This method is not defined or valid for this class type");
5078}

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

Referenced by AddFwdBwdTraceIntegral().

◆ v_AddTraceIntegral()

void Nektar::MultiRegions::ExpList::v_AddTraceIntegral ( const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5063 of file ExpList.cpp.

5066{
5068 "This method is not defined or valid for this class type");
5069}

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

Referenced by AddTraceIntegral().

◆ v_AddTraceIntegralToOffDiag()

void Nektar::MultiRegions::ExpList::v_AddTraceIntegralToOffDiag ( const Array< OneD, const NekDouble > &  FwdFlux,
const Array< OneD, const NekDouble > &  BwdFlux,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 6030 of file ExpList.cpp.

6034{
6035 NEKERROR(ErrorUtil::efatal, "AddTraceIntegralToOffDiag not defined");
6036}

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

Referenced by AddTraceIntegralToOffDiag().

◆ v_AddTraceQuadPhysToField()

void Nektar::MultiRegions::ExpList::v_AddTraceQuadPhysToField ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  field 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5106 of file ExpList.cpp.

5110{
5112 "v_AddTraceQuadPhysToField is not defined for this class type");
5113}

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

Referenced by AddTraceQuadPhysToField().

◆ v_AddTraceQuadPhysToOffDiag()

void Nektar::MultiRegions::ExpList::v_AddTraceQuadPhysToOffDiag ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  field 
)
protectedvirtual

Definition at line 5115 of file ExpList.cpp.

5119{
5121 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
5122}

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

Referenced by AddTraceQuadPhysToOffDiag().

◆ v_AppendFieldData() [1/2]

void Nektar::MultiRegions::ExpList::v_AppendFieldData ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 4205 of file ExpList.cpp.

4208{
4209 v_AppendFieldData(fielddef, fielddata, m_coeffs);
4210}

References m_coeffs, and v_AppendFieldData().

Referenced by AppendFieldData(), and v_AppendFieldData().

◆ v_AppendFieldData() [2/2]

void Nektar::MultiRegions::ExpList::v_AppendFieldData ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata,
Array< OneD, NekDouble > &  coeffs 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 4212 of file ExpList.cpp.

4215{
4216 int i;
4217 // Determine mapping from element ids to location in
4218 // expansion list
4219 // Determine mapping from element ids to location in
4220 // expansion list
4221 map<int, int> ElmtID_to_ExpID;
4222 for (i = 0; i < (*m_exp).size(); ++i)
4223 {
4224 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
4225 }
4226
4227 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
4228 {
4229 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
4230 int datalen = (*m_exp)[eid]->GetNcoeffs();
4231 fielddata.insert(fielddata.end(), &coeffs[m_coeff_offset[eid]],
4232 &coeffs[m_coeff_offset[eid]] + datalen);
4233 }
4234}

References m_coeff_offset.

◆ v_BwdTrans()

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

Given the elemental coefficients \(\hat{u}_n^e\) of an expansion, this function evaluates the spectral/hp expansion \(u^{\delta}(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\). The operation is evaluated locally by the elemental function StdRegions::StdExpansion::BwdTrans.

Parameters
inarrayAn array of size \(N_{\mathrm{eof}}\) containing the local coefficients \(\hat{u}_n^e\).
outarrayThe resulting physical values at the quadrature points \(u^{\delta}(\boldsymbol{x}_i)\) will be stored in this array of size \(Q_{\mathrm{tot}}\).

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 3125 of file ExpList.cpp.

3127{
3128 LibUtilities::Timer timer;
3129
3130 if (m_expType == e0D)
3131 {
3132 Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
3133 }
3134 else
3135 {
3136 // initialise if required
3138 {
3139 for (int i = 0; i < m_collections.size(); ++i)
3140 {
3142 }
3144 }
3145
3146 LIKWID_MARKER_START("v_BwdTrans");
3147 timer.Start();
3148
3149 Array<OneD, NekDouble> tmp;
3150 int input_offset{0};
3151 int output_offset{0};
3152 for (int i = 0; i < m_collections.size(); ++i)
3153 {
3154 m_collections[i].ApplyOperator(Collections::eBwdTrans,
3155 inarray + input_offset,
3156 tmp = outarray + output_offset);
3157 input_offset +=
3158 m_collections[i].GetInputSize(Collections::eBwdTrans);
3159 output_offset +=
3160 m_collections[i].GetOutputSize(Collections::eBwdTrans);
3161 }
3162
3163 timer.Stop();
3164 LIKWID_MARKER_STOP("v_BwdTrans");
3165 }
3166 // Elapsed time
3167 timer.AccumulateRegion("Collections:BwdTrans", 10);
3168}
#define LIKWID_MARKER_START(regionTag)
Definition: Likwid.hpp:46
#define LIKWID_MARKER_STOP(regionTag)
Definition: Likwid.hpp:47

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MultiRegions::e0D, Nektar::Collections::eBwdTrans, LIKWID_MARKER_START, LIKWID_MARKER_STOP, m_collections, m_collectionsDoInit, m_expType, m_ncoeffs, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

Referenced by BwdTrans().

◆ v_ClearGlobalLinSysManager()

void Nektar::MultiRegions::ExpList::v_ClearGlobalLinSysManager ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField3DHomogeneous2D.

Definition at line 3978 of file ExpList.cpp.

3979{
3981 "ClearGlobalLinSysManager not implemented for ExpList.");
3982}

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

Referenced by ClearGlobalLinSysManager().

◆ v_Curl()

void Nektar::MultiRegions::ExpList::v_Curl ( Array< OneD, Array< OneD, NekDouble > > &  Vel,
Array< OneD, Array< OneD, NekDouble > > &  Q 
)
protectedvirtual

Definition at line 2240 of file ExpList.cpp.

2242{
2243 int nq = GetTotPoints();
2244 Array<OneD, NekDouble> Vx(nq);
2245 Array<OneD, NekDouble> Uy(nq);
2246 Array<OneD, NekDouble> Dummy(nq);
2247
2248 switch (m_expType)
2249 {
2250 case e2D:
2251 {
2252 PhysDeriv(xDir, Vel[yDir], Vx);
2253 PhysDeriv(yDir, Vel[xDir], Uy);
2254
2255 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[0], 1);
2256 }
2257 break;
2258
2259 case e3D:
2260 {
2261 Array<OneD, NekDouble> Vz(nq);
2262 Array<OneD, NekDouble> Uz(nq);
2263 Array<OneD, NekDouble> Wx(nq);
2264 Array<OneD, NekDouble> Wy(nq);
2265
2266 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
2267 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
2268 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
2269
2270 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2271 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2272 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2273 }
2274 break;
2275 default:
2276 ASSERTL0(0, "Dimension not supported by ExpList::Curl");
2277 break;
2278 }
2279}
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition: ExpList.h:1813
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.hpp:220

References ASSERTL0, Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, GetTotPoints(), m_expType, PhysDeriv(), Vmath::Vsub(), Nektar::xDir, Nektar::yDir, and Nektar::zDir.

◆ v_CurlCurl()

void Nektar::MultiRegions::ExpList::v_CurlCurl ( Array< OneD, Array< OneD, NekDouble > > &  Vel,
Array< OneD, Array< OneD, NekDouble > > &  Q 
)
protectedvirtual

Definition at line 2289 of file ExpList.cpp.

2291{
2292 int nq = GetTotPoints();
2293 Array<OneD, NekDouble> Vx(nq);
2294 Array<OneD, NekDouble> Uy(nq);
2295 Array<OneD, NekDouble> Dummy(nq);
2296
2297 bool halfMode = false;
2298 if (GetExpType() == e3DH1D)
2299 {
2300 m_session->MatchSolverInfo("ModeType", "HalfMode", halfMode, false);
2301 }
2302
2303 switch (m_expType)
2304 {
2305 case e2D:
2306 {
2307 PhysDeriv(xDir, Vel[yDir], Vx);
2308 PhysDeriv(yDir, Vel[xDir], Uy);
2309
2310 Vmath::Vsub(nq, Vx, 1, Uy, 1, Dummy, 1);
2311
2312 PhysDeriv(Dummy, Q[1], Q[0]);
2313
2314 Vmath::Smul(nq, -1.0, Q[1], 1, Q[1], 1);
2315 }
2316 break;
2317
2318 case e3D:
2319 case e3DH1D:
2320 case e3DH2D:
2321 {
2322 Array<OneD, NekDouble> Vz(nq);
2323 Array<OneD, NekDouble> Uz(nq);
2324 Array<OneD, NekDouble> Wx(nq);
2325 Array<OneD, NekDouble> Wy(nq);
2326
2327 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
2328 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
2329 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
2330
2331 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2332 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2333 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2334
2335 PhysDeriv(Q[0], Dummy, Uy, Uz);
2336 PhysDeriv(Q[1], Vx, Dummy, Vz);
2337 PhysDeriv(Q[2], Wx, Wy, Dummy);
2338
2339 // For halfmode, need to change the sign of z derivatives
2340 if (halfMode)
2341 {
2342 Vmath::Neg(nq, Uz, 1);
2343 Vmath::Neg(nq, Vz, 1);
2344 }
2345
2346 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2347 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2348 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2349 }
2350 break;
2351 default:
2352 ASSERTL0(0, "Dimension not supported");
2353 break;
2354 }
2355}
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:1888
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.hpp:292

References ASSERTL0, Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, GetExpType(), GetTotPoints(), m_expType, m_session, Vmath::Neg(), PhysDeriv(), Vmath::Smul(), Vmath::Vsub(), Nektar::xDir, Nektar::yDir, and Nektar::zDir.

Referenced by CurlCurl().

◆ v_DealiasedDotProd()

void Nektar::MultiRegions::ExpList::v_DealiasedDotProd ( const int  num_dofs,
const Array< OneD, Array< OneD, NekDouble > > &  inarray1,
const Array< OneD, Array< OneD, NekDouble > > &  inarray2,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 5248 of file ExpList.cpp.

5253{
5255 "This method is not defined or valid for this class type");
5256}

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

Referenced by DealiasedDotProd().

◆ v_DealiasedProd()

void Nektar::MultiRegions::ExpList::v_DealiasedProd ( const int  num_dofs,
const Array< OneD, NekDouble > &  inarray1,
const Array< OneD, NekDouble > &  inarray2,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 5238 of file ExpList.cpp.

5243{
5245 "This method is not defined or valid for this class type");
5246}

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

Referenced by DealiasedProd().

◆ v_EvaluateBoundaryConditions()

void Nektar::MultiRegions::ExpList::v_EvaluateBoundaryConditions ( const NekDouble  time = 0.0,
const std::string  varName = "",
const NekDouble  x2_in = NekConstants::kNekUnsetDouble,
const NekDouble  x3_in = NekConstants::kNekUnsetDouble 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 5722 of file ExpList.cpp.

5727{
5729 "This method is not defined or valid for this class type");
5730}

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

Referenced by EvaluateBoundaryConditions().

◆ v_ExtractCoeffsToCoeffs()

void Nektar::MultiRegions::ExpList::v_ExtractCoeffsToCoeffs ( const std::shared_ptr< ExpList > &  fromExpList,
const Array< OneD, const NekDouble > &  fromCoeffs,
Array< OneD, NekDouble > &  toCoeffs 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 4349 of file ExpList.cpp.

4353{
4354 int i;
4355 int offset = 0;
4356
4357 map<int, int> GidToEid;
4358
4359 for (i = 0; i < (*m_exp).size(); ++i)
4360 {
4361 GidToEid[fromExpList->GetExp(i)->GetGeom()->GetGlobalID()] = i;
4362 }
4363
4364 for (i = 0; i < (*m_exp).size(); ++i)
4365 {
4366 std::vector<unsigned int> nummodes;
4367 vector<LibUtilities::BasisType> basisTypes;
4368
4369 int eid = GidToEid[(*m_exp)[i]->GetGeom()->GetGlobalID()];
4370 for (int j = 0; j < fromExpList->GetExp(eid)->GetNumBases(); ++j)
4371 {
4372 nummodes.push_back(fromExpList->GetExp(eid)->GetBasisNumModes(j));
4373 basisTypes.push_back(fromExpList->GetExp(eid)->GetBasisType(j));
4374 }
4375
4376 offset = fromExpList->GetCoeff_Offset(eid);
4377 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
4378 &toCoeffs[m_coeff_offset[i]],
4379 basisTypes);
4380 }
4381}

References m_coeff_offset.

Referenced by ExtractCoeffsToCoeffs().

◆ v_ExtractDataToCoeffs()

void Nektar::MultiRegions::ExpList::v_ExtractDataToCoeffs ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata,
std::string &  field,
Array< OneD, NekDouble > &  coeffs,
std::unordered_map< int, int >  zIdToPlane 
)
protectedvirtual

Extract data from raw field data into expansion list.

Parameters
fielddefField definitions.
fielddataData for associated field.
fieldField variable name.
coeffsResulting coefficient array.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 4261 of file ExpList.cpp.

4266{
4267 int i, expId;
4268 int offset = 0;
4269 int modes_offset = 0;
4270 int datalen = fielddata.size() / fielddef->m_fields.size();
4271
4272 // Find data location according to field definition
4273 for (i = 0; i < fielddef->m_fields.size(); ++i)
4274 {
4275 if (fielddef->m_fields[i] == field)
4276 {
4277 break;
4278 }
4279 offset += datalen;
4280 }
4281
4282 ASSERTL0(i != fielddef->m_fields.size(),
4283 "Field (" + field + ") not found in file.");
4284
4285 if (m_elmtToExpId.size() == 0)
4286 {
4287 // Loop in reverse order so that in case where using a
4288 // Homogeneous expansion it sets geometry ids to first part of
4289 // m_exp list. Otherwise will set to second (complex) expansion
4290 for (i = (*m_exp).size() - 1; i >= 0; --i)
4291 {
4292 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
4293 }
4294 }
4295
4296 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
4297 {
4298 // Reset modes_offset in the case where all expansions of
4299 // the same order.
4300 if (fielddef->m_uniOrder == true)
4301 {
4302 modes_offset = 0;
4303 }
4304
4306 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
4307
4308 const int elmtId = fielddef->m_elementIDs[i];
4309 auto eIt = m_elmtToExpId.find(elmtId);
4310
4311 if (eIt == m_elmtToExpId.end())
4312 {
4313 offset += datalen;
4314 modes_offset += (*m_exp)[0]->GetNumBases();
4315 continue;
4316 }
4317
4318 expId = eIt->second;
4319
4320 bool sameBasis = true;
4321 for (int j = 0; j < fielddef->m_basis.size(); ++j)
4322 {
4323 if (fielddef->m_basis[j] != (*m_exp)[expId]->GetBasisType(j))
4324 {
4325 sameBasis = false;
4326 break;
4327 }
4328 }
4329
4330 if (datalen == (*m_exp)[expId]->GetNcoeffs() && sameBasis)
4331 {
4332 Vmath::Vcopy(datalen, &fielddata[offset], 1,
4333 &coeffs[m_coeff_offset[expId]], 1);
4334 }
4335 else
4336 {
4337 (*m_exp)[expId]->ExtractDataToCoeffs(
4338 &fielddata[offset], fielddef->m_numModes, modes_offset,
4339 &coeffs[m_coeff_offset[expId]], fielddef->m_basis);
4340 }
4341
4342 offset += datalen;
4343 modes_offset += (*m_exp)[0]->GetNumBases();
4344 }
4345
4346 return;
4347}
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
Definition: ShapeType.hpp:305

References ASSERTL0, FilterPython_Function::field, GetNcoeffs(), Nektar::LibUtilities::GetNumberOfCoefficients(), m_coeff_offset, m_elmtToExpId, m_exp, and Vmath::Vcopy().

Referenced by ExtractDataToCoeffs().

◆ v_ExtractElmtToBndPhys()

void Nektar::MultiRegions::ExpList::v_ExtractElmtToBndPhys ( const int  i,
const Array< OneD, NekDouble > &  elmt,
Array< OneD, NekDouble > &  boundary 
)
protectedvirtual

Definition at line 5519 of file ExpList.cpp.

5522{
5523 int n, cnt;
5524 Array<OneD, NekDouble> tmp1, tmp2;
5526
5527 Array<OneD, int> ElmtID, EdgeID;
5528 GetBoundaryToElmtMap(ElmtID, EdgeID);
5529
5530 // Initialise result
5531 boundary =
5532 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5533
5534 // Skip other boundary regions
5535 for (cnt = n = 0; n < i; ++n)
5536 {
5537 cnt += GetBndCondExpansions()[n]->GetExpSize();
5538 }
5539
5540 int offsetBnd;
5541 int offsetElmt = 0;
5542 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5543 {
5544 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5545
5546 elmt = GetExp(ElmtID[cnt + n]);
5547 elmt->GetTracePhysVals(
5548 EdgeID[cnt + n], GetBndCondExpansions()[i]->GetExp(n),
5549 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
5550
5551 offsetElmt += elmt->GetTotPoints();
5552 }
5553}
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:2112
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2261

References GetBndCondExpansions(), GetBoundaryToElmtMap(), GetExp(), and GetTotPoints().

Referenced by ExtractElmtToBndPhys().

◆ v_ExtractPhysToBnd()

void Nektar::MultiRegions::ExpList::v_ExtractPhysToBnd ( const int  i,
const Array< OneD, const NekDouble > &  phys,
Array< OneD, NekDouble > &  bnd 
)
protectedvirtual

Definition at line 5596 of file ExpList.cpp.

5599{
5600 int n, cnt;
5601 Array<OneD, NekDouble> tmp1;
5603
5604 Array<OneD, int> ElmtID, EdgeID;
5605 GetBoundaryToElmtMap(ElmtID, EdgeID);
5606
5607 // Initialise result
5608 bnd =
5609 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5610
5611 // Skip other boundary regions
5612 for (cnt = n = 0; n < i; ++n)
5613 {
5614 cnt += GetBndCondExpansions()[n]->GetExpSize();
5615 }
5616
5617 int offsetBnd;
5618 int offsetPhys;
5619 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5620 {
5621 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5622 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5623
5624 elmt = GetExp(ElmtID[cnt + n]);
5625 elmt->GetTracePhysVals(EdgeID[cnt + n],
5627 phys + offsetPhys, tmp1 = bnd + offsetBnd);
5628 }
5629}

References GetBndCondExpansions(), GetBoundaryToElmtMap(), GetExp(), GetPhys_Offset(), and GetTotPoints().

Referenced by ExtractPhysToBnd().

◆ v_ExtractPhysToBndElmt()

void Nektar::MultiRegions::ExpList::v_ExtractPhysToBndElmt ( const int  i,
const Array< OneD, const NekDouble > &  phys,
Array< OneD, NekDouble > &  bndElmt 
)
protectedvirtual

Definition at line 5557 of file ExpList.cpp.

5560{
5561 int n, cnt, nq;
5562
5563 Array<OneD, int> ElmtID, EdgeID;
5564 GetBoundaryToElmtMap(ElmtID, EdgeID);
5565
5566 // Skip other boundary regions
5567 for (cnt = n = 0; n < i; ++n)
5568 {
5569 cnt += GetBndCondExpansions()[n]->GetExpSize();
5570 }
5571
5572 // Count number of points
5573 int npoints = 0;
5574 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5575 {
5576 npoints += GetExp(ElmtID[cnt + n])->GetTotPoints();
5577 }
5578
5579 // Initialise result
5580 bndElmt = Array<OneD, NekDouble>(npoints, 0.0);
5581
5582 // Extract data
5583 int offsetPhys;
5584 int offsetElmt = 0;
5585 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5586 {
5587 nq = GetExp(ElmtID[cnt + n])->GetTotPoints();
5588 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5589 Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
5590 offsetElmt += nq;
5591 }
5592}

References GetBndCondExpansions(), GetBoundaryToElmtMap(), GetExp(), GetPhys_Offset(), and Vmath::Vcopy().

Referenced by ExtractPhysToBndElmt().

◆ v_ExtractTracePhys() [1/2]

void Nektar::MultiRegions::ExpList::v_ExtractTracePhys ( Array< OneD, NekDouble > &  outarray)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, and Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 5157 of file ExpList.cpp.

5159{
5161 "This method is not defined or valid for this class type");
5162}

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

Referenced by ExtractTracePhys().

◆ v_ExtractTracePhys() [2/2]

void Nektar::MultiRegions::ExpList::v_ExtractTracePhys ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, and Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 5164 of file ExpList.cpp.

5167{
5169 "This method is not defined or valid for this class type");
5170}

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

◆ v_FillBndCondFromField() [1/2]

void Nektar::MultiRegions::ExpList::v_FillBndCondFromField ( const Array< OneD, NekDouble coeffs)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, and Nektar::MultiRegions::ContField3DHomogeneous1D.

Definition at line 5329 of file ExpList.cpp.

5331{
5333 "This method is not defined or valid for this class type");
5334}

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

Referenced by FillBndCondFromField().

◆ v_FillBndCondFromField() [2/2]

void Nektar::MultiRegions::ExpList::v_FillBndCondFromField ( const int  nreg,
const Array< OneD, NekDouble coeffs 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, and Nektar::MultiRegions::ContField3DHomogeneous1D.

Definition at line 5338 of file ExpList.cpp.

5341{
5343 "This method is not defined or valid for this class type");
5344}

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

◆ v_FillBwdWithBoundCond()

void Nektar::MultiRegions::ExpList::v_FillBwdWithBoundCond ( const Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd,
bool  PutFwdInBwdOnBCs 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5097 of file ExpList.cpp.

5101{
5103 "This method is not defined or valid for this class type");
5104}

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

Referenced by FillBwdWithBoundCond().

◆ v_FillBwdWithBwdWeight()

void Nektar::MultiRegions::ExpList::v_FillBwdWithBwdWeight ( Array< OneD, NekDouble > &  weightave,
Array< OneD, NekDouble > &  weightjmp 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5684 of file ExpList.cpp.

5687{
5688 NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
5689}

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

Referenced by FillBwdWithBwdWeight().

◆ v_FwdTrans()

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

◆ v_FwdTransBndConstrained()

void Nektar::MultiRegions::ExpList::v_FwdTransBndConstrained ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous2D, Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 2455 of file ExpList.cpp.

2458{
2459 int i;
2460
2461 Array<OneD, NekDouble> e_outarray;
2462
2463 for (i = 0; i < (*m_exp).size(); ++i)
2464 {
2465 (*m_exp)[i]->FwdTransBndConstrained(inarray + m_phys_offset[i],
2466 e_outarray =
2467 outarray + m_coeff_offset[i]);
2468 }
2469}

References m_coeff_offset, and m_phys_offset.

Referenced by FwdTransBndConstrained().

◆ v_FwdTransLocalElmt()

void Nektar::MultiRegions::ExpList::v_FwdTransLocalElmt ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Given a function \(u(\boldsymbol{x})\) defined at the quadrature points, this function determines the transformed elemental coefficients \(\hat{u}_n^e\) employing a discrete elemental Galerkin projection from physical space to coefficient space. For each element, the operation is evaluated locally by the function StdRegions::StdExpansion::IproductWRTBase followed by a call to #MultiRegions#MultiplyByElmtInvMass.

Parameters
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
outarrayThe resulting coefficients \(\hat{u}_n^e\) will be stored in this array of size \(N_{\mathrm{eof}}\).

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous2D, Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 2446 of file ExpList.cpp.

2448{
2449 Array<OneD, NekDouble> f(m_ncoeffs);
2450
2451 IProductWRTBase(inarray, f);
2452 MultiplyByElmtInvMass(f, outarray);
2453}
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally mulplies the coefficient space of Sin my the elemental inverse of the mass ...
Definition: ExpList.cpp:2408

References IProductWRTBase(), m_ncoeffs, and MultiplyByElmtInvMass().

Referenced by FwdTransLocalElmt(), and v_FwdTrans().

◆ v_GetBCValues()

void Nektar::MultiRegions::ExpList::v_GetBCValues ( Array< OneD, NekDouble > &  BndVals,
const Array< OneD, NekDouble > &  TotField,
int  BndID 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 5258 of file ExpList.cpp.

5262{
5264 "This method is not defined or valid for this class type");
5265}

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

Referenced by GetBCValues().

◆ v_GetBndCondBwdWeight()

const Array< OneD, const NekDouble > & Nektar::MultiRegions::ExpList::v_GetBndCondBwdWeight ( )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5134 of file ExpList.cpp.

5135{
5137 "v_GetBndCondBwdWeight is not defined for this class type");
5138 static Array<OneD, NekDouble> tmp;
5139 return tmp;
5140}

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

Referenced by GetBndCondBwdWeight().

◆ v_GetBndCondExpansions()

const Array< OneD, const std::shared_ptr< ExpList > > & Nektar::MultiRegions::ExpList::v_GetBndCondExpansions ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 4472 of file ExpList.cpp.

4474{
4476 "This method is not defined or valid for this class type");
4477 static Array<OneD, const std::shared_ptr<ExpList>> result;
4478 return result;
4479}

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

Referenced by GetBndCondExpansions().

◆ v_GetBndConditions()

const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::v_GetBndConditions ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 5700 of file ExpList.cpp.

5702{
5704 "This method is not defined or valid for this class type");
5705 static Array<OneD, const SpatialDomains::BoundaryConditionShPtr> result;
5706 return result;
5707}

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

Referenced by GetBndConditions().

◆ v_GetBndElmtExpansion()

void Nektar::MultiRegions::ExpList::v_GetBndElmtExpansion ( int  i,
std::shared_ptr< ExpList > &  result,
const bool  DeclareCoeffPhysArrays 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 5509 of file ExpList.cpp.

5512{
5514 "This method is not defined or valid for this class type");
5515}

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

Referenced by GetBndElmtExpansion().

◆ v_GetBoundaryNormals()

void Nektar::MultiRegions::ExpList::v_GetBoundaryNormals ( int  i,
Array< OneD, Array< OneD, NekDouble > > &  normals 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 5633 of file ExpList.cpp.

5635{
5636 int j, n, cnt, nq;
5637 int coordim = GetCoordim(0);
5638 Array<OneD, NekDouble> tmp;
5640
5641 Array<OneD, int> ElmtID, EdgeID;
5642 GetBoundaryToElmtMap(ElmtID, EdgeID);
5643
5644 // Initialise result
5645 normals = Array<OneD, Array<OneD, NekDouble>>(coordim);
5646 for (j = 0; j < coordim; ++j)
5647 {
5648 normals[j] = Array<OneD, NekDouble>(
5649 GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5650 }
5651
5652 // Skip other boundary regions
5653 for (cnt = n = 0; n < i; ++n)
5654 {
5655 cnt += GetBndCondExpansions()[n]->GetExpSize();
5656 }
5657
5658 int offset;
5659 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5660 {
5661 offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5662 nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
5663
5664 elmt = GetExp(ElmtID[cnt + n]);
5665 const Array<OneD, const Array<OneD, NekDouble>> normalsElmt =
5666 elmt->GetTraceNormal(EdgeID[cnt + n]);
5667 // Copy to result
5668 for (j = 0; j < coordim; ++j)
5669 {
5670 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
5671 }
5672 }
5673}

References GetBndCondExpansions(), GetBoundaryToElmtMap(), GetCoordim(), GetExp(), GetTotPoints(), and Vmath::Vcopy().

Referenced by GetBoundaryNormals().

◆ v_GetBoundaryToElmtMap()

void Nektar::MultiRegions::ExpList::v_GetBoundaryToElmtMap ( Array< OneD, int > &  ElmtID,
Array< OneD, int > &  EdgeID 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D, Nektar::MultiRegions::DisContField3DHomogeneous2D, and Nektar::MultiRegions::DisContField.

Definition at line 5677 of file ExpList.cpp.

5679{
5681 "This method is not defined or valid for this class type");
5682}

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

Referenced by GetBoundaryToElmtMap().

◆ v_GetCoords() [1/2]

void Nektar::MultiRegions::ExpList::v_GetCoords ( Array< OneD, NekDouble > &  coord_0,
Array< OneD, NekDouble > &  coord_1 = NullNekDouble1DArray,
Array< OneD, NekDouble > &  coord_2 = NullNekDouble1DArray 
)
protectedvirtual

The operation is evaluated locally by the elemental function StdRegions::StdExpansion::GetCoords.

Parameters
coord_0After calculation, the \(x_1\) coordinate will be stored in this array.
coord_1After calculation, the \(x_2\) coordinate will be stored in this array.
coord_2After calculation, the \(x_3\) coordinate will be stored in this array.

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous1D, Nektar::MultiRegions::ExpList2DHomogeneous2D, Nektar::MultiRegions::ExpList3DHomogeneous1D, and Nektar::MultiRegions::ExpList3DHomogeneous2D.

Definition at line 5436 of file ExpList.cpp.

5439{
5440 if (GetNumElmts() == 0)
5441 {
5442 return;
5443 }
5444
5445 int i;
5446 Array<OneD, NekDouble> e_coord_0;
5447 Array<OneD, NekDouble> e_coord_1;
5448 Array<OneD, NekDouble> e_coord_2;
5449
5450 switch (GetExp(0)->GetCoordim())
5451 {
5452 case 1:
5453 for (i = 0; i < (*m_exp).size(); ++i)
5454 {
5455 e_coord_0 = coord_0 + m_phys_offset[i];
5456 (*m_exp)[i]->GetCoords(e_coord_0);
5457 }
5458 break;
5459 case 2:
5460 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5461
5462 for (i = 0; i < (*m_exp).size(); ++i)
5463 {
5464 e_coord_0 = coord_0 + m_phys_offset[i];
5465 e_coord_1 = coord_1 + m_phys_offset[i];
5466 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
5467 }
5468 break;
5469 case 3:
5470 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5471 ASSERTL0(coord_2.size() != 0, "output coord_2 is not defined");
5472
5473 for (i = 0; i < (*m_exp).size(); ++i)
5474 {
5475 e_coord_0 = coord_0 + m_phys_offset[i];
5476 e_coord_1 = coord_1 + m_phys_offset[i];
5477 e_coord_2 = coord_2 + m_phys_offset[i];
5478 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
5479 }
5480 break;
5481 }
5482}

References ASSERTL0, GetCoordim(), GetExp(), GetNumElmts(), and m_phys_offset.

Referenced by GetCoords().

◆ v_GetCoords() [2/2]

void Nektar::MultiRegions::ExpList::v_GetCoords ( const int  eid,
Array< OneD, NekDouble > &  xc0,
Array< OneD, NekDouble > &  xc1,
Array< OneD, NekDouble > &  xc2 
)
protectedvirtual

◆ v_GetFieldDefinitions() [1/2]

void Nektar::MultiRegions::ExpList::v_GetFieldDefinitions ( std::vector< LibUtilities::FieldDefinitionsSharedPtr > &  fielddef)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 4197 of file ExpList.cpp.

4199{
4201}
void GeneralGetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef, int NumHomoDir=0, Array< OneD, LibUtilities::BasisSharedPtr > &HomoBasis=LibUtilities::NullBasisSharedPtr1DArray, std::vector< NekDouble > &HomoLen=LibUtilities::NullNekDoubleVector, bool homoStrips=false, std::vector< unsigned int > &HomoSIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoZIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoYIDs=LibUtilities::NullUnsignedIntVector)
Definition: ExpList.cpp:4078

References GeneralGetFieldDefinitions().

◆ v_GetFieldDefinitions() [2/2]

std::vector< LibUtilities::FieldDefinitionsSharedPtr > Nektar::MultiRegions::ExpList::v_GetFieldDefinitions ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 4189 of file ExpList.cpp.

4191{
4192 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
4193 v_GetFieldDefinitions(returnval);
4194 return returnval;
4195}

References v_GetFieldDefinitions().

Referenced by GetFieldDefinitions(), and v_GetFieldDefinitions().

◆ v_GetFwdBwdTracePhys() [1/2]

void Nektar::MultiRegions::ExpList::v_GetFwdBwdTracePhys ( Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5080 of file ExpList.cpp.

5082{
5084 "This method is not defined or valid for this class type");
5085}

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

Referenced by GetFwdBwdTracePhys().

◆ v_GetFwdBwdTracePhys() [2/2]

void Nektar::MultiRegions::ExpList::v_GetFwdBwdTracePhys ( const Array< OneD, const NekDouble > &  field,
Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd,
bool  FillBnd = true,
bool  PutFwdInBwdOnBCs = false,
bool  DoExchange = true 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5087 of file ExpList.cpp.

5092{
5094 "This method is not defined or valid for this class type");
5095}

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

◆ v_GetGlobalLinSysManager()

LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & Nektar::MultiRegions::ExpList::v_GetGlobalLinSysManager ( void  )
protectedvirtual

Definition at line 3997 of file ExpList.cpp.

3999{
4001 "GetGlobalLinSysManager not implemented for ExpList.");
4003}
static LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > NullGlobalLinSysManager
Definition: ExpList.h:1503

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

Referenced by GetGlobalLinSysManager().

◆ v_GetHomogeneousBasis()

virtual LibUtilities::BasisSharedPtr Nektar::MultiRegions::ExpList::v_GetHomogeneousBasis ( void  )
inlineprotectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1464 of file ExpList.h.

1465 {
1467 "This method is not defined or valid for this class type");
1469 }
static BasisSharedPtr NullBasisSharedPtr
Definition: Basis.h:350

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

Referenced by GetHomogeneousBasis().

◆ v_GetHomoLen()

NekDouble Nektar::MultiRegions::ExpList::v_GetHomoLen ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3948 of file ExpList.cpp.

3949{
3951 "This method is not defined or valid for this class type");
3952 NekDouble len = 0.0;
3953 return len;
3954}

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

Referenced by GetHomoLen().

◆ v_GetInterfaceMap()

std::shared_ptr< InterfaceMapDG > & Nektar::MultiRegions::ExpList::v_GetInterfaceMap ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 4614 of file ExpList.cpp.

4615{
4617 "This method is not defined or valid for this class type");
4618 static std::shared_ptr<InterfaceMapDG> result;
4619 return result;
4620}

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

Referenced by GetInterfaceMap().

◆ v_GetLeftAdjacentFaces()

const vector< bool > & Nektar::MultiRegions::ExpList::v_GetLeftAdjacentFaces ( void  ) const
protectedvirtual

Definition at line 5149 of file ExpList.cpp.

5150{
5152 "This method is not defined or valid for this class type");
5153 static vector<bool> tmp;
5154 return tmp;
5155}

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

Referenced by GetLeftAdjacentFaces().

◆ v_GetLeftAdjacentTraces()

std::vector< bool > & Nektar::MultiRegions::ExpList::v_GetLeftAdjacentTraces ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 4627 of file ExpList.cpp.

4628{
4630 "This method is not defined or valid for this class type");
4631 static std::vector<bool> result;
4632 return result;
4633}

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

Referenced by GetLeftAdjacentTraces().

◆ v_GetLocTraceFromTracePts()

void Nektar::MultiRegions::ExpList::v_GetLocTraceFromTracePts ( const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  locTraceFwd,
Array< OneD, NekDouble > &  locTraceBwd 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5124 of file ExpList.cpp.

5129{
5131 "v_GetLocTraceFromTracePts is not defined for this class");
5132}

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

Referenced by GetLocTraceFromTracePts().

◆ v_GetLocTraceToTraceMap()

const LocTraceToTraceMapSharedPtr & Nektar::MultiRegions::ExpList::v_GetLocTraceToTraceMap ( void  ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 6677 of file ExpList.cpp.

6678{
6679 NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
6681}
static LocTraceToTraceMapSharedPtr NullLocTraceToTraceMapSharedPtr

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

Referenced by GetLocTraceToTraceMap().

◆ v_GetMovingFrames()

void Nektar::MultiRegions::ExpList::v_GetMovingFrames ( const SpatialDomains::GeomMMF  MMFdir,
const Array< OneD, const NekDouble > &  CircCentre,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
protectedvirtual

Definition at line 4399 of file ExpList.cpp.

4402{
4403 int npts;
4404
4405 int MFdim = 3;
4406 int nq = outarray[0].size() / MFdim;
4407
4408 // Assume whole array is of same coordinate dimension
4409 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
4410
4411 Array<OneD, Array<OneD, NekDouble>> MFloc(MFdim * coordim);
4412 // Process each expansion.
4413 for (int i = 0; i < m_exp->size(); ++i)
4414 {
4415 npts = (*m_exp)[i]->GetTotPoints();
4416
4417 for (int j = 0; j < MFdim * coordim; ++j)
4418 {
4419 MFloc[j] = Array<OneD, NekDouble>(npts, 0.0);
4420 }
4421
4422 // MF from LOCALREGIONS
4423 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
4424 (*m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
4425
4426 // Get the physical data offset for this expansion.
4427 for (int j = 0; j < MFdim; ++j)
4428 {
4429 for (int k = 0; k < coordim; ++k)
4430 {
4431 Vmath::Vcopy(npts, &MFloc[j * coordim + k][0], 1,
4432 &outarray[j][k * nq + m_phys_offset[i]], 1);
4433 }
4434 }
4435 }
4436}

References m_exp, m_phys_offset, and Vmath::Vcopy().

Referenced by GetMovingFrames().

◆ v_GetNormals()

void Nektar::MultiRegions::ExpList::v_GetNormals ( Array< OneD, Array< OneD, NekDouble > > &  normals)
protectedvirtual

Populate normals with the normals of all expansions.

For each local element, copy the normals stored in the element list into the array normals. This function should only be called by a trace explist, which has setup the left and right adjacent elements.

Parameters
normalsTwo dimensional array in which to copy normals to. The first dimension is the coordim. The second dimension is the same size as trace phys space.

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous1D.

Definition at line 4707 of file ExpList.cpp.

4708{
4709 int i, j, k, e_npoints, offset;
4710 Array<OneD, Array<OneD, NekDouble>> locnormals;
4711
4712 // Assume whole array is of same coordinate dimension
4713 int coordim = GetCoordim(0);
4714
4715 ASSERTL1(normals.size() >= coordim,
4716 "Output vector does not have sufficient dimensions to "
4717 "match coordim");
4718
4719 switch (m_expType)
4720 {
4721 case e0D:
4722 {
4723 // Process each expansion.
4724 for (i = 0; i < m_exp->size(); ++i)
4725 {
4726 LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
4727
4729 loc_exp->GetLeftAdjacentElementExp();
4730
4731 // Get the number of points and normals for this expansion.
4732 e_npoints = 1;
4733 locnormals = loc_elmt->GetTraceNormal(
4734 loc_exp->GetLeftAdjacentElementTrace());
4735
4736 // Get the physical data offset for this expansion.
4737 offset = m_phys_offset[i];
4738
4739 // Process each point in the expansion.
4740 for (j = 0; j < e_npoints; ++j)
4741 {
4742 // Process each spatial dimension and copy the
4743 // values into the output array.
4744 for (k = 0; k < coordim; ++k)
4745 {
4746 normals[k][offset] = locnormals[k][0];
4747 }
4748 }
4749 }
4750 }
4751 break;
4752 case e1D:
4753 {
4754 // Process each (trace) expansion.
4755 for (i = 0; i < m_exp->size(); ++i)
4756 {
4757 LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4758 // location of this normal vector in the output array.
4759 int offset = m_phys_offset[i];
4760
4761 // Get number of points from left expansion.
4763 traceExp->GetLeftAdjacentElementExp();
4764 int edgeId = traceExp->GetLeftAdjacentElementTrace();
4765 LibUtilities::PointsKey edgePoints =
4766 exp2D->GetTraceBasisKey(edgeId).GetPointsKey();
4767 LibUtilities::PointsKey tracePoints =
4768 traceExp->GetBasis(0)->GetPointsKey();
4769
4770 // If right adjacent element exists, then we compare
4771 // the left and right side and take the one with
4772 // the highest number of points to compute the
4773 // local normals. However, it's a question whether
4774 // this effort pays off.
4775 bool useRight = false;
4776 if (traceExp->GetRightAdjacentElementTrace() >= 0)
4777 {
4779 traceExp->GetRightAdjacentElementExp();
4780 int RedgeId = traceExp->GetRightAdjacentElementTrace();
4781 LibUtilities::PointsKey RedgePoints =
4782 Rexp2D->GetTraceBasisKey(RedgeId).GetPointsKey();
4783
4784 if (RedgePoints.GetNumPoints() > edgePoints.GetNumPoints())
4785 {
4786 exp2D = Rexp2D;
4787 edgeId = RedgeId;
4788 edgePoints = RedgePoints;
4789 useRight = true;
4790 }
4791 }
4792
4793 const Array<OneD, const Array<OneD, NekDouble>> &locNormals =
4794 exp2D->GetTraceNormal(edgeId);
4795
4796 // For unknown reason, GetTraceNormal(2D) returns normals
4797 // that has been reoriented to trace order.
4798 // So here we don't need to reorient them again.
4799 for (int d = 0; d < coordim; ++d)
4800 {
4801 LibUtilities::Interp1D(edgePoints, locNormals[d].data(),
4802 tracePoints,
4803 normals[d].data() + offset);
4804 // Trace normal direction is always the outward
4805 // direction of the left element.
4806 if (useRight)
4807 {
4808 Vmath::Neg((int)tracePoints.GetNumPoints(),
4809 &normals[d][offset], 1);
4810 }
4811 }
4812 }
4813 }
4814 break;
4815 case e2D:
4816 {
4817 Array<OneD, NekDouble> tmp;
4818
4819 // Process each expansion.
4820 for (i = 0; i < m_exp->size(); ++i)
4821 {
4822 LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4823 // location of this normal vector in the output array.
4824 int offset = m_phys_offset[i];
4825
4826 // Get the normals from left expansion.
4827 // NOTE:
4828 // One can choose to compare the left and right side and take
4829 // the one with the highest number of points to compute the
4830 // local normals. Here are 2 reasons why we don't do so:
4831 // 1.
4832 // in general two adjacent elements must share a common
4833 // cuerved edge/face, which can be precisely described even by
4834 // the lower-order side. Even if the two sides are not exactly
4835 // the same, it should not affect the convergence of solution.
4836 // 2.
4837 // In 3D, it's hard to define which is side has higher order.
4838 // The left-side may have higher order in axis 0 but lower in
4839 // axis 1. It's too complicated and not worth the effort.
4841 traceExp->GetLeftAdjacentElementExp();
4842 int faceId = traceExp->GetLeftAdjacentElementTrace();
4843 const Array<OneD, const Array<OneD, NekDouble>> &locNormals =
4844 exp3D->GetTraceNormal(faceId);
4845
4846 StdRegions::Orientation orient = exp3D->GetTraceOrient(faceId);
4847
4848 // swap local basiskey 0 and 1 if orientation is transposed
4849 // (>=9)
4850 int fromid0, fromid1;
4851
4853 {
4854 fromid0 = 0;
4855 fromid1 = 1;
4856 }
4857 else
4858 {
4859 fromid0 = 1;
4860 fromid1 = 0;
4861 }
4862
4863 LibUtilities::BasisKey faceBasis0 =
4864 exp3D->GetTraceBasisKey(faceId, fromid0);
4865 LibUtilities::BasisKey faceBasis1 =
4866 exp3D->GetTraceBasisKey(faceId, fromid1);
4867 LibUtilities::BasisKey traceBasis0 =
4868 traceExp->GetBasis(0)->GetBasisKey();
4869 LibUtilities::BasisKey traceBasis1 =
4870 traceExp->GetBasis(1)->GetBasisKey();
4871
4872 const int faceNq0 = faceBasis0.GetNumPoints();
4873 const int faceNq1 = faceBasis1.GetNumPoints();
4874
4875 // Reorient normals from stdExp definition onto the same
4876 // orientation as the trace expansion.(also match the
4877 // swapped local basiskey)
4878 Array<OneD, int> map;
4879 exp3D->ReOrientTracePhysMap(orient, map, faceNq0, faceNq1);
4880
4881 // Perform reorientation and interpolation.
4882 Array<OneD, NekDouble> traceNormals(faceNq0 * faceNq1);
4883 for (j = 0; j < coordim; ++j)
4884 {
4885 Vmath::Scatr(faceNq0 * faceNq1, locNormals[j], map,
4886 traceNormals);
4887
4889 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4890 traceNormals, traceBasis0.GetPointsKey(),
4891 traceBasis1.GetPointsKey(), tmp = normals[j] + offset);
4892 }
4893 }
4894 }
4895 break;
4896 default:
4897 {
4899 "This method is not defined or valid for this class type");
4900 }
4901 }
4902}
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
Definition: Vmath.hpp:539

References ASSERTL1, Nektar::UnitTests::d(), Nektar::MultiRegions::e0D, Nektar::MultiRegions::e1D, Nektar::MultiRegions::e2D, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::ErrorUtil::efatal, GetCoordim(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::LibUtilities::Interp1D(), Nektar::LibUtilities::Interp2D(), m_exp, m_expType, m_phys_offset, Vmath::Neg(), NEKERROR, and Vmath::Scatr().

Referenced by GetNormals().

◆ v_GetNumElmts()

virtual size_t Nektar::MultiRegions::ExpList::v_GetNumElmts ( void  )
inlineprotectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 1162 of file ExpList.h.

1163 {
1164 return (*m_exp).size();
1165 }

Referenced by GetNumElmts().

◆ v_GetPeriodicEntities()

void Nektar::MultiRegions::ExpList::v_GetPeriodicEntities ( PeriodicMap periodicVerts,
PeriodicMap periodicEdges,
PeriodicMap periodicFaces 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, and Nektar::MultiRegions::ExpList3DHomogeneous1D.

Definition at line 5744 of file ExpList.cpp.

5747{
5749 "This method is not defined or valid for this class type");
5750}

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

Referenced by GetPeriodicEntities().

◆ v_GetPlane()

ExpListSharedPtr & Nektar::MultiRegions::ExpList::v_GetPlane ( int  n)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 5773 of file ExpList.cpp.

5774{
5776 "This method is not defined or valid for this class type");
5777 return NullExpListSharedPtr;
5778}
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1499

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

Referenced by GetPlane().

◆ v_GetPoolCount()

int Nektar::MultiRegions::ExpList::v_GetPoolCount ( std::string  poolName)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 3984 of file ExpList.cpp.

3985{
3986 NEKERROR(ErrorUtil::efatal, "GetPoolCount not implemented for ExpList.");
3987 return -1;
3988}

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

Referenced by GetPoolCount().

◆ v_GetRobinBCInfo()

map< int, RobinBCInfoSharedPtr > Nektar::MultiRegions::ExpList::v_GetRobinBCInfo ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 5734 of file ExpList.cpp.

5735{
5737 "This method is not defined or valid for this class type");
5738 static map<int, RobinBCInfoSharedPtr> result;
5739 return result;
5740}

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

Referenced by GetRobinBCInfo().

◆ v_GetTrace()

std::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::v_GetTrace ( )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, and Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 4598 of file ExpList.cpp.

4599{
4601 "This method is not defined or valid for this class type");
4602 static std::shared_ptr<ExpList> returnVal;
4603 return returnVal;
4604}

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

Referenced by GetTrace().

◆ v_GetTraceBndMap()

const Array< OneD, const int > & Nektar::MultiRegions::ExpList::v_GetTraceBndMap ( )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 4622 of file ExpList.cpp.

4623{
4624 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
4625}
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2157

References GetTraceMap().

Referenced by GetTraceBndMap().

◆ v_GetTraceMap()

std::shared_ptr< AssemblyMapDG > & Nektar::MultiRegions::ExpList::v_GetTraceMap ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 4606 of file ExpList.cpp.

4607{
4609 "This method is not defined or valid for this class type");
4610 static std::shared_ptr<AssemblyMapDG> result;
4611 return result;
4612}

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

Referenced by GetTraceMap().

◆ v_GetTransposition()

LibUtilities::TranspositionSharedPtr Nektar::MultiRegions::ExpList::v_GetTransposition ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3940 of file ExpList.cpp.

3941{
3943 "This method is not defined or valid for this class type");
3945 return trans;
3946}
std::shared_ptr< Transposition > TranspositionSharedPtr

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

Referenced by GetTransposition().

◆ v_GetYIDs()

Array< OneD, const unsigned int > Nektar::MultiRegions::ExpList::v_GetYIDs ( void  )
protectedvirtual

Definition at line 3970 of file ExpList.cpp.

3971{
3973 "This method is not defined or valid for this class type");
3974 Array<OneD, unsigned int> NoModes(1);
3975 return NoModes;
3976}

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

Referenced by GetYIDs().

◆ v_GetZIDs()

Array< OneD, const unsigned int > Nektar::MultiRegions::ExpList::v_GetZIDs ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3962 of file ExpList.cpp.

3963{
3965 "This method is not defined or valid for this class type");
3966 Array<OneD, unsigned int> NoModes(1);
3967 return NoModes;
3968}

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

Referenced by GetZIDs().

◆ v_GlobalToLocal() [1/2]

void Nektar::MultiRegions::ExpList::v_GlobalToLocal ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 5367 of file ExpList.cpp.

5370{
5372 "This method is not defined or valid for this class type");
5373}

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

◆ v_GlobalToLocal() [2/2]

void Nektar::MultiRegions::ExpList::v_GlobalToLocal ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField3DHomogeneous2D.

Definition at line 5361 of file ExpList.cpp.

5362{
5364 "This method is not defined or valid for this class type");
5365}

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

Referenced by GlobalToLocal().

◆ v_HelmSolve()

GlobalLinSysKey Nektar::MultiRegions::ExpList::v_HelmSolve ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::ConstFactorMap factors,
const StdRegions::VarCoeffMap varcoeff,
const MultiRegions::VarFactorsMap varfactors,
const Array< OneD, const NekDouble > &  dirForcing,
const bool  PhysSpaceForcing 
)
protectedvirtual

◆ v_HomogeneousBwdTrans()

void Nektar::MultiRegions::ExpList::v_HomogeneousBwdTrans ( const int  npts,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  Shuff = true,
bool  UnShuff = true 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 5228 of file ExpList.cpp.

5233{
5235 "This method is not defined or valid for this class type");
5236}

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

Referenced by HomogeneousBwdTrans().

◆ v_HomogeneousEnergy()

Array< OneD, const NekDouble > Nektar::MultiRegions::ExpList::v_HomogeneousEnergy ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpList3DHomogeneous1D.

Definition at line 3932 of file ExpList.cpp.

3933{
3935 "This method is not defined or valid for this class type");
3936 Array<OneD, NekDouble> NoEnergy(1, 0.0);
3937 return NoEnergy;
3938}

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

Referenced by HomogeneousEnergy().

◆ v_HomogeneousFwdTrans()

void Nektar::MultiRegions::ExpList::v_HomogeneousFwdTrans ( const int  npts,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  Shuff = true,
bool  UnShuff = true 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 5218 of file ExpList.cpp.

5223{
5225 "This method is not defined or valid for this class type");
5226}

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

Referenced by HomogeneousFwdTrans().

◆ v_ImposeDirichletConditions()

void Nektar::MultiRegions::ExpList::v_ImposeDirichletConditions ( Array< OneD, NekDouble > &  outarray)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField3DHomogeneous2D.

Definition at line 5320 of file ExpList.cpp.

5322{
5324 "This method is not defined or valid for this class type");
5325}

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

Referenced by ImposeDirichletConditions().

◆ v_Integral()

NekDouble Nektar::MultiRegions::ExpList::v_Integral ( const Array< OneD, const NekDouble > &  inarray)
protectedvirtual

The integration is evaluated locally, that is

\[\int f(\boldsymbol{x})d\boldsymbol{x}=\sum_{e=1}^{{N_{\mathrm{el}}}} \left\{\int_{\Omega_e}f(\boldsymbol{x})d\boldsymbol{x}\right\}, \]

where the integration over the separate elements is done by the function StdRegions::StdExpansion::Integral, which discretely evaluates the integral using Gaussian quadrature.

Parameters
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
Returns
The value of the discretely evaluated integral \(\int f(\boldsymbol{x})d\boldsymbol{x}\).

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3898 of file ExpList.cpp.

3899{
3900 NekDouble sum = 0.0;
3901 int i = 0;
3902
3903 for (i = 0; i < (*m_exp).size(); ++i)
3904 {
3905 sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
3906 }
3907 m_comm->GetRowComm()->AllReduce(sum, LibUtilities::ReduceSum);
3908
3909 return sum;
3910}

References m_comm, m_phys_offset, and Nektar::LibUtilities::ReduceSum.

Referenced by Integral().

◆ v_IProductWRTBase()

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

The operation is evaluated locally for every element by the function StdRegions::StdExpansion::IProductWRTBase.

Parameters
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
outarrayAn array of size \(N_{\mathrm{eof}}\) used to store the result.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 5392 of file ExpList.cpp.

5394{
5395 LibUtilities::Timer timer;
5396 timer.Start();
5397 // initialise if required
5399 {
5400 for (int i = 0; i < m_collections.size(); ++i)
5401 {
5403 }
5405 }
5406
5407 Array<OneD, NekDouble> tmp;
5408 int input_offset{0};
5409 int output_offset{0};
5410 for (int i = 0; i < m_collections.size(); ++i)
5411 {
5413 inarray + input_offset,
5414 tmp = outarray + output_offset);
5415 input_offset +=
5417 output_offset +=
5419 }
5420 timer.Stop();
5421 // Elapsed time
5422 timer.AccumulateRegion("Collections:IProductWRTBase", 10);
5423}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::Collections::eIProductWRTBase, m_collections, m_collectionsDoInit, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

Referenced by IProductWRTBase().

◆ v_IProductWRTDerivBase() [1/2]

void Nektar::MultiRegions::ExpList::v_IProductWRTDerivBase ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

The operation is evaluated locally for every element by the function StdRegions::StdExpansion::IProductWRTDerivBase.

Parameters
inarrayAn array of arrays of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\) in dir directions.
outarrayAn array of size \(N_{\mathrm{eof}}\) used to store the result.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 2030 of file ExpList.cpp.

2033{
2034 Array<OneD, NekDouble> tmp0, tmp1, tmp2;
2035 // assume coord dimension defines the size of Deriv Base
2036 int dim = GetCoordim(0);
2037
2038 ASSERTL1(inarray.size() >= dim, "inarray is not of sufficient dimension");
2039
2040 // initialise if required
2042 {
2043 for (int i = 0; i < m_collections.size(); ++i)
2044 {
2046 }
2048 }
2049
2050 LibUtilities::Timer timer;
2051 int input_offset{0};
2052 int output_offset{0};
2053 LIKWID_MARKER_START("IProductWRTDerivBase_coll");
2054 timer.Start();
2055
2056 switch (dim)
2057 {
2058 case 1:
2059 for (int i = 0; i < m_collections.size(); ++i)
2060 {
2061 m_collections[i].ApplyOperator(
2063 inarray[0] + input_offset, tmp0 = outarray + output_offset);
2064 input_offset += m_collections[i].GetInputSize(
2066 output_offset += m_collections[i].GetOutputSize(
2068 }
2069 break;
2070 case 2:
2071 for (int i = 0; i < m_collections.size(); ++i)
2072 {
2073 m_collections[i].ApplyOperator(
2075 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
2076 tmp1 = outarray + output_offset);
2077 input_offset += m_collections[i].GetInputSize(
2079 output_offset += m_collections[i].GetOutputSize(
2081 }
2082 break;
2083 case 3:
2084 for (int i = 0; i < m_collections.size(); ++i)
2085 {
2086 m_collections[i].ApplyOperator(
2088 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
2089 tmp1 = inarray[2] + input_offset,
2090 tmp2 = outarray + output_offset);
2091 input_offset += m_collections[i].GetInputSize(
2093 output_offset += m_collections[i].GetOutputSize(
2095 }
2096 break;
2097 default:
2098 NEKERROR(ErrorUtil::efatal, "Dimension of inarray not correct");
2099 break;
2100 }
2101
2102 timer.Stop();
2103 LIKWID_MARKER_STOP("IProductWRTDerivBase_coll");
2104
2105 // Elapsed time
2106 timer.AccumulateRegion("Collections:IProductWRTDerivBase", 10);
2107}

References Nektar::LibUtilities::Timer::AccumulateRegion(), ASSERTL1, Nektar::ErrorUtil::efatal, Nektar::Collections::eIProductWRTDerivBase, GetCoordim(), LIKWID_MARKER_START, LIKWID_MARKER_STOP, m_collections, m_collectionsDoInit, NEKERROR, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

◆ v_IProductWRTDerivBase() [2/2]

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

The operation is evaluated locally for every element by the function StdRegions::Expansion::IProductWRTDerivBase.

Parameters
dir{0,1} is the direction in which the derivative of the basis should be taken
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
outarrayAn array of size \(N_{\mathrm{eof}}\) used to store the result.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1969 of file ExpList.cpp.

1972{
1973 int i;
1974
1975 Array<OneD, NekDouble> e_outarray;
1976 for (i = 0; i < (*m_exp).size(); ++i)
1977 {
1978 (*m_exp)[i]->IProductWRTDerivBase(dir, inarray + m_phys_offset[i],
1979 e_outarray =
1980 outarray + m_coeff_offset[i]);
1981 }
1982}

References m_coeff_offset, and m_phys_offset.

Referenced by IProductWRTDerivBase().

◆ v_L2()

NekDouble Nektar::MultiRegions::ExpList::v_L2 ( const Array< OneD, const NekDouble > &  inarray,
const Array< OneD, const NekDouble > &  soln = NullNekDouble1DArray 
)
protectedvirtual

Given a spectral/hp approximation \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points (which should be contained in m_phys), this function calculates the \(L_2\) error of this approximation with respect to an exact solution. The local distribution of the quadrature points allows an elemental evaluation of this operation through the functions StdRegions::StdExpansion::L2.

The exact solution, also evaluated at the quadrature points, should be contained in the variable m_phys of the ExpList object Sol.

Parameters
SolAn ExpList, containing the discrete evaluation of the exact solution at the quadrature points in its array m_phys.
Returns
The \(L_2\) error of the approximation.

Reimplemented in Nektar::MultiRegions::ExpList3DHomogeneous1D, and Nektar::MultiRegions::ExpList3DHomogeneous2D.

Definition at line 3853 of file ExpList.cpp.

3855{
3856 NekDouble err = 0.0, errl2;
3857 int i;
3858
3859 if (soln == NullNekDouble1DArray)
3860 {
3861 for (i = 0; i < (*m_exp).size(); ++i)
3862 {
3863 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i]);
3864 err += errl2 * errl2;
3865 }
3866 }
3867 else
3868 {
3869 for (i = 0; i < (*m_exp).size(); ++i)
3870 {
3871 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i],
3872 soln + m_phys_offset[i]);
3873 err += errl2 * errl2;
3874 }
3875 }
3876
3877 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3878
3879 return sqrt(err);
3880}

References m_comm, m_phys_offset, Nektar::NullNekDouble1DArray, Nektar::LibUtilities::ReduceSum, and tinysimd::sqrt().

Referenced by L2().

◆ v_LinearAdvectionDiffusionReactionSolve()

GlobalLinSysKey Nektar::MultiRegions::ExpList::v_LinearAdvectionDiffusionReactionSolve ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::ConstFactorMap factors,
const StdRegions::VarCoeffMap varcoeff,
const MultiRegions::VarFactorsMap varfactors,
const Array< OneD, const NekDouble > &  dirForcing,
const bool  PhysSpaceForcing 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 5193 of file ExpList.cpp.

5201{
5203 "LinearAdvectionDiffusionReactionSolve not implemented.");
5204 return NullGlobalLinSysKey;
5205}

References Nektar::ErrorUtil::efatal, NEKERROR, and Nektar::MultiRegions::NullGlobalLinSysKey().

Referenced by LinearAdvectionDiffusionReactionSolve().

◆ v_LinearAdvectionReactionSolve()

void Nektar::MultiRegions::ExpList::v_LinearAdvectionReactionSolve ( const Array< OneD, Array< OneD, NekDouble > > &  velocity,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const NekDouble  lambda,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 5207 of file ExpList.cpp.

5213{
5215 "This method is not defined or valid for this class type");
5216}

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

Referenced by LinearAdvectionReactionSolve().

◆ v_LocalToGlobal() [1/2]

void Nektar::MultiRegions::ExpList::v_LocalToGlobal ( bool  UseComm)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField3DHomogeneous2D.

Definition at line 5346 of file ExpList.cpp.

5347{
5349 "This method is not defined or valid for this class type");
5350}

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

Referenced by LocalToGlobal().

◆ v_LocalToGlobal() [2/2]

void Nektar::MultiRegions::ExpList::v_LocalToGlobal ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  UseComm 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 5352 of file ExpList.cpp.

5356{
5358 "This method is not defined or valid for this class type");
5359}

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

◆ v_MultiplyByInvMassMatrix()

void Nektar::MultiRegions::ExpList::v_MultiplyByInvMassMatrix ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 5172 of file ExpList.cpp.

5175{
5177 "This method is not defined or valid for this class type");
5178}

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

Referenced by MultiplyByInvMassMatrix().

◆ v_NormVectorIProductWRTBase() [1/2]

void Nektar::MultiRegions::ExpList::v_NormVectorIProductWRTBase ( Array< OneD, Array< OneD, NekDouble > > &  V,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 5277 of file ExpList.cpp.

5279{
5280 Array<OneD, NekDouble> tmp;
5281 switch (GetCoordim(0))
5282 {
5283 case 1:
5284 {
5285 for (int i = 0; i < GetExpSize(); ++i)
5286 {
5287 (*m_exp)[i]->NormVectorIProductWRTBase(
5288 V[0] + GetPhys_Offset(i),
5289 tmp = outarray + GetCoeff_Offset(i));
5290 }
5291 }
5292 break;
5293 case 2:
5294 {
5295 for (int i = 0; i < GetExpSize(); ++i)
5296 {
5297 (*m_exp)[i]->NormVectorIProductWRTBase(
5298 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5299 tmp = outarray + GetCoeff_Offset(i));
5300 }
5301 }
5302 break;
5303 case 3:
5304 {
5305 for (int i = 0; i < GetExpSize(); ++i)
5306 {
5307 (*m_exp)[i]->NormVectorIProductWRTBase(
5308 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5309 V[2] + GetPhys_Offset(i),
5310 tmp = outarray + GetCoeff_Offset(i));
5311 }
5312 }
5313 break;
5314 default:
5315 NEKERROR(ErrorUtil::efatal, "Dimension not supported");
5316 break;
5317 }
5318}
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
Definition: ExpList.h:2078
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2038

References Nektar::ErrorUtil::efatal, GetCoeff_Offset(), GetCoordim(), GetExpSize(), GetPhys_Offset(), and NEKERROR.

◆ v_NormVectorIProductWRTBase() [2/2]

void Nektar::MultiRegions::ExpList::v_NormVectorIProductWRTBase ( Array< OneD, const NekDouble > &  V1,
Array< OneD, const NekDouble > &  V2,
Array< OneD, NekDouble > &  outarray,
int  BndID 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 5267 of file ExpList.cpp.

5272{
5274 "This method is not defined or valid for this class type");
5275}

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

Referenced by NormVectorIProductWRTBase().

◆ v_PeriodicBwdCopy()

void Nektar::MultiRegions::ExpList::v_PeriodicBwdCopy ( const Array< OneD, const NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5691 of file ExpList.cpp.

5694{
5695 NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
5696}

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

Referenced by PeriodicBwdCopy().

◆ v_PhysDeriv() [1/3]

void Nektar::MultiRegions::ExpList::v_PhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 
)
protectedvirtual

Given a function \(f(\boldsymbol{x})\) evaluated at the quadrature points, this function calculates the derivatives \(\frac{d}{dx_1}\), \(\frac{d}{dx_2}\) and \(\frac{d}{dx_3}\) of the function \(f(\boldsymbol{x})\) at the same quadrature points. The local distribution of the quadrature points allows an elemental evaluation of the derivative. This is done by a call to the function StdRegions::StdExpansion::PhysDeriv.

Parameters
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
out_d0The discrete evaluation of the derivative \(\frac{d}{dx_1}\) will be stored in this array of size \(Q_{\mathrm{tot}}\).
out_d1The discrete evaluation of the derivative \(\frac{d}{dx_2}\) will be stored in this array of size \(Q_{\mathrm{tot}}\). Note that if no memory is allocated for out_d1, the derivative \(\frac{d}{dx_2}\) will not be calculated.
out_d2The discrete evaluation of the derivative \(\frac{d}{dx_3}\) will be stored in this array of size \(Q_{\mathrm{tot}}\). Note that if no memory is allocated for out_d2, the derivative \(\frac{d}{dx_3}\) will not be calculated.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 2142 of file ExpList.cpp.

2146{
2147 Array<OneD, NekDouble> e_out_d0;
2148 Array<OneD, NekDouble> e_out_d1;
2149 Array<OneD, NekDouble> e_out_d2;
2150
2151 // initialise if required
2153 {
2154 for (int i = 0; i < m_collections.size(); ++i)
2155 {
2157 }
2159 }
2160
2161 int offset{0};
2162 LibUtilities::Timer timer;
2163 timer.Start();
2164 for (int i = 0; i < m_collections.size(); ++i)
2165 {
2166 e_out_d0 = out_d0 + offset;
2167 e_out_d1 = out_d1 + offset;
2168 e_out_d2 = out_d2 + offset;
2169 m_collections[i].ApplyOperator(Collections::ePhysDeriv,
2170 inarray + offset, e_out_d0, e_out_d1,
2171 e_out_d2);
2172 offset += m_collections[i].GetInputSize(Collections::ePhysDeriv);
2173 }
2174 timer.Stop();
2175 // Elapsed time
2176 timer.AccumulateRegion("Collections:PhysDeriv", 10);
2177}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::Collections::ePhysDeriv, m_collections, m_collectionsDoInit, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

Referenced by PhysDeriv(), and v_PhysDeriv().

◆ v_PhysDeriv() [2/3]

void Nektar::MultiRegions::ExpList::v_PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d 
)
protectedvirtual

Definition at line 2179 of file ExpList.cpp.

2182{
2183 Direction edir = DirCartesianMap[dir];
2184 v_PhysDeriv(edir, inarray, out_d);
2185}
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:87

References Nektar::MultiRegions::DirCartesianMap, and v_PhysDeriv().

◆ v_PhysDeriv() [3/3]

void Nektar::MultiRegions::ExpList::v_PhysDeriv ( Direction  edir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 2187 of file ExpList.cpp.

2190{
2191 int i;
2192 if (edir == MultiRegions::eS)
2193 {
2194 Array<OneD, NekDouble> e_out_ds;
2195 for (i = 0; i < (*m_exp).size(); ++i)
2196 {
2197 e_out_ds = out_d + m_phys_offset[i];
2198 (*m_exp)[i]->PhysDeriv_s(inarray + m_phys_offset[i], e_out_ds);
2199 }
2200 }
2201 else if (edir == MultiRegions::eN)
2202 {
2203 Array<OneD, NekDouble> e_out_dn;
2204 for (i = 0; i < (*m_exp).size(); i++)
2205 {
2206 e_out_dn = out_d + m_phys_offset[i];
2207 (*m_exp)[i]->PhysDeriv_n(inarray + m_phys_offset[i], e_out_dn);
2208 }
2209 }
2210 else
2211 {
2212 // initialise if required
2214 {
2215 for (int i = 0; i < m_collections.size(); ++i)
2216 {
2218 }
2220 }
2221
2222 // convert enum into int
2223 int intdir = (int)edir;
2224 Array<OneD, NekDouble> e_out_d;
2225 int offset{0};
2226 for (int i = 0; i < m_collections.size(); ++i)
2227 {
2228 e_out_d = out_d + offset;
2229 m_collections[i].ApplyOperator(Collections::ePhysDeriv, intdir,
2230 inarray + offset, e_out_d);
2231 offset += m_collections[i].GetInputSize(Collections::ePhysDeriv);
2232 }
2233 }
2234}

References Nektar::MultiRegions::eN, Nektar::Collections::ePhysDeriv, Nektar::MultiRegions::eS, m_collections, m_collectionsDoInit, and m_phys_offset.

◆ v_PhysDirectionalDeriv()

void Nektar::MultiRegions::ExpList::v_PhysDirectionalDeriv ( const Array< OneD, const NekDouble > &  direction,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 2357 of file ExpList.cpp.

2361{
2362 int npts_e;
2363 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
2364 int nq = direction.size() / coordim;
2365
2366 Array<OneD, NekDouble> e_outarray;
2367 Array<OneD, NekDouble> e_MFdiv;
2368 Array<OneD, NekDouble> locdir;
2369
2370 for (int i = 0; i < (*m_exp).size(); ++i)
2371 {
2372 npts_e = (*m_exp)[i]->GetTotPoints();
2373 locdir = Array<OneD, NekDouble>(npts_e * coordim);
2374
2375 for (int k = 0; k < coordim; ++k)
2376 {
2377 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
2378 &locdir[k * npts_e], 1);
2379 }
2380
2381 (*m_exp)[i]->PhysDirectionalDeriv(inarray + m_phys_offset[i], locdir,
2382 e_outarray =
2383 outarray + m_phys_offset[i]);
2384 }
2385}

References m_phys_offset, and Vmath::Vcopy().

Referenced by PhysDirectionalDeriv().

◆ v_PhysGalerkinProjection1DScaled()

void Nektar::MultiRegions::ExpList::v_PhysGalerkinProjection1DScaled ( const NekDouble  scale,
const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 6602 of file ExpList.cpp.

6605{
6606 int cnt, cnt1;
6607
6608 cnt = cnt1 = 0;
6609
6610 switch (m_expType)
6611 {
6612 case e2D:
6613 {
6614 for (int i = 0; i < GetExpSize(); ++i)
6615 {
6616 // get new points key
6617 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6618 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6619 int npt0 = (int)pt0 * scale;
6620 int npt1 = (int)pt1 * scale;
6621
6622 LibUtilities::PointsKey newPointsKey0(
6623 npt0, (*m_exp)[i]->GetPointsType(0));
6624 LibUtilities::PointsKey newPointsKey1(
6625 npt1, (*m_exp)[i]->GetPointsType(1));
6626
6627 // Project points;
6629 newPointsKey0, newPointsKey1, &inarray[cnt],
6630 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6631 (*m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6632
6633 cnt += npt0 * npt1;
6634 cnt1 += pt0 * pt1;
6635 }
6636 }
6637 break;
6638 case e3D:
6639 {
6640 for (int i = 0; i < GetExpSize(); ++i)
6641 {
6642 // get new points key
6643 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6644 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6645 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6646 int npt0 = (int)pt0 * scale;
6647 int npt1 = (int)pt1 * scale;
6648 int npt2 = (int)pt2 * scale;
6649
6650 LibUtilities::PointsKey newPointsKey0(
6651 npt0, (*m_exp)[i]->GetPointsType(0));
6652 LibUtilities::PointsKey newPointsKey1(
6653 npt1, (*m_exp)[i]->GetPointsType(1));
6654 LibUtilities::PointsKey newPointsKey2(
6655 npt2, (*m_exp)[i]->GetPointsType(2));
6656
6657 // Project points;
6659 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6660 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6661 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
6662 (*m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6663
6664 cnt += npt0 * npt1 * npt2;
6665 cnt1 += pt0 * pt1 * pt2;
6666 }
6667 }
6668 break;
6669 default:
6670 {
6671 NEKERROR(ErrorUtil::efatal, "not setup for this expansion");
6672 }
6673 break;
6674 }
6675}
void PhysGalerkinProject3D(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)
void PhysGalerkinProject2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)

References Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, Nektar::ErrorUtil::efatal, GetExpSize(), m_exp, m_expType, NEKERROR, Nektar::LibUtilities::PhysGalerkinProject2D(), and Nektar::LibUtilities::PhysGalerkinProject3D().

Referenced by PhysGalerkinProjection1DScaled().

◆ v_PhysInterp1DScaled()

void Nektar::MultiRegions::ExpList::v_PhysInterp1DScaled ( const NekDouble  scale,
const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 5981 of file ExpList.cpp.

5984{
5985 // the scaling factor for the PhysInterp1DScaled is given as NekDouble
5986 // however inside Collections it is treated as a FactorMap
5987 // defining needed FactorMap to pass the scaling factor as an input to
5988 // Collections
5990 // Updating the FactorMap according to the scale input
5992 LibUtilities::Timer timer;
5993
5994 // initialise if required
5995 if (m_collections.size() &&
5997 {
5998 for (int i = 0; i < m_collections.size(); ++i)
5999 {
6002 }
6003 }
6004 // once the collections are initialized, check for the scaling factor
6005 for (int i = 0; i < m_collections.size(); ++i)
6006
6007 {
6009 factors);
6010 }
6011 LIKWID_MARKER_START("v_PhysInterp1DScaled");
6012 timer.Start();
6013 Array<OneD, NekDouble> tmp;
6014 int input_offset{0};
6015 int output_offset{0};
6016 for (int i = 0; i < m_collections.size(); ++i)
6017 {
6019 inarray + input_offset,
6020 tmp = outarray + output_offset);
6021 input_offset +=
6023 output_offset +=
6025 }
6026 timer.Stop();
6027 LIKWID_MARKER_STOP("v_PhysInterp1DScaled");
6028 timer.AccumulateRegion("Collections:PhysInterp1DScaled", 10);
6029}
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:430

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::StdRegions::eFactorConst, Nektar::Collections::ePhysInterp1DScaled, Nektar::VarcoeffHashingTest::factors, LIKWID_MARKER_START, LIKWID_MARKER_STOP, m_collections, m_collectionsDoInit, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

Referenced by PhysInterp1DScaled().

◆ v_Reset()

void Nektar::MultiRegions::ExpList::v_Reset ( )
protectedvirtual

Reset geometry information, metrics, matrix managers and geometry information.

This routine clears all matrix managers and resets all geometry information, which allows the geometry information to be dynamically updated as the solver is run.

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 3332 of file ExpList.cpp.

3333{
3334 // Reset matrix managers.
3335 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3336 LocalRegions::MatrixKey::opLess>::ClearManager();
3337 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3338 LocalRegions::MatrixKey::opLess>::ClearManager();
3339
3340 // Reset block matrix map
3341 m_blockMat->clear();
3342
3343 // Loop over all elements and reset geometry information.
3344 for (int i = 0; i < m_exp->size(); ++i)
3345 {
3346 (*m_exp)[i]->GetGeom()->Reset(m_graph->GetCurvedEdges(),
3347 m_graph->GetCurvedFaces());
3348 }
3349
3350 // Loop over all elements and rebuild geometric factors.
3351 for (int i = 0; i < m_exp->size(); ++i)
3352 {
3353 (*m_exp)[i]->Reset();
3354 }
3355
3356 CreateCollections(Collections::eNoImpType); // @TODO: Might need to pass in
3357 // correct type here
3358}

References CreateCollections(), Nektar::Collections::eNoImpType, m_blockMat, m_exp, and m_graph.

Referenced by Reset(), and Nektar::MultiRegions::DisContField::v_Reset().

◆ v_SetBndCondBwdWeight()

void Nektar::MultiRegions::ExpList::v_SetBndCondBwdWeight ( const int  index,
const NekDouble  value 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 5142 of file ExpList.cpp.

5144{
5146 "v_setBndCondBwdWeight is not defined for this class type");
5147}

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

Referenced by SetBndCondBwdWeight().

◆ v_SetHomo1DSpecVanVisc()

virtual void Nektar::MultiRegions::ExpList::v_SetHomo1DSpecVanVisc ( Array< OneD, NekDouble visc)
inlineprotectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1472 of file ExpList.h.

1474 {
1476 "This method is not defined or valid for this class type");
1477 }

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

Referenced by SetHomo1DSpecVanVisc().

◆ v_SetHomoLen()

void Nektar::MultiRegions::ExpList::v_SetHomoLen ( const NekDouble  lhom)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3956 of file ExpList.cpp.

3957{
3959 "This method is not defined or valid for this class type");
3960}

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

Referenced by SetHomoLen().

◆ v_SetUpPhysNormals()

void Nektar::MultiRegions::ExpList::v_SetUpPhysNormals ( )
protectedvirtual

: Set up a normal along the trace elements between two elements at elemental level

Definition at line 5496 of file ExpList.cpp.

5497{
5498 for (int i = 0; i < m_exp->size(); ++i)
5499 {
5500 for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
5501 {
5502 (*m_exp)[i]->ComputeTraceNormal(j);
5503 }
5504 }
5505}

References m_exp.

Referenced by SetUpPhysNormals().

◆ v_SmoothField()

void Nektar::MultiRegions::ExpList::v_SmoothField ( Array< OneD, NekDouble > &  field)
protectedvirtual

This function smooth a field after some calculaitons which have been done elementally.

Parameters
fieldAn array containing the field in physical space

Reimplemented in Nektar::MultiRegions::ContField, and Nektar::MultiRegions::ContField3DHomogeneous1D.

Definition at line 2478 of file ExpList.cpp.

2479{
2480 // Do nothing unless the method is implemented in the appropriate
2481 // class, i.e. ContField1D,ContField2D, etc.
2482
2483 // So far it has been implemented just for ContField2D and
2484 // ContField3DHomogeneous1D
2485
2486 // Block in case users try the smoothing with a modal expansion.
2487 // Maybe a different techique for the smoothing require
2488 // implementation for modal basis.
2489
2490 ASSERTL0((*m_exp)[0]->GetBasisType(0) == LibUtilities::eGLL_Lagrange ||
2491 (*m_exp)[0]->GetBasisType(0) == LibUtilities::eGauss_Lagrange,
2492 "Smoothing is currently not allowed unless you are using "
2493 "a nodal base for efficiency reasons. The implemented "
2494 "smoothing technique requires the mass matrix inversion "
2495 "which is trivial just for GLL_LAGRANGE_SEM and "
2496 "GAUSS_LAGRANGE_SEMexpansions.");
2497}

References ASSERTL0, Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGLL_Lagrange, and m_exp.

Referenced by SmoothField().

◆ v_UnsetGlobalLinSys()

void Nektar::MultiRegions::ExpList::v_UnsetGlobalLinSys ( GlobalLinSysKey  key,
bool  clearLocalMatrices 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 3990 of file ExpList.cpp.

3992{
3994 "UnsetGlobalLinSys not implemented for ExpList.");
3995}

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

Referenced by UnsetGlobalLinSys().

◆ v_UpdateBndCondExpansion()

std::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::v_UpdateBndCondExpansion ( int  i)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 4481 of file ExpList.cpp.

4483{
4485 "This method is not defined or valid for this class type");
4486 static std::shared_ptr<ExpList> result;
4487 return result;
4488}

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

Referenced by UpdateBndCondExpansion().

◆ v_UpdateBndConditions()

Array< OneD, SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::v_UpdateBndConditions ( )
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 5711 of file ExpList.cpp.

5713{
5715 "This method is not defined or valid for this class type");
5716 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
5717 return result;
5718}

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

Referenced by UpdateBndConditions().

◆ v_Upwind() [1/2]

void Nektar::MultiRegions::ExpList::v_Upwind ( const Array< OneD, const Array< OneD, NekDouble > > &  Vec,
const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  Upwind 
)
protectedvirtual

Upwind the left and right states given by the Arrays Fwd and Bwd using the vector quantity Vec and ouput the upwinded value in the array upwind.

Parameters
VecVelocity field.
FwdLeft state.
BwdRight state.
UpwindOutput vector.

Definition at line 4500 of file ExpList.cpp.

4504{
4505 switch (m_expType)
4506 {
4507 case e1D:
4508 {
4509 int i, j, k, e_npoints, offset;
4510 Array<OneD, NekDouble> normals;
4511 NekDouble Vn;
4512
4513 // Assume whole array is of same coordimate dimension
4514 int coordim = GetCoordim(0);
4515
4516 ASSERTL1(Vec.size() >= coordim,
4517 "Input vector does not have sufficient dimensions to "
4518 "match coordim");
4519
4520 // Process each expansion
4521 for (i = 0; i < m_exp->size(); ++i)
4522 {
4523 // Get the number of points in the expansion and the normals.
4524 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4525 normals = (*m_exp)[i]->GetPhysNormals();
4526
4527 // Get the physical data offset of the expansion in m_phys.
4528 offset = m_phys_offset[i];
4529
4530 // Compute each data point.
4531 for (j = 0; j < e_npoints; ++j)
4532 {
4533 // Calculate normal velocity.
4534 Vn = 0.0;
4535 for (k = 0; k < coordim; ++k)
4536 {
4537 Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
4538 }
4539
4540 // Upwind based on direction of normal velocity.
4541 if (Vn > 0.0)
4542 {
4543 Upwind[offset + j] = Fwd[offset + j];
4544 }
4545 else
4546 {
4547 Upwind[offset + j] = Bwd[offset + j];
4548 }
4549 }
4550 }
4551 }
4552 break;
4553 default:
4555 "This method is not defined or valid for this class type");
4556 break;
4557 }
4558}

References ASSERTL1, Nektar::MultiRegions::e1D, Nektar::ErrorUtil::efatal, GetCoordim(), m_exp, m_expType, m_phys_offset, NEKERROR, and Upwind().

Referenced by Upwind().

◆ v_Upwind() [2/2]

void Nektar::MultiRegions::ExpList::v_Upwind ( const Array< OneD, const NekDouble > &  Vn,
const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  Upwind 
)
protectedvirtual

One-dimensional upwind.

See also
ExpList::Upwind( const Array<OneD, const Array<OneD, NekDouble> >, const Array<OneD, const NekDouble>, const Array<OneD, const NekDouble>, Array<OneD, NekDouble>, int)
Parameters
VnVelocity field.
FwdLeft state.
BwdRight state.
UpwindOutput vector.

Definition at line 4573 of file ExpList.cpp.

4577{
4578 ASSERTL1(Vn.size() >= m_npoints, "Vn is not of sufficient length");
4579 ASSERTL1(Fwd.size() >= m_npoints, "Fwd is not of sufficient length");
4580 ASSERTL1(Bwd.size() >= m_npoints, "Bwd is not of sufficient length");
4581 ASSERTL1(Upwind.size() >= m_npoints, "Upwind is not of sufficient length");
4582
4583 // Process each point in the expansion.
4584 for (int j = 0; j < m_npoints; ++j)
4585 {
4586 // Upwind based on one-dimensional velocity.
4587 if (Vn[j] > 0.0)
4588 {
4589 Upwind[j] = Fwd[j];
4590 }
4591 else
4592 {
4593 Upwind[j] = Bwd[j];
4594 }
4595 }
4596}

References ASSERTL1, m_npoints, and Upwind().

◆ v_VectorFlux()

NekDouble Nektar::MultiRegions::ExpList::v_VectorFlux ( const Array< OneD, Array< OneD, NekDouble > > &  inarray)
protectedvirtual

Definition at line 3912 of file ExpList.cpp.

3914{
3915 NekDouble flux = 0.0;
3916 int i = 0;
3917 int j;
3918
3919 for (i = 0; i < (*m_exp).size(); ++i)
3920 {
3921 Array<OneD, Array<OneD, NekDouble>> tmp(inarray.size());
3922 for (j = 0; j < inarray.size(); ++j)
3923 {
3924 tmp[j] = Array<OneD, NekDouble>(inarray[j] + m_phys_offset[i]);
3925 }
3926 flux += (*m_exp)[i]->VectorFlux(tmp);
3927 }
3928
3929 return flux;
3930}

References m_phys_offset.

Referenced by VectorFlux().

◆ v_WriteTecplotConnectivity()

void Nektar::MultiRegions::ExpList::v_WriteTecplotConnectivity ( std::ostream &  outfile,
int  expansion 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpList3DHomogeneous1D.

Definition at line 3508 of file ExpList.cpp.

3509{
3510 int i, j, k, l;
3511 int nbase = (*m_exp)[0]->GetNumBases();
3512 int cnt = 0;
3513
3514 std::shared_ptr<LocalRegions::ExpansionVector> exp = m_exp;
3515
3516 if (expansion != -1)
3517 {
3518 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
3520 (*exp)[0] = (*m_exp)[expansion];
3521 }
3522
3523 if (nbase == 2)
3524 {
3525 for (i = 0; i < (*exp).size(); ++i)
3526 {
3527 const int np0 = (*exp)[i]->GetNumPoints(0);
3528 const int np1 = (*exp)[i]->GetNumPoints(1);
3529
3530 for (j = 1; j < np1; ++j)
3531 {
3532 for (k = 1; k < np0; ++k)
3533 {
3534 outfile << cnt + (j - 1) * np0 + k << " ";
3535 outfile << cnt + (j - 1) * np0 + k + 1 << " ";
3536 outfile << cnt + j * np0 + k + 1 << " ";
3537 outfile << cnt + j * np0 + k << endl;
3538 }
3539 }
3540
3541 cnt += np0 * np1;
3542 }
3543 }
3544 else if (nbase == 3)
3545 {
3546 for (i = 0; i < (*exp).size(); ++i)
3547 {
3548 const int np0 = (*exp)[i]->GetNumPoints(0);
3549 const int np1 = (*exp)[i]->GetNumPoints(1);
3550 const int np2 = (*exp)[i]->GetNumPoints(2);
3551 const int np01 = np0 * np1;
3552
3553 for (j = 1; j < np2; ++j)
3554 {
3555 for (k = 1; k < np1; ++k)
3556 {
3557 for (l = 1; l < np0; ++l)
3558 {
3559 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
3560 << " ";
3561 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
3562 << " ";
3563 outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
3564 << " ";
3565 outfile << cnt + (j - 1) * np01 + k * np0 + l << " ";
3566 outfile << cnt + j * np01 + (k - 1) * np0 + l << " ";
3567 outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
3568 << " ";
3569 outfile << cnt + j * np01 + k * np0 + l + 1 << " ";
3570 outfile << cnt + j * np01 + k * np0 + l << endl;
3571 }
3572 }
3573 }
3574 cnt += np0 * np1 * np2;
3575 }
3576 }
3577 else
3578 {
3579 NEKERROR(ErrorUtil::efatal, "Not set up for this dimension");
3580 }
3581}
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:68

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

Referenced by WriteTecplotConnectivity().

◆ v_WriteTecplotField()

void Nektar::MultiRegions::ExpList::v_WriteTecplotField ( std::ostream &  outfile,
int  expansion 
)
protectedvirtual

Write Tecplot Files Field

Parameters
outfileOutput file name.
expansionExpansion that is considered

Definition at line 3588 of file ExpList.cpp.

3589{
3590 if (expansion == -1)
3591 {
3592 int totpoints = GetTotPoints();
3593 if (m_physState == false)
3594 {
3596 }
3597
3598 for (int i = 0; i < totpoints; ++i)
3599 {
3600 outfile << m_phys[i] << " ";
3601 if (i % 1000 == 0 && i)
3602 {
3603 outfile << std::endl;
3604 }
3605 }
3606 outfile << std::endl;
3607 }
3608 else
3609 {
3610 int nPoints = (*m_exp)[expansion]->GetTotPoints();
3611
3612 for (int i = 0; i < nPoints; ++i)
3613 {
3614 outfile << m_phys[i + m_phys_offset[expansion]] << " ";
3615 }
3616
3617 outfile << std::endl;
3618 }
3619}

References BwdTrans(), GetTotPoints(), m_coeffs, m_phys, m_phys_offset, and m_physState.

Referenced by WriteTecplotField().

◆ v_WriteTecplotHeader()

void Nektar::MultiRegions::ExpList::v_WriteTecplotHeader ( std::ostream &  outfile,
std::string  var = "" 
)
protectedvirtual

Write Tecplot Files Header

Parameters
outfileOutput file name.
varvariables names

Definition at line 3377 of file ExpList.cpp.

3378{
3379 if (GetNumElmts() == 0)
3380 {
3381 return;
3382 }
3383
3384 int coordim = GetExp(0)->GetCoordim();
3385 char vars[3] = {'x', 'y', 'z'};
3386
3387 if (m_expType == e3DH1D)
3388 {
3389 coordim += 1;
3390 }
3391 else if (m_expType == e3DH2D)
3392 {
3393 coordim += 2;
3394 }
3395
3396 outfile << "Variables = x";
3397 for (int i = 1; i < coordim; ++i)
3398 {
3399 outfile << ", " << vars[i];
3400 }
3401
3402 if (var.size() > 0)
3403 {
3404 outfile << ", " << var;
3405 }
3406
3407 outfile << std::endl << std::endl;
3408}

References Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, GetExp(), GetNumElmts(), and m_expType.

Referenced by WriteTecplotHeader().

◆ v_WriteTecplotZone()

void Nektar::MultiRegions::ExpList::v_WriteTecplotZone ( std::ostream &  outfile,
int  expansion 
)
protectedvirtual

Write Tecplot Files Zone

Parameters
outfileOutput file name.
expansionExpansion that is considered

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous1D, Nektar::MultiRegions::ExpList2DHomogeneous2D, and Nektar::MultiRegions::ExpList3DHomogeneous2D.

Definition at line 3415 of file ExpList.cpp.

3416{
3417 int i, j;
3418 int coordim = GetCoordim(0);
3419 int nPoints = GetTotPoints();
3420 int nBases = (*m_exp)[0]->GetNumBases();
3421 int numBlocks = 0;
3422
3423 Array<OneD, Array<OneD, NekDouble>> coords(3);
3424
3425 if (expansion == -1)
3426 {
3427 nPoints = GetTotPoints();
3428
3429 coords[0] = Array<OneD, NekDouble>(nPoints);
3430 coords[1] = Array<OneD, NekDouble>(nPoints);
3431 coords[2] = Array<OneD, NekDouble>(nPoints);
3432
3433 GetCoords(coords[0], coords[1], coords[2]);
3434
3435 for (i = 0; i < m_exp->size(); ++i)
3436 {
3437 int numInt = 1;
3438
3439 for (j = 0; j < nBases; ++j)
3440 {
3441 numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
3442 }
3443
3444 numBlocks += numInt;
3445 }
3446 }
3447 else
3448 {
3449 nPoints = (*m_exp)[expansion]->GetTotPoints();
3450
3451 coords[0] = Array<OneD, NekDouble>(nPoints);
3452 coords[1] = Array<OneD, NekDouble>(nPoints);
3453 coords[2] = Array<OneD, NekDouble>(nPoints);
3454
3455 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3456
3457 numBlocks = 1;
3458 for (j = 0; j < nBases; ++j)
3459 {
3460 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
3461 }
3462 }
3463
3464 if (m_expType == e3DH1D)
3465 {
3466 nBases += 1;
3467 coordim += 1;
3468 int nPlanes = GetZIDs().size();
3469 NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
3470 numBlocks = (int)tmp;
3471 }
3472 else if (m_expType == e3DH2D)
3473 {
3474 nBases += 2;
3475 coordim += 1;
3476 }
3477
3478 outfile << "Zone, N=" << nPoints << ", E=" << numBlocks << ", F=FEBlock";
3479
3480 switch (nBases)
3481 {
3482 case 2:
3483 outfile << ", ET=QUADRILATERAL" << std::endl;
3484 break;
3485 case 3:
3486 outfile << ", ET=BRICK" << std::endl;
3487 break;
3488 default:
3489 NEKERROR(ErrorUtil::efatal, "Not set up for this type of output");
3490 break;
3491 }
3492
3493 // Write out coordinates
3494 for (j = 0; j < coordim; ++j)
3495 {
3496 for (i = 0; i < nPoints; ++i)
3497 {
3498 outfile << coords[j][i] << " ";
3499 if (i % 1000 == 0 && i)
3500 {
3501 outfile << std::endl;
3502 }
3503 }
3504 outfile << std::endl;
3505 }
3506}
Array< OneD, const unsigned int > GetZIDs(void)
This function returns a vector containing the wave numbers in z-direction associated with the 3D homo...
Definition: ExpList.h:590
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points .
Definition: ExpList.h:1770

References Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, Nektar::ErrorUtil::efatal, GetCoordim(), GetCoords(), GetTotPoints(), GetZIDs(), m_exp, m_expType, and NEKERROR.

Referenced by WriteTecplotZone().

◆ v_WriteVtkPieceData()

void Nektar::MultiRegions::ExpList::v_WriteVtkPieceData ( std::ostream &  outfile,
int  expansion,
std::string  var 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 3775 of file ExpList.cpp.

3777{
3778 int i;
3779 int nq = (*m_exp)[expansion]->GetTotPoints();
3780
3781 // printing the fields of that zone
3782 outfile << R"( <DataArray type="Float64" Name=")" << var << "\">"
3783 << endl;
3784 outfile << " ";
3785
3786 const Array<OneD, NekDouble> phys = m_phys + m_phys_offset[expansion];
3787
3788 for (i = 0; i < nq; ++i)
3789 {
3790 outfile << (fabs(phys[i]) < NekConstants::kNekZeroTol ? 0 : phys[i])
3791 << " ";
3792 }
3793 outfile << endl;
3794 outfile << " </DataArray>" << endl;
3795}
static const NekDouble kNekZeroTol

References Nektar::NekConstants::kNekZeroTol, m_phys, and m_phys_offset.

Referenced by WriteVtkPieceData().

◆ v_WriteVtkPieceHeader()

void Nektar::MultiRegions::ExpList::v_WriteVtkPieceHeader ( std::ostream &  outfile,
int  expansion,
int  istrip 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous1D, Nektar::MultiRegions::ExpList2DHomogeneous2D, Nektar::MultiRegions::ExpList3DHomogeneous1D, and Nektar::MultiRegions::ExpList3DHomogeneous2D.

Definition at line 3635 of file ExpList.cpp.

3637{
3638 int i, j, k;
3639 int nbase = (*m_exp)[expansion]->GetNumBases();
3640 int ntot = (*m_exp)[expansion]->GetTotPoints();
3641 int nquad[3];
3642
3643 int ntotminus = 1;
3644 for (i = 0; i < nbase; ++i)
3645 {
3646 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
3647 ntotminus *= (nquad[i] - 1);
3648 }
3649
3650 Array<OneD, NekDouble> coords[3];
3651 coords[0] = Array<OneD, NekDouble>(ntot, 0.0);
3652 coords[1] = Array<OneD, NekDouble>(ntot, 0.0);
3653 coords[2] = Array<OneD, NekDouble>(ntot, 0.0);
3654 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3655
3656 outfile << " <Piece NumberOfPoints=\"" << ntot << "\" NumberOfCells=\""
3657 << ntotminus << "\">" << endl;
3658 outfile << " <Points>" << endl;
3659 outfile << " <DataArray type=\"Float64\" "
3660 << R"(NumberOfComponents="3" format="ascii">)" << endl;
3661 outfile << " ";
3662 for (i = 0; i < ntot; ++i)
3663 {
3664 for (j = 0; j < 3; ++j)
3665 {
3666 outfile << setprecision(8) << scientific << (float)coords[j][i]
3667 << " ";
3668 }
3669 outfile << endl;
3670 }
3671 outfile << endl;
3672 outfile << " </DataArray>" << endl;
3673 outfile << " </Points>" << endl;
3674 outfile << " <Cells>" << endl;
3675 outfile << " <DataArray type=\"Int32\" "
3676 << R"(Name="connectivity" format="ascii">)" << endl;
3677
3678 int ns = 0; // pow(2,dim) for later usage
3679 string ostr;
3680 switch (m_expType)
3681 {
3682 case e1D:
3683 {
3684 ns = 2;
3685 ostr = "3 ";
3686 for (i = 0; i < nquad[0] - 1; ++i)
3687 {
3688 outfile << i << " " << i + 1 << endl;
3689 }
3690 }
3691 break;
3692 case e2D:
3693 {
3694 ns = 4;
3695 ostr = "9 ";
3696 for (i = 0; i < nquad[0] - 1; ++i)
3697 {
3698 for (j = 0; j < nquad[1] - 1; ++j)
3699 {
3700 outfile << j * nquad[0] + i << " " << j * nquad[0] + i + 1
3701 << " " << (j + 1) * nquad[0] + i + 1 << " "
3702 << (j + 1) * nquad[0] + i << endl;
3703 }
3704 }
3705 }
3706 break;
3707 case e3D:
3708 {
3709 ns = 8;
3710 ostr = "12 ";
3711 for (i = 0; i < nquad[0] - 1; ++i)
3712 {
3713 for (j = 0; j < nquad[1] - 1; ++j)
3714 {
3715 for (k = 0; k < nquad[2] - 1; ++k)
3716 {
3717 outfile
3718 << k * nquad[0] * nquad[1] + j * nquad[0] + i << " "
3719 << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3720 << " "
3721 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3722 i + 1
3723 << " "
3724 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3725 << " "
3726 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3727 << " "
3728 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3729 i + 1
3730 << " "
3731 << (k + 1) * nquad[0] * nquad[1] +
3732 (j + 1) * nquad[0] + i + 1
3733 << " "
3734 << (k + 1) * nquad[0] * nquad[1] +
3735 (j + 1) * nquad[0] + i
3736 << " " << endl;
3737 }
3738 }
3739 }
3740 }
3741 break;
3742 default:
3743 break;
3744 }
3745
3746 outfile << endl;
3747 outfile << " </DataArray>" << endl;
3748 outfile << " <DataArray type=\"Int32\" "
3749 << R"(Name="offsets" format="ascii">)" << endl;
3750 for (i = 0; i < ntotminus; ++i)
3751 {
3752 outfile << i * ns + ns << " ";
3753 }
3754 outfile << endl;
3755 outfile << " </DataArray>" << endl;
3756 outfile << " <DataArray type=\"UInt8\" "
3757 << R"(Name="types" format="ascii">)" << endl;
3758 for (i = 0; i < ntotminus; ++i)
3759 {
3760 outfile << ostr;
3761 }
3762 outfile << endl;
3763 outfile << " </DataArray>" << endl;
3764 outfile << " </Cells>" << endl;
3765 outfile << " <PointData>" << endl;
3766}

References Nektar::MultiRegions::e1D, Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, and m_expType.

Referenced by WriteVtkPieceHeader().

◆ VectorFlux()

NekDouble Nektar::MultiRegions::ExpList::VectorFlux ( const Array< OneD, Array< OneD, NekDouble > > &  inarray)
inline

Definition at line 568 of file ExpList.h.

569 {
570 return v_VectorFlux(inarray);
571 }
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Definition: ExpList.cpp:3912

References v_VectorFlux().

◆ WriteTecplotConnectivity()

void Nektar::MultiRegions::ExpList::WriteTecplotConnectivity ( std::ostream &  outfile,
int  expansion = -1 
)
inline

Definition at line 408 of file ExpList.h.

409 {
410 v_WriteTecplotConnectivity(outfile, expansion);
411 }
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3508

References v_WriteTecplotConnectivity().

◆ WriteTecplotField()

void Nektar::MultiRegions::ExpList::WriteTecplotField ( std::ostream &  outfile,
int  expansion = -1 
)
inline

Definition at line 404 of file ExpList.h.

405 {
406 v_WriteTecplotField(outfile, expansion);
407 }
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3588

References v_WriteTecplotField().

◆ WriteTecplotHeader()

void Nektar::MultiRegions::ExpList::WriteTecplotHeader ( std::ostream &  outfile,
std::string  var = "" 
)
inline

Definition at line 396 of file ExpList.h.

397 {
398 v_WriteTecplotHeader(outfile, var);
399 }
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:3377

References v_WriteTecplotHeader().

◆ WriteTecplotZone()

void Nektar::MultiRegions::ExpList::WriteTecplotZone ( std::ostream &  outfile,
int  expansion = -1 
)
inline

Definition at line 400 of file ExpList.h.

401 {
402 v_WriteTecplotZone(outfile, expansion);
403 }
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3415

References v_WriteTecplotZone().

◆ WriteVtkFooter()

void Nektar::MultiRegions::ExpList::WriteVtkFooter ( std::ostream &  outfile)

Definition at line 3629 of file ExpList.cpp.

3630{
3631 outfile << " </UnstructuredGrid>" << endl;
3632 outfile << "</VTKFile>" << endl;
3633}

◆ WriteVtkHeader()

void Nektar::MultiRegions::ExpList::WriteVtkHeader ( std::ostream &  outfile)

Definition at line 3621 of file ExpList.cpp.

3622{
3623 outfile << "<?xml version=\"1.0\"?>" << endl;
3624 outfile << R"(<VTKFile type="UnstructuredGrid" version="0.1" )"
3625 << "byte_order=\"LittleEndian\">" << endl;
3626 outfile << " <UnstructuredGrid>" << endl;
3627}

◆ WriteVtkPieceData()

void Nektar::MultiRegions::ExpList::WriteVtkPieceData ( std::ostream &  outfile,
int  expansion,
std::string  var = "v" 
)
inline

Definition at line 421 of file ExpList.h.

423 {
424 v_WriteVtkPieceData(outfile, expansion, var);
425 }
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:3775

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

void Nektar::MultiRegions::ExpList::WriteVtkPieceFooter ( std::ostream &  outfile,
int  expansion 
)

Definition at line 3768 of file ExpList.cpp.

3770{
3771 outfile << " </PointData>" << endl;
3772 outfile << " </Piece>" << endl;
3773}

◆ WriteVtkPieceHeader()

void Nektar::MultiRegions::ExpList::WriteVtkPieceHeader ( std::ostream &  outfile,
int  expansion,
int  istrip = 0 
)
inline

Definition at line 414 of file ExpList.h.

416 {
417 v_WriteVtkPieceHeader(outfile, expansion, istrip);
418 }
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:3635

References v_WriteVtkPieceHeader().

Member Data Documentation

◆ m_blockMat

BlockMatrixMapShPtr Nektar::MultiRegions::ExpList::m_blockMat
protected

Definition at line 1128 of file ExpList.h.

Referenced by GetBlockMatrix(), ResetMatrices(), and v_Reset().

◆ m_coeff_offset

Array<OneD, int> Nektar::MultiRegions::ExpList::m_coeff_offset
protected

◆ m_coeffs

Array<OneD, NekDouble> Nektar::MultiRegions::ExpList::m_coeffs
protected

Concatenation of all local expansion coefficients.

The array of length m_ncoeffs \(=N_{\mathrm{eof}}\) which is the concatenation of the local expansion coefficients \(\hat{u}_n^e\) over all \(N_{\mathrm{el}}\) elements

\[\mathrm{\texttt{m\_coeffs}}=\boldsymbol{\hat{u}}_{l} = \underline{\boldsymbol{\hat{u}}}^e = \left [ \begin{array}{c} \boldsymbol{\hat{u}}^{1} \ \ \boldsymbol{\hat{u}}^{2} \ \ \vdots \ \ \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ], \quad \mathrm{where}\quad \boldsymbol{\hat{u}}^{e}[n]=\hat{u}_n^{e}\]

Definition at line 1083 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField::Assemble(), GetCoeff(), GetCoeffs(), SetCoeff(), Nektar::MultiRegions::ExpList2DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList2DHomogeneous2D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous2D::SetCoeffPhys(), SetCoeffs(), SetCoeffsArray(), SetupCoeffPhys(), UpdateCoeffs(), v_AppendFieldData(), Nektar::MultiRegions::ExpListHomogeneous1D::v_AppendFieldData(), Nektar::MultiRegions::ExpListHomogeneous2D::v_AppendFieldData(), Nektar::MultiRegions::ContField::v_GlobalToLocal(), Nektar::MultiRegions::ContField::v_LocalToGlobal(), and v_WriteTecplotField().

◆ m_coeffsToElmt

Array<OneD, std::pair<int, int> > Nektar::MultiRegions::ExpList::m_coeffsToElmt
protected

m_coeffs to elemental value map

Definition at line 1127 of file ExpList.h.

Referenced by GetCoeffsToElmt(), and SetupCoeffPhys().

◆ m_collections

Collections::CollectionVector Nektar::MultiRegions::ExpList::m_collections
protected

◆ m_collectionsDoInit

std::vector<bool> Nektar::MultiRegions::ExpList::m_collectionsDoInit
protected

Vector of bools to act as an initialise on first call flag.

Definition at line 1121 of file ExpList.h.

Referenced by CreateCollections(), GeneralMatrixOp(), v_BwdTrans(), v_IProductWRTBase(), v_IProductWRTDerivBase(), v_PhysDeriv(), and v_PhysInterp1DScaled().

◆ m_comm

LibUtilities::CommSharedPtr Nektar::MultiRegions::ExpList::m_comm
protected

◆ m_elmtToExpId

std::unordered_map<int, int> Nektar::MultiRegions::ExpList::m_elmtToExpId
protected

◆ m_exp

std::shared_ptr<LocalRegions::ExpansionVector> Nektar::MultiRegions::ExpList::m_exp
protected

The list of local expansions.

The (shared pointer to the) vector containing (shared pointers to) all local expansions. The fact that the local expansions are all stored as a (pointer to a) #StdExpansion, the abstract base class for all local expansions, allows a general implementation where most of the routines for the derived classes are defined in the ExpList base class.

Definition at line 1118 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), Nektar::MultiRegions::ContField3DHomogeneous2D::ContField3DHomogeneous2D(), CreateCollections(), Nektar::MultiRegions::DisContField::DisContField(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous2D::DisContField3DHomogeneous2D(), EvalBasisNumModesMax(), EvalBasisNumModesMaxPerExp(), Nektar::MultiRegions::DisContField::EvaluateHDGPostProcessing(), ExpList(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), GenBlockMatrix(), GeneralGetFieldDefinitions(), GeneralMatrixOp(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), GenGlobalMatrix(), GenGlobalMatrixFull(), GetCoordim(), GetElmtNormalLength(), GetExp(), GetExpFromGeomId(), GetExpIndex(), Nektar::MultiRegions::DisContField::GetFwdBwdTracePhys(), GetNcoeffs(), GetShapeDimension(), GetTotPoints(), Nektar::MultiRegions::DisContField::IsLeftAdjacentTrace(), PhysEvaluate(), SetupCoeffPhys(), Nektar::MultiRegions::DisContField::SetUpDG(), Nektar::MultiRegions::DisContField::v_AddTraceIntegral(), v_ExtractDataToCoeffs(), Nektar::MultiRegions::ExpListHomogeneous1D::v_ExtractDataToCoeffs(), v_GetMovingFrames(), v_GetNormals(), v_PhysGalerkinProjection1DScaled(), v_Reset(), v_SetUpPhysNormals(), v_SmoothField(), Nektar::MultiRegions::ContField::v_UnsetGlobalLinSys(), v_Upwind(), v_WriteTecplotConnectivity(), and v_WriteTecplotZone().

◆ m_expType

ExpansionType Nektar::MultiRegions::ExpList::m_expType
protected

◆ m_graph

SpatialDomains::MeshGraphSharedPtr Nektar::MultiRegions::ExpList::m_graph
protected

◆ m_ncoeffs

int Nektar::MultiRegions::ExpList::m_ncoeffs
protected

◆ m_npoints

int Nektar::MultiRegions::ExpList::m_npoints
protected

◆ m_phys

Array<OneD, NekDouble> Nektar::MultiRegions::ExpList::m_phys
protected

The global expansion evaluated at the quadrature points.

The array of length m_npoints \(=Q_{\mathrm{tot}}\) containing the evaluation of \(u^{\delta}(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).

\[\mathrm{\texttt{m\_phys}}=\boldsymbol{u}_{l} = \underline{\boldsymbol{u}}^e = \left [ \begin{array}{c} \boldsymbol{u}^{1} \ \ \boldsymbol{u}^{2} \ \ \vdots \ \ \boldsymbol{u}^{{{N_{\mathrm{el}}}}} \end{array} \right ],\quad \mathrm{where}\quad \boldsymbol{u}^{e}[i]=u^{\delta}(\boldsymbol{x}_i)\]

Definition at line 1099 of file ExpList.h.

Referenced by GetPhys(), Integral(), Nektar::MultiRegions::ExpList2DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList2DHomogeneous2D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous2D::SetCoeffPhys(), SetPhys(), SetPhysArray(), SetupCoeffPhys(), UpdatePhys(), Nektar::MultiRegions::DisContField::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField::v_GetFwdBwdTracePhys(), v_WriteTecplotField(), v_WriteVtkPieceData(), Nektar::MultiRegions::ExpListHomogeneous1D::v_WriteVtkPieceData(), and Nektar::MultiRegions::ExpListHomogeneous2D::v_WriteVtkPieceData().

◆ m_phys_offset

Array<OneD, int> Nektar::MultiRegions::ExpList::m_phys_offset
protected

◆ m_physState

bool Nektar::MultiRegions::ExpList::m_physState
protected

The state of the array m_phys.

Indicates whether the array m_phys, created to contain the evaluation of \(u^{\delta}(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\), is filled with these values.

Definition at line 1107 of file ExpList.h.

Referenced by GetPhysState(), Integral(), SetPhys(), SetPhysState(), UpdatePhys(), Nektar::MultiRegions::DisContField::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_ExtractTracePhys(), and v_WriteTecplotField().

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::MultiRegions::ExpList::m_session
protected

◆ m_WaveSpace

bool Nektar::MultiRegions::ExpList::m_WaveSpace
protected