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...
 
void SetPhys (int i, NekDouble val)
 Set the i th value of m_phys to value val. 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 (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...
 
void 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...
 
void LinearAdvectionDiffusionReactionSolve (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 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 Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
void HomogeneousBwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
void DealiasedProd (const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
 
void DealiasedDotProd (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 (void)
 Fill Bnd Condition expansion from the values stored in expansion. More...
 
void FillBndCondFromField (const int nreg)
 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_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 ()
 
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...
 
int 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::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 global list of m_coeffs correspoinding to element n. More...
 
int GetPhys_Offset (int n) const
 Get the start offset position for a global list of m_phys correspoinding to element n. More...
 
Array< OneD, NekDouble > & UpdateCoeffs ()
 This function returns (a reference to) the array \(\boldsymbol{\hat{u}}_l\) (implemented as m_coeffs) containing all local expansion coefficients. More...
 
Array< OneD, NekDouble > & UpdatePhys ()
 This function returns (a reference to) the array \(\boldsymbol{u}_l\) (implemented as m_phys) containing the function \(u^{\delta}(\boldsymbol{x})\) evaluated at the quadrature points. More...
 
void PhysDeriv (Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 This function discretely evaluates the derivative of a function \(f(\boldsymbol{x})\) on the domain consisting of all elements of the expansion. More...
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
void CurlCurl (Array< OneD, Array< OneD, NekDouble >> &Vel, Array< OneD, Array< OneD, NekDouble >> &Q)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetMovingFrames (const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions ()
 
const Array< OneD, const NekDouble > & GetBndCondBwdWeight ()
 Get the weight value for boundary conditions. More...
 
void SetBndCondBwdWeight (const int index, const NekDouble value)
 Set the weight value for boundary conditions. More...
 
std::shared_ptr< ExpList > & UpdateBndCondExpansion (int i)
 
void Upwind (const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
void Upwind (const Array< OneD, const Array< OneD, NekDouble >> &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
std::shared_ptr< ExpList > & GetTrace ()
 
std::shared_ptr< AssemblyMapDG > & GetTraceMap (void)
 
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 > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
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)
 
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)
 Extract the data in fielddata into the coeffs. More...
 
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)
 
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)
 

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 int 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 > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
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 void 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 void v_LinearAdvectionDiffusionReactionSolve (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_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 ()
 
virtual void v_FillBndCondFromField (const int nreg)
 
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_GetCoords (Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, 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_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 Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
virtual void v_HomogeneousBwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
virtual void v_DealiasedProd (const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
 
virtual void v_DealiasedDotProd (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)
 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_WriteVtkPieceHeader (std::ostream &outfile, int expansion, int istrip)
 
virtual void v_WriteVtkPieceData (std::ostream &outfile, int expansion, std::string var)
 
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)
 
void ExtractFileBCs (const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
 

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

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. The coefficients from these expansions are concatenated in m_coeffs, while the expansion evaluated at the quadrature points is stored in m_phys.

Definition at line 100 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 104 of file ExpList.cpp.

105  : m_expType(type), m_ncoeffs(0), m_npoints(0), m_physState(false),
108  m_WaveSpace(false)
109 {
110 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1218
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1184
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1196
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1136
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1119

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

121  : std::enable_shared_from_this<ExpList>(in), m_expType(in.m_expType),
122  m_comm(in.m_comm), m_session(in.m_session), m_graph(in.m_graph),
123  m_ncoeffs(in.m_ncoeffs), m_npoints(in.m_npoints), m_physState(false),
124  m_exp(in.m_exp), m_collections(in.m_collections),
125  m_collectionsDoInit(in.m_collectionsDoInit),
126  m_coll_coeff_offset(in.m_coll_coeff_offset),
127  m_coll_phys_offset(in.m_coll_phys_offset),
128  m_coeff_offset(in.m_coeff_offset), m_phys_offset(in.m_phys_offset),
129  m_blockMat(in.m_blockMat), m_WaveSpace(false)
130 {
131 
132  // Set up m_coeffs, m_phys and offset arrays.
133  // use this to keep memory declaration in one place
134  SetupCoeffPhys(DeclareCoeffPhysArrays, false);
135 }
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:1092
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1210
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition: ExpList.h:1201
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1207
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1126
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1132
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1204
Collections::CollectionVector m_collections
Definition: ExpList.h:1198
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1129
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1213

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

145  : m_expType(in.m_expType), m_comm(in.m_comm), m_session(in.m_session),
146  m_graph(in.m_graph), m_physState(false),
149  m_WaveSpace(false)
150 {
151  for (int i = 0; i < eIDs.size(); ++i)
152  {
153  (*m_exp).push_back((*(in.m_exp))[eIDs[i]]);
154  }
155 
156  // Set up m_coeffs, m_phys and offset arrays.
157  SetupCoeffPhys(DeclareCoeffPhysArrays);
158 
159  // set up collections
160  CreateCollections(ImpType);
161 }
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:5071

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 allocates memory for the arrays m_coeffs and m_phys.

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

187  : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
188  m_physState(false),
191  m_WaveSpace(false)
192 {
193  // Retrieve the list of expansions
194  const SpatialDomains::ExpansionInfoMap &expansions =
195  graph->GetExpansionInfo(var);
196 
197  // Initialise Expansionn Vector
198  InitialiseExpVector(expansions);
199 
200  // Setup phys coeff space
201  SetupCoeffPhys(DeclareCoeffPhysArrays);
202 
203  // Initialise collection
204  CreateCollections(ImpType);
205 }
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
Definition: ExpList.cpp:1135
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition: MeshGraph.h:143

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\) and allocates memory for the arrays m_coeffs and m_phys.

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

230  : m_comm(pSession->GetComm()), m_session(pSession), m_physState(false),
233  m_WaveSpace(false)
234 {
235 
236  // Initialise expansion vector
237  InitialiseExpVector(expansions);
238 
239  // Set up m_coeffs, m_phys and offset arrays.
240  SetupCoeffPhys(DeclareCoeffPhysArrays);
241 
242  // Setup Collection
243  CreateCollections(ImpType);
244 }

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

777  : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
778  m_physState(false),
781  m_WaveSpace(false)
782 {
783  boost::ignore_unused(variable, ImpType);
784  int i, j, elmtid = 0;
785 
792 
798 
799  for (i = 0; i < locexp.size(); ++i)
800  {
801  if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
802  locexp[i])))
803  {
804  m_expType = e0D;
805 
806  for (j = 0; j < 2; ++j)
807  {
808  PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
809 
811  PointGeom);
812  exp->SetElmtId(elmtid++);
813  (*m_exp).push_back(exp);
814  }
815  }
816  else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
817  locexp[i])))
818  {
819  m_expType = e1D;
820  LibUtilities::BasisKey edgeKey0 =
821  locexp[i]->GetBasis(0)->GetBasisKey();
822 
823  for (j = 0; j < locexp[i]->GetNtraces(); ++j)
824  {
825  segGeom = exp2D->GetGeom2D()->GetEdge(j);
826 
827  int dir = exp2D->GetGeom2D()->GetDir(j);
828 
829  if (locexp[i]->GetNtraces() == 3)
830  {
831  LibUtilities::BasisKey edgeKey =
832  locexp[i]->GetBasis(dir)->GetBasisKey();
833 
834  LibUtilities::BasisKey nEdgeKey(edgeKey0.GetBasisType(),
835  edgeKey.GetNumModes(),
836  edgeKey.GetPointsKey());
837 
838  exp =
840  nEdgeKey, segGeom);
841  }
842  else
843  {
844  exp =
846  locexp[i]->GetBasis(dir)->GetBasisKey(), segGeom);
847  }
848 
849  exp->SetElmtId(elmtid++);
850  (*m_exp).push_back(exp);
851  }
852  }
853  else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
854  locexp[i])))
855  {
856  m_expType = e2D;
857 
858  LibUtilities::BasisKey face0_dir0 =
859  locexp[i]->GetBasis(0)->GetBasisKey();
860  LibUtilities::BasisKey face0_dir1 =
861  locexp[i]->GetBasis(1)->GetBasisKey();
862 
863  for (j = 0; j < exp3D->GetNtraces(); ++j)
864  {
865  FaceGeom = exp3D->GetGeom3D()->GetFace(j);
866 
867  int dir0 = exp3D->GetGeom3D()->GetDir(j, 0);
868  int dir1 = exp3D->GetGeom3D()->GetDir(j, 1);
869 
870  LibUtilities::BasisKey face_dir0 =
871  locexp[i]->GetBasis(dir0)->GetBasisKey();
872  LibUtilities::BasisKey face_dir1 =
873  locexp[i]->GetBasis(dir1)->GetBasisKey();
874 
875  if ((QuadGeom =
876  std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
877  FaceGeom)))
878  {
879  exp =
881  face_dir0, face_dir1, QuadGeom);
882  }
883  else if ((TriGeom = std::dynamic_pointer_cast<
884  SpatialDomains::TriGeom>(FaceGeom)))
885  {
886 
887  LibUtilities::BasisKey nface_dir0(face0_dir0.GetBasisType(),
888  face_dir0.GetNumModes(),
889  face_dir0.GetPointsKey());
890  LibUtilities::BasisKey nface_dir1(face0_dir1.GetBasisType(),
891  face_dir1.GetNumModes(),
892  face_dir1.GetPointsKey());
893  exp =
895  nface_dir0, nface_dir1, TriGeom);
896  }
897  exp->SetElmtId(elmtid++);
898  (*m_exp).push_back(exp);
899  }
900  }
901  }
902 
903  // Set up m_coeffs, m_phys and offset arrays.
904  SetupCoeffPhys(DeclareCoeffPhysArrays);
905 
906  // Set up collections
907  if (m_expType != e0D)
908  {
909  CreateCollections(ImpType);
910  }
911 }
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:47
std::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:48
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:51
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:50
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:46
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:63

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

942  : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
945  m_WaveSpace(false)
946 {
947  int j, elmtid = 0;
952 
954 
956 
957  int meshdim = graph->GetMeshDimension();
958 
959  // Retrieve the list of expansions (needed of meshdim == 1
960  const SpatialDomains::ExpansionInfoMap &expansions =
961  graph->GetExpansionInfo(variable);
962 
963  // Retrieve the list of expansions
964  // Process each composite region.
965  for (auto &compIt : domain)
966  {
967  // Process each expansion in the region.
968  for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
969  {
970  if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
971  compIt.second->m_geomVec[j])))
972  {
973  m_expType = e0D;
974 
976  PtGeom);
977  }
978  else if ((SegGeom =
979  std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
980  compIt.second->m_geomVec[j])))
981  {
982  m_expType = e1D;
983 
984  // Retrieve the basis key from the expansion.
985  LibUtilities::BasisKey bkey = LibUtilities::NullBasisKey;
986 
987  if (meshdim == 1)
988  {
989  auto expIt = expansions.find(SegGeom->GetGlobalID());
990  ASSERTL0(expIt != expansions.end(),
991  "Failed to find basis key");
992  bkey = expIt->second->m_basisKeyVector[0];
993  }
994  else
995  {
996  bkey = graph->GetEdgeBasisKey(SegGeom, variable);
997  }
998 
999  if (SetToOneSpaceDimension)
1000  {
1001  SpatialDomains::SegGeomSharedPtr OneDSegmentGeom =
1002  SegGeom->GenerateOneSpaceDimGeom();
1003 
1004  exp =
1006  bkey, OneDSegmentGeom);
1007  }
1008  else
1009  {
1010 
1011  exp =
1013  bkey, SegGeom);
1014  }
1015  }
1016  else if ((TriGeom =
1017  std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1018  compIt.second->m_geomVec[j])))
1019  {
1020  m_expType = e2D;
1021 
1022  LibUtilities::BasisKey TriBa =
1023  graph->GetFaceBasisKey(TriGeom, 0, variable);
1024  LibUtilities::BasisKey TriBb =
1025  graph->GetFaceBasisKey(TriGeom, 1, variable);
1026 
1027  if (graph->GetExpansionInfo()
1028  .begin()
1029  ->second->m_basisKeyVector[0]
1030  .GetBasisType() == LibUtilities::eGLL_Lagrange)
1031  {
1032  NEKERROR(ErrorUtil::efatal, "This method needs sorting");
1034 
1035  exp = MemoryManager<
1036  LocalRegions::NodalTriExp>::AllocateSharedPtr(TriBa,
1037  TriBb,
1038  TriNb,
1039  TriGeom);
1040  }
1041  else
1042  {
1043  exp =
1045  TriBa, TriBb, TriGeom);
1046  }
1047  }
1048  else if ((QuadGeom =
1049  std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1050  compIt.second->m_geomVec[j])))
1051  {
1052  m_expType = e2D;
1053 
1054  LibUtilities::BasisKey QuadBa =
1055  graph->GetFaceBasisKey(QuadGeom, 0, variable);
1056  LibUtilities::BasisKey QuadBb =
1057  graph->GetFaceBasisKey(QuadGeom, 1, variable);
1058 
1060  QuadBa, QuadBb, QuadGeom);
1061  }
1062  else
1063  {
1065  "dynamic cast to a Geom (possibly 3D) failed");
1066  }
1067 
1068  exp->SetElmtId(elmtid++);
1069  (*m_exp).push_back(exp);
1070  }
1071  }
1072 
1073  // Set up m_coeffs, m_phys and offset arrays.
1074  SetupCoeffPhys(DeclareCoeffPhysArrays);
1075 
1076  if (m_expType != e0D)
1077  {
1078  CreateCollections(ImpType);
1079  }
1080 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
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:83
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:58
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62

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::eNodalTriElec, m_expType, NEKERROR, Nektar::LibUtilities::NullBasisKey(), and SetupCoeffPhys().

◆ ~ExpList()

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

The default destructor.

Definition at line 1308 of file ExpList.cpp.

1309 {
1310 }

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

2355 {
2356  v_AddFwdBwdTraceIntegral(Fwd, Bwd, outarray);
2357 }
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4371

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

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

Definition at line 5860 of file ExpList.cpp.

5863 {
5864  int nelmt;
5865  int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
5866 
5867  nelmtcoef = GetNcoeffs(0);
5868  nelmtpnts = GetTotPoints(0);
5869 
5870  Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
5871  Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
5872 
5873  Array<OneD, NekDouble> MatQ_data;
5874  Array<OneD, NekDouble> MatC_data;
5875 
5876  DNekMatSharedPtr tmpMatQ, tmpMatC;
5877 
5878  nelmtcoef0 = nelmtcoef;
5879  nelmtpnts0 = nelmtpnts;
5880 
5881  for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5882  {
5883  nelmtcoef = GetNcoeffs(nelmt);
5884  nelmtpnts = GetTotPoints(nelmt);
5885 
5886  tmpMatQ = ElmtJacQuad[nelmt];
5887  tmpMatC = ElmtJacCoef[nelmt];
5888 
5889  MatQ_data = tmpMatQ->GetPtr();
5890  MatC_data = tmpMatC->GetPtr();
5891 
5892  if (nelmtcoef != nelmtcoef0)
5893  {
5894  outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
5895  nelmtcoef0 = nelmtcoef;
5896  }
5897 
5898  if (nelmtpnts != nelmtpnts0)
5899  {
5900  innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
5901  nelmtpnts0 = nelmtpnts;
5902  }
5903 
5904  for (int np = 0; np < nelmtcoef; np++)
5905  {
5906  Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
5907  1);
5908  (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
5909  (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
5910 
5911  Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
5912  nelmtcoef, &MatC_data[0] + np, nelmtcoef);
5913  }
5914  }
5915 }
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1641
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1688
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.cpp:359
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1255

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

5806 {
5807  int nelmt;
5808  int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
5809 
5810  nelmtcoef = GetNcoeffs(0);
5811  nelmtpnts = GetTotPoints(0);
5812 
5813  Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
5814  Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
5815 
5816  Array<OneD, NekDouble> MatQ_data;
5817  Array<OneD, NekDouble> MatC_data;
5818 
5819  DNekMatSharedPtr tmpMatQ, tmpMatC;
5820 
5821  nelmtcoef0 = nelmtcoef;
5822  nelmtpnts0 = nelmtpnts;
5823 
5824  for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5825  {
5826  nelmtcoef = GetNcoeffs(nelmt);
5827  nelmtpnts = GetTotPoints(nelmt);
5828 
5829  tmpMatQ = ElmtJacQuad[nelmt];
5830  tmpMatC = ElmtJacCoef[nelmt];
5831 
5832  MatQ_data = tmpMatQ->GetPtr();
5833  MatC_data = tmpMatC->GetPtr();
5834 
5835  if (nelmtcoef != nelmtcoef0)
5836  {
5837  outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
5838  nelmtcoef0 = nelmtcoef;
5839  }
5840 
5841  if (nelmtpnts != nelmtpnts0)
5842  {
5843  innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
5844  nelmtpnts0 = nelmtpnts;
5845  }
5846 
5847  for (int np = 0; np < nelmtcoef; np++)
5848  {
5849  Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
5850  1);
5851  (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
5852  (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
5853 
5854  Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
5855  nelmtcoef, &MatC_data[0] + np, nelmtcoef);
5856  }
5857  }
5858 }

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

◆ AddTraceIntegral() [1/2]

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

Definition at line 2346 of file ExpList.h.

2348 {
2349  v_AddTraceIntegral(Fn, outarray);
2350 }
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4354

References v_AddTraceIntegral().

◆ AddTraceIntegral() [2/2]

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

Definition at line 2339 of file ExpList.h.

2342 {
2343  v_AddTraceIntegral(Fx, Fy, outarray);
2344 }

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

1097  {
1098  v_AddTraceIntegralToOffDiag(FwdFlux, BwdFlux, outarray);
1099  }
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5344

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

