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 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 Curl (Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
 
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)
 
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 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
 Exapnsion 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...
 
std::vector< int > m_coll_coeff_offset
 Offset of elemental data into the array m_coeffs. More...
 
std::vector< int > m_coll_phys_offset
 Offset of elemental data into the array m_phys. 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 97 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 90 of file ExpList.cpp.

91 : m_expType(type), m_ncoeffs(0), m_npoints(0), m_physState(false),
94 m_WaveSpace(false)
95{
96}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1129
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1104
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1115
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1060
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1048

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

107 : std::enable_shared_from_this<ExpList>(in), m_expType(in.m_expType),
108
109 m_comm(in.m_comm), m_session(in.m_session), m_graph(in.m_graph),
110 m_ncoeffs(in.m_ncoeffs), m_npoints(in.m_npoints), m_physState(false),
111 m_exp(in.m_exp), m_collections(in.m_collections),
112 m_collectionsDoInit(in.m_collectionsDoInit),
113 m_coll_coeff_offset(in.m_coll_coeff_offset),
114 m_coll_phys_offset(in.m_coll_phys_offset),
115 m_coeff_offset(in.m_coeff_offset), m_phys_offset(in.m_phys_offset),
116 m_blockMat(in.m_blockMat), m_WaveSpace(false),
117 m_elmtToExpId(in.m_elmtToExpId)
118{
119 // Set up m_coeffs, m_phys and offset arrays.
120 // use this to keep memory declaration in one place
121 SetupCoeffPhys(DeclareCoeffPhysArrays, false);
122}
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:1403
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1124
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition: ExpList.h:1118
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1122
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1053
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1057
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1120
Collections::CollectionVector m_collections
Definition: ExpList.h:1116
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1136
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1055
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1126

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

132 : m_expType(in.m_expType), m_comm(in.m_comm), m_session(in.m_session),
133 m_graph(in.m_graph), m_physState(false),
136 m_WaveSpace(false)
137{
138 for (int i = 0; i < eIDs.size(); ++i)
139 {
140 (*m_exp).push_back((*(in.m_exp))[eIDs[i]]);
141 }
142
143 // Set up m_coeffs, m_phys and offset arrays.
144 SetupCoeffPhys(DeclareCoeffPhysArrays);
145
146 // set up collections
147 CreateCollections(ImpType);
148}
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:5461

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

173 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
174 m_physState(false),
177 m_WaveSpace(false)
178{
179 // Retrieve the list of expansions
180 const SpatialDomains::ExpansionInfoMap &expansions =
181 graph->GetExpansionInfo(var);
182
183 // Initialise Expansionn Vector
184 InitialiseExpVector(expansions);
185
186 // Setup phys coeff space
187 SetupCoeffPhys(DeclareCoeffPhysArrays);
188
189 // Initialise collection
190 CreateCollections(ImpType);
191}
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
Definition: ExpList.cpp:1446
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 211 of file ExpList.cpp.

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

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

969 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
970 m_physState(false),
973 m_WaveSpace(false)
974{
975 int i, j, elmtid = 0;
976
983
989
990 for (i = 0; i < locexp.size(); ++i)
991 {
992 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
993 locexp[i])))
994 {
995 m_expType = e0D;
996
997 for (j = 0; j < 2; ++j)
998 {
999 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
1000
1002 PointGeom);
1003 exp->SetElmtId(elmtid++);
1004 (*m_exp).push_back(exp);
1005 }
1006 }
1007 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
1008 locexp[i])))
1009 {
1010 m_expType = e1D;
1011 LibUtilities::BasisKey edgeKey0 =
1012 locexp[i]->GetBasis(0)->GetBasisKey();
1013
1014 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
1015 {
1016 segGeom = exp2D->GetGeom2D()->GetEdge(j);
1017
1018 int dir = exp2D->GetGeom2D()->GetDir(j);
1019
1020 if (locexp[i]->GetNtraces() == 3)
1021 {
1022 LibUtilities::BasisKey edgeKey =
1023 locexp[i]->GetBasis(dir)->GetBasisKey();
1024
1025 LibUtilities::BasisKey nEdgeKey(edgeKey0.GetBasisType(),
1026 edgeKey.GetNumModes(),
1027 edgeKey.GetPointsKey());
1028
1029 exp =
1031 nEdgeKey, segGeom);
1032 }
1033 else
1034 {
1035 exp =
1037 locexp[i]->GetBasis(dir)->GetBasisKey(), segGeom);
1038 }
1039
1040 exp->SetElmtId(elmtid++);
1041 (*m_exp).push_back(exp);
1042 }
1043 }
1044 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
1045 locexp[i])))
1046 {
1047 m_expType = e2D;
1048
1049 LibUtilities::BasisKey face0_dir0 =
1050 locexp[i]->GetBasis(0)->GetBasisKey();
1051 LibUtilities::BasisKey face0_dir1 =
1052 locexp[i]->GetBasis(1)->GetBasisKey();
1053
1054 for (j = 0; j < exp3D->GetNtraces(); ++j)
1055 {
1056 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
1057
1058 int dir0 = exp3D->GetGeom3D()->GetDir(j, 0);
1059 int dir1 = exp3D->GetGeom3D()->GetDir(j, 1);
1060
1061 LibUtilities::BasisKey face_dir0 =
1062 locexp[i]->GetBasis(dir0)->GetBasisKey();
1063 LibUtilities::BasisKey face_dir1 =
1064 locexp[i]->GetBasis(dir1)->GetBasisKey();
1065
1066 if ((QuadGeom =
1067 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1068 FaceGeom)))
1069 {
1070 exp =
1072 face_dir0, face_dir1, QuadGeom);
1073 }
1074 else if ((TriGeom = std::dynamic_pointer_cast<
1075 SpatialDomains::TriGeom>(FaceGeom)))
1076 {
1077 LibUtilities::BasisKey nface_dir0(face0_dir0.GetBasisType(),
1078 face_dir0.GetNumModes(),
1079 face_dir0.GetPointsKey());
1080 LibUtilities::BasisKey nface_dir1(face0_dir1.GetBasisType(),
1081 face_dir1.GetNumModes(),
1082 face_dir1.GetPointsKey());
1083 exp =
1085 nface_dir0, nface_dir1, TriGeom);
1086 }
1087 exp->SetElmtId(elmtid++);
1088 (*m_exp).push_back(exp);
1089 }
1090 }
1091 }
1092
1093 // Set up m_coeffs, m_phys and offset arrays.
1094 SetupCoeffPhys(DeclareCoeffPhysArrays);
1095
1096 // Set up collections
1097 if (m_expType != e0D)
1098 {
1099 CreateCollections(ImpType);
1100 }
1101}
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.

Definition at line 1125 of file ExpList.cpp.

1132 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
1135 m_WaveSpace(false)
1136{
1137 int j, elmtid = 0;
1142
1144
1146
1147 int meshdim = graph->GetMeshDimension();
1148
1149 // Retrieve the list of expansions (element exp)
1150 const SpatialDomains::ExpansionInfoMap &expansions =
1151 graph->GetExpansionInfo(variable);
1152
1153 // Retrieve the list of expansions
1154 // Process each composite region.
1155 for (auto &compIt : domain)
1156 {
1157 // Process each expansion in the region.
1158 for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
1159 {
1160 if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
1161 compIt.second->m_geomVec[j])))
1162 {
1163 m_expType = e0D;
1164
1166 PtGeom);
1167 }
1168 else if ((SegGeom =
1169 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1170 compIt.second->m_geomVec[j])))
1171 {
1172 m_expType = e1D;
1173
1174 // Retrieve the basis key from the expansion.
1175 LibUtilities::BasisKey bkey = LibUtilities::NullBasisKey;
1176
1177 if (meshdim == 1)
1178 {
1179 // map<int, ExpansionInfoShPtr>
1180 auto expIt = expansions.find(SegGeom->GetGlobalID());
1181 ASSERTL0(expIt != expansions.end(),
1182 "Failed to find basis key");
1183 bkey = expIt->second->m_basisKeyVector[0];
1184 }
1185 else // get bkey from Tri or Quad
1186 {
1187 // First, create the element stdExp that the edge belongs to
1189 graph->GetElementsFromEdge(SegGeom);
1190 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1191 // Currently we assume the elements adjacent to the edge
1192 // have the same type. So we directly fetch the first
1193 // element.
1194 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1195 int edge_id = elmts->at(0).second;
1197 graph->GetExpansionInfo(geom, variable);
1198 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1199 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1201
1202 if (geom->GetShapeType() == LibUtilities::eTriangle)
1203 {
1204 elmtStdExp = MemoryManager<
1205 StdRegions::StdTriExp>::AllocateSharedPtr(Ba, Bb);
1206 }
1207 else if (geom->GetShapeType() ==
1209 {
1210 elmtStdExp = MemoryManager<
1211 StdRegions::StdQuadExp>::AllocateSharedPtr(Ba, Bb);
1212 }
1213 else
1214 {
1216 "Fail to cast geom to a known 2D shape.");
1217 }
1218 // Then, get the trace basis key from the element stdExp,
1219 // which may be different from Ba and Bb.
1220 bkey = elmtStdExp->GetTraceBasisKey(edge_id);
1221 }
1222
1223 if (SetToOneSpaceDimension)
1224 {
1225 SpatialDomains::SegGeomSharedPtr OneDSegmentGeom =
1226 SegGeom->GenerateOneSpaceDimGeom();
1227
1228 exp =
1230 bkey, OneDSegmentGeom);
1231 }
1232 else
1233 {
1234 exp =
1236 bkey, SegGeom);
1237 }
1238 }
1239 else if ((TriGeom =
1240 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1241 compIt.second->m_geomVec[j])))
1242 {
1243 m_expType = e2D;
1244
1245 // First, create the element stdExp that the face belongs to
1247 graph->GetElementsFromFace(TriGeom);
1248 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1249 // Currently we assume the elements adjacent to the face have
1250 // the same type. So we directly fetch the first element.
1251 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1252 int face_id = elmts->at(0).second;
1254 graph->GetExpansionInfo(geom, variable);
1255 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1256 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1257 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1259
1260 if (geom->GetShapeType() == LibUtilities::ePrism)
1261 {
1262 elmtStdExp = MemoryManager<
1263 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1264 }
1265 else if (geom->GetShapeType() == LibUtilities::eTetrahedron)
1266 {
1267 elmtStdExp =
1269 Ba, Bb, Bc);
1270 }
1271 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1272 {
1273 elmtStdExp =
1275 Ba, Bb, Bc);
1276 }
1277 else // hex cannot have tri surface
1278 {
1280 "Fail to cast geom to a known 3D shape.");
1281 }
1282 // Then, get the trace basis key from the element stdExp,
1283 // which may be different from Ba, Bb and Bc.
1284 LibUtilities::BasisKey TriBa =
1285 elmtStdExp->GetTraceBasisKey(face_id, 0);
1286 LibUtilities::BasisKey TriBb =
1287 elmtStdExp->GetTraceBasisKey(face_id, 1);
1288 // swap TriBa and TriBb orientation is transposed
1289 if (geom->GetForient(face_id) >= 9)
1290 {
1291 std::swap(TriBa, TriBb);
1292 }
1293
1294 if (graph->GetExpansionInfo()
1295 .begin()
1296 ->second->m_basisKeyVector[0]
1297 .GetBasisType() == LibUtilities::eGLL_Lagrange)
1298 {
1299 NEKERROR(ErrorUtil::efatal, "This method needs sorting");
1301
1302 exp = MemoryManager<
1303 LocalRegions::NodalTriExp>::AllocateSharedPtr(TriBa,
1304 TriBb,
1305 TriNb,
1306 TriGeom);
1307 }
1308 else
1309 {
1310 exp =
1312 TriBa, TriBb, TriGeom);
1313 }
1314 }
1315 else if ((QuadGeom =
1316 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1317 compIt.second->m_geomVec[j])))
1318 {
1319 m_expType = e2D;
1320
1321 // First, create the element stdExp that the face belongs to
1323 graph->GetElementsFromFace(QuadGeom);
1324 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1325 // Currently we assume the elements adjacent to the face have
1326 // the same type. So we directly fetch the first element.
1327 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1328 int face_id = elmts->at(0).second;
1330 graph->GetExpansionInfo(geom, variable);
1331 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1332 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1333 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1335
1336 if (geom->GetShapeType() == LibUtilities::ePrism)
1337 {
1338 elmtStdExp = MemoryManager<
1339 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1340 }
1341 else if (geom->GetShapeType() == LibUtilities::eHexahedron)
1342 {
1343 elmtStdExp =
1345 Ba, Bb, Bc);
1346 }
1347 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1348 {
1349 elmtStdExp =
1351 Ba, Bb, Bc);
1352 }
1353 else // Tet cannot have quad surface
1354 {
1356 "Fail to cast geom to a known 3D shape.");
1357 }
1358 // Then, get the trace basis key from the element stdExp,
1359 // which may be different from Ba, Bb and Bc.
1360 LibUtilities::BasisKey QuadBa =
1361 elmtStdExp->GetTraceBasisKey(face_id, 0);
1362 LibUtilities::BasisKey QuadBb =
1363 elmtStdExp->GetTraceBasisKey(face_id, 1);
1364 // swap Ba and Bb if the orientation is transposed
1365 if (geom->GetForient(face_id) >= 9)
1366 {
1367 std::swap(QuadBa, QuadBb);
1368 }
1369
1371 QuadBa, QuadBb, QuadGeom);
1372 }
1373 else
1374 {
1376 "dynamic cast to a Geom (possibly 3D) failed");
1377 }
1378
1379 exp->SetElmtId(elmtid++);
1380 (*m_exp).push_back(exp);
1381 }
1382 }
1383
1384 // Set up m_coeffs, m_phys and offset arrays.
1385 SetupCoeffPhys(DeclareCoeffPhysArrays);
1386
1387 if (m_expType != e0D)
1388 {
1389 CreateCollections(ImpType);
1390 }
1391}
#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
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
@ 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, NEKERROR, Nektar::LibUtilities::NullBasisKey(), and SetupCoeffPhys().

◆ ~ExpList()

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

The default destructor.

Definition at line 1615 of file ExpList.cpp.

1616{
1617}

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

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

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

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

Definition at line 6215 of file ExpList.cpp.

6218{
6219 int nelmt;
6220 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6221
6222 nelmtcoef = GetNcoeffs(0);
6223 nelmtpnts = GetTotPoints(0);
6224
6225 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6226 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6227
6228 Array<OneD, NekDouble> MatQ_data;
6229 Array<OneD, NekDouble> MatC_data;
6230
6231 DNekMatSharedPtr tmpMatQ, tmpMatC;
6232
6233 nelmtcoef0 = nelmtcoef;
6234 nelmtpnts0 = nelmtpnts;
6235
6236 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6237 {
6238 nelmtcoef = GetNcoeffs(nelmt);
6239 nelmtpnts = GetTotPoints(nelmt);
6240
6241 tmpMatQ = ElmtJacQuad[nelmt];
6242 tmpMatC = ElmtJacCoef[nelmt];
6243
6244 MatQ_data = tmpMatQ->GetPtr();
6245 MatC_data = tmpMatC->GetPtr();
6246
6247 if (nelmtcoef != nelmtcoef0)
6248 {
6249 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6250 nelmtcoef0 = nelmtcoef;
6251 }
6252
6253 if (nelmtpnts != nelmtpnts0)
6254 {
6255 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6256 nelmtpnts0 = nelmtpnts;
6257 }
6258
6259 for (int np = 0; np < nelmtcoef; np++)
6260 {
6261 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6262 1);
6263 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6264 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
6265
6266 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6267 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6268 }
6269 }
6270}
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 6158 of file ExpList.cpp.

6161{
6162 int nelmt;
6163 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6164
6165 nelmtcoef = GetNcoeffs(0);
6166 nelmtpnts = GetTotPoints(0);
6167
6168 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6169 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6170
6171 Array<OneD, NekDouble> MatQ_data;
6172 Array<OneD, NekDouble> MatC_data;
6173
6174 DNekMatSharedPtr tmpMatQ, tmpMatC;
6175
6176 nelmtcoef0 = nelmtcoef;
6177 nelmtpnts0 = nelmtpnts;
6178
6179 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6180 {
6181 nelmtcoef = GetNcoeffs(nelmt);
6182 nelmtpnts = GetTotPoints(nelmt);
6183
6184 tmpMatQ = ElmtJacQuad[nelmt];
6185 tmpMatC = ElmtJacCoef[nelmt];
6186
6187 MatQ_data = tmpMatQ->GetPtr();
6188 MatC_data = tmpMatC->GetPtr();
6189
6190 if (nelmtcoef != nelmtcoef0)
6191 {
6192 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6193 nelmtcoef0 = nelmtcoef;
6194 }
6195
6196 if (nelmtpnts != nelmtpnts0)
6197 {
6198 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6199 nelmtpnts0 = nelmtpnts;
6200 }
6201
6202 for (int np = 0; np < nelmtcoef; np++)
6203 {
6204 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6205 1);
6206 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6207 (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
6208
6209 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6210 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6211 }
6212 }
6213}

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 2178 of file ExpList.h.

2180{
2181 v_AddTraceIntegral(Fn, outarray);
2182}
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4740

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 1008 of file ExpList.h.

1012 {
1013 v_AddTraceIntegralToOffDiag(FwdFlux, BwdFlux, outarray);
1014 }
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5700

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

