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

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:1676
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 UseGLLOnTri = false;
1301 // use GLL in all directions on Triangles if Continuous Expansion
1302 pSession->MatchSolverInfo("Projection", "Continuous", UseGLLOnTri, false);
1303
1304 bool DoOptOnCollection =
1305 m_session->DefinesCmdLineArgument("no-exp-opt") ? false : true;
1306 int cnt = 0;
1307 for (auto &compIt : domain)
1308 {
1309 bool IsNot0D = true; // Cehck for 0D expansion
1310 // Process each expansion in the region.
1311 for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
1312 {
1316 compIt.second->m_geomVec[j], PtBvec);
1317
1318 if ((SegGeom = std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1319 compIt.second->m_geomVec[j])))
1320 {
1321 if (meshdim == 1)
1322 {
1323 auto expInfo = expansions.find(SegGeom->GetGlobalID());
1324 eInfo = expInfo->second;
1325 }
1326 else // get bkey from Tri or Quad
1327 {
1328 // First, create the element stdExp that the edge belongs to
1330 graph->GetElementsFromEdge(SegGeom);
1331 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1332 // Currently we assume the elements adjacent to the edge
1333 // have the same type. So we directly fetch the first
1334 // element.
1335 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1336 int edge_id = elmts->at(0).second;
1338 graph->GetExpansionInfo(geom, variable);
1339 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1340 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1342
1343 if (geom->GetShapeType() == LibUtilities::eTriangle)
1344 {
1345 elmtStdExp = MemoryManager<
1346 StdRegions::StdTriExp>::AllocateSharedPtr(Ba, Bb);
1347 }
1348 else if (geom->GetShapeType() ==
1350 {
1351 elmtStdExp = MemoryManager<
1352 StdRegions::StdQuadExp>::AllocateSharedPtr(Ba, Bb);
1353 }
1354 else
1355 {
1357 "Fail to cast geom to a known 2D shape.");
1358 }
1359 // Then, get the trace basis key from the element stdExp,
1360 // which may be different from Ba and Bb.
1361 eInfo->m_basisKeyVector.push_back(
1362 elmtStdExp->GetTraceBasisKey(edge_id));
1363 }
1364 }
1365 else if ((TriGeom =
1366 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1367 compIt.second->m_geomVec[j])))
1368 {
1369 // First, create the element stdExp that the face belongs to
1371 graph->GetElementsFromFace(TriGeom);
1372 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1373 // Currently we assume the elements adjacent to the face have
1374 // the same type. So we directly fetch the first element.
1375 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1376 int face_id = elmts->at(0).second;
1377 auto expInfo = expansions.find(geom->GetGlobalID());
1378 ASSERTL0(expInfo != expansions.end(),
1379 "Failed to find expansion info");
1380 LibUtilities::BasisKey Ba =
1381 expInfo->second->m_basisKeyVector[0];
1382 LibUtilities::BasisKey Bb =
1383 expInfo->second->m_basisKeyVector[1];
1384 LibUtilities::BasisKey Bc =
1385 expInfo->second->m_basisKeyVector[2];
1387
1388 if (geom->GetShapeType() == LibUtilities::ePrism)
1389 {
1390 elmtStdExp = MemoryManager<
1391 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1392 }
1393 else if (geom->GetShapeType() == LibUtilities::eTetrahedron)
1394 {
1395 elmtStdExp =
1397 Ba, Bb, Bc);
1398 }
1399 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1400 {
1401 elmtStdExp =
1403 Ba, Bb, Bc);
1404 }
1405 else // hex cannot have tri surface
1406 {
1408 "Fail to cast geom to a known 3D shape.");
1409 }
1410 // Then, get the trace basis key from the element stdExp,
1411 // which may be different from Ba, Bb and Bc.
1412 LibUtilities::BasisKey TriBa =
1413 elmtStdExp->GetTraceBasisKey(face_id, 0, UseGLLOnTri);
1414 LibUtilities::BasisKey TriBb =
1415 elmtStdExp->GetTraceBasisKey(face_id, 1, UseGLLOnTri);
1416 // swap TriBa and TriBb orientation is transposed
1417 if (geom->GetForient(face_id) >= 9)
1418 {
1419 std::swap(TriBa, TriBb);
1420 }
1421
1422 eInfo->m_basisKeyVector.push_back(TriBa);
1423 eInfo->m_basisKeyVector.push_back(TriBb);
1424 }
1425 else if ((QuadGeom =
1426 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1427 compIt.second->m_geomVec[j])))
1428 {
1429 // First, create the element stdExp that the face belongs to
1431 graph->GetElementsFromFace(QuadGeom);
1432 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1433 // Currently we assume the elements adjacent to the face have
1434 // the same type. So we directly fetch the first element.
1435 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1436 int face_id = elmts->at(0).second;
1437 auto expInfo = expansions.find(geom->GetGlobalID());
1438 ASSERTL0(expInfo != expansions.end(),
1439 "Failed to find expansion info");
1440 LibUtilities::BasisKey Ba =
1441 expInfo->second->m_basisKeyVector[0];
1442 LibUtilities::BasisKey Bb =
1443 expInfo->second->m_basisKeyVector[1];
1444 LibUtilities::BasisKey Bc =
1445 expInfo->second->m_basisKeyVector[2];
1447
1448 if (geom->GetShapeType() == LibUtilities::ePrism)
1449 {
1450 elmtStdExp = MemoryManager<
1451 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1452 }
1453 else if (geom->GetShapeType() == LibUtilities::eHexahedron)
1454 {
1455 elmtStdExp =
1457 Ba, Bb, Bc);
1458 }
1459 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1460 {
1461 elmtStdExp =
1463 Ba, Bb, Bc);
1464 }
1465 else // Tet cannot have quad surface
1466 {
1468 "Fail to cast geom to a known 3D shape.");
1469 }
1470 // Then, get the trace basis key from the element stdExp,
1471 // which may be different from Ba, Bb and Bc.
1472 LibUtilities::BasisKey QuadBa =
1473 elmtStdExp->GetTraceBasisKey(face_id, 0);
1474 LibUtilities::BasisKey QuadBb =
1475 elmtStdExp->GetTraceBasisKey(face_id, 1);
1476 // swap Ba and Bb if the orientation is transposed
1477 if (geom->GetForient(face_id) >= 9)
1478 {
1479 std::swap(QuadBa, QuadBb);
1480 }
1481
1482 eInfo->m_basisKeyVector.push_back(QuadBa);
1483 eInfo->m_basisKeyVector.push_back(QuadBb);
1484 }
1485 else
1486 {
1487 IsNot0D = false;
1488 }
1489
1490 if (DoOptOnCollection && IsNot0D)
1491 {
1492 int i;
1493 for (i = 0; i < cnt; ++i)
1494 {
1495 if ((eInfo->m_basisKeyVector ==
1496 ExpOrder[i][0]->m_basisKeyVector) &&
1497 (eInfo->m_geomShPtr->GetGeomFactors()->GetGtype() ==
1498 ExpOrder[i][0]
1499 ->m_geomShPtr->GetGeomFactors()
1500 ->GetGtype()))
1501 {
1502 ExpOrder[i].push_back(eInfo);
1503 break;
1504 }
1505 }
1506
1507 if (i == cnt)
1508 {
1509 ExpOrder[cnt++].push_back(eInfo);
1510 }
1511 }
1512 else
1513 {
1514 ExpOrder[0].push_back(eInfo);
1515 }
1516 }
1517 }
1518
1519 // decalare expansions in provided order using geom and basis info
1520 for (auto &ordIt : ExpOrder)
1521 {
1522 for (auto &eit : ordIt.second)
1523 {
1524 // Process each expansion in the region.
1525 if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
1526 eit->m_geomShPtr)))
1527 {
1528 m_expType = e0D;
1529
1531 PtGeom);
1532 }
1533 else if ((SegGeom =
1534 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1535 eit->m_geomShPtr)))
1536 {
1537 m_expType = e1D;
1538
1539 if (SetToOneSpaceDimension)
1540 {
1541 SpatialDomains::SegGeomSharedPtr OneDSegmentGeom =
1542 SegGeom->GenerateOneSpaceDimGeom();
1543
1544 exp =
1546 eit->m_basisKeyVector[0], OneDSegmentGeom);
1547 }
1548 else
1549 {
1550 exp =
1552 eit->m_basisKeyVector[0], SegGeom);
1553 }
1554 }
1555 else if ((TriGeom =
1556 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1557 eit->m_geomShPtr)))
1558 {
1559 m_expType = e2D;
1560
1561 if (eit->m_basisKeyVector[0].GetBasisType() ==
1563 {
1565
1567 AllocateSharedPtr(eit->m_basisKeyVector[0],
1568 eit->m_basisKeyVector[1], TriNb,
1569 TriGeom);
1570 }
1571 else
1572 {
1573 exp =
1575 eit->m_basisKeyVector[0], eit->m_basisKeyVector[1],
1576 TriGeom);
1577 }
1578 }
1579 else if ((QuadGeom =
1580 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1581 eit->m_geomShPtr)))
1582 {
1583 m_expType = e2D;
1584
1586 eit->m_basisKeyVector[0], eit->m_basisKeyVector[1],
1587 QuadGeom);
1588 }
1589 else
1590 {
1592 "dynamic cast to a Geom (possibly 3D) failed");
1593 }
1594
1595 exp->SetElmtId(elmtid++);
1596 (*m_exp).push_back(exp);
1597 }
1598 }
1599
1600 // Set up m_coeffs, m_phys and offset arrays.
1601 SetupCoeffPhys(DeclareCoeffPhysArrays);
1602
1603 if (m_expType != e0D)
1604 {
1605 CreateCollections(ImpType);
1606 }
1607}
#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:58
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 1897 of file ExpList.cpp.

1898{
1899}

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

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

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

Definition at line 6565 of file ExpList.cpp.

6568{
6569 int nelmt;
6570 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6571
6572 nelmtcoef = GetNcoeffs(0);
6573 nelmtpnts = GetTotPoints(0);
6574
6575 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6576 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6577
6578 Array<OneD, NekDouble> MatQ_data;
6579 Array<OneD, NekDouble> MatC_data;
6580
6581 DNekMatSharedPtr tmpMatQ, tmpMatC;
6582
6583 nelmtcoef0 = nelmtcoef;
6584 nelmtpnts0 = nelmtpnts;
6585
6586 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6587 {
6588 nelmtcoef = GetNcoeffs(nelmt);
6589 nelmtpnts = GetTotPoints(nelmt);
6590
6591 tmpMatQ = ElmtJacQuad[nelmt];
6592 tmpMatC = ElmtJacCoef[nelmt];
6593
6594 MatQ_data = tmpMatQ->GetPtr();
6595 MatC_data = tmpMatC->GetPtr();
6596
6597 if (nelmtcoef != nelmtcoef0)
6598 {
6599 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6600 nelmtcoef0 = nelmtcoef;
6601 }
6602
6603 if (nelmtpnts != nelmtpnts0)
6604 {
6605 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6606 nelmtpnts0 = nelmtpnts;
6607 }
6608
6609 for (int np = 0; np < nelmtcoef; np++)
6610 {
6611 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6612 1);
6613 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6614 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
6615
6616 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6617 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6618 }
6619 }
6620}
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 6508 of file ExpList.cpp.