5571 {
5573  std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
5574  tracelist->GetExp();
5575  int ntotTrace = (*traceExp).size();
5576  int nTracePnt, nTraceCoef;
5577 
5578  std::shared_ptr<LocalRegions::ExpansionVector> fieldExp = GetExp();
5579  int nElmtCoef;
5580 
5581  const MultiRegions::LocTraceToTraceMapSharedPtr locTraceToTraceMap =
5583  const Array<OneD, const Array<OneD, int>> LRAdjExpid =
5584  locTraceToTraceMap->GetLeftRightAdjacentExpId();
5585  const Array<OneD, const Array<OneD, bool>> LRAdjflag =
5586  locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
5587 
5588  const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRMap =
5589  locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
5590  const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRSign =
5591  locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
5592  DNekMatSharedPtr ElmtMat;
5593  Array<OneD, NekDouble> ElmtMat_data;
5594  // int nclAdjExp;
5595  int nrwAdjExp;
5596  int MatIndex, nPnts;
5597  NekDouble sign = 1.0;
5598 
5599  int nTracePntsTtl = tracelist->GetTotPoints();
5600  int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
5601  int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
5602  int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
5603 
5604  Array<OneD, int> nlocTracePtsLR(2);
5605  nlocTracePtsLR[0] = nlocTracePtsFwd;
5606  nlocTracePtsLR[1] = nlocTracePtsBwd;
5607 
5608  size_t nFwdBwdNonZero = 0;
5609  Array<OneD, int> tmpIndex{2, -1};
5610  for (int i = 0; i < 2; ++i)
5611  {
5612  if (nlocTracePtsLR[i] > 0)
5613  {
5614  tmpIndex[nFwdBwdNonZero] = i;
5615  nFwdBwdNonZero++;
5616  }
5617  }
5618 
5619  Array<OneD, int> nlocTracePtsNonZeroIndex{nFwdBwdNonZero};
5620  for (int i = 0; i < nFwdBwdNonZero; ++i)
5621  {
5622  nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
5623  }
5624 
5625  Array<OneD, NekDouble> TraceFwdPhy(nTracePntsTtl);
5626  Array<OneD, NekDouble> TraceBwdPhy(nTracePntsTtl);
5627  Array<OneD, Array<OneD, NekDouble>> tmplocTrace(2);
5628  for (int k = 0; k < 2; ++k)
5629  {
5630  tmplocTrace[k] = NullNekDouble1DArray;
5631  }
5632 
5633  for (int k = 0; k < nFwdBwdNonZero; ++k)
5634  {
5635  size_t i = nlocTracePtsNonZeroIndex[k];
5636  tmplocTrace[i] = Array<OneD, NekDouble>(nlocTracePtsLR[i]);
5637  }
5638 
5639  int nNumbElmt = fieldMat.size();
5640  Array<OneD, Array<OneD, NekDouble>> ElmtMatDataArray(nNumbElmt);
5641  Array<OneD, int> ElmtCoefArray(nNumbElmt);
5642  for (int i = 0; i < nNumbElmt; i++)
5643  {
5644  ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
5645  ElmtCoefArray[i] = GetNcoeffs(i);
5646  }
5647 
5648  int nTraceCoefMax = 0;
5649  int nTraceCoefMin = std::numeric_limits<int>::max();
5650  Array<OneD, int> TraceCoefArray(ntotTrace);
5651  Array<OneD, int> TracePntArray(ntotTrace);
5652  Array<OneD, int> TraceOffArray(ntotTrace);
5653  Array<OneD, Array<OneD, NekDouble>> FwdMatData(ntotTrace);
5654  Array<OneD, Array<OneD, NekDouble>> BwdMatData(ntotTrace);
5655  for (int nt = 0; nt < ntotTrace; nt++)
5656  {
5657  nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
5658  nTracePnt = tracelist->GetTotPoints(nt);
5659  int noffset = tracelist->GetPhys_Offset(nt);
5660  TraceCoefArray[nt] = nTraceCoef;
5661  TracePntArray[nt] = nTracePnt;
5662  TraceOffArray[nt] = noffset;
5663  FwdMatData[nt] = FwdMat[nt]->GetPtr();
5664  BwdMatData[nt] = BwdMat[nt]->GetPtr();
5665  if (nTraceCoef > nTraceCoefMax)
5666  {
5667  nTraceCoefMax = nTraceCoef;
5668  }
5669  if (nTraceCoef < nTraceCoefMin)
5670  {
5671  nTraceCoefMin = nTraceCoef;
5672  }
5673  }
5674  WARNINGL1(nTraceCoefMax == nTraceCoefMin,
5675  "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
5676 
5677  int traceID, nfieldPnts, ElmtId, noffset;
5678  const Array<OneD, const Array<OneD, int>> LocTracephysToTraceIDMap =
5679  locTraceToTraceMap->GetLocTracephysToTraceIDMap();
5680  const Array<OneD, const int> fieldToLocTraceMap =
5681  locTraceToTraceMap->GetLocTraceToFieldMap();
5682  Array<OneD, Array<OneD, int>> fieldToLocTraceMapLR(2);
5683  noffset = 0;
5684  for (int k = 0; k < nFwdBwdNonZero; ++k)
5685  {
5686  size_t i = nlocTracePtsNonZeroIndex[k];
5687  fieldToLocTraceMapLR[i] = Array<OneD, int>(nlocTracePtsLR[i]);
5688  Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
5689  &fieldToLocTraceMapLR[i][0], 1);
5690  noffset += nlocTracePtsLR[i];
5691  }
5692 
5693  Array<OneD, Array<OneD, int>> MatIndexArray(2);
5694  for (int k = 0; k < nFwdBwdNonZero; ++k)
5695  {
5696  size_t nlr = nlocTracePtsNonZeroIndex[k];
5697  MatIndexArray[nlr] = Array<OneD, int>(nlocTracePtsLR[nlr]);
5698  for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5699  {
5700  traceID = LocTracephysToTraceIDMap[nlr][nloc];
5701  nTraceCoef = TraceCoefArray[traceID];
5702  ElmtId = LRAdjExpid[nlr][traceID];
5703  noffset = GetPhys_Offset(ElmtId);
5704  nElmtCoef = ElmtCoefArray[ElmtId];
5705  nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
5706  nPnts = nfieldPnts - noffset;
5707 
5708  MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
5709  }
5710  }
5711 
5712  for (int nc = 0; nc < nTraceCoefMin; nc++)
5713  {
5714  for (int nt = 0; nt < ntotTrace; nt++)
5715  {
5716  nTraceCoef = TraceCoefArray[nt];
5717  nTracePnt = TracePntArray[nt];
5718  noffset = TraceOffArray[nt];
5719  Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
5720  &TraceFwdPhy[noffset], 1);
5721  Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
5722  &TraceBwdPhy[noffset], 1);
5723  }
5724 
5725  for (int k = 0; k < nFwdBwdNonZero; ++k)
5726  {
5727  size_t i = nlocTracePtsNonZeroIndex[k];
5728  Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
5729  }
5730 
5731  GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
5732  tmplocTrace[1]);
5733 
5734  for (int k = 0; k < nFwdBwdNonZero; ++k)
5735  {
5736  size_t nlr = nlocTracePtsNonZeroIndex[k];
5737  for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5738  {
5739  traceID = LocTracephysToTraceIDMap[nlr][nloc];
5740  nTraceCoef = TraceCoefArray[traceID];
5741  ElmtId = LRAdjExpid[nlr][traceID];
5742  nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5743  sign = elmtLRSign[nlr][traceID][nc];
5744  MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5745 
5746  ElmtMatDataArray[ElmtId][MatIndex] -=
5747  sign * tmplocTrace[nlr][nloc];
5748  }
5749  }
5750  }
5751 
5752  for (int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
5753  {
5754  for (int nt = 0; nt < ntotTrace; nt++)
5755  {
5756  nTraceCoef = TraceCoefArray[nt];
5757  nTracePnt = TracePntArray[nt];
5758  noffset = TraceOffArray[nt];
5759  if (nc < nTraceCoef)
5760  {
5761  Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
5762  &TraceFwdPhy[noffset], 1);
5763  Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
5764  &TraceBwdPhy[noffset], 1);
5765  }
5766  else
5767  {
5768  Vmath::Zero(nTracePnt, &TraceFwdPhy[noffset], 1);
5769  Vmath::Zero(nTracePnt, &TraceBwdPhy[noffset], 1);
5770  }
5771  }
5772 
5773  for (int k = 0; k < nFwdBwdNonZero; ++k)
5774  {
5775  size_t i = nlocTracePtsNonZeroIndex[k];
5776  Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
5777  }
5778  GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
5779  tmplocTrace[1]);
5780 
5781  for (int k = 0; k < nFwdBwdNonZero; ++k)
5782  {
5783  size_t nlr = nlocTracePtsNonZeroIndex[k];
5784  for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5785  {
5786  traceID = LocTracephysToTraceIDMap[nlr][nloc];
5787  nTraceCoef = TraceCoefArray[traceID];
5788  if (nc < nTraceCoef)
5789  {
5790  ElmtId = LRAdjExpid[nlr][traceID];
5791  nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5792  sign = -elmtLRSign[nlr][traceID][nc];
5793  MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5794 
5795  ElmtMatDataArray[ElmtId][MatIndex] +=
5796  sign * tmplocTrace[nlr][nloc];
5797  }
5798  }
5799  }
5800  }
5801 }
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:250
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:15
std::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2319
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition: ExpList.h:2283
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:2388
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2223
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n.
Definition: ExpList.h:2240
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.cpp:492

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

2384 {
2385  v_AddTraceQuadPhysToField(Fwd, Bwd, field);
2386 }
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4408

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

883  {
884  v_AddTraceQuadPhysToOffDiag(Fwd, Bwd, field);
885  }
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4417

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

990  {
991  v_AppendFieldData(fielddef, fielddata);
992  }
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:3506

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

999  {
1000  v_AppendFieldData(fielddef, fielddata, coeffs);
1001  }

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

2659 {
2660 }

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\). This operation is evaluated locally by the function ExpList::BwdTrans.

The coefficients of the expansion should be contained in the variable m_coeffs of the ExpList object In. The resulting physical values at the quadrature points \(u^{\delta}(\boldsymbol{x}_i)\) are stored in the array m_phys.

Parameters
InAn ExpList, containing the local coefficients \(\hat{u}_n^e\) in its array m_coeffs.

Definition at line 1849 of file ExpList.h.

1851 {
1852  v_BwdTrans(inarray, outarray);
1853 }
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2467

References v_BwdTrans().

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

◆ ClearGlobalLinSysManager()

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

Definition at line 5263 of file ExpList.cpp.

5264 {
5266 }
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3298

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

5072 {
5074  vector<std::pair<LocalRegions::ExpansionSharedPtr, int>>>
5075  collections;
5076 
5077  // Set up initialisation flags
5079  std::vector<bool>(Collections::SIZE_OperatorType, true);
5080 
5081  // Figure out optimisation parameters if provided in
5082  // session file or default given
5083  Collections::CollectionOptimisation colOpt(
5084  m_session, (*m_exp)[0]->GetShapeDimension(), ImpType);
5085  // ImpType = colOpt.GetDefaultImplementationType();
5086 
5087  // turn on autotuning if explicitly specified in xml file
5088  // or command line option is set but only do optimisation
5089  // for volumetric elements (not boundary condition)
5090  bool autotuning = colOpt.IsUsingAutotuning();
5091  if ((autotuning == false) && (ImpType == Collections::eNoImpType))
5092  {
5093  // turn on autotuning if writeoptfile specified
5094  // if m_graph available
5095  if (m_session->GetUpdateOptFile() && m_graph)
5096  {
5097  // only turn on autotuning for volumetric elements
5098  // where Mesh Dimension is equal to the Shape
5099  // Dimension of element.
5100  if (m_graph->GetMeshDimension() == (*m_exp)[0]->GetShapeDimension())
5101  {
5102  autotuning = true;
5103  }
5104  }
5105  }
5106  bool verbose = (m_session->DefinesCmdLineArgument("verbose")) &&
5107  (m_session->GetComm()->GetRank() == 0);
5108  int collmax =
5109  (colOpt.GetMaxCollectionSize() > 0 ? colOpt.GetMaxCollectionSize()
5110  : 2 * m_exp->size());
5111 
5112  // clear vectors in case previously called
5113  m_collections.clear();
5114  m_coll_coeff_offset.clear();
5115  m_coll_phys_offset.clear();
5116 
5117  // Loop over expansions, and create collections for each element type
5118  for (int i = 0; i < m_exp->size(); ++i)
5119  {
5120  collections[(*m_exp)[i]->DetShapeType()].push_back(
5121  std::pair<LocalRegions::ExpansionSharedPtr, int>((*m_exp)[i], i));
5122  }
5123 
5124  for (auto &it : collections)
5125  {
5126  LocalRegions::ExpansionSharedPtr exp = it.second[0].first;
5127 
5128  Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(exp);
5129 
5130  vector<StdRegions::StdExpansionSharedPtr> collExp;
5131 
5132  int prevCoeffOffset = m_coeff_offset[it.second[0].second];
5133  int prevPhysOffset = m_phys_offset[it.second[0].second];
5134  int collcnt;
5135 
5136  m_coll_coeff_offset.push_back(prevCoeffOffset);
5137  m_coll_phys_offset.push_back(prevPhysOffset);
5138 
5139  int collsize = 0;
5140 
5141  if (it.second.size() == 1) // single element case
5142  {
5143  collExp.push_back(it.second[0].first);
5144 
5145  // if no Imp Type provided and No
5146  // setting in xml file. reset
5147  // impTypes using timings
5148  if (autotuning)
5149  {
5150  if (collExp.size() > collsize)
5151  {
5152  impTypes =
5153  colOpt.SetWithTimings(collExp, impTypes, verbose);
5154  collsize = collExp.size();
5155  }
5156  }
5157 
5158  Collections::Collection tmp(collExp, impTypes);
5159  m_collections.push_back(tmp);
5160  }
5161  else
5162  {
5163  // set up first geometry
5164  collExp.push_back(it.second[0].first);
5165  int prevnCoeff = it.second[0].first->GetNcoeffs();
5166  int prevnPhys = it.second[0].first->GetTotPoints();
5167  bool prevDeformed =
5168  it.second[0].first->GetMetricInfo()->GetGtype() ==
5170  collcnt = 1;
5171 
5172  for (int i = 1; i < it.second.size(); ++i)
5173  {
5174  int nCoeffs = it.second[i].first->GetNcoeffs();
5175  int nPhys = it.second[i].first->GetTotPoints();
5176  bool Deformed =
5177  it.second[i].first->GetMetricInfo()->GetGtype() ==
5179  int coeffOffset = m_coeff_offset[it.second[i].second];
5180  int physOffset = m_phys_offset[it.second[i].second];
5181 
5182  // check to see if next elmt is different or
5183  // collmax reached and if so end collection
5184  // and start new one
5185  if (prevCoeffOffset + nCoeffs != coeffOffset ||
5186  prevnCoeff != nCoeffs ||
5187  prevPhysOffset + nPhys != physOffset ||
5188  prevDeformed != Deformed || prevnPhys != nPhys ||
5189  collcnt >= collmax)
5190  {
5191 
5192  // if no Imp Type provided and No
5193  // settign in xml file. reset
5194  // impTypes using timings
5195  if (autotuning)
5196  {
5197  if (collExp.size() > collsize)
5198  {
5199  impTypes = colOpt.SetWithTimings(collExp, impTypes,
5200  verbose);
5201  collsize = collExp.size();
5202  }
5203  }
5204 
5205  Collections::Collection tmp(collExp, impTypes);
5206  m_collections.push_back(tmp);
5207 
5208  // start new geom list
5209  collExp.clear();
5210 
5211  m_coll_coeff_offset.push_back(coeffOffset);
5212  m_coll_phys_offset.push_back(physOffset);
5213  collExp.push_back(it.second[i].first);
5214  collcnt = 1;
5215  }
5216  else // add to list of collections
5217  {
5218  collExp.push_back(it.second[i].first);
5219  collcnt++;
5220  }
5221 
5222  // if end of list finish up collection
5223  if (i == it.second.size() - 1)
5224  {
5225  // if no Imp Type provided and No
5226  // settign in xml file.
5227  if (autotuning)
5228  {
5229  if (collExp.size() > collsize)
5230  {
5231  impTypes = colOpt.SetWithTimings(collExp, impTypes,
5232  verbose);
5233  collsize = collExp.size();
5234  }
5235  }
5236 
5237  Collections::Collection tmp(collExp, impTypes);
5238  m_collections.push_back(tmp);
5239 
5240  collExp.clear();
5241  collcnt = 0;
5242  }
5243 
5244  prevCoeffOffset = coeffOffset;
5245  prevPhysOffset = physOffset;
5246  prevDeformed = Deformed;
5247  prevnCoeff = nCoeffs;
5248  prevnPhys = nPhys;
5249  }
5250  }
5251  }
5252 
5253  // update optimisation file
5254  if ((m_session->GetUpdateOptFile()) && (ImpType == Collections::eNoImpType))
5255  {
5256  colOpt.UpdateOptFile(m_session->GetSessionName(), m_comm);
5257  // turn off writeoptfile option so only first
5258  // instance is timed
5259  m_session->SetUpdateOptFile(false);
5260  }
5261 }
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition: ExpList.h:2064
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:112
@ eDeformed
Geometry is curved or has non-constant factors.

References 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::Collections::CollectionOptimisation::SetWithTimings(), Nektar::Collections::SIZE_OperatorType, and Nektar::Collections::CollectionOptimisation::UpdateOptFile().

Referenced by ExpList().

◆ CurlCurl()

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

Definition at line 1976 of file ExpList.h.

1978 {
1979  v_CurlCurl(Vel, Q);
1980 }
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble >> &Vel, Array< OneD, Array< OneD, NekDouble >> &Q)
Definition: ExpList.cpp:1645

References v_CurlCurl().

◆ DealiasedDotProd()

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

Definition at line 2015 of file ExpList.h.

