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

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

#include <ExpList.h>

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

Public Member Functions

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Detailed Description

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

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

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

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

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

Definition at line 98 of file ExpList.h.

Constructor & Destructor Documentation

◆ ExpList() [1/9]

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

The default constructor using a type.

Creates an empty expansion list.

Definition at line 91 of file ExpList.cpp.

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

◆ ExpList() [2/9]

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

The copy constructor.

Copies an existing expansion list.

Parameters
inSource expansion list.

Definition at line 107 of file ExpList.cpp.

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

References SetupCoeffPhys().

◆ ExpList() [3/9]

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

Constructor copying only elements defined in eIds.

Copies the eIds elements from an existing expansion list.

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

Definition at line 128 of file ExpList.cpp.

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

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

◆ ExpList() [4/9]

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

Generate an ExpList from a meshgraph graph and session file.

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

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

Definition at line 168 of file ExpList.cpp.

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

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

◆ ExpList() [5/9]

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

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

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

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

Definition at line 210 of file ExpList.cpp.

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

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

◆ ExpList() [6/9]

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

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

Definition at line 232 of file ExpList.cpp.

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

◆ ExpList() [7/9]

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

Generate expansions for the trace space expansions used in DisContField.

◆ ExpList() [8/9]

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

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

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

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

Definition at line 1105 of file ExpList.cpp.

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

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

◆ ExpList() [9/9]

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

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

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

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

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

Definition at line 1270 of file ExpList.cpp.

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

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

◆ ~ExpList()

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

The default destructor.

Definition at line 1893 of file ExpList.cpp.

1894{
1895}

Member Function Documentation

◆ AddFwdBwdTraceIntegral()

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

Definition at line 2178 of file ExpList.h.

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

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

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

Definition at line 6549 of file ExpList.cpp.

6552{
6553 int nelmt;
6554 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6555
6556 nelmtcoef = GetNcoeffs(0);
6557 nelmtpnts = GetTotPoints(0);
6558
6559 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6560 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6561
6562 Array<OneD, NekDouble> MatQ_data;
6563 Array<OneD, NekDouble> MatC_data;
6564
6565 DNekMatSharedPtr tmpMatQ, tmpMatC;
6566
6567 nelmtcoef0 = nelmtcoef;
6568 nelmtpnts0 = nelmtpnts;
6569
6570 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6571 {
6572 nelmtcoef = GetNcoeffs(nelmt);
6573 nelmtpnts = GetTotPoints(nelmt);
6574
6575 tmpMatQ = ElmtJacQuad[nelmt];
6576 tmpMatC = ElmtJacCoef[nelmt];
6577
6578 MatQ_data = tmpMatQ->GetPtr();
6579 MatC_data = tmpMatC->GetPtr();
6580
6581 if (nelmtcoef != nelmtcoef0)
6582 {
6583 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6584 nelmtcoef0 = nelmtcoef;
6585 }
6586
6587 if (nelmtpnts != nelmtpnts0)
6588 {
6589 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6590 nelmtpnts0 = nelmtpnts;
6591 }
6592
6593 for (int np = 0; np < nelmtcoef; np++)
6594 {
6595 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6596 1);
6597 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6598 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
6599
6600 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6601 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6602 }
6603 }
6604}
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 6492 of file ExpList.cpp.

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

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

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

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

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

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

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

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

3324{
3325}

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

◆ BwdTrans()

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

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

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

Definition at line 1717 of file ExpList.h.

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

References v_BwdTrans().

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

◆ ClearGlobalLinSysManager()

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

Definition at line 5958 of file ExpList.cpp.

5959{
5961}
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3981

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

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

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

Referenced by ExpList(), and v_Reset().

◆ CurlCurl()

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

Definition at line 1832 of file ExpList.h.

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

References v_CurlCurl().

◆ DealiasedDotProd()

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

Definition at line 1868 of file ExpList.h.

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

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

References v_DealiasedProd().

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

◆ DivideByQuadratureMetric()

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

Divided by the metric jacobi and quadrature weights.

Divided by the metric jacobi and quadrature weights

Definition at line 1942 of file ExpList.cpp.

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

References m_phys_offset.

◆ EvalBasisNumModesMax()

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

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

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

Definition at line 1526 of file ExpList.h.

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

References m_exp.

◆ EvalBasisNumModesMaxPerExp()

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

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

Definition at line 1541 of file ExpList.h.

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

References m_exp.

◆ EvaluateBoundaryConditions()

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

Definition at line 2250 of file ExpList.h.

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

References v_EvaluateBoundaryConditions().

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

◆ ExponentialFilter()

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

Definition at line 2387 of file ExpList.cpp.

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

References m_phys_offset.

◆ ExtractCoeffsFromFile()

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

Definition at line 4008 of file ExpList.cpp.

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

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

◆ ExtractCoeffsToCoeffs()

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

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

Definition at line 4248 of file ExpList.cpp.

4252{
4253 v_ExtractCoeffsToCoeffs(fromExpList, fromCoeffs, toCoeffs);
4254}
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:4352

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

4244{
4245 v_ExtractDataToCoeffs(fielddef, fielddata, field, coeffs, zIdToPlane);
4246}
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:4264

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

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

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

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

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

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

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

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

References v_FwdTrans().