6511{
6512 int nelmt;
6513 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6514
6515 nelmtcoef = GetNcoeffs(0);
6516 nelmtpnts = GetTotPoints(0);
6517
6518 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6519 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6520
6521 Array<OneD, NekDouble> MatQ_data;
6522 Array<OneD, NekDouble> MatC_data;
6523
6524 DNekMatSharedPtr tmpMatQ, tmpMatC;
6525
6526 nelmtcoef0 = nelmtcoef;
6527 nelmtpnts0 = nelmtpnts;
6528
6529 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6530 {
6531 nelmtcoef = GetNcoeffs(nelmt);
6532 nelmtpnts = GetTotPoints(nelmt);
6533
6534 tmpMatQ = ElmtJacQuad[nelmt];
6535 tmpMatC = ElmtJacCoef[nelmt];
6536
6537 MatQ_data = tmpMatQ->GetPtr();
6538 MatC_data = tmpMatC->GetPtr();
6539
6540 if (nelmtcoef != nelmtcoef0)
6541 {
6542 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6543 nelmtcoef0 = nelmtcoef;
6544 }
6545
6546 if (nelmtpnts != nelmtpnts0)
6547 {
6548 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6549 nelmtpnts0 = nelmtpnts;
6550 }
6551
6552 for (int np = 0; np < nelmtcoef; np++)
6553 {
6554 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6555 1);
6556 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6557 (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
6558
6559 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6560 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6561 }
6562 }
6563}

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

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

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 6272 of file ExpList.cpp.

6276{
6278 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
6279 tracelist->GetExp();
6280 int ntotTrace = (*traceExp).size();
6281 int nTracePnt, nTraceCoef;
6282
6283 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp = GetExp();
6284 int nElmtCoef;
6285
6286 const MultiRegions::LocTraceToTraceMapSharedPtr locTraceToTraceMap =
6288 const Array<OneD, const Array<OneD, int>> LRAdjExpid =
6289 locTraceToTraceMap->GetLeftRightAdjacentExpId();
6290 const Array<OneD, const Array<OneD, bool>> LRAdjflag =
6291 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
6292
6293 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRMap =
6294 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
6295 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRSign =
6296 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
6297 DNekMatSharedPtr ElmtMat;
6298 Array<OneD, NekDouble> ElmtMat_data;
6299 // int nclAdjExp;
6300 int nrwAdjExp;
6301 int MatIndex, nPnts;
6302 NekDouble sign = 1.0;
6303
6304 int nTracePntsTtl = tracelist->GetTotPoints();
6305 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
6306 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
6307 int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
6308
6309 Array<OneD, int> nlocTracePtsLR(2);
6310 nlocTracePtsLR[0] = nlocTracePtsFwd;
6311 nlocTracePtsLR[1] = nlocTracePtsBwd;
6312
6313 size_t nFwdBwdNonZero = 0;
6314 Array<OneD, int> tmpIndex{2, -1};
6315 for (int i = 0; i < 2; ++i)
6316 {
6317 if (nlocTracePtsLR[i] > 0)
6318 {
6319 tmpIndex[nFwdBwdNonZero] = i;
6320 nFwdBwdNonZero++;
6321 }
6322 }
6323
6324 Array<OneD, int> nlocTracePtsNonZeroIndex{nFwdBwdNonZero};
6325 for (int i = 0; i < nFwdBwdNonZero; ++i)
6326 {
6327 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
6328 }
6329
6330 Array<OneD, NekDouble> TraceFwdPhy(nTracePntsTtl);
6331 Array<OneD, NekDouble> TraceBwdPhy(nTracePntsTtl);
6332 Array<OneD, Array<OneD, NekDouble>> tmplocTrace(2);
6333 for (int k = 0; k < 2; ++k)
6334 {
6335 tmplocTrace[k] = NullNekDouble1DArray;
6336 }
6337
6338 for (int k = 0; k < nFwdBwdNonZero; ++k)
6339 {
6340 size_t i = nlocTracePtsNonZeroIndex[k];
6341 tmplocTrace[i] = Array<OneD, NekDouble>(nlocTracePtsLR[i]);
6342 }
6343
6344 int nNumbElmt = fieldMat.size();
6345 Array<OneD, Array<OneD, NekDouble>> ElmtMatDataArray(nNumbElmt);
6346 Array<OneD, int> ElmtCoefArray(nNumbElmt);
6347 for (int i = 0; i < nNumbElmt; i++)
6348 {
6349 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
6350 ElmtCoefArray[i] = GetNcoeffs(i);
6351 }
6352
6353 int nTraceCoefMax = 0;
6354 int nTraceCoefMin = std::numeric_limits<int>::max();
6355 Array<OneD, int> TraceCoefArray(ntotTrace);
6356 Array<OneD, int> TracePntArray(ntotTrace);
6357 Array<OneD, int> TraceOffArray(ntotTrace);
6358 Array<OneD, Array<OneD, NekDouble>> FwdMatData(ntotTrace);
6359 Array<OneD, Array<OneD, NekDouble>> BwdMatData(ntotTrace);
6360 for (int nt = 0; nt < ntotTrace; nt++)
6361 {
6362 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
6363 nTracePnt = tracelist->GetTotPoints(nt);
6364 int noffset = tracelist->GetPhys_Offset(nt);
6365 TraceCoefArray[nt] = nTraceCoef;
6366 TracePntArray[nt] = nTracePnt;
6367 TraceOffArray[nt] = noffset;
6368 FwdMatData[nt] = FwdMat[nt]->GetPtr();
6369 BwdMatData[nt] = BwdMat[nt]->GetPtr();
6370 if (nTraceCoef > nTraceCoefMax)
6371 {
6372 nTraceCoefMax = nTraceCoef;
6373 }
6374 if (nTraceCoef < nTraceCoefMin)
6375 {
6376 nTraceCoefMin = nTraceCoef;
6377 }
6378 }
6379 WARNINGL1(nTraceCoefMax == nTraceCoefMin,
6380 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
6381
6382 int traceID, nfieldPnts, ElmtId, noffset;
6383 const Array<OneD, const Array<OneD, int>> LocTracephysToTraceIDMap =
6384 locTraceToTraceMap->GetLocTracephysToTraceIDMap();
6385 const Array<OneD, const int> fieldToLocTraceMap =
6386 locTraceToTraceMap->GetLocTraceToFieldMap();
6387 Array<OneD, Array<OneD, int>> fieldToLocTraceMapLR(2);
6388 noffset = 0;
6389 for (int k = 0; k < nFwdBwdNonZero; ++k)
6390 {
6391 size_t i = nlocTracePtsNonZeroIndex[k];
6392 fieldToLocTraceMapLR[i] = Array<OneD, int>(nlocTracePtsLR[i]);
6393 Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
6394 &fieldToLocTraceMapLR[i][0], 1);
6395 noffset += nlocTracePtsLR[i];
6396 }
6397
6398 Array<OneD, Array<OneD, int>> MatIndexArray(2);
6399 for (int k = 0; k < nFwdBwdNonZero; ++k)
6400 {
6401 size_t nlr = nlocTracePtsNonZeroIndex[k];
6402 MatIndexArray[nlr] = Array<OneD, int>(nlocTracePtsLR[nlr]);
6403 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6404 {
6405 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6406 nTraceCoef = TraceCoefArray[traceID];
6407 ElmtId = LRAdjExpid[nlr][traceID];
6408 noffset = GetPhys_Offset(ElmtId);
6409 nElmtCoef = ElmtCoefArray[ElmtId];
6410 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
6411 nPnts = nfieldPnts - noffset;
6412
6413 MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
6414 }
6415 }
6416
6417 for (int nc = 0; nc < nTraceCoefMin; nc++)
6418 {
6419 for (int nt = 0; nt < ntotTrace; nt++)
6420 {
6421 nTraceCoef = TraceCoefArray[nt];
6422 nTracePnt = TracePntArray[nt];
6423 noffset = TraceOffArray[nt];
6424 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6425 &TraceFwdPhy[noffset], 1);
6426 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6427 &TraceBwdPhy[noffset], 1);
6428 }
6429
6430 for (int k = 0; k < nFwdBwdNonZero; ++k)
6431 {
6432 size_t i = nlocTracePtsNonZeroIndex[k];
6433 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6434 }
6435
6436 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6437 tmplocTrace[1]);
6438
6439 for (int k = 0; k < nFwdBwdNonZero; ++k)
6440 {
6441 size_t nlr = nlocTracePtsNonZeroIndex[k];
6442 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6443 {
6444 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6445 nTraceCoef = TraceCoefArray[traceID];
6446 ElmtId = LRAdjExpid[nlr][traceID];
6447 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6448 sign = elmtLRSign[nlr][traceID][nc];
6449 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6450
6451 ElmtMatDataArray[ElmtId][MatIndex] -=
6452 sign * tmplocTrace[nlr][nloc];
6453 }
6454 }
6455 }
6456
6457 for (int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
6458 {
6459 for (int nt = 0; nt < ntotTrace; nt++)
6460 {
6461 nTraceCoef = TraceCoefArray[nt];
6462 nTracePnt = TracePntArray[nt];
6463 noffset = TraceOffArray[nt];
6464 if (nc < nTraceCoef)
6465 {
6466 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6467 &TraceFwdPhy[noffset], 1);
6468 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6469 &TraceBwdPhy[noffset], 1);
6470 }
6471 else
6472 {
6473 Vmath::Zero(nTracePnt, &TraceFwdPhy[noffset], 1);
6474 Vmath::Zero(nTracePnt, &TraceBwdPhy[noffset], 1);
6475 }
6476 }
6477
6478 for (int k = 0; k < nFwdBwdNonZero; ++k)
6479 {
6480 size_t i = nlocTracePtsNonZeroIndex[k];
6481 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6482 }
6483 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6484 tmplocTrace[1]);
6485
6486 for (int k = 0; k < nFwdBwdNonZero; ++k)
6487 {
6488 size_t nlr = nlocTracePtsNonZeroIndex[k];
6489 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6490 {
6491 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6492 nTraceCoef = TraceCoefArray[traceID];
6493 if (nc < nTraceCoef)
6494 {
6495 ElmtId = LRAdjExpid[nlr][traceID];
6496 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6497 sign = -elmtLRSign[nlr][traceID][nc];
6498 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6499
6500 ElmtMatDataArray[ElmtId][MatIndex] +=
6501 sign * tmplocTrace[nlr][nloc];
6502 }
6503 }
6504 }
6505 }
6506}
#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:5125

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

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

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 3327 of file ExpList.cpp.

3328{
3329}

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

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 5974 of file ExpList.cpp.

5975{
5977}
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3985

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 5803 of file ExpList.cpp.

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

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

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

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 1946 of file ExpList.cpp.

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

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

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 2391 of file ExpList.cpp.

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

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 4012 of file ExpList.cpp.

4016{
4017 string varString = fileName.substr(0, fileName.find_last_of("."));
4018 int j, k, len = varString.length();
4019 varString = varString.substr(len - 1, len);
4020
4021 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
4022 std::vector<std::vector<NekDouble>> FieldData;
4023
4024 std::string ft = LibUtilities::FieldIO::GetFileType(fileName, comm);
4027 ft, comm, m_session->GetSharedFilesystem());
4028
4029 f->Import(fileName, FieldDef, FieldData);
4030
4031 bool found = false;
4032 for (j = 0; j < FieldDef.size(); ++j)
4033 {
4034 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
4035 {
4036 if (FieldDef[j]->m_fields[k] == varName)
4037 {
4038 // Copy FieldData into locExpList
4039 ExtractDataToCoeffs(FieldDef[j], FieldData[j],
4040 FieldDef[j]->m_fields[k], coeffs);
4041 found = true;
4042 }
4043 }
4044 }
4045
4046 ASSERTL0(found, "Could not find variable '" + varName +
4047 "' in file boundary condition " + fileName);
4048}
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
Definition: FieldIO.cpp:94
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:4256
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:322
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
Definition: FieldIO.cpp:69

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 4264 of file ExpList.cpp.

4268{
4269 v_ExtractCoeffsToCoeffs(fromExpList, fromCoeffs, toCoeffs);
4270}
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:4368

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 4256 of file ExpList.cpp.

4260{
4261 v_ExtractDataToCoeffs(fielddef, fielddata, field, coeffs, zIdToPlane);
4262}
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:4280

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

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

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

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

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

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

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

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

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

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

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 2521 of file ExpList.cpp.

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

