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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Detailed Description

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

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

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

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

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

Definition at line 101 of file ExpList.h.

Constructor & Destructor Documentation

◆ ExpList() [1/10]

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

The default constructor using a type.

Creates an empty expansion list.

Definition at line 102 of file ExpList.cpp.

103 : m_expType(type), m_ncoeffs(0), m_npoints(0), m_physState(false),
106 m_WaveSpace(false)
107{
108}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1141
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1116
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1127
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1072
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1060

◆ ExpList() [2/10]

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

119 : std::enable_shared_from_this<ExpList>(in), m_expType(in.m_expType),
120
121 m_comm(in.m_comm), m_session(in.m_session), m_graph(in.m_graph),
122 m_ncoeffs(in.m_ncoeffs), m_npoints(in.m_npoints), m_physState(false),
123 m_exp(in.m_exp), m_collections(in.m_collections),
124 m_collectionsDoInit(in.m_collectionsDoInit),
125 m_coll_coeff_offset(in.m_coll_coeff_offset),
126 m_coll_phys_offset(in.m_coll_phys_offset),
127 m_coeff_offset(in.m_coeff_offset), m_phys_offset(in.m_phys_offset),
128 m_blockMat(in.m_blockMat), m_WaveSpace(false),
129 m_elmtToExpId(in.m_elmtToExpId)
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:1445
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1136
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition: ExpList.h:1130
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1134
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1065
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1069
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1132
Collections::CollectionVector m_collections
Definition: ExpList.h:1128
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1148
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1067
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1138

References SetupCoeffPhys().

◆ ExpList() [3/10]

Nektar::MultiRegions::ExpList::ExpList ( const ExpListSharedPtr in,
const bool  DeclareCoeffArrays = true,
const bool  DeclarePhysArrays = true 
)

The copy constructor.

Definition at line 137 of file ExpList.cpp.

139 : m_expType(in->m_expType),
140
141 m_comm(in->m_comm), m_session(in->m_session), m_graph(in->m_graph),
142 m_ncoeffs(in->m_ncoeffs), m_npoints(in->m_npoints),
143 m_physState(in->m_physState), m_exp(in->m_exp),
144 m_collections(in->m_collections),
145 m_collectionsDoInit(in->m_collectionsDoInit),
146 m_coll_coeff_offset(in->m_coll_coeff_offset),
147 m_coll_phys_offset(in->m_coll_phys_offset),
148 m_coeff_offset(in->m_coeff_offset), m_phys_offset(in->m_phys_offset),
149 m_coeffsToElmt(in->m_coeffsToElmt), m_blockMat(in->m_blockMat),
150 m_WaveSpace(in->m_WaveSpace), m_elmtToExpId(in->m_elmtToExpId)
151{
152 if (DeclareCoeffArrays)
153 {
154 m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
155 }
156 if (DeclarePhysArrays)
157 {
158 m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
159 }
160}
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1092
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition: ExpList.h:1140
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1108

References m_coeffs, m_ncoeffs, m_npoints, and m_phys.

◆ ExpList() [4/10]

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

170 : m_expType(in.m_expType), m_comm(in.m_comm), m_session(in.m_session),
171 m_graph(in.m_graph), m_physState(false),
174 m_WaveSpace(false)
175{
176 for (int i = 0; i < eIDs.size(); ++i)
177 {
178 (*m_exp).push_back((*(in.m_exp))[eIDs[i]]);
179 }
180
181 // Set up m_coeffs, m_phys and offset arrays.
182 SetupCoeffPhys(DeclareCoeffPhysArrays);
183
184 // set up collections
185 CreateCollections(ImpType);
186}
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:5503

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

◆ ExpList() [5/10]

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

Generate an ExpList from a meshgraph graph and session file.

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

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

Definition at line 207 of file ExpList.cpp.

211 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
212 m_physState(false),
215 m_WaveSpace(false)
216{
217 // Retrieve the list of expansions
218 const SpatialDomains::ExpansionInfoMap &expansions =
219 graph->GetExpansionInfo(var);
220
221 // Initialise Expansionn Vector
222 InitialiseExpVector(expansions);
223
224 // Setup phys coeff space
225 SetupCoeffPhys(DeclareCoeffPhysArrays);
226
227 // Initialise collection
228 CreateCollections(ImpType);
229}
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
Definition: ExpList.cpp:1488
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition: MeshGraph.h:143

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

◆ ExpList() [6/10]

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

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

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

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

Definition at line 249 of file ExpList.cpp.

253 : m_comm(pSession->GetComm()), m_session(pSession), m_physState(false),
256 m_WaveSpace(false)
257{
258
259 // Initialise expansion vector
260 InitialiseExpVector(expansions);
261
262 // Set up m_coeffs, m_phys and offset arrays.
263 SetupCoeffPhys(DeclareCoeffPhysArrays);
264
265 // Setup Collection
266 CreateCollections(ImpType);
267}

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

◆ ExpList() [7/10]

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

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

Definition at line 272 of file ExpList.cpp.

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

◆ ExpList() [8/10]

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() [9/10]

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

1008 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
1009 m_physState(false),
1012 m_WaveSpace(false)
1013{
1014 boost::ignore_unused(variable, ImpType);
1015 int i, j, elmtid = 0;
1016
1023
1029
1030 for (i = 0; i < locexp.size(); ++i)
1031 {
1032 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
1033 locexp[i])))
1034 {
1035 m_expType = e0D;
1036
1037 for (j = 0; j < 2; ++j)
1038 {
1039 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
1040
1042 PointGeom);
1043 exp->SetElmtId(elmtid++);
1044 (*m_exp).push_back(exp);
1045 }
1046 }
1047 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
1048 locexp[i])))
1049 {
1050 m_expType = e1D;
1051 LibUtilities::BasisKey edgeKey0 =
1052 locexp[i]->GetBasis(0)->GetBasisKey();
1053
1054 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
1055 {
1056 segGeom = exp2D->GetGeom2D()->GetEdge(j);
1057
1058 int dir = exp2D->GetGeom2D()->GetDir(j);
1059
1060 if (locexp[i]->GetNtraces() == 3)
1061 {
1062 LibUtilities::BasisKey edgeKey =
1063 locexp[i]->GetBasis(dir)->GetBasisKey();
1064
1065 LibUtilities::BasisKey nEdgeKey(edgeKey0.GetBasisType(),
1066 edgeKey.GetNumModes(),
1067 edgeKey.GetPointsKey());
1068
1069 exp =
1071 nEdgeKey, segGeom);
1072 }
1073 else
1074 {
1075 exp =
1077 locexp[i]->GetBasis(dir)->GetBasisKey(), segGeom);
1078 }
1079
1080 exp->SetElmtId(elmtid++);
1081 (*m_exp).push_back(exp);
1082 }
1083 }
1084 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
1085 locexp[i])))
1086 {
1087 m_expType = e2D;
1088
1089 LibUtilities::BasisKey face0_dir0 =
1090 locexp[i]->GetBasis(0)->GetBasisKey();
1091 LibUtilities::BasisKey face0_dir1 =
1092 locexp[i]->GetBasis(1)->GetBasisKey();
1093
1094 for (j = 0; j < exp3D->GetNtraces(); ++j)
1095 {
1096 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
1097
1098 int dir0 = exp3D->GetGeom3D()->GetDir(j, 0);
1099 int dir1 = exp3D->GetGeom3D()->GetDir(j, 1);
1100
1101 LibUtilities::BasisKey face_dir0 =
1102 locexp[i]->GetBasis(dir0)->GetBasisKey();
1103 LibUtilities::BasisKey face_dir1 =
1104 locexp[i]->GetBasis(dir1)->GetBasisKey();
1105
1106 if ((QuadGeom =
1107 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1108 FaceGeom)))
1109 {
1110 exp =
1112 face_dir0, face_dir1, QuadGeom);
1113 }
1114 else if ((TriGeom = std::dynamic_pointer_cast<
1115 SpatialDomains::TriGeom>(FaceGeom)))
1116 {
1117
1118 LibUtilities::BasisKey nface_dir0(face0_dir0.GetBasisType(),
1119 face_dir0.GetNumModes(),
1120 face_dir0.GetPointsKey());
1121 LibUtilities::BasisKey nface_dir1(face0_dir1.GetBasisType(),
1122 face_dir1.GetNumModes(),
1123 face_dir1.GetPointsKey());
1124 exp =
1126 nface_dir0, nface_dir1, TriGeom);
1127 }
1128 exp->SetElmtId(elmtid++);
1129 (*m_exp).push_back(exp);
1130 }
1131 }
1132 }
1133
1134 // Set up m_coeffs, m_phys and offset arrays.
1135 SetupCoeffPhys(DeclareCoeffPhysArrays);
1136
1137 // Set up collections
1138 if (m_expType != e0D)
1139 {
1140 CreateCollections(ImpType);
1141 }
1142}
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:48
std::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:49
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:52
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:51
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:47
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
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:64

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() [10/10]

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

1173 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
1176 m_WaveSpace(false)
1177{
1178 int j, elmtid = 0;
1183
1185
1187
1188 int meshdim = graph->GetMeshDimension();
1189
1190 // Retrieve the list of expansions (element exp)
1191 const SpatialDomains::ExpansionInfoMap &expansions =
1192 graph->GetExpansionInfo(variable);
1193
1194 // Retrieve the list of expansions
1195 // Process each composite region.
1196 for (auto &compIt : domain)
1197 {
1198 // Process each expansion in the region.
1199 for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
1200 {
1201 if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
1202 compIt.second->m_geomVec[j])))
1203 {
1204 m_expType = e0D;
1205
1207 PtGeom);
1208 }
1209 else if ((SegGeom =
1210 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1211 compIt.second->m_geomVec[j])))
1212 {
1213 m_expType = e1D;
1214
1215 // Retrieve the basis key from the expansion.
1216 LibUtilities::BasisKey bkey = LibUtilities::NullBasisKey;
1217
1218 if (meshdim == 1)
1219 {
1220 // map<int, ExpansionInfoShPtr>
1221 auto expIt = expansions.find(SegGeom->GetGlobalID());
1222 ASSERTL0(expIt != expansions.end(),
1223 "Failed to find basis key");
1224 bkey = expIt->second->m_basisKeyVector[0];
1225 }
1226 else // get bkey from Tri or Quad
1227 {
1228 // First, create the element stdExp that the edge belongs to
1230 graph->GetElementsFromEdge(SegGeom);
1231 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1232 // Currently we assume the elements adjacent to the edge
1233 // have the same type. So we directly fetch the first
1234 // element.
1235 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1236 int edge_id = elmts->at(0).second;
1238 graph->GetExpansionInfo(geom, variable);
1239 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1240 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1242
1243 if (geom->GetShapeType() == LibUtilities::eTriangle)
1244 {
1245 elmtStdExp = MemoryManager<
1246 StdRegions::StdTriExp>::AllocateSharedPtr(Ba, Bb);
1247 }
1248 else if (geom->GetShapeType() ==
1250 {
1251 elmtStdExp = MemoryManager<
1252 StdRegions::StdQuadExp>::AllocateSharedPtr(Ba, Bb);
1253 }
1254 else
1255 {
1257 "Fail to cast geom to a known 2D shape.");
1258 }
1259 // Then, get the trace basis key from the element stdExp,
1260 // which may be different from Ba and Bb.
1261 bkey = elmtStdExp->GetTraceBasisKey(edge_id);
1262 }
1263
1264 if (SetToOneSpaceDimension)
1265 {
1266 SpatialDomains::SegGeomSharedPtr OneDSegmentGeom =
1267 SegGeom->GenerateOneSpaceDimGeom();
1268
1269 exp =
1271 bkey, OneDSegmentGeom);
1272 }
1273 else
1274 {
1275
1276 exp =
1278 bkey, SegGeom);
1279 }
1280 }
1281 else if ((TriGeom =
1282 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1283 compIt.second->m_geomVec[j])))
1284 {
1285 m_expType = e2D;
1286
1287 // First, create the element stdExp that the face belongs to
1289 graph->GetElementsFromFace(TriGeom);
1290 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1291 // Currently we assume the elements adjacent to the face have
1292 // the same type. So we directly fetch the first element.
1293 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1294 int face_id = elmts->at(0).second;
1296 graph->GetExpansionInfo(geom, variable);
1297 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1298 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1299 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1301
1302 if (geom->GetShapeType() == LibUtilities::ePrism)
1303 {
1304 elmtStdExp = MemoryManager<
1305 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1306 }
1307 else if (geom->GetShapeType() == LibUtilities::eTetrahedron)
1308 {
1309 elmtStdExp =
1311 Ba, Bb, Bc);
1312 }
1313 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1314 {
1315 elmtStdExp =
1317 Ba, Bb, Bc);
1318 }
1319 else // hex cannot have tri surface
1320 {
1322 "Fail to cast geom to a known 3D shape.");
1323 }
1324 // Then, get the trace basis key from the element stdExp,
1325 // which may be different from Ba, Bb and Bc.
1326 LibUtilities::BasisKey TriBa =
1327 elmtStdExp->GetTraceBasisKey(face_id, 0);
1328 LibUtilities::BasisKey TriBb =
1329 elmtStdExp->GetTraceBasisKey(face_id, 1);
1330 // swap TriBa and TriBb orientation is transposed
1331 if (geom->GetForient(face_id) >= 9)
1332 {
1333 std::swap(TriBa, TriBb);
1334 }
1335
1336 if (graph->GetExpansionInfo()
1337 .begin()
1338 ->second->m_basisKeyVector[0]
1339 .GetBasisType() == LibUtilities::eGLL_Lagrange)
1340 {
1341 NEKERROR(ErrorUtil::efatal, "This method needs sorting");
1343
1344 exp = MemoryManager<
1345 LocalRegions::NodalTriExp>::AllocateSharedPtr(TriBa,
1346 TriBb,
1347 TriNb,
1348 TriGeom);
1349 }
1350 else
1351 {
1352 exp =
1354 TriBa, TriBb, TriGeom);
1355 }
1356 }
1357 else if ((QuadGeom =
1358 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1359 compIt.second->m_geomVec[j])))
1360 {
1361 m_expType = e2D;
1362
1363 // First, create the element stdExp that the face belongs to
1365 graph->GetElementsFromFace(QuadGeom);
1366 // elmts -> std::vector<std::pair<GeometrySharedPtr, int> >
1367 // Currently we assume the elements adjacent to the face have
1368 // the same type. So we directly fetch the first element.
1369 SpatialDomains::GeometrySharedPtr geom = elmts->at(0).first;
1370 int face_id = elmts->at(0).second;
1372 graph->GetExpansionInfo(geom, variable);
1373 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1374 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1375 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1377
1378 if (geom->GetShapeType() == LibUtilities::ePrism)
1379 {
1380 elmtStdExp = MemoryManager<
1381 StdRegions::StdPrismExp>::AllocateSharedPtr(Ba, Bb, Bc);
1382 }
1383 else if (geom->GetShapeType() == LibUtilities::eHexahedron)
1384 {
1385 elmtStdExp =
1387 Ba, Bb, Bc);
1388 }
1389 else if (geom->GetShapeType() == LibUtilities::ePyramid)
1390 {
1391 elmtStdExp =
1393 Ba, Bb, Bc);
1394 }
1395 else // Tet cannot have quad surface
1396 {
1398 "Fail to cast geom to a known 3D shape.");
1399 }
1400 // Then, get the trace basis key from the element stdExp,
1401 // which may be different from Ba, Bb and Bc.
1402 LibUtilities::BasisKey QuadBa =
1403 elmtStdExp->GetTraceBasisKey(face_id, 0);
1404 LibUtilities::BasisKey QuadBb =
1405 elmtStdExp->GetTraceBasisKey(face_id, 1);
1406 // swap Ba and Bb if the orientation is transposed
1407 if (geom->GetForient(face_id) >= 9)
1408 {
1409 std::swap(QuadBa, QuadBb);
1410 }
1411
1413 QuadBa, QuadBb, QuadGeom);
1414 }
1415 else
1416 {
1418 "dynamic cast to a Geom (possibly 3D) failed");
1419 }
1420
1421 exp->SetElmtId(elmtid++);
1422 (*m_exp).push_back(exp);
1423 }
1424 }
1425
1426 // Set up m_coeffs, m_phys and offset arrays.
1427 SetupCoeffPhys(DeclareCoeffPhysArrays);
1428
1429 if (m_expType != e0D)
1430 {
1431 CreateCollections(ImpType);
1432 }
1433}
#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< std::vector< std::pair< GeometrySharedPtr, int > > > GeometryLinkSharedPtr
Definition: MeshGraph.h:168
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
Definition: MeshGraph.h:142
std::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:54
std::shared_ptr< StdExpansion > StdExpansionSharedPtr

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

◆ ~ExpList()

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

The default destructor.

Definition at line 1661 of file ExpList.cpp.

1662{
1663}

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

2210{
2211 v_AddFwdBwdTraceIntegral(Fwd, Bwd, outarray);
2212}
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4795

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

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

Definition at line 6282 of file ExpList.cpp.

6285{
6286 int nelmt;
6287 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6288
6289 nelmtcoef = GetNcoeffs(0);
6290 nelmtpnts = GetTotPoints(0);
6291
6292 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6293 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6294
6295 Array<OneD, NekDouble> MatQ_data;
6296 Array<OneD, NekDouble> MatC_data;
6297
6298 DNekMatSharedPtr tmpMatQ, tmpMatC;
6299
6300 nelmtcoef0 = nelmtcoef;
6301 nelmtpnts0 = nelmtpnts;
6302
6303 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6304 {
6305 nelmtcoef = GetNcoeffs(nelmt);
6306 nelmtpnts = GetTotPoints(nelmt);
6307
6308 tmpMatQ = ElmtJacQuad[nelmt];
6309 tmpMatC = ElmtJacCoef[nelmt];
6310
6311 MatQ_data = tmpMatQ->GetPtr();
6312 MatC_data = tmpMatC->GetPtr();
6313
6314 if (nelmtcoef != nelmtcoef0)
6315 {
6316 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6317 nelmtcoef0 = nelmtcoef;
6318 }
6319
6320 if (nelmtpnts != nelmtpnts0)
6321 {
6322 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6323 nelmtpnts0 = nelmtpnts;
6324 }
6325
6326 for (int np = 0; np < nelmtcoef; np++)
6327 {
6328 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6329 1);
6330 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6331 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
6332
6333 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6334 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6335 }
6336 }
6337}
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1527
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1572
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:354
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1191

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

6228{
6229 int nelmt;
6230 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6231
6232 nelmtcoef = GetNcoeffs(0);
6233 nelmtpnts = GetTotPoints(0);
6234
6235 Array<OneD, NekDouble> innarray(nelmtpnts, 0.0);
6236 Array<OneD, NekDouble> outarray(nelmtcoef, 0.0);
6237
6238 Array<OneD, NekDouble> MatQ_data;
6239 Array<OneD, NekDouble> MatC_data;
6240
6241 DNekMatSharedPtr tmpMatQ, tmpMatC;
6242
6243 nelmtcoef0 = nelmtcoef;
6244 nelmtpnts0 = nelmtpnts;
6245
6246 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6247 {
6248 nelmtcoef = GetNcoeffs(nelmt);
6249 nelmtpnts = GetTotPoints(nelmt);
6250
6251 tmpMatQ = ElmtJacQuad[nelmt];
6252 tmpMatC = ElmtJacCoef[nelmt];
6253
6254 MatQ_data = tmpMatQ->GetPtr();
6255 MatC_data = tmpMatC->GetPtr();
6256
6257 if (nelmtcoef != nelmtcoef0)
6258 {
6259 outarray = Array<OneD, NekDouble>(nelmtcoef, 0.0);
6260 nelmtcoef0 = nelmtcoef;
6261 }
6262
6263 if (nelmtpnts != nelmtpnts0)
6264 {
6265 innarray = Array<OneD, NekDouble>(nelmtpnts, 0.0);
6266 nelmtpnts0 = nelmtpnts;
6267 }
6268
6269 for (int np = 0; np < nelmtcoef; np++)
6270 {
6271 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6272 1);
6273 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6274 (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
6275
6276 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6277 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6278 }
6279 }
6280}

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

2204{
2205 v_AddTraceIntegral(Fn, outarray);
2206}
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4778

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

2196{
2197 WARNINGL1(false,
2198 "Deprecated AddTraceIntegral interface, will be removed in "
2199 "the next release");
2200 v_AddTraceIntegral(Fx, Fy, outarray);
2201}
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:250

References v_AddTraceIntegral(), and WARNINGL1.

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

1024 {
1025 v_AddTraceIntegralToOffDiag(FwdFlux, BwdFlux, outarray);
1026 }
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5766

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