5926{
5928 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
5929 tracelist->GetExp();
5930 int ntotTrace = (*traceExp).size();
5931 int nTracePnt, nTraceCoef;
5932
5933 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp = GetExp();
5934 int nElmtCoef;
5935
5936 const MultiRegions::LocTraceToTraceMapSharedPtr locTraceToTraceMap =
5938 const Array<OneD, const Array<OneD, int>> LRAdjExpid =
5939 locTraceToTraceMap->GetLeftRightAdjacentExpId();
5940 const Array<OneD, const Array<OneD, bool>> LRAdjflag =
5941 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
5942
5943 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRMap =
5944 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
5945 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRSign =
5946 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
5947 DNekMatSharedPtr ElmtMat;
5948 Array<OneD, NekDouble> ElmtMat_data;
5949 // int nclAdjExp;
5950 int nrwAdjExp;
5951 int MatIndex, nPnts;
5952 NekDouble sign = 1.0;
5953
5954 int nTracePntsTtl = tracelist->GetTotPoints();
5955 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
5956 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
5957 int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
5958
5959 Array<OneD, int> nlocTracePtsLR(2);
5960 nlocTracePtsLR[0] = nlocTracePtsFwd;
5961 nlocTracePtsLR[1] = nlocTracePtsBwd;
5962
5963 size_t nFwdBwdNonZero = 0;
5964 Array<OneD, int> tmpIndex{2, -1};
5965 for (int i = 0; i < 2; ++i)
5966 {
5967 if (nlocTracePtsLR[i] > 0)
5968 {
5969 tmpIndex[nFwdBwdNonZero] = i;
5970 nFwdBwdNonZero++;
5971 }
5972 }
5973
5974 Array<OneD, int> nlocTracePtsNonZeroIndex{nFwdBwdNonZero};
5975 for (int i = 0; i < nFwdBwdNonZero; ++i)
5976 {
5977 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
5978 }
5979
5980 Array<OneD, NekDouble> TraceFwdPhy(nTracePntsTtl);
5981 Array<OneD, NekDouble> TraceBwdPhy(nTracePntsTtl);
5982 Array<OneD, Array<OneD, NekDouble>> tmplocTrace(2);
5983 for (int k = 0; k < 2; ++k)
5984 {
5985 tmplocTrace[k] = NullNekDouble1DArray;
5986 }
5987
5988 for (int k = 0; k < nFwdBwdNonZero; ++k)
5989 {
5990 size_t i = nlocTracePtsNonZeroIndex[k];
5991 tmplocTrace[i] = Array<OneD, NekDouble>(nlocTracePtsLR[i]);
5992 }
5993
5994 int nNumbElmt = fieldMat.size();
5995 Array<OneD, Array<OneD, NekDouble>> ElmtMatDataArray(nNumbElmt);
5996 Array<OneD, int> ElmtCoefArray(nNumbElmt);
5997 for (int i = 0; i < nNumbElmt; i++)
5998 {
5999 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
6000 ElmtCoefArray[i] = GetNcoeffs(i);
6001 }
6002
6003 int nTraceCoefMax = 0;
6004 int nTraceCoefMin = std::numeric_limits<int>::max();
6005 Array<OneD, int> TraceCoefArray(ntotTrace);
6006 Array<OneD, int> TracePntArray(ntotTrace);
6007 Array<OneD, int> TraceOffArray(ntotTrace);
6008 Array<OneD, Array<OneD, NekDouble>> FwdMatData(ntotTrace);
6009 Array<OneD, Array<OneD, NekDouble>> BwdMatData(ntotTrace);
6010 for (int nt = 0; nt < ntotTrace; nt++)
6011 {
6012 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
6013 nTracePnt = tracelist->GetTotPoints(nt);
6014 int noffset = tracelist->GetPhys_Offset(nt);
6015 TraceCoefArray[nt] = nTraceCoef;
6016 TracePntArray[nt] = nTracePnt;
6017 TraceOffArray[nt] = noffset;
6018 FwdMatData[nt] = FwdMat[nt]->GetPtr();
6019 BwdMatData[nt] = BwdMat[nt]->GetPtr();
6020 if (nTraceCoef > nTraceCoefMax)
6021 {
6022 nTraceCoefMax = nTraceCoef;
6023 }
6024 if (nTraceCoef < nTraceCoefMin)
6025 {
6026 nTraceCoefMin = nTraceCoef;
6027 }
6028 }
6029 WARNINGL1(nTraceCoefMax == nTraceCoefMin,
6030 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
6031
6032 int traceID, nfieldPnts, ElmtId, noffset;
6033 const Array<OneD, const Array<OneD, int>> LocTracephysToTraceIDMap =
6034 locTraceToTraceMap->GetLocTracephysToTraceIDMap();
6035 const Array<OneD, const int> fieldToLocTraceMap =
6036 locTraceToTraceMap->GetLocTraceToFieldMap();
6037 Array<OneD, Array<OneD, int>> fieldToLocTraceMapLR(2);
6038 noffset = 0;
6039 for (int k = 0; k < nFwdBwdNonZero; ++k)
6040 {
6041 size_t i = nlocTracePtsNonZeroIndex[k];
6042 fieldToLocTraceMapLR[i] = Array<OneD, int>(nlocTracePtsLR[i]);
6043 Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
6044 &fieldToLocTraceMapLR[i][0], 1);
6045 noffset += nlocTracePtsLR[i];
6046 }
6047
6048 Array<OneD, Array<OneD, int>> MatIndexArray(2);
6049 for (int k = 0; k < nFwdBwdNonZero; ++k)
6050 {
6051 size_t nlr = nlocTracePtsNonZeroIndex[k];
6052 MatIndexArray[nlr] = Array<OneD, int>(nlocTracePtsLR[nlr]);
6053 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6054 {
6055 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6056 nTraceCoef = TraceCoefArray[traceID];
6057 ElmtId = LRAdjExpid[nlr][traceID];
6058 noffset = GetPhys_Offset(ElmtId);
6059 nElmtCoef = ElmtCoefArray[ElmtId];
6060 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
6061 nPnts = nfieldPnts - noffset;
6062
6063 MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
6064 }
6065 }
6066
6067 for (int nc = 0; nc < nTraceCoefMin; nc++)
6068 {
6069 for (int nt = 0; nt < ntotTrace; nt++)
6070 {
6071 nTraceCoef = TraceCoefArray[nt];
6072 nTracePnt = TracePntArray[nt];
6073 noffset = TraceOffArray[nt];
6074 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6075 &TraceFwdPhy[noffset], 1);
6076 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6077 &TraceBwdPhy[noffset], 1);
6078 }
6079
6080 for (int k = 0; k < nFwdBwdNonZero; ++k)
6081 {
6082 size_t i = nlocTracePtsNonZeroIndex[k];
6083 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6084 }
6085
6086 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6087 tmplocTrace[1]);
6088
6089 for (int k = 0; k < nFwdBwdNonZero; ++k)
6090 {
6091 size_t nlr = nlocTracePtsNonZeroIndex[k];
6092 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6093 {
6094 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6095 nTraceCoef = TraceCoefArray[traceID];
6096 ElmtId = LRAdjExpid[nlr][traceID];
6097 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6098 sign = elmtLRSign[nlr][traceID][nc];
6099 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6100
6101 ElmtMatDataArray[ElmtId][MatIndex] -=
6102 sign * tmplocTrace[nlr][nloc];
6103 }
6104 }
6105 }
6106
6107 for (int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
6108 {
6109 for (int nt = 0; nt < ntotTrace; nt++)
6110 {
6111 nTraceCoef = TraceCoefArray[nt];
6112 nTracePnt = TracePntArray[nt];
6113 noffset = TraceOffArray[nt];
6114 if (nc < nTraceCoef)
6115 {
6116 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6117 &TraceFwdPhy[noffset], 1);
6118 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6119 &TraceBwdPhy[noffset], 1);
6120 }
6121 else
6122 {
6123 Vmath::Zero(nTracePnt, &TraceFwdPhy[noffset], 1);
6124 Vmath::Zero(nTracePnt, &TraceBwdPhy[noffset], 1);
6125 }
6126 }
6127
6128 for (int k = 0; k < nFwdBwdNonZero; ++k)
6129 {
6130 size_t i = nlocTracePtsNonZeroIndex[k];
6131 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6132 }
6133 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6134 tmplocTrace[1]);
6135
6136 for (int k = 0; k < nFwdBwdNonZero; ++k)
6137 {
6138 size_t nlr = nlocTracePtsNonZeroIndex[k];
6139 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6140 {
6141 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6142 nTraceCoef = TraceCoefArray[traceID];
6143 if (nc < nTraceCoef)
6144 {
6145 ElmtId = LRAdjExpid[nlr][traceID];
6146 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6147 sign = -elmtLRSign[nlr][traceID][nc];
6148 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6149
6150 ElmtMatDataArray[ElmtId][MatIndex] +=
6151 sign * tmplocTrace[nlr][nloc];
6152 }
6153 }
6154 }
6155 }
6156}
#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:2162
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition: ExpList.h:2132
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:2214
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2079
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:2094
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 2208 of file ExpList.h.

2211{
2212 v_AddTraceQuadPhysToField(Fwd, Bwd, field);
2213}
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4783

References 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 813 of file ExpList.h.

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

References 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 908 of file ExpList.h.

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

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 915 of file ExpList.h.

918 {
919 v_AppendFieldData(fielddef, fielddata, coeffs);
920 }

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

3032{
3033}

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

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

5626{
5628}
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3671

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

5462{
5463 // Set up initialisation flags
5465 std::vector<bool>(Collections::SIZE_OperatorType, true);
5466
5467 // Figure out optimisation parameters if provided in
5468 // session file or default given
5469 Collections::CollectionOptimisation colOpt(
5470 m_session, (*m_exp)[0]->GetShapeDimension(), ImpType);
5471
5472 // turn on autotuning if explicitly specified in xml file
5473 // or command line option is set but only do optimisation
5474 // for volumetric elements (not boundary condition)
5475 bool autotuning = colOpt.IsUsingAutotuning();
5476 if ((autotuning == false) && (ImpType == Collections::eNoImpType))
5477 {
5478 // turn on autotuning if write-opt-file specified
5479 // if m_graph available
5480 if (m_session->GetUpdateOptFile() && m_graph)
5481 {
5482 // only turn on autotuning for volumetric elements
5483 // where Mesh Dimension is equal to the Shape
5484 // Dimension of element.
5485 if (m_graph->GetMeshDimension() == (*m_exp)[0]->GetShapeDimension())
5486 {
5487 autotuning = true;
5488 }
5489 }
5490 }
5491 bool verbose = (m_session->DefinesCmdLineArgument("verbose")) &&
5492 (m_session->GetComm()->GetRank() == 0);
5493
5494 // clear vectors in case previously called
5495 m_collections.clear();
5496 m_coll_coeff_offset.clear();
5497 m_coll_phys_offset.clear();
5498
5499 /*-------------------------------------------------------------------------
5500 Dividing m_exp into sub groups (collections): original exp order is kept.
5501 Use 3 basiskey + deformed flag to determine if two exp belong to the same
5502 collection or not.
5503 -------------------------------------------------------------------------*/
5504 // the maximum size is either explicitly specified, or set to very large
5505 // value which will not affect the actual collection size
5506 int collmax =
5507 (colOpt.GetMaxCollectionSize() > 0 ? colOpt.GetMaxCollectionSize()
5508 : 2 * m_exp->size());
5509
5510 vector<StdRegions::StdExpansionSharedPtr> collExp;
5511 LocalRegions::ExpansionSharedPtr exp = (*m_exp)[0];
5512 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(exp);
5513 // storing the offset for the modes and quadrature points for the 1st
5514 // element in the collection
5515 m_coll_coeff_offset.push_back(m_coeff_offset[0]);
5516 m_coll_phys_offset.push_back(m_phys_offset[0]);
5517
5518 // add the first element to the collection - initialization
5519 collExp.push_back(exp);
5520 // collcnt is the number of elements in current collection
5521 int collcnt = 1;
5522 // initialize the basisKeys to NullBasisKey
5523 std::vector<LibUtilities::BasisKey> thisbasisKeys(
5525 std::vector<LibUtilities::BasisKey> prevbasisKeys(
5527 // fetch basiskeys of the first element
5528 for (int d = 0; d < exp->GetNumBases(); d++)
5529 {
5530 prevbasisKeys[d] = exp->GetBasis(d)->GetBasisKey();
5531 }
5532
5533 // initialize the deformed flag based on the first element
5534 bool prevDef =
5535 exp->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed;
5536 // collsize is the maximum size among all collections
5537 int collsize = 0;
5538
5539 for (int i = 1; i < (*m_exp).size(); i++)
5540 {
5541 exp = (*m_exp)[i];
5542
5543 // fetch basiskeys of current element
5544 for (int d = 0; d < exp->GetNumBases(); d++)
5545 {
5546 thisbasisKeys[d] = exp->GetBasis(d)->GetBasisKey();
5547 }
5548 // fetch deformed flag of current element
5549 bool Deformed =
5550 (exp->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed);
5551
5552 // Check if this element is the same type as the previous one or
5553 // if we have reached the maximum collection size
5554 if (thisbasisKeys != prevbasisKeys || prevDef != Deformed ||
5555 collcnt >= collmax)
5556 {
5557 // if no Imp Type provided and No
5558 // setting in xml file. reset
5559 // impTypes using timings
5560 if (autotuning)
5561 {
5562 // if current collection is larger than previous one
5563 // update impTypes; otherwise, use previous impTypes
5564 if (collExp.size() > collsize)
5565 {
5566 impTypes =
5567 colOpt.SetWithTimings(collExp, impTypes, verbose);
5568 collsize = collExp.size();
5569 }
5570 }
5572 colOpt.GetOperatorImpMap(exp);
5573
5574 Collections::Collection tmp(collExp, impTypes);
5575 m_collections.push_back(tmp);
5576 // store the offsets of the current element
5577 m_coll_coeff_offset.push_back(m_coeff_offset[i]);
5578 m_coll_phys_offset.push_back(m_phys_offset[i]);
5579
5580 // for the new collection calling the optimization routine based on
5581 // its first element
5582 impTypes = colOpt.GetOperatorImpMap((*m_exp)[i]);
5583
5584 // clean-up current element list - temporary collection
5585 collExp.clear();
5586 collcnt = 0;
5587 collsize = 0;
5588 }
5589
5590 // insert exp and increment count
5591 collExp.push_back(exp);
5592 collcnt++;
5593 // update previous info
5594 prevbasisKeys = thisbasisKeys;
5595 prevDef = Deformed;
5596 }
5597
5598 // execute autotuning for the last collection
5599 if (autotuning)
5600 {
5601 if (collExp.size() > collsize)
5602 {
5603 impTypes = colOpt.SetWithTimings(collExp, impTypes, verbose);
5604 collsize = collExp.size();
5605 }
5606 }
5607 Collections::Collection tmp(collExp, impTypes);
5608 m_collections.push_back(tmp);
5609
5610 // clean-up current element list - temporary collection
5611 collExp.clear();
5612 collcnt = 0;
5613 collsize = 0;
5614
5615 // update optimisation file
5616 if ((m_session->GetUpdateOptFile()) && (ImpType == Collections::eNoImpType))
5617 {
5618 colOpt.UpdateOptFile(m_session->GetSessionName(), m_comm);
5619 // turn off write-opt-file option so only first
5620 // instance is timed
5621 m_session->SetUpdateOptFile(false);
5622 }
5623}
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition: ExpList.h:1920
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:126
@ 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_coeff_offset, m_coll_coeff_offset, m_coll_phys_offset, m_collections, m_collectionsDoInit, m_comm, m_exp, m_graph, m_phys_offset, m_session, Nektar::LibUtilities::NullBasisKey(), Nektar::Collections::CollectionOptimisation::SetWithTimings(), Nektar::Collections::SIZE_OperatorType, and Nektar::Collections::CollectionOptimisation::UpdateOptFile().

Referenced by ExpList().

◆ Curl()

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

Definition at line 1832 of file ExpList.h.

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

References v_Curl().

◆ CurlCurl()

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

Definition at line 1840 of file ExpList.h.

1842{
1843 v_CurlCurl(Vel, Q);
1844}
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
Definition: ExpList.cpp:2011

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 1876 of file ExpList.h.

1880{
1881 v_DealiasedDotProd(num_dofs, inarray1, inarray2, outarray);
1882}
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:4925

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 1866 of file ExpList.h.

1870{
1871 v_DealiasedProd(num_dofs, inarray1, inarray2, outarray);
1872}
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:4915

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

1667{
1668 Array<OneD, NekDouble> e_outarray;
1669
1670 for (int i = 0; i < (*m_exp).size(); ++i)
1671 {
1672 (*m_exp)[i]->DivideByQuadratureMetric(inarray + m_phys_offset[i],
1673 e_outarray =
1674 outarray + m_phys_offset[i]);
1675 }
1676}

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 2255 of file ExpList.h.

2259{
2260 v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2261}
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:5399

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

2112{
2113 Array<OneD, NekDouble> e_array;
2114
2115 for (int i = 0; i < (*m_exp).size(); ++i)
2116 {
2117 (*m_exp)[i]->ExponentialFilter(e_array = array + m_phys_offset[i],
2118 alpha, exponent, cutoff);
2119 }
2120}

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

3702{
3703 string varString = fileName.substr(0, fileName.find_last_of("."));
3704 int j, k, len = varString.length();
3705 varString = varString.substr(len - 1, len);
3706
3707 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3708 std::vector<std::vector<NekDouble>> FieldData;
3709
3710 std::string ft = LibUtilities::FieldIO::GetFileType(fileName, comm);
3713 ft, comm, m_session->GetSharedFilesystem());
3714
3715 f->Import(fileName, FieldDef, FieldData);
3716
3717 bool found = false;
3718 for (j = 0; j < FieldDef.size(); ++j)
3719 {
3720 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3721 {
3722 if (FieldDef[j]->m_fields[k] == varName)
3723 {
3724 // Copy FieldData into locExpList
3725 ExtractDataToCoeffs(FieldDef[j], FieldData[j],
3726 FieldDef[j]->m_fields[k], coeffs);
3727 found = true;
3728 }
3729 }
3730 }
3731
3732 ASSERTL0(found, "Could not find variable '" + varName +
3733 "' in file boundary condition " + fileName);
3734}
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.
Definition: NekFactory.hpp:143
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:3930
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 3938 of file ExpList.cpp.

3942{
3943 v_ExtractCoeffsToCoeffs(fromExpList, fromCoeffs, toCoeffs);
3944}
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:4042

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

3934{
3935 v_ExtractDataToCoeffs(fielddef, fielddata, field, coeffs, zIdToPlane);
3936}
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:3954

References 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 2278 of file ExpList.h.

2281{
2282 v_ExtractElmtToBndPhys(i, elmt, boundary);
2283}
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:5196

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 2292 of file ExpList.h.

2295{
2296 v_ExtractPhysToBnd(i, phys, bnd);
2297}
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.cpp:5273

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 2285 of file ExpList.h.

2288{
2289 v_ExtractPhysToBndElmt(i, phys, bndElmt);
2290}
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:5234

References v_ExtractPhysToBndElmt().

◆ ExtractTracePhys() [1/2]

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

Definition at line 2235 of file ExpList.h.

2236{
2237 v_ExtractTracePhys(outarray);
2238}
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4834

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 2239 of file ExpList.h.

2242{
2243 v_ExtractTracePhys(inarray, outarray);
2244}

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 1960 of file ExpList.h.

1961{
1962 v_FillBndCondFromField(coeffs);
1963}
virtual void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
Definition: ExpList.cpp:5006

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 1964 of file ExpList.h.

1966{
1967 v_FillBndCondFromField(nreg, coeffs);
1968}

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 2202 of file ExpList.h.

2205{
2206 v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2207}
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
Definition: ExpList.cpp:4774

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 2221 of file ExpList.h.

2223{
2224 v_FillBwdWithBwdWeight(weightave, weightjmp);
2225}
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Definition: ExpList.cpp:5361

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

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

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

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

2241{
2242 int i, cnt1;
2243 int n_exp = 0;
2244 DNekScalMatSharedPtr loc_mat;
2245 DNekScalBlkMatSharedPtr BlkMatrix;
2246 map<int, int> elmt_id;
2247 LibUtilities::ShapeType ShapeType = gkey.GetShapeType();
2248
2250 {
2251 for (i = 0; i < (*m_exp).size(); ++i)
2252 {
2253 if ((*m_exp)[i]->DetShapeType() == ShapeType)
2254 {
2255 elmt_id[n_exp++] = i;
2256 }
2257 }
2258 }
2259 else
2260 {
2261 n_exp = (*m_exp).size();
2262 for (i = 0; i < n_exp; ++i)
2263 {
2264 elmt_id[i] = i;
2265 }
2266 }
2267
2268 Array<OneD, unsigned int> nrows(n_exp);
2269 Array<OneD, unsigned int> ncols(n_exp);
2270
2271 switch (gkey.GetMatrixType())
2272 {
2274 {
2275 // set up an array of integers for block matrix construction
2276 for (i = 0; i < n_exp; ++i)
2277 {
2278 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2279 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2280 }
2281 }
2282 break;
2284 {
2285 // set up an array of integers for block matrix construction
2286 for (i = 0; i < n_exp; ++i)
2287 {
2288 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2289 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2290 }
2291 }
2292 break;
2293 case StdRegions::eMass:
2298 {
2299 // set up an array of integers for block matrix construction
2300 for (i = 0; i < n_exp; ++i)
2301 {
2302 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2303 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2304 }
2305 }
2306 break;
2307
2309 {
2310 // set up an array of integers for block matrix construction
2311 for (i = 0; i < n_exp; ++i)
2312 {
2313 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2314 ncols[i] =
2315 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2316 }
2317 }
2318 break;
2320 {
2321 // set up an array of integers for block matrix construction
2322 for (i = 0; i < n_exp; ++i)
2323 {
2324 nrows[i] =
2325 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2326 ncols[i] =
2327 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2328 }
2329 }
2330 break;
2331 default:
2332 {
2334 "Global Matrix creation not defined for this "
2335 "type of matrix");
2336 }
2337 }
2338
2339 MatrixStorage blkmatStorage = eDIAGONAL;
2340 BlkMatrix = MemoryManager<DNekScalBlkMat>::AllocateSharedPtr(nrows, ncols,
2341 blkmatStorage);
2342
2343 int nvarcoeffs = gkey.GetNVarCoeffs();
2344 int eid;
2345 Array<OneD, NekDouble> varcoeffs_wk;
2346
2347 for (i = cnt1 = 0; i < n_exp; ++i)
2348 {
2349 // need to be initialised with zero size for non
2350 // variable coefficient case
2351 StdRegions::VarCoeffMap varcoeffs;
2352
2353 eid = elmt_id[i];
2354 if (nvarcoeffs > 0)
2355 {
2356 varcoeffs = StdRegions::RestrictCoeffMap(
2357 gkey.GetVarCoeffs(), m_phys_offset[i],
2358 (*m_exp)[i]->GetTotPoints());
2359 }
2360
2361 LocalRegions::MatrixKey matkey(
2362 gkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(), *(*m_exp)[eid],
2363 gkey.GetConstFactors(), varcoeffs);
2364
2365 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>(
2366 (*m_exp)[elmt_id.find(i)->second])
2367 ->GetLocMatrix(matkey);
2368 BlkMatrix->SetBlock(i, i, loc_mat);
2369 }
2370
2371 return BlkMatrix;
2372}
VarCoeffMap RestrictCoeffMap(const VarCoeffMap &m, size_t offset, size_t cnt)
Definition: StdRegions.hpp:349
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:346
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 3771 of file ExpList.cpp.