2019 {
2020  v_DealiasedDotProd(inarray1, inarray2, outarray);
2021 }
virtual void v_DealiasedDotProd(const Array< OneD, Array< OneD, NekDouble >> &inarray1, const Array< OneD, Array< OneD, NekDouble >> &inarray2, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: ExpList.cpp:4545

References v_DealiasedDotProd().

◆ DealiasedProd()

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

Definition at line 2005 of file ExpList.h.

2008 {
2009  v_DealiasedProd(inarray1, inarray2, outarray);
2010 }
virtual void v_DealiasedProd(const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4536

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

1360 {
1361  Array<OneD, NekDouble> e_outarray;
1362 
1363  for (int i = 0; i < (*m_exp).size(); ++i)
1364  {
1365  (*m_exp)[i]->DivideByQuadratureMetric(inarray + m_phys_offset[i],
1366  e_outarray =
1367  outarray + m_phys_offset[i]);
1368  }
1369 }

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

1656 {
1657  unsigned int i;
1658  int returnval = 0;
1659 
1660  for (i = 0; i < (*m_exp).size(); ++i)
1661  {
1662  returnval = (std::max)(returnval, (*m_exp)[i]->EvalBasisNumModesMax());
1663  }
1664 
1665  return returnval;
1666 }

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

1672 {
1673  unsigned int i;
1674  Array<OneD, int> returnval((*m_exp).size(), 0);
1675 
1676  for (i = 0; i < (*m_exp).size(); ++i)
1677  {
1678  returnval[i] =
1679  (std::max)(returnval[i], (*m_exp)[i]->EvalBasisNumModesMax());
1680  }
1681 
1682  return returnval;
1683 }

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

2441 {
2442  v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2443 }
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:5007

References v_EvaluateBoundaryConditions().

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

◆ ExponentialFilter()

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

Definition at line 1743 of file ExpList.cpp.

1746 {
1747  Array<OneD, NekDouble> e_array;
1748 
1749  for (int i = 0; i < (*m_exp).size(); ++i)
1750  {
1751  (*m_exp)[i]->ExponentialFilter(e_array = array + m_phys_offset[i],
1752  alpha, exponent, cutoff);
1753  }
1754 }

References m_phys_offset.

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

3550 {
3551  v_ExtractCoeffsToCoeffs(fromExpList, fromCoeffs, toCoeffs);
3552 }
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:3649

References v_ExtractCoeffsToCoeffs().

◆ ExtractDataToCoeffs()

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

Extract the data in fielddata into the coeffs.

Definition at line 3538 of file ExpList.cpp.

3542 {
3543  v_ExtractDataToCoeffs(fielddef, fielddata, field, coeffs);
3544 }
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
Extract data from raw field data into expansion list.
Definition: ExpList.cpp:3562

References v_ExtractDataToCoeffs().

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

2466 {
2467  v_ExtractElmtToBndPhys(i, elmt, boundary);
2468 }
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:4803

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

Definition at line 3304 of file ExpList.cpp.

3308 {
3309  string varString = fileName.substr(0, fileName.find_last_of("."));
3310  int j, k, len = varString.length();
3311  varString = varString.substr(len - 1, len);
3312 
3313  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3314  std::vector<std::vector<NekDouble>> FieldData;
3315 
3316  std::string ft = LibUtilities::FieldIO::GetFileType(fileName, comm);
3319  ft, comm, m_session->GetSharedFilesystem());
3320 
3321  f->Import(fileName, FieldDef, FieldData);
3322 
3323  bool found = false;
3324  for (j = 0; j < FieldDef.size(); ++j)
3325  {
3326  for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3327  {
3328  if (FieldDef[j]->m_fields[k] == varName)
3329  {
3330  // Copy FieldData into locExpList
3331  locExpList->ExtractDataToCoeffs(FieldDef[j], FieldData[j],
3332  FieldDef[j]->m_fields[k],
3333  locExpList->UpdateCoeffs());
3334  found = true;
3335  }
3336  }
3337  }
3338 
3339  ASSERTL0(found, "Could not find variable '" + varName +
3340  "' in file boundary condition " + fileName);
3341  locExpList->BwdTrans(locExpList->GetCoeffs(), locExpList->UpdatePhys());
3342 }
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
Definition: FieldIO.cpp:97
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:301
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
Definition: FieldIO.cpp:72

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

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

◆ ExtractPhysToBnd()

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

Definition at line 2477 of file ExpList.h.

2480 {
2481  v_ExtractPhysToBnd(i, phys, bnd);
2482 }
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.cpp:4880

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

2473 {
2474  v_ExtractPhysToBndElmt(i, phys, bndElmt);
2475 }
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:4841

References v_ExtractPhysToBndElmt().

◆ ExtractTracePhys() [1/2]

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

Definition at line 2413 of file ExpList.h.

2414 {
2415  v_ExtractTracePhys(outarray);
2416 }
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4459

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

2421 {
2422  v_ExtractTracePhys(inarray, outarray);
2423 }

References v_ExtractTracePhys().

◆ FillBndCondFromField() [1/2]

void Nektar::MultiRegions::ExpList::FillBndCondFromField ( const int  nreg)
inline

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

Definition at line 2115 of file ExpList.h.

2116 {
2117  v_FillBndCondFromField(nreg);
2118 }
virtual void v_FillBndCondFromField()
Definition: ExpList.cpp:4625

References v_FillBndCondFromField().

◆ FillBndCondFromField() [2/2]

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

Fill Bnd Condition expansion from the values stored in expansion.

Definition at line 2110 of file ExpList.h.

2111 {
2113 }

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

2377 {
2378  v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2379 }
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
Definition: ExpList.cpp:4399

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

2398 {
2399  v_FillBwdWithBwdWeight(weightave, weightjmp);
2400 }
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Definition: ExpList.cpp:4969

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

1799 {
1800  v_FwdTrans(inarray, outarray);
1801 }
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4669

References v_FwdTrans().

◆ FwdTransBndConstrained()

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

Definition at line 1816 of file ExpList.h.

1819 {
1820  v_FwdTransBndConstrained(inarray, outarray);
1821 }
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1811

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

1809 {
1810  v_FwdTransLocalElmt(inarray, outarray);
1811 }
virtual void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1802

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

1876 {
1877  int i, cnt1;
1878  int n_exp = 0;
1879  DNekScalMatSharedPtr loc_mat;
1880  DNekScalBlkMatSharedPtr BlkMatrix;
1881  map<int, int> elmt_id;
1882  LibUtilities::ShapeType ShapeType = gkey.GetShapeType();
1883 
1885  {
1886  for (i = 0; i < (*m_exp).size(); ++i)
1887  {
1888  if ((*m_exp)[i]->DetShapeType() == ShapeType)
1889  {
1890  elmt_id[n_exp++] = i;
1891  }
1892  }
1893  }
1894  else
1895  {
1896  n_exp = (*m_exp).size();
1897  for (i = 0; i < n_exp; ++i)
1898  {
1899  elmt_id[i] = i;
1900  }
1901  }
1902 
1903  Array<OneD, unsigned int> nrows(n_exp);
1904  Array<OneD, unsigned int> ncols(n_exp);
1905 
1906  switch (gkey.GetMatrixType())
1907  {
1908  case StdRegions::eBwdTrans:
1909  {
1910  // set up an array of integers for block matrix construction
1911  for (i = 0; i < n_exp; ++i)
1912  {
1913  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1914  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1915  }
1916  }
1917  break;
1919  {
1920  // set up an array of integers for block matrix construction
1921  for (i = 0; i < n_exp; ++i)
1922  {
1923  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1924  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1925  }
1926  }
1927  break;
1928  case StdRegions::eMass:
1929  case StdRegions::eInvMass:
1933  {
1934  // set up an array of integers for block matrix construction
1935  for (i = 0; i < n_exp; ++i)
1936  {
1937  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1938  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1939  }
1940  }
1941  break;
1942 
1944  {
1945  // set up an array of integers for block matrix construction
1946  for (i = 0; i < n_exp; ++i)
1947  {
1948  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1949  ncols[i] =
1950  (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1951  }
1952  }
1953  break;
1955  {
1956  // set up an array of integers for block matrix construction
1957  for (i = 0; i < n_exp; ++i)
1958  {
1959  nrows[i] =
1960  (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1961  ncols[i] =
1962  (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1963  }
1964  }
1965  break;
1966  default:
1967  {
1969  "Global Matrix creation not defined for this "
1970  "type of matrix");
1971  }
1972  }
1973 
1974  MatrixStorage blkmatStorage = eDIAGONAL;
1975  BlkMatrix = MemoryManager<DNekScalBlkMat>::AllocateSharedPtr(nrows, ncols,
1976  blkmatStorage);
1977 
1978  int nvarcoeffs = gkey.GetNVarCoeffs();
1979  int eid;
1980  Array<OneD, NekDouble> varcoeffs_wk;
1981 
1982  for (i = cnt1 = 0; i < n_exp; ++i)
1983  {
1984  // need to be initialised with zero size for non
1985  // variable coefficient case
1986  StdRegions::VarCoeffMap varcoeffs;
1987 
1988  eid = elmt_id[i];
1989  if (nvarcoeffs > 0)
1990  {
1991  for (auto &x : gkey.GetVarCoeffs())
1992  {
1993  varcoeffs[x.first] = x.second + m_phys_offset[eid];
1994  }
1995  }
1996 
1997  LocalRegions::MatrixKey matkey(
1998  gkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(), *(*m_exp)[eid],
1999  gkey.GetConstFactors(), varcoeffs);
2000 
2001  loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>(
2002  (*m_exp)[elmt_id.find(i)->second])
2003  ->GetLocMatrix(matkey);
2004  BlkMatrix->SetBlock(i, i, loc_mat);
2005  }
2006 
2007  return BlkMatrix;
2008 }
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:240
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, and NEKERROR.

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

3385 {
3386  int startenum = (int)LibUtilities::eSegment;
3387  int endenum = (int)LibUtilities::eHexahedron;
3388  int s = 0;
3390 
3391  ASSERTL1(NumHomoDir == HomoBasis.size(),
3392  "Homogeneous basis is not the same length as NumHomoDir");
3393  ASSERTL1(NumHomoDir == HomoLen.size(),
3394  "Homogeneous length vector is not the same length as NumHomDir");
3395 
3396  // count number of shapes
3397  switch ((*m_exp)[0]->GetShapeDimension())
3398  {
3399  case 1:
3400  startenum = (int)LibUtilities::eSegment;
3401  endenum = (int)LibUtilities::eSegment;
3402  break;
3403  case 2:
3404  startenum = (int)LibUtilities::eTriangle;
3405  endenum = (int)LibUtilities::eQuadrilateral;
3406  break;
3407  case 3:
3408  startenum = (int)LibUtilities::eTetrahedron;
3409  endenum = (int)LibUtilities::eHexahedron;
3410  break;
3411  }
3412 
3413  for (s = startenum; s <= endenum; ++s)
3414  {
3415  std::vector<unsigned int> elementIDs;
3416  std::vector<LibUtilities::BasisType> basis;
3417  std::vector<unsigned int> numModes;
3418  std::vector<std::string> fields;
3419 
3420  bool first = true;
3421  bool UniOrder = true;
3422  int n;
3423 
3424  shape = (LibUtilities::ShapeType)s;
3425 
3426  for (int i = 0; i < (*m_exp).size(); ++i)
3427  {
3428  if ((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
3429  {
3430  elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
3431  if (first)
3432  {
3433  for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3434  {
3435  basis.push_back(
3436  (*m_exp)[i]->GetBasis(j)->GetBasisType());
3437  numModes.push_back(
3438  (*m_exp)[i]->GetBasis(j)->GetNumModes());
3439  }
3440 
3441  // add homogeneous direction details if defined
3442  for (n = 0; n < NumHomoDir; ++n)
3443  {
3444  basis.push_back(HomoBasis[n]->GetBasisType());
3445  numModes.push_back(HomoBasis[n]->GetNumModes());
3446  }
3447 
3448  first = false;
3449  }
3450  else
3451  {
3452  ASSERTL0(
3453  (*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
3454  "Routine is not set up for multiple bases definitions");
3455 
3456  for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3457  {
3458  numModes.push_back(
3459  (*m_exp)[i]->GetBasis(j)->GetNumModes());
3460  if (numModes[j] !=
3461  (*m_exp)[i]->GetBasis(j)->GetNumModes())
3462  {
3463  UniOrder = false;
3464  }
3465  }
3466  // add homogeneous direction details if defined
3467  for (n = 0; n < NumHomoDir; ++n)
3468  {
3469  numModes.push_back(HomoBasis[n]->GetNumModes());
3470  }
3471  }
3472  }
3473  }
3474 
3475  if (elementIDs.size() > 0)
3476  {
3479  AllocateSharedPtr(shape, elementIDs, basis, UniOrder,
3480  numModes, fields, NumHomoDir, HomoLen,
3481  homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
3482  fielddef.push_back(fdef);
3483  }
3484  }
3485 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:177

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

2057 {
2058  int nvarcoeffs = gkey.GetNVarCoeffs();
2059 
2060  if ((nvarcoeffs == 0) && (gkey.GetMatrixType() == StdRegions::eHelmholtz))
2061  {
2062  // initialise if required
2063  if (m_collections.size() &&
2065  {
2066  for (int i = 0; i < m_collections.size(); ++i)
2067  {
2068  m_collections[i].Initialise(Collections::eHelmholtz,
2069  gkey.GetConstFactors());
2070  }
2072  }
2073  else
2074  {
2075  for (int i = 0; i < m_collections.size(); ++i)
2076  {
2077  m_collections[i].CheckFactors(Collections::eHelmholtz,
2078  gkey.GetConstFactors(),
2079  m_coll_phys_offset[i]);
2080  }
2081  }
2082 
2083  Array<OneD, NekDouble> tmp;
2084  for (int i = 0; i < m_collections.size(); ++i)
2085  {
2086  m_collections[i].ApplyOperator(
2088  tmp = outarray + m_coll_coeff_offset[i]);
2089  }
2090  }
2091  else
2092  {
2093  Array<OneD, NekDouble> tmp_outarray;
2094  for (int i = 0; i < (*m_exp).size(); ++i)
2095  {
2096  // need to be initialised with zero size for non
2097  // variable coefficient case
2098  StdRegions::VarCoeffMap varcoeffs;
2099 
2100  if (nvarcoeffs > 0)
2101  {
2102  for (auto &x : gkey.GetVarCoeffs())
2103  {
2104  varcoeffs[x.first] = x.second + m_phys_offset[i];
2105  }
2106  }
2107 
2108  StdRegions::StdMatrixKey mkey(
2109  gkey.GetMatrixType(), (*m_exp)[i]->DetShapeType(),
2110  *((*m_exp)[i]), gkey.GetConstFactors(), varcoeffs);
2111 
2112  (*m_exp)[i]->GeneralMatrixOp(
2113  inarray + m_coeff_offset[i],
2114  tmp_outarray = outarray + m_coeff_offset[i], mkey);
2115  }
2116  }
2117 }

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_coeff_offset, m_coll_phys_offset, m_collections, m_collectionsDoInit, m_exp, and m_phys_offset.

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

3739 {
3740  int npoints_e;
3741  NekDouble coeff;
3742 
3743  Array<OneD, NekDouble> outarray_e;
3744 
3745  for (int i = 0; i < (*m_exp).size(); ++i)
3746  {
3747  npoints_e = (*m_exp)[i]->GetTotPoints();
3748 
3749  if (i <= ElementID)
3750  {
3751  coeff = scalar1;
3752  }
3753  else
3754  {
3755  coeff = scalar2;
3756  }
3757 
3758  outarray_e = Array<OneD, NekDouble>(npoints_e, coeff);
3759  Vmath::Vcopy(npoints_e, &outarray_e[0], 1, &outarray[m_phys_offset[i]],
3760  1);
3761  }
3762 }

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

2433 {
2434  std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2435  const map<int, RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
2436 
2437  MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2438 
2439  if (vType >= eSIZE_GlobalSysSolnType)
2440  {
2441  NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
2442  }
2443  std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2444 
2445  return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
2446  locToGloMap);
2447 }
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:1034
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:963
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 2413 of file ExpList.cpp.

2415 {
2416  GlobalLinSysSharedPtr returnlinsys;
2417  std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2418 
2419  MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2420 
2421  if (vType >= eSIZE_GlobalSysSolnType)
2422  {
2423  NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
2424  }
2425  std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2426 
2427  return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
2428  locToGloMap);
2429 }
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:50

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

2128 {
2129  int i, j, n, gid1, gid2, cntdim1, cntdim2;
2130  NekDouble sign1, sign2;
2131  DNekScalMatSharedPtr loc_mat;
2132 
2133  unsigned int glob_rows = 0;
2134  unsigned int glob_cols = 0;
2135  unsigned int loc_rows = 0;
2136  unsigned int loc_cols = 0;
2137 
2138  bool assembleFirstDim = false;
2139  bool assembleSecondDim = false;
2140 
2141  switch (mkey.GetMatrixType())
2142  {
2143  case StdRegions::eBwdTrans:
2144  {
2145  glob_rows = m_npoints;
2146  glob_cols = locToGloMap->GetNumGlobalCoeffs();
2147 
2148  assembleFirstDim = false;
2149  assembleSecondDim = true;
2150  }
2151  break;
2153  {
2154  glob_rows = locToGloMap->GetNumGlobalCoeffs();
2155  glob_cols = m_npoints;
2156 
2157  assembleFirstDim = true;
2158  assembleSecondDim = false;
2159  }
2160  break;
2161  case StdRegions::eMass:
2165  {
2166  glob_rows = locToGloMap->GetNumGlobalCoeffs();
2167  glob_cols = locToGloMap->GetNumGlobalCoeffs();
2168 
2169  assembleFirstDim = true;
2170  assembleSecondDim = true;
2171  }
2172  break;
2173  default:
2174  {
2176  "Global Matrix creation not defined for this "
2177  "type of matrix");
2178  }
2179  }
2180 
2181  COOMatType spcoomat;
2182  CoordType coord;
2183 
2184  int nvarcoeffs = mkey.GetNVarCoeffs();
2185  int eid;
2186 
2187  // fill global matrix
2188  for (n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2189  {
2190  // need to be initialised with zero size for non
2191  // variable coefficient case
2192  StdRegions::VarCoeffMap varcoeffs;
2193 
2194  eid = n;
2195  if (nvarcoeffs > 0)
2196  {
2197  for (auto &x : mkey.GetVarCoeffs())
2198  {
2199  varcoeffs[x.first] = x.second + m_phys_offset[eid];
2200  }
2201  }
2202 
2203  LocalRegions::MatrixKey matkey(
2204  mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2205  *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2206 
2207  loc_mat =
2208  std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2209  ->GetLocMatrix(matkey);
2210 
2211  loc_rows = loc_mat->GetRows();
2212  loc_cols = loc_mat->GetColumns();
2213 
2214  for (i = 0; i < loc_rows; ++i)
2215  {
2216  if (assembleFirstDim)
2217  {
2218  gid1 = locToGloMap->GetLocalToGlobalMap(cntdim1 + i);
2219  sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2220  }
2221  else
2222  {
2223  gid1 = cntdim1 + i;
2224  sign1 = 1.0;
2225  }
2226 
2227  for (j = 0; j < loc_cols; ++j)
2228  {
2229  if (assembleSecondDim)
2230  {
2231  gid2 = locToGloMap->GetLocalToGlobalMap(cntdim2 + j);
2232  sign2 = locToGloMap->GetLocalToGlobalSign(cntdim2 + j);
2233  }
2234  else
2235  {
2236  gid2 = cntdim2 + j;
2237  sign2 = 1.0;
2238  }
2239 
2240  // sparse matrix fill
2241  coord = make_pair(gid1, gid2);
2242  if (spcoomat.count(coord) == 0)
2243  {
2244  spcoomat[coord] = sign1 * sign2 * (*loc_mat)(i, j);
2245  }
2246  else
2247  {
2248  spcoomat[coord] += sign1 * sign2 * (*loc_mat)(i, j);
2249  }
2250  }
2251  }
2252  cntdim1 += loc_rows;
2253  cntdim2 += loc_cols;
2254  }
2255 
2257  glob_cols, spcoomat);
2258 }
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, and NEKERROR.

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

2262 {
2263  int i, j, n, gid1, gid2, loc_lda, eid;
2264  NekDouble sign1, sign2, value;
2265  DNekScalMatSharedPtr loc_mat;
2266 
2267  int totDofs = locToGloMap->GetNumGlobalCoeffs();
2268  int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2269 
2270  unsigned int rows = totDofs - NumDirBCs;
2271  unsigned int cols = totDofs - NumDirBCs;
2272  NekDouble zero = 0.0;
2273 
2274  DNekMatSharedPtr Gmat;
2275  int bwidth = locToGloMap->GetFullSystemBandWidth();
2276 
2277  int nvarcoeffs = mkey.GetNVarCoeffs();
2278  MatrixStorage matStorage;
2279 
2280  map<int, RobinBCInfoSharedPtr> RobinBCInfo = GetRobinBCInfo();
2281 
2282  switch (mkey.GetMatrixType())
2283  {
2284  // case for all symmetric matices
2287  if ((2 * (bwidth + 1)) < rows)
2288  {
2291  rows, cols, zero, matStorage, bwidth, bwidth);
2292  }
2293  else
2294  {
2295  matStorage = ePOSITIVE_DEFINITE_SYMMETRIC;
2297  rows, cols, zero, matStorage);
2298  }
2299 
2300  break;
2301  default: // Assume general matrix - currently only set up
2302  // for full invert
2303  {
2304  matStorage = eFULL;
2305  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows, cols, zero,
2306  matStorage);
2307  }
2308  }
2309 
2310  // fill global symmetric matrix
2311  for (n = 0; n < (*m_exp).size(); ++n)
2312  {
2313  // need to be initialised with zero size for non
2314  // variable coefficient case
2315  StdRegions::VarCoeffMap varcoeffs;
2316 
2317  eid = n;
2318  if (nvarcoeffs > 0)
2319  {
2320  for (auto &x : mkey.GetVarCoeffs())
2321  {
2322  varcoeffs[x.first] = x.second + m_phys_offset[eid];
2323  }
2324  }
2325 
2326  LocalRegions::MatrixKey matkey(
2327  mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2328  *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2329 
2330  loc_mat =
2331  std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2332  ->GetLocMatrix(matkey);
2333 
2334  if (RobinBCInfo.count(n) != 0) // add robin mass matrix
2335  {
2337 
2338  // declare local matrix from scaled matrix.
2339  int rows = loc_mat->GetRows();
2340  int cols = loc_mat->GetColumns();
2341  const NekDouble *dat = loc_mat->GetRawPtr();
2342  DNekMatSharedPtr new_mat =
2344  Blas::Dscal(rows * cols, loc_mat->Scale(), new_mat->GetRawPtr(), 1);
2345 
2346  // add local matrix contribution
2347  for (rBC = RobinBCInfo.find(n)->second; rBC; rBC = rBC->next)
2348  {
2349  (*m_exp)[n]->AddRobinMassMatrix(
2350  rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, new_mat);
2351  }
2352 
2353  NekDouble one = 1.0;
2354  // redeclare loc_mat to point to new_mat plus the scalar.
2355  loc_mat =
2357  }
2358 
2359  loc_lda = loc_mat->GetColumns();
2360 
2361  for (i = 0; i < loc_lda; ++i)
2362  {
2363  gid1 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + i) -
2364  NumDirBCs;
2365  sign1 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + i);
2366  if (gid1 >= 0)
2367  {
2368  for (j = 0; j < loc_lda; ++j)
2369  {
2370  gid2 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] +
2371  j) -
2372  NumDirBCs;
2373  sign2 = locToGloMap->GetLocalToGlobalSign(
2374  m_coeff_offset[n] + j);
2375  if (gid2 >= 0)
2376  {
2377  // When global matrix is symmetric,
2378  // only add the value for the upper
2379  // triangular part in order to avoid
2380  // entries to be entered twice
2381  if ((matStorage == eFULL) || (gid2 >= gid1))
2382  {
2383  value = Gmat->GetValue(gid1, gid2) +
2384  sign1 * sign2 * (*loc_mat)(i, j);
2385  Gmat->SetValue(gid1, gid2, value);
2386  }
2387  }
2388  }
2389  }
2390  }
2391  }
2392 
2393  return Gmat;
2394 }
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:168
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, and Nektar::MultiRegions::RobinBCInfo::next.

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

1699 {
1700  int returnval = 0;
1701  int cnt;
1702  int nbase = (*m_exp)[0]->GetNumBases();
1703 
1704  for (int i = 0; i < (*m_exp).size(); ++i)
1705  {
1706  cnt = 1;
1707  for (int j = 0; j < nbase; ++j)
1708  {
1709  cnt *= (int)(scale * ((*m_exp)[i]->GetNumPoints(j)));
1710  }
1711  returnval += cnt;
1712  }
1713  return returnval;
1714 }

References m_exp.

◆ GetBCValues()

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

Definition at line 2026 of file ExpList.h.

2029 {
2030  v_GetBCValues(BndVals, TotField, BndID);
2031 }
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:4555

References v_GetBCValues().

◆ GetBlockMatrix()

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

Definition at line 2010 of file ExpList.cpp.

2012 {
2013  auto matrixIter = m_blockMat->find(gkey);
2014 
2015  if (matrixIter == m_blockMat->end())
2016  {
2017  return ((*m_blockMat)[gkey] = GenBlockMatrix(gkey));
2018  }
2019  else
2020  {
2021  return matrixIter->second;
2022  }
2023 }
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:1874

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

2289 {
2290  return v_GetBndCondBwdWeight();
2291 }
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
Definition: ExpList.cpp:4436

References v_GetBndCondBwdWeight().

◆ GetBndCondExpansions()

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

Definition at line 2270 of file ExpList.h.

2271 {
2272  return v_GetBndCondExpansions();
2273 }
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:3765

References v_GetBndCondExpansions().

Referenced by v_ExtractElmtToBndPhys(), v_ExtractPhysToBnd(), v_ExtractPhysToBndElmt(), and v_GetBoundaryNormals().

◆ GetBndConditions()

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

Definition at line 2426 of file ExpList.h.

2427 {
2428  return v_GetBndConditions();
2429 }
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:4986

References v_GetBndConditions().

◆ GetBndElmtExpansion()

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

Definition at line 2456 of file ExpList.h.

2459 {
2460  v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2461 }
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
Definition: ExpList.cpp:4793

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

5041 {
5042  auto collectionIter = collection.find(regionId);
5043  ASSERTL1(collectionIter != collection.end(),
5044  "Unable to locate collection " +
5045  boost::lexical_cast<string>(regionId));
5046 
5048  (*collectionIter).second;
5049  auto conditionMapIter = bndCondMap->find(variable);
5050  ASSERTL1(conditionMapIter != bndCondMap->end(),
5051  "Unable to locate condition map.");
5052 
5053  const SpatialDomains::BoundaryConditionShPtr boundaryCondition =
5054  (*conditionMapIter).second;
5055 
5056  return boundaryCondition;
5057 }
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 2484 of file ExpList.h.

2486 {
2487  v_GetBoundaryNormals(i, normals);
2488 }
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble >> &normals)
Definition: ExpList.cpp:4917

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

3680 {
3681  size_t nTracePts = weightAver.size();
3682  // average for interior traces
3683  for (int i = 0; i < nTracePts; ++i)
3684  {
3685  weightAver[i] = 0.5;
3686  weightJump[i] = 1.0;
3687  }
3688  FillBwdWithBwdWeight(weightAver, weightJump);
3689 }
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition: ExpList.h:2396

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

2174 {
2175  return m_coeffs[i];
2176 }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1158

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

2101 {
2102  return m_coeffs;
2103 }

References m_coeffs.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous2D::EvaluateBoundaryConditions(), Nektar::MultiRegions::ContField::LaplaceSolve(), 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 2182 of file ExpList.h.

2183 {
2184  return m_coeffs[i];
2185 }

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

2278 {
2279  return m_coeffsToElmt;
2280 }
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition: ExpList.h:1216

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

1047  {
1048  return m_comm;
1049  }

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

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

References ASSERTL2, and m_exp.

