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

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

#include <ExpList.h>

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

Public Member Functions

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

Protected Member Functions

std::shared_ptr< DNekMatGenGlobalMatrixFull (const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
 
const DNekScalBlkMatSharedPtr GenBlockMatrix (const GlobalMatrixKey &gkey)
 This function assembles the block diagonal matrix of local matrices of the type mtype. More...
 
const DNekScalBlkMatSharedPtrGetBlockMatrix (const GlobalMatrixKey &gkey)
 
void MultiplyByBlockMatrix (const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
std::shared_ptr< GlobalMatrixGenGlobalMatrix (const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
 Generates a global matrix from the given key and map. More...
 
void GlobalEigenSystem (const std::shared_ptr< DNekMat > &Gmat, Array< OneD, NekDouble > &EigValsReal, Array< OneD, NekDouble > &EigValsImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray)
 
std::shared_ptr< GlobalLinSysGenGlobalLinSys (const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
 This operation constructs the global linear system of type mkey. More...
 
std::shared_ptr< GlobalLinSysGenGlobalBndLinSys (const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
 Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocToGloBaseMap. More...
 
virtual int v_GetNumElmts (void)
 
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions (void)
 
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight ()
 
virtual void v_SetBndCondBwdWeight (const int index, const NekDouble value)
 
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion (int i)
 
virtual void v_Upwind (const Array< OneD, const Array< OneD, NekDouble > > &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
virtual void v_Upwind (const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
virtual std::shared_ptr< ExpList > & v_GetTrace ()
 
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap ()
 
virtual const Array< OneD, const int > & v_GetTraceBndMap ()
 
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap (void) const
 
virtual void v_GetNormals (Array< OneD, Array< OneD, NekDouble > > &normals)
 Populate normals with the normals of all expansions. More...
 
virtual void v_AddTraceIntegral (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddTraceIntegral (const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddFwdBwdTraceIntegral (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetFwdBwdTracePhys (Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 
virtual void v_GetFwdBwdTracePhys (const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool FillBnd=true, bool PutFwdInBwdOnBCs=false, bool DoExchange=true)
 
virtual void v_FillBwdWithBoundCond (const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
 
virtual void v_AddTraceQuadPhysToField (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
 
virtual void v_AddTraceQuadPhysToOffDiag (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
 
virtual void v_GetLocTraceFromTracePts (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
 
virtual void v_FillBwdWithBwdWeight (Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
 
virtual void v_PeriodicBwdCopy (const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 
virtual const std::vector< bool > & v_GetLeftAdjacentFaces (void) const
 
virtual void v_ExtractTracePhys (Array< OneD, NekDouble > &outarray)
 
virtual void v_ExtractTracePhys (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_MultiplyByInvMassMatrix (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_HelmSolve (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
 
virtual void v_LinearAdvectionDiffusionReactionSolve (const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 
virtual void v_LinearAdvectionReactionSolve (const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 
virtual void v_ImposeDirichletConditions (Array< OneD, NekDouble > &outarray)
 
virtual void v_FillBndCondFromField ()
 
virtual void v_FillBndCondFromField (const int nreg)
 
virtual void v_Reset ()
 Reset geometry information, metrics, matrix managers and geometry information. More...
 
virtual void v_LocalToGlobal (bool UseComm)
 
virtual void v_LocalToGlobal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseComm)
 
virtual void v_GlobalToLocal (void)
 
virtual void v_GlobalToLocal (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans_IterPerExp (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_FwdTrans_IterPerExp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_FwdTrans_BndConstrained (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_IProductWRTBase_IterPerExp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_GeneralMatrixOp (const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
 
virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
virtual void v_PhysDeriv (Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
 
virtual void v_CurlCurl (Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
 
virtual void v_PhysDirectionalDeriv (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetMovingFrames (const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual void v_HomogeneousFwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
virtual void v_HomogeneousBwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
 
virtual void v_DealiasedProd (const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
 
virtual void v_DealiasedDotProd (const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
virtual void v_GetBCValues (Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
 
virtual void v_NormVectorIProductWRTBase (Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
 
virtual void v_NormVectorIProductWRTBase (Array< OneD, Array< OneD, NekDouble > > &V, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetUpPhysNormals ()
 
virtual void v_GetBoundaryToElmtMap (Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
 
virtual void v_GetBndElmtExpansion (int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
 
virtual void v_ExtractElmtToBndPhys (const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
 
virtual void v_ExtractPhysToBndElmt (const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
 
virtual void v_ExtractPhysToBnd (const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
 
virtual void v_GetBoundaryNormals (int i, Array< OneD, Array< OneD, NekDouble > > &normals)
 
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtrv_GetFieldDefinitions (void)
 
virtual void v_GetFieldDefinitions (std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
 
virtual void v_AppendFieldData (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
 
virtual void v_AppendFieldData (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, Array< OneD, NekDouble > &coeffs)
 
virtual void v_ExtractDataToCoeffs (LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
 Extract data from raw field data into expansion list. More...
 
virtual void v_ExtractCoeffsToCoeffs (const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
 
virtual void v_WriteTecplotHeader (std::ostream &outfile, std::string var="")
 
virtual void v_WriteTecplotZone (std::ostream &outfile, int expansion)
 
virtual void v_WriteTecplotField (std::ostream &outfile, int expansion)
 
virtual void v_WriteTecplotConnectivity (std::ostream &outfile, int expansion)
 
virtual void v_WriteVtkPieceHeader (std::ostream &outfile, int expansion, int istrip)
 
virtual void v_WriteVtkPieceData (std::ostream &outfile, int expansion, std::string var)
 
virtual NekDouble v_L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
 
virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 
virtual NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &inarray)
 
virtual Array< OneD, const NekDoublev_HomogeneousEnergy (void)
 
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition (void)
 
virtual NekDouble v_GetHomoLen (void)
 
virtual void v_SetHomoLen (const NekDouble lhom)
 
virtual Array< OneD, const unsigned int > v_GetZIDs (void)
 
virtual Array< OneD, const unsigned int > v_GetYIDs (void)
 
virtual void v_PhysInterp1DScaled (const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_PhysGalerkinProjection1DScaled (const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_ClearGlobalLinSysManager (void)
 
void ExtractFileBCs (const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
 

Static Protected Member Functions

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

Protected Attributes

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

Private Member Functions

void SetupCoeffPhys (bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
 Definition of the total number of degrees of freedom and quadrature points and offsets to access data. More...
 
void InitialiseExpVector (const SpatialDomains::ExpansionInfoMap &expmap)
 Define a list of elements using the geometry and basis key information in expmap;. More...
 
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions ()
 
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions ()
 
virtual void v_EvaluateBoundaryConditions (const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
 
virtual std::map< int, RobinBCInfoSharedPtrv_GetRobinBCInfo (void)
 
virtual void v_GetPeriodicEntities (PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
 
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis (void)
 
virtual void v_SetHomo1DSpecVanVisc (Array< OneD, NekDouble > visc)
 
virtual std::shared_ptr< ExpList > & v_GetPlane (int n)
 
virtual void v_AddTraceIntegralToOffDiag (const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
 

Detailed Description

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

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

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

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

The class stores a vector of expansions, m_exp, (each derived from StdRegions::StdExpansion) which define the constituent components of the domain. The coefficients from these expansions are concatenated in m_coeffs, while the expansion evaluated at the quadrature points is stored in m_phys.

Definition at line 106 of file ExpList.h.

Constructor & Destructor Documentation

◆ ExpList() [1/8]

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

The default constructor using a type.

Creates an empty expansion list.

Definition at line 104 of file ExpList.cpp.

104  :
105  m_expType(type),
106  m_ncoeffs(0),
107  m_npoints(0),
108  m_physState(false),
109  m_exp(MemoryManager<LocalRegions::ExpansionVector>
110  ::AllocateSharedPtr()),
112  m_WaveSpace(false)
113  {
114  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1312
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1278
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1290
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1230
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1212

◆ ExpList() [2/8]

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

125  :
126  std::enable_shared_from_this<ExpList>(in),
127  m_expType(in.m_expType),
128  m_comm(in.m_comm),
129  m_session(in.m_session),
130  m_graph(in.m_graph),
131  m_ncoeffs(in.m_ncoeffs),
132  m_npoints(in.m_npoints),
133  m_physState(false),
134  m_exp(in.m_exp),
135  m_collections(in.m_collections),
136  m_collectionsDoInit(in.m_collectionsDoInit),
137  m_coll_coeff_offset(in.m_coll_coeff_offset),
138  m_coll_phys_offset(in.m_coll_phys_offset),
139  m_coeff_offset(in.m_coeff_offset),
140  m_phys_offset(in.m_phys_offset),
141  m_blockMat(in.m_blockMat),
142  m_WaveSpace(false)
143  {
144 
145  // Set up m_coeffs, m_phys and offset arrays.
146  // use this to keep memory declaration in one place
147  SetupCoeffPhys(DeclareCoeffPhysArrays, false);
148  }
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:978
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1304
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
Definition: ExpList.h:1295
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1301
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:1220
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:1226
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:1298
Collections::CollectionVector m_collections
Definition: ExpList.h:1292
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1223
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:1307

References SetupCoeffPhys().

◆ ExpList() [3/8]

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

158  :
159  m_expType(in.m_expType),
160  m_comm(in.m_comm),
161  m_session(in.m_session),
162  m_graph(in.m_graph),
163  m_physState(false),
164  m_exp(MemoryManager<LocalRegions::ExpansionVector>
165  ::AllocateSharedPtr()),
167  m_WaveSpace(false)
168  {
169  for (int i=0; i < eIDs.size(); ++i)
170  {
171  (*m_exp).push_back( (*(in.m_exp))[eIDs[i]]);
172  }
173 
174  // Set up m_coeffs, m_phys and offset arrays.
175  SetupCoeffPhys(DeclareCoeffPhysArrays);
176 
177  // set up collections
178  CreateCollections(ImpType);
179  }
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:5017

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

◆ ExpList() [4/8]

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

Generate an ExpList from a meshgraph graph and session file.

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

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

Definition at line 202 of file ExpList.cpp.

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

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

◆ ExpList() [5/8]

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

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

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

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

Definition at line 249 of file ExpList.cpp.

252  :
253  m_comm(pSession->GetComm()),
254  m_session(pSession),
255  m_physState(false),
256  m_exp(MemoryManager<LocalRegions::ExpansionVector>
257  ::AllocateSharedPtr()),
259  m_WaveSpace(false)
260  {
261 
262  // Initialise expansion vector
263  InitialiseExpVector(expansions);
264 
265  // Set up m_coeffs, m_phys and offset arrays.
266  SetupCoeffPhys(DeclareCoeffPhysArrays);
267 
268  // Setup Collection
269  CreateCollections(ImpType);
270  }

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

◆ ExpList() [6/8]

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

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

Definition at line 275 of file ExpList.cpp.

275  :
276  m_expType(e0D),
277  m_ncoeffs(1),
278  m_npoints(1),
279  m_physState(false),
280  m_exp(MemoryManager<LocalRegions::ExpansionVector>
281  ::AllocateSharedPtr()),
283  m_WaveSpace(false)
284  {
287  (*m_exp).push_back(Point);
288 
289  SetupCoeffPhys();
290  }
std::shared_ptr< PointExp > PointExpSharedPtr
Definition: PointExp.h:129

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

◆ ExpList() [7/8]

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 bool  DeclareCoeffPhysArrays = true,
const std::string  variable = "DefaultVar",
const Collections::ImplementationType  ImpType = Collections::eNoImpType 
)

Generate expansions for the trace space expansions used in DisContField.

◆ ExpList() [8/8]

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

832  :
833  m_comm(comm),
834  m_session(pSession),
835  m_graph(graph),
836  m_physState(false),
837  m_exp(MemoryManager<LocalRegions::ExpansionVector>
838  ::AllocateSharedPtr()),
840  m_WaveSpace(false)
841  {
842  int j, elmtid=0;
847 
849 
851 
852  int meshdim = graph->GetMeshDimension();
853 
854  // Retrieve the list of expansions (needed of meshdim == 1
855  const SpatialDomains::ExpansionInfoMap &expansions
856  = graph->GetExpansionInfo(variable);
857 
858  // Retrieve the list of expansions
859  // Process each composite region.
860  for(auto &compIt : domain)
861  {
862  // Process each expansion in the region.
863  for(j = 0; j < compIt.second->m_geomVec.size(); ++j)
864  {
865  if((PtGeom = std::dynamic_pointer_cast <
866  SpatialDomains::PointGeom>(compIt.second->m_geomVec[j])))
867  {
868  m_expType = e0D;
869 
871  ::AllocateSharedPtr(PtGeom);
872  }
873  else if((SegGeom = std::dynamic_pointer_cast<
874  SpatialDomains::SegGeom>(compIt.second->m_geomVec[j])))
875  {
876  m_expType = e1D;
877 
878  // Retrieve the basis key from the expansion.
879  LibUtilities::BasisKey bkey = LibUtilities::NullBasisKey;
880 
881  if(meshdim == 1)
882  {
883  auto expIt = expansions.find(SegGeom->GetGlobalID());
884  ASSERTL0(expIt != expansions.end(),
885  "Failed to find basis key");
886  bkey = expIt->second->m_basisKeyVector[0];
887  }
888  else
889  {
890  bkey = graph->GetEdgeBasisKey(SegGeom, variable);
891  }
892 
893  if(SetToOneSpaceDimension)
894  {
895  SpatialDomains::SegGeomSharedPtr OneDSegmentGeom =
896  SegGeom->GenerateOneSpaceDimGeom();
897 
899  ::AllocateSharedPtr(bkey, OneDSegmentGeom);
900  }
901  else
902  {
903 
905  ::AllocateSharedPtr(bkey, SegGeom);
906  }
907  }
908  else if ((TriGeom = std::dynamic_pointer_cast<
909  SpatialDomains::TriGeom>(compIt.second->m_geomVec[j])))
910  {
911  m_expType = e2D;
912 
913  LibUtilities::BasisKey TriBa
914  = graph->GetFaceBasisKey(TriGeom,0,variable);
915  LibUtilities::BasisKey TriBb
916  = graph->GetFaceBasisKey(TriGeom,1,variable);
917 
918  if (graph->GetExpansionInfo().begin()->second->
919  m_basisKeyVector[0].GetBasisType() ==
921  {
922  NEKERROR(ErrorUtil::efatal,"This method needs sorting");
924 
926  ::AllocateSharedPtr(TriBa,TriBb,TriNb,
927  TriGeom);
928  }
929  else
930  {
932  ::AllocateSharedPtr(TriBa, TriBb, TriGeom);
933  }
934  }
935  else if ((QuadGeom = std::dynamic_pointer_cast<
936  SpatialDomains::QuadGeom>(compIt.second->m_geomVec[j])))
937  {
938  m_expType = e2D;
939 
940  LibUtilities::BasisKey QuadBa
941  = graph->GetFaceBasisKey(QuadGeom, 0, variable);
942  LibUtilities::BasisKey QuadBb
943  = graph->GetFaceBasisKey(QuadGeom, 1, variable);
944 
946  ::AllocateSharedPtr(QuadBa, QuadBb, QuadGeom);
947  }
948  else
949  {
951  "dynamic cast to a Geom (possibly 3D) failed");
952  }
953 
954  exp->SetElmtId(elmtid++);
955  (*m_exp).push_back(exp);
956  }
957  }
958 
959  // Set up m_coeffs, m_phys and offset arrays.
960  SetupCoeffPhys(DeclareCoeffPhysArrays);
961 
962  if(m_expType != e0D)
963  {
964  CreateCollections(ImpType);
965  }
966  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
#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:69
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:54
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:46
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58

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

◆ ~ExpList()

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

The default destructor.

Definition at line 1187 of file ExpList.cpp.

1188  {
1189  }

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

2565  {
2566  v_AddFwdBwdTraceIntegral(Fwd,Bwd,outarray);
2567  }
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4283

References v_AddFwdBwdTraceIntegral().

◆ AddRightIPTBaseMatrix()

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

Definition at line 5775 of file ExpList.cpp.

5778  {
5779  int nelmt;
5780  int nelmtcoef, nelmtpnts,nelmtcoef0, nelmtpnts0;
5781 
5782  nelmtcoef = GetNcoeffs(0);
5783  nelmtpnts = GetTotPoints(0);
5784 
5785  Array<OneD,NekDouble> innarray(nelmtpnts,0.0);
5786  Array<OneD,NekDouble> outarray(nelmtcoef,0.0);
5787 
5788  Array<OneD,NekDouble> MatQ_data;
5789  Array<OneD,NekDouble> MatC_data;
5790 
5791  DNekMatSharedPtr tmpMatQ,tmpMatC;
5792 
5793  nelmtcoef0 = nelmtcoef;
5794  nelmtpnts0 = nelmtpnts;
5795 
5796  for(nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5797  {
5798  nelmtcoef = GetNcoeffs(nelmt);
5799  nelmtpnts = GetTotPoints(nelmt);
5800 
5801  tmpMatQ = ElmtJacQuad[nelmt];
5802  tmpMatC = ElmtJacCoef[nelmt];
5803 
5804  MatQ_data = tmpMatQ->GetPtr();
5805  MatC_data = tmpMatC->GetPtr();
5806 
5807  if(nelmtcoef!=nelmtcoef0)
5808  {
5809  outarray = Array<OneD,NekDouble> (nelmtcoef,0.0);
5810  nelmtcoef0 = nelmtcoef;
5811  }
5812 
5813  if(nelmtpnts!=nelmtpnts0)
5814  {
5815  innarray = Array<OneD,NekDouble> (nelmtpnts,0.0);
5816  nelmtpnts0 = nelmtpnts;
5817  }
5818 
5819  for(int np=0; np<nelmtcoef;np++)
5820  {
5821  Vmath::Vcopy(nelmtpnts,&MatQ_data[0]+np,nelmtcoef,
5822  &innarray[0],1);
5823  (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray,innarray);
5824  (*m_exp)[nelmt]->IProductWRTBase(innarray,outarray);
5825 
5826  Vmath::Vadd(nelmtcoef,&outarray[0],1,
5827  &MatC_data[0]+np,nelmtcoef,
5828  &MatC_data[0]+np,nelmtcoef);
5829  }
5830  }
5831  }
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1800
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1850
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
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:322
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199

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

5722  {
5723  int nelmt;
5724  int nelmtcoef, nelmtpnts,nelmtcoef0, nelmtpnts0;
5725 
5726  nelmtcoef = GetNcoeffs(0);
5727  nelmtpnts = GetTotPoints(0);
5728 
5729  Array<OneD,NekDouble> innarray(nelmtpnts,0.0);
5730  Array<OneD,NekDouble> outarray(nelmtcoef,0.0);
5731 
5732  Array<OneD,NekDouble> MatQ_data;
5733  Array<OneD,NekDouble> MatC_data;
5734 
5735  DNekMatSharedPtr tmpMatQ,tmpMatC;
5736 
5737  nelmtcoef0 = nelmtcoef;
5738  nelmtpnts0 = nelmtpnts;
5739 
5740  for(nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5741  {
5742  nelmtcoef = GetNcoeffs(nelmt);
5743  nelmtpnts = GetTotPoints(nelmt);
5744 
5745  tmpMatQ = ElmtJacQuad[nelmt];
5746  tmpMatC = ElmtJacCoef[nelmt];
5747 
5748  MatQ_data = tmpMatQ->GetPtr();
5749  MatC_data = tmpMatC->GetPtr();
5750 
5751  if(nelmtcoef!=nelmtcoef0)
5752  {
5753  outarray = Array<OneD,NekDouble> (nelmtcoef,0.0);
5754  nelmtcoef0 = nelmtcoef;
5755  }
5756 
5757  if(nelmtpnts!=nelmtpnts0)
5758  {
5759  innarray = Array<OneD,NekDouble> (nelmtpnts,0.0);
5760  nelmtpnts0 = nelmtpnts;
5761  }
5762 
5763  for(int np=0; np<nelmtcoef;np++)
5764  {
5765  Vmath::Vcopy(nelmtpnts,&MatQ_data[0]+np,nelmtcoef,&innarray[0],1);
5766  (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray,innarray);
5767  (*m_exp)[nelmt]->IProductWRTDerivBase(dir,innarray,outarray);
5768 
5769  Vmath::Vadd(nelmtcoef,&outarray[0],1,&MatC_data[0]+np,nelmtcoef,&MatC_data[0]+np,nelmtcoef);
5770  }
5771  }
5772  }

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

2557  {
2558  v_AddTraceIntegral(Fn,outarray);
2559  }
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4264

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

2550  {
2551  v_AddTraceIntegral(Fx,Fy,outarray);
2552  }

References v_AddTraceIntegral().

◆ AddTraceIntegralToOffDiag()

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

Definition at line 1190 of file ExpList.h.

1194  {
1195  v_AddTraceIntegralToOffDiag(FwdFlux,BwdFlux,outarray);
1196  }
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5244

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

5481  {
5483  std::shared_ptr<LocalRegions::ExpansionVector> traceExp=
5484  tracelist->GetExp();
5485  int ntotTrace = (*traceExp).size();
5486  int nTracePnt,nTraceCoef;
5487 
5488  std::shared_ptr<LocalRegions::ExpansionVector> fieldExp= GetExp();
5489  int nElmtCoef ;
5490 
5491  const MultiRegions::LocTraceToTraceMapSharedPtr locTraceToTraceMap =
5493  const Array<OneD, const Array<OneD, int >> LRAdjExpid =
5494  locTraceToTraceMap->GetLeftRightAdjacentExpId();
5495  const Array<OneD, const Array<OneD, bool>> LRAdjflag =
5496  locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
5497 
5498  const Array<OneD, const Array<OneD, Array<OneD, int > > > elmtLRMap
5499  = locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
5500  const Array<OneD, const Array<OneD, Array<OneD, int > > > elmtLRSign
5501  = locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
5502  DNekMatSharedPtr ElmtMat;
5503  Array<OneD, NekDouble > ElmtMat_data;
5504  // int nclAdjExp;
5505  int nrwAdjExp;
5506  int MatIndex,nPnts;
5507  NekDouble sign = 1.0;
5508 
5509  int nTracePntsTtl = tracelist->GetTotPoints();
5510  int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
5511  int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
5512  int nlocTracePtsBwd = nlocTracePts-nlocTracePtsFwd;
5513 
5514  Array<OneD, int > nlocTracePtsLR(2);
5515  nlocTracePtsLR[0] = nlocTracePtsFwd;
5516  nlocTracePtsLR[1] = nlocTracePtsBwd;
5517 
5518  size_t nFwdBwdNonZero = 0;
5519  Array<OneD, int> tmpIndex{2, -1};
5520  for (int i = 0; i < 2; ++i)
5521  {
5522  if (nlocTracePtsLR[i] > 0)
5523  {
5524  tmpIndex[nFwdBwdNonZero] = i;
5525  nFwdBwdNonZero++;
5526  }
5527  }
5528 
5529  Array<OneD, int> nlocTracePtsNonZeroIndex{nFwdBwdNonZero};
5530  for (int i = 0; i < nFwdBwdNonZero; ++i)
5531  {
5532  nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
5533  }
5534 
5535  Array<OneD, NekDouble> TraceFwdPhy(nTracePntsTtl);
5536  Array<OneD, NekDouble> TraceBwdPhy(nTracePntsTtl);
5537  Array<OneD, Array<OneD, NekDouble> > tmplocTrace(2);
5538  for (int k = 0; k < 2; ++k)
5539  {
5540  tmplocTrace[k] = NullNekDouble1DArray;
5541  }
5542 
5543  for (int k = 0; k < nFwdBwdNonZero; ++k)
5544  {
5545  size_t i = nlocTracePtsNonZeroIndex[k];
5546  tmplocTrace[i] = Array<OneD, NekDouble> (nlocTracePtsLR[i]);
5547  }
5548 
5549  int nNumbElmt = fieldMat.size();
5550  Array<OneD, Array<OneD, NekDouble> > ElmtMatDataArray(nNumbElmt);
5551  Array<OneD, int> ElmtCoefArray(nNumbElmt);
5552  for(int i=0;i<nNumbElmt;i++)
5553  {
5554  ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
5555  ElmtCoefArray[i] = GetNcoeffs(i);
5556  }
5557 
5558  int nTraceCoefMax = 0;
5559  int nTraceCoefMin = std::numeric_limits<int>::max();
5560  Array<OneD, int> TraceCoefArray(ntotTrace);
5561  Array<OneD, int> TracePntArray(ntotTrace);
5562  Array<OneD, int> TraceOffArray(ntotTrace);
5563  Array<OneD, Array<OneD, NekDouble> > FwdMatData(ntotTrace);
5564  Array<OneD, Array<OneD, NekDouble> > BwdMatData(ntotTrace);
5565  for(int nt = 0; nt < ntotTrace; nt++)
5566  {
5567  nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
5568  nTracePnt = tracelist->GetTotPoints(nt);
5569  int noffset = tracelist->GetPhys_Offset(nt);
5570  TraceCoefArray[nt] = nTraceCoef;
5571  TracePntArray[nt] = nTracePnt;
5572  TraceOffArray[nt] = noffset;
5573  FwdMatData[nt] = FwdMat[nt]->GetPtr();
5574  BwdMatData[nt] = BwdMat[nt]->GetPtr();
5575  if(nTraceCoef>nTraceCoefMax)
5576  {
5577  nTraceCoefMax = nTraceCoef;
5578  }
5579  if(nTraceCoef<nTraceCoefMin)
5580  {
5581  nTraceCoefMin = nTraceCoef;
5582  }
5583  }
5584  WARNINGL1(nTraceCoefMax==nTraceCoefMin,
5585  "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
5586 
5587  int traceID, nfieldPnts, ElmtId, noffset;
5588  const Array<OneD, const Array<OneD, int > > LocTracephysToTraceIDMap
5589  = locTraceToTraceMap->GetLocTracephysToTraceIDMap();
5590  const Array<OneD, const int > fieldToLocTraceMap =
5591  locTraceToTraceMap->GetfieldToLocTraceMap();
5592  Array<OneD, Array<OneD, int > > fieldToLocTraceMapLR(2);
5593  noffset = 0;
5594  for (int k = 0; k < nFwdBwdNonZero; ++k)
5595  {
5596  size_t i = nlocTracePtsNonZeroIndex[k];
5597  fieldToLocTraceMapLR[i] = Array<OneD, int> (nlocTracePtsLR[i]);
5598  Vmath::Vcopy(nlocTracePtsLR[i],
5599  &fieldToLocTraceMap[0]+noffset,1,
5600  &fieldToLocTraceMapLR[i][0],1);
5601  noffset += nlocTracePtsLR[i];
5602  }
5603 
5604  Array<OneD, Array<OneD, int > > MatIndexArray(2);
5605  for (int k = 0; k < nFwdBwdNonZero; ++k)
5606  {
5607  size_t nlr = nlocTracePtsNonZeroIndex[k];
5608  MatIndexArray[nlr] = Array<OneD, int > (nlocTracePtsLR[nlr]);
5609  for(int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5610  {
5611  traceID = LocTracephysToTraceIDMap[nlr][nloc];
5612  nTraceCoef = TraceCoefArray[traceID];
5613  ElmtId = LRAdjExpid[nlr][traceID];
5614  noffset = GetPhys_Offset(ElmtId);
5615  nElmtCoef = ElmtCoefArray[ElmtId];
5616  nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
5617  nPnts = nfieldPnts - noffset;
5618 
5619  MatIndexArray[nlr][nloc] = nPnts*nElmtCoef;
5620  }
5621  }
5622 
5623  for(int nc=0;nc<nTraceCoefMin;nc++)
5624  {
5625  for(int nt = 0; nt < ntotTrace; nt++)
5626  {
5627  nTraceCoef = TraceCoefArray[nt];
5628  nTracePnt = TracePntArray[nt] ;
5629  noffset = TraceOffArray[nt] ;
5630  Vmath::Vcopy(nTracePnt,
5631  &FwdMatData[nt][nc], nTraceCoef,
5632  &TraceFwdPhy[noffset],1);
5633  Vmath::Vcopy(nTracePnt,
5634  &BwdMatData[nt][nc],nTraceCoef,
5635  &TraceBwdPhy[noffset],1);
5636  }
5637 
5638  for (int k = 0; k < nFwdBwdNonZero; ++k)
5639  {
5640  size_t i = nlocTracePtsNonZeroIndex[k];
5641  Vmath::Zero(nlocTracePtsLR[i],tmplocTrace[i],1);
5642  }
5643 
5644  GetLocTraceFromTracePts(TraceFwdPhy,TraceBwdPhy,tmplocTrace[0],
5645  tmplocTrace[1]);
5646 
5647  for (int k = 0; k < nFwdBwdNonZero; ++k)
5648  {
5649  size_t nlr = nlocTracePtsNonZeroIndex[k];
5650  for(int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5651  {
5652  traceID = LocTracephysToTraceIDMap[nlr][nloc];
5653  nTraceCoef = TraceCoefArray[traceID];
5654  ElmtId = LRAdjExpid[nlr][traceID];
5655  nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5656  sign = elmtLRSign[nlr][traceID][nc];
5657  MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5658 
5659  ElmtMatDataArray[ElmtId][MatIndex] -=
5660  sign*tmplocTrace[nlr][nloc];
5661  }
5662  }
5663  }
5664 
5665  for(int nc=nTraceCoefMin;nc<nTraceCoefMax;nc++)
5666  {
5667  for(int nt = 0; nt < ntotTrace; nt++)
5668  {
5669  nTraceCoef = TraceCoefArray[nt];
5670  nTracePnt = TracePntArray[nt] ;
5671  noffset = TraceOffArray[nt] ;
5672  if(nc<nTraceCoef)
5673  {
5674  Vmath::Vcopy(nTracePnt,
5675  &FwdMatData[nt][nc],nTraceCoef,
5676  &TraceFwdPhy[noffset],1);
5677  Vmath::Vcopy(nTracePnt,
5678  &BwdMatData[nt][nc],nTraceCoef,
5679  &TraceBwdPhy[noffset],1);
5680  }
5681  else
5682  {
5683  Vmath::Zero(nTracePnt,&TraceFwdPhy[noffset],1);
5684  Vmath::Zero(nTracePnt,&TraceBwdPhy[noffset],1);
5685  }
5686  }
5687 
5688  for (int k = 0; k < nFwdBwdNonZero; ++k)
5689  {
5690  size_t i = nlocTracePtsNonZeroIndex[k];
5691  Vmath::Zero(nlocTracePtsLR[i],tmplocTrace[i],1);
5692  }
5693  GetLocTraceFromTracePts(TraceFwdPhy,TraceBwdPhy,tmplocTrace[0],
5694  tmplocTrace[1]);
5695 
5696  for (int k = 0; k < nFwdBwdNonZero; ++k)
5697  {
5698  size_t nlr = nlocTracePtsNonZeroIndex[k];
5699  for(int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5700  {
5701  traceID = LocTracephysToTraceIDMap[nlr][nloc];
5702  nTraceCoef = TraceCoefArray[traceID];
5703  if(nc<nTraceCoef)
5704  {
5705  ElmtId = LRAdjExpid[nlr][traceID];
5706  nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5707  sign =-elmtLRSign[nlr][traceID][nc];
5708  MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5709 
5710  ElmtMatDataArray[ElmtId][MatIndex] +=
5711  sign*tmplocTrace[nlr][nloc];
5712  }
5713  }
5714  }
5715  }
5716  }
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:251
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:15
std::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2525
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
Definition: ExpList.h:2484
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:2604
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2422
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n.
Definition: ExpList.h:2439
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:436

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

2600  {
2601  v_AddTraceQuadPhysToField(Fwd, Bwd, field);
2602  }
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4325

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

954  {
955  v_AddTraceQuadPhysToOffDiag(Fwd,Bwd,field);
956  }
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:4335

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

1077  {
1078  v_AppendFieldData(fielddef,fielddata);
1079  }
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:3407

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

1088  {
1089  v_AppendFieldData(fielddef,fielddata,coeffs);
1090  }

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

2568  {
2569 
2570  }

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

◆ BwdTrans()

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

Definition at line 2015 of file ExpList.h.

2018  {
2019  v_BwdTrans(inarray,outarray);
2020  }
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4608

References v_BwdTrans().

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

◆ BwdTrans_IterPerExp()

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

Definition at line 2025 of file ExpList.h.

2028  {
2029  v_BwdTrans_IterPerExp(inarray,outarray);
2030  }
virtual void v_BwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2366

References v_BwdTrans_IterPerExp().

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

◆ ClearGlobalLinSysManager()

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

Definition at line 5165 of file ExpList.cpp.

5166  {
5168  }
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:3201

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

5018  {
5020  vector<std::pair<LocalRegions::ExpansionSharedPtr,int> > >
5021  collections;
5022 
5023  //Set up initialisation flags
5024  m_collectionsDoInit = std::vector<bool>(Collections::SIZE_OperatorType,true);
5025 
5026  // Figure out optimisation parameters if provided in
5027  // session file or default given
5028  Collections::CollectionOptimisation colOpt(m_session, ImpType);
5029  ImpType = colOpt.GetDefaultImplementationType();
5030 
5031  bool autotuning = colOpt.IsUsingAutotuning();
5032  bool verbose = (m_session->DefinesCmdLineArgument("verbose")) &&
5033  (m_comm->GetRank() == 0);
5034  int collmax = (colOpt.GetMaxCollectionSize() > 0
5035  ? colOpt.GetMaxCollectionSize()
5036  : 2*m_exp->size());
5037 
5038  // clear vectors in case previously called
5039  m_collections.clear();
5040  m_coll_coeff_offset.clear();
5041  m_coll_phys_offset.clear();
5042 
5043  // Loop over expansions, and create collections for each element type
5044  for (int i = 0; i < m_exp->size(); ++i)
5045  {
5046  collections[(*m_exp)[i]->DetShapeType()].push_back(
5047  std::pair<LocalRegions::ExpansionSharedPtr,int>((*m_exp)[i],i));
5048  }
5049 
5050  for (auto &it : collections)
5051  {
5052  LocalRegions::ExpansionSharedPtr exp = it.second[0].first;
5053 
5054  Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(exp);
5055  vector<StdRegions::StdExpansionSharedPtr> collExp;
5056 
5057  int prevCoeffOffset = m_coeff_offset[it.second[0].second];
5058  int prevPhysOffset = m_phys_offset [it.second[0].second];
5059  int collcnt;
5060 
5061  m_coll_coeff_offset.push_back(prevCoeffOffset);
5062  m_coll_phys_offset .push_back(prevPhysOffset);
5063 
5064  if(it.second.size() == 1) // single element case
5065  {
5066  collExp.push_back(it.second[0].first);
5067 
5068  // if no Imp Type provided and No
5069  // settign in xml file. reset
5070  // impTypes using timings
5071  if(autotuning)
5072  {
5073  impTypes = colOpt.SetWithTimings(collExp,
5074  impTypes, verbose);
5075  }
5076 
5077  Collections::Collection tmp(collExp, impTypes);
5078  m_collections.push_back(tmp);
5079  }
5080  else
5081  {
5082  // set up first geometry
5083  collExp.push_back(it.second[0].first);
5084  int prevnCoeff = it.second[0].first->GetNcoeffs();
5085  int prevnPhys = it.second[0].first->GetTotPoints();
5086  bool prevDeformed = it.second[0].first->GetMetricInfo()->GetGtype()
5088  collcnt = 1;
5089 
5090  for (int i = 1; i < it.second.size(); ++i)
5091  {
5092  int nCoeffs = it.second[i].first->GetNcoeffs();
5093  int nPhys = it.second[i].first->GetTotPoints();
5094  bool Deformed = it.second[i].first->GetMetricInfo()->GetGtype()
5096  int coeffOffset = m_coeff_offset[it.second[i].second];
5097  int physOffset = m_phys_offset [it.second[i].second];
5098 
5099  // check to see if next elmt is different or
5100  // collmax reached and if so end collection
5101  // and start new one
5102  if(prevCoeffOffset + nCoeffs != coeffOffset ||
5103  prevnCoeff != nCoeffs ||
5104  prevPhysOffset + nPhys != physOffset ||
5105  prevDeformed != Deformed ||
5106  prevnPhys != nPhys || collcnt >= collmax)
5107  {
5108 
5109  // if no Imp Type provided and No
5110  // settign in xml file. reset
5111  // impTypes using timings
5112  if(autotuning)
5113  {
5114  impTypes = colOpt.SetWithTimings(collExp,
5115  impTypes,
5116  verbose);
5117  }
5118 
5119  Collections::Collection tmp(collExp, impTypes);
5120  m_collections.push_back(tmp);
5121 
5122  // start new geom list
5123  collExp.clear();
5124 
5125  m_coll_coeff_offset.push_back(coeffOffset);
5126  m_coll_phys_offset .push_back(physOffset);
5127  collExp.push_back(it.second[i].first);
5128  collcnt = 1;
5129  }
5130  else // add to list of collections
5131  {
5132  collExp.push_back(it.second[i].first);
5133  collcnt++;
5134  }
5135 
5136  // if end of list finish up collection
5137  if (i == it.second.size() - 1)
5138  {
5139  // if no Imp Type provided and No
5140  // settign in xml file.
5141  if(autotuning)
5142  {
5143  impTypes = colOpt.SetWithTimings(collExp,
5144  impTypes,verbose);
5145  }
5146 
5147  Collections::Collection tmp(collExp, impTypes);
5148  m_collections.push_back(tmp);
5149 
5150  collExp.clear();
5151  collcnt = 0;
5152 
5153  }
5154 
5155  prevCoeffOffset = coeffOffset;
5156  prevPhysOffset = physOffset;
5157  prevDeformed = Deformed;
5158  prevnCoeff = nCoeffs;
5159  prevnPhys = nPhys;
5160  }
5161  }
5162  }
5163  }
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:108
@ eDeformed
Geometry is curved or has non-constant factors.

References Nektar::SpatialDomains::eDeformed, Nektar::Collections::CollectionOptimisation::GetDefaultImplementationType(), Nektar::Collections::CollectionOptimisation::GetMaxCollectionSize(), Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::CollectionOptimisation::IsUsingAutotuning(), m_coeff_offset, m_coll_coeff_offset, m_coll_phys_offset, m_collections, m_collectionsDoInit, m_comm, m_exp, m_phys_offset, m_session, Nektar::Collections::CollectionOptimisation::SetWithTimings(), and Nektar::Collections::SIZE_OperatorType.

Referenced by ExpList().

◆ CurlCurl()

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

Definition at line 2157 of file ExpList.h.

2160  {
2161  v_CurlCurl(Vel, Q);
2162  }
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
Definition: ExpList.cpp:1566

References v_CurlCurl().

◆ DealiasedDotProd()

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

Definition at line 2202 of file ExpList.h.

2206  {
2207  v_DealiasedDotProd(inarray1,inarray2,outarray);
2208  }
virtual void v_DealiasedDotProd(const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: ExpList.cpp:4475

References v_DealiasedDotProd().

◆ DealiasedProd()

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

Definition at line 2191 of file ExpList.h.

2195  {
2196  v_DealiasedProd(inarray1,inarray2,outarray);
2197  }
virtual void v_DealiasedProd(const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4466

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

1240  {
1241  Array<OneD,NekDouble> e_outarray;
1242 
1243  for (int i = 0; i < (*m_exp).size(); ++i)
1244  {
1245  (*m_exp)[i]->DivideByQuadratureMetric(
1246  inarray+m_phys_offset[i],
1247  e_outarray = outarray + m_phys_offset[i]);
1248  }
1249  }

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

1815  {
1816  unsigned int i;
1817  int returnval = 0;
1818 
1819  for(i= 0; i < (*m_exp).size(); ++i)
1820  {
1821  returnval = (std::max)(returnval,
1822  (*m_exp)[i]->EvalBasisNumModesMax());
1823  }
1824 
1825  return returnval;
1826  }

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

1833  {
1834  unsigned int i;
1835  Array<OneD,int> returnval((*m_exp).size(),0);
1836 
1837  for(i= 0; i < (*m_exp).size(); ++i)
1838  {
1839  returnval[i]
1840  = (std::max)(returnval[i],(*m_exp)[i]->EvalBasisNumModesMax());
1841  }
1842 
1843  return returnval;
1844  }

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

2662  {
2663  v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2664  }
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:4950

References v_EvaluateBoundaryConditions().

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

◆ ExponentialFilter()

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

Definition at line 1670 of file ExpList.cpp.

1675  {
1676  Array<OneD,NekDouble> e_array;
1677 
1678  for(int i = 0; i < (*m_exp).size(); ++i)
1679  {
1680  (*m_exp)[i]->ExponentialFilter(
1681  e_array = array+m_phys_offset[i],
1682  alpha,
1683  exponent,
1684  cutoff);
1685  }
1686  }

References m_phys_offset.

◆ ExtractCoeffsToCoeffs()

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

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

Definition at line 3444 of file ExpList.cpp.

3445  {
3446  v_ExtractCoeffsToCoeffs(fromExpList,fromCoeffs,toCoeffs);
3447  }
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:3546

References v_ExtractCoeffsToCoeffs().

◆ ExtractDataToCoeffs()

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

Extract the data in fielddata into the coeffs.

Definition at line 3435 of file ExpList.cpp.

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

References v_ExtractDataToCoeffs().

◆ ExtractElmtDataToCoeffs()

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

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

◆ ExtractElmtToBndPhys()

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

Definition at line 2722 of file ExpList.h.

2725  {
2726  v_ExtractElmtToBndPhys(i, elmt, boundary);
2727  }
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:4740

References v_ExtractElmtToBndPhys().

◆ ExtractFileBCs()

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

Definition at line 3207 of file ExpList.cpp.

3212  {
3213  string varString = fileName.substr(0, fileName.find_last_of("."));
3214  int j, k, len = varString.length();
3215  varString = varString.substr(len-1, len);
3216 
3217  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3218  std::vector<std::vector<NekDouble> > FieldData;
3219 
3220  std::string ft = LibUtilities::FieldIO::GetFileType(fileName, comm);
3222  .CreateInstance(ft, comm, m_session->GetSharedFilesystem());
3223 
3224  f->Import(fileName, FieldDef, FieldData);
3225 
3226  bool found = false;
3227  for (j = 0; j < FieldDef.size(); ++j)
3228  {
3229  for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3230  {
3231  if (FieldDef[j]->m_fields[k] == varName)
3232  {
3233  // Copy FieldData into locExpList
3234  locExpList->ExtractDataToCoeffs(
3235  FieldDef[j], FieldData[j],
3236  FieldDef[j]->m_fields[k],
3237  locExpList->UpdateCoeffs());
3238  found = true;
3239  }
3240  }
3241  }
3242 
3243  ASSERTL0(found, "Could not find variable '"+varName+
3244  "' in file boundary condition "+fileName);
3245  locExpList->BwdTrans_IterPerExp(
3246  locExpList->GetCoeffs(),
3247  locExpList->UpdatePhys());
3248  }
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:145
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:306
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
Definition: FieldIO.cpp:72

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

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

◆ ExtractPhysToBnd()

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

Definition at line 2736 of file ExpList.h.

2739  {
2740  v_ExtractPhysToBnd(i, phys, bnd);
2741  }
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
Definition: ExpList.cpp:4819

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

2732  {
2733  v_ExtractPhysToBndElmt(i, phys, bndElmt);
2734  }
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:4779

References v_ExtractPhysToBndElmt().

◆ ExtractTracePhys() [1/2]

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

Definition at line 2632 of file ExpList.h.

2633  {
2634  v_ExtractTracePhys(outarray);
2635  }
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4383

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

2641  {
2642  v_ExtractTracePhys(inarray,outarray);
2643  }

References v_ExtractTracePhys().

◆ FillBndCondFromField() [1/2]

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

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

Definition at line 2309 of file ExpList.h.

2310  {
2311  v_FillBndCondFromField(nreg);
2312  }
virtual void v_FillBndCondFromField()
Definition: ExpList.cpp:4559

References v_FillBndCondFromField().

◆ FillBndCondFromField() [2/2]

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

Fill Bnd Condition expansion from the values stored in expansion.

Definition at line 2304 of file ExpList.h.

2305  {
2307  }

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

2592  {
2593  v_FillBwdWithBoundCond(Fwd, Bwd, PutFwdInBwdOnBCs);
2594  }
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
Definition: ExpList.cpp:4315

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

2616  {
2617  v_FillBwdWithBwdWeight(weightave,weightjmp);
2618  }
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Definition: ExpList.cpp:4910

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

1979  {
1980  v_FwdTrans(inarray,outarray);
1981  }
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4614

References v_FwdTrans().

◆ FwdTrans_BndConstrained()

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

Definition at line 1996 of file ExpList.h.

1999  {
2000  v_FwdTrans_BndConstrained(inarray,outarray);
2001  }
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1745

References v_FwdTrans_BndConstrained().

◆ FwdTrans_IterPerExp()

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

1989  {
1990  v_FwdTrans_IterPerExp(inarray,outarray);
1991  }
virtual void v_FwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1735

References v_FwdTrans_IterPerExp().

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

1812  {
1813  int i,cnt1;
1814  int n_exp = 0;
1815  DNekScalMatSharedPtr loc_mat;
1816  DNekScalBlkMatSharedPtr BlkMatrix;
1817  map<int,int> elmt_id;
1818  LibUtilities::ShapeType ShapeType = gkey.GetShapeType();
1819 
1821  {
1822  for(i = 0 ; i < (*m_exp).size(); ++i)
1823  {
1824  if((*m_exp)[i]->DetShapeType()
1825  == ShapeType)
1826  {
1827  elmt_id[n_exp++] = i;
1828  }
1829  }
1830  }
1831  else
1832  {
1833  n_exp = (*m_exp).size();
1834  for(i = 0; i < n_exp; ++i)
1835  {
1836  elmt_id[i] = i;
1837  }
1838  }
1839 
1840  Array<OneD,unsigned int> nrows(n_exp);
1841  Array<OneD,unsigned int> ncols(n_exp);
1842 
1843  switch(gkey.GetMatrixType())
1844  {
1845  case StdRegions::eBwdTrans:
1846  {
1847  // set up an array of integers for block matrix construction
1848  for(i = 0; i < n_exp; ++i)
1849  {
1850  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1851  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1852  }
1853  }
1854  break;
1856  {
1857  // set up an array of integers for block matrix construction
1858  for(i = 0; i < n_exp; ++i)
1859  {
1860  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1861  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1862  }
1863  }
1864  break;
1865  case StdRegions::eMass:
1866  case StdRegions::eInvMass:
1870  {
1871  // set up an array of integers for block matrix construction
1872  for(i = 0; i < n_exp; ++i)
1873  {
1874  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1875  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1876  }
1877  }
1878  break;
1879 
1881  {
1882  // set up an array of integers for block matrix construction
1883  for(i = 0; i < n_exp; ++i)
1884  {
1885  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1886  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1887  }
1888  }
1889  break;
1890 
1892  {
1893  // set up an array of integers for block matrix construction
1894  for(i = 0; i < n_exp; ++i)
1895  {
1896  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1897  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1898  }
1899  }
1900  break;
1901 
1902  default:
1903  {
1905  "Global Matrix creation not defined for this "
1906  "type of matrix");
1907  }
1908  }
1909 
1910  MatrixStorage blkmatStorage = eDIAGONAL;
1911  BlkMatrix = MemoryManager<DNekScalBlkMat>
1912  ::AllocateSharedPtr(nrows,ncols,blkmatStorage);
1913 
1914  int nvarcoeffs = gkey.GetNVarCoeffs();
1915  int eid;
1916  Array<OneD, NekDouble> varcoeffs_wk;
1917 
1918  for(i = cnt1 = 0; i < n_exp; ++i)
1919  {
1920  // need to be initialised with zero size for non
1921  // variable coefficient case
1922  StdRegions::VarCoeffMap varcoeffs;
1923 
1924  eid = elmt_id[i];
1925  if(nvarcoeffs>0)
1926  {
1927  for (auto &x : gkey.GetVarCoeffs())
1928  {
1929  varcoeffs[x.first] = x.second + m_phys_offset[eid];
1930  }
1931  }
1932 
1933  LocalRegions::MatrixKey matkey(gkey.GetMatrixType(),
1934  (*m_exp)[eid]->DetShapeType(),
1935  *(*m_exp)[eid],
1936  gkey.GetConstFactors(),
1937  varcoeffs );
1938 
1939  loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[elmt_id.find(i)->second])->GetLocMatrix(matkey);
1940  BlkMatrix->SetBlock(i,i,loc_mat);
1941  }
1942 
1943  return BlkMatrix;
1944  }
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73

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

Referenced by GetBlockMatrix().

◆ GeneralGetFieldDefinitions()

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

Definition at line 3286 of file ExpList.cpp.

3294  {
3295  int startenum = (int) LibUtilities::eSegment;
3296  int endenum = (int) LibUtilities::eHexahedron;
3297  int s = 0;
3299 
3300  ASSERTL1(NumHomoDir == HomoBasis.size(),"Homogeneous basis is not the same length as NumHomoDir");
3301  ASSERTL1(NumHomoDir == HomoLen.size(),"Homogeneous length vector is not the same length as NumHomDir");
3302 
3303  // count number of shapes
3304  switch((*m_exp)[0]->GetShapeDimension())
3305  {
3306  case 1:
3307  startenum = (int) LibUtilities::eSegment;
3308  endenum = (int) LibUtilities::eSegment;
3309  break;
3310  case 2:
3311  startenum = (int) LibUtilities::eTriangle;
3312  endenum = (int) LibUtilities::eQuadrilateral;
3313  break;
3314  case 3:
3315  startenum = (int) LibUtilities::eTetrahedron;
3316  endenum = (int) LibUtilities::eHexahedron;
3317  break;
3318  }
3319 
3320  for(s = startenum; s <= endenum; ++s)
3321  {
3322  std::vector<unsigned int> elementIDs;
3323  std::vector<LibUtilities::BasisType> basis;
3324  std::vector<unsigned int> numModes;
3325  std::vector<std::string> fields;
3326 
3327  bool first = true;
3328  bool UniOrder = true;
3329  int n;
3330 
3331  shape = (LibUtilities::ShapeType) s;
3332 
3333  for(int i = 0; i < (*m_exp).size(); ++i)
3334  {
3335  if((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
3336  {
3337  elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
3338  if(first)
3339  {
3340  for(int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3341  {
3342  basis.push_back((*m_exp)[i]->GetBasis(j)->GetBasisType());
3343  numModes.push_back((*m_exp)[i]->GetBasis(j)->GetNumModes());
3344  }
3345 
3346  // add homogeneous direction details if defined
3347  for(n = 0 ; n < NumHomoDir; ++n)
3348  {
3349  basis.push_back(HomoBasis[n]->GetBasisType());
3350  numModes.push_back(HomoBasis[n]->GetNumModes());
3351  }
3352 
3353  first = false;
3354  }
3355  else
3356  {
3357  ASSERTL0((*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],"Routine is not set up for multiple bases definitions");
3358 
3359  for(int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3360  {
3361  numModes.push_back((*m_exp)[i]->GetBasis(j)->GetNumModes());
3362  if(numModes[j] != (*m_exp)[i]->GetBasis(j)->GetNumModes())
3363  {
3364  UniOrder = false;
3365  }
3366  }
3367  // add homogeneous direction details if defined
3368  for(n = 0 ; n < NumHomoDir; ++n)
3369  {
3370  numModes.push_back(HomoBasis[n]->GetNumModes());
3371  }
3372  }
3373  }
3374  }
3375 
3376 
3377  if(elementIDs.size() > 0)
3378  {
3381  AllocateSharedPtr(shape, elementIDs, basis,
3382  UniOrder, numModes,fields,
3383  NumHomoDir, HomoLen, homoStrips,
3384  HomoSIDs, HomoZIDs, HomoYIDs);
3385  fielddef.push_back(fdef);
3386  }
3387  }
3388  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
Definition: ExpList.h:2255
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:179

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

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

2699  {
2700  v_GeneralMatrixOp(gkey,inarray,outarray);
2701  }
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4644

References v_GeneralMatrixOp().

◆ GeneralMatrixOp_IterPerExp()

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

Definition at line 1961 of file ExpList.cpp.

1965  {
1966  int nvarcoeffs = gkey.GetNVarCoeffs();
1967 
1968  if((nvarcoeffs == 0)&&(gkey.GetMatrixType() == StdRegions::eHelmholtz))
1969  {
1970  // initialise if required
1972  {
1973  for (int i = 0; i < m_collections.size(); ++i)
1974  {
1975  m_collections[i].Initialise(Collections::eHelmholtz, gkey.GetConstFactors());
1976  }
1978  }
1979  else
1980  {
1981  for (int i = 0; i < m_collections.size(); ++i)
1982  {
1983  m_collections[i].CheckFactors(Collections::eHelmholtz, gkey.GetConstFactors(),
1984  m_coll_phys_offset[i]);
1985  }
1986  }
1987 
1988  Array<OneD, NekDouble> tmp;
1989  for (int i = 0; i < m_collections.size(); ++i)
1990  {
1991  m_collections[i].ApplyOperator
1993  inarray + m_coll_coeff_offset[i],
1994  tmp = outarray + m_coll_coeff_offset[i]);
1995  }
1996  }
1997  else
1998  {
1999  Array<OneD,NekDouble> tmp_outarray;
2000  for(int i= 0; i < (*m_exp).size(); ++i)
2001  {
2002  // need to be initialised with zero size for non
2003  // variable coefficient case
2004  StdRegions::VarCoeffMap varcoeffs;
2005 
2006  if(nvarcoeffs>0)
2007  {
2008  for (auto &x : gkey.GetVarCoeffs())
2009  {
2010  varcoeffs[x.first] = x.second + m_phys_offset[i];
2011  }
2012  }
2013 
2014  StdRegions::StdMatrixKey mkey(gkey.GetMatrixType(),
2015  (*m_exp)[i]->DetShapeType(),
2016  *((*m_exp)[i]),
2017  gkey.GetConstFactors(),varcoeffs);
2018 
2019  (*m_exp)[i]->GeneralMatrixOp(inarray + m_coeff_offset[i],
2020  tmp_outarray = outarray+
2021  m_coeff_offset[i],
2022  mkey);
2023  }
2024  }
2025  }

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

Referenced by Nektar::MultiRegions::ContField::v_GeneralMatrixOp(), and v_GeneralMatrixOp().

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

3643  {
3644  int npoints_e;
3645  NekDouble coeff;
3646 
3647  Array<OneD, NekDouble> outarray_e;
3648 
3649  for(int i = 0 ; i < (*m_exp).size(); ++i)
3650  {
3651  npoints_e = (*m_exp)[i]->GetTotPoints();
3652 
3653  if(i <= ElementID)
3654  {
3655  coeff = scalar1;
3656  }
3657  else
3658  {
3659  coeff = scalar2;
3660  }
3661 
3662  outarray_e = Array<OneD, NekDouble>(npoints_e, coeff);
3663  Vmath::Vcopy(npoints_e, &outarray_e[0], 1,
3664  &outarray[m_phys_offset[i]], 1);
3665  }
3666  }

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

2332  {
2333  std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2334  const map<int,RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
2335 
2336  MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2337 
2338  if (vType >= eSIZE_GlobalSysSolnType)
2339  {
2340  NEKERROR(ErrorUtil::efatal,"Matrix solution type not defined");
2341  }
2342  std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2343 
2344  return GetGlobalLinSysFactory().CreateInstance(vSolnType,mkey,
2345  vExpList,locToGloMap);
2346  }
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:1129
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:1048
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 2310 of file ExpList.cpp.

2313  {
2314  GlobalLinSysSharedPtr returnlinsys;
2315  std::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
2316 
2317  MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
2318 
2319  if (vType >= eSIZE_GlobalSysSolnType)
2320  {
2321  NEKERROR(ErrorUtil::efatal,"Matrix solution type not defined");
2322  }
2323  std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
2324 
2325  return GetGlobalLinSysFactory().CreateInstance( vSolnType, mkey,
2326  vExpList, locToGloMap);
2327  }
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:50

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

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

◆ GenGlobalMatrix()

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

Generates a global matrix from the given key and map.

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

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

Definition at line 2034 of file ExpList.cpp.

2037  {
2038  int i,j,n,gid1,gid2,cntdim1,cntdim2;
2039  NekDouble sign1,sign2;
2040  DNekScalMatSharedPtr loc_mat;
2041 
2042  unsigned int glob_rows = 0;
2043  unsigned int glob_cols = 0;
2044  unsigned int loc_rows = 0;
2045  unsigned int loc_cols = 0;
2046 
2047  bool assembleFirstDim = false;
2048  bool assembleSecondDim = false;
2049 
2050  switch(mkey.GetMatrixType())
2051  {
2052  case StdRegions::eBwdTrans:
2053  {
2054  glob_rows = m_npoints;
2055  glob_cols = locToGloMap->GetNumGlobalCoeffs();
2056 
2057  assembleFirstDim = false;
2058  assembleSecondDim = true;
2059  }
2060  break;
2062  {
2063  glob_rows = locToGloMap->GetNumGlobalCoeffs();
2064  glob_cols = m_npoints;
2065 
2066  assembleFirstDim = true;
2067  assembleSecondDim = false;
2068  }
2069  break;
2070  case StdRegions::eMass:
2074  {
2075  glob_rows = locToGloMap->GetNumGlobalCoeffs();
2076  glob_cols = locToGloMap->GetNumGlobalCoeffs();
2077 
2078  assembleFirstDim = true;
2079  assembleSecondDim = true;
2080  }
2081  break;
2082  default:
2083  {
2085  "Global Matrix creation not defined for this "
2086  "type of matrix");
2087  }
2088  }
2089 
2090  COOMatType spcoomat;
2091  CoordType coord;
2092 
2093  int nvarcoeffs = mkey.GetNVarCoeffs();
2094  int eid;
2095 
2096  // fill global matrix
2097  for(n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2098  {
2099  // need to be initialised with zero size for non variable coefficient case
2100  StdRegions::VarCoeffMap varcoeffs;
2101 
2102  eid = n;
2103  if(nvarcoeffs>0)
2104  {
2105  for (auto &x : mkey.GetVarCoeffs())
2106  {
2107  varcoeffs[x.first] = x.second + m_phys_offset[eid];
2108  }
2109  }
2110 
2111  LocalRegions::MatrixKey matkey(mkey.GetMatrixType(),
2112  (*m_exp)[eid]->DetShapeType(),
2113  *((*m_exp)[eid]),
2114  mkey.GetConstFactors(),varcoeffs);
2115 
2116  loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])->GetLocMatrix(matkey);
2117 
2118  loc_rows = loc_mat->GetRows();
2119  loc_cols = loc_mat->GetColumns();
2120 
2121  for(i = 0; i < loc_rows; ++i)
2122  {
2123  if(assembleFirstDim)
2124  {
2125  gid1 = locToGloMap->GetLocalToGlobalMap (cntdim1 + i);
2126  sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2127  }
2128  else
2129  {
2130  gid1 = cntdim1 + i;
2131  sign1 = 1.0;
2132  }
2133 
2134  for(j = 0; j < loc_cols; ++j)
2135  {
2136  if(assembleSecondDim)
2137  {
2138  gid2 = locToGloMap
2139  ->GetLocalToGlobalMap(cntdim2 + j);
2140  sign2 = locToGloMap
2141  ->GetLocalToGlobalSign(cntdim2 + j);
2142  }
2143  else
2144  {
2145  gid2 = cntdim2 + j;
2146  sign2 = 1.0;
2147  }
2148 
2149  // sparse matrix fill
2150  coord = make_pair(gid1,gid2);
2151  if( spcoomat.count(coord) == 0 )
2152  {
2153  spcoomat[coord] = sign1*sign2*(*loc_mat)(i,j);
2154  }
2155  else
2156  {
2157  spcoomat[coord] += sign1*sign2*(*loc_mat)(i,j);
2158  }
2159  }
2160  }
2161  cntdim1 += loc_rows;
2162  cntdim2 += loc_cols;
2163  }
2164 
2166  ::AllocateSharedPtr(m_session,glob_rows,glob_cols,spcoomat);
2167  }
std::pair< IndexType, IndexType > CoordType
std::map< CoordType, NekDouble > COOMatType

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

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

◆ GenGlobalMatrixFull()

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

Definition at line 2170 of file ExpList.cpp.

2171  {
2172  int i,j,n,gid1,gid2,loc_lda,eid;
2173  NekDouble sign1,sign2,value;
2174  DNekScalMatSharedPtr loc_mat;
2175 
2176  int totDofs = locToGloMap->GetNumGlobalCoeffs();
2177  int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2178 
2179  unsigned int rows = totDofs - NumDirBCs;
2180  unsigned int cols = totDofs - NumDirBCs;
2181  NekDouble zero = 0.0;
2182 
2183  DNekMatSharedPtr Gmat;
2184  int bwidth = locToGloMap->GetFullSystemBandWidth();
2185 
2186  int nvarcoeffs = mkey.GetNVarCoeffs();
2187  MatrixStorage matStorage;
2188 
2189  map<int, RobinBCInfoSharedPtr> RobinBCInfo = GetRobinBCInfo();
2190 
2191  switch(mkey.GetMatrixType())
2192  {
2193  // case for all symmetric matices
2196  if( (2*(bwidth+1)) < rows)
2197  {
2199  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows,cols,zero,matStorage,bwidth,bwidth);
2200  }
2201  else
2202  {
2203  matStorage = ePOSITIVE_DEFINITE_SYMMETRIC;
2204  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows,cols,zero,matStorage);
2205  }
2206 
2207  break;
2208  default: // Assume general matrix - currently only set up for full invert
2209  {
2210  matStorage = eFULL;
2211  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows,cols,zero,matStorage);
2212  }
2213  }
2214 
2215  // fill global symmetric matrix
2216  for(n = 0; n < (*m_exp).size(); ++n)
2217  {
2218  // need to be initialised with zero size for non variable coefficient case
2219  StdRegions::VarCoeffMap varcoeffs;
2220 
2221  eid = n;
2222  if(nvarcoeffs>0)
2223  {
2224  for (auto &x : mkey.GetVarCoeffs())
2225  {
2226  varcoeffs[x.first] = x.second + m_phys_offset[eid];
2227  }
2228  }
2229 
2230  LocalRegions::MatrixKey matkey(mkey.GetMatrixType(),
2231  (*m_exp)[eid]->DetShapeType(),
2232  *((*m_exp)[eid]),
2233  mkey.GetConstFactors(),varcoeffs);
2234 
2235  loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])->GetLocMatrix(matkey);
2236 
2237 
2238  if(RobinBCInfo.count(n) != 0) // add robin mass matrix
2239  {
2241 
2242  // declare local matrix from scaled matrix.
2243  int rows = loc_mat->GetRows();
2244  int cols = loc_mat->GetColumns();
2245  const NekDouble *dat = loc_mat->GetRawPtr();
2247  Blas::Dscal(rows*cols,loc_mat->Scale(),new_mat->GetRawPtr(),1);
2248 
2249  // add local matrix contribution
2250  for(rBC = RobinBCInfo.find(n)->second;rBC; rBC = rBC->next)
2251  {
2252  (*m_exp)[n]->AddRobinMassMatrix(rBC->m_robinID,rBC->m_robinPrimitiveCoeffs,new_mat);
2253  }
2254 
2255  NekDouble one = 1.0;
2256  // redeclare loc_mat to point to new_mat plus the scalar.
2257  loc_mat = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,new_mat);
2258  }
2259 
2260  loc_lda = loc_mat->GetColumns();
2261 
2262  for(i = 0; i < loc_lda; ++i)
2263  {
2264  gid1 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + i) - NumDirBCs;
2265  sign1 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + i);
2266  if(gid1 >= 0)
2267  {
2268  for(j = 0; j < loc_lda; ++j)
2269  {
2270  gid2 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + j) - NumDirBCs;
2271  sign2 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + j);
2272  if(gid2 >= 0)
2273  {
2274  // When global matrix is symmetric,
2275  // only add the value for the upper
2276  // triangular part in order to avoid
2277  // entries to be entered twice
2278  if((matStorage == eFULL)||(gid2 >= gid1))
2279  {
2280  value = Gmat->GetValue(gid1,gid2) + sign1*sign2*(*loc_mat)(i,j);
2281  Gmat->SetValue(gid1,gid2,value);
2282  }
2283  }
2284  }
2285  }
2286  }
2287  }
2288 
2289  return Gmat;
2290  }
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:182
std::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC

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

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

◆ Get1DScaledTotPoints()

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

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

Definition at line 1861 of file ExpList.h.

1862  {
1863  int returnval = 0;
1864  int cnt;
1865  int nbase = (*m_exp)[0]->GetNumBases();
1866 
1867  for(int i = 0; i < (*m_exp).size(); ++i)
1868  {
1869  cnt = 1;
1870  for(int j = 0; j < nbase; ++j)
1871  {
1872  cnt *= (int)(scale*((*m_exp)[i]->GetNumPoints(j)));
1873  }
1874  returnval += cnt;
1875  }
1876  return returnval;
1877  }

References m_exp.

◆ GetBCValues()

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

Definition at line 2213 of file ExpList.h.

2217  {
2218  v_GetBCValues(BndVals,TotField,BndID);
2219  }
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:4485

References v_GetBCValues().

◆ GetBlockMatrix()

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

Definition at line 1946 of file ExpList.cpp.

1948  {
1949  auto matrixIter = m_blockMat->find(gkey);
1950 
1951  if(matrixIter == m_blockMat->end())
1952  {
1953  return ((*m_blockMat)[gkey] = GenBlockMatrix(gkey));
1954  }
1955  else
1956  {
1957  return matrixIter->second;
1958  }
1959  }
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:1810

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

2491  {
2492  return v_GetBndCondBwdWeight();
2493  }
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
Definition: ExpList.cpp:4357

References v_GetBndCondBwdWeight().

◆ GetBndCondExpansions()

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

Definition at line 2470 of file ExpList.h.

2471  {
2472  return v_GetBndCondExpansions();
2473  }
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:3669

References v_GetBndCondExpansions().

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

◆ GetBndConditions()

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

Definition at line 2646 of file ExpList.h.

2647  {
2648  return v_GetBndConditions();
2649  }
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:4929

References v_GetBndConditions().

◆ GetBndElmtExpansion()

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

Definition at line 2715 of file ExpList.h.

2718  {
2719  v_GetBndElmtExpansion(i, result, DeclareCoeffPhysArrays);
2720  }
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
Definition: ExpList.cpp:4729

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

4987  {
4988  auto collectionIter = collection.find(regionId);
4989  ASSERTL1(collectionIter != collection.end(),
4990  "Unable to locate collection " +
4991  boost::lexical_cast<string>(regionId));
4992 
4994  = (*collectionIter).second;
4995  auto conditionMapIter = bndCondMap->find(variable);
4996  ASSERTL1(conditionMapIter != bndCondMap->end(),
4997  "Unable to locate condition map.");
4998 
4999  const SpatialDomains::BoundaryConditionShPtr boundaryCondition
5000  = (*conditionMapIter).second;
5001 
5002  return boundaryCondition;
5003  }
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
Definition: Conditions.h:225

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

2745  {
2746  v_GetBoundaryNormals(i, normals);
2747  }
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:4857

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

3575  {
3576  size_t nTracePts = weightAver.size();
3577  // average for interior traces
3578  for(int i = 0; i < nTracePts; ++i)
3579  {
3580  weightAver[i] = 0.5;
3581  weightJump[i] = 1.0;
3582  }
3583  FillBwdWithBwdWeight(weightAver, weightJump);
3584  }
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
Definition: ExpList.h:2613

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

2371  {
2372  return m_coeffs[i];
2373  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1252

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

2294  {
2295  return m_coeffs;
2296  }

References m_coeffs.

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

◆ GetCoeffs() [2/2]

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

Get the i th value (coefficient) of m_coeffs.

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

Definition at line 2379 of file ExpList.h.

2380  {
2381  return m_coeffs[i];
2382  }

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

2479  {
2480  return m_coeffsToElmt;
2481  }
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
Definition: ExpList.h:1310

References m_coeffsToElmt.

Referenced by Nektar::MultiRegions::LocTraceToTraceMap::TraceLocToElmtLocCoeffMap().

◆ GetComm()

std::shared_ptr<LibUtilities::Comm> Nektar::MultiRegions::ExpList::GetComm ( )
inline

Returns the comm object.

Definition at line 1141 of file ExpList.h.

1142  {
1143  return m_comm;
1144  }

References m_comm.

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

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

References ASSERTL2, and m_exp.

Referenced by Nektar::MultiRegions::ExpList2DHomogeneous1D::GetCoords(), GetExpIndex(), IProductWRTDerivBase(), PhysEvaluate(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetBoundaryNormals(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetCoords(), v_GetCoords(), v_GetNormals(), Nektar::MultiRegions::ExpList2DHomogeneous1D::v_GetNormals(), v_NormVectorIProductWRTBase(), v_Upwind(), v_WriteTecplotZone(), Nektar::MultiRegions::ExpList1DHomogeneous2D::v_WriteTecplotZone(), and Nektar::MultiRegions::ExpList2DHomogeneous1D::v_WriteTecplotZone().

◆ GetCoords()

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

2093  {
2094  v_GetCoords(coord_0,coord_1,coord_2);
2095  }
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:4663

References v_GetCoords().

Referenced by v_WriteTecplotZone().

◆ GetDiagMatIpwrtBase()

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

Definition at line 5405 of file ExpList.cpp.

5408  {
5409  LibUtilities::ShapeType ElmtTypePrevious =
5411  int nElmtPntPrevious = 0;
5412  int nElmtCoefPrevious = 0;
5413  int nTotElmt = (*m_exp).size();
5414  int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5415  int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5416 
5417  Array<OneD, NekDouble> tmpPhys;
5418  Array<OneD, NekDouble > clmnArray,clmnStdMatArray;
5419  Array<OneD, NekDouble > stdMat_data;
5420 
5421  for(int nelmt = 0; nelmt < nTotElmt; nelmt++)
5422  {
5423  nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5424  nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5425  LibUtilities::ShapeType ElmtTypeNow =
5426  (*m_exp)[nelmt]->DetShapeType();
5427 
5428  if (nElmtPntPrevious!=nElmtPnt||nElmtCoefPrevious!=nElmtCoef||
5429  (ElmtTypeNow!=ElmtTypePrevious))
5430  {
5432  stdExp = (*m_exp)[nelmt]->GetStdExp();
5433  StdRegions::StdMatrixKey matkey(StdRegions::eBwdMat,
5434  stdExp->DetShapeType(), *stdExp);
5435 
5436  DNekMatSharedPtr BwdMat = stdExp->GetStdMatrix(matkey);
5437  stdMat_data = BwdMat->GetPtr();
5438 
5439  if (nElmtPntPrevious!=nElmtPnt)
5440  {
5441  tmpPhys = Array<OneD, NekDouble>(nElmtPnt,0.0);
5442  }
5443 
5444  ElmtTypePrevious = ElmtTypeNow;
5445  nElmtPntPrevious = nElmtPnt;
5446  nElmtCoefPrevious = nElmtCoef;
5447  }
5448 
5449  (*m_exp)[nelmt]->MultiplyByQuadratureMetric(inarray[nelmt],
5450  tmpPhys); // weight with metric
5451 
5452  Array<OneD, NekDouble> MatDataArray =
5453  mtxPerVar[nelmt]->GetPtr();
5454 
5455  for(int np=0;np<nElmtPnt;np++)
5456  {
5457  NekDouble factor = tmpPhys[np];
5458  clmnArray = MatDataArray + np*nElmtCoef;
5459  clmnStdMatArray = stdMat_data + np*nElmtCoef;
5460  Vmath::Smul(nElmtCoef,factor,clmnStdMatArray,1,clmnArray,1);
5461  }
5462  }
5463  }
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:225

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

4119  {
4120  int e_npoints;
4121 
4122  Array<OneD, NekDouble> locLeng;
4123  Array<OneD, NekDouble> lengintp;
4124  Array<OneD, NekDouble> lengAdd;
4125  Array<OneD, int > LRbndnumbs(2);
4126  Array<OneD, Array<OneD,NekDouble> > lengLR(2);
4127  lengLR[0] = lengthsFwd;
4128  lengLR[1] = lengthsBwd;
4129  Array<OneD, LocalRegions::ExpansionSharedPtr> LRelmts(2);
4132  int e_npoints0 = -1;
4133  if(m_expType == e1D)
4134  {
4135  for (int i = 0; i < m_exp->size(); ++i)
4136  {
4137  loc_exp = (*m_exp)[i];
4138  int offset = m_phys_offset[i];
4139 
4140  int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4141  e_npoints = (*m_exp)[i]->GetNumPoints(0);
4142  if ( e_npoints0 < e_npoints)
4143  {
4144  lengintp = Array<OneD, NekDouble>{size_t(e_npoints),0.0};
4145  e_npoints0 = e_npoints;
4146  }
4147 
4148  LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4149  LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4150 
4151  LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4152  LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4153  for (int nlr = 0; nlr < 2; ++nlr)
4154  {
4155  Vmath::Zero(e_npoints0, lengintp, 1);
4156  lengAdd = lengintp;
4157  int bndNumber = LRbndnumbs[nlr];
4158  loc_elmt = LRelmts[nlr];
4159  if (bndNumber >= 0)
4160  {
4161  locLeng = loc_elmt->GetElmtBndNormDirElmtLen(
4162  bndNumber);
4163  lengAdd = locLeng;
4164 
4165  int loc_nmodes = loc_elmt->GetBasis(0)->
4166  GetNumModes();
4167  if (e_nmodes != loc_nmodes)
4168  {
4169  // Parallel case: need to interpolate.
4170  LibUtilities::PointsKey to_key =
4171  loc_exp->GetBasis(0)->GetPointsKey();
4172  LibUtilities::PointsKey from_key =
4173  loc_elmt->GetBasis(0)->GetPointsKey();
4174  LibUtilities::Interp1D(from_key, locLeng,
4175  to_key, lengintp);
4176  lengAdd = lengintp;
4177  }
4178  }
4179  for (int j = 0; j < e_npoints; ++j)
4180  {
4181  lengLR[nlr][offset + j] = lengAdd[j];
4182  }
4183  }
4184  }
4185  }
4186  else if (m_expType == e2D)
4187  {
4188  for (int i = 0; i < m_exp->size(); ++i)
4189  {
4190  loc_exp = (*m_exp)[i];
4191  int offset = m_phys_offset[i];
4192 
4193  LibUtilities::BasisKey traceBasis0
4194  = loc_exp->GetBasis(0)->GetBasisKey();
4195  LibUtilities::BasisKey traceBasis1
4196  = loc_exp->GetBasis(1)->GetBasisKey();
4197  const int TraceNq0 = traceBasis0.GetNumPoints();
4198  const int TraceNq1 = traceBasis1.GetNumPoints();
4199  e_npoints = TraceNq0*TraceNq1;
4200  if (e_npoints0 < e_npoints)
4201  {
4202  lengintp = Array<OneD,NekDouble>{size_t(e_npoints),
4203  0.0};
4204  e_npoints0 = e_npoints;
4205  }
4206 
4207  LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4208  LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4209 
4210  LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4211  LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4212  for (int nlr = 0; nlr < 2; ++nlr)
4213  {
4214  Vmath::Zero(e_npoints0, lengintp, 1);
4215  int bndNumber = LRbndnumbs[nlr];
4216  loc_elmt = LRelmts[nlr];
4217  if (bndNumber >= 0)
4218  {
4219  locLeng = loc_elmt->GetElmtBndNormDirElmtLen(
4220  bndNumber);
4221  // Project normals from 3D element onto the
4222  // same orientation as the trace expansion.
4223  StdRegions::Orientation orient = loc_elmt->
4224  GetTraceOrient(bndNumber);
4225 
4226  int fromid0,fromid1;
4228  {
4229  fromid0 = 0;
4230  fromid1 = 1;
4231  }
4232  else
4233  {
4234  fromid0 = 1;
4235  fromid1 = 0;
4236  }
4237 
4238  LibUtilities::BasisKey faceBasis0
4239  = loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4240  LibUtilities::BasisKey faceBasis1
4241  = loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4242  const int faceNq0 = faceBasis0.GetNumPoints();
4243  const int faceNq1 = faceBasis1.GetNumPoints();
4244  Array<OneD, NekDouble> alignedLeng(faceNq0*faceNq1);
4245 
4246  AlignFace(orient, faceNq0, faceNq1,
4247  locLeng, alignedLeng);
4248  LibUtilities::Interp2D(faceBasis0.GetPointsKey(),
4249  faceBasis1.GetPointsKey(),
4250  alignedLeng,
4251  traceBasis0.GetPointsKey(),
4252  traceBasis1.GetPointsKey(),
4253  lengintp);
4254  }
4255  for (int j = 0; j < e_npoints; ++j)
4256  {
4257  lengLR[nlr][offset + j] = lengintp[j];
4258  }
4259  }
4260  }
4261  }
4262  }
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:53
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:115
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:3821

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

◆ GetExp() [1/3]

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

This function returns the vector of elements in the expansion.

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

Definition at line 2422 of file ExpList.h.

2423  {
2424  return m_exp;
2425  }

References m_exp.

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

◆ GetExp() [2/3]

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

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

Definition at line 2406 of file ExpList.cpp.

2408  {
2409  return GetExp(GetExpIndex(gloCoord));
2410  }
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:2418

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

2414  {
2415  return (*m_exp)[n];
2416  }

References m_exp.

◆ GetExpIndex() [1/2]

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

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

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

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

Definition at line 2418 of file ExpList.cpp.

2424  {
2425  Array<OneD, NekDouble> Lcoords(gloCoord.size());
2426 
2427  return GetExpIndex(gloCoord,Lcoords,tol,returnNearestElmt,cachedId,maxDistance);
2428  }

Referenced by GetExp(), and PhysEvaluate().

◆ GetExpIndex() [2/2]

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

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

Definition at line 2431 of file ExpList.cpp.

2438  {
2439  if (GetNumElmts() == 0)
2440  {
2441  return -1;
2442  }
2443 
2444  if (m_elmtToExpId.size() == 0)
2445  {
2446  // Loop in reverse order so that in case where using a
2447  // Homogeneous expansion it sets geometry ids to first part of
2448  // m_exp list. Otherwise will set to second (complex) expansion
2449  for(int i = (*m_exp).size()-1; i >= 0; --i)
2450  {
2451  m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2452  }
2453  }
2454 
2455  NekDouble nearpt = 1e6;
2456  NekDouble nearpt_min = 1e6;
2457  int min_id = -1;
2458  Array<OneD, NekDouble> savLocCoords(locCoords.size());
2459 
2460  if(cachedId >= 0 && cachedId < (*m_exp).size())
2461  {
2462  nearpt = 1e12;
2463  if((*m_exp)[cachedId]->GetGeom()->MinMaxCheck(gloCoords) &&
2464  (*m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords,
2465  locCoords, tol, nearpt))
2466  {
2467  return cachedId;
2468  }
2469  else if(returnNearestElmt && (nearpt < nearpt_min))
2470  {
2471  // If it does not lie within, keep track of which element
2472  // is nearest.
2473  min_id = cachedId;
2474  nearpt_min = nearpt;
2475  Vmath::Vcopy(locCoords.size(),locCoords, 1, savLocCoords, 1);
2476  }
2477  }
2478 
2479  NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2480  NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2481  NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2484  GetExp(0)->GetCoordim(), -1, x, y, z);
2485 
2486  // Get the list of elements whose bounding box contains the desired
2487  // point.
2488  std::vector<int> elmts = m_graph->GetElementsContainingPoint(p);
2489 
2490  // Check each element in turn to see if point lies within it.
2491  for (int i = 0; i < elmts.size(); ++i)
2492  {
2493  int id = m_elmtToExpId[elmts[i]];
2494  if(id == cachedId)
2495  {
2496  continue;
2497  }
2498  if ((*m_exp)[id]->GetGeom()->ContainsPoint(gloCoords,
2499  locCoords, tol, nearpt))
2500  {
2501  return id;
2502  }
2503  else if(returnNearestElmt && (nearpt < nearpt_min))
2504  {
2505  // If it does not lie within, keep track of which element
2506  // is nearest.
2507  min_id = id;
2508  nearpt_min = nearpt;
2509  Vmath::Vcopy(locCoords.size(),locCoords, 1, savLocCoords, 1);
2510  }
2511  }
2512 
2513  // If the calling function is with just the nearest element, return
2514  // that. Otherwise return -1 to indicate no matching elemenet found.
2515  if(returnNearestElmt && nearpt_min <= maxDistance)
2516  {
2517 
2518  std::string msg = "Failed to find point within element to "
2519  "tolerance of "
2520  + boost::lexical_cast<std::string>(tol)
2521  + " using local point ("
2522  + boost::lexical_cast<std::string>(locCoords[0]) +","
2523  + boost::lexical_cast<std::string>(locCoords[1]) +","
2524  + boost::lexical_cast<std::string>(locCoords[1])
2525  + ") in element: "
2526  + boost::lexical_cast<std::string>(min_id);
2527  WARNINGL1(false,msg.c_str());
2528 
2529  Vmath::Vcopy(locCoords.size(),savLocCoords, 1, locCoords, 1);
2530  return min_id;
2531  }
2532  else
2533  {
2534  return -1;
2535  }
2536  }
int GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:743
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
Definition: ExpList.h:1321
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:2244

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

◆ GetExpSize()

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

◆ GetExpType()

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

Returns the type of the expansion.

Definition at line 1182 of file ExpList.cpp.

1183  {
1184  return m_expType;
1185  }

References m_expType.

Referenced by v_CurlCurl().

◆ GetFieldDefinitions() [1/2]

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

Definition at line 1062 of file ExpList.h.

1063  {
1064  return v_GetFieldDefinitions();
1065  }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:3393

References v_GetFieldDefinitions().

◆ GetFieldDefinitions() [2/2]

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

Definition at line 1067 of file ExpList.h.

1068  {
1069  v_GetFieldDefinitions(fielddef);
1070  }

References v_GetFieldDefinitions().

◆ GetFwdBwdTracePhys() [1/2]

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

Definition at line 2569 of file ExpList.h.

2572  {
2573  v_GetFwdBwdTracePhys(Fwd,Bwd);
2574  }
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4293

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

2583  {
2584  v_GetFwdBwdTracePhys(field,Fwd,Bwd,FillBnd,
2585  PutFwdInBwdOnBCs,DoExchange);
2586  }

References v_GetFwdBwdTracePhys().

◆ GetGraph()

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

Definition at line 1146 of file ExpList.h.

1147  {
1148  return m_graph;
1149  }

References m_graph.

◆ GetHomogeneousBasis()

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

Definition at line 1152 of file ExpList.h.

1153  {
1154  return v_GetHomogeneousBasis();
1155  }
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1765

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

692  {
693  return v_GetHomoLen();
694  }
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:3169

References v_GetHomoLen().

◆ GetLeftAdjacentFaces()

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

Definition at line 2627 of file ExpList.h.

2628  {
2629  return v_GetLeftAdjacentFaces();
2630  }
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:4374

References v_GetLeftAdjacentFaces().

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

2609  {
2610  v_GetLocTraceFromTracePts(Fwd,Bwd,locTraceFwd,locTraceBwd);
2611  }
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:4345

References v_GetLocTraceFromTracePts().

Referenced by AddTraceJacToElmtJac().

◆ GetLocTraceToTraceMap()

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

Definition at line 2484 of file ExpList.h.

2485  {
2486  return v_GetLocTraceToTraceMap();
2487  }
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
Definition: ExpList.cpp:5915

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

5257  {
5258  int nTotElmt = (*m_exp).size();
5259  int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5260  int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5261 
5262 
5263  Array<OneD, NekDouble> tmpCoef(nElmtCoef,0.0);
5264  Array<OneD, NekDouble> tmpPhys(nElmtPnt,0.0);
5265 
5266  for(int nelmt = 0; nelmt < nTotElmt; nelmt++)
5267  {
5268  nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5269  nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5270 
5271  if (tmpPhys.size()!=nElmtPnt||tmpCoef.size()!=nElmtCoef)
5272  {
5273  tmpPhys = Array<OneD, NekDouble>(nElmtPnt,0.0);
5274  tmpCoef = Array<OneD, NekDouble>(nElmtCoef,0.0);
5275  }
5276 
5277  for(int ncl = 0; ncl < nElmtPnt; ncl++)
5278  {
5279  tmpPhys[ncl] = inarray[nelmt][ncl];
5280 
5281  (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn,tmpPhys,
5282  tmpCoef);
5283 
5284  for(int nrw = 0; nrw < nElmtCoef; nrw++)
5285  {
5286  (*mtxPerVar[nelmt])(nrw,ncl) = tmpCoef[nrw];
5287  }
5288  // to maintain all the other columes are zero.
5289  tmpPhys[ncl] = 0.0;
5290  }
5291  }
5292  }

◆ GetMatIpwrtDeriveBase() [2/2]

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

Definition at line 5294 of file ExpList.cpp.

5297  {
5298  int nTotElmt = (*m_exp).size();
5299 
5300  int nspacedim = m_graph->GetSpaceDimension();
5301  Array<OneD, Array<OneD, NekDouble> > projectedpnts(nspacedim);
5302  Array<OneD, Array<OneD, NekDouble> > tmppnts(nspacedim);
5303  Array<OneD, DNekMatSharedPtr> ArrayStdMat(nspacedim);
5304  Array<OneD, Array<OneD, NekDouble> > ArrayStdMat_data(nspacedim);
5305 
5306  Array<OneD, NekDouble > clmnArray,clmnStdMatArray;
5307 
5308  LibUtilities::ShapeType ElmtTypePrevious =
5310  int nElmtPntPrevious = 0;
5311  int nElmtCoefPrevious = 0;
5312 
5313  int nElmtPnt,nElmtCoef;
5314  for(int nelmt = 0; nelmt < nTotElmt; nelmt++)
5315  {
5316  nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5317  nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5318  LibUtilities::ShapeType ElmtTypeNow =
5319  (*m_exp)[nelmt]->DetShapeType();
5320 
5321  if (nElmtPntPrevious!=nElmtPnt||nElmtCoefPrevious!=nElmtCoef||
5322  (ElmtTypeNow!=ElmtTypePrevious))
5323  {
5324  if(nElmtPntPrevious!=nElmtPnt)
5325  {
5326  for(int ndir =0;ndir<nspacedim;ndir++)
5327  {
5328  projectedpnts[ndir] =
5329  Array<OneD, NekDouble>(nElmtPnt,0.0);
5330  tmppnts[ndir] =
5331  Array<OneD, NekDouble>(nElmtPnt,0.0);
5332  }
5333  }
5335  stdExp = (*m_exp)[nelmt]->GetStdExp();
5336  StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase0,
5337  stdExp->DetShapeType(), *stdExp);
5338 
5339  ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5340  ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5341 
5342  if(nspacedim>1)
5343  {
5344  StdRegions::StdMatrixKey matkey(StdRegions::eDerivBase1,
5345  stdExp->DetShapeType(), *stdExp);
5346 
5347  ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5348  ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5349 
5350  if(nspacedim>2)
5351  {
5352  StdRegions::StdMatrixKey matkey(
5354  stdExp->DetShapeType(), *stdExp);
5355 
5356  ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5357  ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5358  }
5359  }
5360 
5361  ElmtTypePrevious = ElmtTypeNow;
5362  nElmtPntPrevious = nElmtPnt;
5363  nElmtCoefPrevious = nElmtCoef;
5364  }
5365  else
5366  {
5367  for(int ndir =0;ndir<nspacedim;ndir++)
5368  {
5369  Vmath::Zero(nElmtPnt,projectedpnts[ndir],1);
5370  }
5371  }
5372 
5373  for(int ndir =0;ndir<nspacedim;ndir++)
5374  {
5375  (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5376  ndir,inarray[ndir][nelmt],tmppnts);
5377  for(int n =0;n<nspacedim;n++)
5378  {
5379  Vmath::Vadd(nElmtPnt,tmppnts[n],1,projectedpnts[n],1,
5380  projectedpnts[n],1);
5381  }
5382  }
5383 
5384  for(int ndir =0;ndir<nspacedim;ndir++)
5385  {
5386  // weight with metric
5387  (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5388  projectedpnts[ndir],projectedpnts[ndir]);
5389  Array<OneD, NekDouble> MatDataArray =
5390  mtxPerVar[nelmt]->GetPtr();
5391 
5392  for(int np=0;np<nElmtPnt;np++)
5393  {
5394  NekDouble factor = projectedpnts[ndir][np];
5395  clmnArray = MatDataArray + np*nElmtCoef;
5396  clmnStdMatArray = ArrayStdMat_data[ndir] + np*nElmtCoef;
5397  Vmath::Svtvp(nElmtCoef,factor,clmnStdMatArray,1,
5398  clmnArray,1,clmnArray,1);
5399  }
5400  }
5401  }
5402  }
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:565

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

2105  {
2106  v_GetMovingFrames(MMFdir,CircCentre,outarray);
2107  }
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: ExpList.cpp:3586

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

1806  {
1807  return (*m_exp)[eid]->GetNcoeffs();
1808  }

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

2542  {
2543  v_GetNormals(normals);
2544  }
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList.cpp:3893

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

1883  {
1884  return m_npoints;
1885  }

References m_npoints.

Referenced by export_ExpList(), and MultiplyByMassMatrix().

◆ GetNumElmts()

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

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

Definition at line 743 of file ExpList.h.

744  {
745  return v_GetNumElmts();
746  }
virtual int v_GetNumElmts(void)
Definition: ExpList.h:1364

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

1057  {
1058  v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
1059  }
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:4973

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

2393  {
2394  return m_phys;
2395  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1269

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

1949  {
1950  return m_physState;
1951  }

References m_physState.

Referenced by export_ExpList().

◆ GetPlane()

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

Definition at line 1157 of file ExpList.h.

1158  {
1159  return v_GetPlane(n);
1160  }
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:5005

References v_GetPlane().

◆ GetRobinBCInfo()

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

Definition at line 1048 of file ExpList.h.

1049  {
1050  return v_GetRobinBCInfo();
1051  }
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:4963

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

2256  {
2257  return (*m_exp)[0]->GetShapeDimension();
2258  }

References m_exp.

Referenced by GeneralGetFieldDefinitions().

◆ GetSharedThisPtr()

std::shared_ptr<ExpList> Nektar::MultiRegions::ExpList::GetSharedThisPtr ( )
inline

Returns a shared pointer to the current object.

Definition at line 1129 of file ExpList.h.

1130  {
1131  return shared_from_this();
1132  }

Referenced by GenGlobalBndLinSys(), and GenGlobalLinSys().

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

1856  {
1857  return (*m_exp)[eid]->GetTotPoints();
1858  }

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

2526  {
2527  return v_GetTrace();
2528  }
virtual std::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:3797

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

2536  {
2537  return v_GetTraceBndMap();
2538  }
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:3813

References v_GetTraceBndMap().

◆ GetTraceMap()

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

Definition at line 2530 of file ExpList.h.

2531  {
2532  return v_GetTraceMap();
2533  }
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:3805

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

685  {
686  return v_GetTransposition();
687  }
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:3161

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

1900  {
1901  return m_WaveSpace;
1902  }

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

708  {
709  return v_GetYIDs();
710  }
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:3192

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

678  {
679  return v_GetZIDs();
680  }
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:3184

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

2361  {
2362  v_GlobalToLocal(inarray, outarray);
2363  }
virtual void v_GlobalToLocal(void)
Definition: ExpList.cpp:4592

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

2328  {
2329  v_GlobalToLocal();
2330  }

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

3270  {
3271  NekDouble err = 0.0, errh1;
3272  int i;
3273 
3274  for (i = 0; i < (*m_exp).size(); ++i)
3275  {
3276  errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
3277  soln + m_phys_offset[i]);
3278  err += errh1*errh1;
3279  }
3280 
3281  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3282 
3283  return sqrt(err);
3284  }
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:267

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

◆ HelmSolve()

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

Solve helmholtz problem.

Definition at line 2046 of file ExpList.h.

2055  {
2056  v_HelmSolve(inarray, outarray, factors, varcoeff,
2057  varfactors, dirForcing, PhysSpaceForcing);
2058  }
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Definition: ExpList.cpp:4408

References v_HelmSolve().

◆ HomogeneousBwdTrans()

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

Definition at line 2179 of file ExpList.h.

2184  {
2185  v_HomogeneousBwdTrans(inarray,outarray,Shuff,UnShuff);
2186  }
virtual void v_HomogeneousBwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4456

References v_HomogeneousBwdTrans().

◆ HomogeneousEnergy()

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

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

Definition at line 661 of file ExpList.h.

662  {
663  return v_HomogeneousEnergy();
664  }
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:3153

References v_HomogeneousEnergy().

◆ HomogeneousFwdTrans()

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

Definition at line 2167 of file ExpList.h.

2172  {
2173  v_HomogeneousFwdTrans(inarray,outarray,Shuff,UnShuff);
2174  }
virtual void v_HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:4446

References v_HomogeneousFwdTrans().

◆ ImposeDirichletConditions()

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

Impose Dirichlet Boundary Conditions onto Array.

Definition at line 2298 of file ExpList.h.

2300  {
2301  v_ImposeDirichletConditions(outarray);
2302  }
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4550

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

1024  {
1025 
1027  SpatialDomains::TriGeomSharedPtr TriangleGeom;
1028  SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
1033 
1034  int id=0;
1036 
1037  m_expType = eNoType;
1038  // Process each expansion in the graph
1039  for (auto &expIt : expmap)
1040  {
1041  const SpatialDomains::ExpansionInfoShPtr expInfo = expIt.second;
1042 
1043  switch(expInfo->m_basisKeyVector.size())
1044  {
1045  case 1: // Segment Expansions
1046  {
1048  "Cannot mix expansion dimensions in one vector");
1049  m_expType = e1D;
1050 
1051  if ((SegmentGeom = std::dynamic_pointer_cast<
1052  SpatialDomains::SegGeom>(expInfo->m_geomShPtr)))
1053  {
1054  // Retrieve basis key from expansion
1055  LibUtilities::BasisKey bkey=
1056  expInfo->m_basisKeyVector[0];
1057 
1059  ::AllocateSharedPtr(bkey, SegmentGeom);
1060  }
1061  else
1062  {
1064  "dynamic cast to a 1D Geom failed");
1065  }
1066  }
1067  break;
1068  case 2:
1069  {
1071  "Cannot mix expansion dimensions in one vector");
1072  m_expType = e2D;
1073 
1074  LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1075  LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1076 
1077  if ((TriangleGeom = std::dynamic_pointer_cast<SpatialDomains
1078  ::TriGeom>(expInfo->m_geomShPtr)))
1079  {
1080 
1081  // This is not elegantly implemented needs re-thinking.
1082  if (Ba.GetBasisType() == LibUtilities::eGLL_Lagrange)
1083  {
1084  LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
1085  Ba.GetNumModes(),
1086  Ba.GetPointsKey());
1087 
1091  ::AllocateSharedPtr(newBa,Bb,TriNb,TriangleGeom);
1092  }
1093  else
1094  {
1096  ::AllocateSharedPtr(Ba,Bb,TriangleGeom);
1097  }
1098  }
1099  else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1100  SpatialDomains::QuadGeom>(expInfo->m_geomShPtr)))
1101  {
1103  ::AllocateSharedPtr(Ba,Bb,QuadrilateralGeom);
1104  }
1105  else
1106  {
1108  "dynamic cast to a 2D Geom failed");
1109  }
1110  }
1111  break;
1112  case 3:
1113  {
1115  "Cannot mix expansion dimensions in one vector");
1116  m_expType = e3D;
1117 
1118  LibUtilities::BasisKey Ba = expInfo->m_basisKeyVector[0];
1119  LibUtilities::BasisKey Bb = expInfo->m_basisKeyVector[1];
1120  LibUtilities::BasisKey Bc = expInfo->m_basisKeyVector[2];
1121 
1122  if((TetGeom = std::dynamic_pointer_cast<
1123  SpatialDomains::TetGeom>(expInfo->m_geomShPtr)))
1124  {
1125 
1126  if(Ba.GetBasisType() == LibUtilities::eGLL_Lagrange ||
1127  Ba.GetBasisType() == LibUtilities::eGauss_Lagrange)
1128  {
1130  "LocalRegions::NodalTetExp is not implemented "
1131  "yet");
1132  }
1133  else
1134  {
1136  ::AllocateSharedPtr(Ba,Bb,Bc,TetGeom);
1137  }
1138  }
1139  else if((PrismGeom =
1140  std::dynamic_pointer_cast<SpatialDomains
1141  ::PrismGeom>(expInfo->m_geomShPtr)))
1142  {
1144  ::AllocateSharedPtr(Ba,Bb,Bc,PrismGeom);
1145  }
1146  else if((PyrGeom = std::dynamic_pointer_cast<
1147  SpatialDomains::PyrGeom>(expInfo->m_geomShPtr)))
1148  {
1149 
1151  ::AllocateSharedPtr(Ba,Bb,Bc,PyrGeom);
1152  }
1153  else if((HexGeom = std::dynamic_pointer_cast<
1154  SpatialDomains::HexGeom>(expInfo->m_geomShPtr)))
1155  {
1157  ::AllocateSharedPtr(Ba,Bb,Bc,HexGeom);
1158  }
1159  else
1160  {
1162  "dynamic cast to a Geom failed");
1163  }
1164  }
1165  break;
1166  default:
1168  "Dimension of basis key is greater than 3");
1169  }
1170 
1171  // Assign next id
1172  exp->SetElmtId(id++);
1173 
1174  // Add the expansion
1175  (*m_exp).push_back(exp);
1176  }
1177  }
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:55
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:45
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
Definition: PrismGeom.h:82
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:74
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
Definition: MeshGraph.h:140
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:82
std::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:84

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

Referenced by ExpList().

◆ Integral() [1/2]

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

The integration is evaluated locally, that is

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

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

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

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

Definition at line 625 of file ExpList.h.

626  {
627  ASSERTL1(m_physState == true,
628  "local physical space is not true ");
629 
630  return Integral(m_phys);
631  }

References ASSERTL1, m_phys, and m_physState.

◆ Integral() [2/2]

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

The integration is evaluated locally, that is

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

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

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

Definition at line 649 of file ExpList.h.

650  {
651  return v_Integral(inarray);
652  }
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:3120

References v_Integral().

◆ IProductWRTBase()

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

Definition at line 1956 of file ExpList.h.

1959  {
1960  v_IProductWRTBase(inarray,outarray);
1961  }
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4620

References v_IProductWRTBase().

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

◆ IProductWRTBase_IterPerExp()

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

1969  {
1970  v_IProductWRTBase_IterPerExp(inarray,outarray);
1971  }
virtual void v_IProductWRTBase_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1262

References v_IProductWRTBase_IterPerExp().

Referenced by Nektar::MultiRegions::ContField::IProductWRTBase(), and v_FwdTrans_IterPerExp().

◆ IProductWRTDerivBase() [1/2]

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

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

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

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

Definition at line 1363 of file ExpList.cpp.

1365  {
1366  Array<OneD, NekDouble> tmp0,tmp1,tmp2;
1367  // assume coord dimension defines the size of Deriv Base
1368  int dim = GetCoordim(0);
1369 
1370  ASSERTL1(inarray.size() >= dim,"inarray is not of sufficient dimension");
1371 
1372  // initialise if required
1374  {
1375  for (int i = 0; i < m_collections.size(); ++i)
1376  {
1378  }
1380  }
1381 
1382  LibUtilities::Timer timer;
1383 
1384  LIKWID_MARKER_START("IProductWRTDerivBase_coll");
1385  timer.Start();
1386 
1387  switch(dim)
1388  {
1389  case 1:
1390  for (int i = 0; i < m_collections.size(); ++i)
1391  {
1392  m_collections[i].ApplyOperator(
1394  inarray[0] + m_coll_phys_offset[i],
1395  tmp0 = outarray + m_coll_coeff_offset[i]);
1396  }
1397  break;
1398  case 2:
1399  for (int i = 0; i < m_collections.size(); ++i)
1400  {
1401  m_collections[i].ApplyOperator(
1403  inarray[0] + m_coll_phys_offset[i],
1404  tmp0 = inarray[1] + m_coll_phys_offset[i],
1405  tmp1 = outarray + m_coll_coeff_offset[i]);
1406  }
1407  break;
1408  case 3:
1409  for (int i = 0; i < m_collections.size(); ++i)
1410  {
1411  m_collections[i].ApplyOperator(
1413  inarray[0] + m_coll_phys_offset[i],
1414  tmp0 = inarray[1] + m_coll_phys_offset[i],
1415  tmp1 = inarray[2] + m_coll_phys_offset[i],
1416  tmp2 = outarray + m_coll_coeff_offset[i]);
1417  }
1418  break;
1419  default:
1420  NEKERROR(ErrorUtil::efatal,"Dimension of inarray not correct");
1421  break;
1422  }
1423 
1424  timer.Stop();
1425  LIKWID_MARKER_STOP("IProductWRTDerivBase_coll");
1426 
1427  // Elapsed time
1428  timer.AccumulateRegion("Collections:IProductWRTDerivBase");
1429 
1430  }
#define LIKWID_MARKER_START(regionTag)
Definition: Likwid.hpp:46
#define LIKWID_MARKER_STOP(regionTag)
Definition: Likwid.hpp:47

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

◆ IProductWRTDerivBase() [2/2]

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

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

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

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

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

Definition at line 1299 of file ExpList.cpp.

1302  {
1303  int i;
1304 
1305  Array<OneD,NekDouble> e_outarray;
1306 
1307  for(i = 0; i < (*m_exp).size(); ++i)
1308  {
1309  (*m_exp)[i]->IProductWRTDerivBase(dir,inarray+m_phys_offset[i],
1310  e_outarray = outarray+m_coeff_offset[i]);
1311  }
1312  }

References m_coeff_offset, and m_phys_offset.

◆ IProductWRTDirectionalDerivBase()

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

Directional derivative along a given direction.

Definition at line 1319 of file ExpList.cpp.

1323  {
1324  int npts_e;
1325  int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1326  int nq = direction.size()/coordim;
1327 
1328  Array<OneD, NekDouble> e_outarray;
1329  Array<OneD, NekDouble> e_MFdiv;
1330 
1331  Array<OneD, NekDouble> locdir;
1332 
1333  for(int i = 0; i < (*m_exp).size(); ++i)
1334  {
1335  npts_e = (*m_exp)[i]->GetTotPoints();
1336  locdir = Array<OneD, NekDouble>(npts_e*coordim);
1337 
1338  for (int k = 0; k<coordim; ++k)
1339  {
1340  Vmath::Vcopy(npts_e, &direction[k*nq+m_phys_offset[i]], 1,
1341  &locdir[k*npts_e], 1);
1342  }
1343 
1344  (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1345  locdir,
1346  inarray+m_phys_offset[i],
1347  e_outarray = outarray+m_coeff_offset[i] );
1348  }
1349  }

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

◆ L2()

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

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

Definition at line 596 of file ExpList.h.

599  {
600  return v_L2(inarray, soln);
601  }
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:3074

References v_L2().

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

◆ LinearAdvectionDiffusionReactionSolve()

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

Solve Advection Diffusion Reaction.

Definition at line 2064 of file ExpList.h.

2070  {
2071  v_LinearAdvectionDiffusionReactionSolve(velocity,inarray, outarray,
2072  lambda, dirForcing);
2073  }
virtual void v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:4422

References v_LinearAdvectionDiffusionReactionSolve().

◆ LinearAdvectionReactionSolve()

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

Solve Advection Diffusion Reaction.

Definition at line 2075 of file ExpList.h.

2081  {
2082  v_LinearAdvectionReactionSolve(velocity,inarray, outarray,
2083  lambda, dirForcing);
2084  }
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:4434

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

3038  {
3039  NekDouble err = 0.0;
3040 
3041  if (soln == NullNekDouble1DArray)
3042  {
3043  err = Vmath::Vmax(m_npoints, inarray, 1);
3044  }
3045  else
3046  {
3047  for (int i = 0; i < m_npoints; ++i)
3048  {
3049  err = max(err, abs(inarray[i] - soln[i]));
3050  }
3051  }
3052 
3053  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
3054 
3055  return err;
3056  }
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:892
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:272

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

2315  {
2316  v_LocalToGlobal(useComm);
2317  }
virtual void v_LocalToGlobal(bool UseComm)
Definition: ExpList.cpp:4574

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

2323  {
2324  v_LocalToGlobal(inarray, outarray,useComm);
2325  }

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

1203  {
1204  // Retrieve the block matrix using the given key.
1205  const DNekScalBlkMatSharedPtr& blockmat = GetBlockMatrix(gkey);
1206  int nrows = blockmat->GetRows();
1207  int ncols = blockmat->GetColumns();
1208 
1209  // Create NekVectors from the given data arrays
1210  NekVector<NekDouble> in (ncols,inarray, eWrapper);
1211  NekVector< NekDouble> out(nrows,outarray,eWrapper);
1212 
1213  // Perform matrix-vector multiply.
1214  out = (*blockmat)*in;
1215  }
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:1946

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

1699  {
1700  GlobalMatrixKey mkey(StdRegions::eInvMass);
1701  const DNekScalBlkMatSharedPtr& InvMass = GetBlockMatrix(mkey);
1702 
1703  // Inverse mass matrix
1704  NekVector<NekDouble> out(m_ncoeffs,outarray,eWrapper);
1705  if(inarray.get() == outarray.get())
1706  {
1707  NekVector<NekDouble> in(m_ncoeffs,inarray); // copy data
1708  out = (*InvMass)*in;
1709  }
1710  else
1711  {
1712  NekVector<NekDouble> in(m_ncoeffs,inarray,eWrapper);
1713  out = (*InvMass)*in;
1714  }
1715  }

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

Referenced by v_FwdTrans_IterPerExp().

◆ MultiplyByInvMassMatrix()

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

Definition at line 2036 of file ExpList.h.

2039  {
2040  v_MultiplyByInvMassMatrix(inarray,outarray);
2041  }
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:4399

References v_MultiplyByInvMassMatrix().

◆ MultiplyByMassMatrix()

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

Definition at line 330 of file ExpList.h.

333  {
334  Array<OneD, NekDouble> tmp (GetNpoints(),0.0);
335  BwdTrans(inarray,tmp);
336  IProductWRTBase(tmp,outarray);
337  }
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:1956
int GetNpoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1882
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.h:2015

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

1223  {
1224  Array<OneD,NekDouble> e_outarray;
1225 
1226  for (int i = 0; i < (*m_exp).size(); ++i)
1227  {
1228  (*m_exp)[i]->MultiplyByQuadratureMetric(
1229  inarray+m_phys_offset[i],
1230  e_outarray = outarray + m_phys_offset[i]);
1231  }
1232  }

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

2236  {
2237  v_NormVectorIProductWRTBase(V, outarray);
2238  }
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:4494

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

2229  {
2230  v_NormVectorIProductWRTBase(V1,V2,outarray,BndID);
2231  }

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

2623  {
2624  v_PeriodicBwdCopy(Fwd, Bwd);
2625  }
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:4918

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

2117  {
2118  v_PhysDeriv(inarray,out_d0,out_d1,out_d2);
2119  }
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:1465

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

2128  {
2129  v_PhysDeriv(dir,inarray,out_d);
2130  }

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

2136  {
2137  v_PhysDeriv(edir, inarray,out_d);
2138  }

References v_PhysDeriv().

Referenced by v_CurlCurl().

◆ PhysDirectionalDeriv()

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

Definition at line 2144 of file ExpList.h.

2148  {
2149  v_PhysDirectionalDeriv(direction, inarray, outarray);
2150  }
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1638

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

2545  {
2546  int dim = GetCoordim(0);
2547  ASSERTL0(dim == coords.size(),
2548  "Invalid coordinate dimension.");
2549 
2550  // Grab the element index corresponding to coords.
2551  Array<OneD, NekDouble> xi(dim);
2552  int elmtIdx = GetExpIndex(coords, xi);
2553  ASSERTL0(elmtIdx > 0, "Unable to find element containing point.");
2554 
2555  // Grab that element's physical storage.
2556  Array<OneD, NekDouble> elmtPhys = phys + m_phys_offset[elmtIdx];
2557 
2558  // Evaluate the element at the appropriate point.
2559  return (*m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
2560  }

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

Referenced by export_ExpList().

◆ PhysGalerkinProjection1DScaled()

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

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

Definition at line 728 of file ExpList.h.

732  {
733  v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
734  }
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5833

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

720  {
721  v_PhysInterp1DScaled(scale, inarray,outarray);
722  }
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:5170

References v_PhysInterp1DScaled().

◆ Reset()

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

Reset geometry information and reset matrices.

Definition at line 440 of file ExpList.h.

441  {
442  v_Reset();
443  }
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:2580

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

2498  {
2499  v_SetBndCondBwdWeight(index, value);
2500  }
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
Definition: ExpList.cpp:4365

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

2265  {
2266  m_coeffs[i] = val;
2267  }

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

2275  {
2276  m_coeffs[i] = val;
2277  }

References m_coeffs.

◆ SetCoeffsArray()

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

Set the m_coeffs array to inarray.

Definition at line 2280 of file ExpList.h.

2281  {
2282  m_coeffs = inarray;
2283  }

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

669  {
671  }
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1773

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

699  {
700  return v_SetHomoLen(lhom);
701  }
virtual void v_SetHomoLen(const NekDouble lhom)
Definition: ExpList.cpp:3177

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

1921  {
1922  ASSERTL0(inarray.size() == m_npoints,
1923  "Input array does not have correct number of elements.");
1924 
1925  Vmath::Vcopy(m_npoints,&inarray[0],1,&m_phys[0],1);
1926  m_physState = true;
1927  }

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

1906  {
1907  m_phys[i] = val;
1908  }

References m_phys.

◆ SetPhysArray()

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

Sets the array m_phys.

Definition at line 1930 of file ExpList.h.

1931  {
1932  m_phys = inarray;
1933  }

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

1940  {
1941  m_physState = physState;
1942  }

References m_physState.

Referenced by export_ExpList().

◆ SetupCoeffPhys()

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

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

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

Definition at line 978 of file ExpList.cpp.

980  {
981  if(SetupOffsets)
982  {
983  int i;
984 
985  // Set up offset information and array sizes
986  m_coeff_offset = Array<OneD,int>(m_exp->size());
987  m_phys_offset = Array<OneD,int>(m_exp->size());
988 
989  m_ncoeffs = m_npoints = 0;
990 
991  for(i = 0; i < m_exp->size(); ++i)
992  {
994  m_phys_offset [i] = m_npoints;
995  m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
996  m_npoints += (*m_exp)[i]->GetTotPoints();
997  }
998  }
999 
1000  if(DeclareCoeffPhysArrays)
1001  {
1002  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
1003  m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
1004  }
1005 
1006  m_coeffsToElmt = Array<OneD, pair<int, int> > {size_t(m_ncoeffs)};
1007 
1008  for (int i = 0; i < m_exp->size(); ++i)
1009  {
1010  int coeffs_offset = m_coeff_offset[i];
1011 
1012  int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1013 
1014  for(int j = 0; j < loccoeffs; ++j)
1015  {
1016  m_coeffsToElmt[coeffs_offset+j].first = i;
1017  m_coeffsToElmt[coeffs_offset+j].second = j;
1018  }
1019  }
1020  }

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

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

1892  {
1893  m_WaveSpace = wavespace;
1894  }

References m_WaveSpace.

◆ SmoothField()

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

Smooth a field across elements.

Definition at line 2007 of file ExpList.h.

2008  {
2009  v_SmoothField(field);
2010  }
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:1767

References v_SmoothField().

◆ UpdateBndCondExpansion()

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

Definition at line 2502 of file ExpList.h.

2503  {
2504  return v_UpdateBndCondExpansion(i);
2505  }
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:3677

References v_UpdateBndCondExpansion().

◆ UpdateBndConditions()

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

Definition at line 2652 of file ExpList.h.

2653  {
2654  return v_UpdateBndConditions();
2655  }
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:4940

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

2451  {
2452  return m_coeffs;
2453  }

References m_coeffs.

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

◆ UpdatePhys()

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

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

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

Returns
(A reference to) the array m_phys.

Definition at line 2461 of file ExpList.h.

2462  {
2463  m_physState = true;
2464  return m_phys;
2465  }

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

2512  {
2513  v_Upwind(Vec, Fwd, Bwd, Upwind);
2514  }
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:3696
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:2516

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

2521  {
2522  v_Upwind(Vn, Fwd, Bwd, Upwind);
2523  }

References v_Upwind().

Referenced by Upwind(), and v_Upwind().

◆ v_AddFwdBwdTraceIntegral()

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

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 4283 of file ExpList.cpp.

4287  {
4288  boost::ignore_unused(Fwd, Bwd, outarray);
4290  "This method is not defined or valid for this class type");
4291  }

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

4277  {
4278  boost::ignore_unused(Fn, outarray);
4280  "This method is not defined or valid for this class type");
4281  }

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

4268  {
4269  boost::ignore_unused(Fx, Fy, outarray);
4271  "This method is not defined or valid for this class type");
4272  }

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

Referenced by AddTraceIntegral().

◆ v_AddTraceIntegralToOffDiag()

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

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 5244 of file ExpList.cpp.

5248  {
5249  boost::ignore_unused(FwdFlux, BwdFlux, outarray);
5250  NEKERROR(ErrorUtil::efatal,"AddTraceIntegralToOffDiag not defined");
5251  }

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

4329  {
4330  boost::ignore_unused(field, Fwd, Bwd);
4332  "v_AddTraceQuadPhysToField is not defined for this class type");
4333  }

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

4339  {
4340  boost::ignore_unused(field, Fwd, Bwd);
4342  "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4343  }

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

Referenced by AddTraceQuadPhysToOffDiag().

◆ v_AppendFieldData() [1/2]

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

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

Definition at line 3407 of file ExpList.cpp.

3408  {
3409  v_AppendFieldData(fielddef,fielddata,m_coeffs);
3410  }

References m_coeffs.

Referenced by AppendFieldData().

◆ v_AppendFieldData() [2/2]

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

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

Definition at line 3412 of file ExpList.cpp.

3413  {
3414  int i;
3415  // Determine mapping from element ids to location in
3416  // expansion list
3417  // Determine mapping from element ids to location in
3418  // expansion list
3419  map<int, int> ElmtID_to_ExpID;
3420  for(i = 0; i < (*m_exp).size(); ++i)
3421  {
3422  ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3423  }
3424 
3425  for(i = 0; i < fielddef->m_elementIDs.size(); ++i)
3426  {
3427  int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3428  int datalen = (*m_exp)[eid]->GetNcoeffs();
3429  fielddata.insert(fielddata.end(),&coeffs[m_coeff_offset[eid]],&coeffs[m_coeff_offset[eid]]+datalen);
3430  }
3431 
3432  }

References m_coeff_offset.

◆ v_BwdTrans()

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

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

Definition at line 4608 of file ExpList.cpp.

4610  {
4611  v_BwdTrans_IterPerExp(inarray,outarray);
4612  }

References v_BwdTrans_IterPerExp().

Referenced by BwdTrans().

◆ v_BwdTrans_IterPerExp()

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

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

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

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

Definition at line 2366 of file ExpList.cpp.

2368  {
2369  LibUtilities::Timer timer;
2370 
2371  if(m_expType == e0D)
2372  {
2373  Vmath::Vcopy(m_ncoeffs,inarray,1,outarray,1);
2374  }
2375  else
2376  {
2377  // initialise if required
2379  {
2380  for (int i = 0; i < m_collections.size(); ++i)
2381  {
2382  m_collections[i].Initialise(Collections::eBwdTrans);
2383  }
2385  }
2386 
2387  LIKWID_MARKER_START("v_BwdTrans_IterPerExp");
2388  // timer.Start();
2389 
2390  Array<OneD, NekDouble> tmp;
2391  for (int i = 0; i < m_collections.size(); ++i)
2392  {
2393  m_collections[i].ApplyOperator(Collections::eBwdTrans,
2394  inarray + m_coll_coeff_offset[i],
2395  tmp = outarray + m_coll_phys_offset[i]);
2396  }
2397  }
2398 
2399  timer.Stop();
2400  LIKWID_MARKER_STOP("v_BwdTrans_IterPerExp");
2401 
2402  // Elapsed time
2403  timer.AccumulateRegion("Collections:BwdTrans");
2404  }

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::Stop(), and Vmath::Vcopy().

Referenced by BwdTrans_IterPerExp(), and v_BwdTrans().

◆ v_ClearGlobalLinSysManager()

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

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

Definition at line 3201 of file ExpList.cpp.

3202  {
3204  "This method is not defined or valid for this class type");
3205  }

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

Referenced by ClearGlobalLinSysManager().

◆ v_CurlCurl()

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

Definition at line 1566 of file ExpList.cpp.

1569  {
1570  int nq = GetTotPoints();
1571  Array<OneD,NekDouble> Vx(nq);
1572  Array<OneD,NekDouble> Uy(nq);
1573  Array<OneD,NekDouble> Dummy(nq);
1574 
1575  bool halfMode = false;
1576  if ( GetExpType() == e3DH1D)
1577  {
1578  m_session->MatchSolverInfo("ModeType", "HalfMode",
1579  halfMode, false);
1580  }
1581 
1582  switch(m_expType)
1583  {
1584  case e2D:
1585  {
1586  PhysDeriv(xDir, Vel[yDir], Vx);
1587  PhysDeriv(yDir, Vel[xDir], Uy);
1588 
1589 
1590  Vmath::Vsub(nq, Vx, 1, Uy, 1, Dummy, 1);
1591 
1592  PhysDeriv(Dummy,Q[1],Q[0]);
1593 
1594  Vmath::Smul(nq, -1.0, Q[1], 1, Q[1], 1);
1595  }
1596  break;
1597 
1598  case e3D:
1599  case e3DH1D:
1600  case e3DH2D:
1601  {
1602  Array<OneD,NekDouble> Vz(nq);
1603  Array<OneD,NekDouble> Uz(nq);
1604  Array<OneD,NekDouble> Wx(nq);
1605  Array<OneD,NekDouble> Wy(nq);
1606 
1607  PhysDeriv(Vel[xDir], Dummy, Uy, Uz);
1608  PhysDeriv(Vel[yDir], Vx, Dummy, Vz);
1609  PhysDeriv(Vel[zDir], Wx, Wy, Dummy);
1610 
1611  Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
1612  Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
1613  Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
1614 
1615  PhysDeriv(Q[0], Dummy, Uy, Uz);
1616  PhysDeriv(Q[1], Vx, Dummy, Vz);
1617  PhysDeriv(Q[2], Wx, Wy, Dummy);
1618 
1619  // For halfmode, need to change the sign of z derivatives
1620  if (halfMode)
1621  {
1622  Vmath::Neg(nq, Uz, 1);
1623  Vmath::Neg(nq, Vz, 1);
1624  }
1625 
1626  Vmath::Vsub(nq, Wy, 1, Vz, 1, Q[0], 1);
1627  Vmath::Vsub(nq, Uz, 1, Wx, 1, Q[1], 1);
1628  Vmath::Vsub(nq, Vx, 1, Uy, 1, Q[2], 1);
1629  }
1630  break;
1631  default:
1632  ASSERTL0(0,"Dimension not supported");
1633  break;
1634  }
1635  }
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
Definition: ExpList.h:2132
ExpansionType GetExpType(void)
Returns the type of the expansion.
Definition: ExpList.cpp:1182
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:461
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:372

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

Referenced by CurlCurl().

◆ v_DealiasedDotProd()

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

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

Definition at line 4475 of file ExpList.cpp.

4479  {
4480  boost::ignore_unused(inarray1, inarray2, outarray);
4482  "This method is not defined or valid for this class type");
4483  }

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

Referenced by DealiasedDotProd().

◆ v_DealiasedProd()

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

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

Definition at line 4466 of file ExpList.cpp.

4469  {
4470  boost::ignore_unused(inarray1, inarray2, outarray);
4472  "This method is not defined or valid for this class type");
4473  }

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

Referenced by DealiasedProd().

◆ v_EvaluateBoundaryConditions()

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

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

Definition at line 4950 of file ExpList.cpp.

4955  {
4956  boost::ignore_unused(time, varName, x2_in, x3_in);
4958  "This method is not defined or valid for this class type");
4959  }

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

3547  {
3548  int i;
3549  int offset = 0;
3550 
3551  for(i = 0; i < (*m_exp).size(); ++i)
3552  {
3553  std::vector<unsigned int> nummodes;
3554  vector<LibUtilities::BasisType> basisTypes;
3555  for(int j= 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
3556  {
3557  nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
3558  basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
3559  }
3560 
3561  (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes,0,
3562  &toCoeffs[m_coeff_offset[i]],
3563  basisTypes);
3564 
3565  offset += fromExpList->GetExp(i)->GetNcoeffs();
3566  }
3567  }

References m_coeff_offset.

Referenced by ExtractCoeffsToCoeffs().

◆ v_ExtractDataToCoeffs()

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

Extract data from raw field data into expansion list.

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

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

Definition at line 3457 of file ExpList.cpp.

3462  {
3463  int i, expId;
3464  int offset = 0;
3465  int modes_offset = 0;
3466  int datalen = fielddata.size()/fielddef->m_fields.size();
3467 
3468  // Find data location according to field definition
3469  for(i = 0; i < fielddef->m_fields.size(); ++i)
3470  {
3471  if(fielddef->m_fields[i] == field)
3472  {
3473  break;
3474  }
3475  offset += datalen;
3476  }
3477 
3478  ASSERTL0(i != fielddef->m_fields.size(),
3479  "Field (" + field + ") not found in file.");
3480 
3481  if (m_elmtToExpId.size() == 0)
3482  {
3483  // Loop in reverse order so that in case where using a
3484  // Homogeneous expansion it sets geometry ids to first part of
3485  // m_exp list. Otherwise will set to second (complex) expansion
3486  for(i = (*m_exp).size()-1; i >= 0; --i)
3487  {
3488  m_elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3489  }
3490  }
3491 
3492  for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3493  {
3494  // Reset modes_offset in the case where all expansions of
3495  // the same order.
3496  if (fielddef->m_uniOrder == true)
3497  {
3498  modes_offset = 0;
3499  }
3500 
3502  fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
3503 
3504  const int elmtId = fielddef->m_elementIDs[i];
3505  auto eIt = m_elmtToExpId.find(elmtId);
3506 
3507  if (eIt == m_elmtToExpId.end())
3508  {
3509  offset += datalen;
3510  modes_offset += (*m_exp)[0]->GetNumBases();
3511  continue;
3512  }
3513 
3514  expId = eIt->second;
3515 
3516  bool sameBasis = true;
3517  for (int j = 0; j < fielddef->m_basis.size(); ++j)
3518  {
3519  if (fielddef->m_basis[j] != (*m_exp)[expId]->GetBasisType(j))
3520  {
3521  sameBasis = false;
3522  break;
3523  }
3524  }
3525 
3526  if (datalen == (*m_exp)[expId]->GetNcoeffs() && sameBasis)
3527  {
3528  Vmath::Vcopy(datalen, &fielddata[offset], 1,
3529  &coeffs[m_coeff_offset[expId]], 1);
3530  }
3531  else
3532  {
3533  (*m_exp)[expId]->ExtractDataToCoeffs(
3534  &fielddata[offset], fielddef->m_numModes,
3535  modes_offset, &coeffs[m_coeff_offset[expId]],
3536  fielddef->m_basis);
3537  }
3538 
3539  offset += datalen;
3540  modes_offset += (*m_exp)[0]->GetNumBases();
3541  }
3542 
3543  return;
3544  }
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset)
Definition: ShapeType.hpp:313

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

4743  {
4744  int n, cnt;
4745  Array<OneD, NekDouble> tmp1, tmp2;
4747 
4748  Array<OneD, int> ElmtID,EdgeID;
4749  GetBoundaryToElmtMap(ElmtID,EdgeID);
4750 
4751  // Initialise result
4752  boundary = Array<OneD, NekDouble>
4753  (GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
4754 
4755  // Skip other boundary regions
4756  for (cnt = n = 0; n < i; ++n)
4757  {
4758  cnt += GetBndCondExpansions()[n]->GetExpSize();
4759  }
4760 
4761  int offsetBnd;
4762  int offsetElmt = 0;
4763  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4764  {
4765  offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
4766 
4767  elmt = GetExp(ElmtID[cnt+n]);
4768  elmt->GetTracePhysVals(EdgeID[cnt+n],
4769  GetBndCondExpansions()[i]->GetExp(n),
4770  tmp1 = element + offsetElmt,
4771  tmp2 = boundary + offsetBnd);
4772 
4773  offsetElmt += elmt->GetTotPoints();
4774  }
4775  }
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
Definition: ExpList.h:2470
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2709

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

4822  {
4823  int n, cnt;
4824  Array<OneD, NekDouble> tmp1;
4826 
4827  Array<OneD, int> ElmtID,EdgeID;
4828  GetBoundaryToElmtMap(ElmtID,EdgeID);
4829 
4830  // Initialise result
4831  bnd = Array<OneD, NekDouble>
4832  (GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
4833 
4834  // Skip other boundary regions
4835  for (cnt = n = 0; n < i; ++n)
4836  {
4837  cnt += GetBndCondExpansions()[n]->GetExpSize();
4838  }
4839 
4840  int offsetBnd;
4841  int offsetPhys;
4842  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4843  {
4844  offsetPhys = GetPhys_Offset(ElmtID[cnt+n]);
4845  offsetBnd = GetBndCondExpansions()[i]->GetPhys_Offset(n);
4846 
4847  elmt = GetExp(ElmtID[cnt+n]);
4848  elmt->GetTracePhysVals(EdgeID[cnt+n],
4849  GetBndCondExpansions()[i]->GetExp(n),
4850  phys + offsetPhys,
4851  tmp1 = bnd + offsetBnd);
4852  }
4853  }

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

4782  {
4783  int n, cnt, nq;
4784 
4785  Array<OneD, int> ElmtID,EdgeID;
4786  GetBoundaryToElmtMap(ElmtID,EdgeID);
4787 
4788  // Skip other boundary regions
4789  for (cnt = n = 0; n < i; ++n)
4790  {
4791  cnt += GetBndCondExpansions()[n]->GetExpSize();
4792  }
4793 
4794  // Count number of points
4795  int npoints = 0;
4796  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4797  {
4798  npoints += GetExp(ElmtID[cnt+n])->GetTotPoints();
4799  }
4800 
4801  // Initialise result
4802  bndElmt = Array<OneD, NekDouble> (npoints, 0.0);
4803 
4804  // Extract data
4805  int offsetPhys;
4806  int offsetElmt = 0;
4807  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4808  {
4809  nq = GetExp(ElmtID[cnt+n])->GetTotPoints();
4810  offsetPhys = GetPhys_Offset(ElmtID[cnt+n]);
4811  Vmath::Vcopy(nq, &phys[offsetPhys], 1,
4812  &bndElmt[offsetElmt], 1);
4813  offsetElmt += nq;
4814  }
4815  }

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

Referenced by ExtractPhysToBndElmt().

◆ v_ExtractTracePhys() [1/2]

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

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

Definition at line 4383 of file ExpList.cpp.

4384  {
4385  boost::ignore_unused(outarray);
4387  "This method is not defined or valid for this class type");
4388  }

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

Referenced by ExtractTracePhys().

◆ v_ExtractTracePhys() [2/2]

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

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

Definition at line 4390 of file ExpList.cpp.

4393  {
4394  boost::ignore_unused(inarray, outarray);
4396  "This method is not defined or valid for this class type");
4397  }

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

◆ v_FillBndCondFromField() [1/2]

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

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

Definition at line 4559 of file ExpList.cpp.

4560  {
4562  "This method is not defined or valid for this class type");
4563  }

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

Referenced by FillBndCondFromField().

◆ v_FillBndCondFromField() [2/2]

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

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

Definition at line 4567 of file ExpList.cpp.

4568  {
4569  boost::ignore_unused(nreg);
4571  "This method is not defined or valid for this class type");
4572  }

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

4319  {
4320  boost::ignore_unused(Fwd, Bwd, PutFwdInBwdOnBCs);
4322  "This method is not defined or valid for this class type");
4323  }

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

4913  {
4914  boost::ignore_unused(weightave, weightjmp);
4915  NEKERROR(ErrorUtil::efatal, "v_FillBwdWithBwdWeight not defined");
4916  }

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

Referenced by FillBwdWithBwdWeight().

◆ v_FwdTrans()

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

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

Definition at line 4614 of file ExpList.cpp.

4616  {
4617  v_FwdTrans_IterPerExp(inarray,outarray);
4618  }

References v_FwdTrans_IterPerExp().

Referenced by FwdTrans().

◆ v_FwdTrans_BndConstrained()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1745 of file ExpList.cpp.

1748  {
1749  int i;
1750 
1751  Array<OneD,NekDouble> e_outarray;
1752 
1753  for(i= 0; i < (*m_exp).size(); ++i)
1754  {
1755  (*m_exp)[i]->FwdTrans_BndConstrained(inarray+m_phys_offset[i],
1756  e_outarray = outarray+m_coeff_offset[i]);
1757  }
1758  }

References m_coeff_offset, and m_phys_offset.

Referenced by FwdTrans_BndConstrained().

◆ v_FwdTrans_IterPerExp()

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

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

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

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

Definition at line 1735 of file ExpList.cpp.

1737  {
1738  Array<OneD,NekDouble> f(m_ncoeffs);
1739 
1740  IProductWRTBase_IterPerExp(inarray,f);
1741  MultiplyByElmtInvMass(f,outarray);
1742 
1743  }
void IProductWRTBase_IterPerExp(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:1966
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:1696

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

Referenced by FwdTrans_IterPerExp(), and v_FwdTrans().

◆ v_GeneralMatrixOp()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 4644 of file ExpList.cpp.

4648  {
4649  GeneralMatrixOp_IterPerExp(gkey,inarray,outarray);
4650  }
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1961

References GeneralMatrixOp_IterPerExp().

Referenced by GeneralMatrixOp().

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

4488  {
4489  boost::ignore_unused(BndVals, TotField, BndID);
4491  "This method is not defined or valid for this class type");
4492  }

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

4358  {
4360  "v_GetBndCondBwdWeight is not defined for this class type");
4361  static Array<OneD, NekDouble> tmp;
4362  return tmp;
4363  }

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

Referenced by GetBndCondBwdWeight().

◆ v_GetBndCondExpansions()

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

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

Definition at line 3669 of file ExpList.cpp.

3670  {
3672  "This method is not defined or valid for this class type");
3673  static Array<OneD,const std::shared_ptr<ExpList> > result;
3674  return result;
3675  }

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

Referenced by GetBndCondExpansions().

◆ v_GetBndConditions()

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

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

Definition at line 4929 of file ExpList.cpp.

4930  {
4932  "This method is not defined or valid for this class type");
4933  static Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
4934  result;
4935  return result;
4936  }

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

Referenced by GetBndConditions().

◆ v_GetBndElmtExpansion()

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

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

Definition at line 4729 of file ExpList.cpp.

4732  {
4733  boost::ignore_unused(i, result, DeclareCoeffPhysArrays);
4735  "This method is not defined or valid for this class type");
4736  }

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

4859  {
4860  int j, n, cnt, nq;
4861  int coordim = GetCoordim(0);
4862  Array<OneD, NekDouble> tmp;
4864 
4865  Array<OneD, int> ElmtID,EdgeID;
4866  GetBoundaryToElmtMap(ElmtID,EdgeID);
4867 
4868  // Initialise result
4869  normals = Array<OneD, Array<OneD, NekDouble> > (coordim);
4870  for (j = 0; j < coordim; ++j)
4871  {
4872  normals[j] = Array<OneD, NekDouble> (
4873  GetBndCondExpansions()[i]->GetTotPoints(), 0.0);
4874  }
4875 
4876  // Skip other boundary regions
4877  for (cnt = n = 0; n < i; ++n)
4878  {
4879  cnt += GetBndCondExpansions()[n]->GetExpSize();
4880  }
4881 
4882  int offset;
4883  for (n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n)
4884  {
4885  offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
4886  nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
4887 
4888  elmt = GetExp(ElmtID[cnt+n]);
4889  const Array<OneD, const Array<OneD, NekDouble> > normalsElmt
4890  = elmt->GetTraceNormal(EdgeID[cnt+n]);
4891  // Copy to result
4892  for (j = 0; j < coordim; ++j)
4893  {
4894  Vmath::Vcopy(nq, normalsElmt[j], 1,
4895  tmp = normals[j] + offset, 1);
4896  }
4897  }
4898  }

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

Referenced by GetBoundaryNormals().

◆ v_GetBoundaryToElmtMap()

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

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

Definition at line 4902 of file ExpList.cpp.

4904  {
4905  boost::ignore_unused(ElmtID, EdgeID);
4907  "This method is not defined or valid for this class type");
4908  }

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

Referenced by GetBoundaryToElmtMap().

◆ v_GetCoords()

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

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

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

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

Definition at line 4663 of file ExpList.cpp.

4666  {
4667  if (GetNumElmts() == 0)
4668  {
4669  return;
4670  }
4671 
4672  int i;
4673  Array<OneD, NekDouble> e_coord_0;
4674  Array<OneD, NekDouble> e_coord_1;
4675  Array<OneD, NekDouble> e_coord_2;
4676 
4677  switch(GetExp(0)->GetCoordim())
4678  {
4679  case 1:
4680  for(i= 0; i < (*m_exp).size(); ++i)
4681  {
4682  e_coord_0 = coord_0 + m_phys_offset[i];
4683  (*m_exp)[i]->GetCoords(e_coord_0);
4684  }
4685  break;
4686  case 2:
4687  ASSERTL0(coord_1.size() != 0,
4688  "output coord_1 is not defined");
4689 
4690  for(i= 0; i < (*m_exp).size(); ++i)
4691  {
4692  e_coord_0 = coord_0 + m_phys_offset[i];
4693  e_coord_1 = coord_1 + m_phys_offset[i];
4694  (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1);
4695  }
4696  break;
4697  case 3:
4698  ASSERTL0(coord_1.size() != 0,
4699  "output coord_1 is not defined");
4700  ASSERTL0(coord_2.size() != 0,
4701  "output coord_2 is not defined");
4702 
4703  for(i= 0; i < (*m_exp).size(); ++i)
4704  {
4705  e_coord_0 = coord_0 + m_phys_offset[i];
4706  e_coord_1 = coord_1 + m_phys_offset[i];
4707  e_coord_2 = coord_2 + m_phys_offset[i];
4708  (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1,e_coord_2);
4709  }
4710  break;
4711  }
4712  }

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

Referenced by GetCoords().

◆ v_GetFieldDefinitions() [1/2]

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

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

Definition at line 3400 of file ExpList.cpp.

3401  {
3402  GeneralGetFieldDefinitions(fielddef);
3403  }
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:3286

References GeneralGetFieldDefinitions().

◆ v_GetFieldDefinitions() [2/2]

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

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

Definition at line 3393 of file ExpList.cpp.

3394  {
3395  std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3396  v_GetFieldDefinitions(returnval);
3397  return returnval;
3398  }

Referenced by GetFieldDefinitions().

◆ v_GetFwdBwdTracePhys() [1/2]

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

Reimplemented in Nektar::MultiRegions::DisContField.

Definition at line 4293 of file ExpList.cpp.

4295  {
4296  boost::ignore_unused(Fwd, Bwd);
4298  "This method is not defined or valid for this class type");
4299  }

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

4308  {
4309  boost::ignore_unused(field, Fwd, Bwd, FillBnd,
4310  PutFwdInBwdOnBCs, DoExchange);
4312  "This method is not defined or valid for this class type");
4313  }

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

◆ v_GetHomogeneousBasis()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1765 of file ExpList.h.

1766  {
1768  "This method is not defined or valid for this class type");
1770  }
static BasisSharedPtr NullBasisSharedPtr
Definition: Basis.h:370

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

3170  {
3172  "This method is not defined or valid for this class type");
3173  NekDouble len = 0.0;
3174  return len;
3175  }

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

4375  {
4377  "This method is not defined or valid for this class type");
4378  static vector<bool> tmp;
4379  return tmp;
4380  }

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

Referenced by GetLeftAdjacentFaces().

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

4350  {
4351  boost::ignore_unused(Fwd,Bwd,locTraceFwd,locTraceBwd);
4353  "v_GetLocTraceFromTracePts is not defined for this class");
4354  }

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

5916  {
5917  NEKERROR(ErrorUtil::efatal, "v_GetLocTraceToTraceMap not coded");
5919  }
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 3586 of file ExpList.cpp.

3590  {
3591  int npts;
3592 
3593  int MFdim = 3;
3594  int nq = outarray[0].size()/MFdim;
3595 
3596  // Assume whole array is of same coordinate dimension
3597  int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
3598 
3599  Array<OneD, Array<OneD, NekDouble> > MFloc(MFdim*coordim);
3600  // Process each expansion.
3601  for(int i = 0; i < m_exp->size(); ++i)
3602  {
3603  npts = (*m_exp)[i]->GetTotPoints();
3604 
3605  for (int j=0; j< MFdim*coordim; ++j)
3606  {
3607  MFloc[j] = Array<OneD, NekDouble>(npts, 0.0);
3608  }
3609 
3610  // MF from LOCALREGIONS
3611  (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
3612  (*m_exp)[i]->GetPointsKeys(),
3613  MMFdir,
3614  CircCentre,
3615  MFloc );
3616 
3617  // Get the physical data offset for this expansion.
3618  for (int j = 0; j < MFdim; ++j)
3619  {
3620  for (int k = 0; k < coordim; ++k)
3621  {
3622  Vmath::Vcopy(npts,
3623  &MFloc[j*coordim+k][0], 1,
3624  &outarray[j][k*nq+m_phys_offset[i]], 1);
3625  }
3626  }
3627  }
3628 
3629  }

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

3895  {
3896  int i,j,k,e_npoints,offset;
3897  Array<OneD,Array<OneD,NekDouble> > locnormals;
3898 
3899  // Assume whole array is of same coordinate dimension
3900  int coordim = GetCoordim(0);
3901 
3902  ASSERTL1(normals.size() >= coordim,
3903  "Output vector does not have sufficient dimensions to "
3904  "match coordim");
3905 
3906  switch(m_expType)
3907  {
3908  case e0D:
3909  {
3910  // Process each expansion.
3911  for(i = 0; i < m_exp->size(); ++i)
3912  {
3913  LocalRegions::ExpansionSharedPtr loc_exp = (*m_exp)[i];
3914 
3916  loc_exp->GetLeftAdjacentElementExp();
3917 
3918  // Get the number of points and normals for this expansion.
3919  e_npoints = 1;
3920  locnormals = loc_elmt->GetTraceNormal(loc_exp->
3921  GetLeftAdjacentElementTrace());
3922 
3923  // Get the physical data offset for this expansion.
3924  offset = m_phys_offset[i];
3925 
3926  // Process each point in the expansion.
3927  for(j = 0; j < e_npoints; ++j)
3928  {
3929  // Process each spatial dimension and copy the
3930  // values into the output array.
3931  for(k = 0; k < coordim; ++k)
3932  {
3933  normals[k][offset] = locnormals[k][0];
3934  }
3935  }
3936  }
3937  }
3938  break;
3939  case e1D:
3940  {
3942  Array<OneD,Array<OneD,NekDouble> > locnormals2;
3943  Array<OneD,Array<OneD,NekDouble> > Norms;
3944 
3945  for (i = 0; i < m_exp->size(); ++i)
3946  {
3947  LocalRegions::ExpansionSharedPtr loc_exp =(*m_exp)[i];
3948 
3950  loc_exp->GetLeftAdjacentElementExp();
3951 
3952  int edgeNumber = loc_exp->GetLeftAdjacentElementTrace();
3953 
3954  // Get the number of points and normals for this expansion.
3955  e_npoints = (*m_exp)[i]->GetNumPoints(0);
3956 
3957  locnormals = loc_elmt->GetTraceNormal(edgeNumber);
3958  int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
3959  int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
3960 
3961  if (e_nmodes != loc_nmodes)
3962  {
3963  if (loc_exp->GetRightAdjacentElementTrace() >= 0)
3964  {
3966  loc_exp->GetRightAdjacentElementExp();
3967 
3968  int EdgeNumber = loc_exp->
3969  GetRightAdjacentElementTrace();
3970 
3971  // Serial case: right element is connected so we can
3972  // just grab that normal.
3973  locnormals = loc_elmt->GetTraceNormal(EdgeNumber);
3974 
3975  offset = m_phys_offset[i];
3976 
3977  // Process each point in the expansion.
3978  for (j = 0; j < e_npoints; ++j)
3979  {
3980  // Process each spatial dimension and
3981  // copy the values into the output
3982  // array.
3983  for (k = 0; k < coordim; ++k)
3984  {
3985  normals[k][offset + j] = -locnormals[k][j];
3986  }
3987  }
3988  }
3989  else
3990  {
3991  // Parallel case: need to interpolate normal.
3992  Array<OneD, Array<OneD, NekDouble> > normal(coordim);
3993 
3994  for (int p = 0; p < coordim; ++p)
3995  {
3996  normal[p] = Array<OneD, NekDouble>(e_npoints,0.0);
3997  LibUtilities::PointsKey to_key =
3998  loc_exp->GetBasis(0)->GetPointsKey();
3999  LibUtilities::PointsKey from_key =
4000  loc_elmt->GetBasis(0)->GetPointsKey();
4001  LibUtilities::Interp1D(from_key,
4002  locnormals[p],
4003  to_key,
4004  normal[p]);
4005  }
4006 
4007  offset = m_phys_offset[i];
4008 
4009  // Process each point in the expansion.
4010  for (j = 0; j < e_npoints; ++j)
4011  {
4012  // Process each spatial dimension and copy the values
4013  // into the output array.
4014  for (k = 0; k < coordim; ++k)
4015  {
4016  normals[k][offset + j] = normal[k][j];
4017  }
4018  }
4019  }
4020  }
4021  else
4022  {
4023  // Get the physical data offset for this expansion.
4024  offset = m_phys_offset[i];
4025 
4026  // Process each point in the expansion.
4027  for (j = 0; j < e_npoints; ++j)
4028  {
4029  // Process each spatial dimension and copy the values
4030  // into the output array.
4031  for (k = 0; k < coordim; ++k)
4032  {
4033  normals[k][offset + j] = locnormals[k][j];
4034  }
4035  }
4036  }
4037  }
4038  }
4039  break;
4040  case e2D:
4041  {
4042  Array<OneD, NekDouble> tmp;
4043 
4044  // Process each expansion.
4045  for (i = 0; i < m_exp->size(); ++i)
4046  {
4047  LocalRegions::ExpansionSharedPtr traceExp = (*m_exp)[i];
4049  traceExp->GetLeftAdjacentElementExp();
4050 
4051  // Get the number of points and normals for this expansion.
4052  int faceNum = traceExp->GetLeftAdjacentElementTrace();
4053  int offset = m_phys_offset[i];
4054 
4055  const Array<OneD, const Array<OneD, NekDouble> > &locNormals
4056  = exp3D->GetTraceNormal(faceNum);
4057 
4058  // Project normals from 3D element onto the same
4059  // orientation as the trace expansion.
4060  StdRegions::Orientation orient = exp3D->
4061  GetTraceOrient(faceNum);
4062 
4063  int fromid0,fromid1;
4064 
4066  {
4067  fromid0 = 0;
4068  fromid1 = 1;
4069  }
4070  else
4071  {
4072  fromid0 = 1;
4073  fromid1 = 0;
4074  }
4075 
4076  LibUtilities::BasisKey faceBasis0
4077  = exp3D->GetTraceBasisKey(faceNum, fromid0);
4078  LibUtilities::BasisKey faceBasis1
4079  = exp3D->GetTraceBasisKey(faceNum, fromid1);
4080  LibUtilities::BasisKey traceBasis0
4081  = traceExp->GetBasis(0)->GetBasisKey();
4082  LibUtilities::BasisKey traceBasis1
4083  = traceExp->GetBasis(1)->GetBasisKey();
4084 
4085  const int faceNq0 = faceBasis0.GetNumPoints();
4086  const int faceNq1 = faceBasis1.GetNumPoints();
4087 
4088  Array<OneD, int> faceids;
4089  exp3D->ReOrientTracePhysMap(orient,faceids,faceNq0,faceNq1);
4090 
4091  Array<OneD, NekDouble> traceNormals(faceNq0 * faceNq1);
4092 
4093  for (j = 0; j < coordim; ++j)
4094  {
4095  Vmath::Scatr(faceNq0*faceNq1,locNormals[j],faceids,
4096  traceNormals);
4097 
4098  LibUtilities::Interp2D(faceBasis0.GetPointsKey(),
4099  faceBasis1.GetPointsKey(),
4100  traceNormals,
4101  traceBasis0.GetPointsKey(),
4102  traceBasis1.GetPointsKey(),
4103  tmp = normals[j]+offset);
4104  }
4105  }
4106  }
4107  break;
4108  default:
4109  {
4111  "This method is not defined or valid for this class type");
4112  }
4113  }
4114  }
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:63
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
Definition: Vmath.cpp:772

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

Referenced by GetNormals().

◆ v_GetNumElmts()

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

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

Definition at line 1364 of file ExpList.h.

1365  {
1366  return (*m_exp).size();
1367  }

Referenced by GetNumElmts().

◆ v_GetPeriodicEntities()

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

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

Definition at line 4973 of file ExpList.cpp.

4977  {
4978  boost::ignore_unused(periodicVerts, periodicEdges, periodicFaces);
4980  "This method is not defined or valid for this class type");
4981  }

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

Referenced by GetPeriodicEntities().

◆ v_GetPlane()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 5005 of file ExpList.cpp.

5006  {
5007  boost::ignore_unused(n);
5009  "This method is not defined or valid for this class type");
5010  return NullExpListSharedPtr;
5011  }
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1792

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

Referenced by GetPlane().

◆ v_GetRobinBCInfo()

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

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

Definition at line 4963 of file ExpList.cpp.

4964  {
4966  "This method is not defined or valid for this class type");
4967  static map<int,RobinBCInfoSharedPtr> result;
4968  return result;
4969  }

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

Referenced by GetRobinBCInfo().

◆ v_GetTrace()

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

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

Definition at line 3797 of file ExpList.cpp.

3798  {
3800  "This method is not defined or valid for this class type");
3801  static std::shared_ptr<ExpList> returnVal;
3802  return returnVal;
3803  }

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

3814  {
3815  return GetTraceMap()->GetBndCondIDToGlobalTraceID();
3816  }
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
Definition: ExpList.h:2530

References GetTraceMap().

Referenced by GetTraceBndMap().

◆ v_GetTraceMap()

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

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

Definition at line 3805 of file ExpList.cpp.

3806  {
3808  "This method is not defined or valid for this class type");
3809  static std::shared_ptr<AssemblyMapDG> result;
3810  return result;
3811  }

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

3162  {
3164  "This method is not defined or valid for this class type");
3166  return trans;
3167  }
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 3192 of file ExpList.cpp.

3193  {
3195  "This method is not defined or valid for this class type");
3196  Array<OneD, unsigned int> NoModes(1);
3197  return NoModes;
3198  }

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

3185  {
3187  "This method is not defined or valid for this class type");
3188  Array<OneD, unsigned int> NoModes(1);
3189  return NoModes;
3190  }

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

4601  {
4602  boost::ignore_unused(inarray, outarray);
4604  "This method is not defined or valid for this class type");
4605  }

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

◆ v_GlobalToLocal() [2/2]

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

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

Definition at line 4592 of file ExpList.cpp.

4593  {
4595  "This method is not defined or valid for this class type");
4596  }

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

Referenced by GlobalToLocal().

◆ v_HelmSolve()

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

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

Definition at line 4408 of file ExpList.cpp.

4416  {
4417  boost::ignore_unused(inarray, outarray, factors, varcoeff,
4418  varfactors, dirForcing, PhysSpaceForcing);
4419  NEKERROR(ErrorUtil::efatal, "HelmSolve not implemented.");
4420  }

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

Referenced by HelmSolve().

◆ v_HomogeneousBwdTrans()

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

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

Definition at line 4456 of file ExpList.cpp.

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

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

3154  {
3156  "This method is not defined or valid for this class type");
3157  Array<OneD, NekDouble> NoEnergy(1,0.0);
3158  return NoEnergy;
3159  }

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

Referenced by HomogeneousEnergy().

◆ v_HomogeneousFwdTrans()

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

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

Definition at line 4446 of file ExpList.cpp.

4450  {
4451  boost::ignore_unused(inarray, outarray, Shuff, UnShuff);
4453  "This method is not defined or valid for this class type");
4454  }

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

Referenced by HomogeneousFwdTrans().

◆ v_ImposeDirichletConditions()

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

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

Definition at line 4550 of file ExpList.cpp.

4551  {
4552  boost::ignore_unused(outarray);
4554  "This method is not defined or valid for this class type");
4555  }

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

3121  {
3122  NekDouble sum = 0.0;
3123  int i = 0;
3124 
3125  for (i = 0; i < (*m_exp).size(); ++i)
3126  {
3127  sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
3128  }
3129  m_comm->GetRowComm()->AllReduce(sum, LibUtilities::ReduceSum);
3130 
3131  return sum;
3132  }

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

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

Definition at line 4620 of file ExpList.cpp.

4623  {
4624  // initialise if required
4626  {
4627  for (int i = 0; i < m_collections.size(); ++i)
4628  {
4630  }
4632  }
4633 
4634  Array<OneD,NekDouble> tmp;
4635  for (int i = 0; i < m_collections.size(); ++i)
4636  {
4637 
4639  inarray + m_coll_phys_offset[i],
4640  tmp = outarray + m_coll_coeff_offset[i]);
4641  }
4642  }

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

Referenced by IProductWRTBase().

◆ v_IProductWRTBase_IterPerExp()

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

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

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

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

Definition at line 1262 of file ExpList.cpp.

1265  {
1266  // initialise if required
1268  {
1269  for (int i = 0; i < m_collections.size(); ++i)
1270  {
1272  }
1274  }
1275 
1276  Array<OneD,NekDouble> tmp;
1277  for (int i = 0; i < m_collections.size(); ++i)
1278  {
1279 
1281  inarray + m_coll_phys_offset[i],
1282  tmp = outarray + m_coll_coeff_offset[i]);
1283  }
1284  }

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

Referenced by IProductWRTBase_IterPerExp().

◆ v_L2()

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

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

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

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

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

Definition at line 3074 of file ExpList.cpp.

3077  {
3078  NekDouble err = 0.0, errl2;
3079  int i;
3080 
3081  if (soln == NullNekDouble1DArray)
3082  {
3083  for (i = 0; i < (*m_exp).size(); ++i)
3084  {
3085  errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i]);
3086  err += errl2*errl2;
3087  }
3088  }
3089  else
3090  {
3091  for (i = 0; i < (*m_exp).size(); ++i)
3092  {
3093  errl2 = (*m_exp)[i]->L2(inarray + m_phys_offset[i],
3094  soln + m_phys_offset[i]);
3095  err += errl2*errl2;
3096  }
3097  }
3098 
3099  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
3100 
3101  return sqrt(err);
3102  }

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