4091{
4092 int startenum = (int)LibUtilities::eSegment;
4093 int endenum = (int)LibUtilities::eHexahedron;
4094 int s = 0;
4096
4097 ASSERTL1(NumHomoDir == HomoBasis.size(),
4098 "Homogeneous basis is not the same length as NumHomoDir");
4099 ASSERTL1(NumHomoDir == HomoLen.size(),
4100 "Homogeneous length vector is not the same length as NumHomDir");
4101
4102 // count number of shapes
4103 switch ((*m_exp)[0]->GetShapeDimension())
4104 {
4105 case 1:
4106 startenum = (int)LibUtilities::eSegment;
4107 endenum = (int)LibUtilities::eSegment;
4108 break;
4109 case 2:
4110 startenum = (int)LibUtilities::eTriangle;
4111 endenum = (int)LibUtilities::eQuadrilateral;
4112 break;
4113 case 3:
4114 startenum = (int)LibUtilities::eTetrahedron;
4115 endenum = (int)LibUtilities::eHexahedron;
4116 break;
4117 }
4118
4119 for (s = startenum; s <= endenum; ++s)
4120 {
4121 std::vector<unsigned int> elementIDs;
4122 std::vector<LibUtilities::BasisType> basis;
4123 std::vector<unsigned int> numModes;
4124 std::vector<std::string> fields;
4125
4126 bool first = true;
4127 bool UniOrder = true;
4128 int n;
4129
4130 shape = (LibUtilities::ShapeType)s;
4131
4132 for (int i = 0; i < (*m_exp).size(); ++i)
4133 {
4134 if ((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
4135 {
4136 elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
4137 if (first)
4138 {
4139 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
4140 {
4141 basis.push_back(
4142 (*m_exp)[i]->GetBasis(j)->GetBasisType());
4143 numModes.push_back(
4144 (*m_exp)[i]->GetBasis(j)->GetNumModes());
4145 }
4146
4147 // add homogeneous direction details if defined
4148 for (n = 0; n < NumHomoDir; ++n)
4149 {
4150 basis.push_back(HomoBasis[n]->GetBasisType());
4151 numModes.push_back(HomoBasis[n]->GetNumModes());
4152 }
4153
4154 first = false;
4155 }
4156 else
4157 {
4158 ASSERTL0(
4159 (*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
4160 "Routine is not set up for multiple bases definitions");
4161
4162 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
4163 {
4164 numModes.push_back(
4165 (*m_exp)[i]->GetBasis(j)->GetNumModes());
4166 if (numModes[j] !=
4167 (*m_exp)[i]->GetBasis(j)->GetNumModes())
4168 {
4169 UniOrder = false;
4170 }
4171 }
4172 // add homogeneous direction details if defined
4173 for (n = 0; n < NumHomoDir; ++n)
4174 {
4175 numModes.push_back(HomoBasis[n]->GetNumModes());
4176 }
4177 }
4178 }
4179 }
4180
4181 if (elementIDs.size() > 0)
4182 {
4185 AllocateSharedPtr(shape, elementIDs, basis, UniOrder,
4186 numModes, fields, NumHomoDir, HomoLen,
4187 homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
4188 fielddef.push_back(fdef);
4189 }
4190 }
4191}
#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 2700 of file ExpList.cpp.

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

4466{
4467 int npoints_e;
4468 NekDouble coeff;
4469
4470 Array<OneD, NekDouble> outarray_e;
4471
4472 for (int i = 0; i < (*m_exp).size(); ++i)
4473 {
4474 npoints_e = (*m_exp)[i]->GetTotPoints();
4475
4476 if (i <= ElementID)
4477 {
4478 coeff = scalar1;
4479 }
4480 else
4481 {
4482 coeff = scalar2;
4483 }
4484
4485 outarray_e = Array<OneD, NekDouble>(npoints_e, coeff);
4486 Vmath::Vcopy(npoints_e, &outarray_e[0], 1, &outarray[m_phys_offset[i]],
4487 1);
4488 }
4489}

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 3093 of file ExpList.cpp.

3095{
3096 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
3097 const map<int, RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
3098
3099 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
3100
3101 if (vType >= eSIZE_GlobalSysSolnType)
3102 {
3103 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
3104 }
3105 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
3106
3107 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
3108 locToGloMap);
3109}
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 3075 of file ExpList.cpp.

3077{
3078 GlobalLinSysSharedPtr returnlinsys;
3079 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
3080
3081 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
3082
3083 if (vType >= eSIZE_GlobalSysSolnType)
3084 {
3085 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
3086 }
3087 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
3088
3089 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
3090 locToGloMap);
3091}
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 2790 of file ExpList.cpp.

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

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

References v_GetBCValues().

◆ GetBlockMatrix()

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

Definition at line 2656 of file ExpList.cpp.

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

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

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

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

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

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 5772 of file ExpList.cpp.

5775{
5776 auto collectionIter = collection.find(regionId);
5777 ASSERTL1(collectionIter != collection.end(),
5778 "Unable to locate collection " + std::to_string(regionId));
5779
5781 (*collectionIter).second;
5782 auto conditionMapIter = bndCondMap->find(variable);
5783 ASSERTL1(conditionMapIter != bndCondMap->end(),
5784 "Unable to locate condition map.");
5785
5786 const SpatialDomains::BoundaryConditionShPtr boundaryCondition =
5787 (*conditionMapIter).second;
5788
5789 return boundaryCondition;
5790}
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:213
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
Definition: Conditions.h:219

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

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 4405 of file ExpList.cpp.

4407{
4408 size_t nTracePts = weightAver.size();
4409 // average for interior traces
4410 for (int i = 0; i < nTracePts; ++i)
4411 {
4412 weightAver[i] = 0.5;
4413 weightJump[i] = 1.0;
4414 }
4415 FillBwdWithBwdWeight(weightAver, weightJump);
4416}
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:5455

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 6201 of file ExpList.cpp.

6204{
6206 int nElmtPntPrevious = 0;
6207 int nElmtCoefPrevious = 0;
6208 int nTotElmt = (*m_exp).size();
6209 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
6210 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
6211
6212 Array<OneD, NekDouble> tmpPhys;
6213 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
6214 Array<OneD, NekDouble> stdMat_data;
6215
6216 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6217 {
6218 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6219 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6220 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
6221
6222 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
6223 (ElmtTypeNow != ElmtTypePrevious))
6224 {
6226 stdExp = (*m_exp)[nelmt]->GetStdExp();
6227 StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
6228 stdExp->DetShapeType(), *stdExp);
6229
6230 DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
6231 stdMat_data = BwdMat->GetPtr();
6232
6233 if (nElmtPntPrevious != nElmtPnt)
6234 {
6235 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6236 }
6237
6238 ElmtTypePrevious = ElmtTypeNow;
6239 nElmtPntPrevious = nElmtPnt;
6240 nElmtCoefPrevious = nElmtCoef;
6241 }
6242
6243 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
6244 inarray[nelmt],
6245 tmpPhys); // weight with metric
6246
6247 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
6248
6249 for (int np = 0; np < nElmtPnt; np++)
6250 {
6251 NekDouble factor = tmpPhys[np];
6252 clmnArray = MatDataArray + np * nElmtCoef;
6253 clmnStdMatArray = stdMat_data + np * nElmtCoef;
6254 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
6255 }
6256 }
6257}
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 4935 of file ExpList.cpp.

4937{
4938 int e_npoints;
4939
4940 Array<OneD, NekDouble> locLeng;
4941 Array<OneD, Array<OneD, NekDouble>> lengintp(2);
4942 Array<OneD, Array<OneD, NekDouble>> lengAdd(2);
4943 Array<OneD, int> LRbndnumbs(2);
4944 Array<OneD, Array<OneD, NekDouble>> lengLR(2);
4945 lengLR[0] = lengthsFwd;
4946 lengLR[1] = lengthsBwd;
4947 Array<OneD, LocalRegions::ExpansionSharedPtr> LRelmts(2);
4950 int e_npoints0 = -1;
4951 if (m_expType == e1D)
4952 {
4953 for (int i = 0; i < m_exp->size(); ++i)
4954 {
4955 loc_exp = (*m_exp)[i];
4956 int offset = m_phys_offset[i];
4957
4958 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4959 if (e_npoints0 < e_npoints)
4960 {
4961 for (int nlr = 0; nlr < 2; nlr++)
4962 {
4963 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4964 }
4965 e_npoints0 = e_npoints;
4966 }
4967
4968 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4969 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4970
4971 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4972 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4973 for (int nlr = 0; nlr < 2; ++nlr)
4974 {
4975 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4976 lengAdd[nlr] = lengintp[nlr];
4977 int bndNumber = LRbndnumbs[nlr];
4978 loc_elmt = LRelmts[nlr];
4979 if (bndNumber >= 0)
4980 {
4981 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4982
4983 LibUtilities::PointsKey to_key =
4984 loc_exp->GetBasis(0)->GetPointsKey();
4985 LibUtilities::PointsKey from_key =
4986 loc_elmt->GetTraceBasisKey(bndNumber).GetPointsKey();
4987
4988 // For unknown reason, GetTraceNormal(2D) returns normals
4989 // that has been reoriented to trace order.
4990 // So here we don't need to reorient them again.
4991
4992 // Always do interpolation
4993 LibUtilities::Interp1D(from_key, locLeng, to_key,
4994 lengintp[nlr]);
4995 lengAdd[nlr] = lengintp[nlr];
4996 }
4997
4998 for (int j = 0; j < e_npoints; ++j)
4999 {
5000 lengLR[nlr][offset + j] = lengAdd[nlr][j];
5001 }
5002 }
5003 }
5004 }
5005 else if (m_expType == e2D)
5006 {
5007 for (int i = 0; i < m_exp->size(); ++i)
5008 {
5009 loc_exp = (*m_exp)[i];
5010 int offset = m_phys_offset[i];
5011
5012 LibUtilities::BasisKey traceBasis0 =
5013 loc_exp->GetBasis(0)->GetBasisKey();
5014 LibUtilities::BasisKey traceBasis1 =
5015 loc_exp->GetBasis(1)->GetBasisKey();
5016 const int TraceNq0 = traceBasis0.GetNumPoints();
5017 const int TraceNq1 = traceBasis1.GetNumPoints();
5018 e_npoints = TraceNq0 * TraceNq1;
5019 if (e_npoints0 < e_npoints)
5020 {
5021 for (int nlr = 0; nlr < 2; nlr++)
5022 {
5023 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
5024 }
5025 e_npoints0 = e_npoints;
5026 }
5027
5028 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
5029 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
5030
5031 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
5032 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
5033 for (int nlr = 0; nlr < 2; ++nlr)
5034 {
5035 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
5036 int bndNumber = LRbndnumbs[nlr];
5037 loc_elmt = LRelmts[nlr];
5038 if (bndNumber >= 0)
5039 {
5040 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
5041 // Project normals from 3D element onto the
5042 // same orientation as the trace expansion.
5044 loc_elmt->GetTraceOrient(bndNumber);
5045
5046 int fromid0, fromid1;
5048 {
5049 fromid0 = 0;
5050 fromid1 = 1;
5051 }
5052 else
5053 {
5054 fromid0 = 1;
5055 fromid1 = 0;
5056 }
5057
5058 LibUtilities::BasisKey faceBasis0 =
5059 loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
5060 LibUtilities::BasisKey faceBasis1 =
5061 loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
5062 const int faceNq0 = faceBasis0.GetNumPoints();
5063 const int faceNq1 = faceBasis1.GetNumPoints();
5064 Array<OneD, NekDouble> alignedLeng(faceNq0 * faceNq1);
5065
5066 AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
5068 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
5069 alignedLeng, traceBasis0.GetPointsKey(),
5070 traceBasis1.GetPointsKey(), lengintp[nlr]);
5071 }
5072
5073 for (int j = 0; j < e_npoints; ++j)
5074 {
5075 lengLR[nlr][offset + j] = lengintp[nlr][j];
5076 }
5077 }
5078 }
5079 }
5080}
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:4657

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 3174 of file ExpList.cpp.