◆ FwdTransBndConstrained()

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

Definition at line 1696 of file ExpList.h.

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

References v_FwdTransBndConstrained().

◆ FwdTransLocalElmt()

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

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

Definition at line 1687 of file ExpList.h.

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

References v_FwdTransLocalElmt().

◆ GenBlockMatrix()

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

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

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

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

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

Definition at line 2517 of file ExpList.cpp.

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

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

Referenced by GetBlockMatrix().

◆ GeneralGetFieldDefinitions()

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

Definition at line 4081 of file ExpList.cpp.

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

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

Referenced by v_GetFieldDefinitions().

◆ GeneralMatrixOp()

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

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

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

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

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

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

Definition at line 2696 of file ExpList.cpp.

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

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

◆ GenerateElementVector()

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

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

Definition at line 4446 of file ExpList.cpp.

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

References m_phys_offset, and Vmath::Vcopy().

◆ GenGlobalBndLinSys()

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

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

Definition at line 3089 of file ExpList.cpp.

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

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

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

◆ GenGlobalLinSys()

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

This operation constructs the global linear system of type mkey.

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

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

Definition at line 3071 of file ExpList.cpp.

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

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

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

◆ GenGlobalMatrix()

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

Generates a global matrix from the given key and map.

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

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

Definition at line 2786 of file ExpList.cpp.

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

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

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

◆ GenGlobalMatrixFull()

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

Definition at line 2919 of file ExpList.cpp.

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

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

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

◆ Get1DScaledTotPoints()

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

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

Definition at line 1567 of file ExpList.h.

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

◆ GetBCValues()

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

Definition at line 1878 of file ExpList.h.

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

References v_GetBCValues().

◆ GetBlockMatrix()

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

Definition at line 2652 of file ExpList.cpp.

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

References GenBlockMatrix(), and m_blockMat.

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

◆ GetBndCondBwdWeight()

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

Get the weight value for boundary conditions.

Definition at line 2127 of file ExpList.h.

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

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

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

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

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

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

References ASSERTL1.

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

◆ GetBoundaryNormals()

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

Definition at line 2294 of file ExpList.h.

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

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

4391{
4392 size_t nTracePts = weightAver.size();
4393 // average for interior traces
4394 for (int i = 0; i < nTracePts; ++i)
4395 {
4396 weightAver[i] = 0.5;
4397 weightJump[i] = 1.0;
4398 }
4399 FillBwdWithBwdWeight(weightAver, weightJump);
4400}
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:5439

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

6188{
6190 int nElmtPntPrevious = 0;
6191 int nElmtCoefPrevious = 0;
6192 int nTotElmt = (*m_exp).size();
6193 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
6194 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
6195
6196 Array<OneD, NekDouble> tmpPhys;
6197 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
6198 Array<OneD, NekDouble> stdMat_data;
6199
6200 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
6201 {
6202 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
6203 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
6204 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
6205
6206 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
6207 (ElmtTypeNow != ElmtTypePrevious))
6208 {
6210 stdExp = (*m_exp)[nelmt]->GetStdExp();
6211 StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
6212 stdExp->DetShapeType(), *stdExp);
6213
6214 DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
6215 stdMat_data = BwdMat->GetPtr();
6216
6217 if (nElmtPntPrevious != nElmtPnt)
6218 {
6219 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
6220 }
6221
6222 ElmtTypePrevious = ElmtTypeNow;
6223 nElmtPntPrevious = nElmtPnt;
6224 nElmtCoefPrevious = nElmtCoef;
6225 }
6226
6227 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
6228 inarray[nelmt],
6229 tmpPhys); // weight with metric
6230
6231 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
6232
6233 for (int np = 0; np < nElmtPnt; np++)
6234 {
6235 NekDouble factor = tmpPhys[np];
6236 clmnArray = MatDataArray + np * nElmtCoef;
6237 clmnStdMatArray = stdMat_data + np * nElmtCoef;
6238 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
6239 }
6240 }
6241}
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 4919 of file ExpList.cpp.

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

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

◆ GetElmtToExpId() [1/2]

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

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

Definition at line 1039 of file ExpList.h.

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

References ASSERTL0, and m_elmtToExpId.

◆ GetElmtToExpId() [2/2]

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

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

Definition at line 1032 of file ExpList.h.

1034 {
1035 return m_elmtToExpId;
1036 }

References m_elmtToExpId.

◆ GetExp() [1/3]

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

This function returns the vector of elements in the expansion.

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

Definition at line 2070 of file ExpList.h.

2072{
2073 return m_exp;
2074}

References m_exp.

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

◆ GetExp() [2/3]

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

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

Definition at line 3170 of file ExpList.cpp.

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

References GetExp(), and GetExpIndex().

◆ GetExp() [3/3]

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

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

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

Definition at line 2048 of file ExpList.h.

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

References m_exp.

◆ GetExpFromGeomId()

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

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

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

Definition at line 2058 of file ExpList.h.

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

References ASSERTL0, m_elmtToExpId, and m_exp.

◆ GetExpIndex() [1/2]

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

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

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

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

Definition at line 3181 of file ExpList.cpp.

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

References GetExpIndex().

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

◆ GetExpIndex() [2/2]

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

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

Definition at line 3191 of file ExpList.cpp.

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

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