5993{
5995 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
5996 tracelist->GetExp();
5997 int ntotTrace = (*traceExp).size();
5998 int nTracePnt, nTraceCoef;
5999
6000 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp = GetExp();
6001 int nElmtCoef;
6002
6003 const MultiRegions::LocTraceToTraceMapSharedPtr locTraceToTraceMap =
6005 const Array<OneD, const Array<OneD, int>> LRAdjExpid =
6006 locTraceToTraceMap->GetLeftRightAdjacentExpId();
6007 const Array<OneD, const Array<OneD, bool>> LRAdjflag =
6008 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
6009
6010 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRMap =
6011 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
6012 const Array<OneD, const Array<OneD, Array<OneD, int>>> elmtLRSign =
6013 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
6014 DNekMatSharedPtr ElmtMat;
6015 Array<OneD, NekDouble> ElmtMat_data;
6016 // int nclAdjExp;
6017 int nrwAdjExp;
6018 int MatIndex, nPnts;
6019 NekDouble sign = 1.0;
6020
6021 int nTracePntsTtl = tracelist->GetTotPoints();
6022 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
6023 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
6024 int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
6025
6026 Array<OneD, int> nlocTracePtsLR(2);
6027 nlocTracePtsLR[0] = nlocTracePtsFwd;
6028 nlocTracePtsLR[1] = nlocTracePtsBwd;
6029
6030 size_t nFwdBwdNonZero = 0;
6031 Array<OneD, int> tmpIndex{2, -1};
6032 for (int i = 0; i < 2; ++i)
6033 {
6034 if (nlocTracePtsLR[i] > 0)
6035 {
6036 tmpIndex[nFwdBwdNonZero] = i;
6037 nFwdBwdNonZero++;
6038 }
6039 }
6040
6041 Array<OneD, int> nlocTracePtsNonZeroIndex{nFwdBwdNonZero};
6042 for (int i = 0; i < nFwdBwdNonZero; ++i)
6043 {
6044 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
6045 }
6046
6047 Array<OneD, NekDouble> TraceFwdPhy(nTracePntsTtl);
6048 Array<OneD, NekDouble> TraceBwdPhy(nTracePntsTtl);
6049 Array<OneD, Array<OneD, NekDouble>> tmplocTrace(2);
6050 for (int k = 0; k < 2; ++k)
6051 {
6052 tmplocTrace[k] = NullNekDouble1DArray;
6053 }
6054
6055 for (int k = 0; k < nFwdBwdNonZero; ++k)
6056 {
6057 size_t i = nlocTracePtsNonZeroIndex[k];
6058 tmplocTrace[i] = Array<OneD, NekDouble>(nlocTracePtsLR[i]);
6059 }
6060
6061 int nNumbElmt = fieldMat.size();
6062 Array<OneD, Array<OneD, NekDouble>> ElmtMatDataArray(nNumbElmt);
6063 Array<OneD, int> ElmtCoefArray(nNumbElmt);
6064 for (int i = 0; i < nNumbElmt; i++)
6065 {
6066 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
6067 ElmtCoefArray[i] = GetNcoeffs(i);
6068 }
6069
6070 int nTraceCoefMax = 0;
6071 int nTraceCoefMin = std::numeric_limits<int>::max();
6072 Array<OneD, int> TraceCoefArray(ntotTrace);
6073 Array<OneD, int> TracePntArray(ntotTrace);
6074 Array<OneD, int> TraceOffArray(ntotTrace);
6075 Array<OneD, Array<OneD, NekDouble>> FwdMatData(ntotTrace);
6076 Array<OneD, Array<OneD, NekDouble>> BwdMatData(ntotTrace);
6077 for (int nt = 0; nt < ntotTrace; nt++)
6078 {
6079 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
6080 nTracePnt = tracelist->GetTotPoints(nt);
6081 int noffset = tracelist->GetPhys_Offset(nt);
6082 TraceCoefArray[nt] = nTraceCoef;
6083 TracePntArray[nt] = nTracePnt;
6084 TraceOffArray[nt] = noffset;
6085 FwdMatData[nt] = FwdMat[nt]->GetPtr();
6086 BwdMatData[nt] = BwdMat[nt]->GetPtr();
6087 if (nTraceCoef > nTraceCoefMax)
6088 {
6089 nTraceCoefMax = nTraceCoef;
6090 }
6091 if (nTraceCoef < nTraceCoefMin)
6092 {
6093 nTraceCoefMin = nTraceCoef;
6094 }
6095 }
6096 WARNINGL1(nTraceCoefMax == nTraceCoefMin,
6097 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
6098
6099 int traceID, nfieldPnts, ElmtId, noffset;
6100 const Array<OneD, const Array<OneD, int>> LocTracephysToTraceIDMap =
6101 locTraceToTraceMap->GetLocTracephysToTraceIDMap();
6102 const Array<OneD, const int> fieldToLocTraceMap =
6103 locTraceToTraceMap->GetLocTraceToFieldMap();
6104 Array<OneD, Array<OneD, int>> fieldToLocTraceMapLR(2);
6105 noffset = 0;
6106 for (int k = 0; k < nFwdBwdNonZero; ++k)
6107 {
6108 size_t i = nlocTracePtsNonZeroIndex[k];
6109 fieldToLocTraceMapLR[i] = Array<OneD, int>(nlocTracePtsLR[i]);
6110 Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
6111 &fieldToLocTraceMapLR[i][0], 1);
6112 noffset += nlocTracePtsLR[i];
6113 }
6114
6115 Array<OneD, Array<OneD, int>> MatIndexArray(2);
6116 for (int k = 0; k < nFwdBwdNonZero; ++k)
6117 {
6118 size_t nlr = nlocTracePtsNonZeroIndex[k];
6119 MatIndexArray[nlr] = Array<OneD, int>(nlocTracePtsLR[nlr]);
6120 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6121 {
6122 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6123 nTraceCoef = TraceCoefArray[traceID];
6124 ElmtId = LRAdjExpid[nlr][traceID];
6125 noffset = GetPhys_Offset(ElmtId);
6126 nElmtCoef = ElmtCoefArray[ElmtId];
6127 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
6128 nPnts = nfieldPnts - noffset;
6129
6130 MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
6131 }
6132 }
6133
6134 for (int nc = 0; nc < nTraceCoefMin; nc++)
6135 {
6136 for (int nt = 0; nt < ntotTrace; nt++)
6137 {
6138 nTraceCoef = TraceCoefArray[nt];
6139 nTracePnt = TracePntArray[nt];
6140 noffset = TraceOffArray[nt];
6141 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6142 &TraceFwdPhy[noffset], 1);
6143 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6144 &TraceBwdPhy[noffset], 1);
6145 }
6146
6147 for (int k = 0; k < nFwdBwdNonZero; ++k)
6148 {
6149 size_t i = nlocTracePtsNonZeroIndex[k];
6150 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6151 }
6152
6153 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6154 tmplocTrace[1]);
6155
6156 for (int k = 0; k < nFwdBwdNonZero; ++k)
6157 {
6158 size_t nlr = nlocTracePtsNonZeroIndex[k];
6159 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6160 {
6161 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6162 nTraceCoef = TraceCoefArray[traceID];
6163 ElmtId = LRAdjExpid[nlr][traceID];
6164 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6165 sign = elmtLRSign[nlr][traceID][nc];
6166 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6167
6168 ElmtMatDataArray[ElmtId][MatIndex] -=
6169 sign * tmplocTrace[nlr][nloc];
6170 }
6171 }
6172 }
6173
6174 for (int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
6175 {
6176 for (int nt = 0; nt < ntotTrace; nt++)
6177 {
6178 nTraceCoef = TraceCoefArray[nt];
6179 nTracePnt = TracePntArray[nt];
6180 noffset = TraceOffArray[nt];
6181 if (nc < nTraceCoef)
6182 {
6183 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6184 &TraceFwdPhy[noffset], 1);
6185 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6186 &TraceBwdPhy[noffset], 1);
6187 }
6188 else
6189 {
6190 Vmath::Zero(nTracePnt, &TraceFwdPhy[noffset], 1);
6191 Vmath::Zero(nTracePnt, &TraceBwdPhy[noffset], 1);
6192 }
6193 }
6194
6195 for (int k = 0; k < nFwdBwdNonZero; ++k)
6196 {
6197 size_t i = nlocTracePtsNonZeroIndex[k];
6198 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6199 }
6200 GetLocTraceFromTracePts(TraceFwdPhy, TraceBwdPhy, tmplocTrace[0],
6201 tmplocTrace[1]);
6202
6203 for (int k = 0; k < nFwdBwdNonZero; ++k)
6204 {
6205 size_t nlr = nlocTracePtsNonZeroIndex[k];
6206 for (int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6207 {
6208 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6209 nTraceCoef = TraceCoefArray[traceID];
6210 if (nc < nTraceCoef)
6211 {
6212 ElmtId = LRAdjExpid[nlr][traceID];
6213 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6214 sign = -elmtLRSign[nlr][traceID][nc];
6215 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6216
6217 ElmtMatDataArray[ElmtId][MatIndex] +=
6218 sign * tmplocTrace[nlr][nloc];
6219 }
6220 }
6221 }
6222 }
6223}
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:49
std::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2177
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition: ExpList.h:2147
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:2238
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2094
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
Definition: ExpList.h:2109
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:487

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

2235{
2236 v_AddTraceQuadPhysToField(Fwd, Bwd, field);
2237}
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4832

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

828 {
829 v_AddTraceQuadPhysToOffDiag(Fwd, Bwd, field);
830 }
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4841

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

922 {
923 v_AppendFieldData(fielddef, fielddata);
924 }
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:3929

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

930 {
931 v_AppendFieldData(fielddef, fielddata, coeffs);
932 }

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

3060{
3061}

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

◆ BwdTrans()

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

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

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

Definition at line 1732 of file ExpList.h.

1734{
1735 v_BwdTrans(inarray, outarray);
1736}
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2869

References v_BwdTrans().

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

◆ ClearGlobalLinSysManager()

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

Definition at line 5664 of file ExpList.cpp.

5665{
5667}
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3701

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

5504{
5506 vector<std::pair<LocalRegions::ExpansionSharedPtr, int>>>
5507 collections;
5508
5509 // Set up initialisation flags
5511 std::vector<bool>(Collections::SIZE_OperatorType, true);
5512
5513 // Figure out optimisation parameters if provided in
5514 // session file or default given
5515 Collections::CollectionOptimisation colOpt(
5516 m_session, (*m_exp)[0]->GetShapeDimension(), ImpType);
5517
5518 // turn on autotuning if explicitly specified in xml file
5519 // or command line option is set but only do optimisation
5520 // for volumetric elements (not boundary condition)
5521 bool autotuning = colOpt.IsUsingAutotuning();
5522 if ((autotuning == false) && (ImpType == Collections::eNoImpType))
5523 {
5524 // turn on autotuning if writeoptfile specified
5525 // if m_graph available
5526 if (m_session->GetUpdateOptFile() && m_graph)
5527 {
5528 // only turn on autotuning for volumetric elements
5529 // where Mesh Dimension is equal to the Shape
5530 // Dimension of element.
5531 if (m_graph->GetMeshDimension() == (*m_exp)[0]->GetShapeDimension())
5532 {
5533 autotuning = true;
5534 }
5535 }
5536 }
5537 bool verbose = (m_session->DefinesCmdLineArgument("verbose")) &&
5538 (m_session->GetComm()->GetRank() == 0);
5539 // the maximum size is either explicitly specified, or set to very large
5540 // value which will not affect the actual collection size
5541 int collmax =
5542 (colOpt.GetMaxCollectionSize() > 0 ? colOpt.GetMaxCollectionSize()
5543 : 2 * m_exp->size());
5544
5545 // clear vectors in case previously called
5546 m_collections.clear();
5547 m_coll_coeff_offset.clear();
5548 m_coll_phys_offset.clear();
5549
5550 /*-------------------------------------------------------------------------
5551 Dividing m_exp into sub groups (collections): original exp order is kept.
5552 Use 3 basiskey + deformed flag to determine if two exp belong to the same
5553 collection or not.
5554 -------------------------------------------------------------------------*/
5555 vector<StdRegions::StdExpansionSharedPtr> collExp;
5556 // initialize the basisKeys to NullBasisKey
5557 std::vector<LibUtilities::BasisKey> prevbasisKeys(
5559 std::vector<LibUtilities::BasisKey> thisbasisKeys(
5561 // initialize the deformed flag to false
5562 bool prevDef = false;
5563 // collcnt is the number of elements in current collection
5564 int collcnt = 0;
5565 // collsize is the maximum size among all collections
5566 int collsize = 0;
5567
5568 for (int i = 0; i < (*m_exp).size(); i++)
5569 {
5570 LocalRegions::ExpansionSharedPtr exp = (*m_exp)[i];
5571 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(exp);
5572
5573 // fetch basiskeys of current element
5574 for (int d = 0; d < exp->GetNumBases(); d++)
5575 {
5576 thisbasisKeys[d] = exp->GetBasis(d)->GetBasisKey();
5577 }
5578 // fetch deformed flag of current element
5579 bool Deformed =
5580 (exp->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed);
5581
5582 // Check if this element is the same type as the previous one or
5583 // if we have reached the maximum collection size
5584 if (thisbasisKeys != prevbasisKeys || prevDef != Deformed ||
5585 collcnt >= collmax)
5586 {
5587 // if previous one is not empty (i==0), create new collection
5588 // according to the previous collExp and push it back.
5589 if (i > 0)
5590 {
5591 Collections::Collection tmp(collExp, impTypes);
5592 m_collections.push_back(tmp);
5593
5594 // if no Imp Type provided and No
5595 // setting in xml file. reset
5596 // impTypes using timings
5597 if (autotuning)
5598 {
5599 // if current collection is larger than previous one
5600 // update impTypes; otherwise, use previous impTypes
5601 if (collExp.size() > collsize)
5602 {
5603 impTypes =
5604 colOpt.SetWithTimings(collExp, impTypes, verbose);
5605 collsize = collExp.size();
5606 }
5607 }
5608
5609 // start new geom list
5610 collExp.clear();
5611 }
5612
5613 // set up initial offset of this collection
5614 m_coll_coeff_offset.push_back(m_coeff_offset[i]);
5615 m_coll_phys_offset.push_back(m_phys_offset[i]);
5616 // insert exp and reset count to 1
5617 collExp.push_back(exp);
5618 collcnt = 1;
5619 // update previous info
5620 prevbasisKeys = thisbasisKeys;
5621 prevDef = Deformed;
5622 }
5623 else // The current exp is the same as the previous one
5624 {
5625 // insert exp and increment count
5626 collExp.push_back(exp);
5627 collcnt++;
5628 // No need to update previous info
5629 }
5630
5631 // check if we have reached the end of m_exp
5632 if (i == (*m_exp).size() - 1)
5633 {
5634 // Then create and push back the last collection
5635 Collections::Collection tmp(collExp, impTypes);
5636 m_collections.push_back(tmp);
5637
5638 // if no Imp Type provided and No
5639 // setting in xml file. reset
5640 // impTypes using timings
5641 if (autotuning)
5642 {
5643 if (collExp.size() > collsize)
5644 {
5645 impTypes =
5646 colOpt.SetWithTimings(collExp, impTypes, verbose);
5647 collsize = collExp.size();
5648 }
5649 }
5650 collExp.clear();
5651 }
5652 }
5653
5654 // update optimisation file
5655 if ((m_session->GetUpdateOptFile()) && (ImpType == Collections::eNoImpType))
5656 {
5657 colOpt.UpdateOptFile(m_session->GetSessionName(), m_comm);
5658 // turn off writeoptfile option so only first
5659 // instance is timed
5660 m_session->SetUpdateOptFile(false);
5661 }
5662}
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition: ExpList.h:1935
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:112
@ eDeformed
Geometry is curved or has non-constant factors.
std::vector< double > d(NPUPPER *NPUPPER)

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

Referenced by ExpList().

◆ Curl()

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

Definition at line 1847 of file ExpList.h.

1849{
1850 v_Curl(Vel, Q);
1851}
virtual void v_Curl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
Definition: ExpList.cpp:2002

References v_Curl().

◆ CurlCurl()

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

Definition at line 1855 of file ExpList.h.

1857{
1858 v_CurlCurl(Vel, Q);
1859}
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
Definition: ExpList.cpp:2051

References v_CurlCurl().

◆ DealiasedDotProd()

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

Definition at line 1891 of file ExpList.h.

1895{
1896 v_DealiasedDotProd(num_dofs, inarray1, inarray2, outarray);
1897}
virtual void v_DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: ExpList.cpp:4975

References v_DealiasedDotProd().

◆ DealiasedProd()

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

Definition at line 1881 of file ExpList.h.

1885{
1886 v_DealiasedProd(num_dofs, inarray1, inarray2, outarray);
1887}
virtual void v_DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4965

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

1713{
1714 Array<OneD, NekDouble> e_outarray;
1715
1716 for (int i = 0; i < (*m_exp).size(); ++i)
1717 {
1718 (*m_exp)[i]->DivideByQuadratureMetric(inarray + m_phys_offset[i],
1719 e_outarray =
1720 outarray + m_phys_offset[i]);
1721 }
1722}

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

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

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

1557{
1558 Array<OneD, int> returnval((*m_exp).size(), 0);
1559
1560 for (size_t i = 0; i < (*m_exp).size(); ++i)
1561 {
1562 returnval[i] =
1563 (std::max)(returnval[i], (*m_exp)[i]->EvalBasisNumModesMax());
1564 }
1565
1566 return returnval;
1567}

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

2283{
2284 v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2285}
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:5439

References v_EvaluateBoundaryConditions().

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

◆ ExponentialFilter()

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

Definition at line 2149 of file ExpList.cpp.

2152{
2153 Array<OneD, NekDouble> e_array;
2154
2155 for (int i = 0; i < (*m_exp).size(); ++i)
2156 {
2157 (*m_exp)[i]->ExponentialFilter(e_array = array + m_phys_offset[i],
2158 alpha, exponent, cutoff);
2159 }
2160}

References m_phys_offset.

◆ ExtractCoeffsFromFile()

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

Definition at line 3729 of file ExpList.cpp.

3733{
3734 string varString = fileName.substr(0, fileName.find_last_of("."));
3735 int j, k, len = varString.length();
3736 varString = varString.substr(len - 1, len);
3737
3738 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3739 std::vector<std::vector<NekDouble>> FieldData;
3740
3741 std::string ft = LibUtilities::FieldIO::GetFileType(fileName, comm);
3744 ft, comm, m_session->GetSharedFilesystem());
3745
3746 f->Import(fileName, FieldDef, FieldData);
3747
3748 bool found = false;
3749 for (j = 0; j < FieldDef.size(); ++j)
3750 {
3751 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3752 {
3753 if (FieldDef[j]->m_fields[k] == varName)
3754 {
3755 // Copy FieldData into locExpList
3756 ExtractDataToCoeffs(FieldDef[j], FieldData[j],
3757 FieldDef[j]->m_fields[k], coeffs);
3758 found = true;
3759 }
3760 }
3761 }
3762
3763 ASSERTL0(found, "Could not find variable '" + varName +
3764 "' in file boundary condition " + fileName);
3765}
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
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane=std::unordered_map< int, int >())
Extract the data in fielddata into the coeffs.
Definition: ExpList.cpp:3961
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:327
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
Definition: FieldIO.cpp:72

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

◆ ExtractCoeffsToCoeffs()

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

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

Definition at line 3969 of file ExpList.cpp.

3973{
3974 v_ExtractCoeffsToCoeffs(fromExpList, fromCoeffs, toCoeffs);
3975}
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:4073

References v_ExtractCoeffsToCoeffs().

◆ ExtractDataToCoeffs()

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

Extract the data in fielddata into the coeffs.

Definition at line 3961 of file ExpList.cpp.

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

References v_ExtractDataToCoeffs().

Referenced by ExtractCoeffsFromFile().

◆ ExtractElmtDataToCoeffs()

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

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

◆ ExtractElmtToBndPhys()

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

Definition at line 2302 of file ExpList.h.

2305{
2306 v_ExtractElmtToBndPhys(i, elmt, boundary);
2307}
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:5235

References v_ExtractElmtToBndPhys().

◆ ExtractFileBCs()

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

◆ ExtractPhysToBnd()

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

Definition at line 2316 of file ExpList.h.

2319{
2320 v_ExtractPhysToBnd(i, phys, bnd);
2321}
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.cpp:5312

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

2312{
2313 v_ExtractPhysToBndElmt(i, phys, bndElmt);
2314}
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:5273

References v_ExtractPhysToBndElmt().

◆ ExtractTracePhys() [1/2]

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

Definition at line 2259 of file ExpList.h.

2260{
2261 v_ExtractTracePhys(outarray);
2262}
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4883

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

2266{
2267 v_ExtractTracePhys(inarray, outarray);
2268}

References v_ExtractTracePhys().

◆ FillBndCondFromField() [1/2]

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

Fill Bnd Condition expansion from the values stored in expansion.

Definition at line 1975 of file ExpList.h.

1976{
1977 v_FillBndCondFromField(coeffs);
1978}
virtual void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
Definition: ExpList.cpp:5055

References v_FillBndCondFromField().

◆ FillBndCondFromField() [2/2]

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

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

Definition at line 1979 of file ExpList.h.

1981{
1982 v_FillBndCondFromField(nreg, coeffs);
1983}

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

2229{
2230 v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2231}
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
Definition: ExpList.cpp:4823

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

2247{
2248 v_FillBwdWithBwdWeight(weightave, weightjmp);
2249}
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Definition: ExpList.cpp:5401

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

1696{
1697 v_FwdTrans(inarray, outarray);
1698}
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5101

References v_FwdTrans().

◆ FwdTransBndConstrained()

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

Definition at line 1711 of file ExpList.h.

1714{
1715 v_FwdTransBndConstrained(inarray, outarray);
1716}
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2217

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

1705{
1706 v_FwdTransLocalElmt(inarray, outarray);
1707}
virtual void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2208

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