3777{
3778 int startenum = (int)LibUtilities::eSegment;
3779 int endenum = (int)LibUtilities::eHexahedron;
3780 int s = 0;
3782
3783 ASSERTL1(NumHomoDir == HomoBasis.size(),
3784 "Homogeneous basis is not the same length as NumHomoDir");
3785 ASSERTL1(NumHomoDir == HomoLen.size(),
3786 "Homogeneous length vector is not the same length as NumHomDir");
3787
3788 // count number of shapes
3789 switch ((*m_exp)[0]->GetShapeDimension())
3790 {
3791 case 1:
3792 startenum = (int)LibUtilities::eSegment;
3793 endenum = (int)LibUtilities::eSegment;
3794 break;
3795 case 2:
3796 startenum = (int)LibUtilities::eTriangle;
3797 endenum = (int)LibUtilities::eQuadrilateral;
3798 break;
3799 case 3:
3800 startenum = (int)LibUtilities::eTetrahedron;
3801 endenum = (int)LibUtilities::eHexahedron;
3802 break;
3803 }
3804
3805 for (s = startenum; s <= endenum; ++s)
3806 {
3807 std::vector<unsigned int> elementIDs;
3808 std::vector<LibUtilities::BasisType> basis;
3809 std::vector<unsigned int> numModes;
3810 std::vector<std::string> fields;
3811
3812 bool first = true;
3813 bool UniOrder = true;
3814 int n;
3815
3816 shape = (LibUtilities::ShapeType)s;
3817
3818 for (int i = 0; i < (*m_exp).size(); ++i)
3819 {
3820 if ((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
3821 {
3822 elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
3823 if (first)
3824 {
3825 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3826 {
3827 basis.push_back(
3828 (*m_exp)[i]->GetBasis(j)->GetBasisType());
3829 numModes.push_back(
3830 (*m_exp)[i]->GetBasis(j)->GetNumModes());
3831 }
3832
3833 // add homogeneous direction details if defined
3834 for (n = 0; n < NumHomoDir; ++n)
3835 {
3836 basis.push_back(HomoBasis[n]->GetBasisType());
3837 numModes.push_back(HomoBasis[n]->GetNumModes());
3838 }
3839
3840 first = false;
3841 }
3842 else
3843 {
3844 ASSERTL0(
3845 (*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
3846 "Routine is not set up for multiple bases definitions");
3847
3848 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3849 {
3850 numModes.push_back(
3851 (*m_exp)[i]->GetBasis(j)->GetNumModes());
3852 if (numModes[j] !=
3853 (*m_exp)[i]->GetBasis(j)->GetNumModes())
3854 {
3855 UniOrder = false;
3856 }
3857 }
3858 // add homogeneous direction details if defined
3859 for (n = 0; n < NumHomoDir; ++n)
3860 {
3861 numModes.push_back(HomoBasis[n]->GetNumModes());
3862 }
3863 }
3864 }
3865 }
3866
3867 if (elementIDs.size() > 0)
3868 {
3871 AllocateSharedPtr(shape, elementIDs, basis, UniOrder,
3872 numModes, fields, NumHomoDir, HomoLen,
3873 homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
3874 fielddef.push_back(fdef);
3875 }
3876 }
3877}
#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 2418 of file ExpList.cpp.

2421{
2422 int nvarcoeffs = gkey.GetNVarCoeffs();
2423
2424 if ((nvarcoeffs == 0) && (gkey.GetMatrixType() == StdRegions::eHelmholtz))
2425 {
2426 // initialise if required
2427 if (m_collections.size() &&
2429 {
2430 for (int i = 0; i < m_collections.size(); ++i)
2431 {
2433 gkey.GetConstFactors());
2434 }
2436 }
2437 else
2438 {
2439 for (int i = 0; i < m_collections.size(); ++i)
2440 {
2441 m_collections[i].CheckFactors(Collections::eHelmholtz,
2442 gkey.GetConstFactors(),
2444 }
2445 }
2446
2447 Array<OneD, NekDouble> tmp;
2448 int input_offset{0};
2449 int output_offset{0};
2450 for (int i = 0; i < m_collections.size(); ++i)
2451 {
2452 // the input_offset is equal to the output_offset - this is
2453 // happenning inside the Helmholtz_Helper class
2454 m_collections[i].ApplyOperator(Collections::eHelmholtz,
2455 inarray + input_offset,
2456 tmp = outarray + output_offset);
2457 input_offset +=
2458 m_collections[i].GetInputSize(Collections::eHelmholtz);
2459 output_offset +=
2460 m_collections[i].GetOutputSize(Collections::eHelmholtz);
2461 }
2462 }
2463 else
2464 {
2465 Array<OneD, NekDouble> tmp_outarray;
2466 for (int i = 0; i < (*m_exp).size(); ++i)
2467 {
2468 // need to be initialised with zero size for non
2469 // variable coefficient case
2470 StdRegions::VarCoeffMap varcoeffs;
2471
2472 if (nvarcoeffs > 0)
2473 {
2474 varcoeffs = StdRegions::RestrictCoeffMap(
2475 gkey.GetVarCoeffs(), m_phys_offset[i],
2476 (*m_exp)[i]->GetTotPoints());
2477 }
2478
2479 StdRegions::StdMatrixKey mkey(
2480 gkey.GetMatrixType(), (*m_exp)[i]->DetShapeType(),
2481 *((*m_exp)[i]), gkey.GetConstFactors(), varcoeffs);
2482
2483 (*m_exp)[i]->GeneralMatrixOp(
2484 inarray + m_coeff_offset[i],
2485 tmp_outarray = outarray + m_coeff_offset[i], mkey);
2486 }
2487 }
2488}

References Nektar::Collections::eHelmholtz, Nektar::StdRegions::eHelmholtz, Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_coeff_offset, m_coll_phys_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 4128 of file ExpList.cpp.

4132{
4133 int npoints_e;
4134 NekDouble coeff;
4135
4136 Array<OneD, NekDouble> outarray_e;
4137
4138 for (int i = 0; i < (*m_exp).size(); ++i)
4139 {
4140 npoints_e = (*m_exp)[i]->GetTotPoints();
4141
4142 if (i <= ElementID)
4143 {
4144 coeff = scalar1;
4145 }
4146 else
4147 {
4148 coeff = scalar2;
4149 }
4150
4151 outarray_e = Array<OneD, NekDouble>(npoints_e, coeff);
4152 Vmath::Vcopy(npoints_e, &outarray_e[0], 1, &outarray[m_phys_offset[i]],
4153 1);
4154 }
4155}

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

2802{
2803 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2804 const map<int, RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
2805
2806 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2807
2808 if (vType >= eSIZE_GlobalSysSolnType)
2809 {
2810 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
2811 }
2812 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2813
2814 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
2815 locToGloMap);
2816}
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:954
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:883
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 2782 of file ExpList.cpp.

2784{
2785 GlobalLinSysSharedPtr returnlinsys;
2786 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2787
2788 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2789
2790 if (vType >= eSIZE_GlobalSysSolnType)
2791 {
2792 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
2793 }
2794 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2795
2796 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
2797 locToGloMap);
2798}
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 2497 of file ExpList.cpp.

2499{
2500 int i, j, n, gid1, gid2, cntdim1, cntdim2;
2501 NekDouble sign1, sign2;
2502 DNekScalMatSharedPtr loc_mat;
2503
2504 unsigned int glob_rows = 0;
2505 unsigned int glob_cols = 0;
2506 unsigned int loc_rows = 0;
2507 unsigned int loc_cols = 0;
2508
2509 bool assembleFirstDim = false;
2510 bool assembleSecondDim = false;
2511
2512 switch (mkey.GetMatrixType())
2513 {
2515 {
2516 glob_rows = m_npoints;
2517 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2518
2519 assembleFirstDim = false;
2520 assembleSecondDim = true;
2521 }
2522 break;
2524 {
2525 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2526 glob_cols = m_npoints;
2527
2528 assembleFirstDim = true;
2529 assembleSecondDim = false;
2530 }
2531 break;
2532 case StdRegions::eMass:
2536 {
2537 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2538 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2539
2540 assembleFirstDim = true;
2541 assembleSecondDim = true;
2542 }
2543 break;
2544 default:
2545 {
2547 "Global Matrix creation not defined for this "
2548 "type of matrix");
2549 }
2550 }
2551
2552 COOMatType spcoomat;
2553 CoordType coord;
2554
2555 int nvarcoeffs = mkey.GetNVarCoeffs();
2556 int eid;
2557
2558 // fill global matrix
2559 for (n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2560 {
2561 // need to be initialised with zero size for non
2562 // variable coefficient case
2563 StdRegions::VarCoeffMap varcoeffs;
2564
2565 eid = n;
2566 if (nvarcoeffs > 0)
2567 {
2568 varcoeffs = StdRegions::RestrictCoeffMap(
2569 mkey.GetVarCoeffs(), m_phys_offset[eid],
2570 (*m_exp)[eid]->GetTotPoints());
2571 }
2572
2573 LocalRegions::MatrixKey matkey(
2574 mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2575 *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2576
2577 loc_mat =
2578 std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2579 ->GetLocMatrix(matkey);
2580
2581 loc_rows = loc_mat->GetRows();
2582 loc_cols = loc_mat->GetColumns();
2583
2584 for (i = 0; i < loc_rows; ++i)
2585 {
2586 if (assembleFirstDim)
2587 {
2588 gid1 = locToGloMap->GetLocalToGlobalMap(cntdim1 + i);
2589 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2590 }
2591 else
2592 {
2593 gid1 = cntdim1 + i;
2594 sign1 = 1.0;
2595 }
2596
2597 for (j = 0; j < loc_cols; ++j)
2598 {
2599 if (assembleSecondDim)
2600 {
2601 gid2 = locToGloMap->GetLocalToGlobalMap(cntdim2 + j);
2602 sign2 = locToGloMap->GetLocalToGlobalSign(cntdim2 + j);
2603 }
2604 else
2605 {
2606 gid2 = cntdim2 + j;
2607 sign2 = 1.0;
2608 }
2609
2610 // sparse matrix fill
2611 coord = make_pair(gid1, gid2);
2612 if (spcoomat.count(coord) == 0)
2613 {
2614 spcoomat[coord] = sign1 * sign2 * (*loc_mat)(i, j);
2615 }
2616 else
2617 {
2618 spcoomat[coord] += sign1 * sign2 * (*loc_mat)(i, j);
2619 }
2620 }
2621 }
2622 cntdim1 += loc_rows;
2623 cntdim2 += loc_cols;
2624 }
2625
2627 glob_cols, spcoomat);
2628}
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 2630 of file ExpList.cpp.

2632{
2633 int i, j, n, gid1, gid2, loc_lda, eid;
2634 NekDouble sign1, sign2, value;
2635 DNekScalMatSharedPtr loc_mat;
2636
2637 int totDofs = locToGloMap->GetNumGlobalCoeffs();
2638 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2639
2640 unsigned int rows = totDofs - NumDirBCs;
2641 unsigned int cols = totDofs - NumDirBCs;
2642 NekDouble zero = 0.0;
2643
2644 DNekMatSharedPtr Gmat;
2645 int bwidth = locToGloMap->GetFullSystemBandWidth();
2646
2647 int nvarcoeffs = mkey.GetNVarCoeffs();
2648 MatrixStorage matStorage;
2649
2650 map<int, RobinBCInfoSharedPtr> RobinBCInfo = GetRobinBCInfo();
2651
2652 switch (mkey.GetMatrixType())
2653 {
2654 // case for all symmetric matices
2657 if ((2 * (bwidth + 1)) < rows)
2658 {
2661 rows, cols, zero, matStorage, bwidth, bwidth);
2662 }
2663 else
2664 {
2665 matStorage = ePOSITIVE_DEFINITE_SYMMETRIC;
2667 rows, cols, zero, matStorage);
2668 }
2669
2670 break;
2671 default: // Assume general matrix - currently only set up
2672 // for full invert
2673 {
2674 matStorage = eFULL;
2676 rows, cols, zero, matStorage);
2677 }
2678 }
2679
2680 // fill global symmetric matrix
2681 for (n = 0; n < (*m_exp).size(); ++n)
2682 {
2683 // need to be initialised with zero size for non
2684 // variable coefficient case
2685 StdRegions::VarCoeffMap varcoeffs;
2686
2687 eid = n;
2688 if (nvarcoeffs > 0)
2689 {
2690 varcoeffs = StdRegions::RestrictCoeffMap(
2691 mkey.GetVarCoeffs(), m_phys_offset[eid],
2692 (*m_exp)[eid]->GetTotPoints());
2693 }
2694
2695 LocalRegions::MatrixKey matkey(
2696 mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2697 *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2698
2699 loc_mat =
2700 std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2701 ->GetLocMatrix(matkey);
2702
2703 if (RobinBCInfo.count(n) != 0) // add robin mass matrix
2704 {
2706
2707 // declare local matrix from scaled matrix.
2708 int rows = loc_mat->GetRows();
2709 int cols = loc_mat->GetColumns();
2710 const NekDouble *dat = loc_mat->GetRawPtr();
2711 DNekMatSharedPtr new_mat =
2713 Blas::Dscal(rows * cols, loc_mat->Scale(), new_mat->GetRawPtr(), 1);
2714
2715 // add local matrix contribution
2716 for (rBC = RobinBCInfo.find(n)->second; rBC; rBC = rBC->next)
2717 {
2718 (*m_exp)[n]->AddRobinMassMatrix(
2719 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, new_mat);
2720 }
2721
2722 NekDouble one = 1.0;
2723 // redeclare loc_mat to point to new_mat plus the scalar.
2724 loc_mat =
2726 }
2727
2728 loc_lda = loc_mat->GetColumns();
2729
2730 for (i = 0; i < loc_lda; ++i)
2731 {
2732 gid1 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + i) -
2733 NumDirBCs;
2734 sign1 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + i);
2735 if (gid1 >= 0)
2736 {
2737 for (j = 0; j < loc_lda; ++j)
2738 {
2739 gid2 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] +
2740 j) -
2741 NumDirBCs;
2742 sign2 = locToGloMap->GetLocalToGlobalSign(
2743 m_coeff_offset[n] + j);
2744 if (gid2 >= 0)
2745 {
2746 // When global matrix is symmetric,
2747 // only add the value for the upper
2748 // triangular part in order to avoid
2749 // entries to be entered twice
2750 if ((matStorage == eFULL) || (gid2 >= gid1))
2751 {
2752 value = Gmat->GetValue(gid1, gid2) +
2753 sign1 * sign2 * (*loc_mat)(i, j);
2754 Gmat->SetValue(gid1, gid2, value);
2755 }
2756 }
2757 }
2758 }
2759 }
2760 }
2761
2762 return Gmat;
2763}
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 1886 of file ExpList.h.

1889{
1890 v_GetBCValues(BndVals, TotField, BndID);
1891}
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:4935

References v_GetBCValues().

◆ GetBlockMatrix()

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

Definition at line 2374 of file ExpList.cpp.

2376{
2377 auto matrixIter = m_blockMat->find(gkey);
2378
2379 if (matrixIter == m_blockMat->end())
2380 {
2381 return ((*m_blockMat)[gkey] = GenBlockMatrix(gkey));
2382 }
2383 else
2384 {
2385 return matrixIter->second;
2386 }
2387}
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:2239

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 2136 of file ExpList.h.

2137{
2138 return v_GetBndCondBwdWeight();
2139}
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
Definition: ExpList.cpp:4811

References v_GetBndCondBwdWeight().

◆ GetBndCondExpansions()

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

Definition at line 2121 of file ExpList.h.

2122{
2123 return v_GetBndCondExpansions();
2124}
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:4158

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 2246 of file ExpList.h.

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