Referenced by L2().

◆ v_LinearAdvectionDiffusionReactionSolve()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 4422 of file ExpList.cpp.

4428  {
4429  boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4431  "This method is not defined or valid for this class type");
4432  }

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

Referenced by LinearAdvectionDiffusionReactionSolve().

◆ v_LinearAdvectionReactionSolve()

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

Reimplemented in Nektar::MultiRegions::ContField.

Definition at line 4434 of file ExpList.cpp.

4440  {
4441  boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4443  "This method is not defined or valid for this class type");
4444  }

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

Referenced by LinearAdvectionReactionSolve().

◆ v_LocalToGlobal() [1/2]

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

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

Definition at line 4574 of file ExpList.cpp.

4575  {
4576  boost::ignore_unused(useComm);
4578  "This method is not defined or valid for this class type");
4579  }

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

4585  {
4586  boost::ignore_unused(inarray, outarray, useComm);
4588  "This method is not defined or valid for this class type");
4589  }

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

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

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

4507  {
4508  Array< OneD, NekDouble> tmp;
4509  switch (GetCoordim(0))
4510  {
4511  case 1:
4512  {
4513  for(int i = 0; i < GetExpSize(); ++i)
4514  {
4515  (*m_exp)[i]->NormVectorIProductWRTBase(
4516  V[0] + GetPhys_Offset(i),
4517  tmp = outarray + GetCoeff_Offset(i));
4518  }
4519  }
4520  break;
4521  case 2:
4522  {
4523  for(int i = 0; i < GetExpSize(); ++i)
4524  {
4525  (*m_exp)[i]->NormVectorIProductWRTBase(
4526  V[0] + GetPhys_Offset(i),
4527  V[1] + GetPhys_Offset(i),
4528  tmp = outarray + GetCoeff_Offset(i));
4529  }
4530  }
4531  break;
4532  case 3:
4533  {
4534  for(int i = 0; i < GetExpSize(); ++i)
4535  {
4536  (*m_exp)[i]->NormVectorIProductWRTBase(
4537  V[0] + GetPhys_Offset(i),
4538  V[1] + GetPhys_Offset(i),
4539  V[2] + GetPhys_Offset(i),
4540  tmp = outarray + GetCoeff_Offset(i));
4541  }
4542  }
4543  break;
4544  default:
4545  NEKERROR(ErrorUtil::efatal,"Dimension not supported");
4546  break;
4547  }
4548  }
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n.
Definition: ExpList.h:2431
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2401

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