2282{
2283 int i, cnt1;
2284 int n_exp = 0;
2285 DNekScalMatSharedPtr loc_mat;
2286 DNekScalBlkMatSharedPtr BlkMatrix;
2287 map<int, int> elmt_id;
2288 LibUtilities::ShapeType ShapeType = gkey.GetShapeType();
2289
2291 {
2292 for (i = 0; i < (*m_exp).size(); ++i)
2293 {
2294 if ((*m_exp)[i]->DetShapeType() == ShapeType)
2295 {
2296 elmt_id[n_exp++] = i;
2297 }
2298 }
2299 }
2300 else
2301 {
2302 n_exp = (*m_exp).size();
2303 for (i = 0; i < n_exp; ++i)
2304 {
2305 elmt_id[i] = i;
2306 }
2307 }
2308
2309 Array<OneD, unsigned int> nrows(n_exp);
2310 Array<OneD, unsigned int> ncols(n_exp);
2311
2312 switch (gkey.GetMatrixType())
2313 {
2315 {
2316 // set up an array of integers for block matrix construction
2317 for (i = 0; i < n_exp; ++i)
2318 {
2319 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2320 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2321 }
2322 }
2323 break;
2325 {
2326 // set up an array of integers for block matrix construction
2327 for (i = 0; i < n_exp; ++i)
2328 {
2329 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2330 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2331 }
2332 }
2333 break;
2334 case StdRegions::eMass:
2339 {
2340 // set up an array of integers for block matrix construction
2341 for (i = 0; i < n_exp; ++i)
2342 {
2343 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2344 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2345 }
2346 }
2347 break;
2348
2350 {
2351 // set up an array of integers for block matrix construction
2352 for (i = 0; i < n_exp; ++i)
2353 {
2354 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2355 ncols[i] =
2356 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2357 }
2358 }
2359 break;
2361 {
2362 // set up an array of integers for block matrix construction
2363 for (i = 0; i < n_exp; ++i)
2364 {
2365 nrows[i] =
2366 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2367 ncols[i] =
2368 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2369 }
2370 }
2371 break;
2372 default:
2373 {
2375 "Global Matrix creation not defined for this "
2376 "type of matrix");
2377 }
2378 }
2379
2380 MatrixStorage blkmatStorage = eDIAGONAL;
2381 BlkMatrix = MemoryManager<DNekScalBlkMat>::AllocateSharedPtr(nrows, ncols,
2382 blkmatStorage);
2383
2384 int nvarcoeffs = gkey.GetNVarCoeffs();
2385 int eid;
2386 Array<OneD, NekDouble> varcoeffs_wk;
2387
2388 for (i = cnt1 = 0; i < n_exp; ++i)
2389 {
2390 // need to be initialised with zero size for non
2391 // variable coefficient case
2392 StdRegions::VarCoeffMap varcoeffs;
2393
2394 eid = elmt_id[i];
2395 if (nvarcoeffs > 0)
2396 {
2397 varcoeffs = StdRegions::RestrictCoeffMap(
2398 gkey.GetVarCoeffs(), m_phys_offset[i],
2399 (*m_exp)[i]->GetTotPoints());
2400 }
2401
2402 LocalRegions::MatrixKey matkey(
2403 gkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(), *(*m_exp)[eid],
2404 gkey.GetConstFactors(), varcoeffs);
2405
2406 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>(
2407 (*m_exp)[elmt_id.find(i)->second])
2408 ->GetLocMatrix(matkey);
2409 BlkMatrix->SetBlock(i, i, loc_mat);
2410 }
2411
2412 return BlkMatrix;
2413}
VarCoeffMap RestrictCoeffMap(const VarCoeffMap &m, size_t offset, size_t cnt)
Definition: StdRegions.hpp:355
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:352
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79

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

Referenced by GetBlockMatrix().

◆ GeneralGetFieldDefinitions()

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

Definition at line 3802 of file ExpList.cpp.

3808{
3809 int startenum = (int)LibUtilities::eSegment;
3810 int endenum = (int)LibUtilities::eHexahedron;
3811 int s = 0;
3813
3814 ASSERTL1(NumHomoDir == HomoBasis.size(),
3815 "Homogeneous basis is not the same length as NumHomoDir");
3816 ASSERTL1(NumHomoDir == HomoLen.size(),
3817 "Homogeneous length vector is not the same length as NumHomDir");
3818
3819 // count number of shapes
3820 switch ((*m_exp)[0]->GetShapeDimension())
3821 {
3822 case 1:
3823 startenum = (int)LibUtilities::eSegment;
3824 endenum = (int)LibUtilities::eSegment;
3825 break;
3826 case 2:
3827 startenum = (int)LibUtilities::eTriangle;
3828 endenum = (int)LibUtilities::eQuadrilateral;
3829 break;
3830 case 3:
3831 startenum = (int)LibUtilities::eTetrahedron;
3832 endenum = (int)LibUtilities::eHexahedron;
3833 break;
3834 }
3835
3836 for (s = startenum; s <= endenum; ++s)
3837 {
3838 std::vector<unsigned int> elementIDs;
3839 std::vector<LibUtilities::BasisType> basis;
3840 std::vector<unsigned int> numModes;
3841 std::vector<std::string> fields;
3842
3843 bool first = true;
3844 bool UniOrder = true;
3845 int n;
3846
3847 shape = (LibUtilities::ShapeType)s;
3848
3849 for (int i = 0; i < (*m_exp).size(); ++i)
3850 {
3851 if ((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
3852 {
3853 elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
3854 if (first)
3855 {
3856 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3857 {
3858 basis.push_back(
3859 (*m_exp)[i]->GetBasis(j)->GetBasisType());
3860 numModes.push_back(
3861 (*m_exp)[i]->GetBasis(j)->GetNumModes());
3862 }
3863
3864 // add homogeneous direction details if defined
3865 for (n = 0; n < NumHomoDir; ++n)
3866 {
3867 basis.push_back(HomoBasis[n]->GetBasisType());
3868 numModes.push_back(HomoBasis[n]->GetNumModes());
3869 }
3870
3871 first = false;
3872 }
3873 else
3874 {
3875 ASSERTL0(
3876 (*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
3877 "Routine is not set up for multiple bases definitions");
3878
3879 for (int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3880 {
3881 numModes.push_back(
3882 (*m_exp)[i]->GetBasis(j)->GetNumModes());
3883 if (numModes[j] !=
3884 (*m_exp)[i]->GetBasis(j)->GetNumModes())
3885 {
3886 UniOrder = false;
3887 }
3888 }
3889 // add homogeneous direction details if defined
3890 for (n = 0; n < NumHomoDir; ++n)
3891 {
3892 numModes.push_back(HomoBasis[n]->GetNumModes());
3893 }
3894 }
3895 }
3896 }
3897
3898 if (elementIDs.size() > 0)
3899 {
3902 AllocateSharedPtr(shape, elementIDs, basis, UniOrder,
3903 numModes, fields, NumHomoDir, HomoLen,
3904 homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
3905 fielddef.push_back(fdef);
3906 }
3907 }
3908}
#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:186

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

2462{
2463 int nvarcoeffs = gkey.GetNVarCoeffs();
2464
2465 if ((nvarcoeffs == 0) && (gkey.GetMatrixType() == StdRegions::eHelmholtz))
2466 {
2467 // initialise if required
2468 if (m_collections.size() &&
2470 {
2471 for (int i = 0; i < m_collections.size(); ++i)
2472 {
2474 gkey.GetConstFactors());
2475 }
2477 }
2478 else
2479 {
2480 for (int i = 0; i < m_collections.size(); ++i)
2481 {
2482 m_collections[i].CheckFactors(Collections::eHelmholtz,
2483 gkey.GetConstFactors(),
2485 }
2486 }
2487
2488 Array<OneD, NekDouble> tmp;
2489 for (int i = 0; i < m_collections.size(); ++i)
2490 {
2491 m_collections[i].ApplyOperator(
2493 tmp = outarray + m_coll_coeff_offset[i]);
2494 }
2495 }
2496 else
2497 {
2498 Array<OneD, NekDouble> tmp_outarray;
2499 for (int i = 0; i < (*m_exp).size(); ++i)
2500 {
2501 // need to be initialised with zero size for non
2502 // variable coefficient case
2503 StdRegions::VarCoeffMap varcoeffs;
2504
2505 if (nvarcoeffs > 0)
2506 {
2507 varcoeffs = StdRegions::RestrictCoeffMap(
2508 gkey.GetVarCoeffs(), m_phys_offset[i],
2509 (*m_exp)[i]->GetTotPoints());
2510 }
2511
2512 StdRegions::StdMatrixKey mkey(
2513 gkey.GetMatrixType(), (*m_exp)[i]->DetShapeType(),
2514 *((*m_exp)[i]), gkey.GetConstFactors(), varcoeffs);
2515
2516 (*m_exp)[i]->GeneralMatrixOp(
2517 inarray + m_coeff_offset[i],
2518 tmp_outarray = outarray + m_coeff_offset[i], mkey);
2519 }
2520 }
2521}

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, m_phys_offset, and Nektar::StdRegions::RestrictCoeffMap().

◆ GenerateElementVector()

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

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

Definition at line 4159 of file ExpList.cpp.

4163{
4164 int npoints_e;
4165 NekDouble coeff;
4166
4167 Array<OneD, NekDouble> outarray_e;
4168
4169 for (int i = 0; i < (*m_exp).size(); ++i)
4170 {
4171 npoints_e = (*m_exp)[i]->GetTotPoints();
4172
4173 if (i <= ElementID)
4174 {
4175 coeff = scalar1;
4176 }
4177 else
4178 {
4179 coeff = scalar2;
4180 }
4181
4182 outarray_e = Array<OneD, NekDouble>(npoints_e, coeff);
4183 Vmath::Vcopy(npoints_e, &outarray_e[0], 1, &outarray[m_phys_offset[i]],
4184 1);
4185 }
4186}

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

2835{
2836 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2837 const map<int, RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
2838
2839 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2840
2841 if (vType >= eSIZE_GlobalSysSolnType)
2842 {
2843 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
2844 }
2845 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2846
2847 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
2848 locToGloMap);
2849}
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:966
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:895
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 2815 of file ExpList.cpp.

2817{
2818 GlobalLinSysSharedPtr returnlinsys;
2819 std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2820
2821 MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2822
2823 if (vType >= eSIZE_GlobalSysSolnType)
2824 {
2825 NEKERROR(ErrorUtil::efatal, "Matrix solution type not defined");
2826 }
2827 std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2828
2829 return GetGlobalLinSysFactory().CreateInstance(vSolnType, mkey, vExpList,
2830 locToGloMap);
2831}
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:53

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

2532{
2533 int i, j, n, gid1, gid2, cntdim1, cntdim2;
2534 NekDouble sign1, sign2;
2535 DNekScalMatSharedPtr loc_mat;
2536
2537 unsigned int glob_rows = 0;
2538 unsigned int glob_cols = 0;
2539 unsigned int loc_rows = 0;
2540 unsigned int loc_cols = 0;
2541
2542 bool assembleFirstDim = false;
2543 bool assembleSecondDim = false;
2544
2545 switch (mkey.GetMatrixType())
2546 {
2548 {
2549 glob_rows = m_npoints;
2550 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2551
2552 assembleFirstDim = false;
2553 assembleSecondDim = true;
2554 }
2555 break;
2557 {
2558 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2559 glob_cols = m_npoints;
2560
2561 assembleFirstDim = true;
2562 assembleSecondDim = false;
2563 }
2564 break;
2565 case StdRegions::eMass:
2569 {
2570 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2571 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2572
2573 assembleFirstDim = true;
2574 assembleSecondDim = true;
2575 }
2576 break;
2577 default:
2578 {
2580 "Global Matrix creation not defined for this "
2581 "type of matrix");
2582 }
2583 }
2584
2585 COOMatType spcoomat;
2586 CoordType coord;
2587
2588 int nvarcoeffs = mkey.GetNVarCoeffs();
2589 int eid;
2590
2591 // fill global matrix
2592 for (n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2593 {
2594 // need to be initialised with zero size for non
2595 // variable coefficient case
2596 StdRegions::VarCoeffMap varcoeffs;
2597
2598 eid = n;
2599 if (nvarcoeffs > 0)
2600 {
2601 varcoeffs = StdRegions::RestrictCoeffMap(
2602 mkey.GetVarCoeffs(), m_phys_offset[eid],
2603 (*m_exp)[eid]->GetTotPoints());
2604 }
2605
2606 LocalRegions::MatrixKey matkey(
2607 mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2608 *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2609
2610 loc_mat =
2611 std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2612 ->GetLocMatrix(matkey);
2613
2614 loc_rows = loc_mat->GetRows();
2615 loc_cols = loc_mat->GetColumns();
2616
2617 for (i = 0; i < loc_rows; ++i)
2618 {
2619 if (assembleFirstDim)
2620 {
2621 gid1 = locToGloMap->GetLocalToGlobalMap(cntdim1 + i);
2622 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2623 }
2624 else
2625 {
2626 gid1 = cntdim1 + i;
2627 sign1 = 1.0;
2628 }
2629
2630 for (j = 0; j < loc_cols; ++j)
2631 {
2632 if (assembleSecondDim)
2633 {
2634 gid2 = locToGloMap->GetLocalToGlobalMap(cntdim2 + j);
2635 sign2 = locToGloMap->GetLocalToGlobalSign(cntdim2 + j);
2636 }
2637 else
2638 {
2639 gid2 = cntdim2 + j;
2640 sign2 = 1.0;
2641 }
2642
2643 // sparse matrix fill
2644 coord = make_pair(gid1, gid2);
2645 if (spcoomat.count(coord) == 0)
2646 {
2647 spcoomat[coord] = sign1 * sign2 * (*loc_mat)(i, j);
2648 }
2649 else
2650 {
2651 spcoomat[coord] += sign1 * sign2 * (*loc_mat)(i, j);
2652 }
2653 }
2654 }
2655 cntdim1 += loc_rows;
2656 cntdim2 += loc_cols;
2657 }
2658
2660 glob_cols, spcoomat);
2661}
std::pair< IndexType, IndexType > CoordType
std::map< CoordType, NekDouble > COOMatType

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

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

◆ GenGlobalMatrixFull()

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

Definition at line 2663 of file ExpList.cpp.

2665{
2666 int i, j, n, gid1, gid2, loc_lda, eid;
2667 NekDouble sign1, sign2, value;
2668 DNekScalMatSharedPtr loc_mat;
2669
2670 int totDofs = locToGloMap->GetNumGlobalCoeffs();
2671 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2672
2673 unsigned int rows = totDofs - NumDirBCs;
2674 unsigned int cols = totDofs - NumDirBCs;
2675 NekDouble zero = 0.0;
2676
2677 DNekMatSharedPtr Gmat;
2678 int bwidth = locToGloMap->GetFullSystemBandWidth();
2679
2680 int nvarcoeffs = mkey.GetNVarCoeffs();
2681 MatrixStorage matStorage;
2682
2683 map<int, RobinBCInfoSharedPtr> RobinBCInfo = GetRobinBCInfo();
2684
2685 switch (mkey.GetMatrixType())
2686 {
2687 // case for all symmetric matices
2690 if ((2 * (bwidth + 1)) < rows)
2691 {
2694 rows, cols, zero, matStorage, bwidth, bwidth);
2695 }
2696 else
2697 {
2698 matStorage = ePOSITIVE_DEFINITE_SYMMETRIC;
2700 rows, cols, zero, matStorage);
2701 }
2702
2703 break;
2704 default: // Assume general matrix - currently only set up
2705 // for full invert
2706 {
2707 matStorage = eFULL;
2709 rows, cols, zero, matStorage);
2710 }
2711 }
2712
2713 // fill global symmetric matrix
2714 for (n = 0; n < (*m_exp).size(); ++n)
2715 {
2716 // need to be initialised with zero size for non
2717 // variable coefficient case
2718 StdRegions::VarCoeffMap varcoeffs;
2719
2720 eid = n;
2721 if (nvarcoeffs > 0)
2722 {
2723 varcoeffs = StdRegions::RestrictCoeffMap(
2724 mkey.GetVarCoeffs(), m_phys_offset[eid],
2725 (*m_exp)[eid]->GetTotPoints());
2726 }
2727
2728 LocalRegions::MatrixKey matkey(
2729 mkey.GetMatrixType(), (*m_exp)[eid]->DetShapeType(),
2730 *((*m_exp)[eid]), mkey.GetConstFactors(), varcoeffs);
2731
2732 loc_mat =
2733 std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])
2734 ->GetLocMatrix(matkey);
2735
2736 if (RobinBCInfo.count(n) != 0) // add robin mass matrix
2737 {
2739
2740 // declare local matrix from scaled matrix.
2741 int rows = loc_mat->GetRows();
2742 int cols = loc_mat->GetColumns();
2743 const NekDouble *dat = loc_mat->GetRawPtr();
2744 DNekMatSharedPtr new_mat =
2746 Blas::Dscal(rows * cols, loc_mat->Scale(), new_mat->GetRawPtr(), 1);
2747
2748 // add local matrix contribution
2749 for (rBC = RobinBCInfo.find(n)->second; rBC; rBC = rBC->next)
2750 {
2751 (*m_exp)[n]->AddRobinMassMatrix(
2752 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, new_mat);
2753 }
2754
2755 NekDouble one = 1.0;
2756 // redeclare loc_mat to point to new_mat plus the scalar.
2757 loc_mat =
2759 }
2760
2761 loc_lda = loc_mat->GetColumns();
2762
2763 for (i = 0; i < loc_lda; ++i)
2764 {
2765 gid1 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + i) -
2766 NumDirBCs;
2767 sign1 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + i);
2768 if (gid1 >= 0)
2769 {
2770 for (j = 0; j < loc_lda; ++j)
2771 {
2772 gid2 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] +
2773 j) -
2774 NumDirBCs;
2775 sign2 = locToGloMap->GetLocalToGlobalSign(
2776 m_coeff_offset[n] + j);
2777 if (gid2 >= 0)
2778 {
2779 // When global matrix is symmetric,
2780 // only add the value for the upper
2781 // triangular part in order to avoid
2782 // entries to be entered twice
2783 if ((matStorage == eFULL) || (gid2 >= gid1))
2784 {
2785 value = Gmat->GetValue(gid1, gid2) +
2786 sign1 * sign2 * (*loc_mat)(i, j);
2787 Gmat->SetValue(gid1, gid2, value);
2788 }
2789 }
2790 }
2791 }
2792 }
2793 }
2794
2795 return Gmat;
2796}
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:151
std::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC

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

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

◆ Get1DScaledTotPoints()

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

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

Definition at line 1582 of file ExpList.h.

1583{
1584 int returnval = 0;
1585 size_t cnt;
1586 size_t nbase = (*m_exp)[0]->GetNumBases();
1587
1588 for (size_t i = 0; i < (*m_exp).size(); ++i)
1589 {
1590 cnt = 1;
1591 for (size_t j = 0; j < nbase; ++j)
1592 {
1593 cnt *= scale * ((*m_exp)[i]->GetNumPoints(j));
1594 }
1595 returnval += cnt;
1596 }
1597 return returnval;
1598}

◆ GetBCValues()

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

Definition at line 1901 of file ExpList.h.

1904{
1905 v_GetBCValues(BndVals, TotField, BndID);
1906}
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:4985

References v_GetBCValues().

◆ GetBlockMatrix()

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

Definition at line 2415 of file ExpList.cpp.

2417{
2418 auto matrixIter = m_blockMat->find(gkey);
2419
2420 if (matrixIter == m_blockMat->end())
2421 {
2422 return ((*m_blockMat)[gkey] = GenBlockMatrix(gkey));
2423 }
2424 else
2425 {
2426 return matrixIter->second;
2427 }
2428}
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:2280

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

2152{
2153 return v_GetBndCondBwdWeight();
2154}
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
Definition: ExpList.cpp:4860

References v_GetBndCondBwdWeight().

◆ GetBndCondExpansions()

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

Definition at line 2136 of file ExpList.h.

2137{
2138 return v_GetBndCondExpansions();
2139}
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:4189

References v_GetBndCondExpansions().

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

◆ GetBndConditions()

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

Definition at line 2270 of file ExpList.h.

2271{
2272 return v_GetBndConditions();
2273}
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:5418

References v_GetBndConditions().

◆ GetBndElmtExpansion()

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

Definition at line 2295 of file ExpList.h.

2298{
2299 v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2300}
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
Definition: ExpList.cpp:5225

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

5473{
5474 auto collectionIter = collection.find(regionId);
5475 ASSERTL1(collectionIter != collection.end(),
5476 "Unable to locate collection " +
5477 boost::lexical_cast<string>(regionId));
5478
5480 (*collectionIter).second;
5481 auto conditionMapIter = bndCondMap->find(variable);
5482 ASSERTL1(conditionMapIter != bndCondMap->end(),
5483 "Unable to locate condition map.");
5484
5485 const SpatialDomains::BoundaryConditionShPtr boundaryCondition =
5486 (*conditionMapIter).second;
5487
5488 return boundaryCondition;
5489}
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 2323 of file ExpList.h.

2325{
2326 v_GetBoundaryNormals(i, normals);
2327}
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:5349

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

4104{
4105 size_t nTracePts = weightAver.size();
4106 // average for interior traces
4107 for (int i = 0; i < nTracePts; ++i)
4108 {
4109 weightAver[i] = 0.5;
4110 weightJump[i] = 1.0;
4111 }
4112 FillBwdWithBwdWeight(weightAver, weightJump);
4113}
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition: ExpList.h:2245

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

2034{
2035 return m_coeffs[i];
2036}

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

1968{
1969 return m_coeffs;
1970}

References m_coeffs.

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

◆ GetCoeffs() [2/2]

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

Get the i th value (coefficient) of m_coeffs.

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

Definition at line 2041 of file ExpList.h.

2042{
2043 return m_coeffs[i];
2044}

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

2143{
2144 return m_coeffsToElmt;
2145}

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

977 {
978 return m_comm;
979 }

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

1927{
1928 ASSERTL2(eid <= (*m_exp).size(), "eid is larger than number of elements");
1929 return (*m_exp)[eid]->GetCoordim();
1930}
#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 GetExpIndex(), PhysEvaluate(), v_GetBoundaryNormals(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetCoords(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetCoords(), v_GetNormals(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetNormals(), v_IProductWRTDerivBase(), v_NormVectorIProductWRTBase(), v_Upwind(), v_WriteTecplotZone(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_WriteTecplotZone(), and Nektar::MultiRegions::ExpList2DHomogeneous2D::v_WriteTecplotZone().

◆ GetCoords() [1/2]

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

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

Definition at line 1785 of file ExpList.h.

1788{
1789 v_GetCoords(coord_0, coord_1, coord_2);
1790}
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:5152

References v_GetCoords().

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

◆ GetCoords() [2/2]

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

Definition at line 1792 of file ExpList.h.

1795{
1796 v_GetCoords(eid, xc0, xc1, xc2);
1797}

References v_GetCoords().

◆ GetDiagMatIpwrtBase()

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

Definition at line 5918 of file ExpList.cpp.