3176{
3177 return GetExp(GetExpIndex(gloCoord));
3178}
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:3185

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 3185 of file ExpList.cpp.

3188{
3189 Array<OneD, NekDouble> Lcoords(gloCoord.size());
3190
3191 return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
3192 maxDistance);
3193}

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 3195 of file ExpList.cpp.

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

1893{
1894 return m_expType;
1895}

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

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

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 5994 of file ExpList.cpp.

5996{
5997 return v_GetGlobalLinSysManager();
5998}
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Definition: ExpList.cpp:4005

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

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

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

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

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

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

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 6058 of file ExpList.cpp.

6061{
6062 int nTotElmt = (*m_exp).size();
6063 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
6064 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
6065
6066 Array<OneD, NekDouble> tmpCoef(nElmtCoef, 0.0);
6067 Array<OneD, NekDouble> tmpPhys(nElmtPnt, 0.0);
6068
6069 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6070 {
6071 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6072 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6073
6074 if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
6075 {
6076 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6077 tmpCoef = Array<OneD, NekDouble>(nElmtCoef, 0.0);
6078 }
6079
6080 for (int ncl = 0; ncl < nElmtPnt; ncl++)
6081 {
6082 tmpPhys[ncl] = inarray[nelmt][ncl];
6083
6084 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
6085
6086 for (int nrw = 0; nrw < nElmtCoef; nrw++)
6087 {
6088 (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
6089 }
6090 // to maintain all the other columes are zero.
6091 tmpPhys[ncl] = 0.0;
6092 }
6093 }
6094}

◆ GetMatIpwrtDeriveBase() [2/2]

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

Definition at line 6096 of file ExpList.cpp.

6098{
6099 int nTotElmt = (*m_exp).size();
6100
6101 int nspacedim = m_graph->GetSpaceDimension();
6102 Array<OneD, Array<OneD, NekDouble>> projectedpnts(nspacedim);
6103 Array<OneD, Array<OneD, NekDouble>> tmppnts(nspacedim);
6104 Array<OneD, DNekMatSharedPtr> ArrayStdMat(nspacedim);
6105 Array<OneD, Array<OneD, NekDouble>> ArrayStdMat_data(nspacedim);
6106
6107 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
6108
6110 int nElmtPntPrevious = 0;
6111 int nElmtCoefPrevious = 0;
6112
6113 int nElmtPnt, nElmtCoef;
6114 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6115 {
6116 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6117 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6118 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
6119
6120 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
6121 (ElmtTypeNow != ElmtTypePrevious))
6122 {
6123 if (nElmtPntPrevious != nElmtPnt)
6124 {
6125 for (int ndir = 0; ndir < nspacedim; ndir++)
6126 {
6127 projectedpnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6128 tmppnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6129 }
6130 }
6132 stdExp = (*m_exp)[nelmt]->GetStdExp();
6133 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase0,
6134 stdExp->DetShapeType(), *stdExp);
6135
6136 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
6137 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
6138
6139 if (nspacedim > 1)
6140 {
6141 StdRegions::StdMatrixKey matkey(
6142 StdRegions::eDerivBase1, stdExp->DetShapeType(), *stdExp);
6143
6144 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
6145 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
6146
6147 if (nspacedim > 2)
6148 {
6149 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase2,
6150 stdExp->DetShapeType(),
6151 *stdExp);
6152
6153 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
6154 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
6155 }
6156 }
6157
6158 ElmtTypePrevious = ElmtTypeNow;
6159 nElmtPntPrevious = nElmtPnt;
6160 nElmtCoefPrevious = nElmtCoef;
6161 }
6162 else
6163 {
6164 for (int ndir = 0; ndir < nspacedim; ndir++)
6165 {
6166 Vmath::Zero(nElmtPnt, projectedpnts[ndir], 1);
6167 }
6168 }
6169
6170 for (int ndir = 0; ndir < nspacedim; ndir++)
6171 {
6172 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
6173 ndir, inarray[ndir][nelmt], tmppnts);
6174 for (int n = 0; n < nspacedim; n++)
6175 {
6176 Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
6177 projectedpnts[n], 1);
6178 }
6179 }
6180
6181 for (int ndir = 0; ndir < nspacedim; ndir++)
6182 {
6183 // weight with metric
6184 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
6185 projectedpnts[ndir]);
6186 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
6187
6188 for (int np = 0; np < nElmtPnt; np++)
6189 {
6190 NekDouble factor = projectedpnts[ndir][np];
6191 clmnArray = MatDataArray + np * nElmtCoef;
6192 clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
6193 Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
6194 1, clmnArray, 1);
6195 }
6196 }
6197 }
6198}
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:4418

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

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

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

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 5984 of file ExpList.cpp.

5985{
5986 return v_GetPoolCount(poolName);
5987}
virtual int v_GetPoolCount(std::string)
Definition: ExpList.cpp:3991

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

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

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

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

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

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

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

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

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 4067 of file ExpList.cpp.

4069{
4070 NekDouble err = 0.0, errh1;
4071 int i;
4072
4073 for (i = 0; i < (*m_exp).size(); ++i)
4074 {
4075 errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
4076 soln + m_phys_offset[i]);
4077 err += errh1 * errh1;
4078 }
4079
4080 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
4081
4082 return sqrt(err);
4083}
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:285

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

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

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

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 1676 of file ExpList.cpp.

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

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

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

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 1992 of file ExpList.cpp.

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

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

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

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

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 3822 of file ExpList.cpp.

3824{
3825 NekDouble err = 0.0;
3826
3827 if (soln == NullNekDouble1DArray)
3828 {
3829 err = Vmath::Vmax(m_npoints, inarray, 1);
3830 }
3831 else
3832 {
3833 for (int i = 0; i < m_npoints; ++i)
3834 {
3835 err = max(err, abs(inarray[i] - soln[i]));
3836 }
3837 }
3838
3839 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
3840
3841 return err;
3842}
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:289

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

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 1909 of file ExpList.cpp.

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

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 2412 of file ExpList.cpp.

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

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

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 1929 of file ExpList.cpp.

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

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

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

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

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

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 3304 of file ExpList.cpp.

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

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

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

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

References v_Reset().

◆ ResetMatrices()

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

Reset matrices.

Definition at line 3367 of file ExpList.cpp.

3368{
3369 // Reset matrix managers.
3370 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3371 LocalRegions::MatrixKey::opLess>::ClearManager();
3372 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3373 LocalRegions::MatrixKey::opLess>::ClearManager();
3374
3375 // Reset block matrix map
3376 m_blockMat->clear();
3377}
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:5161

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

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 1619 of file ExpList.cpp.

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

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

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

References FilterPython_Function::field, and v_SmoothField().

◆ UnsetGlobalLinSys()

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

Definition at line 5989 of file ExpList.cpp.

5990{
5991 v_UnsetGlobalLinSys(key, clearLocalMatrices);
5992}
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:3997

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

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

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:4519
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 5090 of file ExpList.cpp.

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

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 5082 of file ExpList.cpp.

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

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 6050 of file ExpList.cpp.

6054{
6055 NEKERROR(ErrorUtil::efatal, "AddTraceIntegralToOffDiag not defined");
6056}

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 5125 of file ExpList.cpp.

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

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 5134 of file ExpList.cpp.

5138{
5140 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
5141}

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 4212 of file ExpList.cpp.

4215{
4216 v_AppendFieldData(fielddef, fielddata, m_coeffs);
4217}

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 4219 of file ExpList.cpp.

4222{
4223 int i;
4224 // Determine mapping from element ids to location in
4225 // expansion list
4226 // Determine mapping from element ids to location in
4227 // expansion list
4228 map<int, int> ElmtID_to_ExpID;
4229 for (i = 0; i < (*m_exp).size(); ++i)
4230 {
4231 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
4232 }
4233
4234 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
4235 {
4236 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
4237 int datalen = (*m_exp)[eid]->GetNcoeffs();
4238 if ((*m_exp)[eid]->IsNodalNonTensorialExp())
4239 {
4240 // need to convert nodal coeff values into orthonormal expansion
4241 Array<OneD, NekDouble> orthocoeffs((*m_exp)[eid]->GetNcoeffs());
4242 (*m_exp)[eid]->NodalToModal(coeffs + m_coeff_offset[eid],
4243 orthocoeffs);
4244 fielddata.insert(fielddata.end(), &orthocoeffs[0],
4245 &orthocoeffs[0] + datalen);
4246 }
4247 else
4248 {
4249 fielddata.insert(fielddata.end(), &coeffs[m_coeff_offset[eid]],
4250 &coeffs[m_coeff_offset[eid]] + datalen);
4251 }
4252 }
4253}

References GetNcoeffs(), m_coeff_offset, and m_exp.

◆ 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 3129 of file ExpList.cpp.

3131{
3132 LibUtilities::Timer timer;
3133
3134 if (m_expType == e0D)
3135 {
3136 Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
3137 }
3138 else
3139 {
3140 // initialise if required
3142 {
3143 for (int i = 0; i < m_collections.size(); ++i)
3144 {
3146 }
3148 }
3149
3150 LIKWID_MARKER_START("v_BwdTrans");
3151 timer.Start();
3152
3153 Array<OneD, NekDouble> tmp;
3154 int input_offset{0};
3155 int output_offset{0};
3156 for (int i = 0; i < m_collections.size(); ++i)
3157 {
3158 m_collections[i].ApplyOperator(Collections::eBwdTrans,
3159 inarray + input_offset,
3160 tmp = outarray + output_offset);
3161 input_offset +=
3162 m_collections[i].GetInputSize(Collections::eBwdTrans);
3163 output_offset +=
3164 m_collections[i].GetOutputSize(Collections::eBwdTrans);
3165 }
3166
3167 timer.Stop();
3168 LIKWID_MARKER_STOP("v_BwdTrans");
3169 }
3170 // Elapsed time
3171 timer.AccumulateRegion("Collections:BwdTrans", 10);
3172}
#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 3985 of file ExpList.cpp.

3986{
3988 "ClearGlobalLinSysManager not implemented for ExpList.");
3989}

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 2244 of file ExpList.cpp.

2246{
2247 int nq = GetTotPoints();
2248 Array<OneD, NekDouble> Vx(nq);
2249 Array<OneD, NekDouble> Uy(nq);
2250 Array<OneD, NekDouble> Dummy(nq);
2251
2252 switch (m_expType)
2253 {
2254 case e2D:
2255 {
2256 PhysDeriv(xDir, Vel[yDir], Vx);
2257 PhysDeriv(yDir, Vel[xDir], Uy);
2258
2259 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[0], 1);
2260 }
2261 break;
2262
2263 case e3D:
2264 {
2265 Array<OneD, NekDouble> Vz(nq);
2266 Array<OneD, NekDouble> Uz(nq);
2267 Array<OneD, NekDouble> Wx(nq);
2268 Array<OneD, NekDouble> Wy(nq);
2269
2270 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
2271 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
2272 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
2273
2274 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2275 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2276 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2277 }
2278 break;
2279 default:
2280 ASSERTL0(0, "Dimension not supported by ExpList::Curl");
2281 break;
2282 }
2283}
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 2293 of file ExpList.cpp.

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

4372{
4373 int i;
4374 int offset = 0;
4375
4376 map<int, int> GidToEid;
4377
4378 for (i = 0; i < (*m_exp).size(); ++i)
4379 {
4380 GidToEid[fromExpList->GetExp(i)->GetGeom()->GetGlobalID()] = i;
4381 }
4382
4383 for (i = 0; i < (*m_exp).size(); ++i)
4384 {
4385 std::vector<unsigned int> nummodes;
4386 vector<LibUtilities::BasisType> basisTypes;
4387
4388 int eid = GidToEid[(*m_exp)[i]->GetGeom()->GetGlobalID()];
4389 for (int j = 0; j < fromExpList->GetExp(eid)->GetNumBases(); ++j)
4390 {
4391 nummodes.push_back(fromExpList->GetExp(eid)->GetBasisNumModes(j));
4392 basisTypes.push_back(fromExpList->GetExp(eid)->GetBasisType(j));
4393 }
4394
4395 offset = fromExpList->GetCoeff_Offset(eid);
4396 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
4397 &toCoeffs[m_coeff_offset[i]],
4398 basisTypes);
4399 }
4400}

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 4280 of file ExpList.cpp.