References v_GetBndConditions().

◆ GetBndElmtExpansion()

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

Definition at line 2271 of file ExpList.h.

2274{
2275 v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2276}
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
Definition: ExpList.cpp:5186

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

5432{
5433 auto collectionIter = collection.find(regionId);
5434 ASSERTL1(collectionIter != collection.end(),
5435 "Unable to locate collection " +
5436 boost::lexical_cast<string>(regionId));
5437
5439 (*collectionIter).second;
5440 auto conditionMapIter = bndCondMap->find(variable);
5441 ASSERTL1(conditionMapIter != bndCondMap->end(),
5442 "Unable to locate condition map.");
5443
5444 const SpatialDomains::BoundaryConditionShPtr boundaryCondition =
5445 (*conditionMapIter).second;
5446
5447 return boundaryCondition;
5448}
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 2299 of file ExpList.h.

2301{
2302 v_GetBoundaryNormals(i, normals);
2303}
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:5310

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

4073{
4074 size_t nTracePts = weightAver.size();
4075 // average for interior traces
4076 for (int i = 0; i < nTracePts; ++i)
4077 {
4078 weightAver[i] = 0.5;
4079 weightJump[i] = 1.0;
4080 }
4081 FillBwdWithBwdWeight(weightAver, weightJump);
4082}
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition: ExpList.h:2221

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 2018 of file ExpList.h.

2019{
2020 return m_coeffs[i];
2021}
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1080

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 1952 of file ExpList.h.

1953{
1954 return m_coeffs;
1955}

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 2026 of file ExpList.h.

2027{
2028 return m_coeffs[i];
2029}

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 2127 of file ExpList.h.

2128{
2129 return m_coeffsToElmt;
2130}
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition: ExpList.h:1128

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 964 of file ExpList.h.

965 {
966 return m_comm;
967 }

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 1911 of file ExpList.h.

1912{
1913 ASSERTL2(eid <= (*m_exp).size(), "eid is larger than number of elements");
1914 return (*m_exp)[eid]->GetCoordim();
1915}
#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:5113

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

5854{
5856 int nElmtPntPrevious = 0;
5857 int nElmtCoefPrevious = 0;
5858 int nTotElmt = (*m_exp).size();
5859 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5860 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5861
5862 Array<OneD, NekDouble> tmpPhys;
5863 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
5864 Array<OneD, NekDouble> stdMat_data;
5865
5866 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5867 {
5868 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5869 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5870 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
5871
5872 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5873 (ElmtTypeNow != ElmtTypePrevious))
5874 {
5876 stdExp = (*m_exp)[nelmt]->GetStdExp();
5877 StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
5878 stdExp->DetShapeType(), *stdExp);
5879
5880 DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
5881 stdMat_data = BwdMat->GetPtr();
5882
5883 if (nElmtPntPrevious != nElmtPnt)
5884 {
5885 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5886 }
5887
5888 ElmtTypePrevious = ElmtTypeNow;
5889 nElmtPntPrevious = nElmtPnt;
5890 nElmtCoefPrevious = nElmtCoef;
5891 }
5892
5893 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5894 inarray[nelmt],
5895 tmpPhys); // weight with metric
5896
5897 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
5898
5899 for (int np = 0; np < nElmtPnt; np++)
5900 {
5901 NekDouble factor = tmpPhys[np];
5902 clmnArray = MatDataArray + np * nElmtCoef;
5903 clmnStdMatArray = stdMat_data + np * nElmtCoef;
5904 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
5905 }
5906 }
5907}
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 4593 of file ExpList.cpp.

4595{
4596 int e_npoints;
4597
4598 Array<OneD, NekDouble> locLeng;
4599 Array<OneD, Array<OneD, NekDouble>> lengintp(2);
4600 Array<OneD, Array<OneD, NekDouble>> lengAdd(2);
4601 Array<OneD, int> LRbndnumbs(2);
4602 Array<OneD, Array<OneD, NekDouble>> lengLR(2);
4603 lengLR[0] = lengthsFwd;
4604 lengLR[1] = lengthsBwd;
4605 Array<OneD, LocalRegions::ExpansionSharedPtr> LRelmts(2);
4608 int e_npoints0 = -1;
4609 if (m_expType == e1D)
4610 {
4611 for (int i = 0; i < m_exp->size(); ++i)
4612 {
4613 loc_exp = (*m_exp)[i];
4614 int offset = m_phys_offset[i];
4615
4616 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4617 if (e_npoints0 < e_npoints)
4618 {
4619 for (int nlr = 0; nlr < 2; nlr++)
4620 {
4621 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4622 }
4623 e_npoints0 = e_npoints;
4624 }
4625
4626 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4627 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4628
4629 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4630 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4631 for (int nlr = 0; nlr < 2; ++nlr)
4632 {
4633 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4634 lengAdd[nlr] = lengintp[nlr];
4635 int bndNumber = LRbndnumbs[nlr];
4636 loc_elmt = LRelmts[nlr];
4637 if (bndNumber >= 0)
4638 {
4639 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4640
4641 LibUtilities::PointsKey to_key =
4642 loc_exp->GetBasis(0)->GetPointsKey();
4643 LibUtilities::PointsKey from_key =
4644 loc_elmt->GetTraceBasisKey(bndNumber).GetPointsKey();
4645
4646 // For unknown reason, GetTraceNormal(2D) returns normals
4647 // that has been reoriented to trace order.
4648 // So here we don't need to reorient them again.
4649
4650 // Always do interpolation
4651 LibUtilities::Interp1D(from_key, locLeng, to_key,
4652 lengintp[nlr]);
4653 lengAdd[nlr] = lengintp[nlr];
4654 }
4655
4656 for (int j = 0; j < e_npoints; ++j)
4657 {
4658 lengLR[nlr][offset + j] = lengAdd[nlr][j];
4659 }
4660 }
4661 }
4662 }
4663 else if (m_expType == e2D)
4664 {
4665 for (int i = 0; i < m_exp->size(); ++i)
4666 {
4667 loc_exp = (*m_exp)[i];
4668 int offset = m_phys_offset[i];
4669
4670 LibUtilities::BasisKey traceBasis0 =
4671 loc_exp->GetBasis(0)->GetBasisKey();
4672 LibUtilities::BasisKey traceBasis1 =
4673 loc_exp->GetBasis(1)->GetBasisKey();
4674 const int TraceNq0 = traceBasis0.GetNumPoints();
4675 const int TraceNq1 = traceBasis1.GetNumPoints();
4676 e_npoints = TraceNq0 * TraceNq1;
4677 if (e_npoints0 < e_npoints)
4678 {
4679 for (int nlr = 0; nlr < 2; nlr++)
4680 {
4681 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4682 }
4683 e_npoints0 = e_npoints;
4684 }
4685
4686 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4687 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4688
4689 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4690 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4691 for (int nlr = 0; nlr < 2; ++nlr)
4692 {
4693 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4694 int bndNumber = LRbndnumbs[nlr];
4695 loc_elmt = LRelmts[nlr];
4696 if (bndNumber >= 0)
4697 {
4698 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4699 // Project normals from 3D element onto the
4700 // same orientation as the trace expansion.
4702 loc_elmt->GetTraceOrient(bndNumber);
4703
4704 int fromid0, fromid1;
4706 {
4707 fromid0 = 0;
4708 fromid1 = 1;
4709 }
4710 else
4711 {
4712 fromid0 = 1;
4713 fromid1 = 0;
4714 }
4715
4716 LibUtilities::BasisKey faceBasis0 =
4717 loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4718 LibUtilities::BasisKey faceBasis1 =
4719 loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4720 const int faceNq0 = faceBasis0.GetNumPoints();
4721 const int faceNq1 = faceBasis1.GetNumPoints();
4722 Array<OneD, NekDouble> alignedLeng(faceNq0 * faceNq1);
4723
4724 AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
4726 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4727 alignedLeng, traceBasis0.GetPointsKey(),
4728 traceBasis1.GetPointsKey(), lengintp[nlr]);
4729 }
4730
4731 for (int j = 0; j < e_npoints; ++j)
4732 {
4733 lengLR[nlr][offset + j] = lengintp[nlr][j];
4734 }
4735 }
4736 }
4737 }
4738}
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:4315

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 1036 of file ExpList.h.

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

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 1030 of file ExpList.h.

1031 {
1032 return m_elmtToExpId;
1033 }

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 2079 of file ExpList.h.

2081{
2082 return m_exp;
2083}

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

2883{
2884 return GetExp(GetExpIndex(gloCoord));
2885}
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:2892

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 2056 of file ExpList.h.

2057{
2058 return (*m_exp)[n];
2059}

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 2066 of file ExpList.h.

2067{
2068 auto it = m_elmtToExpId.find(n);
2069 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
2070 std::to_string(n) +
2071 " not found in element ID to "
2072 "expansion ID map.")
2073 return (*m_exp)[it->second];
2074}

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

2895{
2896 Array<OneD, NekDouble> Lcoords(gloCoord.size());
2897
2898 return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
2899 maxDistance);
2900}

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

2906{
2907 if (GetNumElmts() == 0)
2908 {
2909 return -1;
2910 }
2911
2912 if (m_elmtToExpId.size() == 0)
2913 {
2914 // Loop in reverse order so that in case where using a
2915 // Homogeneous expansion it sets geometry ids to first part of
2916 // m_exp list. Otherwise will set to second (complex) expansion
2917 for (int i = (*m_exp).size() - 1; i >= 0; --i)
2918 {
2919 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2920 }
2921 }
2922
2923 NekDouble nearpt = 1e6;
2924 NekDouble nearpt_min = 1e6;
2925 int min_id = -1;
2926 Array<OneD, NekDouble> savLocCoords(locCoords.size());
2927
2928 if (cachedId >= 0 && cachedId < (*m_exp).size())
2929 {
2930 nearpt = 1e12;
2931 if ((*m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords, locCoords,
2932 tol, nearpt))
2933 {
2934 return cachedId;
2935 }
2936 else if (returnNearestElmt && (nearpt < nearpt_min))
2937 {
2938 // If it does not lie within, keep track of which element
2939 // is nearest.
2940 min_id = cachedId;
2941 nearpt_min = nearpt;
2942 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2943 }
2944 }
2945
2946 NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2947 NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2948 NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2951 GetExp(0)->GetCoordim(), -1, x, y, z);
2952
2953 // Get the list of elements whose bounding box contains the desired
2954 // point.
2955 std::vector<int> elmts = m_graph->GetElementsContainingPoint(p);
2956
2957 // Check each element in turn to see if point lies within it.
2958 for (int i = 0; i < elmts.size(); ++i)
2959 {
2960 int id = m_elmtToExpId[elmts[i]];
2961 if (id == cachedId)
2962 {
2963 continue;
2964 }
2965 if ((*m_exp)[id]->GetGeom()->ContainsPoint(gloCoords, locCoords, tol,
2966 nearpt))
2967 {
2968 return id;
2969 }
2970 else if (returnNearestElmt && (nearpt < nearpt_min))
2971 {
2972 // If it does not lie within, keep track of which element
2973 // is nearest.
2974 min_id = id;
2975 nearpt_min = nearpt;
2976 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2977 }
2978 }
2979
2980 // If the calling function is with just the nearest element, return
2981 // that. Otherwise return -1 to indicate no matching elemenet found.
2982 if (returnNearestElmt && nearpt_min <= maxDistance)
2983 {
2984
2985 std::string msg = "Failed to find point within element to "
2986 "tolerance of " +
2987 boost::lexical_cast<std::string>(tol) +
2988 " using local point (" +
2989 boost::lexical_cast<std::string>(locCoords[0]) + "," +
2990 boost::lexical_cast<std::string>(locCoords[1]) + "," +
2991 boost::lexical_cast<std::string>(locCoords[1]) +
2992 ") in element: " + std::to_string(min_id);
2993 WARNINGL1(false, msg.c_str());
2994
2995 Vmath::Vcopy(locCoords.size(), savLocCoords, 1, locCoords, 1);
2996 return min_id;
2997 }
2998 else
2999 {
3000 return -1;
3001 }
3002}
size_t GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:648
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1911
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 1610 of file ExpList.cpp.

1611{
1612 return m_expType;
1613}

References m_expType.

Referenced by v_CurlCurl().

◆ GetFieldDefinitions() [1/2]

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

Definition at line 895 of file ExpList.h.

896 {
897 return v_GetFieldDefinitions();
898 }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:3883

References v_GetFieldDefinitions().

◆ GetFieldDefinitions() [2/2]

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

Definition at line 900 of file ExpList.h.

902 {
903 v_GetFieldDefinitions(fielddef);
904 }

References v_GetFieldDefinitions().

◆ GetFwdBwdTracePhys() [1/2]

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

Definition at line 2189 of file ExpList.h.

2191{
2192 v_GetFwdBwdTracePhys(Fwd, Bwd);
2193}
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4757

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 2194 of file ExpList.h.

2198{
2199 v_GetFwdBwdTracePhys(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
2200 DoExchange);
2201}

References v_GetFwdBwdTracePhys().

◆ GetGlobalLinSysManager()

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

Definition at line 5646 of file ExpList.cpp.

5647{
5648 return v_GetGlobalLinSysManager();
5649}
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Definition: ExpList.cpp:3691

References v_GetGlobalLinSysManager().

◆ GetGraph()

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

Definition at line 968 of file ExpList.h.

969 {
970 return m_graph;
971 }

References m_graph.

◆ GetHomogeneousBasis()

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

Definition at line 973 of file ExpList.h.

974 {
975 return v_GetHomogeneousBasis();
976 }
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 599 of file ExpList.h.

600 {
601 return v_GetHomoLen();
602 }
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:3641

References v_GetHomoLen().

◆ GetLeftAdjacentFaces()

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

Definition at line 2231 of file ExpList.h.

2232{
2233 return v_GetLeftAdjacentFaces();
2234}
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:4826

References v_GetLeftAdjacentFaces().

◆ GetLeftAdjacentTraces()

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

Definition at line 2305 of file ExpList.h.

2306{
2307 return v_GetLeftAdjacentTraces();
2308}
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
Definition: ExpList.cpp:4304

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 2214 of file ExpList.h.

2218{
2219 v_GetLocTraceFromTracePts(Fwd, Bwd, locTraceFwd, locTraceBwd);
2220}
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:4801

References v_GetLocTraceFromTracePts().

Referenced by AddTraceJacToElmtJac().

◆ GetLocTraceToTraceMap()

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

Definition at line 2131 of file ExpList.h.

2133{
2134 return v_GetLocTraceToTraceMap();
2135}
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
Definition: ExpList.cpp:6347

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

5711{
5712 int nTotElmt = (*m_exp).size();
5713 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5714 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5715
5716 Array<OneD, NekDouble> tmpCoef(nElmtCoef, 0.0);
5717 Array<OneD, NekDouble> tmpPhys(nElmtPnt, 0.0);
5718
5719 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5720 {
5721 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5722 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5723
5724 if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
5725 {
5726 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5727 tmpCoef = Array<OneD, NekDouble>(nElmtCoef, 0.0);
5728 }
5729
5730 for (int ncl = 0; ncl < nElmtPnt; ncl++)
5731 {
5732 tmpPhys[ncl] = inarray[nelmt][ncl];
5733
5734 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
5735
5736 for (int nrw = 0; nrw < nElmtCoef; nrw++)
5737 {
5738 (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
5739 }
5740 // to maintain all the other columes are zero.
5741 tmpPhys[ncl] = 0.0;
5742 }
5743 }
5744}

◆ GetMatIpwrtDeriveBase() [2/2]

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

Definition at line 5746 of file ExpList.cpp.

5748{
5749 int nTotElmt = (*m_exp).size();
5750
5751 int nspacedim = m_graph->GetSpaceDimension();
5752 Array<OneD, Array<OneD, NekDouble>> projectedpnts(nspacedim);
5753 Array<OneD, Array<OneD, NekDouble>> tmppnts(nspacedim);
5754 Array<OneD, DNekMatSharedPtr> ArrayStdMat(nspacedim);
5755 Array<OneD, Array<OneD, NekDouble>> ArrayStdMat_data(nspacedim);
5756
5757 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
5758
5760 int nElmtPntPrevious = 0;
5761 int nElmtCoefPrevious = 0;
5762
5763 int nElmtPnt, nElmtCoef;
5764 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5765 {
5766 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5767 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5768 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
5769
5770 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5771 (ElmtTypeNow != ElmtTypePrevious))
5772 {
5773 if (nElmtPntPrevious != nElmtPnt)
5774 {
5775 for (int ndir = 0; ndir < nspacedim; ndir++)
5776 {
5777 projectedpnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5778 tmppnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5779 }
5780 }
5782 stdExp = (*m_exp)[nelmt]->GetStdExp();
5783 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase0,
5784 stdExp->DetShapeType(), *stdExp);
5785
5786 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5787 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5788
5789 if (nspacedim > 1)
5790 {
5791 StdRegions::StdMatrixKey matkey(
5792 StdRegions::eDerivBase1, stdExp->DetShapeType(), *stdExp);
5793
5794 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5795 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5796
5797 if (nspacedim > 2)
5798 {
5799 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase2,
5800 stdExp->DetShapeType(),
5801 *stdExp);
5802
5803 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5804 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5805 }
5806 }
5807
5808 ElmtTypePrevious = ElmtTypeNow;
5809 nElmtPntPrevious = nElmtPnt;
5810 nElmtCoefPrevious = nElmtCoef;
5811 }
5812 else
5813 {
5814 for (int ndir = 0; ndir < nspacedim; ndir++)
5815 {
5816 Vmath::Zero(nElmtPnt, projectedpnts[ndir], 1);
5817 }
5818 }
5819
5820 for (int ndir = 0; ndir < nspacedim; ndir++)
5821 {
5822 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5823 ndir, inarray[ndir][nelmt], tmppnts);
5824 for (int n = 0; n < nspacedim; n++)
5825 {
5826 Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
5827 projectedpnts[n], 1);
5828 }
5829 }
5830
5831 for (int ndir = 0; ndir < nspacedim; ndir++)
5832 {
5833 // weight with metric
5834 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
5835 projectedpnts[ndir]);
5836 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
5837
5838 for (int np = 0; np < nElmtPnt; np++)
5839 {
5840 NekDouble factor = projectedpnts[ndir][np];
5841 clmnArray = MatDataArray + np * nElmtCoef;
5842 clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
5843 Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
5844 1, clmnArray, 1);
5845 }
5846 }
5847 }
5848}
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:4084

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 2174 of file ExpList.h.

2175{
2176 v_GetNormals(normals);
2177}
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList.cpp:4384

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 648 of file ExpList.h.

649 {
650 return v_GetNumElmts();
651 }
virtual size_t v_GetNumElmts(void)
Definition: ExpList.h:1163

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 888 of file ExpList.h.

891 {
892 v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
893 }
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:5421

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 2038 of file ExpList.h.