5921{
5923 int nElmtPntPrevious = 0;
5924 int nElmtCoefPrevious = 0;
5925 int nTotElmt = (*m_exp).size();
5926 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5927 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5928
5929 Array<OneD, NekDouble> tmpPhys;
5930 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
5931 Array<OneD, NekDouble> stdMat_data;
5932
5933 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5934 {
5935 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5936 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5937 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
5938
5939 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5940 (ElmtTypeNow != ElmtTypePrevious))
5941 {
5943 stdExp = (*m_exp)[nelmt]->GetStdExp();
5944 StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
5945 stdExp->DetShapeType(), *stdExp);
5946
5947 DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
5948 stdMat_data = BwdMat->GetPtr();
5949
5950 if (nElmtPntPrevious != nElmtPnt)
5951 {
5952 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5953 }
5954
5955 ElmtTypePrevious = ElmtTypeNow;
5956 nElmtPntPrevious = nElmtPnt;
5957 nElmtCoefPrevious = nElmtCoef;
5958 }
5959
5960 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5961 inarray[nelmt],
5962 tmpPhys); // weight with metric
5963
5964 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
5965
5966 for (int np = 0; np < nElmtPnt; np++)
5967 {
5968 NekDouble factor = tmpPhys[np];
5969 clmnArray = MatDataArray + np * nElmtCoef;
5970 clmnStdMatArray = stdMat_data + np * nElmtCoef;
5971 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
5972 }
5973 }
5974}
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:245

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

4632{
4633 int e_npoints;
4634
4635 Array<OneD, NekDouble> locLeng;
4636 Array<OneD, Array<OneD, NekDouble>> lengintp(2);
4637 Array<OneD, Array<OneD, NekDouble>> lengAdd(2);
4638 Array<OneD, int> LRbndnumbs(2);
4639 Array<OneD, Array<OneD, NekDouble>> lengLR(2);
4640 lengLR[0] = lengthsFwd;
4641 lengLR[1] = lengthsBwd;
4642 Array<OneD, LocalRegions::ExpansionSharedPtr> LRelmts(2);
4645 int e_npoints0 = -1;
4646 if (m_expType == e1D)
4647 {
4648 for (int i = 0; i < m_exp->size(); ++i)
4649 {
4650 loc_exp = (*m_exp)[i];
4651 int offset = m_phys_offset[i];
4652
4653 int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4654 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4655 if (e_npoints0 < e_npoints)
4656 {
4657 for (int nlr = 0; nlr < 2; nlr++)
4658 {
4659 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4660 }
4661 e_npoints0 = e_npoints;
4662 }
4663
4664 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4665 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4666
4667 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4668 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4669 for (int nlr = 0; nlr < 2; ++nlr)
4670 {
4671 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4672 lengAdd[nlr] = lengintp[nlr];
4673 int bndNumber = LRbndnumbs[nlr];
4674 loc_elmt = LRelmts[nlr];
4675 if (bndNumber >= 0)
4676 {
4677 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4678 lengAdd[nlr] = locLeng;
4679
4680 int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
4681 if (e_nmodes != loc_nmodes)
4682 {
4683 // Parallel case: need to interpolate.
4684 LibUtilities::PointsKey to_key =
4685 loc_exp->GetBasis(0)->GetPointsKey();
4686 LibUtilities::PointsKey from_key =
4687 loc_elmt->GetBasis(0)->GetPointsKey();
4688 LibUtilities::Interp1D(from_key, locLeng, to_key,
4689 lengintp[nlr]);
4690 lengAdd[nlr] = lengintp[nlr];
4691 }
4692 }
4693
4694 for (int j = 0; j < e_npoints; ++j)
4695 {
4696 lengLR[nlr][offset + j] = lengAdd[nlr][j];
4697 }
4698 }
4699 }
4700 }
4701 else if (m_expType == e2D)
4702 {
4703 for (int i = 0; i < m_exp->size(); ++i)
4704 {
4705 loc_exp = (*m_exp)[i];
4706 int offset = m_phys_offset[i];
4707
4708 LibUtilities::BasisKey traceBasis0 =
4709 loc_exp->GetBasis(0)->GetBasisKey();
4710 LibUtilities::BasisKey traceBasis1 =
4711 loc_exp->GetBasis(1)->GetBasisKey();
4712 const int TraceNq0 = traceBasis0.GetNumPoints();
4713 const int TraceNq1 = traceBasis1.GetNumPoints();
4714 e_npoints = TraceNq0 * TraceNq1;
4715 if (e_npoints0 < e_npoints)
4716 {
4717 for (int nlr = 0; nlr < 2; nlr++)
4718 {
4719 lengintp[nlr] = Array<OneD, NekDouble>(e_npoints, 0.0);
4720 }
4721 e_npoints0 = e_npoints;
4722 }
4723
4724 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4725 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4726
4727 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4728 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4729 for (int nlr = 0; nlr < 2; ++nlr)
4730 {
4731 Vmath::Zero(e_npoints0, lengintp[nlr], 1);
4732 int bndNumber = LRbndnumbs[nlr];
4733 loc_elmt = LRelmts[nlr];
4734 if (bndNumber >= 0)
4735 {
4736 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4737 // Project normals from 3D element onto the
4738 // same orientation as the trace expansion.
4740 loc_elmt->GetTraceOrient(bndNumber);
4741
4742 int fromid0, fromid1;
4744 {
4745 fromid0 = 0;
4746 fromid1 = 1;
4747 }
4748 else
4749 {
4750 fromid0 = 1;
4751 fromid1 = 0;
4752 }
4753
4754 LibUtilities::BasisKey faceBasis0 =
4755 loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4756 LibUtilities::BasisKey faceBasis1 =
4757 loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4758 const int faceNq0 = faceBasis0.GetNumPoints();
4759 const int faceNq1 = faceBasis1.GetNumPoints();
4760 Array<OneD, NekDouble> alignedLeng(faceNq0 * faceNq1);
4761
4762 AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
4764 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4765 alignedLeng, traceBasis0.GetPointsKey(),
4766 traceBasis1.GetPointsKey(), lengintp[nlr]);
4767 }
4768
4769 for (int j = 0; j < e_npoints; ++j)
4770 {
4771 lengLR[nlr][offset + j] = lengintp[nlr][j];
4772 }
4773 }
4774 }
4775 }
4776}
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:49
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:103
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:4346

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

◆ GetElmtToExpId() [1/2]

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

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

Definition at line 1048 of file ExpList.h.

1049 {
1050 auto it = m_elmtToExpId.find(elmtId);
1051 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
1052 std::to_string(elmtId) +
1053 " not found in element ID to "
1054 "expansion ID map.")
1055 return it->second;
1056 }

References ASSERTL0, and m_elmtToExpId.

◆ GetElmtToExpId() [2/2]

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

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

Definition at line 1042 of file ExpList.h.

1043 {
1044 return m_elmtToExpId;
1045 }

References m_elmtToExpId.

◆ GetExp() [1/3]

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

This function returns the vector of elements in the expansion.

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

Definition at line 2094 of file ExpList.h.

2096{
2097 return m_exp;
2098}

References m_exp.

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

◆ GetExp() [2/3]

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

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

Definition at line 2909 of file ExpList.cpp.

2911{
2912 return GetExp(GetExpIndex(gloCoord));
2913}
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:2920

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

2072{
2073 return (*m_exp)[n];
2074}

References m_exp.

◆ GetExpFromGeomId()

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

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

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

Definition at line 2081 of file ExpList.h.

2082{
2083 auto it = m_elmtToExpId.find(n);
2084 ASSERTL0(it != m_elmtToExpId.end(), "Global geometry ID " +
2085 std::to_string(n) +
2086 " not found in element ID to "
2087 "expansion ID map.")
2088 return (*m_exp)[it->second];
2089}

References ASSERTL0, m_elmtToExpId, and m_exp.

◆ GetExpIndex() [1/2]

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

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

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

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

Definition at line 2920 of file ExpList.cpp.

2923{
2924 Array<OneD, NekDouble> Lcoords(gloCoord.size());
2925
2926 return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
2927 maxDistance);
2928}

References GetExpIndex().

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

◆ GetExpIndex() [2/2]

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

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

Definition at line 2930 of file ExpList.cpp.

2934{
2935 if (GetNumElmts() == 0)
2936 {
2937 return -1;
2938 }
2939
2940 if (m_elmtToExpId.size() == 0)
2941 {
2942 // Loop in reverse order so that in case where using a
2943 // Homogeneous expansion it sets geometry ids to first part of
2944 // m_exp list. Otherwise will set to second (complex) expansion
2945 for (int i = (*m_exp).size() - 1; i >= 0; --i)
2946 {
2947 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2948 }
2949 }
2950
2951 NekDouble nearpt = 1e6;
2952 NekDouble nearpt_min = 1e6;
2953 int min_id = -1;
2954 Array<OneD, NekDouble> savLocCoords(locCoords.size());
2955
2956 if (cachedId >= 0 && cachedId < (*m_exp).size())
2957 {
2958 nearpt = 1e12;
2959 if ((*m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords, locCoords,
2960 tol, nearpt))
2961 {
2962 return cachedId;
2963 }
2964 else if (returnNearestElmt && (nearpt < nearpt_min))
2965 {
2966 // If it does not lie within, keep track of which element
2967 // is nearest.
2968 min_id = cachedId;
2969 nearpt_min = nearpt;
2970 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2971 }
2972 }
2973
2974 NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2975 NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2976 NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2979 GetExp(0)->GetCoordim(), -1, x, y, z);
2980
2981 // Get the list of elements whose bounding box contains the desired
2982 // point.
2983 std::vector<int> elmts = m_graph->GetElementsContainingPoint(p);
2984
2985 // Check each element in turn to see if point lies within it.
2986 for (int i = 0; i < elmts.size(); ++i)
2987 {
2988 int id = m_elmtToExpId[elmts[i]];
2989 if (id == cachedId)
2990 {
2991 continue;
2992 }
2993 if ((*m_exp)[id]->GetGeom()->ContainsPoint(gloCoords, locCoords, tol,
2994 nearpt))
2995 {
2996 return id;
2997 }
2998 else if (returnNearestElmt && (nearpt < nearpt_min))
2999 {
3000 // If it does not lie within, keep track of which element
3001 // is nearest.
3002 min_id = id;
3003 nearpt_min = nearpt;
3004 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
3005 }
3006 }
3007
3008 // If the calling function is with just the nearest element, return
3009 // that. Otherwise return -1 to indicate no matching elemenet found.
3010 if (returnNearestElmt && nearpt_min <= maxDistance)
3011 {
3012
3013 std::string msg =
3014 "Failed to find point within element to "
3015 "tolerance of " +
3016 boost::lexical_cast<std::string>(tol) + " using local point (" +
3017 boost::lexical_cast<std::string>(locCoords[0]) + "," +
3018 boost::lexical_cast<std::string>(locCoords[1]) + "," +
3019 boost::lexical_cast<std::string>(locCoords[1]) +
3020 ") in element: " + boost::lexical_cast<std::string>(min_id);
3021 WARNINGL1(false, msg.c_str());
3022
3023 Vmath::Vcopy(locCoords.size(), savLocCoords, 1, locCoords, 1);
3024 return min_id;
3025 }
3026 else
3027 {
3028 return -1;
3029 }
3030}
size_t GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:657
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1926
std::vector< double > z(NPUPPER)

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

◆ GetExpSize()

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

◆ GetExpType()

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

Returns the type of the expansion.

Definition at line 1656 of file ExpList.cpp.

1657{
1658 return m_expType;
1659}

References m_expType.

Referenced by v_CurlCurl().

◆ GetFieldDefinitions() [1/2]

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

Definition at line 907 of file ExpList.h.

908 {
909 return v_GetFieldDefinitions();
910 }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:3914

References v_GetFieldDefinitions().

◆ GetFieldDefinitions() [2/2]

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

Definition at line 912 of file ExpList.h.

914 {
915 v_GetFieldDefinitions(fielddef);
916 }

References v_GetFieldDefinitions().

◆ GetFwdBwdTracePhys() [1/2]

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

Definition at line 2213 of file ExpList.h.

2215{
2216 v_GetFwdBwdTracePhys(Fwd, Bwd);
2217}
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4804

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

2222{
2223 v_GetFwdBwdTracePhys(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
2224 DoExchange);
2225}

References v_GetFwdBwdTracePhys().

◆ GetGlobalLinSysManager()

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

Definition at line 5685 of file ExpList.cpp.

5686{
5687 return v_GetGlobalLinSysManager();
5688}
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
Definition: ExpList.cpp:3722

References v_GetGlobalLinSysManager().

◆ GetGraph()

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

Definition at line 980 of file ExpList.h.

981 {
982 return m_graph;
983 }

References m_graph.

◆ GetHomogeneousBasis()

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

Definition at line 985 of file ExpList.h.

986 {
987 return v_GetHomogeneousBasis();
988 }
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1479

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

609 {
610 return v_GetHomoLen();
611 }
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:3670

References v_GetHomoLen().

◆ GetLeftAdjacentFaces()

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

Definition at line 2255 of file ExpList.h.

2256{
2257 return v_GetLeftAdjacentFaces();
2258}
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:4875

References v_GetLeftAdjacentFaces().

◆ GetLeftAdjacentTraces()

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

Definition at line 2329 of file ExpList.h.

2330{
2331 return v_GetLeftAdjacentTraces();
2332}
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
Definition: ExpList.cpp:4335

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

2242{
2243 v_GetLocTraceFromTracePts(Fwd, Bwd, locTraceFwd, locTraceBwd);
2244}
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:4850

References v_GetLocTraceFromTracePts().

Referenced by AddTraceJacToElmtJac().

◆ GetLocTraceToTraceMap()

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

Definition at line 2146 of file ExpList.h.

2148{
2149 return v_GetLocTraceToTraceMap();
2150}
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
Definition: ExpList.cpp:6414

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

5778{
5779 int nTotElmt = (*m_exp).size();
5780 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5781 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5782
5783 Array<OneD, NekDouble> tmpCoef(nElmtCoef, 0.0);
5784 Array<OneD, NekDouble> tmpPhys(nElmtPnt, 0.0);
5785
5786 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5787 {
5788 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5789 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5790
5791 if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
5792 {
5793 tmpPhys = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5794 tmpCoef = Array<OneD, NekDouble>(nElmtCoef, 0.0);
5795 }
5796
5797 for (int ncl = 0; ncl < nElmtPnt; ncl++)
5798 {
5799 tmpPhys[ncl] = inarray[nelmt][ncl];
5800
5801 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
5802
5803 for (int nrw = 0; nrw < nElmtCoef; nrw++)
5804 {
5805 (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
5806 }
5807 // to maintain all the other columes are zero.
5808 tmpPhys[ncl] = 0.0;
5809 }
5810 }
5811}

◆ GetMatIpwrtDeriveBase() [2/2]

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

Definition at line 5813 of file ExpList.cpp.

5815{
5816 int nTotElmt = (*m_exp).size();
5817
5818 int nspacedim = m_graph->GetSpaceDimension();
5819 Array<OneD, Array<OneD, NekDouble>> projectedpnts(nspacedim);
5820 Array<OneD, Array<OneD, NekDouble>> tmppnts(nspacedim);
5821 Array<OneD, DNekMatSharedPtr> ArrayStdMat(nspacedim);
5822 Array<OneD, Array<OneD, NekDouble>> ArrayStdMat_data(nspacedim);
5823
5824 Array<OneD, NekDouble> clmnArray, clmnStdMatArray;
5825
5827 int nElmtPntPrevious = 0;
5828 int nElmtCoefPrevious = 0;
5829
5830 int nElmtPnt, nElmtCoef;
5831 for (int nelmt = 0; nelmt < nTotElmt; nelmt++)
5832 {
5833 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5834 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5835 LibUtilities::ShapeType ElmtTypeNow = (*m_exp)[nelmt]->DetShapeType();
5836
5837 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5838 (ElmtTypeNow != ElmtTypePrevious))
5839 {
5840 if (nElmtPntPrevious != nElmtPnt)
5841 {
5842 for (int ndir = 0; ndir < nspacedim; ndir++)
5843 {
5844 projectedpnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5845 tmppnts[ndir] = Array<OneD, NekDouble>(nElmtPnt, 0.0);
5846 }
5847 }
5849 stdExp = (*m_exp)[nelmt]->GetStdExp();
5850 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase0,
5851 stdExp->DetShapeType(), *stdExp);
5852
5853 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5854 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5855
5856 if (nspacedim > 1)
5857 {
5858 StdRegions::StdMatrixKey matkey(
5859 StdRegions::eDerivBase1, stdExp->DetShapeType(), *stdExp);
5860
5861 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5862 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5863
5864 if (nspacedim > 2)
5865 {
5866 StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase2,
5867 stdExp->DetShapeType(),
5868 *stdExp);
5869
5870 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5871 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5872 }
5873 }
5874
5875 ElmtTypePrevious = ElmtTypeNow;
5876 nElmtPntPrevious = nElmtPnt;
5877 nElmtCoefPrevious = nElmtCoef;
5878 }
5879 else
5880 {
5881 for (int ndir = 0; ndir < nspacedim; ndir++)
5882 {
5883 Vmath::Zero(nElmtPnt, projectedpnts[ndir], 1);
5884 }
5885 }
5886
5887 for (int ndir = 0; ndir < nspacedim; ndir++)
5888 {
5889 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5890 ndir, inarray[ndir][nelmt], tmppnts);
5891 for (int n = 0; n < nspacedim; n++)
5892 {
5893 Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
5894 projectedpnts[n], 1);
5895 }
5896 }
5897
5898 for (int ndir = 0; ndir < nspacedim; ndir++)
5899 {
5900 // weight with metric
5901 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
5902 projectedpnts[ndir]);
5903 Array<OneD, NekDouble> MatDataArray = mtxPerVar[nelmt]->GetPtr();
5904
5905 for (int np = 0; np < nElmtPnt; np++)
5906 {
5907 NekDouble factor = projectedpnts[ndir][np];
5908 clmnArray = MatDataArray + np * nElmtCoef;
5909 clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
5910 Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
5911 1, clmnArray, 1);
5912 }
5913 }
5914 }
5915}
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:617

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

1806{
1807 v_GetMovingFrames(MMFdir, CircCentre, outarray);
1808}
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: ExpList.cpp:4115

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

1533{
1534 return (*m_exp)[eid]->GetNcoeffs();
1535}

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

2190{
2191 v_GetNormals(normals);
2192}
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList.cpp:4413

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

1604{
1605 return m_npoints;
1606}

References m_npoints.

Referenced by MultiplyByMassMatrix().

◆ GetNumElmts()

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

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

Definition at line 657 of file ExpList.h.

658 {
659 return v_GetNumElmts();
660 }
virtual size_t v_GetNumElmts(void)
Definition: ExpList.h:1175

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

903 {
904 v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
905 }
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:5461

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

2054{
2055 return m_phys;
2056}

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

1659{
1660 return m_physState;
1661}

References m_physState.

◆ GetPlane()

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

Definition at line 989 of file ExpList.h.

990 {
991 return v_GetPlane(n);
992 }
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:5491

References v_GetPlane().

◆ GetPoolCount()

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

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

Definition at line 5674 of file ExpList.cpp.

5675{
5676 return v_GetPoolCount(poolName);
5677}
virtual int v_GetPoolCount(std::string)
Definition: ExpList.cpp:3707

References v_GetPoolCount().

◆ GetRobinBCInfo()

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

Definition at line 895 of file ExpList.h.

896 {
897 return v_GetRobinBCInfo();
898 }
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:5451

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

1936{
1937 return (*m_exp)[0]->GetShapeDimension();
1938}

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

967 {
968 return shared_from_this();
969 }

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

◆ GetTotPoints() [1/2]

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

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

Definition at line 1577 of file ExpList.h.

1578{
1579 return (*m_exp)[eid]->GetTotPoints();
1580}

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

2178{
2179 return v_GetTrace();
2180}
virtual std::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:4314

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

2186{
2187 return v_GetTraceBndMap();
2188}
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:4330

References v_GetTraceBndMap().

◆ GetTraceMap()

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

Definition at line 2181 of file ExpList.h.

2182{
2183 return v_GetTraceMap();
2184}
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:4322

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

602 {
603 return v_GetTransposition();
604 }
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:3662

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

1620{
1621 return m_WaveSpace;
1622}

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

625 {
626 return v_GetYIDs();
627 }
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:3693

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

595 {
596 return v_GetZIDs();
597 }
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:3685

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

2026{
2027 v_GlobalToLocal(inarray, outarray);
2028}
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:5087

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

1995{
1997}

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

3786{
3787 NekDouble err = 0.0, errh1;
3788 int i;
3789
3790 for (i = 0; i < (*m_exp).size(); ++i)
3791 {
3792 errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
3793 soln + m_phys_offset[i]);
3794 err += errh1 * errh1;
3795 }
3796
3797 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3798
3799 return sqrt(err);
3800}
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

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

◆ HelmSolve()

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

Solve helmholtz problem.

Definition at line 1749 of file ExpList.h.

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

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

◆ HomogeneousBwdTrans()

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

◆ HomogeneousEnergy()

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

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

Definition at line 578 of file ExpList.h.

579 {
580 return v_HomogeneousEnergy();
581 }
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:3654

References v_HomogeneousEnergy().

◆ HomogeneousFwdTrans()

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

Definition at line 1863 of file ExpList.h.

1866{
1867 v_HomogeneousFwdTrans(npts, inarray, outarray, Shuff, UnShuff);
1868}
virtual void v_HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4945

References v_HomogeneousFwdTrans().

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

◆ ImposeDirichletConditions()

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

Impose Dirichlet Boundary Conditions onto Array.

Definition at line 1971 of file ExpList.h.

1972{
1974}
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5046

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