4498  {
4499  boost::ignore_unused(V1, V2, outarray, BndID);
4501  "This method is not defined or valid for this class type");
4502  }

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

4921  {
4922  boost::ignore_unused(Fwd, Bwd);
4923  NEKERROR(ErrorUtil::efatal, "v_PeriodicBwdCopy not defined");
4924  }

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

Referenced by PeriodicBwdCopy().

◆ v_PhysDeriv() [1/3]

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

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

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

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

Definition at line 1465 of file ExpList.cpp.

1469  {
1470  Array<OneD, NekDouble> e_out_d0;
1471  Array<OneD, NekDouble> e_out_d1;
1472  Array<OneD, NekDouble> e_out_d2;
1473  int offset;
1474 
1475  // initialise if required
1477  {
1478  for (int i = 0; i < m_collections.size(); ++i)
1479  {
1480  m_collections[i].Initialise(Collections::ePhysDeriv);
1481  }
1483  }
1484 
1485  LibUtilities::Timer timer;
1486  timer.Start();
1487  for (int i = 0; i < m_collections.size(); ++i)
1488  {
1489  offset = m_coll_phys_offset[i];
1490  e_out_d0 = out_d0 + offset;
1491  e_out_d1 = out_d1 + offset;
1492  e_out_d2 = out_d2 + offset;
1493 
1494 
1495  m_collections[i].ApplyOperator(Collections::ePhysDeriv,
1496  inarray + offset,
1497  e_out_d0,e_out_d1, e_out_d2);
1498 
1499 
1500  }
1501  timer.Stop();
1502  // Elapsed time
1503  timer.AccumulateRegion("Collections:PhysDeriv");
1504  }

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