4285{
4286 int i, expId;
4287 int offset = 0;
4288 int modes_offset = 0;
4289 int datalen = fielddata.size() / fielddef->m_fields.size();
4290
4291 // Find data location according to field definition
4292 for (i = 0; i < fielddef->m_fields.size(); ++i)
4293 {
4294 if (fielddef->m_fields[i] == field)
4295 {
4296 break;
4297 }
4298 offset += datalen;
4299 }
4300
4301 ASSERTL0(i != fielddef->m_fields.size(),
4302 "Field (" + field + ") not found in file.");
4303
4304 if (m_elmtToExpId.size() == 0)
4305 {
4306 // Loop in reverse order so that in case where using a
4307 // Homogeneous expansion it sets geometry ids to first part of
4308 // m_exp list. Otherwise will set to second (complex) expansion
4309 for (i = (*m_exp).size() - 1; i >= 0; --i)
4310 {
4311 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
4312 }
4313 }
4314
4315 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
4316 {
4317 // Reset modes_offset in the case where all expansions of
4318 // the same order.
4319 if (fielddef->m_uniOrder == true)
4320 {
4321 modes_offset = 0;
4322 }
4323
4325 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
4326
4327 const int elmtId = fielddef->m_elementIDs[i];
4328 auto eIt = m_elmtToExpId.find(elmtId);
4329
4330 if (eIt == m_elmtToExpId.end())
4331 {
4332 offset += datalen;
4333 modes_offset += (*m_exp)[0]->GetNumBases();
4334 continue;
4335 }
4336
4337 expId = eIt->second;
4338
4339 bool sameBasis = true;
4340 for (int j = 0; j < fielddef->m_basis.size(); ++j)
4341 {
4342 if (fielddef->m_basis[j] != (*m_exp)[expId]->GetBasisType(j))
4343 {
4344 sameBasis = false;
4345 break;
4346 }
4347 }
4348
4349 if (datalen == (*m_exp)[expId]->GetNcoeffs() && sameBasis)
4350 {
4351 Vmath::Vcopy(datalen, &fielddata[offset], 1,
4352 &coeffs[m_coeff_offset[expId]], 1);
4353 }
4354 else
4355 {
4356 (*m_exp)[expId]->ExtractDataToCoeffs(
4357 &fielddata[offset], fielddef->m_numModes, modes_offset,
4358 &coeffs[m_coeff_offset[expId]], fielddef->m_basis);
4359 }
4360
4361 offset += datalen;
4362 modes_offset += (*m_exp)[0]->GetNumBases();
4363 }
4364
4365 return;
4366}
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 5538 of file ExpList.cpp.

5541{
5542 int n, cnt;
5543 Array<OneD, NekDouble> tmp1, tmp2;
5545
5546 Array<OneD, int> ElmtID, EdgeID;
5547 GetBoundaryToElmtMap(ElmtID, EdgeID);
5548
5549 // Initialise result
5550 boundary =
5551 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5552
5553 // Skip other boundary regions
5554 for (cnt = n = 0; n < i; ++n)
5555 {
5556 cnt += GetBndCondExpansions()[n]->GetExpSize();
5557 }
5558
5559 int offsetBnd;
5560 int offsetElmt = 0;
5561 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5562 {
5563 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5564
5565 elmt = GetExp(ElmtID[cnt + n]);
5566 elmt->GetTracePhysVals(
5567 EdgeID[cnt + n], GetBndCondExpansions()[i]->GetExp(n),
5568 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
5569
5570 offsetElmt += elmt->GetTotPoints();
5571 }
5572}
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 5615 of file ExpList.cpp.

5618{
5619 int n, cnt;
5620 Array<OneD, NekDouble> tmp1;
5622
5623 Array<OneD, int> ElmtID, EdgeID;
5624 GetBoundaryToElmtMap(ElmtID, EdgeID);
5625
5626 // Initialise result
5627 bnd =
5628 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5629
5630 // Skip other boundary regions
5631 for (cnt = n = 0; n < i; ++n)
5632 {
5633 cnt += GetBndCondExpansions()[n]->GetExpSize();
5634 }
5635
5636 int offsetBnd;
5637 int offsetPhys;
5638 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5639 {
5640 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5641 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5642
5643 elmt = GetExp(ElmtID[cnt + n]);
5644 elmt->GetTracePhysVals(EdgeID[cnt + n],
5646 phys + offsetPhys, tmp1 = bnd + offsetBnd);
5647 }
5648}

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 5576 of file ExpList.cpp.

5579{
5580 int n, cnt, nq;
5581
5582 Array<OneD, int> ElmtID, EdgeID;
5583 GetBoundaryToElmtMap(ElmtID, EdgeID);
5584
5585 // Skip other boundary regions
5586 for (cnt = n = 0; n < i; ++n)
5587 {
5588 cnt += GetBndCondExpansions()[n]->GetExpSize();
5589 }
5590
5591 // Count number of points
5592 int npoints = 0;
5593 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5594 {
5595 npoints += GetExp(ElmtID[cnt + n])->GetTotPoints();
5596 }
5597
5598 // Initialise result
5599 bndElmt = Array<OneD, NekDouble>(npoints, 0.0);
5600
5601 // Extract data
5602 int offsetPhys;
5603 int offsetElmt = 0;
5604 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5605 {
5606 nq = GetExp(ElmtID[cnt + n])->GetTotPoints();
5607 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5608 Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
5609 offsetElmt += nq;
5610 }
5611}

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 5176 of file ExpList.cpp.

5178{
5180 "This method is not defined or valid for this class type");
5181}

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 5183 of file ExpList.cpp.

5186{
5188 "This method is not defined or valid for this class type");
5189}

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 5348 of file ExpList.cpp.

5350{
5352 "This method is not defined or valid for this class type");
5353}

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 5357 of file ExpList.cpp.

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

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 5116 of file ExpList.cpp.

5120{
5122 "This method is not defined or valid for this class type");
5123}

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 5704 of file ExpList.cpp.

5707{
5708 NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
5709}

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 2459 of file ExpList.cpp.

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

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 2450 of file ExpList.cpp.

2452{
2453 Array<OneD, NekDouble> f(m_ncoeffs);
2454
2455 IProductWRTBase(inarray, f);
2456 MultiplyByElmtInvMass(f, outarray);
2457}
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:2412

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 5277 of file ExpList.cpp.

5281{
5283 "This method is not defined or valid for this class type");
5284}

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 5153 of file ExpList.cpp.

5154{
5156 "v_GetBndCondBwdWeight is not defined for this class type");
5157 static Array<OneD, NekDouble> tmp;
5158 return tmp;
5159}

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 4491 of file ExpList.cpp.

4493{
4495 "This method is not defined or valid for this class type");
4496 static Array<OneD, const std::shared_ptr<ExpList>> result;
4497 return result;
4498}

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 5720 of file ExpList.cpp.

5722{
5724 "This method is not defined or valid for this class type");
5725 static Array<OneD, const SpatialDomains::BoundaryConditionShPtr> result;
5726 return result;
5727}

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 5528 of file ExpList.cpp.

5531{
5533 "This method is not defined or valid for this class type");
5534}

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 5652 of file ExpList.cpp.

5654{
5655 int j, n, cnt;
5656 int coordim = GetCoordim(0);
5657 Array<OneD, NekDouble> tmp;
5659
5660 Array<OneD, int> ElmtID, EdgeID;
5661 GetBoundaryToElmtMap(ElmtID, EdgeID);
5662
5663 // Initialise result
5664 normals = Array<OneD, Array<OneD, NekDouble>>(coordim);
5665 for (j = 0; j < coordim; ++j)
5666 {
5667 normals[j] = Array<OneD, NekDouble>(
5668 GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5669 }
5670
5671 // Skip other boundary regions
5672 for (cnt = n = 0; n < i; ++n)
5673 {
5674 cnt += GetBndCondExpansions()[n]->GetExpSize();
5675 }
5676
5677 int offset;
5678 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5679 {
5680 offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5681
5682 elmt = GetExp(ElmtID[cnt + n]);
5683 const Array<OneD, const Array<OneD, NekDouble>> normalsElmt =
5684 elmt->GetTraceNormal(EdgeID[cnt + n]);
5685
5686 // Interp/Copy to result
5687 for (j = 0; j < coordim; ++j)
5688 {
5689 GetBndCondExpansions()[i]->GetExp(n)->PhysInterp(
5690 elmt, normalsElmt[j], tmp = normals[j] + offset);
5691 }
5692 }
5693}

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

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 5697 of file ExpList.cpp.

5699{
5701 "This method is not defined or valid for this class type");
5702}

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 5455 of file ExpList.cpp.

5458{
5459 if (GetNumElmts() == 0)
5460 {
5461 return;
5462 }
5463
5464 int i;
5465 Array<OneD, NekDouble> e_coord_0;
5466 Array<OneD, NekDouble> e_coord_1;
5467 Array<OneD, NekDouble> e_coord_2;
5468
5469 switch (GetExp(0)->GetCoordim())
5470 {
5471 case 1:
5472 for (i = 0; i < (*m_exp).size(); ++i)
5473 {
5474 e_coord_0 = coord_0 + m_phys_offset[i];
5475 (*m_exp)[i]->GetCoords(e_coord_0);
5476 }
5477 break;
5478 case 2:
5479 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5480
5481 for (i = 0; i < (*m_exp).size(); ++i)
5482 {
5483 e_coord_0 = coord_0 + m_phys_offset[i];
5484 e_coord_1 = coord_1 + m_phys_offset[i];
5485 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
5486 }
5487 break;
5488 case 3:
5489 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5490 ASSERTL0(coord_2.size() != 0, "output coord_2 is not defined");
5491
5492 for (i = 0; i < (*m_exp).size(); ++i)
5493 {
5494 e_coord_0 = coord_0 + m_phys_offset[i];
5495 e_coord_1 = coord_1 + m_phys_offset[i];
5496 e_coord_2 = coord_2 + m_phys_offset[i];
5497 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
5498 }
5499 break;
5500 }
5501}

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 4204 of file ExpList.cpp.

4206{
4208}
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:4085

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 4196 of file ExpList.cpp.

4198{
4199 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
4200 v_GetFieldDefinitions(returnval);
4201 return returnval;
4202}

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 5099 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 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 5106 of file ExpList.cpp.

5111{
5113 "This method is not defined or valid for this class type");
5114}

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

◆ v_GetGlobalLinSysManager()

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

Definition at line 4004 of file ExpList.cpp.

4006{
4008 "GetGlobalLinSysManager not implemented for ExpList.");
4010}
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 3955 of file ExpList.cpp.

3956{
3958 "This method is not defined or valid for this class type");
3959 NekDouble len = 0.0;
3960 return len;
3961}

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 4633 of file ExpList.cpp.

4634{
4636 "This method is not defined or valid for this class type");
4637 static std::shared_ptr<InterfaceMapDG> result;
4638 return result;
4639}

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 5168 of file ExpList.cpp.

5169{
5171 "This method is not defined or valid for this class type");
5172 static vector<bool> tmp;
5173 return tmp;
5174}

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 4646 of file ExpList.cpp.

4647{
4649 "This method is not defined or valid for this class type");
4650 static std::vector<bool> result;
4651 return result;
4652}

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 5143 of file ExpList.cpp.

5148{
5150 "v_GetLocTraceFromTracePts is not defined for this class");
5151}

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 6697 of file ExpList.cpp.