1490{
1491
1494 SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
1499
1500 int id = 0;
1502
1504 // Process each expansion in the graph
1505 for (auto &expIt : expmap)
1506 {
1507 const SpatialDomains::ExpansionInfoShPtr expInfo = expIt.second;
1508
1509 switch (expInfo->m_basisKeyVector.size())
1510 {
1511 case 1: // Segment Expansions
1512 {
1514 "Cannot mix expansion dimensions in one vector");
1515 m_expType = e1D;
1516
1517 if ((SegmentGeom =
1518 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1519 expInfo->m_geomShPtr)))
1520 {
1521 // Retrieve basis key from expansion
1522 LibUtilities::BasisKey bkey = expInfo->m_basisKeyVector[0];
1523
1524 exp =
1526 bkey, SegmentGeom);
1527 }
1528 else
1529 {
1531 "dynamic cast to a 1D Geom failed");
1532 }
1533 }
1534 break;
1535 case 2:
1536 {
1538 "Cannot mix expansion dimensions in one vector");
1539 m_expType = e2D;
1540
1541 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1542 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1543
1544 if ((TriangleGeom =
1545 std::dynamic_pointer_cast<SpatialDomains ::TriGeom>(
1546 expInfo->m_geomShPtr)))
1547 {
1548
1549 // This is not elegantly implemented needs re-thinking.
1550 if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange)
1551 {
1552 LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
1553 Ba.GetNumModes(),
1554 Ba.GetPointsKey());
1555
1559 AllocateSharedPtr(newBa, Bb, TriNb, TriangleGeom);
1560 }
1561 else
1562 {
1564 AllocateSharedPtr(Ba, Bb, TriangleGeom);
1565 }
1566 }
1567 else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1568 SpatialDomains::QuadGeom>(expInfo->m_geomShPtr)))
1569 {
1570 exp =
1572 Ba, Bb, QuadrilateralGeom);
1573 }
1574 else
1575 {
1577 "dynamic cast to a 2D Geom failed");
1578 }
1579 }
1580 break;
1581 case 3:
1582 {
1584 "Cannot mix expansion dimensions in one vector");
1585 m_expType = e3D;
1586
1587 LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1588 LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1589 LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1590
1591 if ((TetGeom =
1592 std::dynamic_pointer_cast<SpatialDomains::TetGeom>(
1593 expInfo->m_geomShPtr)))
1594 {
1595
1596 if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange ||
1597 Ba.GetBasisType() == LibUtilities::eGauss_Lagrange)
1598 {
1600 "LocalRegions::NodalTetExp is not implemented "
1601 "yet");
1602 }
1603 else
1604 {
1605 exp = MemoryManager<
1606 LocalRegions::TetExp>::AllocateSharedPtr(Ba, Bb, Bc,
1607 TetGeom);
1608 }
1609 }
1610 else if ((PrismGeom = std::dynamic_pointer_cast<
1611 SpatialDomains ::PrismGeom>(
1612 expInfo->m_geomShPtr)))
1613 {
1614 exp = MemoryManager<
1615 LocalRegions::PrismExp>::AllocateSharedPtr(Ba, Bb, Bc,
1616 PrismGeom);
1617 }
1618 else if ((PyrGeom = std::dynamic_pointer_cast<
1619 SpatialDomains::PyrGeom>(expInfo->m_geomShPtr)))
1620 {
1621
1622 exp =
1624 Ba, Bb, Bc, PyrGeom);
1625 }
1626 else if ((HexGeom = std::dynamic_pointer_cast<
1627 SpatialDomains::HexGeom>(expInfo->m_geomShPtr)))
1628 {
1629 exp =
1631 Ba, Bb, Bc, HexGeom);
1632 }
1633 else
1634 {
1636 "dynamic cast to a Geom failed");
1637 }
1638 }
1639 break;
1640 default:
1642 "Dimension of basis key is greater than 3");
1643 }
1644
1645 // Assign next id
1646 exp->SetElmtId(id++);
1647
1648 // Add the expansion
1649 (*m_exp).push_back(exp);
1650 }
1651}
@ 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:85
std::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:87
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:77
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:85

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

Referenced by ExpList().

◆ Integral() [1/2]

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

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

The integration is evaluated locally, that is

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

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

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

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

Definition at line 547 of file ExpList.h.

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

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

Referenced by Integral().

◆ Integral() [2/2]

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

The integration is evaluated locally, that is

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

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

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

Definition at line 568 of file ExpList.h.

569 {
570 return v_Integral(inarray);
571 }
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:3620

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

1668{
1669 v_IProductWRTBase(inarray, outarray);
1670}
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5118

References v_IProductWRTBase().

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

◆ IProductWRTDerivBase() [1/2]

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

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

Definition at line 1684 of file ExpList.h.

1687{
1688 v_IProductWRTDerivBase(inarray, outarray);
1689}
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1737

References v_IProductWRTDerivBase().

◆ IProductWRTDerivBase() [2/2]

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

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

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

Definition at line 1674 of file ExpList.h.

1677{
1678 v_IProductWRTDerivBase(dir, inarray, outarray);
1679}

References v_IProductWRTDerivBase().

◆ IProductWRTDirectionalDerivBase()

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

Directional derivative along a given direction.

Definition at line 1757 of file ExpList.cpp.

1761{
1762 int npts_e;
1763 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1764 int nq = direction.size() / coordim;
1765
1766 Array<OneD, NekDouble> e_outarray;
1767 Array<OneD, NekDouble> e_MFdiv;
1768
1769 Array<OneD, NekDouble> locdir;
1770
1771 for (int i = 0; i < (*m_exp).size(); ++i)
1772 {
1773 npts_e = (*m_exp)[i]->GetTotPoints();
1774 locdir = Array<OneD, NekDouble>(npts_e * coordim);
1775
1776 for (int k = 0; k < coordim; ++k)
1777 {
1778 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
1779 &locdir[k * npts_e], 1);
1780 }
1781
1782 (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1783 locdir, inarray + m_phys_offset[i],
1784 e_outarray = outarray + m_coeff_offset[i]);
1785 }
1786}

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

◆ L2()

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

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

Definition at line 518 of file ExpList.h.

521 {
522 return v_L2(inarray, soln);
523 }
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:3575

References v_L2().

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

◆ LinearAdvectionDiffusionReactionSolve()

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

Solve Advection Diffusion Reaction.

Definition at line 1762 of file ExpList.h.

1768{
1770 inarray, outarray, factors, varcoeff, varfactors, dirForcing,
1771 PhysSpaceForcing);
1772}
virtual GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Definition: ExpList.cpp:4920

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

◆ LinearAdvectionReactionSolve()

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

Solve Advection Diffusion Reaction.

Definition at line 1773 of file ExpList.h.

1778{
1779 v_LinearAdvectionReactionSolve(velocity, inarray, outarray, lambda,
1780 dirForcing);
1781}
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:4934

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

3539{
3540 NekDouble err = 0.0;
3541
3542 if (soln == NullNekDouble1DArray)
3543 {
3544 err = Vmath::Vmax(m_npoints, inarray, 1);
3545 }
3546 else
3547 {
3548 for (int i = 0; i < m_npoints; ++i)
3549 {
3550 err = max(err, abs(inarray[i] - soln[i]));
3551 }
3552 }
3553
3554 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
3555
3556 return err;
3557}
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:940
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:298

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

◆ LocalToGlobal() [1/2]

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

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

Definition at line 1984 of file ExpList.h.

1985{
1986 v_LocalToGlobal(useComm);
1987}
virtual void v_LocalToGlobal(bool UseComm)
Definition: ExpList.cpp:5072

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

1991{
1992 v_LocalToGlobal(inarray, outarray, useComm);
1993}

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

1676{
1677 // Retrieve the block matrix using the given key.
1678 const DNekScalBlkMatSharedPtr &blockmat = GetBlockMatrix(gkey);
1679 int nrows = blockmat->GetRows();
1680 int ncols = blockmat->GetColumns();
1681
1682 // Create NekVectors from the given data arrays
1683 NekVector<NekDouble> in(ncols, inarray, eWrapper);
1684 NekVector<NekDouble> out(nrows, outarray, eWrapper);
1685
1686 // Perform matrix-vector multiply.
1687 out = (*blockmat) * in;
1688}
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:2415

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

2172{
2173 GlobalMatrixKey mkey(StdRegions::eInvMass);
2174 const DNekScalBlkMatSharedPtr &InvMass = GetBlockMatrix(mkey);
2175
2176 // Inverse mass matrix
2177 NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
2178 if (inarray.get() == outarray.get())
2179 {
2180 NekVector<NekDouble> in(m_ncoeffs, inarray); // copy data
2181 out = (*InvMass) * in;
2182 }
2183 else
2184 {
2185 NekVector<NekDouble> in(m_ncoeffs, inarray, eWrapper);
2186 out = (*InvMass) * in;
2187 }
2188}

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

1743{
1744 v_MultiplyByInvMassMatrix(inarray, outarray);
1745}
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4898

References v_MultiplyByInvMassMatrix().

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

◆ MultiplyByMassMatrix()

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

Definition at line 307 of file ExpList.h.

310 {
311 Array<OneD, NekDouble> tmp(GetNpoints(), 0.0);
312 BwdTrans(inarray, tmp);
313 IProductWRTBase(tmp, outarray);
314 }
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:1665
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1603
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:1732

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

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

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

1919{
1920 v_NormVectorIProductWRTBase(V, outarray);
1921}
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:4993

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

1914{
1915 v_NormVectorIProductWRTBase(V1, V2, outarray, BndID);
1916}

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

2252{
2253 v_PeriodicBwdCopy(Fwd, Bwd);
2254}
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:5408

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

1816{
1817 v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
1818}
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:1901

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

1825{
1826 v_PhysDeriv(dir, inarray, out_d);
1827}

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

1831{
1832 v_PhysDeriv(edir, inarray, out_d);
1833}

References v_PhysDeriv().

Referenced by v_Curl(), and v_CurlCurl().

◆ PhysDirectionalDeriv()

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

Definition at line 1837 of file ExpList.h.

1841{
1842 v_PhysDirectionalDeriv(direction, inarray, outarray);
1843}
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2119

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

3038{
3039 int dim = GetCoordim(0);
3040 ASSERTL0(dim == coords.size(), "Invalid coordinate dimension.");
3041
3042 // Grab the element index corresponding to coords.
3043 Array<OneD, NekDouble> xi(dim);
3044 int elmtIdx = GetExpIndex(coords, xi);
3045 ASSERTL0(elmtIdx > 0, "Unable to find element containing point.");
3046
3047 // Grab that element's physical storage.
3048 Array<OneD, NekDouble> elmtPhys = phys + m_phys_offset[elmtIdx];
3049
3050 // Evaluate the element at the appropriate point.
3051 return (*m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
3052}

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

◆ PhysGalerkinProjection1DScaled()

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

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

Definition at line 644 of file ExpList.h.

647 {
648 v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
649 }
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:6339

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

636 {
637 v_PhysInterp1DScaled(scale, inarray, outarray);
638 }
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5690

References v_PhysInterp1DScaled().

◆ Reset()

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

Reset geometry information and reset matrices.

Definition at line 395 of file ExpList.h.

396 {
397 v_Reset();
398 }
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:3071

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

2156{
2157 v_SetBndCondBwdWeight(index, value);
2158}
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
Definition: ExpList.cpp:4868

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

1944{
1945 m_coeffs[i] = val;
1946}

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

1952{
1953 m_coeffs[i] = val;
1954}

References m_coeffs.

◆ SetCoeffsArray()

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

Set the m_coeffs array to inarray.

Definition at line 1955 of file ExpList.h.

1956{
1957 m_coeffs = inarray;
1958}

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

586 {
588 }
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1487

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

616 {
617 return v_SetHomoLen(lhom);
618 }
virtual void v_SetHomoLen(const NekDouble lhom)
Definition: ExpList.cpp:3678

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

1638{
1639 ASSERTL0((int)inarray.size() == m_npoints,
1640 "Input array does not have correct number of elements.");
1641 Vmath::Vcopy(m_npoints, &inarray[0], 1, &m_phys[0], 1);
1642 m_physState = true;
1643}

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

1626{
1627 m_phys[i] = val;
1628}

References m_phys.

◆ SetPhysArray()

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

Sets the array m_phys.

Definition at line 1644 of file ExpList.h.

1645{
1646 m_phys = inarray;
1647}

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

1652{
1653 m_physState = physState;
1654}

References m_physState.

◆ SetupCoeffPhys()

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

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

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

Definition at line 1445 of file ExpList.cpp.

1446{
1447 if (SetupOffsets)
1448 {
1449 int i;
1450
1451 // Set up offset information and array sizes
1452 m_coeff_offset = Array<OneD, int>(m_exp->size());
1453 m_phys_offset = Array<OneD, int>(m_exp->size());
1454
1455 m_ncoeffs = m_npoints = 0;
1456
1457 for (i = 0; i < m_exp->size(); ++i)
1458 {
1461 m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
1462 m_npoints += (*m_exp)[i]->GetTotPoints();
1463 }
1464 }
1465
1466 if (DeclareCoeffPhysArrays)
1467 {
1468 m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
1469 m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
1470 }
1471
1472 m_coeffsToElmt = Array<OneD, pair<int, int>>{size_t(m_ncoeffs)};
1473
1474 for (int i = 0; i < m_exp->size(); ++i)
1475 {
1476 int coeffs_offset = m_coeff_offset[i];
1477
1478 int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1479
1480 for (int j = 0; j < loccoeffs; ++j)
1481 {
1482 m_coeffsToElmt[coeffs_offset + j].first = i;
1483 m_coeffsToElmt[coeffs_offset + j].second = j;
1484 }
1485 }
1486}

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

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

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

1612{
1613 m_WaveSpace = wavespace;
1614}

References m_WaveSpace.

◆ SmoothField()

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

Smooth a field across elements.

Definition at line 1720 of file ExpList.h.

1721{
1722 v_SmoothField(field);
1723}
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:2240

References v_SmoothField().

◆ UnsetGlobalLinSys()

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

Definition at line 5679 of file ExpList.cpp.

5680{
5681 v_UnsetGlobalLinSys(key, clearLocalMatrices);
5682}
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
Definition: ExpList.cpp:3714

References v_UnsetGlobalLinSys().

◆ UpdateBndCondExpansion()

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

Definition at line 2159 of file ExpList.h.

2160{
2161 return v_UpdateBndCondExpansion(i);
2162}
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:4197

References v_UpdateBndCondExpansion().

◆ UpdateBndConditions()

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

Definition at line 2275 of file ExpList.h.

2276{
2277 return v_UpdateBndConditions();
2278}
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:5429

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

2120{
2121 return m_coeffs;
2122}

References m_coeffs.

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

◆ UpdatePhys()

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

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

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

Returns
(A reference to) the array m_phys.

Definition at line 2129 of file ExpList.h.

2130{
2131 m_physState = true;
2132 return m_phys;
2133}

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

2167{
2168 v_Upwind(Vec, Fwd, Bwd, Upwind);
2169}
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:4216
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:2170

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

2174{
2175 v_Upwind(Vn, Fwd, Bwd, Upwind);
2176}

References Upwind(), and v_Upwind().

Referenced by Upwind(), and v_Upwind().

◆ v_AddFwdBwdTraceIntegral()

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

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 4795 of file ExpList.cpp.

4798{
4799 boost::ignore_unused(Fwd, Bwd, outarray);
4801 "This method is not defined or valid for this class type");
4802}

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

4789{
4790 boost::ignore_unused(Fn, outarray);
4792 "This method is not defined or valid for this class type");
4793}

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

4781{
4782 boost::ignore_unused(Fx, Fy, outarray);
4784 "This method is not defined or valid for this class type");
4785}

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

Referenced by AddTraceIntegral().

◆ v_AddTraceIntegralToOffDiag()

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

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5766 of file ExpList.cpp.

5770{
5771 boost::ignore_unused(FwdFlux, BwdFlux, outarray);
5772 NEKERROR(ErrorUtil::efatal, "AddTraceIntegralToOffDiag not defined");
5773}

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

4835{
4836 boost::ignore_unused(field, Fwd, Bwd);
4838 "v_AddTraceQuadPhysToField is not defined for this class type");
4839}

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

4844{
4845 boost::ignore_unused(field, Fwd, Bwd);
4847 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4848}

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

Referenced by AddTraceQuadPhysToOffDiag().

◆ v_AppendFieldData() [1/2]

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

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

Definition at line 3929 of file ExpList.cpp.

3932{
3933 v_AppendFieldData(fielddef, fielddata, m_coeffs);
3934}

References m_coeffs, and v_AppendFieldData().

Referenced by AppendFieldData(), and v_AppendFieldData().

◆ v_AppendFieldData() [2/2]

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

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

Definition at line 3936 of file ExpList.cpp.

3939{
3940 int i;
3941 // Determine mapping from element ids to location in
3942 // expansion list
3943 // Determine mapping from element ids to location in
3944 // expansion list
3945 map<int, int> ElmtID_to_ExpID;
3946 for (i = 0; i < (*m_exp).size(); ++i)
3947 {
3948 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3949 }
3950
3951 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3952 {
3953 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3954 int datalen = (*m_exp)[eid]->GetNcoeffs();
3955 fielddata.insert(fielddata.end(), &coeffs[m_coeff_offset[eid]],
3956 &coeffs[m_coeff_offset[eid]] + datalen);
3957 }
3958}

References m_coeff_offset.

◆ v_BwdTrans()

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

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

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

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

Definition at line 2869 of file ExpList.cpp.

2871{
2872 LibUtilities::Timer timer;
2873
2874 if (m_expType == e0D)
2875 {
2876 Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
2877 }
2878 else
2879 {
2880 // initialise if required
2882 {
2883 for (int i = 0; i < m_collections.size(); ++i)
2884 {
2886 }
2888 }
2889
2890 LIKWID_MARKER_START("v_BwdTrans");
2891 timer.Start();
2892
2893 Array<OneD, NekDouble> tmp;
2894 for (int i = 0; i < m_collections.size(); ++i)
2895 {
2896 m_collections[i].ApplyOperator(
2898 tmp = outarray + m_coll_phys_offset[i]);
2899 }
2900
2901 timer.Stop();
2902 LIKWID_MARKER_STOP("v_BwdTrans");
2903 }
2904
2905 // Elapsed time
2906 timer.AccumulateRegion("Collections:BwdTrans", 10);
2907}
#define LIKWID_MARKER_START(regionTag)
Definition: Likwid.hpp:46
#define LIKWID_MARKER_STOP(regionTag)
Definition: Likwid.hpp:47

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

Definition at line 3701 of file ExpList.cpp.

3702{
3704 "ClearGlobalLinSysManager not implemented for ExpList.");
3705}

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

Referenced by ClearGlobalLinSysManager().

◆ v_Curl()

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

Definition at line 2002 of file ExpList.cpp.

2004{
2005 int nq = GetTotPoints();
2006 Array<OneD, NekDouble> Vx(nq);
2007 Array<OneD, NekDouble> Uy(nq);
2008 Array<OneD, NekDouble> Dummy(nq);
2009
2010 switch (m_expType)
2011 {
2012 case e2D:
2013 {
2014 PhysDeriv(xDir, Vel[yDir], Vx);
2015 PhysDeriv(yDir, Vel[xDir], Uy);
2016
2017 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[0], 1);
2018 }
2019 break;
2020
2021 case e3D:
2022 {
2023 Array<OneD, NekDouble> Vz(nq);
2024 Array<OneD, NekDouble> Uz(nq);
2025 Array<OneD, NekDouble> Wx(nq);
2026 Array<OneD, NekDouble> Wy(nq);
2027
2028 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
2029 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
2030 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
2031
2032 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2033 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2034 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2035 }
2036 break;
2037 default:
2038 ASSERTL0(0, "Dimension not supported by ExpList::Curl");
2039 break;
2040 }
2041}
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition: ExpList.h:1828
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:414

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

Referenced by Curl().

◆ v_CurlCurl()

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

Definition at line 2051 of file ExpList.cpp.

2053{
2054 int nq = GetTotPoints();
2055 Array<OneD, NekDouble> Vx(nq);
2056 Array<OneD, NekDouble> Uy(nq);
2057 Array<OneD, NekDouble> Dummy(nq);
2058
2059 bool halfMode = false;
2060 if (GetExpType() == e3DH1D)
2061 {
2062 m_session->MatchSolverInfo("ModeType", "HalfMode", halfMode, false);
2063 }
2064
2065 switch (m_expType)
2066 {
2067 case e2D:
2068 {
2069 PhysDeriv(xDir, Vel[yDir], Vx);
2070 PhysDeriv(yDir, Vel[xDir], Uy);
2071
2072 Vmath::Vsub(nq, Vx, 1, Uy, 1, Dummy, 1);
2073
2074 PhysDeriv(Dummy, Q[1], Q[0]);
2075
2076 Vmath::Smul(nq, -1.0, Q[1], 1, Q[1], 1);
2077 }
2078 break;
2079
2080 case e3D:
2081 case e3DH1D:
2082 case e3DH2D:
2083 {
2084 Array<OneD, NekDouble> Vz(nq);
2085 Array<OneD, NekDouble> Uz(nq);
2086 Array<OneD, NekDouble> Wx(nq);
2087 Array<OneD, NekDouble> Wy(nq);
2088
2089 PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
2090 PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
2091 PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
2092
2093 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2094 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2095 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2096
2097 PhysDeriv(Q[0], Dummy, Uy, Uz);
2098 PhysDeriv(Q[1], Vx, Dummy, Vz);
2099 PhysDeriv(Q[2], Wx, Wy, Dummy);
2100
2101 // For halfmode, need to change the sign of z derivatives
2102 if (halfMode)
2103 {
2104 Vmath::Neg(nq, Uz, 1);
2105 Vmath::Neg(nq, Vz, 1);
2106 }
2107
2108 Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
2109 Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
2110 Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
2111 }
2112 break;
2113 default:
2114 ASSERTL0(0, "Dimension not supported");
2115 break;
2116 }
2117}
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:1656
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:513

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

Referenced by CurlCurl().

◆ v_DealiasedDotProd()

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

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

Definition at line 4975 of file ExpList.cpp.

4979{
4980 boost::ignore_unused(npts, inarray1, inarray2, outarray);
4982 "This method is not defined or valid for this class type");
4983}

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

Referenced by DealiasedDotProd().

◆ v_DealiasedProd()

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

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

Definition at line 4965 of file ExpList.cpp.

4969{
4970 boost::ignore_unused(npts, inarray1, inarray2, outarray);
4972 "This method is not defined or valid for this class type");
4973}

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

Referenced by DealiasedProd().

◆ v_EvaluateBoundaryConditions()

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

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

Definition at line 5439 of file ExpList.cpp.

5443{
5444 boost::ignore_unused(time, varName, x2_in, x3_in);
5446 "This method is not defined or valid for this class type");
5447}

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

4077{
4078 int i;
4079 int offset = 0;
4080
4081 for (i = 0; i < (*m_exp).size(); ++i)
4082 {
4083 std::vector<unsigned int> nummodes;
4084 vector<LibUtilities::BasisType> basisTypes;
4085 for (int j = 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
4086 {
4087 nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
4088 basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
4089 }
4090
4091 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
4092 &toCoeffs[m_coeff_offset[i]],
4093 basisTypes);
4094
4095 offset += fromExpList->GetExp(i)->GetNcoeffs();
4096 }
4097}