1509  {
1510  Direction edir = DirCartesianMap[dir];
1511  v_PhysDeriv(edir, inarray,out_d);
1512  }
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::ExpListHomogeneous2D, and Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1514 of file ExpList.cpp.

1516  {
1517  int i;
1518  if(edir==MultiRegions::eS)
1519  {
1520  Array<OneD, NekDouble> e_out_ds;
1521  for(i=0; i<(*m_exp).size(); ++i)
1522  {
1523  e_out_ds = out_d + m_phys_offset[i];
1524  (*m_exp)[i]->PhysDeriv_s(inarray+m_phys_offset[i],e_out_ds);
1525  }
1526  }
1527  else if(edir==MultiRegions::eN)
1528  {
1529  Array<OneD, NekDouble > e_out_dn;
1530  for(i=0; i<(*m_exp).size(); i++)
1531  {
1532  e_out_dn = out_d +m_phys_offset[i];
1533  (*m_exp)[i]->PhysDeriv_n(inarray+m_phys_offset[i],e_out_dn);
1534  }
1535  }
1536  else
1537  {
1538 
1539  // initialise if required
1541  {
1542  for (int i = 0; i < m_collections.size(); ++i)
1543  {
1544  m_collections[i].Initialise(Collections::ePhysDeriv);
1545  }
1547  }
1548 
1549  // convert enum into int
1550  int intdir= (int)edir;
1551  Array<OneD, NekDouble> e_out_d;
1552  int offset;
1553  for (int i = 0; i < m_collections.size(); ++i)
1554  {
1555  offset = m_coll_phys_offset[i];
1556  e_out_d = out_d + offset;
1557 
1558  m_collections[i].ApplyOperator(Collections::ePhysDeriv,
1559  intdir,
1560  inarray + offset,
1561  e_out_d);
1562  }
1563  }
1564  }

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