2039{
2040 return m_phys;
2041}
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1096

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 977 of file ExpList.h.

978 {
979 return v_GetPlane(n);
980 }
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:5450

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

5636{
5637 return v_GetPoolCount(poolName);
5638}
virtual int v_GetPoolCount(std::string)
Definition: ExpList.cpp:3677

References v_GetPoolCount().

◆ GetRobinBCInfo()

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

Definition at line 883 of file ExpList.h.

884 {
885 return v_GetRobinBCInfo();
886 }
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:5411

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 1920 of file ExpList.h.

1921{
1922 return (*m_exp)[0]->GetShapeDimension();
1923}

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 954 of file ExpList.h.

955 {
956 return shared_from_this();
957 }

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 2162 of file ExpList.h.

2163{
2164 return v_GetTrace();
2165}
virtual std::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:4283

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 2170 of file ExpList.h.

2171{
2172 return v_GetTraceBndMap();
2173}
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:4299

References v_GetTraceBndMap().

◆ GetTraceMap()

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

Definition at line 2166 of file ExpList.h.

2167{
2168 return v_GetTraceMap();
2169}
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:4291

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 592 of file ExpList.h.

593 {
594 return v_GetTransposition();
595 }
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:3633

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 615 of file ExpList.h.

616 {
617 return v_GetYIDs();
618 }
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:3663

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 585 of file ExpList.h.

586 {
587 return v_GetZIDs();
588 }
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:3655

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 2009 of file ExpList.h.

2011{
2012 v_GlobalToLocal(inarray, outarray);
2013}
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:5038

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 1979 of file ExpList.h.

1980{
1982}

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

3755{
3756 NekDouble err = 0.0, errh1;
3757 int i;
3758
3759 for (i = 0; i < (*m_exp).size(); ++i)
3760 {
3761 errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
3762 soln + m_phys_offset[i]);
3763 err += errh1 * errh1;
3764 }
3765
3766 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3767
3768 return sqrt(err);
3769}
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:4857
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 569 of file ExpList.h.

570 {
571 return v_HomogeneousEnergy();
572 }
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:3625

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 1848 of file ExpList.h.

1851{
1852 v_HomogeneousFwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1853}
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:4895

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 1956 of file ExpList.h.

1957{
1959}
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4997

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

Definition at line 1446 of file ExpList.cpp.

1448{
1451 SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
1456
1457 int id = 0;
1459
1461 // Process each expansion in the graph
1462 for (auto &expIt : expmap)
1463 {
1464 const SpatialDomains::ExpansionInfoShPtr expInfo = expIt.second;
1465
1466 switch (expInfo->m_basisKeyVector.size())
1467 {
1468 case 1: // Segment Expansions
1469 {
1471 "Cannot mix expansion dimensions in one vector");
1472 m_expType = e1D;
1473
1474 if ((SegmentGeom =
1475 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1476 expInfo->m_geomShPtr)))
1477 {
1478 // Retrieve basis key from expansion
1479 LibUtilities::BasisKey bkey = expInfo->m_basisKeyVector[0];
1480
1481 exp =
1483 bkey, SegmentGeom);
1484 }
1485 else
1486 {
1488 "dynamic cast to a 1D Geom failed");
1489 }
1490 }
1491 break;
1492 case 2:
1493 {
1495 "Cannot mix expansion dimensions in one vector");
1496 m_expType = e2D;
1497
1498 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1499 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1500
1501 if ((TriangleGeom =
1502 std::dynamic_pointer_cast<SpatialDomains ::TriGeom>(
1503 expInfo->m_geomShPtr)))
1504 {
1505 // This is not elegantly implemented needs re-thinking.
1506 if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange)
1507 {
1508 LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
1509 Ba.GetNumModes(),
1510 Ba.GetPointsKey());
1511
1515 AllocateSharedPtr(newBa, Bb, TriNb, TriangleGeom);
1516 }
1517 else
1518 {
1520 AllocateSharedPtr(Ba, Bb, TriangleGeom);
1521 }
1522 }
1523 else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1524 SpatialDomains::QuadGeom>(expInfo->m_geomShPtr)))
1525 {
1526 exp =
1528 Ba, Bb, QuadrilateralGeom);
1529 }
1530 else
1531 {
1533 "dynamic cast to a 2D Geom failed");
1534 }
1535 }
1536 break;
1537 case 3:
1538 {
1540 "Cannot mix expansion dimensions in one vector");
1541 m_expType = e3D;
1542
1543 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1544 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1545 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1546
1547 if ((TetGeom =
1548 std::dynamic_pointer_cast<SpatialDomains::TetGeom>(
1549 expInfo->m_geomShPtr)))
1550 {
1551 if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange ||
1552 Ba.GetBasisType() == LibUtilities::eGauss_Lagrange)
1553 {
1555 "LocalRegions::NodalTetExp is not implemented "
1556 "yet");
1557 }
1558 else
1559 {
1560 exp = MemoryManager<
1561 LocalRegions::TetExp>::AllocateSharedPtr(Ba, Bb, Bc,
1562 TetGeom);
1563 }
1564 }
1565 else if ((PrismGeom = std::dynamic_pointer_cast<
1566 SpatialDomains ::PrismGeom>(
1567 expInfo->m_geomShPtr)))
1568 {
1569 exp = MemoryManager<
1570 LocalRegions::PrismExp>::AllocateSharedPtr(Ba, Bb, Bc,
1571 PrismGeom);
1572 }
1573 else if ((PyrGeom = std::dynamic_pointer_cast<
1574 SpatialDomains::PyrGeom>(expInfo->m_geomShPtr)))
1575 {
1576 exp =
1578 Ba, Bb, Bc, PyrGeom);
1579 }
1580 else if ((HexGeom = std::dynamic_pointer_cast<
1581 SpatialDomains::HexGeom>(expInfo->m_geomShPtr)))
1582 {
1583 exp =
1585 Ba, Bb, Bc, HexGeom);
1586 }
1587 else
1588 {
1590 "dynamic cast to a Geom failed");
1591 }
1592 }
1593 break;
1594 default:
1596 "Dimension of basis key is greater than 3");
1597 }
1598
1599 // Assign next id
1600 exp->SetElmtId(id++);
1601
1602 // Add the expansion
1603 (*m_exp).push_back(exp);
1604 }
1605}
@ 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_expType, 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 538 of file ExpList.h.

539 {
540 ASSERTL1(m_physState == true, "local physical space is not true ");
541 return Integral(m_phys);
542 }
NekDouble Integral()
Calculates the error of the global spectral/hp element approximation.
Definition: ExpList.h:538

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 559 of file ExpList.h.

560 {
561 return v_Integral(inarray);
562 }
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:3591

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

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

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

1714{
1715 int npts_e;
1716 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1717 int nq = direction.size() / coordim;
1718
1719 Array<OneD, NekDouble> e_outarray;
1720 Array<OneD, NekDouble> e_MFdiv;
1721
1722 Array<OneD, NekDouble> locdir;
1723
1724 for (int i = 0; i < (*m_exp).size(); ++i)
1725 {
1726 npts_e = (*m_exp)[i]->GetTotPoints();
1727 locdir = Array<OneD, NekDouble>(npts_e * coordim);
1728
1729 for (int k = 0; k < coordim; ++k)
1730 {
1731 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
1732 &locdir[k * npts_e], 1);
1733 }
1734
1735 (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1736 locdir, inarray + m_phys_offset[i],
1737 e_outarray = outarray + m_coeff_offset[i]);
1738 }
1739}

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 509 of file ExpList.h.

512 {
513 return v_L2(inarray, soln);
514 }
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:3546

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

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:4884
const std::vector< NekDouble > velocity

References v_LinearAdvectionReactionSolve(), and Nektar::MovementTests::velocity.

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

3510{
3511 NekDouble err = 0.0;
3512
3513 if (soln == NullNekDouble1DArray)
3514 {
3515 err = Vmath::Vmax(m_npoints, inarray, 1);
3516 }
3517 else
3518 {
3519 for (int i = 0; i < m_npoints; ++i)
3520 {
3521 err = max(err, abs(inarray[i] - soln[i]));
3522 }
3523 }
3524
3525 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
3526
3527 return err;
3528}
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 1969 of file ExpList.h.

1970{
1971 v_LocalToGlobal(useComm);
1972}
virtual void v_LocalToGlobal(bool UseComm)
Definition: ExpList.cpp:5023

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

1976{
1977 v_LocalToGlobal(inarray, outarray, useComm);
1978}

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

1630{
1631 // Retrieve the block matrix using the given key.
1632 const DNekScalBlkMatSharedPtr &blockmat = GetBlockMatrix(gkey);
1633 int nrows = blockmat->GetRows();
1634 int ncols = blockmat->GetColumns();
1635
1636 // Create NekVectors from the given data arrays
1637 NekVector<NekDouble> in(ncols, inarray, eWrapper);
1638 NekVector<NekDouble> out(nrows, outarray, eWrapper);
1639
1640 // Perform matrix-vector multiply.
1641 out = (*blockmat) * in;
1642}
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:2374

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

2132{
2133 GlobalMatrixKey mkey(StdRegions::eInvMass);
2134 const DNekScalBlkMatSharedPtr &InvMass = GetBlockMatrix(mkey);
2135
2136 // Inverse mass matrix
2137 NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
2138 if (inarray.get() == outarray.get())
2139 {
2140 NekVector<NekDouble> in(m_ncoeffs, inarray); // copy data
2141 out = (*InvMass) * in;
2142 }
2143 else
2144 {
2145 NekVector<NekDouble> in(m_ncoeffs, inarray, eWrapper);
2146 out = (*InvMass) * in;
2147 }
2148}

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

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 298 of file ExpList.h.

301 {
302 Array<OneD, NekDouble> tmp(GetNpoints(), 0.0);
303 BwdTrans(inarray, tmp);
304 IProductWRTBase(tmp, outarray);
305 }
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 1647 of file ExpList.cpp.

1650{
1651 Array<OneD, NekDouble> e_outarray;
1652
1653 for (int i = 0; i < (*m_exp).size(); ++i)
1654 {
1655 (*m_exp)[i]->MultiplyByQuadratureMetric(inarray + m_phys_offset[i],
1656 e_outarray = outarray +
1657 m_phys_offset[i]);
1658 }
1659}

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 1902 of file ExpList.h.

1904{
1905 v_NormVectorIProductWRTBase(V, outarray);
1906}
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:4944

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 1895 of file ExpList.h.

1899{
1900 v_NormVectorIProductWRTBase(V1, V2, outarray, BndID);
1901}

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 2226 of file ExpList.h.

2228{
2229 v_PeriodicBwdCopy(Fwd, Bwd);
2230}
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:5368

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

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

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

3010{
3011 int dim = GetCoordim(0);
3012 ASSERTL0(dim == coords.size(), "Invalid coordinate dimension.");
3013
3014 // Grab the element index corresponding to coords.
3015 Array<OneD, NekDouble> xi(dim);
3016 int elmtIdx = GetExpIndex(coords, xi);
3017 ASSERTL0(elmtIdx > 0, "Unable to find element containing point.");
3018
3019 // Grab that element's physical storage.
3020 Array<OneD, NekDouble> elmtPhys = phys + m_phys_offset[elmtIdx];
3021
3022 // Evaluate the element at the appropriate point.
3023 return (*m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
3024}

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 635 of file ExpList.h.

638 {
639 v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
640 }
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:6272

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 624 of file ExpList.h.

627 {
628 v_PhysInterp1DScaled(scale, inarray, outarray);
629 }
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5651

References v_PhysInterp1DScaled().

◆ Reset()

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

Reset geometry information and reset matrices.

Definition at line 386 of file ExpList.h.

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

References v_Reset().

◆ SetBndCondBwdWeight()

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

Set the weight value for boundary conditions.

Definition at line 2140 of file ExpList.h.

2141{
2142 v_SetBndCondBwdWeight(index, value);
2143}
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
Definition: ExpList.cpp:4819

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 1928 of file ExpList.h.

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

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 1936 of file ExpList.h.

1937{
1938 m_coeffs[i] = val;
1939}

References m_coeffs.

◆ SetCoeffsArray()

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

Set the m_coeffs array to inarray.

Definition at line 1940 of file ExpList.h.

1941{
1942 m_coeffs = inarray;
1943}

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 576 of file ExpList.h.

577 {
579 }
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 606 of file ExpList.h.

607 {
608 return v_SetHomoLen(lhom);
609 }
virtual void v_SetHomoLen(const NekDouble lhom)
Definition: ExpList.cpp:3649

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

1404{
1405 if (SetupOffsets)
1406 {
1407 int i;
1408
1409 // Set up offset information and array sizes
1410 m_coeff_offset = Array<OneD, int>(m_exp->size());
1411 m_phys_offset = Array<OneD, int>(m_exp->size());
1412
1413 m_ncoeffs = m_npoints = 0;
1414
1415 for (i = 0; i < m_exp->size(); ++i)
1416 {
1419 m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
1420 m_npoints += (*m_exp)[i]->GetTotPoints();
1421 }
1422 }
1423
1424 if (DeclareCoeffPhysArrays)
1425 {
1426 m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
1427 m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
1428 }
1429
1430 m_coeffsToElmt = Array<OneD, pair<int, int>>{size_t(m_ncoeffs)};
1431
1432 for (int i = 0; i < m_exp->size(); ++i)
1433 {
1434 int coeffs_offset = m_coeff_offset[i];
1435
1436 int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1437
1438 for (int j = 0; j < loccoeffs; ++j)
1439 {
1440 m_coeffsToElmt[coeffs_offset + j].first = i;
1441 m_coeffsToElmt[coeffs_offset + j].second = j;
1442 }
1443 }
1444}

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 2262 of file ExpList.h.

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

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{
1707 v_SmoothField(field);
1708}
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:2200

References v_SmoothField().

◆ UnsetGlobalLinSys()

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

Definition at line 5640 of file ExpList.cpp.

5641{
5642 v_UnsetGlobalLinSys(key, clearLocalMatrices);
5643}
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:3683

References v_UnsetGlobalLinSys().

◆ UpdateBndCondExpansion()

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

Definition at line 2144 of file ExpList.h.

2145{
2146 return v_UpdateBndCondExpansion(i);
2147}
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:4166

References v_UpdateBndCondExpansion().

◆ UpdateBndConditions()

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

Definition at line 2251 of file ExpList.h.

2252{
2253 return v_UpdateBndConditions();
2254}
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:5389

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 2104 of file ExpList.h.

2105{
2106 return m_coeffs;
2107}

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 2114 of file ExpList.h.

2115{
2116 m_physState = true;
2117 return m_phys;
2118}

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 2148 of file ExpList.h.

2152{
2153 v_Upwind(Vec, Fwd, Bwd, Upwind);
2154}
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:4185
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:2155

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 2155 of file ExpList.h.

2159{
2160 v_Upwind(Vn, Fwd, Bwd, Upwind);
2161}

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

4752{
4754 "This method is not defined or valid for this class type");
4755}

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

4743{
4745 "This method is not defined or valid for this class type");
4746}

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

5704{
5705 NEKERROR(ErrorUtil::efatal, "AddTraceIntegralToOffDiag not defined");
5706}

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

4787{
4789 "v_AddTraceQuadPhysToField is not defined for this class type");
4790}

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

4796{
4798 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4799}

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

3901{
3902 v_AppendFieldData(fielddef, fielddata, m_coeffs);
3903}

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

3908{
3909 int i;
3910 // Determine mapping from element ids to location in
3911 // expansion list
3912 // Determine mapping from element ids to location in
3913 // expansion list
3914 map<int, int> ElmtID_to_ExpID;
3915 for (i = 0; i < (*m_exp).size(); ++i)
3916 {
3917 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3918 }
3919
3920 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3921 {
3922 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3923 int datalen = (*m_exp)[eid]->GetNcoeffs();
3924 fielddata.insert(fielddata.end(), &coeffs[m_coeff_offset[eid]],
3925 &coeffs[m_coeff_offset[eid]] + datalen);
3926 }
3927}

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

2838{
2839 LibUtilities::Timer timer;
2840
2841 if (m_expType == e0D)
2842 {
2843 Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
2844 }
2845 else
2846 {
2847 // initialise if required
2849 {
2850 for (int i = 0; i < m_collections.size(); ++i)
2851 {
2853 }
2855 }
2856
2857 LIKWID_MARKER_START("v_BwdTrans");
2858 timer.Start();
2859
2860 Array<OneD, NekDouble> tmp;
2861 int input_offset{0};
2862 int output_offset{0};
2863 for (int i = 0; i < m_collections.size(); ++i)
2864 {
2865 m_collections[i].ApplyOperator(Collections::eBwdTrans,
2866 inarray + input_offset,
2867 tmp = outarray + output_offset);
2868 input_offset +=
2869 m_collections[i].GetInputSize(Collections::eBwdTrans);
2870 output_offset +=
2871 m_collections[i].GetOutputSize(Collections::eBwdTrans);
2872 }
2873
2874 timer.Stop();
2875 LIKWID_MARKER_STOP("v_BwdTrans");
2876 }
2877 // Elapsed time
2878 timer.AccumulateRegion("Collections:BwdTrans", 10);
2879}
#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 3671 of file ExpList.cpp.

3672{
3674 "ClearGlobalLinSysManager not implemented for ExpList.");
3675}

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

1964{
1965 int nq = GetTotPoints();
1966 Array<OneD, NekDouble> Vx(nq);
1967 Array<OneD, NekDouble> Uy(nq);
1968 Array<OneD, NekDouble> Dummy(nq);
1969
1970 switch (m_expType)
1971 {
1972 case e2D:
1973 {
1974 PhysDeriv(xDir, Vel[yDir], Vx);
1975 PhysDeriv(yDir, Vel[xDir], Uy);
1976
1977 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[0], 1);
1978 }
1979 break;
1980
1981 case e3D:
1982 {
1983 Array<OneD, NekDouble> Vz(nq);
1984 Array<OneD, NekDouble> Uz(nq);
1985 Array<OneD, NekDouble> Wx(nq);
1986 Array<OneD, NekDouble> Wy(nq);
1987
1988 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
1989 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
1990 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
1991
1992 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
1993 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
1994 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
1995 }
1996 break;
1997 default:
1998 ASSERTL0(0, "Dimension not supported by ExpList::Curl");
1999 break;
2000 }
2001}
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.

Referenced by Curl().

◆ v_CurlCurl()

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

Definition at line 2011 of file ExpList.cpp.