References m_coeff_offset.

Referenced by ExtractCoeffsToCoeffs().

◆ v_ExtractDataToCoeffs()

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

Extract data from raw field data into expansion list.

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

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

Definition at line 3985 of file ExpList.cpp.

3989{
3990 boost::ignore_unused(zIdToPlane);
3991 int i, expId;
3992 int offset = 0;
3993 int modes_offset = 0;
3994 int datalen = fielddata.size() / fielddef->m_fields.size();
3995
3996 // Find data location according to field definition
3997 for (i = 0; i < fielddef->m_fields.size(); ++i)
3998 {
3999 if (fielddef->m_fields[i] == field)
4000 {
4001 break;
4002 }
4003 offset += datalen;
4004 }
4005
4006 ASSERTL0(i != fielddef->m_fields.size(),
4007 "Field (" + field + ") not found in file.");
4008
4009 if (m_elmtToExpId.size() == 0)
4010 {
4011 // Loop in reverse order so that in case where using a
4012 // Homogeneous expansion it sets geometry ids to first part of
4013 // m_exp list. Otherwise will set to second (complex) expansion
4014 for (i = (*m_exp).size() - 1; i >= 0; --i)
4015 {
4016 m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
4017 }
4018 }
4019
4020 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
4021 {
4022 // Reset modes_offset in the case where all expansions of
4023 // the same order.
4024 if (fielddef->m_uniOrder == true)
4025 {
4026 modes_offset = 0;
4027 }
4028
4030 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
4031
4032 const int elmtId = fielddef->m_elementIDs[i];
4033 auto eIt = m_elmtToExpId.find(elmtId);
4034
4035 if (eIt == m_elmtToExpId.end())
4036 {
4037 offset += datalen;
4038 modes_offset += (*m_exp)[0]->GetNumBases();
4039 continue;
4040 }
4041
4042 expId = eIt->second;
4043
4044 bool sameBasis = true;
4045 for (int j = 0; j < fielddef->m_basis.size(); ++j)
4046 {
4047 if (fielddef->m_basis[j] != (*m_exp)[expId]->GetBasisType(j))
4048 {
4049 sameBasis = false;
4050 break;
4051 }
4052 }
4053
4054 if (datalen == (*m_exp)[expId]->GetNcoeffs() && sameBasis)
4055 {
4056 Vmath::Vcopy(datalen, &fielddata[offset], 1,
4057 &coeffs[m_coeff_offset[expId]], 1);
4058 }
4059 else
4060 {
4061 (*m_exp)[expId]->ExtractDataToCoeffs(
4062 &fielddata[offset], fielddef->m_numModes, modes_offset,
4063 &coeffs[m_coeff_offset[expId]], fielddef->m_basis);
4064 }
4065
4066 offset += datalen;
4067 modes_offset += (*m_exp)[0]->GetNumBases();
4068 }
4069
4070 return;
4071}
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
Definition: ShapeType.hpp:310

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

5238{
5239 int n, cnt;
5240 Array<OneD, NekDouble> tmp1, tmp2;
5242
5243 Array<OneD, int> ElmtID, EdgeID;
5244 GetBoundaryToElmtMap(ElmtID, EdgeID);
5245
5246 // Initialise result
5247 boundary =
5248 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5249
5250 // Skip other boundary regions
5251 for (cnt = n = 0; n < i; ++n)
5252 {
5253 cnt += GetBndCondExpansions()[n]->GetExpSize();
5254 }
5255
5256 int offsetBnd;
5257 int offsetElmt = 0;
5258 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5259 {
5260 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5261
5262 elmt = GetExp(ElmtID[cnt + n]);
5263 elmt->GetTracePhysVals(
5264 EdgeID[cnt + n], GetBndCondExpansions()[i]->GetExp(n),
5265 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
5266
5267 offsetElmt += elmt->GetTotPoints();
5268 }
5269}
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:2136
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2290

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

5315{
5316 int n, cnt;
5317 Array<OneD, NekDouble> tmp1;
5319
5320 Array<OneD, int> ElmtID, EdgeID;
5321 GetBoundaryToElmtMap(ElmtID, EdgeID);
5322
5323 // Initialise result
5324 bnd =
5325 Array<OneD, NekDouble>(GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5326
5327 // Skip other boundary regions
5328 for (cnt = n = 0; n < i; ++n)
5329 {
5330 cnt += GetBndCondExpansions()[n]->GetExpSize();
5331 }
5332
5333 int offsetBnd;
5334 int offsetPhys;
5335 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5336 {
5337 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5338 offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5339
5340 elmt = GetExp(ElmtID[cnt + n]);
5341 elmt->GetTracePhysVals(EdgeID[cnt + n],
5343 phys + offsetPhys, tmp1 = bnd + offsetBnd);
5344 }
5345}

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

5276{
5277 int n, cnt, nq;
5278
5279 Array<OneD, int> ElmtID, EdgeID;
5280 GetBoundaryToElmtMap(ElmtID, EdgeID);
5281
5282 // Skip other boundary regions
5283 for (cnt = n = 0; n < i; ++n)
5284 {
5285 cnt += GetBndCondExpansions()[n]->GetExpSize();
5286 }
5287
5288 // Count number of points
5289 int npoints = 0;
5290 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5291 {
5292 npoints += GetExp(ElmtID[cnt + n])->GetTotPoints();
5293 }
5294
5295 // Initialise result
5296 bndElmt = Array<OneD, NekDouble>(npoints, 0.0);
5297
5298 // Extract data
5299 int offsetPhys;
5300 int offsetElmt = 0;
5301 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5302 {
5303 nq = GetExp(ElmtID[cnt + n])->GetTotPoints();
5304 offsetPhys = GetPhys_Offset(ElmtID[cnt + n]);
5305 Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
5306 offsetElmt += nq;
5307 }
5308}

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

Referenced by ExtractPhysToBndElmt().

◆ v_ExtractTracePhys() [1/2]

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

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

Definition at line 4883 of file ExpList.cpp.

4884{
4885 boost::ignore_unused(outarray);
4887 "This method is not defined or valid for this class type");
4888}

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

Referenced by ExtractTracePhys().

◆ v_ExtractTracePhys() [2/2]

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

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

Definition at line 4890 of file ExpList.cpp.

4892{
4893 boost::ignore_unused(inarray, outarray);
4895 "This method is not defined or valid for this class type");
4896}

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

◆ v_FillBndCondFromField() [1/2]

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

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

Definition at line 5055 of file ExpList.cpp.

5056{
5057 boost::ignore_unused(coeffs);
5059 "This method is not defined or valid for this class type");
5060}

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

Referenced by FillBndCondFromField().

◆ v_FillBndCondFromField() [2/2]

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

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

Definition at line 5064 of file ExpList.cpp.

5066{
5067 boost::ignore_unused(nreg, coeffs);
5069 "This method is not defined or valid for this class type");
5070}

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

4826{
4827 boost::ignore_unused(Fwd, Bwd, PutFwdInBwdOnBCs);
4829 "This method is not defined or valid for this class type");
4830}

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

5403{
5404 boost::ignore_unused(weightave, weightjmp);
5405 NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
5406}

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

Referenced by FillBwdWithBwdWeight().

◆ v_FwdTrans()

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

◆ v_FwdTransBndConstrained()

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

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

Definition at line 2217 of file ExpList.cpp.

2220{
2221 int i;
2222
2223 Array<OneD, NekDouble> e_outarray;
2224
2225 for (i = 0; i < (*m_exp).size(); ++i)
2226 {
2227 (*m_exp)[i]->FwdTransBndConstrained(inarray + m_phys_offset[i],
2228 e_outarray =
2229 outarray + m_coeff_offset[i]);
2230 }
2231}

References m_coeff_offset, and m_phys_offset.

Referenced by FwdTransBndConstrained().

◆ v_FwdTransLocalElmt()

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

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

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

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

Definition at line 2208 of file ExpList.cpp.

2210{
2211 Array<OneD, NekDouble> f(m_ncoeffs);
2212
2213 IProductWRTBase(inarray, f);
2214 MultiplyByElmtInvMass(f, outarray);
2215}
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:2170

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

4987{
4988 boost::ignore_unused(BndVals, TotField, BndID);
4990 "This method is not defined or valid for this class type");
4991}

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

4861{
4863 "v_GetBndCondBwdWeight is not defined for this class type");
4864 static Array<OneD, NekDouble> tmp;
4865 return tmp;
4866}

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

Referenced by GetBndCondBwdWeight().

◆ v_GetBndCondExpansions()

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

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

Definition at line 4189 of file ExpList.cpp.

4190{
4192 "This method is not defined or valid for this class type");
4193 static Array<OneD, const std::shared_ptr<ExpList>> result;
4194 return result;
4195}

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

Referenced by GetBndCondExpansions().

◆ v_GetBndConditions()

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

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

Definition at line 5418 of file ExpList.cpp.

5419{
5421 "This method is not defined or valid for this class type");
5422 static Array<OneD, const SpatialDomains::BoundaryConditionShPtr> result;
5423 return result;
5424}

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

Referenced by GetBndConditions().

◆ v_GetBndElmtExpansion()

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

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

Definition at line 5225 of file ExpList.cpp.

5227{
5228 boost::ignore_unused(i, result, DeclareCoeffPhysArrays);
5230 "This method is not defined or valid for this class type");
5231}

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

5351{
5352 int j, n, cnt, nq;
5353 int coordim = GetCoordim(0);
5354 Array<OneD, NekDouble> tmp;
5356
5357 Array<OneD, int> ElmtID, EdgeID;
5358 GetBoundaryToElmtMap(ElmtID, EdgeID);
5359
5360 // Initialise result
5361 normals = Array<OneD, Array<OneD, NekDouble>>(coordim);
5362 for (j = 0; j < coordim; ++j)
5363 {
5364 normals[j] = Array<OneD, NekDouble>(
5365 GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
5366 }
5367
5368 // Skip other boundary regions
5369 for (cnt = n = 0; n < i; ++n)
5370 {
5371 cnt += GetBndCondExpansions()[n]->GetExpSize();
5372 }
5373
5374 int offset;
5375 for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
5376 {
5377 offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
5378 nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
5379
5380 elmt = GetExp(ElmtID[cnt + n]);
5381 const Array<OneD, const Array<OneD, NekDouble>> normalsElmt =
5382 elmt->GetTraceNormal(EdgeID[cnt + n]);
5383 // Copy to result
5384 for (j = 0; j < coordim; ++j)
5385 {
5386 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
5387 }
5388 }
5389}

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

Referenced by GetBoundaryNormals().

◆ v_GetBoundaryToElmtMap()

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

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

Definition at line 5393 of file ExpList.cpp.

5395{
5396 boost::ignore_unused(ElmtID, EdgeID);
5398 "This method is not defined or valid for this class type");
5399}

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

Referenced by GetBoundaryToElmtMap().

◆ v_GetCoords() [1/2]

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

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

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

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

Definition at line 5152 of file ExpList.cpp.

5155{
5156 if (GetNumElmts() == 0)
5157 {
5158 return;
5159 }
5160
5161 int i;
5162 Array<OneD, NekDouble> e_coord_0;
5163 Array<OneD, NekDouble> e_coord_1;
5164 Array<OneD, NekDouble> e_coord_2;
5165
5166 switch (GetExp(0)->GetCoordim())
5167 {
5168 case 1:
5169 for (i = 0; i < (*m_exp).size(); ++i)
5170 {
5171 e_coord_0 = coord_0 + m_phys_offset[i];
5172 (*m_exp)[i]->GetCoords(e_coord_0);
5173 }
5174 break;
5175 case 2:
5176 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5177
5178 for (i = 0; i < (*m_exp).size(); ++i)
5179 {
5180 e_coord_0 = coord_0 + m_phys_offset[i];
5181 e_coord_1 = coord_1 + m_phys_offset[i];
5182 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
5183 }
5184 break;
5185 case 3:
5186 ASSERTL0(coord_1.size() != 0, "output coord_1 is not defined");
5187 ASSERTL0(coord_2.size() != 0, "output coord_2 is not defined");
5188
5189 for (i = 0; i < (*m_exp).size(); ++i)
5190 {
5191 e_coord_0 = coord_0 + m_phys_offset[i];
5192 e_coord_1 = coord_1 + m_phys_offset[i];
5193 e_coord_2 = coord_2 + m_phys_offset[i];
5194 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
5195 }
5196 break;
5197 }
5198}

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

Referenced by GetCoords().

◆ v_GetCoords() [2/2]

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

◆ v_GetFieldDefinitions() [1/2]

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

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

Definition at line 3921 of file ExpList.cpp.

3923{
3925}
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:3802

References GeneralGetFieldDefinitions().

◆ v_GetFieldDefinitions() [2/2]

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

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

Definition at line 3913 of file ExpList.cpp.

3915{
3916 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3917 v_GetFieldDefinitions(returnval);
3918 return returnval;
3919}

References v_GetFieldDefinitions().

Referenced by GetFieldDefinitions(), and v_GetFieldDefinitions().

◆ v_GetFwdBwdTracePhys() [1/2]

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

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 4804 of file ExpList.cpp.

4806{
4807 boost::ignore_unused(Fwd, Bwd);
4809 "This method is not defined or valid for this class type");
4810}

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

4816{
4817 boost::ignore_unused(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
4818 DoExchange);
4820 "This method is not defined or valid for this class type");
4821}

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

◆ v_GetGlobalLinSysManager()

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

Definition at line 3722 of file ExpList.cpp.

3723{
3725 "GetGlobalLinSysManager not implemented for ExpList.");
3727}
static LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > NullGlobalLinSysManager
Definition: ExpList.h:1518

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

Referenced by GetGlobalLinSysManager().

◆ v_GetHomogeneousBasis()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1479 of file ExpList.h.

1480 {
1482 "This method is not defined or valid for this class type");
1484 }
static BasisSharedPtr NullBasisSharedPtr
Definition: Basis.h:352

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

3671{
3673 "This method is not defined or valid for this class type");
3674 NekDouble len = 0.0;
3675 return len;
3676}

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

4876{
4878 "This method is not defined or valid for this class type");
4879 static vector<bool> tmp;
4880 return tmp;
4881}

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

4336{
4338 "This method is not defined or valid for this class type");
4339 static std::vector<bool> result;
4340 return result;
4341}

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

4854{
4855 boost::ignore_unused(Fwd, Bwd, locTraceFwd, locTraceBwd);
4857 "v_GetLocTraceFromTracePts is not defined for this class");
4858}

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

6415{
6416 NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
6418}
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 4115 of file ExpList.cpp.

4118{
4119 int npts;
4120
4121 int MFdim = 3;
4122 int nq = outarray[0].size() / MFdim;
4123
4124 // Assume whole array is of same coordinate dimension
4125 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
4126
4127 Array<OneD, Array<OneD, NekDouble>> MFloc(MFdim * coordim);
4128 // Process each expansion.
4129 for (int i = 0; i < m_exp->size(); ++i)
4130 {
4131 npts = (*m_exp)[i]->GetTotPoints();
4132
4133 for (int j = 0; j < MFdim * coordim; ++j)
4134 {
4135 MFloc[j] = Array<OneD, NekDouble>(npts, 0.0);
4136 }
4137
4138 // MF from LOCALREGIONS
4139 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
4140 (*m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
4141
4142 // Get the physical data offset for this expansion.
4143 for (int j = 0; j < MFdim; ++j)
4144 {
4145 for (int k = 0; k < coordim; ++k)
4146 {
4147 Vmath::Vcopy(npts, &MFloc[j * coordim + k][0], 1,
4148 &outarray[j][k * nq + m_phys_offset[i]], 1);
4149 }
4150 }
4151 }
4152}

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

4414{
4415 int i, j, k, e_npoints, offset;
4416 Array<OneD, Array<OneD, NekDouble>> locnormals;
4417
4418 // Assume whole array is of same coordinate dimension
4419 int coordim = GetCoordim(0);
4420
4421 ASSERTL1(normals.size() >= coordim,
4422 "Output vector does not have sufficient dimensions to "
4423 "match coordim");
4424
4425 switch (m_expType)
4426 {
4427 case e0D:
4428 {
4429 // Process each expansion.
4430 for (i = 0; i < m_exp->size(); ++i)
4431 {
4432 LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
4433
4435 loc_exp->GetLeftAdjacentElementExp();
4436
4437 // Get the number of points and normals for this expansion.
4438 e_npoints = 1;
4439 locnormals = loc_elmt->GetTraceNormal(
4440 loc_exp->GetLeftAdjacentElementTrace());
4441
4442 // Get the physical data offset for this expansion.
4443 offset = m_phys_offset[i];
4444
4445 // Process each point in the expansion.
4446 for (j = 0; j < e_npoints; ++j)
4447 {
4448 // Process each spatial dimension and copy the
4449 // values into the output array.
4450 for (k = 0; k < coordim; ++k)
4451 {
4452 normals[k][offset] = locnormals[k][0];
4453 }
4454 }
4455 }
4456 }
4457 break;
4458 case e1D:
4459 {
4461 Array<OneD, Array<OneD, NekDouble>> locnormals2;
4462 Array<OneD, Array<OneD, NekDouble>> Norms;
4463
4464 for (i = 0; i < m_exp->size(); ++i)
4465 {
4466 LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
4467
4469 loc_exp->GetLeftAdjacentElementExp();
4470
4471 int edgeNumber = loc_exp->GetLeftAdjacentElementTrace();
4472
4473 // Get the number of points and normals for this expansion.
4474 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4475
4476 locnormals = loc_elmt->GetTraceNormal(edgeNumber);
4477 int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4478 int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
4479
4480 if (e_nmodes != loc_nmodes)
4481 {
4482 if (loc_exp->GetRightAdjacentElementTrace() >= 0)
4483 {
4485 loc_exp->GetRightAdjacentElementExp();
4486
4487 int EdgeNumber =
4488 loc_exp->GetRightAdjacentElementTrace();
4489
4490 // Serial case: right element is connected so we can
4491 // just grab that normal.
4492 locnormals = loc_elmt->GetTraceNormal(EdgeNumber);
4493
4494 offset = m_phys_offset[i];
4495
4496 // Process each point in the expansion.
4497 for (j = 0; j < e_npoints; ++j)
4498 {
4499 // Process each spatial dimension and
4500 // copy the values into the output
4501 // array.
4502 for (k = 0; k < coordim; ++k)
4503 {
4504 normals[k][offset + j] = -locnormals[k][j];
4505 }
4506 }
4507 }
4508 else
4509 {
4510 // Parallel case: need to interpolate normal.
4511 Array<OneD, Array<OneD, NekDouble>> normal(coordim);
4512
4513 for (int p = 0; p < coordim; ++p)
4514 {
4515 normal[p] = Array<OneD, NekDouble>(e_npoints, 0.0);
4516 LibUtilities::PointsKey to_key =
4517 loc_exp->GetBasis(0)->GetPointsKey();
4518 LibUtilities::PointsKey from_key =
4519 loc_elmt->GetBasis(0)->GetPointsKey();
4520 LibUtilities::Interp1D(from_key, locnormals[p],
4521 to_key, normal[p]);
4522 }
4523
4524 offset = m_phys_offset[i];
4525
4526 // Process each point in the expansion.
4527 for (j = 0; j < e_npoints; ++j)
4528 {
4529 // Process each spatial dimension and copy the
4530 // values into the output array.
4531 for (k = 0; k < coordim; ++k)
4532 {
4533 normals[k][offset + j] = normal[k][j];
4534 }
4535 }
4536 }
4537 }
4538 else
4539 {
4540 // Get the physical data offset for this expansion.
4541 offset = m_phys_offset[i];
4542
4543 // Process each point in the expansion.
4544 for (j = 0; j < e_npoints; ++j)
4545 {
4546 // Process each spatial dimension and copy the values
4547 // into the output array.
4548 for (k = 0; k < coordim; ++k)
4549 {
4550 normals[k][offset + j] = locnormals[k][j];
4551 }
4552 }
4553 }
4554 }
4555 }
4556 break;
4557 case e2D:
4558 {
4559 Array<OneD, NekDouble> tmp;
4560
4561 // Process each expansion.
4562 for (i = 0; i < m_exp->size(); ++i)
4563 {
4564 LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4566 traceExp->GetLeftAdjacentElementExp();
4567
4568 // Get the number of points and normals for this expansion.
4569 int faceNum = traceExp->GetLeftAdjacentElementTrace();
4570 int offset = m_phys_offset[i];
4571
4572 const Array<OneD, const Array<OneD, NekDouble>> &locNormals =
4573 exp3D->GetTraceNormal(faceNum);
4574
4575 // Project normals from 3D element onto the same
4576 // orientation as the trace expansion.
4577 StdRegions::Orientation orient = exp3D->GetTraceOrient(faceNum);
4578
4579 int fromid0, fromid1;
4580
4582 {
4583 fromid0 = 0;
4584 fromid1 = 1;
4585 }
4586 else
4587 {
4588 fromid0 = 1;
4589 fromid1 = 0;
4590 }
4591
4592 LibUtilities::BasisKey faceBasis0 =
4593 exp3D->GetTraceBasisKey(faceNum, fromid0);
4594 LibUtilities::BasisKey faceBasis1 =
4595 exp3D->GetTraceBasisKey(faceNum, fromid1);
4596 LibUtilities::BasisKey traceBasis0 =
4597 traceExp->GetBasis(0)->GetBasisKey();
4598 LibUtilities::BasisKey traceBasis1 =
4599 traceExp->GetBasis(1)->GetBasisKey();
4600
4601 const int faceNq0 = faceBasis0.GetNumPoints();
4602 const int faceNq1 = faceBasis1.GetNumPoints();
4603
4604 Array<OneD, int> faceids;
4605 exp3D->ReOrientTracePhysMap(orient, faceids, faceNq0, faceNq1);
4606
4607 Array<OneD, NekDouble> traceNormals(faceNq0 * faceNq1);
4608
4609 for (j = 0; j < coordim; ++j)
4610 {
4611 Vmath::Scatr(faceNq0 * faceNq1, locNormals[j], faceids,
4612 traceNormals);
4613
4615 faceBasis0.GetPointsKey(), faceBasis1.GetPointsKey(),
4616 traceNormals, traceBasis0.GetPointsKey(),
4617 traceBasis1.GetPointsKey(), tmp = normals[j] + offset);
4618 }
4619 }
4620 }
4621 break;
4622 default:
4623 {
4625 "This method is not defined or valid for this class type");
4626 }
4627 }
4628}
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
Definition: Vmath.cpp:817

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 size_t Nektar::MultiRegions::ExpList::v_GetNumElmts ( void  )
inlineprotectedvirtual

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