6698{
6699 NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
6701}
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 4418 of file ExpList.cpp.

4421{
4422 int npts;
4423
4424 int MFdim = 3;
4425 int nq = outarray[0].size() / MFdim;
4426
4427 // Assume whole array is of same coordinate dimension
4428 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
4429
4430 Array<OneD, Array<OneD, NekDouble>> MFloc(MFdim * coordim);
4431 // Process each expansion.
4432 for (int i = 0; i < m_exp->size(); ++i)
4433 {
4434 npts = (*m_exp)[i]->GetTotPoints();
4435
4436 for (int j = 0; j < MFdim * coordim; ++j)
4437 {
4438 MFloc[j] = Array<OneD, NekDouble>(npts, 0.0);
4439 }
4440
4441 // MF from LOCALREGIONS
4442 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
4443 (*m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
4444
4445 // Get the physical data offset for this expansion.
4446 for (int j = 0; j < MFdim; ++j)
4447 {
4448 for (int k = 0; k < coordim; ++k)
4449 {
4450 Vmath::Vcopy(npts, &MFloc[j * coordim + k][0], 1,
4451 &outarray[j][k * nq + m_phys_offset[i]], 1);
4452 }
4453 }
4454 }
4455}

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 4726 of file ExpList.cpp.

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

5767{
5769 "This method is not defined or valid for this class type");
5770}

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 5792 of file ExpList.cpp.

5793{
5795 "This method is not defined or valid for this class type");
5796 return NullExpListSharedPtr;
5797}
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 3991 of file ExpList.cpp.

3992{
3993 NEKERROR(ErrorUtil::efatal, "GetPoolCount not implemented for ExpList.");
3994 return -1;
3995}

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 5754 of file ExpList.cpp.

5755{
5757 "This method is not defined or valid for this class type");
5758 static map<int, RobinBCInfoSharedPtr> result;
5759 return result;
5760}

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 4617 of file ExpList.cpp.

4618{
4620 "This method is not defined or valid for this class type");
4621 static std::shared_ptr<ExpList> returnVal;
4622 return returnVal;
4623}

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 4641 of file ExpList.cpp.

4642{
4643 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
4644}
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 4625 of file ExpList.cpp.

4626{
4628 "This method is not defined or valid for this class type");
4629 static std::shared_ptr<AssemblyMapDG> result;
4630 return result;
4631}

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 3947 of file ExpList.cpp.

3948{
3950 "This method is not defined or valid for this class type");
3952 return trans;
3953}
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 3977 of file ExpList.cpp.

3978{
3980 "This method is not defined or valid for this class type");
3981 Array<OneD, unsigned int> NoModes(1);
3982 return NoModes;
3983}

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 3969 of file ExpList.cpp.

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

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 5386 of file ExpList.cpp.

5389{
5391 "This method is not defined or valid for this class type");
5392}

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 5380 of file ExpList.cpp.

5381{
5383 "This method is not defined or valid for this class type");
5384}

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 5247 of file ExpList.cpp.

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

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 3939 of file ExpList.cpp.

3940{
3942 "This method is not defined or valid for this class type");
3943 Array<OneD, NekDouble> NoEnergy(1, 0.0);
3944 return NoEnergy;
3945}

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 5237 of file ExpList.cpp.

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

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 5339 of file ExpList.cpp.

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

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 3905 of file ExpList.cpp.

3906{
3907 NekDouble sum = 0.0;
3908 int i = 0;
3909
3910 for (i = 0; i < (*m_exp).size(); ++i)
3911 {
3912 sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
3913 }
3914 m_comm->GetRowComm()->AllReduce(sum, LibUtilities::ReduceSum);
3915
3916 return sum;
3917}

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 5411 of file ExpList.cpp.

5413{
5414 LibUtilities::Timer timer;
5415 timer.Start();
5416 // initialise if required
5418 {
5419 for (int i = 0; i < m_collections.size(); ++i)
5420 {
5422 }
5424 }
5425
5426 Array<OneD, NekDouble> tmp;
5427 int input_offset{0};
5428 int output_offset{0};
5429 for (int i = 0; i < m_collections.size(); ++i)
5430 {
5432 inarray + input_offset,
5433 tmp = outarray + output_offset);
5434 input_offset +=
5436 output_offset +=
5438 }
5439 timer.Stop();
5440 // Elapsed time
5441 timer.AccumulateRegion("Collections:IProductWRTBase", 10);
5442}

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 2034 of file ExpList.cpp.

2037{
2038 Array<OneD, NekDouble> tmp0, tmp1, tmp2;
2039 // assume coord dimension defines the size of Deriv Base
2040 int dim = GetCoordim(0);
2041
2042 ASSERTL1(inarray.size() >= dim, "inarray is not of sufficient dimension");
2043
2044 // initialise if required
2046 {
2047 for (int i = 0; i < m_collections.size(); ++i)
2048 {
2050 }
2052 }
2053
2054 LibUtilities::Timer timer;
2055 int input_offset{0};
2056 int output_offset{0};
2057 LIKWID_MARKER_START("IProductWRTDerivBase_coll");
2058 timer.Start();
2059
2060 switch (dim)
2061 {
2062 case 1:
2063 for (int i = 0; i < m_collections.size(); ++i)
2064 {
2065 m_collections[i].ApplyOperator(
2067 inarray[0] + input_offset, tmp0 = outarray + output_offset);
2068 input_offset += m_collections[i].GetInputSize(
2070 output_offset += m_collections[i].GetOutputSize(
2072 }
2073 break;
2074 case 2:
2075 for (int i = 0; i < m_collections.size(); ++i)
2076 {
2077 m_collections[i].ApplyOperator(
2079 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
2080 tmp1 = outarray + output_offset);
2081 input_offset += m_collections[i].GetInputSize(
2083 output_offset += m_collections[i].GetOutputSize(
2085 }
2086 break;
2087 case 3:
2088 for (int i = 0; i < m_collections.size(); ++i)
2089 {
2090 m_collections[i].ApplyOperator(
2092 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
2093 tmp1 = inarray[2] + input_offset,
2094 tmp2 = outarray + output_offset);
2095 input_offset += m_collections[i].GetInputSize(
2097 output_offset += m_collections[i].GetOutputSize(
2099 }
2100 break;
2101 default:
2102 NEKERROR(ErrorUtil::efatal, "Dimension of inarray not correct");
2103 break;
2104 }
2105
2106 timer.Stop();
2107 LIKWID_MARKER_STOP("IProductWRTDerivBase_coll");
2108
2109 // Elapsed time
2110 timer.AccumulateRegion("Collections:IProductWRTDerivBase", 10);
2111}

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 1973 of file ExpList.cpp.

1976{
1977 int i;
1978
1979 Array<OneD, NekDouble> e_outarray;
1980 for (i = 0; i < (*m_exp).size(); ++i)
1981 {
1982 (*m_exp)[i]->IProductWRTDerivBase(dir, inarray + m_phys_offset[i],
1983 e_outarray =
1984 outarray + m_coeff_offset[i]);
1985 }
1986}

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 3860 of file ExpList.cpp.

3862{
3863 NekDouble err = 0.0, errl2;
3864 int i;
3865
3866 if (soln == NullNekDouble1DArray)
3867 {
3868 for (i = 0; i < (*m_exp).size(); ++i)
3869 {
3870 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i]);
3871 err += errl2 * errl2;
3872 }
3873 }
3874 else
3875 {
3876 for (i = 0; i < (*m_exp).size(); ++i)
3877 {
3878 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i],
3879 soln + m_phys_offset[i]);
3880 err += errl2 * errl2;
3881 }
3882 }
3883
3884 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3885
3886 return sqrt(err);
3887}

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 5212 of file ExpList.cpp.

5220{
5222 "LinearAdvectionDiffusionReactionSolve not implemented.");
5223 return NullGlobalLinSysKey;
5224}

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 5226 of file ExpList.cpp.

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

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 5365 of file ExpList.cpp.

5366{
5368 "This method is not defined or valid for this class type");
5369}

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 5371 of file ExpList.cpp.

5375{
5377 "This method is not defined or valid for this class type");
5378}

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 5191 of file ExpList.cpp.

5194{
5196 "This method is not defined or valid for this class type");
5197}

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 5296 of file ExpList.cpp.

5298{
5299 Array<OneD, NekDouble> tmp;
5300 switch (GetCoordim(0))
5301 {
5302 case 1:
5303 {
5304 for (int i = 0; i < GetExpSize(); ++i)
5305 {
5306 (*m_exp)[i]->NormVectorIProductWRTBase(
5307 V[0] + GetPhys_Offset(i),
5308 tmp = outarray + GetCoeff_Offset(i));
5309 }
5310 }
5311 break;
5312 case 2:
5313 {
5314 for (int i = 0; i < GetExpSize(); ++i)
5315 {
5316 (*m_exp)[i]->NormVectorIProductWRTBase(
5317 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5318 tmp = outarray + GetCoeff_Offset(i));
5319 }
5320 }
5321 break;
5322 case 3:
5323 {
5324 for (int i = 0; i < GetExpSize(); ++i)
5325 {
5326 (*m_exp)[i]->NormVectorIProductWRTBase(
5327 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5328 V[2] + GetPhys_Offset(i),
5329 tmp = outarray + GetCoeff_Offset(i));
5330 }
5331 }
5332 break;
5333 default:
5334 NEKERROR(ErrorUtil::efatal, "Dimension not supported");
5335 break;
5336 }
5337}
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 5286 of file ExpList.cpp.

5291{
5293 "This method is not defined or valid for this class type");
5294}

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 5711 of file ExpList.cpp.

5714{
5715 NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
5716}

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 2146 of file ExpList.cpp.

2150{
2151 Array<OneD, NekDouble> e_out_d0;
2152 Array<OneD, NekDouble> e_out_d1;
2153 Array<OneD, NekDouble> e_out_d2;
2154
2155 // initialise if required
2157 {
2158 for (int i = 0; i < m_collections.size(); ++i)
2159 {
2161 }
2163 }
2164
2165 int offset{0};
2166 LibUtilities::Timer timer;
2167 timer.Start();
2168 for (int i = 0; i < m_collections.size(); ++i)
2169 {
2170 e_out_d0 = out_d0 + offset;
2171 e_out_d1 = out_d1 + offset;
2172 e_out_d2 = out_d2 + offset;
2173 m_collections[i].ApplyOperator(Collections::ePhysDeriv,
2174 inarray + offset, e_out_d0, e_out_d1,
2175 e_out_d2);
2176 offset += m_collections[i].GetInputSize(Collections::ePhysDeriv);
2177 }
2178 timer.Stop();
2179 // Elapsed time
2180 timer.AccumulateRegion("Collections:PhysDeriv", 10);
2181}

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 2183 of file ExpList.cpp.

2186{
2187 Direction edir = DirCartesianMap[dir];
2188 v_PhysDeriv(edir, inarray, out_d);
2189}
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 2191 of file ExpList.cpp.

2194{
2195 int i;
2196 if (edir == MultiRegions::eS)
2197 {
2198 Array<OneD, NekDouble> e_out_ds;
2199 for (i = 0; i < (*m_exp).size(); ++i)
2200 {
2201 e_out_ds = out_d + m_phys_offset[i];
2202 (*m_exp)[i]->PhysDeriv_s(inarray + m_phys_offset[i], e_out_ds);
2203 }
2204 }
2205 else if (edir == MultiRegions::eN)
2206 {
2207 Array<OneD, NekDouble> e_out_dn;
2208 for (i = 0; i < (*m_exp).size(); i++)
2209 {
2210 e_out_dn = out_d + m_phys_offset[i];
2211 (*m_exp)[i]->PhysDeriv_n(inarray + m_phys_offset[i], e_out_dn);
2212 }
2213 }
2214 else
2215 {
2216 // initialise if required
2218 {
2219 for (int i = 0; i < m_collections.size(); ++i)
2220 {
2222 }
2224 }
2225
2226 // convert enum into int
2227 int intdir = (int)edir;
2228 Array<OneD, NekDouble> e_out_d;
2229 int offset{0};
2230 for (int i = 0; i < m_collections.size(); ++i)
2231 {
2232 e_out_d = out_d + offset;
2233 m_collections[i].ApplyOperator(Collections::ePhysDeriv, intdir,
2234 inarray + offset, e_out_d);
2235 offset += m_collections[i].GetInputSize(Collections::ePhysDeriv);
2236 }
2237 }
2238}

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 2361 of file ExpList.cpp.