2013{
2014 int nq = GetTotPoints();
2015 Array<OneD, NekDouble> Vx(nq);
2016 Array<OneD, NekDouble> Uy(nq);
2017 Array<OneD, NekDouble> Dummy(nq);
2018
2019 bool halfMode = false;
2020 if (GetExpType() == e3DH1D)
2021 {
2022 m_session->MatchSolverInfo("ModeType", "HalfMode", halfMode, false);
2023 }
2024
2025 switch (m_expType)
2026 {
2027 case e2D:
2028 {
2029 PhysDeriv(xDir, Vel[yDir], Vx);
2030 PhysDeriv(yDir, Vel[xDir], Uy);
2031
2032 Vmath::Vsub(nq, Vx, 1, Uy, 1, Dummy, 1);
2033
2034 PhysDeriv(Dummy, Q[1], Q[0]);
2035
2036 Vmath::Smul(nq, -1.0, Q[1], 1, Q[1], 1);
2037 }
2038 break;
2039
2040 case e3D:
2041 case e3DH1D:
2042 case e3DH2D:
2043 {
2044 Array<OneD, NekDouble> Vz(nq);
2045 Array<OneD, NekDouble> Uz(nq);
2046 Array<OneD, NekDouble> Wx(nq);
2047 Array<OneD, NekDouble> Wy(nq);
2048
2049 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
2050 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
2051 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
2052
2053 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2054 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2055 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2056
2057 PhysDeriv(Q[0], Dummy, Uy, Uz);
2058 PhysDeriv(Q[1], Vx, Dummy, Vz);
2059 PhysDeriv(Q[2], Wx, Wy, Dummy);
2060
2061 // For halfmode, need to change the sign of z derivatives
2062 if (halfMode)
2063 {
2064 Vmath::Neg(nq, Uz, 1);
2065 Vmath::Neg(nq, Vz, 1);
2066 }
2067
2068 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2069 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2070 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2071 }
2072 break;
2073 default:
2074 ASSERTL0(0, "Dimension not supported");
2075 break;
2076 }
2077}
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:1610
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 4925 of file ExpList.cpp.

4930{
4932 "This method is not defined or valid for this class type");
4933}

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

4920{
4922 "This method is not defined or valid for this class type");
4923}

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

5404{
5406 "This method is not defined or valid for this class type");
5407}

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

4046{
4047 int i;
4048 int offset = 0;
4049
4050 for (i = 0; i < (*m_exp).size(); ++i)
4051 {
4052 std::vector<unsigned int> nummodes;
4053 vector<LibUtilities::BasisType> basisTypes;
4054 for (int j = 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
4055 {
4056 nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
4057 basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
4058 }
4059
4060 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
4061 &toCoeffs[m_coeff_offset[i]],
4062 basisTypes);
4063
4064 offset += fromExpList->GetExp(i)->GetNcoeffs();
4065 }
4066}

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

3959{
3960 int i, expId;
3961 int offset = 0;
3962 int modes_offset = 0;
3963 int datalen = fielddata.size() / fielddef->m_fields.size();
3964
3965 // Find data location according to field definition
3966 for (i = 0; i < fielddef->m_fields.size(); ++i)
3967 {
3968 if (fielddef->m_fields[i] == field)
3969 {
3970 break;
3971 }
3972 offset += datalen;
3973 }
3974
3975 ASSERTL0(i != fielddef->m_fields.size(),
3976 "Field (" + field + ") not found in file.");
3977
3978 if (m_elmtToExpId.size() == 0)
3979 {
3980 // Loop in reverse order so that in case where using a
3981 // Homogeneous expansion it sets geometry ids to first part of
3982 // m_exp list. Otherwise will set to second (complex) expansion
3983 for (i = (*m_exp).size() - 1; i >= 0; --i)
3984 {
3985 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3986 }
3987 }
3988
3989 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3990 {
3991 // Reset modes_offset in the case where all expansions of
3992 // the same order.
3993 if (fielddef->m_uniOrder == true)
3994 {
3995 modes_offset = 0;
3996 }
3997
3999 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
4000
4001 const int elmtId = fielddef->m_elementIDs[i];
4002 auto eIt = m_elmtToExpId.find(elmtId);
4003
4004 if (eIt == m_elmtToExpId.end())
4005 {
4006 offset += datalen;
4007 modes_offset += (*m_exp)[0]->GetNumBases();
4008 continue;
4009 }
4010
4011 expId = eIt->second;
4012
4013 bool sameBasis = true;
4014 for (int j = 0; j < fielddef->m_basis.size(); ++j)
4015 {
4016 if (fielddef->m_basis[j] != (*m_exp)[expId]->GetBasisType(j))
4017 {
4018 sameBasis = false;
4019 break;
4020 }
4021 }
4022
4023 if (datalen == (*m_exp)[expId]->GetNcoeffs() && sameBasis)
4024 {
4025 Vmath::Vcopy(datalen, &fielddata[offset], 1,
4026 &coeffs[m_coeff_offset[expId]], 1);
4027 }
4028 else
4029 {
4030 (*m_exp)[expId]->ExtractDataToCoeffs(
4031 &fielddata[offset], fielddef->m_numModes, modes_offset,
4032 &coeffs[m_coeff_offset[expId]], fielddef->m_basis);
4033 }
4034
4035 offset += datalen;
4036 modes_offset += (*m_exp)[0]->GetNumBases();
4037 }
4038
4039 return;
4040}
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
Definition: ShapeType.hpp:305

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

5199{
5200 int n, cnt;
5201 Array<OneD, NekDouble> tmp1, tmp2;
5203
5204 Array<OneD, int> ElmtID, EdgeID;
5205 GetBoundaryToElmtMap(ElmtID, EdgeID);
5206
5207 // Initialise result
5208 boundary =
5209 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5210
5211 // Skip other boundary regions
5212 for (cnt = n = 0; n < i; ++n)
5213 {
5214 cnt += GetBndCondExpansions()[n]->GetExpSize();
5215 }
5216
5217 int offsetBnd;
5218 int offsetElmt = 0;
5219 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5220 {
5221 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5222
5223 elmt = GetExp(ElmtID[cnt + n]);
5224 elmt->GetTracePhysVals(
5225 EdgeID[cnt + n], GetBndCondExpansions()[i]->GetExp(n),
5226 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
5227
5228 offsetElmt += elmt->GetTotPoints();
5229 }
5230}
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:2121
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2266

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

5276{
5277 int n, cnt;
5278 Array<OneD, NekDouble> tmp1;
5280
5281 Array<OneD, int> ElmtID, EdgeID;
5282 GetBoundaryToElmtMap(ElmtID, EdgeID);
5283
5284 // Initialise result
5285 bnd =
5286 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5287
5288 // Skip other boundary regions
5289 for (cnt = n = 0; n < i; ++n)
5290 {
5291 cnt += GetBndCondExpansions()[n]->GetExpSize();
5292 }
5293
5294 int offsetBnd;
5295 int offsetPhys;
5296 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5297 {
5298 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5299 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5300
5301 elmt = GetExp(ElmtID[cnt + n]);
5302 elmt->GetTracePhysVals(EdgeID[cnt + n],
5304 phys + offsetPhys, tmp1 = bnd + offsetBnd);
5305 }
5306}

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

5237{
5238 int n, cnt, nq;
5239
5240 Array<OneD, int> ElmtID, EdgeID;
5241 GetBoundaryToElmtMap(ElmtID, EdgeID);
5242
5243 // Skip other boundary regions
5244 for (cnt = n = 0; n < i; ++n)
5245 {
5246 cnt += GetBndCondExpansions()[n]->GetExpSize();
5247 }
5248
5249 // Count number of points
5250 int npoints = 0;
5251 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5252 {
5253 npoints += GetExp(ElmtID[cnt + n])->GetTotPoints();
5254 }
5255
5256 // Initialise result
5257 bndElmt = Array<OneD, NekDouble>(npoints, 0.0);
5258
5259 // Extract data
5260 int offsetPhys;
5261 int offsetElmt = 0;
5262 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5263 {
5264 nq = GetExp(ElmtID[cnt + n])->GetTotPoints();
5265 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5266 Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
5267 offsetElmt += nq;
5268 }
5269}

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

4836{
4838 "This method is not defined or valid for this class type");
4839}

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

4844{
4846 "This method is not defined or valid for this class type");
4847}

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

5008{
5010 "This method is not defined or valid for this class type");
5011}

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

5018{
5020 "This method is not defined or valid for this class type");
5021}

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

4778{
4780 "This method is not defined or valid for this class type");
4781}

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

5364{
5365 NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
5366}

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

2180{
2181 int i;
2182
2183 Array<OneD, NekDouble> e_outarray;
2184
2185 for (i = 0; i < (*m_exp).size(); ++i)
2186 {
2187 (*m_exp)[i]->FwdTransBndConstrained(inarray + m_phys_offset[i],
2188 e_outarray =
2189 outarray + m_coeff_offset[i]);
2190 }
2191}

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

2170{
2171 Array<OneD, NekDouble> f(m_ncoeffs);
2172
2173 IProductWRTBase(inarray, f);
2174 MultiplyByElmtInvMass(f, outarray);
2175}
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:2130

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

4939{
4941 "This method is not defined or valid for this class type");
4942}

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

4812{
4814 "v_GetBndCondBwdWeight is not defined for this class type");
4815 static Array<OneD, NekDouble> tmp;
4816 return tmp;
4817}

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

4159{
4161 "This method is not defined or valid for this class type");
4162 static Array<OneD, const std::shared_ptr<ExpList>> result;
4163 return result;
4164}

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

5379{
5381 "This method is not defined or valid for this class type");
5382 static Array<OneD, const SpatialDomains::BoundaryConditionShPtr> result;
5383 return result;
5384}

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

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

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

5312{
5313 int j, n, cnt, nq;
5314 int coordim = GetCoordim(0);
5315 Array<OneD, NekDouble> tmp;
5317
5318 Array<OneD, int> ElmtID, EdgeID;
5319 GetBoundaryToElmtMap(ElmtID, EdgeID);
5320
5321 // Initialise result
5322 normals = Array<OneD, Array<OneD, NekDouble>>(coordim);
5323 for (j = 0; j < coordim; ++j)
5324 {
5325 normals[j] = Array<OneD, NekDouble>(
5326 GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5327 }
5328
5329 // Skip other boundary regions
5330 for (cnt = n = 0; n < i; ++n)
5331 {
5332 cnt += GetBndCondExpansions()[n]->GetExpSize();
5333 }
5334
5335 int offset;
5336 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5337 {
5338 offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5339 nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
5340
5341 elmt = GetExp(ElmtID[cnt + n]);
5342 const Array<OneD, const Array<OneD, NekDouble>> normalsElmt =
5343 elmt->GetTraceNormal(EdgeID[cnt + n]);
5344 // Copy to result
5345 for (j = 0; j < coordim; ++j)
5346 {
5347 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
5348 }
5349 }
5350}

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

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

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

5116{
5117 if (GetNumElmts() == 0)
5118 {
5119 return;
5120 }
5121
5122 int i;
5123 Array<OneD, NekDouble> e_coord_0;
5124 Array<OneD, NekDouble> e_coord_1;
5125 Array<OneD, NekDouble> e_coord_2;
5126
5127 switch (GetExp(0)->GetCoordim())
5128 {
5129 case 1:
5130 for (i = 0; i < (*m_exp).size(); ++i)
5131 {
5132 e_coord_0 = coord_0 + m_phys_offset[i];
5133 (*m_exp)[i]->GetCoords(e_coord_0);
5134 }
5135 break;
5136 case 2:
5137 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5138
5139 for (i = 0; i < (*m_exp).size(); ++i)
5140 {
5141 e_coord_0 = coord_0 + m_phys_offset[i];
5142 e_coord_1 = coord_1 + m_phys_offset[i];
5143 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
5144 }
5145 break;
5146 case 3:
5147 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5148 ASSERTL0(coord_2.size() != 0, "output coord_2 is not defined");
5149
5150 for (i = 0; i < (*m_exp).size(); ++i)
5151 {
5152 e_coord_0 = coord_0 + m_phys_offset[i];
5153 e_coord_1 = coord_1 + m_phys_offset[i];
5154 e_coord_2 = coord_2 + m_phys_offset[i];
5155 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
5156 }
5157 break;
5158 }
5159}

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

3892{
3894}
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:3771

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

3884{
3885 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3886 v_GetFieldDefinitions(returnval);
3887 return returnval;
3888}

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

4759{
4761 "This method is not defined or valid for this class type");
4762}

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

4769{
4771 "This method is not defined or valid for this class type");
4772}

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

◆ v_GetGlobalLinSysManager()

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

Definition at line 3691 of file ExpList.cpp.

3692{
3694 "GetGlobalLinSysManager not implemented for ExpList.");
3696}
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 3641 of file ExpList.cpp.

3642{
3644 "This method is not defined or valid for this class type");
3645 NekDouble len = 0.0;
3646 return len;
3647}

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

Referenced by GetHomoLen().

◆ v_GetLeftAdjacentFaces()

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

Definition at line 4826 of file ExpList.cpp.

4827{
4829 "This method is not defined or valid for this class type");
4830 static vector<bool> tmp;
4831 return tmp;
4832}

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

4305{
4307 "This method is not defined or valid for this class type");
4308 static std::vector<bool> result;
4309 return result;
4310}

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

4806{
4808 "v_GetLocTraceFromTracePts is not defined for this class");
4809}

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

6348{
6349 NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
6351}
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 4084 of file ExpList.cpp.

4087{
4088 int npts;
4089
4090 int MFdim = 3;
4091 int nq = outarray[0].size() / MFdim;
4092
4093 // Assume whole array is of same coordinate dimension
4094 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
4095
4096 Array<OneD, Array<OneD, NekDouble>> MFloc(MFdim * coordim);
4097 // Process each expansion.
4098 for (int i = 0; i < m_exp->size(); ++i)
4099 {
4100 npts = (*m_exp)[i]->GetTotPoints();
4101
4102 for (int j = 0; j < MFdim * coordim; ++j)
4103 {
4104 MFloc[j] = Array<OneD, NekDouble>(npts, 0.0);
4105 }
4106
4107 // MF from LOCALREGIONS
4108 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
4109 (*m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
4110
4111 // Get the physical data offset for this expansion.
4112 for (int j = 0; j < MFdim; ++j)
4113 {
4114 for (int k = 0; k < coordim; ++k)
4115 {
4116 Vmath::Vcopy(npts, &MFloc[j * coordim + k][0], 1,
4117 &outarray[j][k * nq + m_phys_offset[i]], 1);
4118 }
4119 }
4120 }
4121}

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

4385{
4386 int i, j, k, e_npoints, offset;
4387 Array<OneD, Array<OneD, NekDouble>> locnormals;
4388
4389 // Assume whole array is of same coordinate dimension
4390 int coordim = GetCoordim(0);
4391
4392 ASSERTL1(normals.size() >= coordim,
4393 "Output vector does not have sufficient dimensions to "
4394 "match coordim");
4395
4396 switch (m_expType)
4397 {
4398 case e0D:
4399 {
4400 // Process each expansion.
4401 for (i = 0; i < m_exp->size(); ++i)
4402 {
4403 LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
4404
4406 loc_exp->GetLeftAdjacentElementExp();
4407
4408 // Get the number of points and normals for this expansion.
4409 e_npoints = 1;
4410 locnormals = loc_elmt->GetTraceNormal(
4411 loc_exp->GetLeftAdjacentElementTrace());
4412
4413 // Get the physical data offset for this expansion.
4414 offset = m_phys_offset[i];
4415
4416 // Process each point in the expansion.
4417 for (j = 0; j < e_npoints; ++j)
4418 {
4419 // Process each spatial dimension and copy the
4420 // values into the output array.
4421 for (k = 0; k < coordim; ++k)
4422 {
4423 normals[k][offset] = locnormals[k][0];
4424 }
4425 }
4426 }
4427 }
4428 break;
4429 case e1D:
4430 {
4431 // Process each (trace) expansion.
4432 for (i = 0; i < m_exp->size(); ++i)
4433 {
4434 LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4435 // location of this normal vector in the output array.
4436 int offset = m_phys_offset[i];
4437
4438 // Get number of points from left expansion.
4440 traceExp->GetLeftAdjacentElementExp();
4441 int edgeId = traceExp->GetLeftAdjacentElementTrace();
4442 LibUtilities::PointsKey edgePoints =
4443 exp2D->GetTraceBasisKey(edgeId).GetPointsKey();
4444 LibUtilities::PointsKey tracePoints =
4445 traceExp->GetBasis(0)->GetPointsKey();
4446
4447 // If right adjacent element exists, then we compare
4448 // the left and right side and take the one with
4449 // the highest number of points to compute the
4450 // local normals. However, it's a question whether
4451 // this effort pays off.
4452 bool useRight = false;
4453 if (traceExp->GetRightAdjacentElementTrace() >= 0)
4454 {
4456 traceExp->GetRightAdjacentElementExp();
4457 int RedgeId = traceExp->GetRightAdjacentElementTrace();
4458 LibUtilities::PointsKey RedgePoints =
4459 Rexp2D->GetTraceBasisKey(RedgeId).GetPointsKey();
4460
4461 if (RedgePoints.GetNumPoints() > edgePoints.GetNumPoints())
4462 {
4463 exp2D = Rexp2D;
4464 edgeId = RedgeId;
4465 edgePoints = RedgePoints;
4466 useRight = true;
4467 }
4468 }
4469
4470 const Array<OneD, const Array<OneD, NekDouble>> &locNormals =
4471 exp2D->GetTraceNormal(edgeId);
4472
4473 // For unknown reason, GetTraceNormal(2D) returns normals
4474 // that has been reoriented to trace order.
4475 // So here we don't need to reorient them again.
4476 for (int d = 0; d < coordim; ++d)
4477 {
4478 LibUtilities::Interp1D(edgePoints, locNormals[d].data(),
4479 tracePoints,
4480 normals[d].data() + offset);
4481 // Trace normal direction is always the outward
4482 // direction of the left element.
4483 if (useRight)
4484 {
4485 Vmath::Neg((int)tracePoints.GetNumPoints(),
4486 &normals[d][offset], 1);
4487 }
4488 }
4489 }
4490 }
4491 break;
4492 case e2D:
4493 {
4494 Array<OneD, NekDouble> tmp;
4495
4496 // Process each expansion.
4497 for (i = 0; i < m_exp->size(); ++i)
4498 {
4499 LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4500 // location of this normal vector in the output array.
4501 int offset = m_phys_offset[i];
4502
4503 // Get the normals from left expansion.
4504 // NOTE:
4505 // One can choose to compare the left and right side and take
4506 // the one with the highest number of points to compute the
4507 // local normals. Here are 2 reasons why we don't do so:
4508 // 1.
4509 // in general two adjacent elements must share a common
4510 // cuerved edge/face, which can be precisely described even by
4511 // the lower-order side. Even if the two sides are not exactly
4512 // the same, it should not affect the convergence of solution.
4513 // 2.
4514 // In 3D, it's hard to define which is side has higher order.
4515 // The left-side may have higher order in axis 0 but lower in
4516 // axis 1. It's too complicated and not worth the effort.
4518 traceExp->GetLeftAdjacentElementExp();
4519 int faceId = traceExp->GetLeftAdjacentElementTrace();
4520 const Array<OneD, const Array<OneD, NekDouble>> &locNormals =
4521 exp3D->GetTraceNormal(faceId);
4522
4523 StdRegions::Orientation orient = exp3D->GetTraceOrient(faceId);
4524
4525 // swap local basiskey 0 and 1 if orientation is transposed
4526 // (>=9)
4527 int fromid0, fromid1;
4528
4530 {
4531 fromid0 = 0;
4532 fromid1 = 1;
4533 }
4534 else
4535 {
4536 fromid0 = 1;
4537 fromid1 = 0;
4538 }
4539
4540 LibUtilities::BasisKey faceBasis0 =
4541 exp3D->GetTraceBasisKey(faceId, fromid0);
4542 LibUtilities::BasisKey faceBasis1 =
4543 exp3D->GetTraceBasisKey(faceId, fromid1);
4544 LibUtilities::BasisKey traceBasis0 =
4545 traceExp->GetBasis(0)->GetBasisKey();
4546 LibUtilities::BasisKey traceBasis1 =
4547 traceExp->GetBasis(1)->GetBasisKey();
4548
4549 const int faceNq0 = faceBasis0.GetNumPoints();
4550 const int faceNq1 = faceBasis1.GetNumPoints();
4551
4552 // Reorient normals from stdExp definition onto the same
4553 // orientation as the trace expansion.(also match the
4554 // swapped local basiskey)
4555 Array<OneD, int> map;
4556 exp3D->ReOrientTracePhysMap(orient, map, faceNq0, faceNq1);
4557
4558 // Perform reorientation and interpolation.
4559 Array<OneD, NekDouble> traceNormals(faceNq0 * faceNq1);
4560 for (j = 0; j < coordim; ++j)
4561 {
4562 Vmath::Scatr(faceNq0 * faceNq1, locNormals[j], map,
4563 traceNormals);
4564
4566 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4567 traceNormals, traceBasis0.GetPointsKey(),
4568 traceBasis1.GetPointsKey(), tmp = normals[j] + offset);
4569 }
4570 }
4571 }
4572 break;
4573 default:
4574 {
4576 "This method is not defined or valid for this class type");
4577 }
4578 }
4579}
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 1163 of file ExpList.h.

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

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