Definition at line 1175 of file ExpList.h.

1176 {
1177 return (*m_exp).size();
1178 }

Referenced by GetNumElmts().

◆ v_GetPeriodicEntities()

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

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

Definition at line 5461 of file ExpList.cpp.

5464{
5465 boost::ignore_unused(periodicVerts, periodicEdges, periodicFaces);
5467 "This method is not defined or valid for this class type");
5468}

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

Referenced by GetPeriodicEntities().

◆ v_GetPlane()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 5491 of file ExpList.cpp.

5492{
5493 boost::ignore_unused(n);
5495 "This method is not defined or valid for this class type");
5496 return NullExpListSharedPtr;
5497}
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1514

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

Referenced by GetPlane().

◆ v_GetPoolCount()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 3707 of file ExpList.cpp.

3708{
3709 boost::ignore_unused(poolName);
3710 NEKERROR(ErrorUtil::efatal, "GetPoolCount not implemented for ExpList.");
3711 return -1;
3712}

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

Referenced by GetPoolCount().

◆ v_GetRobinBCInfo()

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

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

Definition at line 5451 of file ExpList.cpp.

5452{
5454 "This method is not defined or valid for this class type");
5455 static map<int, RobinBCInfoSharedPtr> result;
5456 return result;
5457}

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

Referenced by GetRobinBCInfo().

◆ v_GetTrace()

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

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

Definition at line 4314 of file ExpList.cpp.

4315{
4317 "This method is not defined or valid for this class type");
4318 static std::shared_ptr<ExpList> returnVal;
4319 return returnVal;
4320}

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

4331{
4332 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
4333}
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2181

References GetTraceMap().

Referenced by GetTraceBndMap().

◆ v_GetTraceMap()

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

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

Definition at line 4322 of file ExpList.cpp.

4323{
4325 "This method is not defined or valid for this class type");
4326 static std::shared_ptr<AssemblyMapDG> result;
4327 return result;
4328}

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

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

3694{
3696 "This method is not defined or valid for this class type");
3697 Array<OneD, unsigned int> NoModes(1);
3698 return NoModes;
3699}

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

3686{
3688 "This method is not defined or valid for this class type");
3689 Array<OneD, unsigned int> NoModes(1);
3690 return NoModes;
3691}

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

5095{
5096 boost::ignore_unused(inarray, outarray);
5098 "This method is not defined or valid for this class type");
5099}

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

◆ v_GlobalToLocal() [2/2]

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

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

Definition at line 5087 of file ExpList.cpp.

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

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

Referenced by GlobalToLocal().

◆ v_HelmSolve()

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

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

Definition at line 4907 of file ExpList.cpp.

4913{
4914 boost::ignore_unused(inarray, outarray, factors, varcoeff, varfactors,
4915 dirForcing, PhysSpaceForcing);
4916 NEKERROR(ErrorUtil::efatal, "HelmSolve not implemented.");
4917 return NullGlobalLinSysKey;
4918}
static GlobalLinSysKey NullGlobalLinSysKey(StdRegions::eNoMatrixType)

References Nektar::ErrorUtil::efatal, Nektar::VarcoeffHashingTest::factors, NEKERROR, and Nektar::MultiRegions::NullGlobalLinSysKey().

Referenced by HelmSolve().

◆ v_HomogeneousBwdTrans()

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

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

Definition at line 4955 of file ExpList.cpp.

4959{
4960 boost::ignore_unused(npts, inarray, outarray, Shuff, UnShuff);
4962 "This method is not defined or valid for this class type");
4963}

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

3655{
3657 "This method is not defined or valid for this class type");
3658 Array<OneD, NekDouble> NoEnergy(1, 0.0);
3659 return NoEnergy;
3660}

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

Referenced by HomogeneousEnergy().

◆ v_HomogeneousFwdTrans()

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

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

Definition at line 4945 of file ExpList.cpp.

4949{
4950 boost::ignore_unused(npts, inarray, outarray, Shuff, UnShuff);
4952 "This method is not defined or valid for this class type");
4953}

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

Referenced by HomogeneousFwdTrans().

◆ v_ImposeDirichletConditions()

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

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

Definition at line 5046 of file ExpList.cpp.

5047{
5048 boost::ignore_unused(outarray);
5050 "This method is not defined or valid for this class type");
5051}

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

3621{
3622 NekDouble sum = 0.0;
3623 int i = 0;
3624
3625 for (i = 0; i < (*m_exp).size(); ++i)
3626 {
3627 sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
3628 }
3629 m_comm->GetRowComm()->AllReduce(sum, LibUtilities::ReduceSum);
3630
3631 return sum;
3632}

References m_comm, m_phys_offset, and Nektar::LibUtilities::ReduceSum.

Referenced by Integral().

◆ v_IProductWRTBase()

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

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

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

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

Definition at line 5118 of file ExpList.cpp.

5120{
5121 // initialise if required
5123 {
5124 for (int i = 0; i < m_collections.size(); ++i)
5125 {
5127 }
5129 }
5130
5131 Array<OneD, NekDouble> tmp;
5132 for (int i = 0; i < m_collections.size(); ++i)
5133 {
5134
5136 inarray + m_coll_phys_offset[i],
5137 tmp = outarray + m_coll_coeff_offset[i]);
5138 }
5139}

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

Referenced by IProductWRTBase().

◆ v_IProductWRTDerivBase() [1/2]

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

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

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1799 of file ExpList.cpp.

1802{
1803 Array<OneD, NekDouble> tmp0, tmp1, tmp2;
1804 // assume coord dimension defines the size of Deriv Base
1805 int dim = GetCoordim(0);
1806
1807 ASSERTL1(inarray.size() >= dim, "inarray is not of sufficient dimension");
1808
1809 // initialise if required
1811 {
1812 for (int i = 0; i < m_collections.size(); ++i)
1813 {
1815 }
1817 }
1818
1819 LibUtilities::Timer timer;
1820
1821 LIKWID_MARKER_START("IProductWRTDerivBase_coll");
1822 timer.Start();
1823
1824 switch (dim)
1825 {
1826 case 1:
1827 for (int i = 0; i < m_collections.size(); ++i)
1828 {
1829 m_collections[i].ApplyOperator(
1831 inarray[0] + m_coll_phys_offset[i],
1832 tmp0 = outarray + m_coll_coeff_offset[i]);
1833 }
1834 break;
1835 case 2:
1836 for (int i = 0; i < m_collections.size(); ++i)
1837 {
1838 m_collections[i].ApplyOperator(
1840 inarray[0] + m_coll_phys_offset[i],
1841 tmp0 = inarray[1] + m_coll_phys_offset[i],
1842 tmp1 = outarray + m_coll_coeff_offset[i]);
1843 }
1844 break;
1845 case 3:
1846 for (int i = 0; i < m_collections.size(); ++i)
1847 {
1848 m_collections[i].ApplyOperator(
1850 inarray[0] + m_coll_phys_offset[i],
1851 tmp0 = inarray[1] + m_coll_phys_offset[i],
1852 tmp1 = inarray[2] + m_coll_phys_offset[i],
1853 tmp2 = outarray + m_coll_coeff_offset[i]);
1854 }
1855 break;
1856 default:
1857 NEKERROR(ErrorUtil::efatal, "Dimension of inarray not correct");
1858 break;
1859 }
1860
1861 timer.Stop();
1862 LIKWID_MARKER_STOP("IProductWRTDerivBase_coll");
1863
1864 // Elapsed time
1865 timer.AccumulateRegion("Collections:IProductWRTDerivBase", 10);
1866}

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

◆ v_IProductWRTDerivBase() [2/2]

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

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

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1737 of file ExpList.cpp.

1740{
1741 int i;
1742
1743 Array<OneD, NekDouble> e_outarray;
1744
1745 for (i = 0; i < (*m_exp).size(); ++i)
1746 {
1747 (*m_exp)[i]->IProductWRTDerivBase(dir, inarray + m_phys_offset[i],
1748 e_outarray =
1749 outarray + m_coeff_offset[i]);
1750 }
1751}

References m_coeff_offset, and m_phys_offset.

Referenced by IProductWRTDerivBase().

◆ v_L2()

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

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

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

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

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

Definition at line 3575 of file ExpList.cpp.

3577{
3578 NekDouble err = 0.0, errl2;
3579 int i;
3580
3581 if (soln == NullNekDouble1DArray)
3582 {
3583 for (i = 0; i < (*m_exp).size(); ++i)
3584 {
3585 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i]);
3586 err += errl2 * errl2;
3587 }
3588 }
3589 else
3590 {
3591 for (i = 0; i < (*m_exp).size(); ++i)
3592 {
3593 errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i],
3594 soln + m_phys_offset[i]);
3595 err += errl2 * errl2;
3596 }
3597 }
3598
3599 m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3600
3601 return sqrt(err);
3602}

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

Referenced by L2().

◆ v_LinearAdvectionDiffusionReactionSolve()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 4920 of file ExpList.cpp.

4926{
4927 boost::ignore_unused(inarray, outarray, factors, varcoeff, varfactors,
4928 dirForcing, PhysSpaceForcing);
4930 "LinearAdvectionDiffusionReactionSolve not implemented.");
4931 return NullGlobalLinSysKey;
4932}

References Nektar::ErrorUtil::efatal, Nektar::VarcoeffHashingTest::factors, NEKERROR, and Nektar::MultiRegions::NullGlobalLinSysKey().

Referenced by LinearAdvectionDiffusionReactionSolve().

◆ v_LinearAdvectionReactionSolve()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 4934 of file ExpList.cpp.

4939{
4940 boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4942 "This method is not defined or valid for this class type");
4943}

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

Referenced by LinearAdvectionReactionSolve().

◆ v_LocalToGlobal() [1/2]

void Nektar::MultiRegions::ExpList::v_LocalToGlobal ( bool  UseComm)
protectedvirtual

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

Definition at line 5072 of file ExpList.cpp.

5073{
5074 boost::ignore_unused(useComm);
5076 "This method is not defined or valid for this class type");
5077}

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

5081{
5082 boost::ignore_unused(inarray, outarray, useComm);
5084 "This method is not defined or valid for this class type");
5085}

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

4901{
4902 boost::ignore_unused(inarray, outarray);
4904 "This method is not defined or valid for this class type");
4905}

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

5005{
5006 Array<OneD, NekDouble> tmp;
5007 switch (GetCoordim(0))
5008 {
5009 case 1:
5010 {
5011 for (int i = 0; i < GetExpSize(); ++i)
5012 {
5013 (*m_exp)[i]->NormVectorIProductWRTBase(
5014 V[0] + GetPhys_Offset(i),
5015 tmp = outarray + GetCoeff_Offset(i));
5016 }
5017 }
5018 break;
5019 case 2:
5020 {
5021 for (int i = 0; i < GetExpSize(); ++i)
5022 {
5023 (*m_exp)[i]->NormVectorIProductWRTBase(
5024 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5025 tmp = outarray + GetCoeff_Offset(i));
5026 }
5027 }
5028 break;
5029 case 3:
5030 {
5031 for (int i = 0; i < GetExpSize(); ++i)
5032 {
5033 (*m_exp)[i]->NormVectorIProductWRTBase(
5034 V[0] + GetPhys_Offset(i), V[1] + GetPhys_Offset(i),
5035 V[2] + GetPhys_Offset(i),
5036 tmp = outarray + GetCoeff_Offset(i));
5037 }
5038 }
5039 break;
5040 default:
5041 NEKERROR(ErrorUtil::efatal, "Dimension not supported");
5042 break;
5043 }
5044}
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
Definition: ExpList.h:2102
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2061

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

4997{
4998 boost::ignore_unused(V1, V2, outarray, BndID);
5000 "This method is not defined or valid for this class type");
5001}

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

5410{
5411 boost::ignore_unused(Fwd, Bwd);
5412 NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
5413}

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

Referenced by PeriodicBwdCopy().

◆ v_PhysDeriv() [1/3]

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

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

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

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

Definition at line 1901 of file ExpList.cpp.

1905{
1906 Array<OneD, NekDouble> e_out_d0;
1907 Array<OneD, NekDouble> e_out_d1;
1908 Array<OneD, NekDouble> e_out_d2;
1909 int offset;
1910
1911 // initialise if required
1913 {
1914 for (int i = 0; i < m_collections.size(); ++i)
1915 {
1917 }
1919 }
1920
1921 LibUtilities::Timer timer;
1922 timer.Start();
1923 for (int i = 0; i < m_collections.size(); ++i)
1924 {
1925 offset = m_coll_phys_offset[i];
1926 e_out_d0 = out_d0 + offset;
1927 e_out_d1 = out_d1 + offset;
1928 e_out_d2 = out_d2 + offset;
1929
1930 m_collections[i].ApplyOperator(Collections::ePhysDeriv,
1931 inarray + offset, e_out_d0, e_out_d1,
1932 e_out_d2);
1933 }
1934 timer.Stop();
1935 // Elapsed time
1936 timer.AccumulateRegion("Collections:PhysDeriv", 10);
1937}

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

1942{
1943 Direction edir = DirCartesianMap[dir];
1944 v_PhysDeriv(edir, inarray, out_d);
1945}
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:90

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

◆ v_PhysDeriv() [3/3]

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

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

Definition at line 1947 of file ExpList.cpp.

1950{
1951 int i;
1952 if (edir == MultiRegions::eS)
1953 {
1954 Array<OneD, NekDouble> e_out_ds;
1955 for (i = 0; i < (*m_exp).size(); ++i)
1956 {
1957 e_out_ds = out_d + m_phys_offset[i];
1958 (*m_exp)[i]->PhysDeriv_s(inarray + m_phys_offset[i], e_out_ds);
1959 }
1960 }
1961 else if (edir == MultiRegions::eN)
1962 {
1963 Array<OneD, NekDouble> e_out_dn;
1964 for (i = 0; i < (*m_exp).size(); i++)
1965 {
1966 e_out_dn = out_d + m_phys_offset[i];
1967 (*m_exp)[i]->PhysDeriv_n(inarray + m_phys_offset[i], e_out_dn);
1968 }
1969 }
1970 else
1971 {
1972
1973 // initialise if required
1975 {
1976 for (int i = 0; i < m_collections.size(); ++i)
1977 {
1979 }
1981 }
1982
1983 // convert enum into int
1984 int intdir = (int)edir;
1985 Array<OneD, NekDouble> e_out_d;
1986 int offset;
1987 for (int i = 0; i < m_collections.size(); ++i)
1988 {
1989 offset = m_coll_phys_offset[i];
1990 e_out_d = out_d + offset;
1991
1992 m_collections[i].ApplyOperator(Collections::ePhysDeriv, intdir,
1993 inarray + offset, e_out_d);
1994 }
1995 }
1996}

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

2123{
2124 int npts_e;
2125 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
2126 int nq = direction.size() / coordim;
2127
2128 Array<OneD, NekDouble> e_outarray;
2129 Array<OneD, NekDouble> e_MFdiv;
2130 Array<OneD, NekDouble> locdir;
2131
2132 for (int i = 0; i < (*m_exp).size(); ++i)
2133 {
2134 npts_e = (*m_exp)[i]->GetTotPoints();
2135 locdir = Array<OneD, NekDouble>(npts_e * coordim);
2136
2137 for (int k = 0; k < coordim; ++k)
2138 {
2139 Vmath::Vcopy(npts_e, &direction[k * nq + m_phys_offset[i]], 1,
2140 &locdir[k * npts_e], 1);
2141 }
2142
2143 (*m_exp)[i]->PhysDirectionalDeriv(inarray + m_phys_offset[i], locdir,
2144 e_outarray =
2145 outarray + m_phys_offset[i]);
2146 }
2147}

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

6342{
6343 int cnt, cnt1;
6344
6345 cnt = cnt1 = 0;
6346
6347 switch (m_expType)
6348 {
6349 case e2D:
6350 {
6351 for (int i = 0; i < GetExpSize(); ++i)
6352 {
6353 // get new points key
6354 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6355 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6356 int npt0 = (int)pt0 * scale;
6357 int npt1 = (int)pt1 * scale;
6358
6359 LibUtilities::PointsKey newPointsKey0(
6360 npt0, (*m_exp)[i]->GetPointsType(0));
6361 LibUtilities::PointsKey newPointsKey1(
6362 npt1, (*m_exp)[i]->GetPointsType(1));
6363
6364 // Project points;
6366 newPointsKey0, newPointsKey1, &inarray[cnt],
6367 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6368 (*m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6369
6370 cnt += npt0 * npt1;
6371 cnt1 += pt0 * pt1;
6372 }
6373 }
6374 break;
6375 case e3D:
6376 {
6377 for (int i = 0; i < GetExpSize(); ++i)
6378 {
6379 // get new points key
6380 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6381 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6382 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6383 int npt0 = (int)pt0 * scale;
6384 int npt1 = (int)pt1 * scale;
6385 int npt2 = (int)pt2 * scale;
6386
6387 LibUtilities::PointsKey newPointsKey0(
6388 npt0, (*m_exp)[i]->GetPointsType(0));
6389 LibUtilities::PointsKey newPointsKey1(
6390 npt1, (*m_exp)[i]->GetPointsType(1));
6391 LibUtilities::PointsKey newPointsKey2(
6392 npt2, (*m_exp)[i]->GetPointsType(2));
6393
6394 // Project points;
6396 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6397 (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
6398 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
6399 (*m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6400
6401 cnt += npt0 * npt1 * npt2;
6402 cnt1 += pt0 * pt1 * pt2;
6403 }
6404 }
6405 break;
6406 default:
6407 {
6408 NEKERROR(ErrorUtil::efatal, "not setup for this expansion");
6409 }
6410 break;
6411 }
6412}
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 5690 of file ExpList.cpp.

5693{
5694 int cnt, cnt1;
5695
5696 cnt = cnt1 = 0;
5697
5698 switch (m_expType)
5699 {
5700 case e2D:
5701 {
5702 for (int i = 0; i < GetExpSize(); ++i)
5703 {
5704 // get new points key
5705 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5706 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5707 int npt0 = (int)pt0 * scale;
5708 int npt1 = (int)pt1 * scale;
5709
5710 LibUtilities::PointsKey newPointsKey0(
5711 npt0, (*m_exp)[i]->GetPointsType(0));
5712 LibUtilities::PointsKey newPointsKey1(
5713 npt1, (*m_exp)[i]->GetPointsType(1));
5714
5715 // Interpolate points;
5716 LibUtilities::Interp2D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5717 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5718 &inarray[cnt], newPointsKey0,
5719 newPointsKey1, &outarray[cnt1]);
5720
5721 cnt += pt0 * pt1;
5722 cnt1 += npt0 * npt1;
5723 }
5724 }
5725 break;
5726 case e3D:
5727 {
5728 for (int i = 0; i < GetExpSize(); ++i)
5729 {
5730 // get new points key
5731 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5732 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5733 int pt2 = (*m_exp)[i]->GetNumPoints(2);
5734 int npt0 = (int)pt0 * scale;
5735 int npt1 = (int)pt1 * scale;
5736 int npt2 = (int)pt2 * scale;
5737
5738 LibUtilities::PointsKey newPointsKey0(
5739 npt0, (*m_exp)[i]->GetPointsType(0));
5740 LibUtilities::PointsKey newPointsKey1(
5741 npt1, (*m_exp)[i]->GetPointsType(1));
5742 LibUtilities::PointsKey newPointsKey2(
5743 npt2, (*m_exp)[i]->GetPointsType(2));
5744
5745 // Interpolate points;
5746 LibUtilities::Interp3D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5747 (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5748 (*m_exp)[i]->GetBasis(2)->GetPointsKey(),
5749 &inarray[cnt], newPointsKey0,
5750 newPointsKey1, newPointsKey2,
5751 &outarray[cnt1]);
5752
5753 cnt += pt0 * pt1 * pt2;
5754 cnt1 += npt0 * npt1 * npt2;
5755 }
5756 }
5757 break;
5758 default:
5759 {
5760 NEKERROR(ErrorUtil::efatal, "This expansion is not set");
5761 }
5762 break;
5763 }
5764}
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:164

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

3072{
3073 // Reset matrix managers.
3074 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalMat,
3075 LocalRegions::MatrixKey::opLess>::ClearManager();
3076 LibUtilities::NekManager<LocalRegions::MatrixKey, DNekScalBlkMat,
3077 LocalRegions::MatrixKey::opLess>::ClearManager();
3078
3079 // Loop over all elements and reset geometry information.
3080 for (int i = 0; i < m_exp->size(); ++i)
3081 {
3082 (*m_exp)[i]->GetGeom()->Reset(m_graph->GetCurvedEdges(),
3083 m_graph->GetCurvedFaces());
3084 }
3085
3086 // Loop over all elements and rebuild geometric factors.
3087 for (int i = 0; i < m_exp->size(); ++i)
3088 {
3089 (*m_exp)[i]->Reset();
3090 }
3091}
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
Definition: NekTypeDefs.hpp:68
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat

References m_exp, and m_graph.

Referenced by Reset(), and Nektar::MultiRegions::DisContField::v_Reset().

◆ v_SetBndCondBwdWeight()

void Nektar::MultiRegions::ExpList::v_SetBndCondBwdWeight ( const int  index,
const NekDouble  value 
)
protectedvirtual

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

Definition at line 4868 of file ExpList.cpp.

4869{
4870 boost::ignore_unused(index, value);
4872 "v_setBndCondBwdWeight is not defined for this class type");
4873}

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

Referenced by SetBndCondBwdWeight().

◆ v_SetHomo1DSpecVanVisc()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1487 of file ExpList.h.

1488 {
1489 boost::ignore_unused(visc);
1491 "This method is not defined or valid for this class type");
1492 }

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