◆ GetExpSize()

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

◆ GetExpType()

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

Returns the type of the expansion.

Definition at line 1888 of file ExpList.cpp.

1889{
1890 return m_expType;
1891}

References m_expType.

Referenced by v_CurlCurl().

◆ GetFieldDefinitions() [1/2]

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

Definition at line 897 of file ExpList.h.

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

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

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

5980{
5981 return v_GetGlobalLinSysManager();
5982}
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Definition: ExpList.cpp:4001

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

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

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

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

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

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

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

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

◆ GetMatIpwrtDeriveBase() [2/2]

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

Definition at line 6080 of file ExpList.cpp.

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

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

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

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

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

5969{
5970 return v_GetPoolCount(poolName);
5971}
virtual int v_GetPoolCount(std::string)
Definition: ExpList.cpp:3987

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

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

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

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

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

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

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

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

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

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

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

◆ HelmSolve()

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

Solve helmholtz problem.

Definition at line 1734 of file ExpList.h.

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

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

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

References v_ImposeDirichletConditions().

◆ InitialiseExpVector()

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

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

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

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

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

Definition at line 1672 of file ExpList.cpp.

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

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

Referenced by ExpList().

◆ Integral() [1/2]

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

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

The integration is evaluated locally, that is

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

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

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

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

Definition at line 543 of file ExpList.h.

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

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

Referenced by Integral().

◆ Integral() [2/2]

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

The integration is evaluated locally, that is

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

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

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

Definition at line 564 of file ExpList.h.

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

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

References v_IProductWRTBase().

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

◆ IProductWRTDerivBase() [1/2]

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

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

Definition at line 1669 of file ExpList.h.

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

References v_IProductWRTDerivBase().

◆ IProductWRTDerivBase() [2/2]

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

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

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

Definition at line 1659 of file ExpList.h.

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

References v_IProductWRTDerivBase().

◆ IProductWRTDirectionalDerivBase()

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

Directional derivative along a given direction.

Definition at line 1988 of file ExpList.cpp.

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

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

◆ L2()

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

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

Definition at line 514 of file ExpList.h.

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

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

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

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

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

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

◆ LocalToGlobal() [1/2]

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

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

Definition at line 1961 of file ExpList.h.

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

References v_LocalToGlobal().

◆ LocalToGlobal() [2/2]

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

Definition at line 1965 of file ExpList.h.

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

References v_LocalToGlobal().

◆ MultiplyByBlockMatrix()

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

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

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

Definition at line 1905 of file ExpList.cpp.

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

References Nektar::eWrapper, and GetBlockMatrix().

◆ MultiplyByElmtInvMass()

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

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

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

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

Definition at line 2408 of file ExpList.cpp.

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

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

Referenced by v_FwdTransLocalElmt().

◆ MultiplyByInvMassMatrix()

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

Definition at line 1725 of file ExpList.h.

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

References v_MultiplyByInvMassMatrix().

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

◆ MultiplyByMassMatrix()

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

Definition at line 299 of file ExpList.h.

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

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

◆ MultiplyByQuadratureMetric()

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

multiply the metric jacobi and quadrature weights

multiply the metric jacobi and quadrature weights

Definition at line 1925 of file ExpList.cpp.

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

References m_phys_offset.

◆ NormVectorIProductWRTBase() [1/2]

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

Definition at line 1894 of file ExpList.h.

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

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

References v_PeriodicBwdCopy().

◆ PhysDeriv() [1/3]

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

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

Definition at line 1797 of file ExpList.h.

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

References v_PhysDeriv().

◆ PhysDeriv() [2/3]

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

Definition at line 1807 of file ExpList.h.

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

References v_PhysDeriv().

◆ PhysDeriv() [3/3]

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

Definition at line 1813 of file ExpList.h.

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

References v_PhysDeriv().

Referenced by v_Curl(), and v_CurlCurl().

◆ PhysDirectionalDeriv()

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

Definition at line 1822 of file ExpList.h.

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

References v_PhysDirectionalDeriv().

◆ PhysEvaluate()

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

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

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

Definition at line 3300 of file ExpList.cpp.

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

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

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

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

References v_Reset().

◆ ResetMatrices()

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

Reset matrices.

Definition at line 3363 of file ExpList.cpp.

3364{
3365 // Reset matrix managers.
3366 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3367 LocalRegions::MatrixKey::opLess>::ClearManager();
3368 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3369 LocalRegions::MatrixKey::opLess>::ClearManager();
3370
3371 // Reset block matrix map
3372 m_blockMat->clear();
3373}
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:5145

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

References v_SetHomoLen().

◆ SetModifiedBasis()

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

Set Modified Basis for the stability analysis.

◆ SetPhys() [1/2]

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

Fills the array m_phys.

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

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

Definition at line 1622 of file ExpList.h.

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

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

◆ SetPhys() [2/2]

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

Set the i th value of m_phys to value val.

Set the i th value ofm_phys to value val.

Definition at line 1610 of file ExpList.h.

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

References m_phys.

◆ SetPhysArray()

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

Sets the array m_phys.

Definition at line 1629 of file ExpList.h.

1630{
1631 m_phys = inarray;
1632}

References m_phys.

◆ SetPhysState()

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

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

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