Referenced by Nektar::MultiRegions::ExpList2DHomogeneous1D::GetCoords(), GetExpIndex(), IProductWRTDerivBase(), PhysEvaluate(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetBoundaryNormals(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetCoords(), v_GetCoords(), v_GetNormals(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetNormals(), v_NormVectorIProductWRTBase(), v_Upwind(), v_WriteTecplotZone(), Nektar::MultiRegions::ExpList1DHomogeneous2D::v_WriteTecplotZone(), and Nektar::MultiRegions::ExpList2DHomogeneous1D::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 1907 of file ExpList.h.

1911 {
1912  v_GetCoords(coord_0, coord_1, coord_2);
1913 }
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:4720

References v_GetCoords().

Referenced by v_WriteTecplotZone().

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

1918 {
1919  v_GetCoords(eid, xc0, xc1, xc2);
1920 }

References v_GetCoords().

◆ GetDiagMatIpwrtBase()

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

Definition at line 5496 of file ExpList.cpp.

5499 {
5501  int nElmtPntPrevious = 0;
5502  int nElmtCoefPrevious = 0;
5503  int nTotElmt = (*m_exp).size();
5504  int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5505  int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5506 
5507  Array<OneD, NekDouble> tmpPhys;
5508  Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
5509  Array<OneD, NekDouble> stdMat_data;
5510 
5511  for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5512  {
5513  nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5514  nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5515  LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
5516 
5517  if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5518  (ElmtTypeNow != ElmtTypePrevious))
5519  {
5521  stdExp = (*m_exp)[nelmt]->GetStdExp();
5522  StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
5523  stdExp->DetShapeType(), *stdExp);
5524 
5525  DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
5526  stdMat_data = BwdMat->GetPtr();
5527 
5528  if (nElmtPntPrevious != nElmtPnt)
5529  {
5530  tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5531  }
5532 
5533  ElmtTypePrevious = ElmtTypeNow;
5534  nElmtPntPrevious = nElmtPnt;
5535  nElmtCoefPrevious = nElmtCoef;
5536  }
5537 
5538  (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5539  inarray[nelmt],
5540  tmpPhys); // weight with metric
5541 
5542  Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
5543 
5544  for (int np = 0; np < nElmtPnt; np++)
5545  {
5546  NekDouble factor = tmpPhys[np];
5547  clmnArray = MatDataArray + np * nElmtCoef;
5548  clmnStdMatArray = stdMat_data + np * nElmtCoef;
5549  Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
5550  }
5551  }
5552 }
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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.cpp:248

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.

Definition at line 4206 of file ExpList.cpp.

4208 {
4209  int e_npoints;
4210 
4211  Array<OneD, NekDouble> locLeng;
4212  Array<OneD, Array<OneD, NekDouble>> lengintp(2);
4213  Array<OneD, Array<OneD, NekDouble>> lengAdd(2);
4214  Array<OneD, int> LRbndnumbs(2);
4215  Array<OneD, Array<OneD, NekDouble>> lengLR(2);
4216  lengLR[0] = lengthsFwd;
4217  lengLR[1] = lengthsBwd;
4218  Array<OneD, LocalRegions::ExpansionSharedPtr> LRelmts(2);
4221  int e_npoints0 = -1;
4222  if (m_expType == e1D)
4223  {
4224  for (int i = 0; i < m_exp->size(); ++i)
4225  {
4226  loc_exp = (*m_exp)[i];
4227  int offset = m_phys_offset[i];
4228 
4229  int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4230  e_npoints = (*m_exp)[i]->GetNumPoints(0);
4231  if (e_npoints0 < e_npoints)
4232  {
4233  for (int nlr = 0; nlr < 2; nlr++)
4234  {
4235  lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4236  }
4237  e_npoints0 = e_npoints;
4238  }
4239 
4240  LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4241  LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4242 
4243  LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4244  LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4245  for (int nlr = 0; nlr < 2; ++nlr)
4246  {
4247  Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4248  lengAdd[nlr] = lengintp[nlr];
4249  int bndNumber = LRbndnumbs[nlr];
4250  loc_elmt = LRelmts[nlr];
4251  if (bndNumber >= 0)
4252  {
4253  locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4254  lengAdd[nlr] = locLeng;
4255 
4256  int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
4257  if (e_nmodes != loc_nmodes)
4258  {
4259  // Parallel case: need to interpolate.
4260  LibUtilities::PointsKey to_key =
4261  loc_exp->GetBasis(0)->GetPointsKey();
4262  LibUtilities::PointsKey from_key =
4263  loc_elmt->GetBasis(0)->GetPointsKey();
4264  LibUtilities::Interp1D(from_key, locLeng, to_key,
4265  lengintp[nlr]);
4266  lengAdd[nlr] = lengintp[nlr];
4267  }
4268  }
4269 
4270  for (int j = 0; j < e_npoints; ++j)
4271  {
4272  lengLR[nlr][offset + j] = lengAdd[nlr][j];
4273  }
4274  }
4275  }
4276  }
4277  else if (m_expType == e2D)
4278  {
4279  for (int i = 0; i < m_exp->size(); ++i)
4280  {
4281  loc_exp = (*m_exp)[i];
4282  int offset = m_phys_offset[i];
4283 
4284  LibUtilities::BasisKey traceBasis0 =
4285  loc_exp->GetBasis(0)->GetBasisKey();
4286  LibUtilities::BasisKey traceBasis1 =
4287  loc_exp->GetBasis(1)->GetBasisKey();
4288  const int TraceNq0 = traceBasis0.GetNumPoints();
4289  const int TraceNq1 = traceBasis1.GetNumPoints();
4290  e_npoints = TraceNq0 * TraceNq1;
4291  if (e_npoints0 < e_npoints)
4292  {
4293  for (int nlr = 0; nlr < 2; nlr++)
4294  {
4295  lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4296  }
4297  e_npoints0 = e_npoints;
4298  }
4299 
4300  LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4301  LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4302 
4303  LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4304  LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4305  for (int nlr = 0; nlr < 2; ++nlr)
4306  {
4307  Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4308  int bndNumber = LRbndnumbs[nlr];
4309  loc_elmt = LRelmts[nlr];
4310  if (bndNumber >= 0)
4311  {
4312  locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4313  // Project normals from 3D element onto the
4314  // same orientation as the trace expansion.
4315  StdRegions::Orientation orient =
4316  loc_elmt->GetTraceOrient(bndNumber);
4317 
4318  int fromid0, fromid1;
4320  {
4321  fromid0 = 0;
4322  fromid1 = 1;
4323  }
4324  else
4325  {
4326  fromid0 = 1;
4327  fromid1 = 0;
4328  }
4329 
4330  LibUtilities::BasisKey faceBasis0 =
4331  loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4332  LibUtilities::BasisKey faceBasis1 =
4333  loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4334  const int faceNq0 = faceBasis0.GetNumPoints();
4335  const int faceNq1 = faceBasis1.GetNumPoints();
4336  Array<OneD, NekDouble> alignedLeng(faceNq0 * faceNq1);
4337 
4338  AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
4340  faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4341  alignedLeng, traceBasis0.GetPointsKey(),
4342  traceBasis1.GetPointsKey(), lengintp[nlr]);
4343  }
4344 
4345  for (int j = 0; j < e_npoints; ++j)
4346  {
4347  lengLR[nlr][offset + j] = lengintp[nlr][j];
4348  }
4349  }
4350  }
4351  }
4352 }
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:52
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:106
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:3922

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().

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

2225 {
2226  return m_exp;
2227 }

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::ExpList1DHomogeneous2D::ExpList1DHomogeneous2D(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), Nektar::MultiRegions::LocTraceToTraceMap::FindElmtNeighbors(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous1D::GetBCValues(), GetExp(), GetExpIndex(), Nektar::MultiRegions::AssemblyCommDG::InitialiseStructure(), Nektar::MultiRegions::LocTraceToTraceMap::LocTraceToTraceMap(), Nektar::MultiRegions::DisContField3DHomogeneous1D::NormVectorIProductWRTBase(), Nektar::MultiRegions::LocTraceToTraceMap::Setup(), Nektar::MultiRegions::AssemblyMapCG::SetUpUniversalC0ContMap(), Nektar::MultiRegions::AssemblyMapDG::SetUpUniversalDGMap(), v_ExtractElmtToBndPhys(), v_ExtractPhysToBnd(), v_ExtractPhysToBndElmt(), Nektar::MultiRegions::DisContField::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetBoundaryNormals(), v_GetCoords(), Nektar::MultiRegions::ExpList3DHomogeneous1D::v_HomogeneousEnergy(), Nektar::MultiRegions::AssemblyMapCG::v_LinearSpaceMap(), 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 2507 of file ExpList.cpp.

2509 {
2510  return GetExp(GetExpIndex(gloCoord));
2511 }
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:2518

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

2216 {
2217  return (*m_exp)[n];
2218 }

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

2521 {
2522  Array<OneD, NekDouble> Lcoords(gloCoord.size());
2523 
2524  return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
2525  maxDistance);
2526 }

Referenced by GetExp(), 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 2528 of file ExpList.cpp.

2532 {
2533  if (GetNumElmts() == 0)
2534  {
2535  return -1;
2536  }
2537 
2538  if (m_elmtToExpId.size() == 0)
2539  {
2540  // Loop in reverse order so that in case where using a
2541  // Homogeneous expansion it sets geometry ids to first part of
2542  // m_exp list. Otherwise will set to second (complex) expansion
2543  for (int i = (*m_exp).size() - 1; i >= 0; --i)
2544  {
2545  m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2546  }
2547  }
2548 
2549  NekDouble nearpt = 1e6;
2550  NekDouble nearpt_min = 1e6;
2551  int min_id = -1;
2552  Array<OneD, NekDouble> savLocCoords(locCoords.size());
2553 
2554  if (cachedId >= 0 && cachedId < (*m_exp).size())
2555  {
2556  nearpt = 1e12;
2557  if ((*m_exp)[cachedId]->GetGeom()->MinMaxCheck(gloCoords) &&
2558  (*m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords, locCoords,
2559  tol, nearpt))
2560  {
2561  return cachedId;
2562  }
2563  else if (returnNearestElmt && (nearpt < nearpt_min))
2564  {
2565  // If it does not lie within, keep track of which element
2566  // is nearest.
2567  min_id = cachedId;
2568  nearpt_min = nearpt;
2569  Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2570  }
2571  }
2572 
2573  NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2574  NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2575  NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2578  GetExp(0)->GetCoordim(), -1, x, y, z);
2579 
2580  // Get the list of elements whose bounding box contains the desired
2581  // point.
2582  std::vector<int> elmts = m_graph->GetElementsContainingPoint(p);
2583 
2584  // Check each element in turn to see if point lies within it.
2585  for (int i = 0; i < elmts.size(); ++i)
2586  {
2587  int id = m_elmtToExpId[elmts[i]];
2588  if (id == cachedId)
2589  {
2590  continue;
2591  }
2592  if ((*m_exp)[id]->GetGeom()->ContainsPoint(gloCoords, locCoords, tol,
2593  nearpt))
2594  {
2595  return id;
2596  }
2597  else if (returnNearestElmt && (nearpt < nearpt_min))
2598  {
2599  // If it does not lie within, keep track of which element
2600  // is nearest.
2601  min_id = id;
2602  nearpt_min = nearpt;
2603  Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2604  }
2605  }
2606 
2607  // If the calling function is with just the nearest element, return
2608  // that. Otherwise return -1 to indicate no matching elemenet found.
2609  if (returnNearestElmt && nearpt_min <= maxDistance)
2610  {
2611 
2612  std::string msg =
2613  "Failed to find point within element to "
2614  "tolerance of " +
2615  boost::lexical_cast<std::string>(tol) + " using local point (" +
2616  boost::lexical_cast<std::string>(locCoords[0]) + "," +
2617  boost::lexical_cast<std::string>(locCoords[1]) + "," +
2618  boost::lexical_cast<std::string>(locCoords[1]) +
2619  ") in element: " + boost::lexical_cast<std::string>(min_id);
2620  WARNINGL1(false, msg.c_str());
2621 
2622  Vmath::Vcopy(locCoords.size(), savLocCoords, 1, locCoords, 1);
2623  return min_id;
2624  }
2625  else
2626  {
2627  return -1;
2628  }
2629 }
int GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:694
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1227
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:2054

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

◆ GetExpSize()

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

◆ GetExpType()

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

Returns the type of the expansion.

Definition at line 1303 of file ExpList.cpp.

1304 {
1305  return m_expType;
1306 }

References m_expType.

Referenced by v_CurlCurl().

◆ GetFieldDefinitions() [1/2]

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

Definition at line 975 of file ExpList.h.

976  {
977  return v_GetFieldDefinitions();
978  }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:3491

References v_GetFieldDefinitions().

◆ GetFieldDefinitions() [2/2]

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

Definition at line 980 of file ExpList.h.

982  {
983  v_GetFieldDefinitions(fielddef);
984  }

References v_GetFieldDefinitions().

◆ GetFwdBwdTracePhys() [1/2]

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

Definition at line 2359 of file ExpList.h.

2361 {
2362  v_GetFwdBwdTracePhys(Fwd, Bwd);
2363 }
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4380

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

2369 {
2370  v_GetFwdBwdTracePhys(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
2371  DoExchange);
2372 }

References v_GetFwdBwdTracePhys().

◆ GetGraph()

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

Definition at line 1051 of file ExpList.h.

1052  {
1053  return m_graph;
1054  }

References m_graph.

◆ GetHomogeneousBasis()

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

Definition at line 1057 of file ExpList.h.

1058  {
1059  return v_GetHomogeneousBasis();
1060  }
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1608

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

646  {
647  return v_GetHomoLen();
648  }
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:3267

References v_GetHomoLen().

◆ GetLeftAdjacentFaces()

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

Definition at line 2408 of file ExpList.h.

2409 {
2410  return v_GetLeftAdjacentFaces();
2411 }
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:4451

References v_GetLeftAdjacentFaces().

◆ GetLeftAdjacentTraces()

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

Definition at line 2490 of file ExpList.h.

2491 {
2492  return v_GetLeftAdjacentTraces();
2493 }
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
Definition: ExpList.cpp:3911

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

2392 {
2393  v_GetLocTraceFromTracePts(Fwd, Bwd, locTraceFwd, locTraceBwd);
2394 }
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:4426

References v_GetLocTraceFromTracePts().

Referenced by AddTraceJacToElmtJac().

◆ GetLocTraceToTraceMap()

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

Definition at line 2282 of file ExpList.h.

2284 {
2285  return v_GetLocTraceToTraceMap();
2286 }
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
Definition: ExpList.cpp:5992

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

5356 {
5357  int nTotElmt = (*m_exp).size();
5358  int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5359  int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5360 
5361  Array<OneD, NekDouble> tmpCoef(nElmtCoef, 0.0);
5362  Array<OneD, NekDouble> tmpPhys(nElmtPnt, 0.0);
5363 
5364  for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5365  {
5366  nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5367  nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5368 
5369  if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
5370  {
5371  tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5372  tmpCoef = Array<OneD, NekDouble>(nElmtCoef, 0.0);
5373  }
5374 
5375  for (int ncl = 0; ncl < nElmtPnt; ncl++)
5376  {
5377  tmpPhys[ncl] = inarray[nelmt][ncl];
5378 
5379  (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
5380 
5381  for (int nrw = 0; nrw < nElmtCoef; nrw++)
5382  {
5383  (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
5384  }
5385  // to maintain all the other columes are zero.
5386  tmpPhys[ncl] = 0.0;
5387  }
5388  }
5389 }

◆ GetMatIpwrtDeriveBase() [2/2]

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

Definition at line 5391 of file ExpList.cpp.

5393 {
5394  int nTotElmt = (*m_exp).size();
5395 
5396  int nspacedim = m_graph->GetSpaceDimension();
5397  Array<OneD, Array<OneD, NekDouble>> projectedpnts(nspacedim);
5398  Array<OneD, Array<OneD, NekDouble>> tmppnts(nspacedim);
5399  Array<OneD, DNekMatSharedPtr> ArrayStdMat(nspacedim);
5400  Array<OneD, Array<OneD, NekDouble>> ArrayStdMat_data(nspacedim);
5401 
5402  Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
5403 
5405  int nElmtPntPrevious = 0;
5406  int nElmtCoefPrevious = 0;
5407 
5408  int nElmtPnt, nElmtCoef;
5409  for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5410  {
5411  nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5412  nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5413  LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
5414 
5415  if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5416  (ElmtTypeNow != ElmtTypePrevious))
5417  {
5418  if (nElmtPntPrevious != nElmtPnt)
5419  {
5420  for (int ndir = 0; ndir < nspacedim; ndir++)
5421  {
5422  projectedpnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5423  tmppnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5424  }
5425  }
5427  stdExp = (*m_exp)[nelmt]->GetStdExp();
5428  StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase0,
5429  stdExp->DetShapeType(), *stdExp);
5430 
5431  ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5432  ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5433 
5434  if (nspacedim > 1)
5435  {
5436  StdRegions::StdMatrixKey matkey(
5437  StdRegions::eDerivBase1, stdExp->DetShapeType(), *stdExp);
5438 
5439  ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5440  ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5441 
5442  if (nspacedim > 2)
5443  {
5444  StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase2,
5445  stdExp->DetShapeType(),
5446  *stdExp);
5447 
5448  ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5449  ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5450  }
5451  }
5452 
5453  ElmtTypePrevious = ElmtTypeNow;
5454  nElmtPntPrevious = nElmtPnt;
5455  nElmtCoefPrevious = nElmtCoef;
5456  }
5457  else
5458  {
5459  for (int ndir = 0; ndir < nspacedim; ndir++)
5460  {
5461  Vmath::Zero(nElmtPnt, projectedpnts[ndir], 1);
5462  }
5463  }
5464 
5465  for (int ndir = 0; ndir < nspacedim; ndir++)
5466  {
5467  (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5468  ndir, inarray[ndir][nelmt], tmppnts);
5469  for (int n = 0; n < nspacedim; n++)
5470  {
5471  Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
5472  projectedpnts[n], 1);
5473  }
5474  }
5475 
5476  for (int ndir = 0; ndir < nspacedim; ndir++)
5477  {
5478  // weight with metric
5479  (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
5480  projectedpnts[ndir]);
5481  Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
5482 
5483  for (int np = 0; np < nElmtPnt; np++)
5484  {
5485  NekDouble factor = projectedpnts[ndir][np];
5486  clmnArray = MatDataArray + np * nElmtCoef;
5487  clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
5488  Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
5489  1, clmnArray, 1);
5490  }
5491  }
5492  }
5493 }
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.cpp:622

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

1929 {
1930  v_GetMovingFrames(MMFdir, CircCentre, outarray);
1931 }
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: ExpList.cpp:3691

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

1647 {
1648  return (*m_exp)[eid]->GetNcoeffs();
1649 }

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

2335 {
2336  v_GetNormals(normals);
2337 }
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble >> &normals)
Populate normals with the normals of all expansions.
Definition: ExpList.cpp:3989

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

1720 {
1721  return m_npoints;
1722 }

References m_npoints.

Referenced by export_ExpList(), and MultiplyByMassMatrix().

◆ GetNumElmts()

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

695  {
696  return v_GetNumElmts();
697  }
virtual int v_GetNumElmts(void)
Definition: ExpList.h:1263

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

971  {
972  v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
973  }
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:5029

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

2196 {
2197  return m_phys;
2198 }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1175

References m_phys.

Referenced by Nektar::MultiRegions::DisContField::v_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 1779 of file ExpList.h.

1780 {
1781  return m_physState;
1782 }

References m_physState.

Referenced by export_ExpList().

◆ GetPlane()

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

Definition at line 1062 of file ExpList.h.

1063  {
1064  return v_GetPlane(n);
1065  }
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:5059

References v_GetPlane().

◆ GetRobinBCInfo()

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

Definition at line 963 of file ExpList.h.

964  {
965  return v_GetRobinBCInfo();
966  }
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:5019

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

2065 {
2066  return (*m_exp)[0]->GetShapeDimension();
2067 }

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

1035  {
1036  return shared_from_this();
1037  }

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

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

1694 {
1695  return (*m_exp)[eid]->GetTotPoints();
1696 }

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

2320 {
2321  return v_GetTrace();
2322 }
virtual std::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:3890

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

2330 {
2331  return v_GetTraceBndMap();
2332 }
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:3906

References v_GetTraceBndMap().

◆ GetTraceMap()

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

Definition at line 2324 of file ExpList.h.

2325 {
2326  return v_GetTraceMap();
2327 }
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:3898

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

639  {
640  return v_GetTransposition();
641  }
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:3259

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

1736 {
1737  return m_WaveSpace;
1738 }

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

662  {
663  return v_GetYIDs();
664  }
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:3290

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

632  {
633  return v_GetZIDs();
634  }
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:3282

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

2165 {
2166  v_GlobalToLocal(inarray, outarray);
2167 }
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:4655

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

2133 {
2134  v_GlobalToLocal();
2135 }

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

3363 {
3364  NekDouble err = 0.0, errh1;
3365  int i;
3366 
3367  for (i = 0; i < (*m_exp).size(); ++i)
3368  {
3369  errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
3370  soln + m_phys_offset[i]);
3371  err += errh1 * errh1;
3372  }
3373 
3374  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3375 
3376  return sqrt(err);
3377 }
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:291

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

◆ HelmSolve()

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

1876 {
1877  v_HelmSolve(inarray, outarray, factors, varcoeff, varfactors, dirForcing,
1878  PhysSpaceForcing);
1879 }
virtual void 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:4483

References v_HelmSolve().

◆ HomogeneousBwdTrans()

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

Definition at line 1995 of file ExpList.h.

1998 {
1999  v_HomogeneousBwdTrans(inarray, outarray, Shuff, UnShuff);
2000 }
virtual void v_HomogeneousBwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4527

References v_HomogeneousBwdTrans().

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

616  {
617  return v_HomogeneousEnergy();
618  }
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:3251

References v_HomogeneousEnergy().

◆ HomogeneousFwdTrans()

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

Definition at line 1985 of file ExpList.h.

1988 {
1989  v_HomogeneousFwdTrans(inarray, outarray, Shuff, UnShuff);
1990 }
virtual void v_HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4518