3679{
3680 boost::ignore_unused(lhom);
3682 "This method is not defined or valid for this class type");
3683}

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

5213{
5214 for (int i = 0; i < m_exp->size(); ++i)
5215 {
5216 for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
5217 {
5218 (*m_exp)[i]->ComputeTraceNormal(j);
5219 }
5220 }
5221}

References m_exp.

Referenced by SetUpPhysNormals().

◆ v_SmoothField()

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

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

Parameters
fieldAn array containing the field in physical space

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

Definition at line 2240 of file ExpList.cpp.

2241{
2242 boost::ignore_unused(field);
2243 // Do nothing unless the method is implemented in the appropriate
2244 // class, i.e. ContField1D,ContField2D, etc.
2245
2246 // So far it has been implemented just for ContField2D and
2247 // ContField3DHomogeneous1D
2248
2249 // Block in case users try the smoothing with a modal expansion.
2250 // Maybe a different techique for the smoothing require
2251 // implementation for modal basis.
2252
2253 ASSERTL0((*m_exp)[0]->GetBasisType(0) == LibUtilities::eGLL_Lagrange ||
2254 (*m_exp)[0]->GetBasisType(0) == LibUtilities::eGauss_Lagrange,
2255 "Smoothing is currently not allowed unless you are using "
2256 "a nodal base for efficiency reasons. The implemented "
2257 "smoothing technique requires the mass matrix inversion "
2258 "which is trivial just for GLL_LAGRANGE_SEM and "
2259 "GAUSS_LAGRANGE_SEMexpansions.");
2260}

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

Referenced by SmoothField().

◆ v_UnsetGlobalLinSys()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 3714 of file ExpList.cpp.

3715{
3716 boost::ignore_unused(key, clearLocalMatrices);
3718 "UnsetGlobalLinSys not implemented for ExpList.");
3719}

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

Referenced by UnsetGlobalLinSys().

◆ v_UpdateBndCondExpansion()

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

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

Definition at line 4197 of file ExpList.cpp.

4198{
4199 boost::ignore_unused(i);
4201 "This method is not defined or valid for this class type");
4202 static std::shared_ptr<ExpList> result;
4203 return result;
4204}

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

Referenced by UpdateBndCondExpansion().

◆ v_UpdateBndConditions()

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

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

Definition at line 5429 of file ExpList.cpp.

5430{
5432 "This method is not defined or valid for this class type");
5433 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
5434 return result;
5435}

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

4220{
4221 switch (m_expType)
4222 {
4223 case e1D:
4224 {
4225 int i, j, k, e_npoints, offset;
4226 Array<OneD, NekDouble> normals;
4227 NekDouble Vn;
4228
4229 // Assume whole array is of same coordimate dimension
4230 int coordim = GetCoordim(0);
4231
4232 ASSERTL1(Vec.size() >= coordim,
4233 "Input vector does not have sufficient dimensions to "
4234 "match coordim");
4235
4236 // Process each expansion
4237 for (i = 0; i < m_exp->size(); ++i)
4238 {
4239 // Get the number of points in the expansion and the normals.
4240 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4241 normals = (*m_exp)[i]->GetPhysNormals();
4242
4243 // Get the physical data offset of the expansion in m_phys.
4244 offset = m_phys_offset[i];
4245
4246 // Compute each data point.
4247 for (j = 0; j < e_npoints; ++j)
4248 {
4249 // Calculate normal velocity.
4250 Vn = 0.0;
4251 for (k = 0; k < coordim; ++k)
4252 {
4253 Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
4254 }
4255
4256 // Upwind based on direction of normal velocity.
4257 if (Vn > 0.0)
4258 {
4259 Upwind[offset + j] = Fwd[offset + j];
4260 }
4261 else
4262 {
4263 Upwind[offset + j] = Bwd[offset + j];
4264 }
4265 }
4266 }
4267 }
4268 break;
4269 default:
4271 "This method is not defined or valid for this class type");
4272 break;
4273 }
4274}

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

4293{
4294 ASSERTL1(Vn.size() >= m_npoints, "Vn is not of sufficient length");
4295 ASSERTL1(Fwd.size() >= m_npoints, "Fwd is not of sufficient length");
4296 ASSERTL1(Bwd.size() >= m_npoints, "Bwd is not of sufficient length");
4297 ASSERTL1(Upwind.size() >= m_npoints, "Upwind is not of sufficient length");
4298
4299 // Process each point in the expansion.
4300 for (int j = 0; j < m_npoints; ++j)
4301 {
4302 // Upwind based on one-dimensional velocity.
4303 if (Vn[j] > 0.0)
4304 {
4305 Upwind[j] = Fwd[j];
4306 }
4307 else
4308 {
4309 Upwind[j] = Bwd[j];
4310 }
4311 }
4312}

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

3636{
3637 NekDouble flux = 0.0;
3638 int i = 0;
3639 int j;
3640
3641 for (i = 0; i < (*m_exp).size(); ++i)
3642 {
3643 Array<OneD, Array<OneD, NekDouble>> tmp(inarray.size());
3644 for (j = 0; j < inarray.size(); ++j)
3645 {
3646 tmp[j] = Array<OneD, NekDouble>(inarray[j] + m_phys_offset[i]);
3647 }
3648 flux += (*m_exp)[i]->VectorFlux(tmp);
3649 }
3650
3651 return flux;
3652}

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

3230{
3231 int i, j, k, l;
3232 int nbase = (*m_exp)[0]->GetNumBases();
3233 int cnt = 0;
3234
3235 std::shared_ptr<LocalRegions::ExpansionVector> exp = m_exp;
3236
3237 if (expansion != -1)
3238 {
3239 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
3241 (*exp)[0] = (*m_exp)[expansion];
3242 }
3243
3244 if (nbase == 2)
3245 {
3246 for (i = 0; i < (*exp).size(); ++i)
3247 {
3248 const int np0 = (*exp)[i]->GetNumPoints(0);
3249 const int np1 = (*exp)[i]->GetNumPoints(1);
3250
3251 for (j = 1; j < np1; ++j)
3252 {
3253 for (k = 1; k < np0; ++k)
3254 {
3255 outfile << cnt + (j - 1) * np0 + k << " ";
3256 outfile << cnt + (j - 1) * np0 + k + 1 << " ";
3257 outfile << cnt + j * np0 + k + 1 << " ";
3258 outfile << cnt + j * np0 + k << endl;
3259 }
3260 }
3261
3262 cnt += np0 * np1;
3263 }
3264 }
3265 else if (nbase == 3)
3266 {
3267 for (i = 0; i < (*exp).size(); ++i)
3268 {
3269 const int np0 = (*exp)[i]->GetNumPoints(0);
3270 const int np1 = (*exp)[i]->GetNumPoints(1);
3271 const int np2 = (*exp)[i]->GetNumPoints(2);
3272 const int np01 = np0 * np1;
3273
3274 for (j = 1; j < np2; ++j)
3275 {
3276 for (k = 1; k < np1; ++k)
3277 {
3278 for (l = 1; l < np0; ++l)
3279 {
3280 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
3281 << " ";
3282 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
3283 << " ";
3284 outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
3285 << " ";
3286 outfile << cnt + (j - 1) * np01 + k * np0 + l << " ";
3287 outfile << cnt + j * np01 + (k - 1) * np0 + l << " ";
3288 outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
3289 << " ";
3290 outfile << cnt + j * np01 + k * np0 + l + 1 << " ";
3291 outfile << cnt + j * np01 + k * np0 + l << endl;
3292 }
3293 }
3294 }
3295 cnt += np0 * np1 * np2;
3296 }
3297 }
3298 else
3299 {
3300 NEKERROR(ErrorUtil::efatal, "Not set up for this dimension");
3301 }
3302}
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 3309 of file ExpList.cpp.

3310{
3311 if (expansion == -1)
3312 {
3313 int totpoints = GetTotPoints();
3314 if (m_physState == false)
3315 {
3317 }
3318
3319 for (int i = 0; i < totpoints; ++i)
3320 {
3321 outfile << m_phys[i] << " ";
3322 if (i % 1000 == 0 && i)
3323 {
3324 outfile << std::endl;
3325 }
3326 }
3327 outfile << std::endl;
3328 }
3329 else
3330 {
3331 int nPoints = (*m_exp)[expansion]->GetTotPoints();
3332
3333 for (int i = 0; i < nPoints; ++i)
3334 {
3335 outfile << m_phys[i + m_phys_offset[expansion]] << " ";
3336 }
3337
3338 outfile << std::endl;
3339 }
3340}

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

3099{
3100 if (GetNumElmts() == 0)
3101 {
3102 return;
3103 }
3104
3105 int coordim = GetExp(0)->GetCoordim();
3106 char vars[3] = {'x', 'y', 'z'};
3107
3108 if (m_expType == e3DH1D)
3109 {
3110 coordim += 1;
3111 }
3112 else if (m_expType == e3DH2D)
3113 {
3114 coordim += 2;
3115 }
3116
3117 outfile << "Variables = x";
3118 for (int i = 1; i < coordim; ++i)
3119 {
3120 outfile << ", " << vars[i];
3121 }
3122
3123 if (var.size() > 0)
3124 {
3125 outfile << ", " << var;
3126 }
3127
3128 outfile << std::endl << std::endl;
3129}

References Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, GetExp(), GetNumElmts(), and m_expType.

Referenced by WriteTecplotHeader().

◆ v_WriteTecplotZone()

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

Write Tecplot Files Zone

Parameters
outfileOutput file name.
expansionExpansion that is considered

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

Definition at line 3136 of file ExpList.cpp.

3137{
3138 int i, j;
3139 int coordim = GetCoordim(0);
3140 int nPoints = GetTotPoints();
3141 int nBases = (*m_exp)[0]->GetNumBases();
3142 int numBlocks = 0;
3143
3144 Array<OneD, Array<OneD, NekDouble>> coords(3);
3145
3146 if (expansion == -1)
3147 {
3148 nPoints = GetTotPoints();
3149
3150 coords[0] = Array<OneD, NekDouble>(nPoints);
3151 coords[1] = Array<OneD, NekDouble>(nPoints);
3152 coords[2] = Array<OneD, NekDouble>(nPoints);
3153
3154 GetCoords(coords[0], coords[1], coords[2]);
3155
3156 for (i = 0; i < m_exp->size(); ++i)
3157 {
3158 int numInt = 1;
3159
3160 for (j = 0; j < nBases; ++j)
3161 {
3162 numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
3163 }
3164
3165 numBlocks += numInt;
3166 }
3167 }
3168 else
3169 {
3170 nPoints = (*m_exp)[expansion]->GetTotPoints();
3171
3172 coords[0] = Array<OneD, NekDouble>(nPoints);
3173 coords[1] = Array<OneD, NekDouble>(nPoints);
3174 coords[2] = Array<OneD, NekDouble>(nPoints);
3175
3176 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3177
3178 numBlocks = 1;
3179 for (j = 0; j < nBases; ++j)
3180 {
3181 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
3182 }
3183 }
3184
3185 if (m_expType == e3DH1D)
3186 {
3187 nBases += 1;
3188 coordim += 1;
3189 int nPlanes = GetZIDs().size();
3190 NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
3191 numBlocks = (int)tmp;
3192 }
3193 else if (m_expType == e3DH2D)
3194 {
3195 nBases += 2;
3196 coordim += 1;
3197 }
3198
3199 outfile << "Zone, N=" << nPoints << ", E=" << numBlocks << ", F=FEBlock";
3200
3201 switch (nBases)
3202 {
3203 case 2:
3204 outfile << ", ET=QUADRILATERAL" << std::endl;
3205 break;
3206 case 3:
3207 outfile << ", ET=BRICK" << std::endl;
3208 break;
3209 default:
3210 NEKERROR(ErrorUtil::efatal, "Not set up for this type of output");
3211 break;
3212 }
3213
3214 // Write out coordinates
3215 for (j = 0; j < coordim; ++j)
3216 {
3217 for (i = 0; i < nPoints; ++i)
3218 {
3219 outfile << coords[j][i] << " ";
3220 if (i % 1000 == 0 && i)
3221 {
3222 outfile << std::endl;
3223 }
3224 }
3225 outfile << std::endl;
3226 }
3227}
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:594
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:1785

References Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, Nektar::ErrorUtil::efatal, GetCoordim(), GetCoords(), GetTotPoints(), GetZIDs(), m_exp, m_expType, and NEKERROR.

Referenced by WriteTecplotZone().

◆ v_WriteVtkPieceData()

void Nektar::MultiRegions::ExpList::v_WriteVtkPieceData ( std::ostream &  outfile,
int  expansion,
std::string  var 
)
protectedvirtual

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

Definition at line 3497 of file ExpList.cpp.

3499{
3500 int i;
3501 int nq = (*m_exp)[expansion]->GetTotPoints();
3502
3503 // printing the fields of that zone
3504 outfile << " <DataArray type=\"Float64\" Name=\"" << var << "\">"
3505 << endl;
3506 outfile << " ";
3507
3508 const Array<OneD, NekDouble> phys = m_phys + m_phys_offset[expansion];
3509
3510 for (i = 0; i < nq; ++i)
3511 {
3512 outfile << (fabs(phys[i]) < NekConstants::kNekZeroTol ? 0 : phys[i])
3513 << " ";
3514 }
3515 outfile << endl;
3516 outfile << " </DataArray>" << endl;
3517}
static const NekDouble kNekZeroTol

References Nektar::NekConstants::kNekZeroTol, m_phys, and m_phys_offset.

Referenced by WriteVtkPieceData().

◆ v_WriteVtkPieceHeader()

void Nektar::MultiRegions::ExpList::v_WriteVtkPieceHeader ( std::ostream &  outfile,
int  expansion,
int  istrip 
)
protectedvirtual

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

Definition at line 3356 of file ExpList.cpp.

3358{
3359 boost::ignore_unused(istrip);
3360 int i, j, k;
3361 int nbase = (*m_exp)[expansion]->GetNumBases();
3362 int ntot = (*m_exp)[expansion]->GetTotPoints();
3363 int nquad[3];
3364
3365 int ntotminus = 1;
3366 for (i = 0; i < nbase; ++i)
3367 {
3368 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
3369 ntotminus *= (nquad[i] - 1);
3370 }
3371
3372 Array<OneD, NekDouble> coords[3];
3373 coords[0] = Array<OneD, NekDouble>(ntot, 0.0);
3374 coords[1] = Array<OneD, NekDouble>(ntot, 0.0);
3375 coords[2] = Array<OneD, NekDouble>(ntot, 0.0);
3376 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3377
3378 outfile << " <Piece NumberOfPoints=\"" << ntot << "\" NumberOfCells=\""
3379 << ntotminus << "\">" << endl;
3380 outfile << " <Points>" << endl;
3381 outfile << " <DataArray type=\"Float64\" "
3382 << "NumberOfComponents=\"3\" format=\"ascii\">" << endl;
3383 outfile << " ";
3384 for (i = 0; i < ntot; ++i)
3385 {
3386 for (j = 0; j < 3; ++j)
3387 {
3388 outfile << setprecision(8) << scientific << (float)coords[j][i]
3389 << " ";
3390 }
3391 outfile << endl;
3392 }
3393 outfile << endl;
3394 outfile << " </DataArray>" << endl;
3395 outfile << " </Points>" << endl;
3396 outfile << " <Cells>" << endl;
3397 outfile << " <DataArray type=\"Int32\" "
3398 << "Name=\"connectivity\" format=\"ascii\">" << endl;
3399
3400 int ns = 0; // pow(2,dim) for later usage
3401 string ostr;
3402 switch (m_expType)
3403 {
3404 case e1D:
3405 {
3406 ns = 2;
3407 ostr = "3 ";
3408 for (i = 0; i < nquad[0] - 1; ++i)
3409 {
3410 outfile << i << " " << i + 1 << endl;
3411 }
3412 }
3413 break;
3414 case e2D:
3415 {
3416 ns = 4;
3417 ostr = "9 ";
3418 for (i = 0; i < nquad[0] - 1; ++i)
3419 {
3420 for (j = 0; j < nquad[1] - 1; ++j)
3421 {
3422 outfile << j * nquad[0] + i << " " << j * nquad[0] + i + 1
3423 << " " << (j + 1) * nquad[0] + i + 1 << " "
3424 << (j + 1) * nquad[0] + i << endl;
3425 }
3426 }
3427 }
3428 break;
3429 case e3D:
3430 {
3431 ns = 8;
3432 ostr = "12 ";
3433 for (i = 0; i < nquad[0] - 1; ++i)
3434 {
3435 for (j = 0; j < nquad[1] - 1; ++j)
3436 {
3437 for (k = 0; k < nquad[2] - 1; ++k)
3438 {
3439 outfile
3440 << k * nquad[0] * nquad[1] + j * nquad[0] + i << " "
3441 << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3442 << " "
3443 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3444 i + 1
3445 << " "
3446 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3447 << " "
3448 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3449 << " "
3450 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3451 i + 1
3452 << " "
3453 << (k + 1) * nquad[0] * nquad[1] +
3454 (j + 1) * nquad[0] + i + 1
3455 << " "
3456 << (k + 1) * nquad[0] * nquad[1] +
3457 (j + 1) * nquad[0] + i
3458 << " " << endl;
3459 }
3460 }
3461 }
3462 }
3463 break;
3464 default:
3465 break;
3466 }
3467
3468 outfile << endl;
3469 outfile << " </DataArray>" << endl;
3470 outfile << " <DataArray type=\"Int32\" "
3471 << "Name=\"offsets\" format=\"ascii\">" << endl;
3472 for (i = 0; i < ntotminus; ++i)
3473 {
3474 outfile << i * ns + ns << " ";
3475 }
3476 outfile << endl;
3477 outfile << " </DataArray>" << endl;
3478 outfile << " <DataArray type=\"UInt8\" "
3479 << "Name=\"types\" format=\"ascii\">" << endl;
3480 for (i = 0; i < ntotminus; ++i)
3481 {
3482 outfile << ostr;
3483 }
3484 outfile << endl;
3485 outfile << " </DataArray>" << endl;
3486 outfile << " </Cells>" << endl;
3487 outfile << " <PointData>" << endl;
3488}

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

573 {
574 return v_VectorFlux(inarray);
575 }
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Definition: ExpList.cpp:3634

References v_VectorFlux().

◆ WriteTecplotConnectivity()

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

Definition at line 412 of file ExpList.h.

413 {
414 v_WriteTecplotConnectivity(outfile, expansion);
415 }
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3229

References v_WriteTecplotConnectivity().

◆ WriteTecplotField()

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

Definition at line 408 of file ExpList.h.

409 {
410 v_WriteTecplotField(outfile, expansion);
411 }
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3309

References v_WriteTecplotField().

◆ WriteTecplotHeader()

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

Definition at line 400 of file ExpList.h.

401 {
402 v_WriteTecplotHeader(outfile, var);
403 }
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:3098

References v_WriteTecplotHeader().

◆ WriteTecplotZone()

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

Definition at line 404 of file ExpList.h.

405 {
406 v_WriteTecplotZone(outfile, expansion);
407 }
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:3136

References v_WriteTecplotZone().

◆ WriteVtkFooter()

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

Definition at line 3350 of file ExpList.cpp.

3351{
3352 outfile << " </UnstructuredGrid>" << endl;
3353 outfile << "</VTKFile>" << endl;
3354}

◆ WriteVtkHeader()

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

Definition at line 3342 of file ExpList.cpp.

3343{
3344 outfile << "<?xml version=\"1.0\"?>" << endl;
3345 outfile << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
3346 << "byte_order=\"LittleEndian\">" << endl;
3347 outfile << " <UnstructuredGrid>" << endl;
3348}

◆ WriteVtkPieceData()

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

Definition at line 425 of file ExpList.h.

427 {
428 v_WriteVtkPieceData(outfile, expansion, var);
429 }
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:3497

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

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

Definition at line 3490 of file ExpList.cpp.

3491{
3492 boost::ignore_unused(expansion);
3493 outfile << " </PointData>" << endl;
3494 outfile << " </Piece>" << endl;
3495}

◆ WriteVtkPieceHeader()

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

Definition at line 418 of file ExpList.h.

420 {
421 v_WriteVtkPieceHeader(outfile, expansion, istrip);
422 }
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:3356

References v_WriteVtkPieceHeader().

Member Data Documentation

◆ m_blockMat

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

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

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

◆ m_coeffsToElmt

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

m_coeffs to elemental value map

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

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

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

Referenced by CreateCollections(), GeneralMatrixOp(), v_BwdTrans(), v_IProductWRTBase(), v_IProductWRTDerivBase(), 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 1130 of file ExpList.h.

Referenced by CreateCollections(), GeneralMatrixOp(), v_BwdTrans(), v_IProductWRTBase(), v_IProductWRTDerivBase(), 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 1127 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), Nektar::MultiRegions::ContField3DHomogeneous2D::ContField3DHomogeneous2D(), CreateCollections(), Nektar::MultiRegions::DisContField::DisContField(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous2D::DisContField3DHomogeneous2D(), EvalBasisNumModesMax(), EvalBasisNumModesMaxPerExp(), Nektar::MultiRegions::DisContField::EvaluateHDGPostProcessing(), ExpList(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), GenBlockMatrix(), GeneralGetFieldDefinitions(), GeneralMatrixOp(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), GenGlobalMatrix(), GenGlobalMatrixFull(), GetCoordim(), GetElmtNormalLength(), GetExp(), GetExpFromGeomId(), GetExpIndex(), 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(), Nektar::MultiRegions::ContField::v_UnsetGlobalLinSys(), v_Upwind(), v_WriteTecplotConnectivity(), and v_WriteTecplotZone().

◆ m_expType

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

◆ m_graph

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

◆ m_ncoeffs

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

◆ m_npoints

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

◆ m_phys

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

The global expansion evaluated at the quadrature points.

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

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

Definition at line 1108 of file ExpList.h.

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

◆ m_phys_offset

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

◆ m_physState

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

The state of the array m_phys.

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

Definition at line 1116 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