Definition at line 1636 of file ExpList.h.

1637{
1638 m_physState = physState;
1639}

References m_physState.

◆ SetupCoeffPhys()

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

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

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

Definition at line 1615 of file ExpList.cpp.

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

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

Referenced by ExpList().

◆ SetUpPhysNormals()

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

Definition at line 2257 of file ExpList.h.

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

References v_SetUpPhysNormals().

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

◆ SetWaveSpace()

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

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

Definition at line 1596 of file ExpList.h.

1597{
1598 m_WaveSpace = wavespace;
1599}

References m_WaveSpace.

◆ SmoothField()

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

Smooth a field across elements.

Definition at line 1705 of file ExpList.h.

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

References FilterPython_Function::field, and v_SmoothField().

◆ UnsetGlobalLinSys()

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

Definition at line 5973 of file ExpList.cpp.

5974{
5975 v_UnsetGlobalLinSys(key, clearLocalMatrices);
5976}
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:3993

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

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

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:4503
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 5074 of file ExpList.cpp.

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

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

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

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

6038{
6039 NEKERROR(ErrorUtil::efatal, "AddTraceIntegralToOffDiag not defined");
6040}

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

5113{
5115 "v_AddTraceQuadPhysToField is not defined for this class type");
5116}

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

5122{
5124 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
5125}

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

4211{
4212 v_AppendFieldData(fielddef, fielddata, m_coeffs);
4213}

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

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

References m_coeff_offset.

◆ v_BwdTrans()

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

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

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

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

Definition at line 3125 of file ExpList.cpp.

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

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

Referenced by BwdTrans().

◆ v_ClearGlobalLinSysManager()

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

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

Definition at line 3981 of file ExpList.cpp.

3982{
3984 "ClearGlobalLinSysManager not implemented for ExpList.");
3985}

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

Referenced by ClearGlobalLinSysManager().

◆ v_Curl()

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

Definition at line 2240 of file ExpList.cpp.

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

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

◆ v_CurlCurl()

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

Definition at line 2289 of file ExpList.cpp.

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

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

Referenced by CurlCurl().

◆ v_DealiasedDotProd()

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

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

Definition at line 5251 of file ExpList.cpp.

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

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

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

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

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

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

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

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

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

5525{
5526 int n, cnt;
5527 Array<OneD, NekDouble> tmp1, tmp2;
5529
5530 Array<OneD, int> ElmtID, EdgeID;
5531 GetBoundaryToElmtMap(ElmtID, EdgeID);
5532
5533 // Initialise result
5534 boundary =
5535 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5536
5537 // Skip other boundary regions
5538 for (cnt = n = 0; n < i; ++n)
5539 {
5540 cnt += GetBndCondExpansions()[n]->GetExpSize();
5541 }
5542
5543 int offsetBnd;
5544 int offsetElmt = 0;
5545 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5546 {
5547 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5548
5549 elmt = GetExp(ElmtID[cnt + n]);
5550 elmt->GetTracePhysVals(
5551 EdgeID[cnt + n], GetBndCondExpansions()[i]->GetExp(n),
5552 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
5553
5554 offsetElmt += elmt->GetTotPoints();
5555 }
5556}
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 5599 of file ExpList.cpp.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5690{
5691 NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
5692}

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

Referenced by FillBwdWithBwdWeight().

◆ v_FwdTrans()

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

◆ v_FwdTransBndConstrained()

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

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

Definition at line 2455 of file ExpList.cpp.

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

References m_coeff_offset, and m_phys_offset.

Referenced by FwdTransBndConstrained().

◆ v_FwdTransLocalElmt()

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

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

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

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

Definition at line 2446 of file ExpList.cpp.

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

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

Referenced by FwdTransLocalElmt(), and v_FwdTrans().

◆ v_GetBCValues()

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

Reimplemented in Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 5261 of file ExpList.cpp.

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by GetBoundaryNormals().

◆ v_GetBoundaryToElmtMap()

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

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

Definition at line 5680 of file ExpList.cpp.

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

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

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

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

4202{
4204}
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:4081

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

4194{
4195 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
4196 v_GetFieldDefinitions(returnval);
4197 return returnval;
4198}

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

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

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

◆ v_GetGlobalLinSysManager()

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

Definition at line 4000 of file ExpList.cpp.

4002{
4004 "GetGlobalLinSysManager not implemented for ExpList.");
4006}
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 3951 of file ExpList.cpp.

3952{
3954 "This method is not defined or valid for this class type");
3955 NekDouble len = 0.0;
3956 return len;
3957}

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

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

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

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

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

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

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

5132{
5134 "v_GetLocTraceFromTracePts is not defined for this class");
5135}

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

6682{
6683 NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
6685}
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 4402 of file ExpList.cpp.

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

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

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

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

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

5777{
5779 "This method is not defined or valid for this class type");
5780 return NullExpListSharedPtr;
5781}
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 3987 of file ExpList.cpp.

3988{
3989 NEKERROR(ErrorUtil::efatal, "GetPoolCount not implemented for ExpList.");
3990 return -1;
3991}

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

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

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

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

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