5424{
5426 "This method is not defined or valid for this class type");
5427}

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

5451{
5453 "This method is not defined or valid for this class type");
5454 return NullExpListSharedPtr;
5455}
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 3677 of file ExpList.cpp.

3678{
3679 NEKERROR(ErrorUtil::efatal, "GetPoolCount not implemented for ExpList.");
3680 return -1;
3681}

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

5412{
5414 "This method is not defined or valid for this class type");
5415 static map<int, RobinBCInfoSharedPtr> result;
5416 return result;
5417}

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

4284{
4286 "This method is not defined or valid for this class type");
4287 static std::shared_ptr<ExpList> returnVal;
4288 return returnVal;
4289}

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

4300{
4301 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
4302}
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2166

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

4292{
4294 "This method is not defined or valid for this class type");
4295 static std::shared_ptr<AssemblyMapDG> result;
4296 return result;
4297}

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

3634{
3636 "This method is not defined or valid for this class type");
3638 return trans;
3639}
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 3663 of file ExpList.cpp.

3664{
3666 "This method is not defined or valid for this class type");
3667 Array<OneD, unsigned int> NoModes(1);
3668 return NoModes;
3669}

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

3656{
3658 "This method is not defined or valid for this class type");
3659 Array<OneD, unsigned int> NoModes(1);
3660 return NoModes;
3661}

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

5047{
5049 "This method is not defined or valid for this class type");
5050}

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

5039{
5041 "This method is not defined or valid for this class type");
5042}

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

4910{
4912 "This method is not defined or valid for this class type");
4913}

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

3626{
3628 "This method is not defined or valid for this class type");
3629 Array<OneD, NekDouble> NoEnergy(1, 0.0);
3630 return NoEnergy;
3631}

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

4900{
4902 "This method is not defined or valid for this class type");
4903}

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

4999{
5001 "This method is not defined or valid for this class type");
5002}

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

3592{
3593 NekDouble sum = 0.0;
3594 int i = 0;
3595
3596 for (i = 0; i < (*m_exp).size(); ++i)
3597 {
3598 sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
3599 }
3600 m_comm->GetRowComm()->AllReduce(sum, LibUtilities::ReduceSum);
3601
3602 return sum;
3603}

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

5071{
5072 LibUtilities::Timer timer;
5073 timer.Start();
5074 // initialise if required
5076 {
5077 for (int i = 0; i < m_collections.size(); ++i)
5078 {
5080 }
5082 }
5083
5084 Array<OneD, NekDouble> tmp;
5085 int input_offset{0};
5086 int output_offset{0};
5087 for (int i = 0; i < m_collections.size(); ++i)
5088 {
5090 inarray + input_offset,
5091 tmp = outarray + output_offset);
5092 input_offset +=
5094 output_offset +=
5096 }
5097 timer.Stop();
5098 // Elapsed time
5099 timer.AccumulateRegion("Collections:IProductWRTBase", 10);
5100}

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

1755{
1756 Array<OneD, NekDouble> tmp0, tmp1, tmp2;
1757 // assume coord dimension defines the size of Deriv Base
1758 int dim = GetCoordim(0);
1759
1760 ASSERTL1(inarray.size() >= dim, "inarray is not of sufficient dimension");
1761
1762 // initialise if required
1764 {
1765 for (int i = 0; i < m_collections.size(); ++i)
1766 {
1768 }
1770 }
1771
1772 LibUtilities::Timer timer;
1773 int input_offset{0};
1774 int output_offset{0};
1775 LIKWID_MARKER_START("IProductWRTDerivBase_coll");
1776 timer.Start();
1777
1778 switch (dim)
1779 {
1780 case 1:
1781 for (int i = 0; i < m_collections.size(); ++i)
1782 {
1783 m_collections[i].ApplyOperator(
1785 inarray[0] + input_offset, tmp0 = outarray + output_offset);
1786 input_offset += m_collections[i].GetInputSize(
1788 output_offset += m_collections[i].GetOutputSize(
1790 }
1791 break;
1792 case 2:
1793 for (int i = 0; i < m_collections.size(); ++i)
1794 {
1795 m_collections[i].ApplyOperator(
1797 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
1798 tmp1 = outarray + output_offset);
1799 input_offset += m_collections[i].GetInputSize(
1801 output_offset += m_collections[i].GetOutputSize(
1803 }
1804 break;
1805 case 3:
1806 for (int i = 0; i < m_collections.size(); ++i)
1807 {
1808 m_collections[i].ApplyOperator(
1810 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
1811 tmp1 = inarray[2] + input_offset,
1812 tmp2 = outarray + output_offset);
1813 input_offset += m_collections[i].GetInputSize(
1815 output_offset += m_collections[i].GetOutputSize(
1817 }
1818 break;
1819 default:
1820 NEKERROR(ErrorUtil::efatal, "Dimension of inarray not correct");
1821 break;
1822 }
1823
1824 timer.Stop();
1825 LIKWID_MARKER_STOP("IProductWRTDerivBase_coll");
1826
1827 // Elapsed time
1828 timer.AccumulateRegion("Collections:IProductWRTDerivBase", 10);
1829}

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

1694{
1695 int i;
1696
1697 Array<OneD, NekDouble> e_outarray;
1698 for (i = 0; i < (*m_exp).size(); ++i)
1699 {
1700 (*m_exp)[i]->IProductWRTDerivBase(dir, inarray + m_phys_offset[i],
1701 e_outarray =
1702 outarray + m_coeff_offset[i]);
1703 }
1704}

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

3548{
3549 NekDouble err = 0.0, errl2;
3550 int i;
3551
3552 if (soln == NullNekDouble1DArray)
3553 {
3554 for (i = 0; i < (*m_exp).size(); ++i)
3555 {
3556 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i]);
3557 err += errl2 * errl2;
3558 }
3559 }
3560 else
3561 {
3562 for (i = 0; i < (*m_exp).size(); ++i)
3563 {
3564 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i],
3565 soln + m_phys_offset[i]);
3566 err += errl2 * errl2;
3567 }
3568 }
3569
3570 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3571
3572 return sqrt(err);
3573}

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

4878{
4880 "LinearAdvectionDiffusionReactionSolve not implemented.");
4881 return NullGlobalLinSysKey;
4882}

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

4890{
4892 "This method is not defined or valid for this class type");
4893}

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

5024{
5026 "This method is not defined or valid for this class type");
5027}

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

5033{
5035 "This method is not defined or valid for this class type");
5036}

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

4852{
4854 "This method is not defined or valid for this class type");
4855}

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

4956{
4957 Array<OneD, NekDouble> tmp;
4958 switch (GetCoordim(0))
4959 {
4960 case 1:
4961 {
4962 for (int i = 0; i < GetExpSize(); ++i)
4963 {
4964 (*m_exp)[i]->NormVectorIProductWRTBase(
4965 V[0] + GetPhys_Offset(i),
4966 tmp = outarray + GetCoeff_Offset(i));
4967 }
4968 }
4969 break;
4970 case 2:
4971 {
4972 for (int i = 0; i < GetExpSize(); ++i)
4973 {
4974 (*m_exp)[i]->NormVectorIProductWRTBase(
4975 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
4976 tmp = outarray + GetCoeff_Offset(i));
4977 }
4978 }
4979 break;
4980 case 3:
4981 {
4982 for (int i = 0; i < GetExpSize(); ++i)
4983 {
4984 (*m_exp)[i]->NormVectorIProductWRTBase(
4985 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
4986 V[2] + GetPhys_Offset(i),
4987 tmp = outarray + GetCoeff_Offset(i));
4988 }
4989 }
4990 break;
4991 default:
4992 NEKERROR(ErrorUtil::efatal, "Dimension not supported");
4993 break;
4994 }
4995}
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:2087
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2046

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

4949{
4951 "This method is not defined or valid for this class type");
4952}

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

5371{
5372 NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
5373}

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

1868{
1869 Array<OneD, NekDouble> e_out_d0;
1870 Array<OneD, NekDouble> e_out_d1;
1871 Array<OneD, NekDouble> e_out_d2;
1872
1873 // initialise if required
1875 {
1876 for (int i = 0; i < m_collections.size(); ++i)
1877 {
1879 }
1881 }
1882
1883 int offset{0};
1884 LibUtilities::Timer timer;
1885 timer.Start();
1886 for (int i = 0; i < m_collections.size(); ++i)
1887 {
1888 e_out_d0 = out_d0 + offset;
1889 e_out_d1 = out_d1 + offset;
1890 e_out_d2 = out_d2 + offset;
1891 m_collections[i].ApplyOperator(Collections::ePhysDeriv,
1892 inarray + offset, e_out_d0, e_out_d1,
1893 e_out_d2);
1894 offset += m_collections[i].GetInputSize(Collections::ePhysDeriv);
1895 }
1896 timer.Stop();
1897 // Elapsed time
1898 timer.AccumulateRegion("Collections:PhysDeriv", 10);
1899}

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

1904{
1905 Direction edir = DirCartesianMap[dir];
1906 v_PhysDeriv(edir, inarray, out_d);
1907}
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:86

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

1912{
1913 int i;
1914 if (edir == MultiRegions::eS)
1915 {
1916 Array<OneD, NekDouble> e_out_ds;
1917 for (i = 0; i < (*m_exp).size(); ++i)
1918 {
1919 e_out_ds = out_d + m_phys_offset[i];
1920 (*m_exp)[i]->PhysDeriv_s(inarray + m_phys_offset[i], e_out_ds);
1921 }
1922 }
1923 else if (edir == MultiRegions::eN)
1924 {
1925 Array<OneD, NekDouble> e_out_dn;
1926 for (i = 0; i < (*m_exp).size(); i++)
1927 {
1928 e_out_dn = out_d + m_phys_offset[i];
1929 (*m_exp)[i]->PhysDeriv_n(inarray + m_phys_offset[i], e_out_dn);
1930 }
1931 }
1932 else
1933 {
1934 // initialise if required
1936 {
1937 for (int i = 0; i < m_collections.size(); ++i)
1938 {
1940 }
1942 }
1943
1944 // convert enum into int
1945 int intdir = (int)edir;
1946 Array<OneD, NekDouble> e_out_d;
1947 int offset{0};
1948 for (int i = 0; i < m_collections.size(); ++i)
1949 {
1950 e_out_d = out_d + offset;
1951 m_collections[i].ApplyOperator(Collections::ePhysDeriv, intdir,
1952 inarray + offset, e_out_d);
1953 offset += m_collections[i].GetInputSize(Collections::ePhysDeriv);
1954 }
1955 }
1956}

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

2083{
2084 int npts_e;
2085 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
2086 int nq = direction.size() / coordim;
2087
2088 Array<OneD, NekDouble> e_outarray;
2089 Array<OneD, NekDouble> e_MFdiv;
2090 Array<OneD, NekDouble> locdir;
2091
2092 for (int i = 0; i < (*m_exp).size(); ++i)
2093 {
2094 npts_e = (*m_exp)[i]->GetTotPoints();
2095 locdir = Array<OneD, NekDouble>(npts_e * coordim);
2096
2097 for (int k = 0; k < coordim; ++k)
2098 {
2099 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
2100 &locdir[k * npts_e], 1);
2101 }
2102
2103 (*m_exp)[i]->PhysDirectionalDeriv(inarray + m_phys_offset[i], locdir,
2104 e_outarray =
2105 outarray + m_phys_offset[i]);
2106 }
2107}

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

6275{
6276 int cnt, cnt1;
6277
6278 cnt = cnt1 = 0;
6279
6280 switch (m_expType)
6281 {
6282 case e2D:
6283 {
6284 for (int i = 0; i < GetExpSize(); ++i)
6285 {
6286 // get new points key
6287 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6288 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6289 int npt0 = (int)pt0 * scale;
6290 int npt1 = (int)pt1 * scale;
6291
6292 LibUtilities::PointsKey newPointsKey0(
6293 npt0, (*m_exp)[i]->GetPointsType(0));
6294 LibUtilities::PointsKey newPointsKey1(
6295 npt1, (*m_exp)[i]->GetPointsType(1));
6296
6297 // Project points;
6299 newPointsKey0, newPointsKey1, &inarray[cnt],
6300 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6301 (*m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6302
6303 cnt += npt0 * npt1;
6304 cnt1 += pt0 * pt1;
6305 }
6306 }
6307 break;
6308 case e3D:
6309 {
6310 for (int i = 0; i < GetExpSize(); ++i)
6311 {
6312 // get new points key
6313 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6314 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6315 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6316 int npt0 = (int)pt0 * scale;
6317 int npt1 = (int)pt1 * scale;
6318 int npt2 = (int)pt2 * scale;
6319
6320 LibUtilities::PointsKey newPointsKey0(
6321 npt0, (*m_exp)[i]->GetPointsType(0));
6322 LibUtilities::PointsKey newPointsKey1(
6323 npt1, (*m_exp)[i]->GetPointsType(1));
6324 LibUtilities::PointsKey newPointsKey2(
6325 npt2, (*m_exp)[i]->GetPointsType(2));
6326
6327 // Project points;
6329 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6330 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6331 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
6332 (*m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6333
6334 cnt += npt0 * npt1 * npt2;
6335 cnt1 += pt0 * pt1 * pt2;
6336 }
6337 }
6338 break;
6339 default:
6340 {
6341 NEKERROR(ErrorUtil::efatal, "not setup for this expansion");
6342 }
6343 break;
6344 }
6345}
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 5651 of file ExpList.cpp.

5654{
5655 // the scaling factor for the PhysInterp1DScaled is given as NekDouble
5656 // however inside Collections it is treated as a FactorMap
5657 // defining needed FactorMap to pass the scaling factor as an input to
5658 // Collections
5660 // Updating the FactorMap according to the scale input
5662 LibUtilities::Timer timer;
5663
5664 // initialise if required
5665 if (m_collections.size() &&
5667 {
5668 for (int i = 0; i < m_collections.size(); ++i)
5669 {
5672 }
5673 }
5674 // once the collections are initialized, check for the scaling factor
5675 for (int i = 0; i < m_collections.size(); ++i)
5676
5677 {
5680 }
5681 LIKWID_MARKER_START("v_PhysInterp1DScaled");
5682 timer.Start();
5683 Array<OneD, NekDouble> tmp;
5684 int input_offset{0};
5685 int output_offset{0};
5686 for (int i = 0; i < m_collections.size(); ++i)
5687 {
5689 inarray + input_offset,
5690 tmp = outarray + output_offset);
5691 input_offset +=
5693 output_offset +=
5695 }
5696 timer.Stop();
5697 LIKWID_MARKER_STOP("v_PhysInterp1DScaled");
5698 timer.AccumulateRegion("Collections:PhysInterp1DScaled", 10);
5699}
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:402

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::StdRegions::eFactorConst, Nektar::Collections::ePhysInterp1DScaled, Nektar::VarcoeffHashingTest::factors, LIKWID_MARKER_START, LIKWID_MARKER_STOP, m_coll_phys_offset, 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 3043 of file ExpList.cpp.

3044{
3045 // Reset matrix managers.
3046 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3047 LocalRegions::MatrixKey::opLess>::ClearManager();
3048 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3049 LocalRegions::MatrixKey::opLess>::ClearManager();
3050
3051 // Loop over all elements and reset geometry information.
3052 for (int i = 0; i < m_exp->size(); ++i)
3053 {
3054 (*m_exp)[i]->GetGeom()->Reset(m_graph->GetCurvedEdges(),
3055 m_graph->GetCurvedFaces());
3056 }
3057
3058 // Loop over all elements and rebuild geometric factors.
3059 for (int i = 0; i < m_exp->size(); ++i)
3060 {
3061 (*m_exp)[i]->Reset();
3062 }
3063}
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
Definition: NekTypeDefs.hpp:68
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat

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

4821{
4823 "v_setBndCondBwdWeight is not defined for this class type");
4824}

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

3650{
3652 "This method is not defined or valid for this class type");
3653}

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

5174{
5175 for (int i = 0; i < m_exp->size(); ++i)
5176 {
5177 for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
5178 {
5179 (*m_exp)[i]->ComputeTraceNormal(j);
5180 }
5181 }
5182}

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

2201{
2202 // Do nothing unless the method is implemented in the appropriate
2203 // class, i.e. ContField1D,ContField2D, etc.
2204
2205 // So far it has been implemented just for ContField2D and
2206 // ContField3DHomogeneous1D
2207
2208 // Block in case users try the smoothing with a modal expansion.
2209 // Maybe a different techique for the smoothing require
2210 // implementation for modal basis.
2211
2212 ASSERTL0((*m_exp)[0]->GetBasisType(0) == LibUtilities::eGLL_Lagrange ||
2213 (*m_exp)[0]->GetBasisType(0) == LibUtilities::eGauss_Lagrange,
2214 "Smoothing is currently not allowed unless you are using "
2215 "a nodal base for efficiency reasons. The implemented "
2216 "smoothing technique requires the mass matrix inversion "
2217 "which is trivial just for GLL_LAGRANGE_SEM and "
2218 "GAUSS_LAGRANGE_SEMexpansions.");
2219}

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