1642  {
1643  int npts_e;
1644  int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1645  int nq = direction.size() / coordim;
1646 
1647  Array<OneD, NekDouble> e_outarray;
1648  Array<OneD, NekDouble> e_MFdiv;
1649  Array<OneD, NekDouble> locdir;
1650 
1651  for(int i = 0; i < (*m_exp).size(); ++i)
1652  {
1653  npts_e = (*m_exp)[i]->GetTotPoints();
1654  locdir = Array<OneD, NekDouble>(npts_e*coordim);
1655 
1656  for (int k = 0; k<coordim; ++k)
1657  {
1658  Vmath::Vcopy(npts_e, &direction[k*nq+m_phys_offset[i]], 1,
1659  &locdir[k*npts_e], 1);
1660  }
1661 
1662  (*m_exp)[i]->PhysDirectionalDeriv(
1663  inarray + m_phys_offset[i],
1664  locdir,
1665  e_outarray = outarray+m_phys_offset[i] );
1666  }
1667  }

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

5837  {
5838  int cnt,cnt1;
5839 
5840  cnt = cnt1 = 0;
5841 
5842  switch(m_expType)
5843  {
5844  case e2D:
5845  {
5846  for(int i = 0; i < GetExpSize(); ++i)
5847  {
5848  // get new points key
5849  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5850  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5851  int npt0 = (int) pt0*scale;
5852  int npt1 = (int) pt1*scale;
5853 
5854  LibUtilities::PointsKey newPointsKey0(npt0,
5855  (*m_exp)[i]->GetPointsType(0));
5856  LibUtilities::PointsKey newPointsKey1(npt1,
5857  (*m_exp)[i]->GetPointsType(1));
5858 
5859  // Project points;
5861  newPointsKey1,
5862  &inarray[cnt],
5863  (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5864  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5865  &outarray[cnt1]);
5866 
5867  cnt += npt0*npt1;
5868  cnt1 += pt0*pt1;
5869  }
5870  }
5871  break;
5872  case e3D:
5873  {
5874  for(int i = 0; i < GetExpSize(); ++i)
5875  {
5876  // get new points key
5877  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5878  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5879  int pt2 = (*m_exp)[i]->GetNumPoints(2);
5880  int npt0 = (int) pt0*scale;
5881  int npt1 = (int) pt1*scale;
5882  int npt2 = (int) pt2*scale;
5883 
5884  LibUtilities::PointsKey newPointsKey0(npt0,
5885  (*m_exp)[i]->GetPointsType(0));
5886  LibUtilities::PointsKey newPointsKey1(npt1,
5887  (*m_exp)[i]->GetPointsType(1));
5888  LibUtilities::PointsKey newPointsKey2(npt2,
5889  (*m_exp)[i]->GetPointsType(2));
5890 
5891  // Project points;
5893  newPointsKey1,
5894  newPointsKey2,
5895  &inarray[cnt],
5896  (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5897  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5898  (*m_exp)[i]->GetBasis(2)->GetPointsKey(),
5899  &outarray[cnt1]);
5900 
5901  cnt += npt0*npt1*npt2;
5902  cnt1 += pt0*pt1*pt2;
5903  }
5904  }
5905  break;
5906  default:
5907  {
5908  NEKERROR(ErrorUtil::efatal,"not setup for this expansion");
5909  }
5910  break;
5911  }
5912  }
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 5170 of file ExpList.cpp.