4626{
4627 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
4628}
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 4609 of file ExpList.cpp.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5397{
5398 LibUtilities::Timer timer;
5399 timer.Start();
5400 // initialise if required
5402 {
5403 for (int i = 0; i < m_collections.size(); ++i)
5404 {
5406 }
5408 }
5409
5410 Array<OneD, NekDouble> tmp;
5411 int input_offset{0};
5412 int output_offset{0};
5413 for (int i = 0; i < m_collections.size(); ++i)
5414 {
5416 inarray + input_offset,
5417 tmp = outarray + output_offset);
5418 input_offset +=
5420 output_offset +=
5422 }
5423 timer.Stop();
5424 // Elapsed time
5425 timer.AccumulateRegion("Collections:IProductWRTBase", 10);
5426}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::Collections::eIProductWRTBase, m_collections, m_collectionsDoInit, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

Referenced by IProductWRTBase().

◆ v_IProductWRTDerivBase() [1/2]

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

The operation is evaluated locally for every element by the function StdRegions::StdExpansion::IProductWRTDerivBase.

Parameters
inarrayAn array of arrays of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\) in dir directions.
outarrayAn array of size \(N_{\mathrm{eof}}\) used to store the result.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 2030 of file ExpList.cpp.

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

References Nektar::LibUtilities::Timer::AccumulateRegion(), ASSERTL1, Nektar::ErrorUtil::efatal, Nektar::Collections::eIProductWRTDerivBase, GetCoordim(), LIKWID_MARKER_START, LIKWID_MARKER_STOP, m_collections, m_collectionsDoInit, NEKERROR, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

◆ v_IProductWRTDerivBase() [2/2]

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

The operation is evaluated locally for every element by the function StdRegions::Expansion::IProductWRTDerivBase.

Parameters
dir{0,1} is the direction in which the derivative of the basis should be taken
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
outarrayAn array of size \(N_{\mathrm{eof}}\) used to store the result.

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1969 of file ExpList.cpp.

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

References m_coeff_offset, and m_phys_offset.

Referenced by IProductWRTDerivBase().

◆ v_L2()

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

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

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

Parameters
SolAn ExpList, containing the discrete evaluation of the exact solution at the quadrature points in its array m_phys.
Returns
The \(L_2\) error of the approximation.

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

Definition at line 3856 of file ExpList.cpp.

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

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

5204{
5206 "LinearAdvectionDiffusionReactionSolve not implemented.");
5207 return NullGlobalLinSysKey;
5208}

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

5216{
5218 "This method is not defined or valid for this class type");
5219}

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

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

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

5282{
5283 Array<OneD, NekDouble> tmp;
5284 switch (GetCoordim(0))
5285 {
5286 case 1:
5287 {
5288 for (int i = 0; i < GetExpSize(); ++i)
5289 {
5290 (*m_exp)[i]->NormVectorIProductWRTBase(
5291 V[0] + GetPhys_Offset(i),
5292 tmp = outarray + GetCoeff_Offset(i));
5293 }
5294 }
5295 break;
5296 case 2:
5297 {
5298 for (int i = 0; i < GetExpSize(); ++i)
5299 {
5300 (*m_exp)[i]->NormVectorIProductWRTBase(
5301 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5302 tmp = outarray + GetCoeff_Offset(i));
5303 }
5304 }
5305 break;
5306 case 3:
5307 {
5308 for (int i = 0; i < GetExpSize(); ++i)
5309 {
5310 (*m_exp)[i]->NormVectorIProductWRTBase(
5311 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5312 V[2] + GetPhys_Offset(i),
5313 tmp = outarray + GetCoeff_Offset(i));
5314 }
5315 }
5316 break;
5317 default:
5318 NEKERROR(ErrorUtil::efatal, "Dimension not supported");
5319 break;
5320 }
5321}
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 5270 of file ExpList.cpp.

5275{
5277 "This method is not defined or valid for this class type");
5278}

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

5697{
5698 NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
5699}

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

Referenced by PeriodicBwdCopy().

◆ v_PhysDeriv() [1/3]

void Nektar::MultiRegions::ExpList::v_PhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 
)
protectedvirtual

Given a function \(f(\boldsymbol{x})\) evaluated at the quadrature points, this function calculates the derivatives \(\frac{d}{dx_1}\), \(\frac{d}{dx_2}\) and \(\frac{d}{dx_3}\) of the function \(f(\boldsymbol{x})\) at the same quadrature points. The local distribution of the quadrature points allows an elemental evaluation of the derivative. This is done by a call to the function StdRegions::StdExpansion::PhysDeriv.