References v_HomogeneousFwdTrans().

◆ ImposeDirichletConditions()

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

Impose Dirichlet Boundary Conditions onto Array.

Definition at line 2105 of file ExpList.h.

2106 {
2107  v_ImposeDirichletConditions(outarray);
2108 }
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4616

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

1137 {
1138 
1140  SpatialDomains::TriGeomSharedPtr TriangleGeom;
1141  SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
1146 
1147  int id = 0;
1149 
1150  m_expType = eNoType;
1151  // Process each expansion in the graph
1152  for (auto &expIt : expmap)
1153  {
1154  const SpatialDomains::ExpansionInfoShPtr expInfo = expIt.second;
1155 
1156  switch (expInfo->m_basisKeyVector.size())
1157  {
1158  case 1: // Segment Expansions
1159  {
1161  "Cannot mix expansion dimensions in one vector");
1162  m_expType = e1D;
1163 
1164  if ((SegmentGeom =
1165  std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1166  expInfo->m_geomShPtr)))
1167  {
1168  // Retrieve basis key from expansion
1169  LibUtilities::BasisKey bkey = expInfo->m_basisKeyVector[0];
1170 
1171  exp =
1173  bkey, SegmentGeom);
1174  }
1175  else
1176  {
1178  "dynamic cast to a 1D Geom failed");
1179  }
1180  }
1181  break;
1182  case 2:
1183  {
1185  "Cannot mix expansion dimensions in one vector");
1186  m_expType = e2D;
1187 
1188  LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1189  LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1190 
1191  if ((TriangleGeom =
1192  std::dynamic_pointer_cast<SpatialDomains ::TriGeom>(
1193  expInfo->m_geomShPtr)))
1194  {
1195 
1196  // This is not elegantly implemented needs re-thinking.
1197  if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange)
1198  {
1199  LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
1200  Ba.GetNumModes(),
1201  Ba.GetPointsKey());
1202 
1203  LibUtilities::PointsType TriNb =
1206  AllocateSharedPtr(newBa, Bb, TriNb, TriangleGeom);
1207  }
1208  else
1209  {
1211  AllocateSharedPtr(Ba, Bb, TriangleGeom);
1212  }
1213  }
1214  else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1215  SpatialDomains::QuadGeom>(expInfo->m_geomShPtr)))
1216  {
1217  exp =
1219  Ba, Bb, QuadrilateralGeom);
1220  }
1221  else
1222  {
1224  "dynamic cast to a 2D Geom failed");
1225  }
1226  }
1227  break;
1228  case 3:
1229  {
1231  "Cannot mix expansion dimensions in one vector");
1232  m_expType = e3D;
1233 
1234  LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1235  LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1236  LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1237 
1238  if ((TetGeom =
1239  std::dynamic_pointer_cast<SpatialDomains::TetGeom>(
1240  expInfo->m_geomShPtr)))
1241  {
1242 
1243  if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange ||
1244  Ba.GetBasisType() == LibUtilities::eGauss_Lagrange)
1245  {
1247  "LocalRegions::NodalTetExp is not implemented "
1248  "yet");
1249  }
1250  else
1251  {
1252  exp = MemoryManager<
1253  LocalRegions::TetExp>::AllocateSharedPtr(Ba, Bb, Bc,
1254  TetGeom);
1255  }
1256  }
1257  else if ((PrismGeom = std::dynamic_pointer_cast<
1258  SpatialDomains ::PrismGeom>(
1259  expInfo->m_geomShPtr)))
1260  {
1261  exp = MemoryManager<
1262  LocalRegions::PrismExp>::AllocateSharedPtr(Ba, Bb, Bc,
1263  PrismGeom);
1264  }
1265  else if ((PyrGeom = std::dynamic_pointer_cast<
1266  SpatialDomains::PyrGeom>(expInfo->m_geomShPtr)))
1267  {
1268 
1269  exp =
1271  Ba, Bb, Bc, PyrGeom);
1272  }
1273  else if ((HexGeom = std::dynamic_pointer_cast<
1274  SpatialDomains::HexGeom>(expInfo->m_geomShPtr)))
1275  {
1276  exp =
1278  Ba, Bb, Bc, HexGeom);
1279  }
1280  else
1281  {
1283  "dynamic cast to a Geom failed");
1284  }
1285  }
1286  break;
1287  default:
1289  "Dimension of basis key is greater than 3");
1290  }
1291 
1292  // Assign next id
1293  exp->SetElmtId(id++);
1294 
1295  // Add the expansion
1296  (*m_exp).push_back(exp);
1297  }
1298 }
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
Definition: BasisType.h:59
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:44
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
Definition: PrismGeom.h:84
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:77
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
Definition: MeshGraph.h:140
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:84
std::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:86

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

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

581  {
582  ASSERTL1(m_physState == true, "local physical space is not true ");
583 
584  return Integral(m_phys);
585  }

References ASSERTL1, m_phys, and m_physState.

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

604  {
605  return v_Integral(inarray);
606  }
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:3217

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

1790 {
1791  v_IProductWRTBase(inarray, outarray);
1792 }
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4686

References v_IProductWRTBase().

Referenced by Nektar::MultiRegions::ContField::FwdTrans(), Nektar::MultiRegions::ContField::LaplaceSolve(), MultiplyByMassMatrix(), 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 
)

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})\).

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.

Definition at line 1446 of file ExpList.cpp.

1449 {
1450  Array<OneD, NekDouble> tmp0, tmp1, tmp2;
1451  // assume coord dimension defines the size of Deriv Base
1452  int dim = GetCoordim(0);
1453 
1454  ASSERTL1(inarray.size() >= dim, "inarray is not of sufficient dimension");
1455 
1456  // initialise if required
1458  {
1459  for (int i = 0; i < m_collections.size(); ++i)
1460  {
1462  }
1464  }
1465 
1466  LibUtilities::Timer timer;
1467 
1468  LIKWID_MARKER_START("IProductWRTDerivBase_coll");
1469  timer.Start();
1470 
1471  switch (dim)
1472  {
1473  case 1:
1474  for (int i = 0; i < m_collections.size(); ++i)
1475  {
1476  m_collections[i].ApplyOperator(
1478  inarray[0] + m_coll_phys_offset[i],
1479  tmp0 = outarray + m_coll_coeff_offset[i]);
1480  }
1481  break;
1482  case 2:
1483  for (int i = 0; i < m_collections.size(); ++i)
1484  {
1485  m_collections[i].ApplyOperator(
1487  inarray[0] + m_coll_phys_offset[i],
1488  tmp0 = inarray[1] + m_coll_phys_offset[i],
1489  tmp1 = outarray + m_coll_coeff_offset[i]);
1490  }
1491  break;
1492  case 3:
1493  for (int i = 0; i < m_collections.size(); ++i)
1494  {
1495  m_collections[i].ApplyOperator(
1497  inarray[0] + m_coll_phys_offset[i],
1498  tmp0 = inarray[1] + m_coll_phys_offset[i],
1499  tmp1 = inarray[2] + m_coll_phys_offset[i],
1500  tmp2 = outarray + m_coll_coeff_offset[i]);
1501  }
1502  break;
1503  default:
1504  NEKERROR(ErrorUtil::efatal, "Dimension of inarray not correct");
1505  break;
1506  }
1507 
1508  timer.Stop();
1509  LIKWID_MARKER_STOP("IProductWRTDerivBase_coll");
1510 
1511  // Elapsed time
1512  timer.AccumulateRegion("Collections:IProductWRTDerivBase", 10);
1513 }
#define LIKWID_MARKER_START(regionTag)
Definition: Likwid.hpp:46
#define LIKWID_MARKER_STOP(regionTag)
Definition: Likwid.hpp:47

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

◆ IProductWRTDerivBase() [2/2]

void Nektar::MultiRegions::ExpList::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.

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

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.

Definition at line 1384 of file ExpList.cpp.

1387 {
1388  int i;
1389 
1390  Array<OneD, NekDouble> e_outarray;
1391 
1392  for (i = 0; i < (*m_exp).size(); ++i)
1393  {
1394  (*m_exp)[i]->IProductWRTDerivBase(dir, inarray + m_phys_offset[i],
1395  e_outarray =
1396  outarray + m_coeff_offset[i]);
1397  }
1398 }

References m_coeff_offset, and m_phys_offset.

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

1408 {
1409  int npts_e;
1410  int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1411  int nq = direction.size() / coordim;
1412 
1413  Array<OneD, NekDouble> e_outarray;
1414  Array<OneD, NekDouble> e_MFdiv;
1415 
1416  Array<OneD, NekDouble> locdir;
1417 
1418  for (int i = 0; i < (*m_exp).size(); ++i)
1419  {
1420  npts_e = (*m_exp)[i]->GetTotPoints();
1421  locdir = Array<OneD, NekDouble>(npts_e * coordim);
1422 
1423  for (int k = 0; k < coordim; ++k)
1424  {
1425  Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
1426  &locdir[k * npts_e], 1);
1427  }
1428 
1429  (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1430  locdir, inarray + m_phys_offset[i],
1431  e_outarray = outarray + m_coeff_offset[i]);
1432  }
1433 }

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_2\) error with respect to soln of the global spectral/hp element approximation.

Definition at line 551 of file ExpList.h.

554  {
555  return v_L2(inarray, soln);
556  }
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:3172

References v_L2().

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

◆ LinearAdvectionDiffusionReactionSolve()

void Nektar::MultiRegions::ExpList::LinearAdvectionDiffusionReactionSolve ( 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 1884 of file ExpList.h.

1889 {
1890  v_LinearAdvectionDiffusionReactionSolve(velocity, inarray, outarray, lambda,
1891  dirForcing);
1892 }
virtual void v_LinearAdvectionDiffusionReactionSolve(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:4496

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

1899 {
1900  v_LinearAdvectionReactionSolve(velocity, inarray, outarray, lambda,
1901  dirForcing);
1902 }
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:4507

References v_LinearAdvectionReactionSolve().

◆ Linf()

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

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

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

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

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

Definition at line 3134 of file ExpList.cpp.

3136 {
3137  NekDouble err = 0.0;
3138 
3139  if (soln == NullNekDouble1DArray)
3140  {
3141  err = Vmath::Vmax(m_npoints, inarray, 1);
3142  }
3143  else
3144  {
3145  for (int i = 0; i < m_npoints; ++i)
3146  {
3147  err = max(err, abs(inarray[i] - soln[i]));
3148  }
3149  }
3150 
3151  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
3152 
3153  return err;
3154 }
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.cpp:945
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:295

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

2121 {
2122  v_LocalToGlobal(useComm);
2123 }
virtual void v_LocalToGlobal(bool UseComm)
Definition: ExpList.cpp:4640

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

2128 {
2129  v_LocalToGlobal(inarray, outarray, useComm);
2130 }

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

1323 {
1324  // Retrieve the block matrix using the given key.
1325  const DNekScalBlkMatSharedPtr &blockmat = GetBlockMatrix(gkey);
1326  int nrows = blockmat->GetRows();
1327  int ncols = blockmat->GetColumns();
1328 
1329  // Create NekVectors from the given data arrays
1330  NekVector<NekDouble> in(ncols, inarray, eWrapper);
1331  NekVector<NekDouble> out(nrows, outarray, eWrapper);
1332 
1333  // Perform matrix-vector multiply.
1334  out = (*blockmat) * in;
1335 }
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:2010

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

1766 {
1767  GlobalMatrixKey mkey(StdRegions::eInvMass);
1768  const DNekScalBlkMatSharedPtr &InvMass = GetBlockMatrix(mkey);
1769 
1770  // Inverse mass matrix
1771  NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
1772  if (inarray.get() == outarray.get())
1773  {
1774  NekVector<NekDouble> in(m_ncoeffs, inarray); // copy data
1775  out = (*InvMass) * in;
1776  }
1777  else
1778  {
1779  NekVector<NekDouble> in(m_ncoeffs, inarray, eWrapper);
1780  out = (*InvMass) * in;
1781  }
1782 }

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

1861 {
1862  v_MultiplyByInvMassMatrix(inarray, outarray);
1863 }
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4474

References v_MultiplyByInvMassMatrix().

◆ MultiplyByMassMatrix()

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

Definition at line 314 of file ExpList.h.

317  {
318  Array<OneD, NekDouble> tmp(GetNpoints(), 0.0);
319  BwdTrans(inarray, tmp);
320  IProductWRTBase(tmp, outarray);
321  }
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:1787
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1719
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:1849

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

1343 {
1344  Array<OneD, NekDouble> e_outarray;
1345 
1346  for (int i = 0; i < (*m_exp).size(); ++i)
1347  {
1348  (*m_exp)[i]->MultiplyByQuadratureMetric(inarray + m_phys_offset[i],
1349  e_outarray = outarray +
1350  m_phys_offset[i]);
1351  }
1352 }

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

2046 {
2047  v_NormVectorIProductWRTBase(V, outarray);
2048 }
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:4563

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

2040 {
2041  v_NormVectorIProductWRTBase(V1, V2, outarray, BndID);
2042 }

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

2404 {
2405  v_PeriodicBwdCopy(Fwd, Bwd);
2406 }
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4976

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

1940 {
1941  v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
1942 }
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:1548

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

1950 {
1951  v_PhysDeriv(dir, inarray, out_d);
1952 }

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

1957 {
1958  v_PhysDeriv(edir, inarray, out_d);
1959 }

References v_PhysDeriv().

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

1968 {
1969  v_PhysDirectionalDeriv(direction, inarray, outarray);
1970 }
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1713

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

2637 {
2638  int dim = GetCoordim(0);
2639  ASSERTL0(dim == coords.size(), "Invalid coordinate dimension.");
2640 
2641  // Grab the element index corresponding to coords.
2642  Array<OneD, NekDouble> xi(dim);
2643  int elmtIdx = GetExpIndex(coords, xi);
2644  ASSERTL0(elmtIdx > 0, "Unable to find element containing point.");
2645 
2646  // Grab that element's physical storage.
2647  Array<OneD, NekDouble> elmtPhys = phys + m_phys_offset[elmtIdx];
2648 
2649  // Evaluate the element at the appropriate point.
2650  return (*m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
2651 }

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

Referenced by export_ExpList().

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

684  {
685  v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
686  }
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5917

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

673  {
674  v_PhysInterp1DScaled(scale, inarray, outarray);
675  }
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5268

References v_PhysInterp1DScaled().

◆ Reset()

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

Reset geometry information and reset matrices.

Definition at line 407 of file ExpList.h.

408  {
409  v_Reset();
410  }
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:2670

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

2294 {
2295  v_SetBndCondBwdWeight(index, value);
2296 }
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
Definition: ExpList.cpp:4444

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

2074 {
2075  m_coeffs[i] = val;
2076 }

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

2083 {
2084  m_coeffs[i] = val;
2085 }

References m_coeffs.

◆ SetCoeffsArray()

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

Set the m_coeffs array to inarray.

Definition at line 2087 of file ExpList.h.

2088 {
2089  m_coeffs = inarray;
2090 }

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

623  {
625  }
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1616

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

653  {
654  return v_SetHomoLen(lhom);
655  }
virtual void v_SetHomoLen(const NekDouble lhom)
Definition: ExpList.cpp:3275

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

1755 {
1756  ASSERTL0(inarray.size() == m_npoints,
1757  "Input array does not have correct number of elements.");
1758 
1759  Vmath::Vcopy(m_npoints, &inarray[0], 1, &m_phys[0], 1);
1760  m_physState = true;
1761 }

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

1742 {
1743  m_phys[i] = val;
1744 }

References m_phys.

◆ SetPhysArray()

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

Sets the array m_phys.

Definition at line 1763 of file ExpList.h.

1764 {
1765  m_phys = inarray;
1766 }

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

1772 {
1773  m_physState = physState;
1774 }

References m_physState.

Referenced by export_ExpList().

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

1093 {
1094  if (SetupOffsets)
1095  {
1096  int i;
1097 
1098  // Set up offset information and array sizes
1099  m_coeff_offset = Array<OneD, int>(m_exp->size());
1100  m_phys_offset = Array<OneD, int>(m_exp->size());
1101 
1102  m_ncoeffs = m_npoints = 0;
1103 
1104  for (i = 0; i < m_exp->size(); ++i)
1105  {
1107  m_phys_offset[i] = m_npoints;
1108  m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
1109  m_npoints += (*m_exp)[i]->GetTotPoints();
1110  }
1111  }
1112 
1113  if (DeclareCoeffPhysArrays)
1114  {
1115  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
1116  m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
1117  }
1118 
1119  m_coeffsToElmt = Array<OneD, pair<int, int>>{size_t(m_ncoeffs)};
1120 
1121  for (int i = 0; i < m_exp->size(); ++i)
1122  {
1123  int coeffs_offset = m_coeff_offset[i];
1124 
1125  int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1126 
1127  for (int j = 0; j < loccoeffs; ++j)
1128  {
1129  m_coeffsToElmt[coeffs_offset + j].first = i;
1130  m_coeffsToElmt[coeffs_offset + j].second = j;
1131  }
1132  }
1133 }

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

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

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

1728 {
1729  m_WaveSpace = wavespace;
1730 }

References m_WaveSpace.

◆ SmoothField()

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

Smooth a field across elements.

Definition at line 1826 of file ExpList.h.

1827 {
1828  v_SmoothField(field);
1829 }
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:1834

References v_SmoothField().

◆ UpdateBndCondExpansion()

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

Definition at line 2298 of file ExpList.h.

2299 {
2300  return v_UpdateBndCondExpansion(i);
2301 }
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:3773

References v_UpdateBndCondExpansion().

◆ UpdateBndConditions()

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

Definition at line 2432 of file ExpList.h.

2433 {
2434  return v_UpdateBndConditions();
2435 }
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:4997

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

2252 {
2253  return m_coeffs;
2254 }

References m_coeffs.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous2D::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 2262 of file ExpList.h.

2263 {
2264  m_physState = true;
2265  return m_phys;
2266 }

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

2307 {
2308  v_Upwind(Vec, Fwd, Bwd, Upwind);
2309 }
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:3792
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:2311

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

2315 {
2316  v_Upwind(Vn, Fwd, Bwd, Upwind);
2317 }

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

4374 {
4375  boost::ignore_unused(Fwd, Bwd, outarray);
4377  "This method is not defined or valid for this class type");
4378 }

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

Referenced by AddFwdBwdTraceIntegral().

◆ v_AddTraceIntegral() [1/2]

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

4365 {
4366  boost::ignore_unused(Fn, outarray);
4368  "This method is not defined or valid for this class type");
4369 }

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

◆ v_AddTraceIntegral() [2/2]

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

Definition at line 4354 of file ExpList.cpp.

4357 {
4358  boost::ignore_unused(Fx, Fy, outarray);
4360  "This method is not defined or valid for this class type");
4361 }

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 
)
privatevirtual

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5344 of file ExpList.cpp.

5348 {
5349  boost::ignore_unused(FwdFlux, BwdFlux, outarray);
5350  NEKERROR(ErrorUtil::efatal, "AddTraceIntegralToOffDiag not defined");
5351 }

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

4411 {
4412  boost::ignore_unused(field, Fwd, Bwd);
4414  "v_AddTraceQuadPhysToField is not defined for this class type");
4415 }

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

4420 {
4421  boost::ignore_unused(field, Fwd, Bwd);
4423  "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4424 }

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3506 of file ExpList.cpp.

3509 {
3510  v_AppendFieldData(fielddef, fielddata, m_coeffs);
3511 }

References m_coeffs.

Referenced by 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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3513 of file ExpList.cpp.

3516 {
3517  int i;
3518  // Determine mapping from element ids to location in
3519  // expansion list
3520  // Determine mapping from element ids to location in
3521  // expansion list
3522  map<int, int> ElmtID_to_ExpID;
3523  for (i = 0; i < (*m_exp).size(); ++i)
3524  {
3525  ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3526  }
3527 
3528  for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3529  {
3530  int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3531  int datalen = (*m_exp)[eid]->GetNcoeffs();
3532  fielddata.insert(fielddata.end(), &coeffs[m_coeff_offset[eid]],
3533  &coeffs[m_coeff_offset[eid]] + datalen);
3534  }
3535 }

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 2467 of file ExpList.cpp.

2469 {
2470  LibUtilities::Timer timer;
2471 
2472  if (m_expType == e0D)
2473  {
2474  Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
2475  }
2476  else
2477  {
2478  // initialise if required
2480  {
2481  for (int i = 0; i < m_collections.size(); ++i)
2482  {
2483  m_collections[i].Initialise(Collections::eBwdTrans);
2484  }
2486  }
2487 
2488  LIKWID_MARKER_START("v_BwdTrans");
2489  timer.Start();
2490 
2491  Array<OneD, NekDouble> tmp;
2492  for (int i = 0; i < m_collections.size(); ++i)
2493  {
2494  m_collections[i].ApplyOperator(
2496  tmp = outarray + m_coll_phys_offset[i]);
2497  }
2498 
2499  timer.Stop();
2500  LIKWID_MARKER_STOP("v_BwdTrans");
2501  }
2502 
2503  // Elapsed time
2504  timer.AccumulateRegion("Collections:BwdTrans", 10);
2505 }

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MultiRegions::e0D, Nektar::Collections::eBwdTrans, LIKWID_MARKER_START, LIKWID_MARKER_STOP, m_coll_coeff_offset, m_coll_phys_offset, 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::ContField3DHomogeneous2D, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField.

Definition at line 3298 of file ExpList.cpp.

3299 {
3301  "This method is not defined or valid for this class type");
3302 }

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