5174  {
5175  int cnt,cnt1;
5176 
5177  cnt = cnt1 = 0;
5178 
5179  switch(m_expType)
5180  {
5181  case e2D:
5182  {
5183  for(int i = 0; i < GetExpSize(); ++i)
5184  {
5185  // get new points key
5186  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5187  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5188  int npt0 = (int) pt0*scale;
5189  int npt1 = (int) pt1*scale;
5190 
5191  LibUtilities::PointsKey newPointsKey0(npt0,
5192  (*m_exp)[i]->GetPointsType(0));
5193  LibUtilities::PointsKey newPointsKey1(npt1,
5194  (*m_exp)[i]->GetPointsType(1));
5195 
5196  // Interpolate points;
5197  LibUtilities::Interp2D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5198  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5199  &inarray[cnt],newPointsKey0,
5200  newPointsKey1,&outarray[cnt1]);
5201 
5202  cnt += pt0*pt1;
5203  cnt1 += npt0*npt1;
5204  }
5205  }
5206  break;
5207  case e3D:
5208  {
5209  for(int i = 0; i < GetExpSize(); ++i)
5210  {
5211  // get new points key
5212  int pt0 = (*m_exp)[i]->GetNumPoints(0);
5213  int pt1 = (*m_exp)[i]->GetNumPoints(1);
5214  int pt2 = (*m_exp)[i]->GetNumPoints(2);
5215  int npt0 = (int) pt0*scale;
5216  int npt1 = (int) pt1*scale;
5217  int npt2 = (int) pt2*scale;
5218 
5219  LibUtilities::PointsKey newPointsKey0(npt0,(*m_exp)[i]->GetPointsType(0));
5220  LibUtilities::PointsKey newPointsKey1(npt1,(*m_exp)[i]->GetPointsType(1));
5221  LibUtilities::PointsKey newPointsKey2(npt2,(*m_exp)[i]->GetPointsType(2));
5222 
5223  // Interpolate points;
5224  LibUtilities::Interp3D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
5225  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
5226  (*m_exp)[i]->GetBasis(2)->GetPointsKey(),
5227  &inarray[cnt], newPointsKey0,
5228  newPointsKey1, newPointsKey2,
5229  &outarray[cnt1]);
5230 
5231  cnt += pt0*pt1*pt2;
5232  cnt1 += npt0*npt1*npt2;
5233  }
5234  }
5235  break;
5236  default:
5237  {
5238  NEKERROR(ErrorUtil::efatal,"This expansion is not set");
5239  }
5240  break;
5241  }
5242  }
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:185

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