Parameters
inarrayAn array of size \(Q_{\mathrm{tot}}\) containing the values of the function \(f(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).
out_d0The discrete evaluation of the derivative \(\frac{d}{dx_1}\) will be stored in this array of size \(Q_{\mathrm{tot}}\).
out_d1The discrete evaluation of the derivative \(\frac{d}{dx_2}\) will be stored in this array of size \(Q_{\mathrm{tot}}\). Note that if no memory is allocated for out_d1, the derivative \(\frac{d}{dx_2}\) will not be calculated.
out_d2The discrete evaluation of the derivative \(\frac{d}{dx_3}\) will be stored in this array of size \(Q_{\mathrm{tot}}\). Note that if no memory is allocated for out_d2, the derivative \(\frac{d}{dx_3}\) will not be calculated.

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

Definition at line 2142 of file ExpList.cpp.

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

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::Collections::ePhysDeriv, m_collections, m_collectionsDoInit, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

Referenced by PhysDeriv(), and v_PhysDeriv().

◆ v_PhysDeriv() [2/3]

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

Definition at line 2179 of file ExpList.cpp.

2182{
2183 Direction edir = DirCartesianMap[dir];
2184 v_PhysDeriv(edir, inarray, out_d);
2185}
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:87

References Nektar::MultiRegions::DirCartesianMap, and v_PhysDeriv().

◆ v_PhysDeriv() [3/3]

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

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

Definition at line 2187 of file ExpList.cpp.

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

References Nektar::MultiRegions::eN, Nektar::Collections::ePhysDeriv, Nektar::MultiRegions::eS, m_collections, m_collectionsDoInit, and m_phys_offset.

◆ v_PhysDirectionalDeriv()

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

Definition at line 2357 of file ExpList.cpp.

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

References m_phys_offset, and Vmath::Vcopy().

Referenced by PhysDirectionalDeriv().

◆ v_PhysGalerkinProjection1DScaled()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 6606 of file ExpList.cpp.

6609{
6610 int cnt, cnt1;
6611
6612 cnt = cnt1 = 0;
6613
6614 switch (m_expType)
6615 {
6616 case e2D:
6617 {
6618 for (int i = 0; i < GetExpSize(); ++i)
6619 {
6620 // get new points key
6621 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6622 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6623 int npt0 = (int)pt0 * scale;
6624 int npt1 = (int)pt1 * scale;
6625
6626 LibUtilities::PointsKey newPointsKey0(
6627 npt0, (*m_exp)[i]->GetPointsType(0));
6628 LibUtilities::PointsKey newPointsKey1(
6629 npt1, (*m_exp)[i]->GetPointsType(1));
6630
6631 // Project points;
6633 newPointsKey0, newPointsKey1, &inarray[cnt],
6634 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6635 (*m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6636
6637 cnt += npt0 * npt1;
6638 cnt1 += pt0 * pt1;
6639 }
6640 }
6641 break;
6642 case e3D:
6643 {
6644 for (int i = 0; i < GetExpSize(); ++i)
6645 {
6646 // get new points key
6647 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6648 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6649 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6650 int npt0 = (int)pt0 * scale;
6651 int npt1 = (int)pt1 * scale;
6652 int npt2 = (int)pt2 * scale;
6653
6654 LibUtilities::PointsKey newPointsKey0(
6655 npt0, (*m_exp)[i]->GetPointsType(0));
6656 LibUtilities::PointsKey newPointsKey1(
6657 npt1, (*m_exp)[i]->GetPointsType(1));
6658 LibUtilities::PointsKey newPointsKey2(
6659 npt2, (*m_exp)[i]->GetPointsType(2));
6660
6661 // Project points;
6663 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6664 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6665 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
6666 (*m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6667
6668 cnt += npt0 * npt1 * npt2;
6669 cnt1 += pt0 * pt1 * pt2;
6670 }
6671 }
6672 break;
6673 default:
6674 {
6675 NEKERROR(ErrorUtil::efatal, "not setup for this expansion");
6676 }
6677 break;
6678 }
6679}
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 5984 of file ExpList.cpp.

5987{
5988 // the scaling factor for the PhysInterp1DScaled is given as NekDouble
5989 // however inside Collections it is treated as a FactorMap
5990 // defining needed FactorMap to pass the scaling factor as an input to
5991 // Collections
5993 // Updating the FactorMap according to the scale input
5995 LibUtilities::Timer timer;
5996
5997 // initialise if required
5998 if (m_collections.size() &&
6000 {
6001 for (int i = 0; i < m_collections.size(); ++i)
6002 {
6005 }
6006 }
6007 // once the collections are initialized, check for the scaling factor
6008 for (int i = 0; i < m_collections.size(); ++i)
6009
6010 {
6012 factors);
6013 }
6014
6015 LIKWID_MARKER_START("v_PhysInterp1DScaled");
6016 timer.Start();
6017 Array<OneD, NekDouble> tmp;
6018 int input_offset{0};
6019 int output_offset{0};
6020 for (int i = 0; i < m_collections.size(); ++i)
6021 {
6023 inarray + input_offset,
6024 tmp = outarray + output_offset);
6025 input_offset +=
6027 output_offset +=
6029 }
6030 timer.Stop();
6031 LIKWID_MARKER_STOP("v_PhysInterp1DScaled");
6032 timer.AccumulateRegion("Collections:PhysInterp1DScaled", 10);
6033}
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 3335 of file ExpList.cpp.

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

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

5147{
5149 "v_setBndCondBwdWeight is not defined for this class type");
5150}

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

3960{
3962 "This method is not defined or valid for this class type");
3963}

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

5500{
5501 for (int i = 0; i < m_exp->size(); ++i)
5502 {
5503 for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
5504 {
5505 (*m_exp)[i]->ComputeTraceNormal(j);
5506 }
5507 }
5508}

References m_exp.

Referenced by SetUpPhysNormals().

◆ v_SmoothField()

void Nektar::MultiRegions::ExpList::v_SmoothField ( Array< OneD, NekDouble > &  field)
protectedvirtual