Referenced by ClearGlobalLinSysManager().

◆ v_CurlCurl()

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

Definition at line 1645 of file ExpList.cpp.

1647 {
1648  int nq = GetTotPoints();
1649  Array<OneD, NekDouble> Vx(nq);
1650  Array<OneD, NekDouble> Uy(nq);
1651  Array<OneD, NekDouble> Dummy(nq);
1652 
1653  bool halfMode = false;
1654  if (GetExpType() == e3DH1D)
1655  {
1656  m_session->MatchSolverInfo("ModeType", "HalfMode", halfMode, false);
1657  }
1658 
1659  switch (m_expType)
1660  {
1661  case e2D:
1662  {
1663  PhysDeriv(xDir, Vel[yDir], Vx);
1664  PhysDeriv(yDir, Vel[xDir], Uy);
1665 
1666  Vmath::Vsub(nq, Vx, 1, Uy, 1, Dummy, 1);
1667 
1668  PhysDeriv(Dummy, Q[1], Q[0]);
1669 
1670  Vmath::Smul(nq, -1.0, Q[1], 1, Q[1], 1);
1671  }
1672  break;
1673 
1674  case e3D:
1675  case e3DH1D:
1676  case e3DH2D:
1677  {
1678  Array<OneD, NekDouble> Vz(nq);
1679  Array<OneD, NekDouble> Uz(nq);
1680  Array<OneD, NekDouble> Wx(nq);
1681  Array<OneD, NekDouble> Wy(nq);
1682 
1683  PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
1684  PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
1685  PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
1686 
1687  Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
1688  Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
1689  Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
1690 
1691  PhysDeriv(Q[0], Dummy, Uy, Uz);
1692  PhysDeriv(Q[1], Vx, Dummy, Vz);
1693  PhysDeriv(Q[2], Wx, Wy, Dummy);
1694 
1695  // For halfmode, need to change the sign of z derivatives
1696  if (halfMode)
1697  {
1698  Vmath::Neg(nq, Uz, 1);
1699  Vmath::Neg(nq, Vz, 1);
1700  }
1701 
1702  Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
1703  Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
1704  Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
1705  }
1706  break;
1707  default:
1708  ASSERTL0(0, "Dimension not supported");
1709  break;
1710  }
1711 }
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition: ExpList.h:1954
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:1303
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:518
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.cpp:419

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 Array< OneD, Array< OneD, NekDouble >> &  inarray1,
const Array< OneD, Array< OneD, NekDouble >> &  inarray2,
Array< OneD, Array< OneD, NekDouble >> &  outarray 
)
protectedvirtual

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

Definition at line 4545 of file ExpList.cpp.

4549 {
4550  boost::ignore_unused(inarray1, inarray2, outarray);
4552  "This method is not defined or valid for this class type");
4553 }

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

Referenced by DealiasedDotProd().

◆ v_DealiasedProd()

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

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

Definition at line 4536 of file ExpList.cpp.

4539 {
4540  boost::ignore_unused(inarray1, inarray2, outarray);
4542  "This method is not defined or valid for this class type");
4543 }

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 
)
privatevirtual

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

Definition at line 5007 of file ExpList.cpp.

5011 {
5012  boost::ignore_unused(time, varName, x2_in, x3_in);
5014  "This method is not defined or valid for this class type");
5015 }

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

3653 {
3654  int i;
3655  int offset = 0;
3656 
3657  for (i = 0; i < (*m_exp).size(); ++i)
3658  {
3659  std::vector<unsigned int> nummodes;
3660  vector<LibUtilities::BasisType> basisTypes;
3661  for (int j = 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
3662  {
3663  nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
3664  basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
3665  }
3666 
3667  (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
3668  &toCoeffs[m_coeff_offset[i]],
3669  basisTypes);
3670 
3671  offset += fromExpList->GetExp(i)->GetNcoeffs();
3672  }
3673 }

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 
)
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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3562 of file ExpList.cpp.

3566 {
3567  int i, expId;
3568  int offset = 0;
3569  int modes_offset = 0;
3570  int datalen = fielddata.size() / fielddef->m_fields.size();
3571 
3572  // Find data location according to field definition
3573  for (i = 0; i < fielddef->m_fields.size(); ++i)
3574  {
3575  if (fielddef->m_fields[i] == field)
3576  {
3577  break;
3578  }
3579  offset += datalen;
3580  }
3581 
3582  ASSERTL0(i != fielddef->m_fields.size(),
3583  "Field (" + field + ") not found in file.");
3584 
3585  if (m_elmtToExpId.size() == 0)
3586  {
3587  // Loop in reverse order so that in case where using a
3588  // Homogeneous expansion it sets geometry ids to first part of
3589  // m_exp list. Otherwise will set to second (complex) expansion
3590  for (i = (*m_exp).size() - 1; i >= 0; --i)
3591  {
3592  m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3593  }
3594  }
3595 
3596  for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3597  {
3598  // Reset modes_offset in the case where all expansions of
3599  // the same order.
3600  if (fielddef->m_uniOrder == true)
3601  {
3602  modes_offset = 0;
3603  }
3604 
3606  fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
3607 
3608  const int elmtId = fielddef->m_elementIDs[i];
3609  auto eIt = m_elmtToExpId.find(elmtId);
3610 
3611  if (eIt == m_elmtToExpId.end())
3612  {
3613  offset += datalen;
3614  modes_offset += (*m_exp)[0]->GetNumBases();
3615  continue;
3616  }
3617 
3618  expId = eIt->second;
3619 
3620  bool sameBasis = true;
3621  for (int j = 0; j < fielddef->m_basis.size(); ++j)
3622  {
3623  if (fielddef->m_basis[j] != (*m_exp)[expId]->GetBasisType(j))
3624  {
3625  sameBasis = false;
3626  break;
3627  }
3628  }
3629 
3630  if (datalen == (*m_exp)[expId]->GetNcoeffs() && sameBasis)
3631  {
3632  Vmath::Vcopy(datalen, &fielddata[offset], 1,
3633  &coeffs[m_coeff_offset[expId]], 1);
3634  }
3635  else
3636  {
3637  (*m_exp)[expId]->ExtractDataToCoeffs(
3638  &fielddata[offset], fielddef->m_numModes, modes_offset,
3639  &coeffs[m_coeff_offset[expId]], fielddef->m_basis);
3640  }
3641 
3642  offset += datalen;
3643  modes_offset += (*m_exp)[0]->GetNumBases();
3644  }
3645 
3646  return;
3647 }
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
Definition: ShapeType.hpp:308

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

4806 {
4807  int n, cnt;
4808  Array<OneD, NekDouble> tmp1, tmp2;
4810 
4811  Array<OneD, int> ElmtID, EdgeID;
4812  GetBoundaryToElmtMap(ElmtID, EdgeID);
4813 
4814  // Initialise result
4815  boundary =
4816  Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
4817 
4818  // Skip other boundary regions
4819  for (cnt = n = 0; n < i; ++n)
4820  {
4821  cnt += GetBndCondExpansions()[n]->GetExpSize();
4822  }
4823 
4824  int offsetBnd;
4825  int offsetElmt = 0;
4826  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4827  {
4828  offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
4829 
4830  elmt = GetExp(ElmtID[cnt + n]);
4831  elmt->GetTracePhysVals(
4832  EdgeID[cnt + n], GetBndCondExpansions()[i]->GetExp(n),
4833  tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
4834 
4835  offsetElmt += elmt->GetTotPoints();
4836  }
4837 }
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:2270
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2450

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

4883 {
4884  int n, cnt;
4885  Array<OneD, NekDouble> tmp1;
4887 
4888  Array<OneD, int> ElmtID, EdgeID;
4889  GetBoundaryToElmtMap(ElmtID, EdgeID);
4890 
4891  // Initialise result
4892  bnd =
4893  Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
4894 
4895  // Skip other boundary regions
4896  for (cnt = n = 0; n < i; ++n)
4897  {
4898  cnt += GetBndCondExpansions()[n]->GetExpSize();
4899  }
4900 
4901  int offsetBnd;
4902  int offsetPhys;
4903  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4904  {
4905  offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
4906  offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
4907 
4908  elmt = GetExp(ElmtID[cnt + n]);
4909  elmt->GetTracePhysVals(EdgeID[cnt + n],
4910  GetBndCondExpansions()[i]->GetExp(n),
4911  phys + offsetPhys, tmp1 = bnd + offsetBnd);
4912  }
4913 }

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

4844 {
4845  int n, cnt, nq;
4846 
4847  Array<OneD, int> ElmtID, EdgeID;
4848  GetBoundaryToElmtMap(ElmtID, EdgeID);
4849 
4850  // Skip other boundary regions
4851  for (cnt = n = 0; n < i; ++n)
4852  {
4853  cnt += GetBndCondExpansions()[n]->GetExpSize();
4854  }
4855 
4856  // Count number of points
4857  int npoints = 0;
4858  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4859  {
4860  npoints += GetExp(ElmtID[cnt + n])->GetTotPoints();
4861  }
4862 
4863  // Initialise result
4864  bndElmt = Array<OneD, NekDouble>(npoints, 0.0);
4865 
4866  // Extract data
4867  int offsetPhys;
4868  int offsetElmt = 0;
4869  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4870  {
4871  nq = GetExp(ElmtID[cnt + n])->GetTotPoints();
4872  offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
4873  Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
4874  offsetElmt += nq;
4875  }
4876 }

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::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 4459 of file ExpList.cpp.

4460 {
4461  boost::ignore_unused(outarray);
4463  "This method is not defined or valid for this class type");
4464 }

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::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 4466 of file ExpList.cpp.

4468 {
4469  boost::ignore_unused(inarray, outarray);
4471  "This method is not defined or valid for this class type");
4472 }

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

◆ v_FillBndCondFromField() [1/2]

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

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

Definition at line 4625 of file ExpList.cpp.

4626 {
4628  "This method is not defined or valid for this class type");
4629 }

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

Referenced by FillBndCondFromField().

◆ v_FillBndCondFromField() [2/2]

void Nektar::MultiRegions::ExpList::v_FillBndCondFromField ( const int  nreg)
protectedvirtual

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

Definition at line 4633 of file ExpList.cpp.

4634 {
4635  boost::ignore_unused(nreg);
4637  "This method is not defined or valid for this class type");
4638 }

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

4402 {
4403  boost::ignore_unused(Fwd, Bwd, PutFwdInBwdOnBCs);
4405  "This method is not defined or valid for this class type");
4406 }

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

4971 {
4972  boost::ignore_unused(weightave, weightjmp);
4973  NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
4974 }

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

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

Definition at line 4669 of file ExpList.cpp.

4671 {
4672  v_FwdTransLocalElmt(inarray, outarray);
4673 }

References v_FwdTransLocalElmt().

Referenced by FwdTrans().

◆ v_FwdTransBndConstrained()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1811 of file ExpList.cpp.

1814 {
1815  int i;
1816 
1817  Array<OneD, NekDouble> e_outarray;
1818 
1819  for (i = 0; i < (*m_exp).size(); ++i)
1820  {
1821  (*m_exp)[i]->FwdTransBndConstrained(inarray + m_phys_offset[i],
1822  e_outarray =
1823  outarray + m_coeff_offset[i]);
1824  }
1825 }

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1802 of file ExpList.cpp.

1804 {
1805  Array<OneD, NekDouble> f(m_ncoeffs);
1806 
1807  IProductWRTBase(inarray, f);
1808  MultiplyByElmtInvMass(f, outarray);
1809 }
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:1764

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

4557 {
4558  boost::ignore_unused(BndVals, TotField, BndID);
4560  "This method is not defined or valid for this class type");
4561 }

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

4437 {
4439  "v_GetBndCondBwdWeight is not defined for this class type");
4440  static Array<OneD, NekDouble> tmp;
4441  return tmp;
4442 }

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::DisContField3DHomogeneous2D, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 3765 of file ExpList.cpp.

3766 {
3768  "This method is not defined or valid for this class type");
3769  static Array<OneD, const std::shared_ptr<ExpList>> result;
3770  return result;
3771 }

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

Referenced by GetBndCondExpansions().

◆ v_GetBndConditions()

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

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

Definition at line 4986 of file ExpList.cpp.

4987 {
4989  "This method is not defined or valid for this class type");
4990  static Array<OneD, const SpatialDomains::BoundaryConditionShPtr> result;
4991  return result;
4992 }

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::DisContField3DHomogeneous2D, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 4793 of file ExpList.cpp.

4795 {
4796  boost::ignore_unused(i, result, DeclareCoeffPhysArrays);
4798  "This method is not defined or valid for this class type");
4799 }

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

4919 {
4920  int j, n, cnt, nq;
4921  int coordim = GetCoordim(0);
4922  Array<OneD, NekDouble> tmp;
4924 
4925  Array<OneD, int> ElmtID, EdgeID;
4926  GetBoundaryToElmtMap(ElmtID, EdgeID);
4927 
4928  // Initialise result
4929  normals = Array<OneD, Array<OneD, NekDouble>>(coordim);
4930  for (j = 0; j < coordim; ++j)
4931  {
4932  normals[j] = Array<OneD, NekDouble>(
4933  GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
4934  }
4935 
4936  // Skip other boundary regions
4937  for (cnt = n = 0; n < i; ++n)
4938  {
4939  cnt += GetBndCondExpansions()[n]->GetExpSize();
4940  }
4941 
4942  int offset;
4943  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4944  {
4945  offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
4946  nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
4947 
4948  elmt = GetExp(ElmtID[cnt + n]);
4949  const Array<OneD, const Array<OneD, NekDouble>> normalsElmt =
4950  elmt->GetTraceNormal(EdgeID[cnt + n]);
4951  // Copy to result
4952  for (j = 0; j < coordim; ++j)
4953  {
4954  Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
4955  }
4956  }
4957 }

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::DisContField, Nektar::MultiRegions::DisContField3DHomogeneous2D, and Nektar::MultiRegions::DisContField3DHomogeneous1D.

Definition at line 4961 of file ExpList.cpp.

4963 {
4964  boost::ignore_unused(ElmtID, EdgeID);
4966  "This method is not defined or valid for this class type");
4967 }

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,
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::ExpList3DHomogeneous2D, Nektar::MultiRegions::ExpList3DHomogeneous1D, Nektar::MultiRegions::ExpList2DHomogeneous1D, and Nektar::MultiRegions::ExpList1DHomogeneous2D.

Definition at line 4720 of file ExpList.cpp.

4723 {
4724  if (GetNumElmts() == 0)
4725  {
4726  return;
4727  }
4728 
4729  int i;
4730  Array<OneD, NekDouble> e_coord_0;
4731  Array<OneD, NekDouble> e_coord_1;
4732  Array<OneD, NekDouble> e_coord_2;
4733 
4734  switch (GetExp(0)->GetCoordim())
4735  {
4736  case 1:
4737  for (i = 0; i < (*m_exp).size(); ++i)
4738  {
4739  e_coord_0 = coord_0 + m_phys_offset[i];
4740  (*m_exp)[i]->GetCoords(e_coord_0);
4741  }
4742  break;
4743  case 2:
4744  ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
4745 
4746  for (i = 0; i < (*m_exp).size(); ++i)
4747  {
4748  e_coord_0 = coord_0 + m_phys_offset[i];
4749  e_coord_1 = coord_1 + m_phys_offset[i];
4750  (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
4751  }
4752  break;
4753  case 3:
4754  ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
4755  ASSERTL0(coord_2.size() != 0, "output coord_2 is not defined");
4756 
4757  for (i = 0; i < (*m_exp).size(); ++i)
4758  {
4759  e_coord_0 = coord_0 + m_phys_offset[i];
4760  e_coord_1 = coord_1 + m_phys_offset[i];
4761  e_coord_2 = coord_2 + m_phys_offset[i];
4762  (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
4763  }
4764  break;
4765  }
4766 }

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

Reimplemented in Nektar::MultiRegions::ExpList3DHomogeneous1D.

Definition at line 4768 of file ExpList.cpp.

4771 {
4772  (*m_exp)[eid]->GetCoords(xc0, xc1, xc2);
4773 }

◆ v_GetFieldDefinitions() [1/2]

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

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

Definition at line 3498 of file ExpList.cpp.

3500 {
3501  GeneralGetFieldDefinitions(fielddef);
3502 }
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:3379

References GeneralGetFieldDefinitions().

◆ v_GetFieldDefinitions() [2/2]

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

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

Definition at line 3490 of file ExpList.cpp.

3492 {
3493  std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3494  v_GetFieldDefinitions(returnval);
3495  return returnval;
3496 }

Referenced by 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 4380 of file ExpList.cpp.

4382 {
4383  boost::ignore_unused(Fwd, Bwd);
4385  "This method is not defined or valid for this class type");
4386 }

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

4392 {
4393  boost::ignore_unused(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
4394  DoExchange);
4396  "This method is not defined or valid for this class type");
4397 }

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

◆ v_GetHomogeneousBasis()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1608 of file ExpList.h.

1609  {
1611  "This method is not defined or valid for this class type");
1613  }
static BasisSharedPtr NullBasisSharedPtr
Definition: Basis.h:369

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

3268 {
3270  "This method is not defined or valid for this class type");
3271  NekDouble len = 0.0;
3272  return len;
3273 }

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

4452 {
4454  "This method is not defined or valid for this class type");
4455  static vector<bool> tmp;
4456  return tmp;
4457 }

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

3912 {
3914  "This method is not defined or valid for this class type");
3915  static std::vector<bool> result;
3916  return result;
3917 }

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

4430 {
4431  boost::ignore_unused(Fwd, Bwd, locTraceFwd, locTraceBwd);
4433  "v_GetLocTraceFromTracePts is not defined for this class");
4434 }

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

5993 {
5994  NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
5996 }
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 3691 of file ExpList.cpp.