2365{
2366 int npts_e;
2367 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
2368 int nq = direction.size() / coordim;
2369
2370 Array<OneD, NekDouble> e_outarray;
2371 Array<OneD, NekDouble> e_MFdiv;
2372 Array<OneD, NekDouble> locdir;
2373
2374 for (int i = 0; i < (*m_exp).size(); ++i)
2375 {
2376 npts_e = (*m_exp)[i]->GetTotPoints();
2377 locdir = Array<OneD, NekDouble>(npts_e * coordim);
2378
2379 for (int k = 0; k < coordim; ++k)
2380 {
2381 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
2382 &locdir[k * npts_e], 1);
2383 }
2384
2385 (*m_exp)[i]->PhysDirectionalDeriv(inarray + m_phys_offset[i], locdir,
2386 e_outarray =
2387 outarray + m_phys_offset[i]);
2388 }
2389}

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 6622 of file ExpList.cpp.

6625{
6626 int cnt, cnt1;
6627
6628 cnt = cnt1 = 0;
6629
6630 switch (m_expType)
6631 {
6632 case e2D:
6633 {
6634 for (int i = 0; i < GetExpSize(); ++i)
6635 {
6636 // get new points key
6637 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6638 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6639 int npt0 = (int)pt0 * scale;
6640 int npt1 = (int)pt1 * scale;
6641
6642 LibUtilities::PointsKey newPointsKey0(
6643 npt0, (*m_exp)[i]->GetPointsType(0));
6644 LibUtilities::PointsKey newPointsKey1(
6645 npt1, (*m_exp)[i]->GetPointsType(1));
6646
6647 // Project points;
6649 newPointsKey0, newPointsKey1, &inarray[cnt],
6650 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6651 (*m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6652
6653 cnt += npt0 * npt1;
6654 cnt1 += pt0 * pt1;
6655 }
6656 }
6657 break;
6658 case e3D:
6659 {
6660 for (int i = 0; i < GetExpSize(); ++i)
6661 {
6662 // get new points key
6663 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6664 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6665 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6666 int npt0 = (int)pt0 * scale;
6667 int npt1 = (int)pt1 * scale;
6668 int npt2 = (int)pt2 * scale;
6669
6670 LibUtilities::PointsKey newPointsKey0(
6671 npt0, (*m_exp)[i]->GetPointsType(0));
6672 LibUtilities::PointsKey newPointsKey1(
6673 npt1, (*m_exp)[i]->GetPointsType(1));
6674 LibUtilities::PointsKey newPointsKey2(
6675 npt2, (*m_exp)[i]->GetPointsType(2));
6676
6677 // Project points;
6679 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6680 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6681 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
6682 (*m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6683
6684 cnt += npt0 * npt1 * npt2;
6685 cnt1 += pt0 * pt1 * pt2;
6686 }
6687 }
6688 break;
6689 default:
6690 {
6691 NEKERROR(ErrorUtil::efatal, "not setup for this expansion");
6692 }
6693 break;
6694 }
6695}
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 6000 of file ExpList.cpp.

6003{
6004 // the scaling factor for the PhysInterp1DScaled is given as NekDouble
6005 // however inside Collections it is treated as a FactorMap
6006 // defining needed FactorMap to pass the scaling factor as an input to
6007 // Collections
6009 // Updating the FactorMap according to the scale input
6011 LibUtilities::Timer timer;
6012
6013 // initialise if required
6014 if (m_collections.size() &&
6016 {
6017 for (int i = 0; i < m_collections.size(); ++i)
6018 {
6021 }
6022 }
6023 // once the collections are initialized, check for the scaling factor
6024 for (int i = 0; i < m_collections.size(); ++i)
6025
6026 {
6028 factors);
6029 }
6030
6031 LIKWID_MARKER_START("v_PhysInterp1DScaled");
6032 timer.Start();
6033 Array<OneD, NekDouble> tmp;
6034 int input_offset{0};
6035 int output_offset{0};
6036 for (int i = 0; i < m_collections.size(); ++i)
6037 {
6039 inarray + input_offset,
6040 tmp = outarray + output_offset);
6041 input_offset +=
6043 output_offset +=
6045 }
6046 timer.Stop();
6047 LIKWID_MARKER_STOP("v_PhysInterp1DScaled");
6048 timer.AccumulateRegion("Collections:PhysInterp1DScaled", 10);
6049}
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 3339 of file ExpList.cpp.

3340{
3341 // Reset matrix managers.
3342 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3343 LocalRegions::MatrixKey::opLess>::ClearManager();
3344 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3345 LocalRegions::MatrixKey::opLess>::ClearManager();
3346
3347 // Reset block matrix map
3348 m_blockMat->clear();
3349
3350 // Loop over all elements and reset geometry information.
3351 for (int i = 0; i < m_exp->size(); ++i)
3352 {
3353 (*m_exp)[i]->GetGeom()->Reset(m_graph->GetCurvedEdges(),
3354 m_graph->GetCurvedFaces());
3355 }
3356
3357 // Loop over all elements and rebuild geometric factors.
3358 for (int i = 0; i < m_exp->size(); ++i)
3359 {
3360 (*m_exp)[i]->Reset();
3361 }
3362
3363 CreateCollections(Collections::eNoImpType); // @TODO: Might need to pass in
3364 // correct type here
3365}

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 5161 of file ExpList.cpp.

5163{
5165 "v_setBndCondBwdWeight is not defined for this class type");
5166}

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 3963 of file ExpList.cpp.

3964{
3966 "This method is not defined or valid for this class type");
3967}

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 5515 of file ExpList.cpp.

5516{
5517 for (int i = 0; i < m_exp->size(); ++i)
5518 {
5519 for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
5520 {
5521 (*m_exp)[i]->ComputeTraceNormal(j);
5522 }
5523 }
5524}

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 2482 of file ExpList.cpp.

2483{
2484 // Do nothing unless the method is implemented in the appropriate
2485 // class, i.e. ContField1D,ContField2D, etc.
2486
2487 // So far it has been implemented just for ContField2D and
2488 // ContField3DHomogeneous1D
2489
2490 // Block in case users try the smoothing with a modal expansion.
2491 // Maybe a different techique for the smoothing require
2492 // implementation for modal basis.
2493
2494 ASSERTL0((*m_exp)[0]->GetBasisType(0) == LibUtilities::eGLL_Lagrange ||
2495 (*m_exp)[0]->GetBasisType(0) == LibUtilities::eGauss_Lagrange,
2496 "Smoothing is currently not allowed unless you are using "
2497 "a nodal base for efficiency reasons. The implemented "
2498 "smoothing technique requires the mass matrix inversion "
2499 "which is trivial just for GLL_LAGRANGE_SEM and "
2500 "GAUSS_LAGRANGE_SEMexpansions.");
2501}

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 3997 of file ExpList.cpp.

3999{
4001 "UnsetGlobalLinSys not implemented for ExpList.");
4002}

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 4500 of file ExpList.cpp.

4502{
4504 "This method is not defined or valid for this class type");
4505 static std::shared_ptr<ExpList> result;
4506 return result;
4507}

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 5731 of file ExpList.cpp.

5733{
5735 "This method is not defined or valid for this class type");
5736 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
5737 return result;
5738}

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 4519 of file ExpList.cpp.

4523{
4524 switch (m_expType)
4525 {
4526 case e1D:
4527 {
4528 int i, j, k, e_npoints, offset;
4529 Array<OneD, NekDouble> normals;
4530 NekDouble Vn;
4531
4532 // Assume whole array is of same coordimate dimension
4533 int coordim = GetCoordim(0);
4534
4535 ASSERTL1(Vec.size() >= coordim,
4536 "Input vector does not have sufficient dimensions to "
4537 "match coordim");
4538
4539 // Process each expansion
4540 for (i = 0; i < m_exp->size(); ++i)
4541 {
4542 // Get the number of points in the expansion and the normals.
4543 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4544 normals = (*m_exp)[i]->GetPhysNormals();
4545
4546 // Get the physical data offset of the expansion in m_phys.
4547 offset = m_phys_offset[i];
4548
4549 // Compute each data point.
4550 for (j = 0; j < e_npoints; ++j)
4551 {
4552 // Calculate normal velocity.
4553 Vn = 0.0;
4554 for (k = 0; k < coordim; ++k)
4555 {
4556 Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
4557 }
4558
4559 // Upwind based on direction of normal velocity.
4560 if (Vn > 0.0)
4561 {
4562 Upwind[offset + j] = Fwd[offset + j];
4563 }
4564 else
4565 {
4566 Upwind[offset + j] = Bwd[offset + j];
4567 }
4568 }
4569 }
4570 }
4571 break;
4572 default:
4574 "This method is not defined or valid for this class type");
4575 break;
4576 }
4577}

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 4592 of file ExpList.cpp.

4596{
4597 ASSERTL1(Vn.size() >= m_npoints, "Vn is not of sufficient length");
4598 ASSERTL1(Fwd.size() >= m_npoints, "Fwd is not of sufficient length");
4599 ASSERTL1(Bwd.size() >= m_npoints, "Bwd is not of sufficient length");
4600 ASSERTL1(Upwind.size() >= m_npoints, "Upwind is not of sufficient length");
4601
4602 // Process each point in the expansion.
4603 for (int j = 0; j < m_npoints; ++j)
4604 {
4605 // Upwind based on one-dimensional velocity.
4606 if (Vn[j] > 0.0)
4607 {
4608 Upwind[j] = Fwd[j];
4609 }
4610 else
4611 {
4612 Upwind[j] = Bwd[j];
4613 }
4614 }
4615}

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 3919 of file ExpList.cpp.

3921{
3922 NekDouble flux = 0.0;
3923 int i = 0;
3924 int j;
3925
3926 for (i = 0; i < (*m_exp).size(); ++i)
3927 {
3928 Array<OneD, Array<OneD, NekDouble>> tmp(inarray.size());
3929 for (j = 0; j < inarray.size(); ++j)
3930 {
3931 tmp[j] = Array<OneD, NekDouble>(inarray[j] + m_phys_offset[i]);
3932 }
3933 flux += (*m_exp)[i]->VectorFlux(tmp);
3934 }
3935
3936 return flux;
3937}

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 3515 of file ExpList.cpp.