This function smooth a field after some calculaitons which have been done elementally.

Parameters
fieldAn array containing the field in physical space

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

Definition at line 2478 of file ExpList.cpp.

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

References ASSERTL0, Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGLL_Lagrange, and m_exp.

Referenced by SmoothField().

◆ v_UnsetGlobalLinSys()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 3993 of file ExpList.cpp.

3995{
3997 "UnsetGlobalLinSys not implemented for ExpList.");
3998}

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

4486{
4488 "This method is not defined or valid for this class type");
4489 static std::shared_ptr<ExpList> result;
4490 return result;
4491}

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

5716{
5718 "This method is not defined or valid for this class type");
5719 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
5720 return result;
5721}

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

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

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

4580{
4581 ASSERTL1(Vn.size() >= m_npoints, "Vn is not of sufficient length");
4582 ASSERTL1(Fwd.size() >= m_npoints, "Fwd is not of sufficient length");
4583 ASSERTL1(Bwd.size() >= m_npoints, "Bwd is not of sufficient length");
4584 ASSERTL1(Upwind.size() >= m_npoints, "Upwind is not of sufficient length");
4585
4586 // Process each point in the expansion.
4587 for (int j = 0; j < m_npoints; ++j)
4588 {
4589 // Upwind based on one-dimensional velocity.
4590 if (Vn[j] > 0.0)
4591 {
4592 Upwind[j] = Fwd[j];
4593 }
4594 else
4595 {
4596 Upwind[j] = Bwd[j];
4597 }
4598 }
4599}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References v_WriteTecplotZone().

◆ WriteVtkFooter()

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

Definition at line 3632 of file ExpList.cpp.

3633{
3634 outfile << " </UnstructuredGrid>" << endl;
3635 outfile << "</VTKFile>" << endl;
3636}

◆ WriteVtkHeader()

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

Definition at line 3624 of file ExpList.cpp.

3625{
3626 outfile << "<?xml version=\"1.0\"?>" << endl;
3627 outfile << R"(<VTKFile type="UnstructuredGrid" version="0.1" )"
3628 << "byte_order=\"LittleEndian\">" << endl;
3629 outfile << " <UnstructuredGrid>" << endl;
3630}

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

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

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

Definition at line 3771 of file ExpList.cpp.

3773{
3774 outfile << " </PointData>" << endl;
3775 outfile << " </Piece>" << endl;
3776}

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

References v_WriteVtkPieceHeader().

Member Data Documentation

◆ m_blockMat

BlockMatrixMapShPtr Nektar::MultiRegions::ExpList::m_blockMat
protected

Definition at line 1128 of file ExpList.h.

Referenced by GetBlockMatrix(), ResetMatrices(), and v_Reset().

◆ m_coeff_offset

Array<OneD, int> Nektar::MultiRegions::ExpList::m_coeff_offset
protected

◆ m_coeffs

Array<OneD, NekDouble> Nektar::MultiRegions::ExpList::m_coeffs
protected

Concatenation of all local expansion coefficients.

The array of length m_ncoeffs \(=N_{\mathrm{eof}}\) which is the concatenation of the local expansion coefficients \(\hat{u}_n^e\) over all \(N_{\mathrm{el}}\) elements

\[\mathrm{\texttt{m\_coeffs}}=\boldsymbol{\hat{u}}_{l} = \underline{\boldsymbol{\hat{u}}}^e = \left [ \begin{array}{c} \boldsymbol{\hat{u}}^{1} \ \ \boldsymbol{\hat{u}}^{2} \ \ \vdots \ \ \boldsymbol{\hat{u}}^{{{N_{\mathrm{el}}}}} \end{array} \right ], \quad \mathrm{where}\quad \boldsymbol{\hat{u}}^{e}[n]=\hat{u}_n^{e}\]

Definition at line 1083 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField::Assemble(), GetCoeff(), GetCoeffs(), SetCoeff(), Nektar::MultiRegions::ExpList2DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList2DHomogeneous2D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous2D::SetCoeffPhys(), SetCoeffs(), SetCoeffsArray(), SetupCoeffPhys(), UpdateCoeffs(), v_AppendFieldData(), Nektar::MultiRegions::ExpListHomogeneous1D::v_AppendFieldData(), Nektar::MultiRegions::ExpListHomogeneous2D::v_AppendFieldData(), Nektar::MultiRegions::ContField::v_GlobalToLocal(), Nektar::MultiRegions::ContField::v_LocalToGlobal(), and v_WriteTecplotField().

◆ m_coeffsToElmt

Array<OneD, std::pair<int, int> > Nektar::MultiRegions::ExpList::m_coeffsToElmt
protected

m_coeffs to elemental value map

Definition at line 1127 of file ExpList.h.

Referenced by GetCoeffsToElmt(), and SetupCoeffPhys().

◆ m_collections

Collections::CollectionVector Nektar::MultiRegions::ExpList::m_collections
protected

◆ m_collectionsDoInit

std::vector<bool> Nektar::MultiRegions::ExpList::m_collectionsDoInit
protected

Vector of bools to act as an initialise on first call flag.

Definition at line 1121 of file ExpList.h.

Referenced by CreateCollections(), GeneralMatrixOp(), v_BwdTrans(), v_IProductWRTBase(), v_IProductWRTDerivBase(), v_PhysDeriv(), and v_PhysInterp1DScaled().