3694 {
3695  int npts;
3696 
3697  int MFdim = 3;
3698  int nq = outarray[0].size() / MFdim;
3699 
3700  // Assume whole array is of same coordinate dimension
3701  int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
3702 
3703  Array<OneD, Array<OneD, NekDouble>> MFloc(MFdim * coordim);
3704  // Process each expansion.
3705  for (int i = 0; i < m_exp->size(); ++i)
3706  {
3707  npts = (*m_exp)[i]->GetTotPoints();
3708 
3709  for (int j = 0; j < MFdim * coordim; ++j)
3710  {
3711  MFloc[j] = Array<OneD, NekDouble>(npts, 0.0);
3712  }
3713 
3714  // MF from LOCALREGIONS
3715  (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
3716  (*m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
3717 
3718  // Get the physical data offset for this expansion.
3719  for (int j = 0; j < MFdim; ++j)
3720  {
3721  for (int k = 0; k < coordim; ++k)
3722  {
3723  Vmath::Vcopy(npts, &MFloc[j * coordim + k][0], 1,
3724  &outarray[j][k * nq + m_phys_offset[i]], 1);
3725  }
3726  }
3727  }
3728 }

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.

Parameters
normalsMultidimensional array in which to copy normals to. Must have dimension equal to or larger than the spatial dimension of the elements.

Reimplemented in Nektar::MultiRegions::ExpList2DHomogeneous1D.

Definition at line 3989 of file ExpList.cpp.

3990 {
3991  int i, j, k, e_npoints, offset;
3992  Array<OneD, Array<OneD, NekDouble>> locnormals;
3993 
3994  // Assume whole array is of same coordinate dimension
3995  int coordim = GetCoordim(0);
3996 
3997  ASSERTL1(normals.size() >= coordim,
3998  "Output vector does not have sufficient dimensions to "
3999  "match coordim");
4000 
4001  switch (m_expType)
4002  {
4003  case e0D:
4004  {
4005  // Process each expansion.
4006  for (i = 0; i < m_exp->size(); ++i)
4007  {
4008  LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
4009 
4011  loc_exp->GetLeftAdjacentElementExp();
4012 
4013  // Get the number of points and normals for this expansion.
4014  e_npoints = 1;
4015  locnormals = loc_elmt->GetTraceNormal(
4016  loc_exp->GetLeftAdjacentElementTrace());
4017 
4018  // Get the physical data offset for this expansion.
4019  offset = m_phys_offset[i];
4020 
4021  // Process each point in the expansion.
4022  for (j = 0; j < e_npoints; ++j)
4023  {
4024  // Process each spatial dimension and copy the
4025  // values into the output array.
4026  for (k = 0; k < coordim; ++k)
4027  {
4028  normals[k][offset] = locnormals[k][0];
4029  }
4030  }
4031  }
4032  }
4033  break;
4034  case e1D:
4035  {
4037  Array<OneD, Array<OneD, NekDouble>> locnormals2;
4038  Array<OneD, Array<OneD, NekDouble>> Norms;
4039 
4040  for (i = 0; i < m_exp->size(); ++i)
4041  {
4042  LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
4043 
4045  loc_exp->GetLeftAdjacentElementExp();
4046 
4047  int edgeNumber = loc_exp->GetLeftAdjacentElementTrace();
4048 
4049  // Get the number of points and normals for this expansion.
4050  e_npoints = (*m_exp)[i]->GetNumPoints(0);
4051 
4052  locnormals = loc_elmt->GetTraceNormal(edgeNumber);
4053  int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4054  int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
4055 
4056  if (e_nmodes != loc_nmodes)
4057  {
4058  if (loc_exp->GetRightAdjacentElementTrace() >= 0)
4059  {
4061  loc_exp->GetRightAdjacentElementExp();
4062 
4063  int EdgeNumber =
4064  loc_exp->GetRightAdjacentElementTrace();
4065 
4066  // Serial case: right element is connected so we can
4067  // just grab that normal.
4068  locnormals = loc_elmt->GetTraceNormal(EdgeNumber);
4069 
4070  offset = m_phys_offset[i];
4071 
4072  // Process each point in the expansion.
4073  for (j = 0; j < e_npoints; ++j)
4074  {
4075  // Process each spatial dimension and
4076  // copy the values into the output
4077  // array.
4078  for (k = 0; k < coordim; ++k)
4079  {
4080  normals[k][offset + j] = -locnormals[k][j];
4081  }
4082  }
4083  }
4084  else
4085  {
4086  // Parallel case: need to interpolate normal.
4087  Array<OneD, Array<OneD, NekDouble>> normal(coordim);
4088 
4089  for (int p = 0; p < coordim; ++p)
4090  {
4091  normal[p] = Array<OneD, NekDouble>(e_npoints, 0.0);
4092  LibUtilities::PointsKey to_key =
4093  loc_exp->GetBasis(0)->GetPointsKey();
4094  LibUtilities::PointsKey from_key =
4095  loc_elmt->GetBasis(0)->GetPointsKey();
4096  LibUtilities::Interp1D(from_key, locnormals[p],
4097  to_key, normal[p]);
4098  }
4099 
4100  offset = m_phys_offset[i];
4101 
4102  // Process each point in the expansion.
4103  for (j = 0; j < e_npoints; ++j)
4104  {
4105  // Process each spatial dimension and copy the
4106  // values into the output array.
4107  for (k = 0; k < coordim; ++k)
4108  {
4109  normals[k][offset + j] = normal[k][j];
4110  }
4111  }
4112  }
4113  }
4114  else
4115  {
4116  // Get the physical data offset for this expansion.
4117  offset = m_phys_offset[i];
4118 
4119  // Process each point in the expansion.
4120  for (j = 0; j < e_npoints; ++j)
4121  {
4122  // Process each spatial dimension and copy the values
4123  // into the output array.
4124  for (k = 0; k < coordim; ++k)
4125  {
4126  normals[k][offset + j] = locnormals[k][j];
4127  }
4128  }
4129  }
4130  }
4131  }
4132  break;
4133  case e2D:
4134  {
4135  Array<OneD, NekDouble> tmp;
4136 
4137  // Process each expansion.
4138  for (i = 0; i < m_exp->size(); ++i)
4139  {
4140  LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4142  traceExp->GetLeftAdjacentElementExp();
4143 
4144  // Get the number of points and normals for this expansion.
4145  int faceNum = traceExp->GetLeftAdjacentElementTrace();
4146  int offset = m_phys_offset[i];
4147 
4148  const Array<OneD, const Array<OneD, NekDouble>> &locNormals =
4149  exp3D->GetTraceNormal(faceNum);
4150 
4151  // Project normals from 3D element onto the same
4152  // orientation as the trace expansion.
4153  StdRegions::Orientation orient = exp3D->GetTraceOrient(faceNum);
4154 
4155  int fromid0, fromid1;
4156 
4158  {
4159  fromid0 = 0;
4160  fromid1 = 1;
4161  }
4162  else
4163  {
4164  fromid0 = 1;
4165  fromid1 = 0;
4166  }
4167 
4168  LibUtilities::BasisKey faceBasis0 =
4169  exp3D->GetTraceBasisKey(faceNum, fromid0);
4170  LibUtilities::BasisKey faceBasis1 =
4171  exp3D->GetTraceBasisKey(faceNum, fromid1);
4172  LibUtilities::BasisKey traceBasis0 =
4173  traceExp->GetBasis(0)->GetBasisKey();
4174  LibUtilities::BasisKey traceBasis1 =
4175  traceExp->GetBasis(1)->GetBasisKey();
4176 
4177  const int faceNq0 = faceBasis0.GetNumPoints();
4178  const int faceNq1 = faceBasis1.GetNumPoints();
4179 
4180  Array<OneD, int> faceids;
4181  exp3D->ReOrientTracePhysMap(orient, faceids, faceNq0, faceNq1);
4182 
4183  Array<OneD, NekDouble> traceNormals(faceNq0 * faceNq1);
4184 
4185  for (j = 0; j < coordim; ++j)
4186  {
4187  Vmath::Scatr(faceNq0 * faceNq1, locNormals[j], faceids,
4188  traceNormals);
4189 
4191  faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4192  traceNormals, traceBasis0.GetPointsKey(),
4193  traceBasis1.GetPointsKey(), tmp = normals[j] + offset);
4194  }
4195  }
4196  }
4197  break;
4198  default:
4199  {
4201  "This method is not defined or valid for this class type");
4202  }
4203  }
4204 }
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
Definition: Vmath.cpp:822

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

Referenced by GetNormals().

◆ v_GetNumElmts()

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

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

Definition at line 1263 of file ExpList.h.

1264  {
1265  return (*m_exp).size();
1266  }

Referenced by GetNumElmts().

◆ v_GetPeriodicEntities()

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

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

Definition at line 5029 of file ExpList.cpp.

5032 {
5033  boost::ignore_unused(periodicVerts, periodicEdges, periodicFaces);
5035  "This method is not defined or valid for this class type");
5036 }

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

Referenced by GetPeriodicEntities().

◆ v_GetPlane()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 5059 of file ExpList.cpp.

5060 {
5061  boost::ignore_unused(n);
5063  "This method is not defined or valid for this class type");
5064  return NullExpListSharedPtr;
5065 }
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1633

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

Referenced by GetPlane().

◆ v_GetRobinBCInfo()

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

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

Definition at line 5019 of file ExpList.cpp.

5020 {
5022  "This method is not defined or valid for this class type");
5023  static map<int, RobinBCInfoSharedPtr> result;
5024  return result;
5025 }

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::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 3890 of file ExpList.cpp.

3891 {
3893  "This method is not defined or valid for this class type");
3894  static std::shared_ptr<ExpList> returnVal;
3895  return returnVal;
3896 }

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

3907 {
3908  return GetTraceMap()->GetBndCondIDToGlobalTraceID();
3909 }
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2324

References GetTraceMap().

Referenced by GetTraceBndMap().

◆ v_GetTraceMap()

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

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

Definition at line 3898 of file ExpList.cpp.

3899 {
3901  "This method is not defined or valid for this class type");
3902  static std::shared_ptr<AssemblyMapDG> result;
3903  return result;
3904 }

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

3260 {
3262  "This method is not defined or valid for this class type");
3264  return trans;
3265 }
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 3290 of file ExpList.cpp.

3291 {
3293  "This method is not defined or valid for this class type");
3294  Array<OneD, unsigned int> NoModes(1);
3295  return NoModes;
3296 }

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

3283 {
3285  "This method is not defined or valid for this class type");
3286  Array<OneD, unsigned int> NoModes(1);
3287  return NoModes;
3288 }

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

4663 {
4664  boost::ignore_unused(inarray, outarray);
4666  "This method is not defined or valid for this class type");
4667 }

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

◆ v_GlobalToLocal() [2/2]

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

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

Definition at line 4655 of file ExpList.cpp.

4656 {
4658  "This method is not defined or valid for this class type");
4659 }

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

Referenced by GlobalToLocal().

◆ v_HelmSolve()

void 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

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

Definition at line 4483 of file ExpList.cpp.

4490 {
4491  boost::ignore_unused(inarray, outarray, factors, varcoeff, varfactors,
4492  dirForcing, PhysSpaceForcing);
4493  NEKERROR(ErrorUtil::efatal, "HelmSolve not implemented.");
4494 }

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

Referenced by HelmSolve().

◆ v_HomogeneousBwdTrans()

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

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

Definition at line 4527 of file ExpList.cpp.

4530 {
4531  boost::ignore_unused(inarray, outarray, Shuff, UnShuff);
4533  "This method is not defined or valid for this class type");
4534 }

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

3252 {
3254  "This method is not defined or valid for this class type");
3255  Array<OneD, NekDouble> NoEnergy(1, 0.0);
3256  return NoEnergy;
3257 }

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

Referenced by HomogeneousEnergy().

◆ v_HomogeneousFwdTrans()

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

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

Definition at line 4518 of file ExpList.cpp.

4521 {
4522  boost::ignore_unused(inarray, outarray, Shuff, UnShuff);
4524  "This method is not defined or valid for this class type");
4525 }

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::ContField3DHomogeneous2D, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField.

Definition at line 4616 of file ExpList.cpp.

4617 {
4618  boost::ignore_unused(outarray);
4620  "This method is not defined or valid for this class type");
4621 }

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

3218 {
3219  NekDouble sum = 0.0;
3220  int i = 0;
3221 
3222  for (i = 0; i < (*m_exp).size(); ++i)
3223  {
3224  sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
3225  }
3226  m_comm->GetRowComm()->AllReduce(sum, LibUtilities::ReduceSum);
3227 
3228  return sum;
3229 }

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 4686 of file ExpList.cpp.

4688 {
4689  // initialise if required
4691  {
4692  for (int i = 0; i < m_collections.size(); ++i)
4693  {
4695  }
4697  }
4698 
4699  Array<OneD, NekDouble> tmp;
4700  for (int i = 0; i < m_collections.size(); ++i)
4701  {
4702 
4704  inarray + m_coll_phys_offset[i],
4705  tmp = outarray + m_coll_coeff_offset[i]);
4706  }
4707 }

References Nektar::Collections::eIProductWRTBase, m_coll_coeff_offset, m_coll_phys_offset, m_collections, and m_collectionsDoInit.

Referenced by IProductWRTBase().

◆ 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::ExpList3DHomogeneous2D, and Nektar::MultiRegions::ExpList3DHomogeneous1D.

Definition at line 3172 of file ExpList.cpp.

3174 {
3175  NekDouble err = 0.0, errl2;
3176  int i;
3177 
3178  if (soln == NullNekDouble1DArray)
3179  {
3180  for (i = 0; i < (*m_exp).size(); ++i)
3181  {
3182  errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i]);
3183  err += errl2 * errl2;
3184  }
3185  }
3186  else
3187  {
3188  for (i = 0; i < (*m_exp).size(); ++i)
3189  {
3190  errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i],
3191  soln + m_phys_offset[i]);
3192  err += errl2 * errl2;
3193  }
3194  }
3195 
3196  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3197 
3198  return sqrt(err);
3199 }

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

Referenced by L2().

◆ v_LinearAdvectionDiffusionReactionSolve()

void Nektar::MultiRegions::ExpList::v_LinearAdvectionDiffusionReactionSolve ( 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 4496 of file ExpList.cpp.

4501 {
4502  boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4504  "This method is not defined or valid for this class type");
4505 }

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

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

4512 {
4513  boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4515  "This method is not defined or valid for this class type");
4516 }

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::ContField3DHomogeneous2D, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField.

Definition at line 4640 of file ExpList.cpp.

4641 {
4642  boost::ignore_unused(useComm);
4644  "This method is not defined or valid for this class type");
4645 }

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

4649 {
4650  boost::ignore_unused(inarray, outarray, useComm);
4652  "This method is not defined or valid for this class type");
4653 }

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

4477 {
4478  boost::ignore_unused(inarray, outarray);
4480  "This method is not defined or valid for this class type");
4481 }

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

4575 {
4576  Array<OneD, NekDouble> tmp;
4577  switch (GetCoordim(0))
4578  {
4579  case 1:
4580  {
4581  for (int i = 0; i < GetExpSize(); ++i)
4582  {
4583  (*m_exp)[i]->NormVectorIProductWRTBase(
4584  V[0] + GetPhys_Offset(i),
4585  tmp = outarray + GetCoeff_Offset(i));
4586  }
4587  }
4588  break;
4589  case 2:
4590  {
4591  for (int i = 0; i < GetExpSize(); ++i)
4592  {
4593  (*m_exp)[i]->NormVectorIProductWRTBase(
4594  V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
4595  tmp = outarray + GetCoeff_Offset(i));
4596  }
4597  }
4598  break;
4599  case 3:
4600  {
4601  for (int i = 0; i < GetExpSize(); ++i)
4602  {
4603  (*m_exp)[i]->NormVectorIProductWRTBase(
4604  V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
4605  V[2] + GetPhys_Offset(i),
4606  tmp = outarray + GetCoeff_Offset(i));
4607  }
4608  }
4609  break;
4610  default:
4611  NEKERROR(ErrorUtil::efatal, "Dimension not supported");
4612  break;
4613  }
4614 }
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n.
Definition: ExpList.h:2232
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2204

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

4567 {
4568  boost::ignore_unused(V1, V2, outarray, BndID);
4570  "This method is not defined or valid for this class type");
4571 }

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

4978 {
4979  boost::ignore_unused(Fwd, Bwd);
4980  NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
4981 }

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1548 of file ExpList.cpp.

1552 {
1553  Array<OneD, NekDouble> e_out_d0;
1554  Array<OneD, NekDouble> e_out_d1;
1555  Array<OneD, NekDouble> e_out_d2;
1556  int offset;
1557 
1558  // initialise if required
1560  {
1561  for (int i = 0; i < m_collections.size(); ++i)
1562  {
1563  m_collections[i].Initialise(Collections::ePhysDeriv);
1564  }
1566  }
1567 
1568  LibUtilities::Timer timer;
1569  timer.Start();
1570  for (int i = 0; i < m_collections.size(); ++i)
1571  {
1572  offset = m_coll_phys_offset[i];
1573  e_out_d0 = out_d0 + offset;
1574  e_out_d1 = out_d1 + offset;
1575  e_out_d2 = out_d2 + offset;
1576 
1577  m_collections[i].ApplyOperator(Collections::ePhysDeriv,
1578  inarray + offset, e_out_d0, e_out_d1,
1579  e_out_d2);
1580  }
1581  timer.Stop();
1582  // Elapsed time
1583  timer.AccumulateRegion("Collections:PhysDeriv", 10);
1584 }

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::Collections::ePhysDeriv, m_coll_phys_offset, 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 1586 of file ExpList.cpp.

1589 {
1590  Direction edir = DirCartesianMap[dir];
1591  v_PhysDeriv(edir, inarray, out_d);
1592 }
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:89

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1594 of file ExpList.cpp.

1597 {
1598  int i;
1599  if (edir == MultiRegions::eS)
1600  {
1601  Array<OneD, NekDouble> e_out_ds;
1602  for (i = 0; i < (*m_exp).size(); ++i)
1603  {
1604  e_out_ds = out_d + m_phys_offset[i];
1605  (*m_exp)[i]->PhysDeriv_s(inarray + m_phys_offset[i], e_out_ds);
1606  }
1607  }
1608  else if (edir == MultiRegions::eN)
1609  {
1610  Array<OneD, NekDouble> e_out_dn;
1611  for (i = 0; i < (*m_exp).size(); i++)
1612  {
1613  e_out_dn = out_d + m_phys_offset[i];
1614  (*m_exp)[i]->PhysDeriv_n(inarray + m_phys_offset[i], e_out_dn);
1615  }
1616  }
1617  else
1618  {
1619 
1620  // initialise if required
1622  {
1623  for (int i = 0; i < m_collections.size(); ++i)
1624  {
1625  m_collections[i].Initialise(Collections::ePhysDeriv);
1626  }
1628  }
1629 
1630  // convert enum into int
1631  int intdir = (int)edir;
1632  Array<OneD, NekDouble> e_out_d;
1633  int offset;
1634  for (int i = 0; i < m_collections.size(); ++i)
1635  {
1636  offset = m_coll_phys_offset[i];
1637  e_out_d = out_d + offset;
1638 
1639  m_collections[i].ApplyOperator(Collections::ePhysDeriv, intdir,
1640  inarray + offset, e_out_d);
1641  }
1642  }
1643 }

References Nektar::MultiRegions::eN, Nektar::Collections::ePhysDeriv, Nektar::MultiRegions::eS, m_coll_phys_offset, 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 1713 of file ExpList.cpp.

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

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

5920 {
5921  int cnt, cnt1;
5922 
5923  cnt = cnt1 = 0;
5924 
5925  switch (m_expType)
5926  {
5927  case e2D:
5928  {
5929  for (int i = 0; i < GetExpSize(); ++i)
5930  {
5931  // get new points key
5932  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5933  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5934  int npt0 = (int)pt0 * scale;
5935  int npt1 = (int)pt1 * scale;
5936 
5937  LibUtilities::PointsKey newPointsKey0(
5938  npt0, (*m_exp)[i]->GetPointsType(0));
5939  LibUtilities::PointsKey newPointsKey1(
5940  npt1, (*m_exp)[i]->GetPointsType(1));
5941 
5942  // Project points;
5944  newPointsKey0, newPointsKey1, &inarray[cnt],
5945  (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5946  (*m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
5947 
5948  cnt += npt0 * npt1;
5949  cnt1 += pt0 * pt1;
5950  }
5951  }
5952  break;
5953  case e3D:
5954  {
5955  for (int i = 0; i < GetExpSize(); ++i)
5956  {
5957  // get new points key
5958  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5959  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5960  int pt2 = (*m_exp)[i]->GetNumPoints(2);
5961  int npt0 = (int)pt0 * scale;
5962  int npt1 = (int)pt1 * scale;
5963  int npt2 = (int)pt2 * scale;
5964 
5965  LibUtilities::PointsKey newPointsKey0(
5966  npt0, (*m_exp)[i]->GetPointsType(0));
5967  LibUtilities::PointsKey newPointsKey1(
5968  npt1, (*m_exp)[i]->GetPointsType(1));
5969  LibUtilities::PointsKey newPointsKey2(
5970  npt2, (*m_exp)[i]->GetPointsType(2));
5971 
5972  // Project points;
5974  newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
5975  (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5976  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5977  (*m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
5978 
5979  cnt += npt0 * npt1 * npt2;
5980  cnt1 += pt0 * pt1 * pt2;
5981  }
5982  }
5983  break;
5984  default:
5985  {
5986  NEKERROR(ErrorUtil::efatal, "not setup for this expansion");
5987  }
5988  break;
5989  }
5990 }
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 5268 of file ExpList.cpp.

5271 {
5272  int cnt, cnt1;
5273 
5274  cnt = cnt1 = 0;
5275 
5276  switch (m_expType)
5277  {
5278  case e2D:
5279  {
5280  for (int i = 0; i < GetExpSize(); ++i)
5281  {
5282  // get new points key
5283  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5284  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5285  int npt0 = (int)pt0 * scale;
5286  int npt1 = (int)pt1 * scale;
5287 
5288  LibUtilities::PointsKey newPointsKey0(
5289  npt0, (*m_exp)[i]->GetPointsType(0));
5290  LibUtilities::PointsKey newPointsKey1(
5291  npt1, (*m_exp)[i]->GetPointsType(1));
5292 
5293  // Interpolate points;
5294  LibUtilities::Interp2D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5295  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5296  &inarray[cnt], newPointsKey0,
5297  newPointsKey1, &outarray[cnt1]);
5298 
5299  cnt += pt0 * pt1;
5300  cnt1 += npt0 * npt1;
5301  }
5302  }
5303  break;
5304  case e3D:
5305  {
5306  for (int i = 0; i < GetExpSize(); ++i)
5307  {
5308  // get new points key
5309  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5310  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5311  int pt2 = (*m_exp)[i]->GetNumPoints(2);
5312  int npt0 = (int)pt0 * scale;
5313  int npt1 = (int)pt1 * scale;
5314  int npt2 = (int)pt2 * scale;
5315 
5316  LibUtilities::PointsKey newPointsKey0(
5317  npt0, (*m_exp)[i]->GetPointsType(0));
5318  LibUtilities::PointsKey newPointsKey1(
5319  npt1, (*m_exp)[i]->GetPointsType(1));
5320  LibUtilities::PointsKey newPointsKey2(
5321  npt2, (*m_exp)[i]->GetPointsType(2));
5322 
5323  // Interpolate points;
5324  LibUtilities::Interp3D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5325  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5326  (*m_exp)[i]->GetBasis(2)->GetPointsKey(),
5327  &inarray[cnt], newPointsKey0,
5328  newPointsKey1, newPointsKey2,
5329  &outarray[cnt1]);
5330 
5331  cnt += pt0 * pt1 * pt2;
5332  cnt1 += npt0 * npt1 * npt2;
5333  }
5334  }
5335  break;
5336  default:
5337  {
5338  NEKERROR(ErrorUtil::efatal, "This expansion is not set");
5339  }
5340  break;
5341  }
5342 }
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis,...
Definition: Interp.cpp:167

References Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, Nektar::ErrorUtil::efatal, GetExpSize(), Nektar::LibUtilities::Interp2D(), Nektar::LibUtilities::Interp3D(), m_exp, m_expType, and NEKERROR.

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

2671 {
2672  // Reset matrix managers.
2673  LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
2674  LocalRegions::MatrixKey::opLess>::ClearManager();
2675  LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
2676  LocalRegions::MatrixKey::opLess>::ClearManager();
2677 
2678  // Loop over all elements and reset geometry information.
2679  for (int i = 0; i < m_exp->size(); ++i)
2680  {
2681  (*m_exp)[i]->GetGeom()->Reset(m_graph->GetCurvedEdges(),
2682  m_graph->GetCurvedFaces());
2683  }
2684 
2685  // Loop over all elements and rebuild geometric factors.
2686  for (int i = 0; i < m_exp->size(); ++i)
2687  {
2688  (*m_exp)[i]->Reset();
2689  }
2690 }
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::DisContField3DHomogeneous2D, Nektar::MultiRegions::DisContField3DHomogeneous1D, and Nektar::MultiRegions::DisContField.

Definition at line 4444 of file ExpList.cpp.

4445 {
4446  boost::ignore_unused(index, value);
4448  "v_setBndCondBwdWeight is not defined for this class type");
4449 }

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

Referenced by SetBndCondBwdWeight().

◆ v_SetHomo1DSpecVanVisc()

virtual void Nektar::MultiRegions::ExpList::v_SetHomo1DSpecVanVisc ( Array< OneD, NekDouble visc)
inlineprivatevirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1616 of file ExpList.h.

1617  {
1618  boost::ignore_unused(visc);
1620  "This method is not defined or valid for this class type");
1621  }

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