3685{
3687 "UnsetGlobalLinSys not implemented for ExpList.");
3688}

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

4168{
4170 "This method is not defined or valid for this class type");
4171 static std::shared_ptr<ExpList> result;
4172 return result;
4173}

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

5390{
5392 "This method is not defined or valid for this class type");
5393 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
5394 return result;
5395}

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

4189{
4190 switch (m_expType)
4191 {
4192 case e1D:
4193 {
4194 int i, j, k, e_npoints, offset;
4195 Array<OneD, NekDouble> normals;
4196 NekDouble Vn;
4197
4198 // Assume whole array is of same coordimate dimension
4199 int coordim = GetCoordim(0);
4200
4201 ASSERTL1(Vec.size() >= coordim,
4202 "Input vector does not have sufficient dimensions to "
4203 "match coordim");
4204
4205 // Process each expansion
4206 for (i = 0; i < m_exp->size(); ++i)
4207 {
4208 // Get the number of points in the expansion and the normals.
4209 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4210 normals = (*m_exp)[i]->GetPhysNormals();
4211
4212 // Get the physical data offset of the expansion in m_phys.
4213 offset = m_phys_offset[i];
4214
4215 // Compute each data point.
4216 for (j = 0; j < e_npoints; ++j)
4217 {
4218 // Calculate normal velocity.
4219 Vn = 0.0;
4220 for (k = 0; k < coordim; ++k)
4221 {
4222 Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
4223 }
4224
4225 // Upwind based on direction of normal velocity.
4226 if (Vn > 0.0)
4227 {
4228 Upwind[offset + j] = Fwd[offset + j];
4229 }
4230 else
4231 {
4232 Upwind[offset + j] = Bwd[offset + j];
4233 }
4234 }
4235 }
4236 }
4237 break;
4238 default:
4240 "This method is not defined or valid for this class type");
4241 break;
4242 }
4243}

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

4262{
4263 ASSERTL1(Vn.size() >= m_npoints, "Vn is not of sufficient length");
4264 ASSERTL1(Fwd.size() >= m_npoints, "Fwd is not of sufficient length");
4265 ASSERTL1(Bwd.size() >= m_npoints, "Bwd is not of sufficient length");
4266 ASSERTL1(Upwind.size() >= m_npoints, "Upwind is not of sufficient length");
4267
4268 // Process each point in the expansion.
4269 for (int j = 0; j < m_npoints; ++j)
4270 {
4271 // Upwind based on one-dimensional velocity.
4272 if (Vn[j] > 0.0)
4273 {
4274 Upwind[j] = Fwd[j];
4275 }
4276 else
4277 {
4278 Upwind[j] = Bwd[j];
4279 }
4280 }
4281}

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

3607{
3608 NekDouble flux = 0.0;
3609 int i = 0;
3610 int j;
3611
3612 for (i = 0; i < (*m_exp).size(); ++i)
3613 {
3614 Array<OneD, Array<OneD, NekDouble>> tmp(inarray.size());
3615 for (j = 0; j < inarray.size(); ++j)
3616 {
3617 tmp[j] = Array<OneD, NekDouble>(inarray[j] + m_phys_offset[i]);
3618 }
3619 flux += (*m_exp)[i]->VectorFlux(tmp);
3620 }
3621
3622 return flux;
3623}

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

3202{
3203 int i, j, k, l;
3204 int nbase = (*m_exp)[0]->GetNumBases();
3205 int cnt = 0;
3206
3207 std::shared_ptr<LocalRegions::ExpansionVector> exp = m_exp;
3208
3209 if (expansion != -1)
3210 {
3211 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
3213 (*exp)[0] = (*m_exp)[expansion];
3214 }
3215
3216 if (nbase == 2)
3217 {
3218 for (i = 0; i < (*exp).size(); ++i)
3219 {
3220 const int np0 = (*exp)[i]->GetNumPoints(0);
3221 const int np1 = (*exp)[i]->GetNumPoints(1);
3222
3223 for (j = 1; j < np1; ++j)
3224 {
3225 for (k = 1; k < np0; ++k)
3226 {
3227 outfile << cnt + (j - 1) * np0 + k << " ";
3228 outfile << cnt + (j - 1) * np0 + k + 1 << " ";
3229 outfile << cnt + j * np0 + k + 1 << " ";
3230 outfile << cnt + j * np0 + k << endl;
3231 }
3232 }
3233
3234 cnt += np0 * np1;
3235 }
3236 }
3237 else if (nbase == 3)
3238 {
3239 for (i = 0; i < (*exp).size(); ++i)
3240 {
3241 const int np0 = (*exp)[i]->GetNumPoints(0);
3242 const int np1 = (*exp)[i]->GetNumPoints(1);
3243 const int np2 = (*exp)[i]->GetNumPoints(2);
3244 const int np01 = np0 * np1;
3245
3246 for (j = 1; j < np2; ++j)
3247 {
3248 for (k = 1; k < np1; ++k)
3249 {
3250 for (l = 1; l < np0; ++l)
3251 {
3252 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
3253 << " ";
3254 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
3255 << " ";
3256 outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
3257 << " ";
3258 outfile << cnt + (j - 1) * np01 + k * np0 + l << " ";
3259 outfile << cnt + j * np01 + (k - 1) * np0 + l << " ";
3260 outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
3261 << " ";
3262 outfile << cnt + j * np01 + k * np0 + l + 1 << " ";
3263 outfile << cnt + j * np01 + k * np0 + l << endl;
3264 }
3265 }
3266 }
3267 cnt += np0 * np1 * np2;
3268 }
3269 }
3270 else
3271 {
3272 NEKERROR(ErrorUtil::efatal, "Not set up for this dimension");
3273 }
3274}
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 3281 of file ExpList.cpp.

3282{
3283 if (expansion == -1)
3284 {
3285 int totpoints = GetTotPoints();
3286 if (m_physState == false)
3287 {
3289 }
3290
3291 for (int i = 0; i < totpoints; ++i)
3292 {
3293 outfile << m_phys[i] << " ";
3294 if (i % 1000 == 0 && i)
3295 {
3296 outfile << std::endl;
3297 }
3298 }
3299 outfile << std::endl;
3300 }
3301 else
3302 {
3303 int nPoints = (*m_exp)[expansion]->GetTotPoints();
3304
3305 for (int i = 0; i < nPoints; ++i)
3306 {
3307 outfile << m_phys[i + m_phys_offset[expansion]] << " ";
3308 }
3309
3310 outfile << std::endl;
3311 }
3312}

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

3071{
3072 if (GetNumElmts() == 0)
3073 {
3074 return;
3075 }
3076
3077 int coordim = GetExp(0)->GetCoordim();
3078 char vars[3] = {'x', 'y', 'z'};
3079
3080 if (m_expType == e3DH1D)
3081 {
3082 coordim += 1;
3083 }
3084 else if (m_expType == e3DH2D)
3085 {
3086 coordim += 2;
3087 }
3088
3089 outfile << "Variables = x";
3090 for (int i = 1; i < coordim; ++i)
3091 {
3092 outfile << ", " << vars[i];
3093 }
3094
3095 if (var.size() > 0)
3096 {
3097 outfile << ", " << var;
3098 }
3099
3100 outfile << std::endl << std::endl;
3101}

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

3109{
3110 int i, j;
3111 int coordim = GetCoordim(0);
3112 int nPoints = GetTotPoints();
3113 int nBases = (*m_exp)[0]->GetNumBases();
3114 int numBlocks = 0;
3115
3116 Array<OneD, Array<OneD, NekDouble>> coords(3);
3117
3118 if (expansion == -1)
3119 {
3120 nPoints = GetTotPoints();
3121
3122 coords[0] = Array<OneD, NekDouble>(nPoints);
3123 coords[1] = Array<OneD, NekDouble>(nPoints);
3124 coords[2] = Array<OneD, NekDouble>(nPoints);
3125
3126 GetCoords(coords[0], coords[1], coords[2]);
3127
3128 for (i = 0; i < m_exp->size(); ++i)
3129 {
3130 int numInt = 1;
3131
3132 for (j = 0; j < nBases; ++j)
3133 {
3134 numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
3135 }
3136
3137 numBlocks += numInt;
3138 }
3139 }
3140 else
3141 {
3142 nPoints = (*m_exp)[expansion]->GetTotPoints();
3143
3144 coords[0] = Array<OneD, NekDouble>(nPoints);
3145 coords[1] = Array<OneD, NekDouble>(nPoints);
3146 coords[2] = Array<OneD, NekDouble>(nPoints);
3147
3148 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3149
3150 numBlocks = 1;
3151 for (j = 0; j < nBases; ++j)
3152 {
3153 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
3154 }
3155 }
3156
3157 if (m_expType == e3DH1D)
3158 {
3159 nBases += 1;
3160 coordim += 1;
3161 int nPlanes = GetZIDs().size();
3162 NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
3163 numBlocks = (int)tmp;
3164 }
3165 else if (m_expType == e3DH2D)
3166 {
3167 nBases += 2;
3168 coordim += 1;
3169 }
3170
3171 outfile << "Zone, N=" << nPoints << ", E=" << numBlocks << ", F=FEBlock";
3172
3173 switch (nBases)
3174 {
3175 case 2:
3176 outfile << ", ET=QUADRILATERAL" << std::endl;
3177 break;
3178 case 3:
3179 outfile << ", ET=BRICK" << std::endl;
3180 break;
3181 default:
3182 NEKERROR(ErrorUtil::efatal, "Not set up for this type of output");
3183 break;
3184 }
3185
3186 // Write out coordinates
3187 for (j = 0; j < coordim; ++j)
3188 {
3189 for (i = 0; i < nPoints; ++i)
3190 {
3191 outfile << coords[j][i] << " ";
3192 if (i % 1000 == 0 && i)
3193 {
3194 outfile << std::endl;
3195 }
3196 }
3197 outfile << std::endl;
3198 }
3199}
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:585
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 3468 of file ExpList.cpp.

3470{
3471 int i;
3472 int nq = (*m_exp)[expansion]->GetTotPoints();
3473
3474 // printing the fields of that zone
3475 outfile << R"( <DataArray type="Float64" Name=")" << var << "\">"
3476 << endl;
3477 outfile << " ";
3478
3479 const Array<OneD, NekDouble> phys = m_phys + m_phys_offset[expansion];
3480
3481 for (i = 0; i < nq; ++i)
3482 {
3483 outfile << (fabs(phys[i]) < NekConstants::kNekZeroTol ? 0 : phys[i])
3484 << " ";
3485 }
3486 outfile << endl;
3487 outfile << " </DataArray>" << endl;
3488}
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 3328 of file ExpList.cpp.

3330{
3331 int i, j, k;
3332 int nbase = (*m_exp)[expansion]->GetNumBases();
3333 int ntot = (*m_exp)[expansion]->GetTotPoints();
3334 int nquad[3];
3335
3336 int ntotminus = 1;
3337 for (i = 0; i < nbase; ++i)
3338 {
3339 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
3340 ntotminus *= (nquad[i] - 1);
3341 }
3342
3343 Array<OneD, NekDouble> coords[3];
3344 coords[0] = Array<OneD, NekDouble>(ntot, 0.0);
3345 coords[1] = Array<OneD, NekDouble>(ntot, 0.0);
3346 coords[2] = Array<OneD, NekDouble>(ntot, 0.0);
3347 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3348
3349 outfile << " <Piece NumberOfPoints=\"" << ntot << "\" NumberOfCells=\""
3350 << ntotminus << "\">" << endl;
3351 outfile << " <Points>" << endl;
3352 outfile << " <DataArray type=\"Float64\" "
3353 << R"(NumberOfComponents="3" format="ascii">)" << endl;
3354 outfile << " ";
3355 for (i = 0; i < ntot; ++i)
3356 {
3357 for (j = 0; j < 3; ++j)
3358 {
3359 outfile << setprecision(8) << scientific << (float)coords[j][i]
3360 << " ";
3361 }
3362 outfile << endl;
3363 }
3364 outfile << endl;
3365 outfile << " </DataArray>" << endl;
3366 outfile << " </Points>" << endl;
3367 outfile << " <Cells>" << endl;
3368 outfile << " <DataArray type=\"Int32\" "
3369 << R"(Name="connectivity" format="ascii">)" << endl;
3370
3371 int ns = 0; // pow(2,dim) for later usage
3372 string ostr;
3373 switch (m_expType)
3374 {
3375 case e1D:
3376 {
3377 ns = 2;
3378 ostr = "3 ";
3379 for (i = 0; i < nquad[0] - 1; ++i)
3380 {
3381 outfile << i << " " << i + 1 << endl;
3382 }
3383 }
3384 break;
3385 case e2D:
3386 {
3387 ns = 4;
3388 ostr = "9 ";
3389 for (i = 0; i < nquad[0] - 1; ++i)
3390 {
3391 for (j = 0; j < nquad[1] - 1; ++j)
3392 {
3393 outfile << j * nquad[0] + i << " " << j * nquad[0] + i + 1
3394 << " " << (j + 1) * nquad[0] + i + 1 << " "
3395 << (j + 1) * nquad[0] + i << endl;
3396 }
3397 }
3398 }
3399 break;
3400 case e3D:
3401 {
3402 ns = 8;
3403 ostr = "12 ";
3404 for (i = 0; i < nquad[0] - 1; ++i)
3405 {
3406 for (j = 0; j < nquad[1] - 1; ++j)
3407 {
3408 for (k = 0; k < nquad[2] - 1; ++k)
3409 {
3410 outfile
3411 << k * nquad[0] * nquad[1] + j * nquad[0] + i << " "
3412 << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3413 << " "
3414 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3415 i + 1
3416 << " "
3417 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3418 << " "
3419 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3420 << " "
3421 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3422 i + 1
3423 << " "
3424 << (k + 1) * nquad[0] * nquad[1] +
3425 (j + 1) * nquad[0] + i + 1
3426 << " "
3427 << (k + 1) * nquad[0] * nquad[1] +
3428 (j + 1) * nquad[0] + i
3429 << " " << endl;
3430 }
3431 }
3432 }
3433 }
3434 break;
3435 default:
3436 break;
3437 }
3438
3439 outfile << endl;
3440 outfile << " </DataArray>" << endl;
3441 outfile << " <DataArray type=\"Int32\" "
3442 << R"(Name="offsets" format="ascii">)" << endl;
3443 for (i = 0; i < ntotminus; ++i)
3444 {
3445 outfile << i * ns + ns << " ";
3446 }
3447 outfile << endl;
3448 outfile << " </DataArray>" << endl;
3449 outfile << " <DataArray type=\"UInt8\" "
3450 << R"(Name="types" format="ascii">)" << endl;
3451 for (i = 0; i < ntotminus; ++i)
3452 {
3453 outfile << ostr;
3454 }
3455 outfile << endl;
3456 outfile << " </DataArray>" << endl;
3457 outfile << " </Cells>" << endl;
3458 outfile << " <PointData>" << endl;
3459}

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 563 of file ExpList.h.

564 {
565 return v_VectorFlux(inarray);
566 }
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Definition: ExpList.cpp:3605

References v_VectorFlux().

◆ WriteTecplotConnectivity()

void Nektar::MultiRegions::ExpList::WriteTecplotConnectivity ( std::ostream &  outfile,
int  expansion = -1 
)
inline

Definition at line 403 of file ExpList.h.

404 {
405 v_WriteTecplotConnectivity(outfile, expansion);
406 }
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3201

References v_WriteTecplotConnectivity().

◆ WriteTecplotField()

void Nektar::MultiRegions::ExpList::WriteTecplotField ( std::ostream &  outfile,
int  expansion = -1 
)
inline

Definition at line 399 of file ExpList.h.

400 {
401 v_WriteTecplotField(outfile, expansion);
402 }
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3281

References v_WriteTecplotField().

◆ WriteTecplotHeader()

void Nektar::MultiRegions::ExpList::WriteTecplotHeader ( std::ostream &  outfile,
std::string  var = "" 
)
inline

Definition at line 391 of file ExpList.h.

392 {
393 v_WriteTecplotHeader(outfile, var);
394 }
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:3070

References v_WriteTecplotHeader().

◆ WriteTecplotZone()

void Nektar::MultiRegions::ExpList::WriteTecplotZone ( std::ostream &  outfile,
int  expansion = -1 
)
inline

Definition at line 395 of file ExpList.h.

396 {
397 v_WriteTecplotZone(outfile, expansion);
398 }
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3108

References v_WriteTecplotZone().

◆ WriteVtkFooter()

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

Definition at line 3322 of file ExpList.cpp.

3323{
3324 outfile << " </UnstructuredGrid>" << endl;
3325 outfile << "</VTKFile>" << endl;
3326}

◆ WriteVtkHeader()

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

Definition at line 3314 of file ExpList.cpp.

3315{
3316 outfile << "<?xml version=\"1.0\"?>" << endl;
3317 outfile << R"(<VTKFile type="UnstructuredGrid" version="0.1" )"
3318 << "byte_order=\"LittleEndian\">" << endl;
3319 outfile << " <UnstructuredGrid>" << endl;
3320}

◆ WriteVtkPieceData()

void Nektar::MultiRegions::ExpList::WriteVtkPieceData ( std::ostream &  outfile,
int  expansion,
std::string  var = "v" 
)
inline

Definition at line 416 of file ExpList.h.

418 {
419 v_WriteVtkPieceData(outfile, expansion, var);
420 }
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:3468

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

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

Definition at line 3461 of file ExpList.cpp.

3463{
3464 outfile << " </PointData>" << endl;
3465 outfile << " </Piece>" << endl;
3466}

◆ WriteVtkPieceHeader()

void Nektar::MultiRegions::ExpList::WriteVtkPieceHeader ( std::ostream &  outfile,
int  expansion,
int  istrip = 0 
)
inline

Definition at line 409 of file ExpList.h.

411 {
412 v_WriteVtkPieceHeader(outfile, expansion, istrip);
413 }
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:3328

References v_WriteVtkPieceHeader().

Member Data Documentation

◆ m_blockMat

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

Definition at line 1129 of file ExpList.h.

Referenced by GetBlockMatrix().

◆ 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 1080 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 1128 of file ExpList.h.

Referenced by GetCoeffsToElmt(), and SetupCoeffPhys().

◆ m_coll_coeff_offset

std::vector<int> Nektar::MultiRegions::ExpList::m_coll_coeff_offset
protected

Offset of elemental data into the array m_coeffs.

Definition at line 1120 of file ExpList.h.

Referenced by CreateCollections().

◆ m_coll_phys_offset

std::vector<int> Nektar::MultiRegions::ExpList::m_coll_phys_offset
protected

Offset of elemental data into the array m_phys.

Definition at line 1122 of file ExpList.h.

Referenced by CreateCollections(), GeneralMatrixOp(), and v_PhysInterp1DScaled().

◆ 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 1118 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 1115 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 1096 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 1104 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