◆ m_comm

LibUtilities::CommSharedPtr Nektar::MultiRegions::ExpList::m_comm
protected

◆ m_elmtToExpId

std::unordered_map<int, int> Nektar::MultiRegions::ExpList::m_elmtToExpId
protected

◆ m_exp

std::shared_ptr<LocalRegions::ExpansionVector> Nektar::MultiRegions::ExpList::m_exp
protected

The list of local expansions.

The (shared pointer to the) vector containing (shared pointers to) all local expansions. The fact that the local expansions are all stored as a (pointer to a) #StdExpansion, the abstract base class for all local expansions, allows a general implementation where most of the routines for the derived classes are defined in the ExpList base class.

Definition at line 1118 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), Nektar::MultiRegions::ContField3DHomogeneous2D::ContField3DHomogeneous2D(), CreateCollections(), Nektar::MultiRegions::DisContField::DisContField(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous2D::DisContField3DHomogeneous2D(), EvalBasisNumModesMax(), EvalBasisNumModesMaxPerExp(), Nektar::MultiRegions::DisContField::EvaluateHDGPostProcessing(), ExpList(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), GenBlockMatrix(), GeneralGetFieldDefinitions(), GeneralMatrixOp(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), GenGlobalMatrix(), GenGlobalMatrixFull(), GetCoordim(), GetElmtNormalLength(), GetExp(), GetExpFromGeomId(), GetExpIndex(), Nektar::MultiRegions::DisContField::GetFwdBwdTracePhys(), GetNcoeffs(), GetShapeDimension(), GetTotPoints(), Nektar::MultiRegions::DisContField::IsLeftAdjacentTrace(), PhysEvaluate(), SetupCoeffPhys(), Nektar::MultiRegions::DisContField::SetUpDG(), Nektar::MultiRegions::DisContField::v_AddTraceIntegral(), v_ExtractDataToCoeffs(), Nektar::MultiRegions::ExpListHomogeneous1D::v_ExtractDataToCoeffs(), v_GetMovingFrames(), v_GetNormals(), v_PhysGalerkinProjection1DScaled(), v_Reset(), v_SetUpPhysNormals(), v_SmoothField(), Nektar::MultiRegions::ContField::v_UnsetGlobalLinSys(), v_Upwind(), v_WriteTecplotConnectivity(), and v_WriteTecplotZone().

◆ m_expType

ExpansionType Nektar::MultiRegions::ExpList::m_expType
protected

◆ m_graph

SpatialDomains::MeshGraphSharedPtr Nektar::MultiRegions::ExpList::m_graph
protected

◆ m_ncoeffs

int Nektar::MultiRegions::ExpList::m_ncoeffs
protected

◆ m_npoints

int Nektar::MultiRegions::ExpList::m_npoints
protected

◆ m_phys

Array<OneD, NekDouble> Nektar::MultiRegions::ExpList::m_phys
protected

The global expansion evaluated at the quadrature points.

The array of length m_npoints \(=Q_{\mathrm{tot}}\) containing the evaluation of \(u^{\delta}(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\).

\[\mathrm{\texttt{m\_phys}}=\boldsymbol{u}_{l} = \underline{\boldsymbol{u}}^e = \left [ \begin{array}{c} \boldsymbol{u}^{1} \ \ \boldsymbol{u}^{2} \ \ \vdots \ \ \boldsymbol{u}^{{{N_{\mathrm{el}}}}} \end{array} \right ],\quad \mathrm{where}\quad \boldsymbol{u}^{e}[i]=u^{\delta}(\boldsymbol{x}_i)\]

Definition at line 1099 of file ExpList.h.

Referenced by GetPhys(), Integral(), Nektar::MultiRegions::ExpList2DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList2DHomogeneous2D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous1D::SetCoeffPhys(), Nektar::MultiRegions::ExpList3DHomogeneous2D::SetCoeffPhys(), SetPhys(), SetPhysArray(), SetupCoeffPhys(), UpdatePhys(), Nektar::MultiRegions::DisContField::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField::v_GetFwdBwdTracePhys(), v_WriteTecplotField(), v_WriteVtkPieceData(), Nektar::MultiRegions::ExpListHomogeneous1D::v_WriteVtkPieceData(), and Nektar::MultiRegions::ExpListHomogeneous2D::v_WriteVtkPieceData().

◆ m_phys_offset

Array<OneD, int> Nektar::MultiRegions::ExpList::m_phys_offset
protected

◆ m_physState

bool Nektar::MultiRegions::ExpList::m_physState
protected

The state of the array m_phys.

Indicates whether the array m_phys, created to contain the evaluation of \(u^{\delta}(\boldsymbol{x})\) at the quadrature points \(\boldsymbol{x}_i\), is filled with these values.

Definition at line 1107 of file ExpList.h.

Referenced by GetPhysState(), Integral(), SetPhys(), SetPhysState(), UpdatePhys(), Nektar::MultiRegions::DisContField::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_ExtractTracePhys(), and v_WriteTecplotField().

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::MultiRegions::ExpList::m_session
protected

◆ m_WaveSpace

bool Nektar::MultiRegions::ExpList::m_WaveSpace
protected