3276 {
3277  boost::ignore_unused(lhom);
3279  "This method is not defined or valid for this class type");
3280 }

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

4781 {
4782  for (int i = 0; i < m_exp->size(); ++i)
4783  {
4784  for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
4785  {
4786  (*m_exp)[i]->ComputeTraceNormal(j);
4787  }
4788  }
4789 }

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::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField.

Definition at line 1834 of file ExpList.cpp.

1835 {
1836  boost::ignore_unused(field);
1837  // Do nothing unless the method is implemented in the appropriate
1838  // class, i.e. ContField1D,ContField2D, etc.
1839 
1840  // So far it has been implemented just for ContField2D and
1841  // ContField3DHomogeneous1D
1842 
1843  // Block in case users try the smoothing with a modal expansion.
1844  // Maybe a different techique for the smoothing require
1845  // implementation for modal basis.
1846 
1847  ASSERTL0((*m_exp)[0]->GetBasisType(0) == LibUtilities::eGLL_Lagrange ||
1848  (*m_exp)[0]->GetBasisType(0) == LibUtilities::eGauss_Lagrange,
1849  "Smoothing is currently not allowed unless you are using "
1850  "a nodal base for efficiency reasons. The implemented "
1851  "smoothing technique requires the mass matrix inversion "
1852  "which is trivial just for GLL_LAGRANGE_SEM and "
1853  "GAUSS_LAGRANGE_SEMexpansions.");
1854 }

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

Referenced by SmoothField().

◆ v_UpdateBndCondExpansion()

std::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::v_UpdateBndCondExpansion ( int  i)
protectedvirtual

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

Definition at line 3773 of file ExpList.cpp.

3774 {
3775  boost::ignore_unused(i);
3777  "This method is not defined or valid for this class type");
3778  static std::shared_ptr<ExpList> result;
3779  return result;
3780 }

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

Referenced by UpdateBndCondExpansion().

◆ v_UpdateBndConditions()

Array< OneD, SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::v_UpdateBndConditions ( )
privatevirtual

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

Definition at line 4997 of file ExpList.cpp.

4998 {
5000  "This method is not defined or valid for this class type");
5001  static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
5002  return result;
5003 }

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

3796 {
3797  switch (m_expType)
3798  {
3799  case e1D:
3800  {
3801  int i, j, k, e_npoints, offset;
3802  Array<OneD, NekDouble> normals;
3803  NekDouble Vn;
3804 
3805  // Assume whole array is of same coordimate dimension
3806  int coordim = GetCoordim(0);
3807 
3808  ASSERTL1(Vec.size() >= coordim,
3809  "Input vector does not have sufficient dimensions to "
3810  "match coordim");
3811 
3812  // Process each expansion
3813  for (i = 0; i < m_exp->size(); ++i)
3814  {
3815  // Get the number of points in the expansion and the normals.
3816  e_npoints = (*m_exp)[i]->GetNumPoints(0);
3817  normals = (*m_exp)[i]->GetPhysNormals();
3818 
3819  // Get the physical data offset of the expansion in m_phys.
3820  offset = m_phys_offset[i];
3821 
3822  // Compute each data point.
3823  for (j = 0; j < e_npoints; ++j)
3824  {
3825  // Calculate normal velocity.
3826  Vn = 0.0;
3827  for (k = 0; k < coordim; ++k)
3828  {
3829  Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
3830  }
3831 
3832  // Upwind based on direction of normal velocity.
3833  if (Vn > 0.0)
3834  {
3835  Upwind[offset + j] = Fwd[offset + j];
3836  }
3837  else
3838  {
3839  Upwind[offset + j] = Bwd[offset + j];
3840  }
3841  }
3842  }
3843  }
3844  break;
3845  default:
3847  "This method is not defined or valid for this class type");
3848  break;
3849  }
3850 }

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

3869 {
3870  ASSERTL1(Vn.size() >= m_npoints, "Vn is not of sufficient length");
3871  ASSERTL1(Fwd.size() >= m_npoints, "Fwd is not of sufficient length");
3872  ASSERTL1(Bwd.size() >= m_npoints, "Bwd is not of sufficient length");
3873  ASSERTL1(Upwind.size() >= m_npoints, "Upwind is not of sufficient length");
3874 
3875  // Process each point in the expansion.
3876  for (int j = 0; j < m_npoints; ++j)
3877  {
3878  // Upwind based on one-dimensional velocity.
3879  if (Vn[j] > 0.0)
3880  {
3881  Upwind[j] = Fwd[j];
3882  }
3883  else
3884  {
3885  Upwind[j] = Bwd[j];
3886  }
3887  }
3888 }

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

3233 {
3234  NekDouble flux = 0.0;
3235  int i = 0;
3236  int j;
3237 
3238  for (i = 0; i < (*m_exp).size(); ++i)
3239  {
3240  Array<OneD, Array<OneD, NekDouble>> tmp(inarray.size());
3241  for (j = 0; j < inarray.size(); ++j)
3242  {
3243  tmp[j] = Array<OneD, NekDouble>(inarray[j] + m_phys_offset[i]);
3244  }
3245  flux += (*m_exp)[i]->VectorFlux(tmp);
3246  }
3247 
3248  return flux;
3249 }

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

2829 {
2830  int i, j, k, l;
2831  int nbase = (*m_exp)[0]->GetNumBases();
2832  int cnt = 0;
2833 
2834  std::shared_ptr<LocalRegions::ExpansionVector> exp = m_exp;
2835 
2836  if (expansion != -1)
2837  {
2838  exp = std::shared_ptr<LocalRegions::ExpansionVector>(
2840  (*exp)[0] = (*m_exp)[expansion];
2841  }
2842 
2843  if (nbase == 2)
2844  {
2845  for (i = 0; i < (*exp).size(); ++i)
2846  {
2847  const int np0 = (*exp)[i]->GetNumPoints(0);
2848  const int np1 = (*exp)[i]->GetNumPoints(1);
2849 
2850  for (j = 1; j < np1; ++j)
2851  {
2852  for (k = 1; k < np0; ++k)
2853  {
2854  outfile << cnt + (j - 1) * np0 + k << " ";
2855  outfile << cnt + (j - 1) * np0 + k + 1 << " ";
2856  outfile << cnt + j * np0 + k + 1 << " ";
2857  outfile << cnt + j * np0 + k << endl;
2858  }
2859  }
2860 
2861  cnt += np0 * np1;
2862  }
2863  }
2864  else if (nbase == 3)
2865  {
2866  for (i = 0; i < (*exp).size(); ++i)
2867  {
2868  const int np0 = (*exp)[i]->GetNumPoints(0);
2869  const int np1 = (*exp)[i]->GetNumPoints(1);
2870  const int np2 = (*exp)[i]->GetNumPoints(2);
2871  const int np01 = np0 * np1;
2872 
2873  for (j = 1; j < np2; ++j)
2874  {
2875  for (k = 1; k < np1; ++k)
2876  {
2877  for (l = 1; l < np0; ++l)
2878  {
2879  outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
2880  << " ";
2881  outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
2882  << " ";
2883  outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
2884  << " ";
2885  outfile << cnt + (j - 1) * np01 + k * np0 + l << " ";
2886  outfile << cnt + j * np01 + (k - 1) * np0 + l << " ";
2887  outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
2888  << " ";
2889  outfile << cnt + j * np01 + k * np0 + l + 1 << " ";
2890  outfile << cnt + j * np01 + k * np0 + l << endl;
2891  }
2892  }
2893  }
2894  cnt += np0 * np1 * np2;
2895  }
2896  }
2897  else
2898  {
2899  NEKERROR(ErrorUtil::efatal, "Not set up for this dimension");
2900  }
2901 }
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:70

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

2909 {
2910  if (expansion == -1)
2911  {
2912  int totpoints = GetTotPoints();
2913  if (m_physState == false)
2914  {
2916  }
2917 
2918  for (int i = 0; i < totpoints; ++i)
2919  {
2920  outfile << m_phys[i] << " ";
2921  if (i % 1000 == 0 && i)
2922  {
2923  outfile << std::endl;
2924  }
2925  }
2926  outfile << std::endl;
2927  }
2928  else
2929  {
2930  int nPoints = (*m_exp)[expansion]->GetTotPoints();
2931 
2932  for (int i = 0; i < nPoints; ++i)
2933  {
2934  outfile << m_phys[i + m_phys_offset[expansion]] << " ";
2935  }
2936 
2937  outfile << std::endl;
2938  }
2939 }

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

2698 {
2699  if (GetNumElmts() == 0)
2700  {
2701  return;
2702  }
2703 
2704  int coordim = GetExp(0)->GetCoordim();
2705  char vars[3] = {'x', 'y', 'z'};
2706 
2707  if (m_expType == e3DH1D)
2708  {
2709  coordim += 1;
2710  }
2711  else if (m_expType == e3DH2D)
2712  {
2713  coordim += 2;
2714  }
2715 
2716  outfile << "Variables = x";
2717  for (int i = 1; i < coordim; ++i)
2718  {
2719  outfile << ", " << vars[i];
2720  }
2721 
2722  if (var.size() > 0)
2723  {
2724  outfile << ", " << var;
2725  }
2726 
2727  outfile << std::endl << std::endl;
2728 }

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::ExpList3DHomogeneous2D, Nektar::MultiRegions::ExpList2DHomogeneous1D, and Nektar::MultiRegions::ExpList1DHomogeneous2D.

Definition at line 2735 of file ExpList.cpp.

2736 {
2737  int i, j;
2738  int coordim = GetCoordim(0);
2739  int nPoints = GetTotPoints();
2740  int nBases = (*m_exp)[0]->GetNumBases();
2741  int numBlocks = 0;
2742 
2743  Array<OneD, Array<OneD, NekDouble>> coords(3);
2744 
2745  if (expansion == -1)
2746  {
2747  nPoints = GetTotPoints();
2748 
2749  coords[0] = Array<OneD, NekDouble>(nPoints);
2750  coords[1] = Array<OneD, NekDouble>(nPoints);
2751  coords[2] = Array<OneD, NekDouble>(nPoints);
2752 
2753  GetCoords(coords[0], coords[1], coords[2]);
2754 
2755  for (i = 0; i < m_exp->size(); ++i)
2756  {
2757  int numInt = 1;
2758 
2759  for (j = 0; j < nBases; ++j)
2760  {
2761  numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
2762  }
2763 
2764  numBlocks += numInt;
2765  }
2766  }
2767  else
2768  {
2769  nPoints = (*m_exp)[expansion]->GetTotPoints();
2770 
2771  coords[0] = Array<OneD, NekDouble>(nPoints);
2772  coords[1] = Array<OneD, NekDouble>(nPoints);
2773  coords[2] = Array<OneD, NekDouble>(nPoints);
2774 
2775  (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
2776 
2777  numBlocks = 1;
2778  for (j = 0; j < nBases; ++j)
2779  {
2780  numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
2781  }
2782  }
2783 
2784  if (m_expType == e3DH1D)
2785  {
2786  nBases += 1;
2787  coordim += 1;
2788  int nPlanes = GetZIDs().size();
2789  NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
2790  numBlocks = (int)tmp;
2791  }
2792  else if (m_expType == e3DH2D)
2793  {
2794  nBases += 2;
2795  coordim += 1;
2796  }
2797 
2798  outfile << "Zone, N=" << nPoints << ", E=" << numBlocks << ", F=FEBlock";
2799 
2800  switch (nBases)
2801  {
2802  case 2:
2803  outfile << ", ET=QUADRILATERAL" << std::endl;
2804  break;
2805  case 3:
2806  outfile << ", ET=BRICK" << std::endl;
2807  break;
2808  default:
2809  NEKERROR(ErrorUtil::efatal, "Not set up for this type of output");
2810  break;
2811  }
2812 
2813  // Write out coordinates
2814  for (j = 0; j < coordim; ++j)
2815  {
2816  for (i = 0; i < nPoints; ++i)
2817  {
2818  outfile << coords[j][i] << " ";
2819  if (i % 1000 == 0 && i)
2820  {
2821  outfile << std::endl;
2822  }
2823  }
2824  outfile << std::endl;
2825  }
2826 }
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:1907
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:631

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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 3096 of file ExpList.cpp.

3098 {
3099  int i;
3100  int nq = (*m_exp)[expansion]->GetTotPoints();
3101 
3102  // printing the fields of that zone
3103  outfile << " <DataArray type=\"Float64\" Name=\"" << var << "\">"
3104  << endl;
3105  outfile << " ";
3106  const Array<OneD, NekDouble> phys = m_phys + m_phys_offset[expansion];
3107  for (i = 0; i < nq; ++i)
3108  {
3109  outfile << (fabs(phys[i]) < NekConstants::kNekZeroTol ? 0 : phys[i])
3110  << " ";
3111  }
3112  outfile << endl;
3113  outfile << " </DataArray>" << endl;
3114 }
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::ExpList3DHomogeneous2D, Nektar::MultiRegions::ExpList3DHomogeneous1D, Nektar::MultiRegions::ExpList2DHomogeneous1D, and Nektar::MultiRegions::ExpList1DHomogeneous2D.

Definition at line 2955 of file ExpList.cpp.

2957 {
2958  boost::ignore_unused(istrip);
2959  int i, j, k;
2960  int nbase = (*m_exp)[expansion]->GetNumBases();
2961  int ntot = (*m_exp)[expansion]->GetTotPoints();
2962  int nquad[3];
2963 
2964  int ntotminus = 1;
2965  for (i = 0; i < nbase; ++i)
2966  {
2967  nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
2968  ntotminus *= (nquad[i] - 1);
2969  }
2970 
2971  Array<OneD, NekDouble> coords[3];
2972  coords[0] = Array<OneD, NekDouble>(ntot, 0.0);
2973  coords[1] = Array<OneD, NekDouble>(ntot, 0.0);
2974  coords[2] = Array<OneD, NekDouble>(ntot, 0.0);
2975  (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
2976 
2977  outfile << " <Piece NumberOfPoints=\"" << ntot << "\" NumberOfCells=\""
2978  << ntotminus << "\">" << endl;
2979  outfile << " <Points>" << endl;
2980  outfile << " <DataArray type=\"Float64\" "
2981  << "NumberOfComponents=\"3\" format=\"ascii\">" << endl;
2982  outfile << " ";
2983  for (i = 0; i < ntot; ++i)
2984  {
2985  for (j = 0; j < 3; ++j)
2986  {
2987  outfile << setprecision(8) << scientific << (float)coords[j][i]
2988  << " ";
2989  }
2990  outfile << endl;
2991  }
2992  outfile << endl;
2993  outfile << " </DataArray>" << endl;
2994  outfile << " </Points>" << endl;
2995  outfile << " <Cells>" << endl;
2996  outfile << " <DataArray type=\"Int32\" "
2997  << "Name=\"connectivity\" format=\"ascii\">" << endl;
2998 
2999  int ns = 0; // pow(2,dim) for later usage
3000  string ostr;
3001  switch (m_expType)
3002  {
3003  case e1D:
3004  {
3005  ns = 2;
3006  ostr = "3 ";
3007  for (i = 0; i < nquad[0] - 1; ++i)
3008  {
3009  outfile << i << " " << i + 1 << endl;
3010  }
3011  }
3012  break;
3013  case e2D:
3014  {
3015  ns = 4;
3016  ostr = "9 ";
3017  for (i = 0; i < nquad[0] - 1; ++i)
3018  {
3019  for (j = 0; j < nquad[1] - 1; ++j)
3020  {
3021  outfile << j * nquad[0] + i << " " << j * nquad[0] + i + 1
3022  << " " << (j + 1) * nquad[0] + i + 1 << " "
3023  << (j + 1) * nquad[0] + i << endl;
3024  }
3025  }
3026  }
3027  break;
3028  case e3D:
3029  {
3030  ns = 8;
3031  ostr = "12 ";
3032  for (i = 0; i < nquad[0] - 1; ++i)
3033  {
3034  for (j = 0; j < nquad[1] - 1; ++j)
3035  {
3036  for (k = 0; k < nquad[2] - 1; ++k)
3037  {
3038  outfile
3039  << k * nquad[0] * nquad[1] + j * nquad[0] + i << " "
3040  << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3041  << " "
3042  << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3043  i + 1
3044  << " "
3045  << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3046  << " "
3047  << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3048  << " "
3049  << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3050  i + 1
3051  << " "
3052  << (k + 1) * nquad[0] * nquad[1] +
3053  (j + 1) * nquad[0] + i + 1
3054  << " "
3055  << (k + 1) * nquad[0] * nquad[1] +
3056  (j + 1) * nquad[0] + i
3057  << " " << endl;
3058  }
3059  }
3060  }
3061  }
3062  break;
3063  default:
3064  break;
3065  }
3066 
3067  outfile << endl;
3068  outfile << " </DataArray>" << endl;
3069  outfile << " <DataArray type=\"Int32\" "
3070  << "Name=\"offsets\" format=\"ascii\">" << endl;
3071  for (i = 0; i < ntotminus; ++i)
3072  {
3073  outfile << i * ns + ns << " ";
3074  }
3075  outfile << endl;
3076  outfile << " </DataArray>" << endl;
3077  outfile << " <DataArray type=\"UInt8\" "
3078  << "Name=\"types\" format=\"ascii\">" << endl;
3079  for (i = 0; i < ntotminus; ++i)
3080  {
3081  outfile << ostr;
3082  }
3083  outfile << endl;
3084  outfile << " </DataArray>" << endl;
3085  outfile << " </Cells>" << endl;
3086  outfile << " <PointData>" << endl;
3087 }

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

609  {
610  return v_VectorFlux(inarray);
611  }
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble >> &inarray)
Definition: ExpList.cpp:3231

References v_VectorFlux().

◆ WriteTecplotConnectivity()

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

Definition at line 427 of file ExpList.h.

428  {
429  v_WriteTecplotConnectivity(outfile, expansion);
430  }
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2828

References v_WriteTecplotConnectivity().

◆ WriteTecplotField()

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

Definition at line 422 of file ExpList.h.

423  {
424  v_WriteTecplotField(outfile, expansion);
425  }
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2908

References v_WriteTecplotField().

◆ WriteTecplotHeader()

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

Definition at line 412 of file ExpList.h.

413  {
414  v_WriteTecplotHeader(outfile, var);
415  }
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:2697

References v_WriteTecplotHeader().

◆ WriteTecplotZone()

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

Definition at line 417 of file ExpList.h.

418  {
419  v_WriteTecplotZone(outfile, expansion);
420  }
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2735

References v_WriteTecplotZone().

◆ WriteVtkFooter()

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

Definition at line 2949 of file ExpList.cpp.

2950 {
2951  outfile << " </UnstructuredGrid>" << endl;
2952  outfile << "</VTKFile>" << endl;
2953 }

◆ WriteVtkHeader()

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

Definition at line 2941 of file ExpList.cpp.

2942 {
2943  outfile << "<?xml version=\"1.0\"?>" << endl;
2944  outfile << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
2945  << "byte_order=\"LittleEndian\">" << endl;
2946  outfile << " <UnstructuredGrid>" << endl;
2947 }

◆ WriteVtkPieceData()

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

Definition at line 444 of file ExpList.h.

446  {
447  v_WriteVtkPieceData(outfile, expansion, var);
448  }
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:3096

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

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

Definition at line 3089 of file ExpList.cpp.

3090 {
3091  boost::ignore_unused(expansion);
3092  outfile << " </PointData>" << endl;
3093  outfile << " </Piece>" << endl;
3094 }

◆ WriteVtkPieceHeader()

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

Definition at line 435 of file ExpList.h.

437  {
438  v_WriteVtkPieceHeader(outfile, expansion, istrip);
439  }
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:2955

References v_WriteVtkPieceHeader().

Member Data Documentation

◆ m_blockMat

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

Definition at line 1218 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 1158 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField::Assemble(), Nektar::MultiRegions::DisContField::EvaluateHDGPostProcessing(), GetCoeff(), GetCoeffs(), Nektar::MultiRegions::DisContField::L2_DGDeriv(), SetCoeff(), Nektar::MultiRegions::ExpList1DHomogeneous2D::SetCoeffPhys(), Nektar::MultiRegions::ExpList2DHomogeneous1D::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_FillBndCondFromField(), 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 1216 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 1204 of file ExpList.h.

Referenced by CreateCollections(), GeneralMatrixOp(), IProductWRTDerivBase(), v_BwdTrans(), and v_IProductWRTBase().

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

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

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

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

◆ 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 1196 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(), Get1DScaledTotPoints(), GetCoordim(), GetElmtNormalLength(), GetExp(), GetExpIndex(), 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_PhysInterp1DScaled(), v_Reset(), v_SetUpPhysNormals(), v_SmoothField(), 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 1175 of file ExpList.h.

Referenced by GetPhys(), Integral(), Nektar::MultiRegions::DisContField::L2_DGDeriv(), Nektar::MultiRegions::ExpList1DHomogeneous2D::SetCoeffPhys(), Nektar::MultiRegions::ExpList2DHomogeneous1D::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 1184 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