2581  {
2582  // Reset matrix managers.
2583  LibUtilities::NekManager<LocalRegions::MatrixKey,
2584  DNekScalMat, LocalRegions::MatrixKey::opLess>::ClearManager();
2585  LibUtilities::NekManager<LocalRegions::MatrixKey,
2586  DNekScalBlkMat, LocalRegions::MatrixKey::opLess>::ClearManager();
2587 
2588  // Loop over all elements and reset geometry information.
2589  for (int i = 0; i < m_exp->size(); ++i)
2590  {
2591  (*m_exp)[i]->GetGeom()->Reset(m_graph->GetCurvedEdges(),
2592  m_graph->GetCurvedFaces());
2593  }
2594 
2595  // Loop over all elements and rebuild geometric factors.
2596  for (int i = 0; i < m_exp->size(); ++i)
2597  {
2598  (*m_exp)[i]->Reset();
2599  }
2600  }
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
Definition: NekTypeDefs.hpp:65

References m_exp, and m_graph.

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

◆ v_SetBndCondBwdWeight()

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

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

Definition at line 4365 of file ExpList.cpp.

4368  {
4369  boost::ignore_unused(index, value);
4371  "v_setBndCondBwdWeight is not defined for this class type");
4372  }

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

Referenced by SetBndCondBwdWeight().

◆ v_SetHomo1DSpecVanVisc()

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

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 1773 of file ExpList.h.

1774  {
1775  boost::ignore_unused(visc);
1777  "This method is not defined or valid for this class type");
1778  }

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

3178  {
3179  boost::ignore_unused(lhom);
3181  "This method is not defined or valid for this class type");
3182  }

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

Referenced by SetHomoLen().

◆ v_SetUpPhysNormals()

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

Definition at line 4716 of file ExpList.cpp.