3516{
3517 int i, j, k, l;
3518 int nbase = (*m_exp)[0]->GetNumBases();
3519 int cnt = 0;
3520
3521 std::shared_ptr<LocalRegions::ExpansionVector> exp = m_exp;
3522
3523 if (expansion != -1)
3524 {
3525 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
3527 (*exp)[0] = (*m_exp)[expansion];
3528 }
3529
3530 if (nbase == 2)
3531 {
3532 for (i = 0; i < (*exp).size(); ++i)
3533 {
3534 const int np0 = (*exp)[i]->GetNumPoints(0);
3535 const int np1 = (*exp)[i]->GetNumPoints(1);
3536
3537 for (j = 1; j < np1; ++j)
3538 {
3539 for (k = 1; k < np0; ++k)
3540 {
3541 outfile << cnt + (j - 1) * np0 + k << " ";
3542 outfile << cnt + (j - 1) * np0 + k + 1 << " ";
3543 outfile << cnt + j * np0 + k + 1 << " ";
3544 outfile << cnt + j * np0 + k << endl;
3545 }
3546 }
3547
3548 cnt += np0 * np1;
3549 }
3550 }
3551 else if (nbase == 3)
3552 {
3553 for (i = 0; i < (*exp).size(); ++i)
3554 {
3555 const int np0 = (*exp)[i]->GetNumPoints(0);
3556 const int np1 = (*exp)[i]->GetNumPoints(1);
3557 const int np2 = (*exp)[i]->GetNumPoints(2);
3558 const int np01 = np0 * np1;
3559
3560 for (j = 1; j < np2; ++j)
3561 {
3562 for (k = 1; k < np1; ++k)
3563 {
3564 for (l = 1; l < np0; ++l)
3565 {
3566 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
3567 << " ";
3568 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
3569 << " ";
3570 outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
3571 << " ";
3572 outfile << cnt + (j - 1) * np01 + k * np0 + l << " ";
3573 outfile << cnt + j * np01 + (k - 1) * np0 + l << " ";
3574 outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
3575 << " ";
3576 outfile << cnt + j * np01 + k * np0 + l + 1 << " ";
3577 outfile << cnt + j * np01 + k * np0 + l << endl;
3578 }
3579 }
3580 }
3581 cnt += np0 * np1 * np2;
3582 }
3583 }
3584 else
3585 {
3586 NEKERROR(ErrorUtil::efatal, "Not set up for this dimension");
3587 }
3588}
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 3595 of file ExpList.cpp.

3596{
3597 if (expansion == -1)
3598 {
3599 int totpoints = GetTotPoints();
3600 if (m_physState == false)
3601 {
3603 }
3604
3605 for (int i = 0; i < totpoints; ++i)
3606 {
3607 outfile << m_phys[i] << " ";
3608 if (i % 1000 == 0 && i)
3609 {
3610 outfile << std::endl;
3611 }
3612 }
3613 outfile << std::endl;
3614 }
3615 else
3616 {
3617 int nPoints = (*m_exp)[expansion]->GetTotPoints();
3618
3619 for (int i = 0; i < nPoints; ++i)
3620 {
3621 outfile << m_phys[i + m_phys_offset[expansion]] << " ";
3622 }
3623
3624 outfile << std::endl;
3625 }
3626}

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 3384 of file ExpList.cpp.

3385{
3386 if (GetNumElmts() == 0)
3387 {
3388 return;
3389 }
3390
3391 int coordim = GetExp(0)->GetCoordim();
3392 char vars[3] = {'x', 'y', 'z'};
3393
3394 if (m_expType == e3DH1D)
3395 {
3396 coordim += 1;
3397 }
3398 else if (m_expType == e3DH2D)
3399 {
3400 coordim += 2;
3401 }
3402
3403 outfile << "Variables = x";
3404 for (int i = 1; i < coordim; ++i)
3405 {
3406 outfile << ", " << vars[i];
3407 }
3408
3409 if (var.size() > 0)
3410 {
3411 outfile << ", " << var;
3412 }
3413
3414 outfile << std::endl << std::endl;
3415}

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 3422 of file ExpList.cpp.

3423{
3424 int i, j;
3425 int coordim = GetCoordim(0);
3426 int nPoints = GetTotPoints();
3427 int nBases = (*m_exp)[0]->GetNumBases();
3428 int numBlocks = 0;
3429
3430 Array<OneD, Array<OneD, NekDouble>> coords(3);
3431
3432 if (expansion == -1)
3433 {
3434 nPoints = GetTotPoints();
3435
3436 coords[0] = Array<OneD, NekDouble>(nPoints);
3437 coords[1] = Array<OneD, NekDouble>(nPoints);
3438 coords[2] = Array<OneD, NekDouble>(nPoints);
3439
3440 GetCoords(coords[0], coords[1], coords[2]);
3441
3442 for (i = 0; i < m_exp->size(); ++i)
3443 {
3444 int numInt = 1;
3445
3446 for (j = 0; j < nBases; ++j)
3447 {
3448 numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
3449 }
3450
3451 numBlocks += numInt;
3452 }
3453 }
3454 else
3455 {
3456 nPoints = (*m_exp)[expansion]->GetTotPoints();
3457
3458 coords[0] = Array<OneD, NekDouble>(nPoints);
3459 coords[1] = Array<OneD, NekDouble>(nPoints);
3460 coords[2] = Array<OneD, NekDouble>(nPoints);
3461
3462 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3463
3464 numBlocks = 1;
3465 for (j = 0; j < nBases; ++j)
3466 {
3467 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
3468 }
3469 }
3470
3471 if (m_expType == e3DH1D)
3472 {
3473 nBases += 1;
3474 coordim += 1;
3475 int nPlanes = GetZIDs().size();
3476 NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
3477 numBlocks = (int)tmp;
3478 }
3479 else if (m_expType == e3DH2D)
3480 {
3481 nBases += 2;
3482 coordim += 1;
3483 }
3484
3485 outfile << "Zone, N=" << nPoints << ", E=" << numBlocks << ", F=FEBlock";
3486
3487 switch (nBases)
3488 {
3489 case 2:
3490 outfile << ", ET=QUADRILATERAL" << std::endl;
3491 break;
3492 case 3:
3493 outfile << ", ET=BRICK" << std::endl;
3494 break;
3495 default:
3496 NEKERROR(ErrorUtil::efatal, "Not set up for this type of output");
3497 break;
3498 }
3499
3500 // Write out coordinates
3501 for (j = 0; j < coordim; ++j)
3502 {
3503 for (i = 0; i < nPoints; ++i)
3504 {
3505 outfile << coords[j][i] << " ";
3506 if (i % 1000 == 0 && i)
3507 {
3508 outfile << std::endl;
3509 }
3510 }
3511 outfile << std::endl;
3512 }
3513}
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 3782 of file ExpList.cpp.

3784{
3785 int i;
3786 int nq = (*m_exp)[expansion]->GetTotPoints();
3787
3788 // printing the fields of that zone
3789 outfile << R"( <DataArray type="Float64" Name=")" << var << "\">"
3790 << endl;
3791 outfile << " ";
3792
3793 const Array<OneD, NekDouble> phys = m_phys + m_phys_offset[expansion];
3794
3795 for (i = 0; i < nq; ++i)
3796 {
3797 outfile << (fabs(phys[i]) < NekConstants::kNekZeroTol ? 0 : phys[i])
3798 << " ";
3799 }
3800 outfile << endl;
3801 outfile << " </DataArray>" << endl;
3802}
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 3642 of file ExpList.cpp.

3644{
3645 int i, j, k;
3646 int nbase = (*m_exp)[expansion]->GetNumBases();
3647 int ntot = (*m_exp)[expansion]->GetTotPoints();
3648 int nquad[3];
3649
3650 int ntotminus = 1;
3651 for (i = 0; i < nbase; ++i)
3652 {
3653 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
3654 ntotminus *= (nquad[i] - 1);
3655 }
3656
3657 Array<OneD, NekDouble> coords[3];
3658 coords[0] = Array<OneD, NekDouble>(ntot, 0.0);
3659 coords[1] = Array<OneD, NekDouble>(ntot, 0.0);
3660 coords[2] = Array<OneD, NekDouble>(ntot, 0.0);
3661 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3662
3663 outfile << " <Piece NumberOfPoints=\"" << ntot << "\" NumberOfCells=\""
3664 << ntotminus << "\">" << endl;
3665 outfile << " <Points>" << endl;
3666 outfile << " <DataArray type=\"Float64\" "
3667 << R"(NumberOfComponents="3" format="ascii">)" << endl;
3668 outfile << " ";
3669 for (i = 0; i < ntot; ++i)
3670 {
3671 for (j = 0; j < 3; ++j)
3672 {
3673 outfile << setprecision(8) << scientific << (float)coords[j][i]
3674 << " ";
3675 }
3676 outfile << endl;
3677 }
3678 outfile << endl;
3679 outfile << " </DataArray>" << endl;
3680 outfile << " </Points>" << endl;
3681 outfile << " <Cells>" << endl;
3682 outfile << " <DataArray type=\"Int32\" "
3683 << R"(Name="connectivity" format="ascii">)" << endl;
3684
3685 int ns = 0; // pow(2,dim) for later usage
3686 string ostr;
3687 switch (m_expType)
3688 {
3689 case e1D:
3690 {
3691 ns = 2;
3692 ostr = "3 ";
3693 for (i = 0; i < nquad[0] - 1; ++i)
3694 {
3695 outfile << i << " " << i + 1 << endl;
3696 }
3697 }
3698 break;
3699 case e2D:
3700 {
3701 ns = 4;
3702 ostr = "9 ";
3703 for (i = 0; i < nquad[0] - 1; ++i)
3704 {
3705 for (j = 0; j < nquad[1] - 1; ++j)
3706 {
3707 outfile << j * nquad[0] + i << " " << j * nquad[0] + i + 1
3708 << " " << (j + 1) * nquad[0] + i + 1 << " "
3709 << (j + 1) * nquad[0] + i << endl;
3710 }
3711 }
3712 }
3713 break;
3714 case e3D:
3715 {
3716 ns = 8;
3717 ostr = "12 ";
3718 for (i = 0; i < nquad[0] - 1; ++i)
3719 {
3720 for (j = 0; j < nquad[1] - 1; ++j)
3721 {
3722 for (k = 0; k < nquad[2] - 1; ++k)
3723 {
3724 outfile
3725 << k * nquad[0] * nquad[1] + j * nquad[0] + i << " "
3726 << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3727 << " "
3728 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3729 i + 1
3730 << " "
3731 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3732 << " "
3733 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3734 << " "
3735 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3736 i + 1
3737 << " "
3738 << (k + 1) * nquad[0] * nquad[1] +
3739 (j + 1) * nquad[0] + i + 1
3740 << " "
3741 << (k + 1) * nquad[0] * nquad[1] +
3742 (j + 1) * nquad[0] + i
3743 << " " << endl;
3744 }
3745 }
3746 }
3747 }
3748 break;
3749 default:
3750 break;
3751 }
3752
3753 outfile << endl;
3754 outfile << " </DataArray>" << endl;
3755 outfile << " <DataArray type=\"Int32\" "
3756 << R"(Name="offsets" format="ascii">)" << endl;
3757 for (i = 0; i < ntotminus; ++i)
3758 {
3759 outfile << i * ns + ns << " ";
3760 }
3761 outfile << endl;
3762 outfile << " </DataArray>" << endl;
3763 outfile << " <DataArray type=\"UInt8\" "
3764 << R"(Name="types" format="ascii">)" << endl;
3765 for (i = 0; i < ntotminus; ++i)
3766 {
3767 outfile << ostr;
3768 }
3769 outfile << endl;
3770 outfile << " </DataArray>" << endl;
3771 outfile << " </Cells>" << endl;
3772 outfile << " <PointData>" << endl;
3773}

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

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

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

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

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

References v_WriteTecplotZone().

◆ WriteVtkFooter()

void Nektar::MultiRegions::ExpList::WriteVtkFooter ( std::ostream &  outfile)

Definition at line 3636 of file ExpList.cpp.

3637{
3638 outfile << " </UnstructuredGrid>" << endl;
3639 outfile << "</VTKFile>" << endl;
3640}

◆ WriteVtkHeader()

void Nektar::MultiRegions::ExpList::WriteVtkHeader ( std::ostream &  outfile)

Definition at line 3628 of file ExpList.cpp.

3629{
3630 outfile << "<?xml version=\"1.0\"?>" << endl;
3631 outfile << R"(<VTKFile type="UnstructuredGrid" version="0.1" )"
3632 << "byte_order=\"LittleEndian\">" << endl;
3633 outfile << " <UnstructuredGrid>" << endl;
3634}

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

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

void Nektar::MultiRegions::ExpList::WriteVtkPieceFooter ( std::ostream &  outfile,
int  expansion 
)

Definition at line 3775 of file ExpList.cpp.

3777{
3778 outfile << " </PointData>" << endl;
3779 outfile << " </Piece>" << endl;
3780}

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

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