4717  {
4718  for (int i = 0; i < m_exp->size(); ++i)
4719  {
4720  for (int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
4721  {
4722  (*m_exp)[i]->ComputeTraceNormal(j);
4723  }
4724  }
4725  }

References m_exp.

Referenced by SetUpPhysNormals().

◆ v_SmoothField()

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

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

Parameters
fieldAn array containing the field in physical space

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

Definition at line 1767 of file ExpList.cpp.

1768  {
1769  boost::ignore_unused(field);
1770  // Do nothing unless the method is implemented in the appropriate
1771  // class, i.e. ContField1D,ContField2D, etc.
1772 
1773  // So far it has been implemented just for ContField2D and
1774  // ContField3DHomogeneous1D
1775 
1776  // Block in case users try the smoothing with a modal expansion.
1777  // Maybe a different techique for the smoothing require
1778  // implementation for modal basis.
1779 
1780  ASSERTL0((*m_exp)[0]->GetBasisType(0)
1782  (*m_exp)[0]->GetBasisType(0)
1784  "Smoothing is currently not allowed unless you are using "
1785  "a nodal base for efficiency reasons. The implemented "
1786  "smoothing technique requires the mass matrix inversion "
1787  "which is trivial just for GLL_LAGRANGE_SEM and "
1788  "GAUSS_LAGRANGE_SEMexpansions.");
1789  }

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

Referenced by SmoothField().

◆ v_UpdateBndCondExpansion()

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

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

Definition at line 3677 of file ExpList.cpp.

3678  {
3679  boost::ignore_unused(i);
3681  "This method is not defined or valid for this class type");
3682  static std::shared_ptr<ExpList> result;
3683  return result;
3684  }

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

Referenced by UpdateBndCondExpansion().

◆ v_UpdateBndConditions()

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

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

Definition at line 4940 of file ExpList.cpp.

4941  {
4943  "This method is not defined or valid for this class type");
4944  static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
4945  return result;
4946  }

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

3701  {
3702  switch(m_expType)
3703  {
3704  case e1D:
3705  {
3706  int i,j,k,e_npoints,offset;
3707  Array<OneD,NekDouble> normals;
3708  NekDouble Vn;
3709 
3710  // Assume whole array is of same coordimate dimension
3711  int coordim = GetCoordim(0);
3712 
3713  ASSERTL1(Vec.size() >= coordim,
3714  "Input vector does not have sufficient dimensions to "
3715  "match coordim");
3716 
3717  // Process each expansion
3718  for(i = 0; i < m_exp->size(); ++i)
3719  {
3720  // Get the number of points in the expansion and the normals.
3721  e_npoints = (*m_exp)[i]->GetNumPoints(0);
3722  normals = (*m_exp)[i]->GetPhysNormals();
3723 
3724  // Get the physical data offset of the expansion in m_phys.
3725  offset = m_phys_offset[i];
3726 
3727  // Compute each data point.
3728  for(j = 0; j < e_npoints; ++j)
3729  {
3730  // Calculate normal velocity.
3731  Vn = 0.0;
3732  for(k = 0; k < coordim; ++k)
3733  {
3734  Vn += Vec[k][offset+j]*normals[k*e_npoints + j];
3735  }
3736 
3737  // Upwind based on direction of normal velocity.
3738  if(Vn > 0.0)
3739  {
3740  Upwind[offset + j] = Fwd[offset + j];
3741  }
3742  else
3743  {
3744  Upwind[offset + j] = Bwd[offset + j];
3745  }
3746  }
3747  }
3748  }
3749  break;
3750  default:
3752  "This method is not defined or valid for this class type");
3753  break;
3754  }
3755  }

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

3775  {
3776  ASSERTL1(Vn.size() >= m_npoints,"Vn is not of sufficient length");
3777  ASSERTL1(Fwd.size() >= m_npoints,"Fwd is not of sufficient length");
3778  ASSERTL1(Bwd.size() >= m_npoints,"Bwd is not of sufficient length");
3779  ASSERTL1(Upwind.size() >= m_npoints,
3780  "Upwind is not of sufficient length");
3781 
3782  // Process each point in the expansion.
3783  for(int j = 0; j < m_npoints; ++j)
3784  {
3785  // Upwind based on one-dimensional velocity.
3786  if(Vn[j] > 0.0)
3787  {
3788  Upwind[j] = Fwd[j];
3789  }
3790  else
3791  {
3792  Upwind[j] = Bwd[j];
3793  }
3794  }
3795  }

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

3135  {
3136  NekDouble flux = 0.0;
3137  int i = 0;
3138  int j;
3139 
3140  for (i = 0; i < (*m_exp).size(); ++i)
3141  {
3142  Array<OneD, Array<OneD, NekDouble> > tmp(inarray.size());
3143  for (j = 0; j < inarray.size(); ++j)
3144  {
3145  tmp[j] = Array<OneD, NekDouble>(inarray[j] + m_phys_offset[i]);
3146  }
3147  flux += (*m_exp)[i]->VectorFlux(tmp);
3148  }
3149 
3150  return flux;
3151  }

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

2743  {
2744  int i,j,k,l;
2745  int nbase = (*m_exp)[0]->GetNumBases();
2746  int cnt = 0;
2747 
2748  std::shared_ptr<LocalRegions::ExpansionVector> exp = m_exp;
2749 
2750  if (expansion != -1)
2751  {
2752  exp = std::shared_ptr<LocalRegions::ExpansionVector>(
2754  (*exp)[0] = (*m_exp)[expansion];
2755  }
2756 
2757  if (nbase == 2)
2758  {
2759  for(i = 0; i < (*exp).size(); ++i)
2760  {
2761  const int np0 = (*exp)[i]->GetNumPoints(0);
2762  const int np1 = (*exp)[i]->GetNumPoints(1);
2763 
2764  for(j = 1; j < np1; ++j)
2765  {
2766  for(k = 1; k < np0; ++k)
2767  {
2768  outfile << cnt + (j-1)*np0 + k << " ";
2769  outfile << cnt + (j-1)*np0 + k+1 << " ";
2770  outfile << cnt + j *np0 + k+1 << " ";
2771  outfile << cnt + j *np0 + k << endl;
2772  }
2773  }
2774 
2775  cnt += np0*np1;
2776  }
2777  }
2778  else if (nbase == 3)
2779  {
2780  for(i = 0; i < (*exp).size(); ++i)
2781  {
2782  const int np0 = (*exp)[i]->GetNumPoints(0);
2783  const int np1 = (*exp)[i]->GetNumPoints(1);
2784  const int np2 = (*exp)[i]->GetNumPoints(2);
2785  const int np01 = np0*np1;
2786 
2787  for(j = 1; j < np2; ++j)
2788  {
2789  for(k = 1; k < np1; ++k)
2790  {
2791  for(l = 1; l < np0; ++l)
2792  {
2793  outfile << cnt + (j-1)*np01 + (k-1)*np0 + l << " ";
2794  outfile << cnt + (j-1)*np01 + (k-1)*np0 + l+1 << " ";
2795  outfile << cnt + (j-1)*np01 + k *np0 + l+1 << " ";
2796  outfile << cnt + (j-1)*np01 + k *np0 + l << " ";
2797  outfile << cnt + j *np01 + (k-1)*np0 + l << " ";
2798  outfile << cnt + j *np01 + (k-1)*np0 + l+1 << " ";
2799  outfile << cnt + j *np01 + k *np0 + l+1 << " ";
2800  outfile << cnt + j *np01 + k *np0 + l << endl;
2801  }
2802  }
2803  }
2804  cnt += np0*np1*np2;
2805  }
2806  }
2807  else
2808  {
2809  NEKERROR(ErrorUtil::efatal,"Not set up for this dimension");
2810  }
2811  }
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 2818 of file ExpList.cpp.

2819  {
2820  if (expansion == -1)
2821  {
2822  int totpoints = GetTotPoints();
2823  if(m_physState == false)
2824  {
2826  }
2827 
2828  for(int i = 0; i < totpoints; ++i)
2829  {
2830  outfile << m_phys[i] << " ";
2831  if(i % 1000 == 0 && i)
2832  {
2833  outfile << std::endl;
2834  }
2835  }
2836  outfile << std::endl;
2837 
2838  }
2839  else
2840  {
2841  int nPoints = (*m_exp)[expansion]->GetTotPoints();
2842 
2843  for (int i = 0; i < nPoints; ++i)
2844  {
2845  outfile << m_phys[i + m_phys_offset[expansion]] << " ";
2846  }
2847 
2848  outfile << std::endl;
2849  }
2850  }

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

2609  {
2610  if (GetNumElmts() == 0)
2611  {
2612  return;
2613  }
2614 
2615  int coordim = GetExp(0)->GetCoordim();
2616  char vars[3] = { 'x', 'y', 'z' };
2617 
2618  if (m_expType == e3DH1D)
2619  {
2620  coordim += 1;
2621  }
2622  else if (m_expType == e3DH2D)
2623  {
2624  coordim += 2;
2625  }
2626 
2627  outfile << "Variables = x";
2628  for (int i = 1; i < coordim; ++i)
2629  {
2630  outfile << ", " << vars[i];
2631  }
2632 
2633  if (var.size() > 0)
2634  {
2635  outfile << ", " << var;
2636  }
2637 
2638  outfile << std::endl << std::endl;
2639  }

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

Referenced by WriteTecplotHeader().

◆ v_WriteTecplotZone()

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

Write Tecplot Files Zone

Parameters
outfileOutput file name.
expansionExpansion that is considered

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

Definition at line 2646 of file ExpList.cpp.

2647  {
2648  int i, j;
2649  int coordim = GetCoordim(0);
2650  int nPoints = GetTotPoints();
2651  int nBases = (*m_exp)[0]->GetNumBases();
2652  int numBlocks = 0;
2653 
2654  Array<OneD, Array<OneD, NekDouble> > coords(3);
2655 
2656  if (expansion == -1)
2657  {
2658  nPoints = GetTotPoints();
2659 
2660  coords[0] = Array<OneD, NekDouble>(nPoints);
2661  coords[1] = Array<OneD, NekDouble>(nPoints);
2662  coords[2] = Array<OneD, NekDouble>(nPoints);
2663 
2664  GetCoords(coords[0], coords[1], coords[2]);
2665 
2666  for (i = 0; i < m_exp->size(); ++i)
2667  {
2668  int numInt = 1;
2669 
2670  for (j = 0; j < nBases; ++j)
2671  {
2672  numInt *= (*m_exp)[i]->GetNumPoints(j)-1;
2673  }
2674 
2675  numBlocks += numInt;
2676  }
2677  }
2678  else
2679  {
2680  nPoints = (*m_exp)[expansion]->GetTotPoints();
2681 
2682  coords[0] = Array<OneD, NekDouble>(nPoints);
2683  coords[1] = Array<OneD, NekDouble>(nPoints);
2684  coords[2] = Array<OneD, NekDouble>(nPoints);
2685 
2686  (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
2687 
2688  numBlocks = 1;
2689  for (j = 0; j < nBases; ++j)
2690  {
2691  numBlocks *= (*m_exp)[expansion]->GetNumPoints(j)-1;
2692  }
2693  }
2694 
2695  if (m_expType == e3DH1D)
2696  {
2697  nBases += 1;
2698  coordim += 1;
2699  int nPlanes = GetZIDs().size();
2700  NekDouble tmp = numBlocks * (nPlanes-1.0) / nPlanes;
2701  numBlocks = (int)tmp;
2702  }
2703  else if (m_expType == e3DH2D)
2704  {
2705  nBases += 2;
2706  coordim += 1;
2707  }
2708 
2709  outfile << "Zone, N=" << nPoints << ", E="
2710  << numBlocks << ", F=FEBlock" ;
2711 
2712  switch(nBases)
2713  {
2714  case 2:
2715  outfile << ", ET=QUADRILATERAL" << std::endl;
2716  break;
2717  case 3:
2718  outfile << ", ET=BRICK" << std::endl;
2719  break;
2720  default:
2722  "Not set up for this type of output");
2723  break;
2724  }
2725 
2726  // Write out coordinates
2727  for (j = 0; j < coordim; ++j)
2728  {
2729  for (i = 0; i < nPoints; ++i)
2730  {
2731  outfile << coords[j][i] << " ";
2732  if (i % 1000 == 0 && i)
2733  {
2734  outfile << std::endl;
2735  }
2736  }
2737  outfile << std::endl;
2738  }
2739  }
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:2089
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:677

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

Referenced by WriteTecplotZone().

◆ v_WriteVtkPieceData()

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

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

Definition at line 2998 of file ExpList.cpp.

3000  {
3001  int i;
3002  int nq = (*m_exp)[expansion]->GetTotPoints();
3003 
3004  // printing the fields of that zone
3005  outfile << " <DataArray type=\"Float64\" Name=\""
3006  << var << "\">" << endl;
3007  outfile << " ";
3008  const Array<OneD, NekDouble> phys = m_phys + m_phys_offset[expansion];
3009  for(i = 0; i < nq; ++i)
3010  {
3011  outfile << (fabs(phys[i]) < NekConstants::kNekZeroTol ? 0 : phys[i]) << " ";
3012  }
3013  outfile << endl;
3014  outfile << " </DataArray>" << endl;
3015  }
static const NekDouble kNekZeroTol

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

Referenced by WriteVtkPieceData().

◆ v_WriteVtkPieceHeader()

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

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

Definition at line 2866 of file ExpList.cpp.

2867  {
2868  boost::ignore_unused(istrip);
2869  int i,j,k;
2870  int nbase = (*m_exp)[expansion]->GetNumBases();
2871  int ntot = (*m_exp)[expansion]->GetTotPoints();
2872  int nquad[3];
2873 
2874  int ntotminus = 1;
2875  for(i = 0; i < nbase; ++i)
2876  {
2877  nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
2878  ntotminus *= (nquad[i]-1);
2879  }
2880 
2881  Array<OneD,NekDouble> coords[3];
2882  coords[0] = Array<OneD,NekDouble>(ntot, 0.0);
2883  coords[1] = Array<OneD,NekDouble>(ntot, 0.0);
2884  coords[2] = Array<OneD,NekDouble>(ntot, 0.0);
2885  (*m_exp)[expansion]->GetCoords(coords[0],coords[1],coords[2]);
2886 
2887  outfile << " <Piece NumberOfPoints=\""
2888  << ntot << "\" NumberOfCells=\""
2889  << ntotminus << "\">" << endl;
2890  outfile << " <Points>" << endl;
2891  outfile << " <DataArray type=\"Float64\" "
2892  << "NumberOfComponents=\"3\" format=\"ascii\">" << endl;
2893  outfile << " ";
2894  for (i = 0; i < ntot; ++i)
2895  {
2896  for (j = 0; j < 3; ++j)
2897  {
2898  outfile << setprecision(8) << scientific
2899  << (float)coords[j][i] << " ";
2900  }
2901  outfile << endl;
2902  }
2903  outfile << endl;
2904  outfile << " </DataArray>" << endl;
2905  outfile << " </Points>" << endl;
2906  outfile << " <Cells>" << endl;
2907  outfile << " <DataArray type=\"Int32\" "
2908  << "Name=\"connectivity\" format=\"ascii\">" << endl;
2909 
2910  int ns = 0; // pow(2,dim) for later usage
2911  string ostr;
2912  switch(m_expType)
2913  {
2914  case e1D:
2915  {
2916  ns = 2;
2917  ostr = "3 ";
2918  for (i = 0; i < nquad[0]-1; ++i)
2919  {
2920  outfile << i << " " << i+1 << endl;
2921  }
2922  }
2923  break;
2924  case e2D:
2925  {
2926  ns = 4;
2927  ostr = "9 ";
2928  for (i = 0; i < nquad[0]-1; ++i)
2929  {
2930  for (j = 0; j < nquad[1]-1; ++j)
2931  {
2932  outfile << j*nquad[0] + i << " "
2933  << j*nquad[0] + i + 1 << " "
2934  << (j+1)*nquad[0] + i + 1 << " "
2935  << (j+1)*nquad[0] + i << endl;
2936  }
2937  }
2938  }
2939  break;
2940  case e3D:
2941  {
2942  ns = 8;
2943  ostr = "12 ";
2944  for (i = 0; i < nquad[0]-1; ++i)
2945  {
2946  for (j = 0; j < nquad[1]-1; ++j)
2947  {
2948  for (k = 0; k < nquad[2]-1; ++k)
2949  {
2950  outfile << k*nquad[0]*nquad[1] + j*nquad[0] + i << " "
2951  << k*nquad[0]*nquad[1] + j*nquad[0] + i + 1 << " "
2952  << k*nquad[0]*nquad[1] + (j+1)*nquad[0] + i + 1 << " "
2953  << k*nquad[0]*nquad[1] + (j+1)*nquad[0] + i << " "
2954  << (k+1)*nquad[0]*nquad[1] + j*nquad[0] + i << " "
2955  << (k+1)*nquad[0]*nquad[1] + j*nquad[0] + i + 1 << " "
2956  << (k+1)*nquad[0]*nquad[1] + (j+1)*nquad[0] + i + 1 << " "
2957  << (k+1)*nquad[0]*nquad[1] + (j+1)*nquad[0] + i << " " << endl;
2958  }
2959  }
2960  }
2961  }
2962  break;
2963  default:
2964  break;
2965  }
2966 
2967 
2968  outfile << endl;
2969  outfile << " </DataArray>" << endl;
2970  outfile << " <DataArray type=\"Int32\" "
2971  << "Name=\"offsets\" format=\"ascii\">" << endl;
2972  for (i = 0; i < ntotminus; ++i)
2973  {
2974  outfile << i*ns+ns << " ";
2975  }
2976  outfile << endl;
2977  outfile << " </DataArray>" << endl;
2978  outfile << " <DataArray type=\"UInt8\" "
2979  << "Name=\"types\" format=\"ascii\">" << endl;
2980  for (i = 0; i < ntotminus; ++i)
2981  {
2982  outfile << ostr;
2983  }
2984  outfile << endl;
2985  outfile << " </DataArray>" << endl;
2986  outfile << " </Cells>" << endl;
2987  outfile << " <PointData>" << endl;
2988 
2989  }

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

655  {
656  return v_VectorFlux(inarray);
657  }
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Definition: ExpList.cpp:3134

References v_VectorFlux().

◆ WriteTecplotConnectivity()

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

Definition at line 464 of file ExpList.h.

466  {
467  v_WriteTecplotConnectivity(outfile, expansion);
468  }
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2741

References v_WriteTecplotConnectivity().

◆ WriteTecplotField()

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

Definition at line 458 of file ExpList.h.

460  {
461  v_WriteTecplotField(outfile, expansion);
462  }
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2818

References v_WriteTecplotField().

◆ WriteTecplotHeader()

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

Definition at line 445 of file ExpList.h.

447  {
448  v_WriteTecplotHeader(outfile, var);
449  }
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
Definition: ExpList.cpp:2607

References v_WriteTecplotHeader().

◆ WriteTecplotZone()

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

Definition at line 451 of file ExpList.h.

454  {
455  v_WriteTecplotZone(outfile, expansion);
456  }
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
Definition: ExpList.cpp:2646

References v_WriteTecplotZone().

◆ WriteVtkFooter()

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

Definition at line 2860 of file ExpList.cpp.

2861  {
2862  outfile << " </UnstructuredGrid>" << endl;
2863  outfile << "</VTKFile>" << endl;
2864  }

◆ WriteVtkHeader()

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

Definition at line 2852 of file ExpList.cpp.

2853  {
2854  outfile << "<?xml version=\"1.0\"?>" << endl;
2855  outfile << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
2856  << "byte_order=\"LittleEndian\">" << endl;
2857  outfile << " <UnstructuredGrid>" << endl;
2858  }

◆ WriteVtkPieceData()

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

Definition at line 483 of file ExpList.h.

487  {
488  v_WriteVtkPieceData(outfile, expansion, var);
489  }
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
Definition: ExpList.cpp:2998

References v_WriteVtkPieceData().

◆ WriteVtkPieceFooter()

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

Definition at line 2991 of file ExpList.cpp.

2992  {
2993  boost::ignore_unused(expansion);
2994  outfile << " </PointData>" << endl;
2995  outfile << " </Piece>" << endl;
2996  }

◆ WriteVtkPieceHeader()

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

Definition at line 473 of file ExpList.h.

475  {
476  v_WriteVtkPieceHeader(outfile, expansion, istrip);
477  }
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList.cpp:2866

References v_WriteVtkPieceHeader().

Member Data Documentation

◆ m_blockMat

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

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

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

◆ m_coeffsToElmt

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

m_coeffs to elemental value map

Definition at line 1310 of file ExpList.h.

Referenced by GetCoeffsToElmt(), and SetupCoeffPhys().

◆ m_coll_coeff_offset

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

◆ m_coll_phys_offset

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

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

Referenced by CreateCollections(), GeneralMatrixOp_IterPerExp(), IProductWRTDerivBase(), v_BwdTrans_IterPerExp(), v_IProductWRTBase(), v_IProductWRTBase_IterPerExp(), 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 1290 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_IterPerExp(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), GenGlobalMatrix(), GenGlobalMatrixFull(), Get1DScaledTotPoints(), GetCoordim(), GetElmtNormalLength(), GetExp(), GetExpIndex(), GetNcoeffs(), GetShapeDimension(), GetTotPoints(), Nektar::MultiRegions::DisContField::IsLeftAdjacentTrace(), PhysEvaluate(), SetupCoeffPhys(), Nektar::MultiRegions::DisContField::SetUpDG(), Nektar::MultiRegions::DisContField::v_AddTraceIntegral(), v_ExtractDataToCoeffs(), Nektar::MultiRegions::ExpListHomogeneous1D::v_ExtractDataToCoeffs(), v_GetMovingFrames(), v_GetNormals(), v_PhysGalerkinProjection1DScaled(), v_PhysInterp1DScaled(), v_Reset(), v_SetUpPhysNormals(), v_SmoothField(), v_Upwind(), v_WriteTecplotConnectivity(), and v_WriteTecplotZone().

◆ m_expType

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

◆ m_graph

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

◆ m_ncoeffs

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

◆ m_npoints

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

◆ m_phys

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

The global expansion evaluated at the quadrature points.

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

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

Definition at line 1269 of file ExpList.h.

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

◆ m_phys_offset

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

◆ m_physState

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

The state of the array m_phys.

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

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

Session.

Definition at line 1223 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField::ContField(), Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), CreateCollections(), Nektar::MultiRegions::DisContField::DisContField(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), Nektar::MultiRegions::ExpListHomogeneous1D::ExpListHomogeneous1D(), Nektar::MultiRegions::ExpListHomogeneous2D::ExpListHomogeneous2D(), ExtractFileBCs(), Nektar::MultiRegions::DisContField::FindPeriodicTraces(), Nektar::MultiRegions::DisContField::GenerateBoundaryConditionExpansion(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), GenGlobalMatrix(), Nektar::MultiRegions::DisContField::GetDomainBCs(), GetSession(), Nektar::MultiRegions::ExpListHomogeneous1D::Homogeneous1DTrans(), Nektar::MultiRegions::DisContField3DHomogeneous1D::SetupBoundaryConditions(), Nektar::MultiRegions::DisContField3DHomogeneous2D::SetupBoundaryConditions(), Nektar::MultiRegions::DisContField::SetUpDG(), v_CurlCurl(), Nektar::MultiRegions::ExpListHomogeneous1D::v_DealiasedDotProd(), Nektar::MultiRegions::ExpListHomogeneous1D::v_DealiasedProd(), Nektar::MultiRegions::ExpListHomogeneous1D::v_GetFieldDefinitions(), Nektar::MultiRegions::ExpListHomogeneous1D::v_PhysDeriv(), and Nektar::MultiRegions::ExpList3DHomogeneous1D::v_WriteVtkPieceHeader().

◆ m_WaveSpace

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