Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | 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:
Inheritance graph
[legend]
Collaboration diagram for Nektar::MultiRegions::ExpList:
Collaboration graph
[legend]

Public Member Functions

 ExpList ()
 The default constructor. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession)
 The default constructor. More...
 
 ExpList (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 The default constructor. More...
 
 ExpList (const ExpList &in, const std::vector< unsigned int > &eIDs, const bool DeclareCoeffPhysArrays=true)
 Constructor copying only elements defined in eIds. More...
 
 ExpList (const ExpList &in, const bool DeclareCoeffPhysArrays=true)
 The copy constructor. 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...
 
NekDouble PhysIntegral (void)
 This function integrates a function $f(\boldsymbol{x})$ over the domain consisting of all the elements of the expansion. More...
 
NekDouble PhysIntegral (const Array< OneD, const NekDouble > &inarray)
 This function integrates a function $f(\boldsymbol{x})$ over the domain consisting of all the elements of the expansion. 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, CoeffState coeffstate=eLocal)
 
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 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 (in direction. 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, CoeffState coeffstate=eLocal)
 
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, CoeffState coeffstate=eLocal)
 
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 FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff=StdRegions::NullVarCoeffMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 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, CoeffState coeffstate=eLocal, 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, CoeffState coeffstate=eLocal, 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, CoeffState coeffstate=eLocal)
 
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, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
 
void HomogeneousBwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
 
void DealiasedProd (const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
 
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...
 
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 LocalToGlobal (void)
 Put the coefficients into global ordering using m_coeffs. More...
 
void GlobalToLocal (void)
 Put the coefficients into local ordering and place in m_coeffs. More...
 
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 (const Array< OneD, const 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 associaed with the homogeneous expansion. More...
 
NekDouble GetHomoLen (void)
 This function returns the Width of homogeneous direction associaed 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 boost::shared_ptr
< LocalRegions::ExpansionVector
GetExp () 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 GetExpIndex (const Array< OneD, const NekDouble > &gloCoords, Array< OneD, NekDouble > &locCoords, NekDouble tol=0.0, bool returnNearestElmt=false)
 
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...
 
int GetOffset_Elmt_Id (int n) const
 Get the element id associated with the n th consecutive block of data in m_phys and m_coeffs. 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)
 
const Array< OneD, const
boost::shared_ptr< ExpList > > & 
GetBndCondExpansions ()
 
boost::shared_ptr< ExpList > & UpdateBndCondExpansion (int i)
 
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)
 
void Upwind (const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
 
boost::shared_ptr< ExpList > & GetTrace ()
 
boost::shared_ptr
< AssemblyMapDG > & 
GetTraceMap (void)
 
const Array< OneD, const int > & GetTraceBndMap (void)
 
void GetNormals (Array< OneD, Array< OneD, NekDouble > > &normals)
 
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)
 
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, CoeffState coeffstate=eLocal)
 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, boost::shared_ptr< ExpList > &result)
 
void ExtractElmtToBndPhys (int i, Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
 
void ExtractPhysToBndElmt (int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
 
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)
 
const
NekOptimize::GlobalOptParamSharedPtr
GetGlobalOptParam (void)
 
std::map< int,
RobinBCInfoSharedPtr
GetRobinBCInfo ()
 
void GetPeriodicEntities (PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces=NullPeriodicMap)
 
std::vector
< LibUtilities::FieldDefinitionsSharedPtr
GetFieldDefinitions ()
 
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 boost::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...
 
boost::shared_ptr< ExpListGetSharedThisPtr ()
 Returns a shared pointer to the current object. More...
 
boost::shared_ptr
< LibUtilities::SessionReader
GetSession ()
 Returns the session object. More...
 
boost::shared_ptr
< LibUtilities::Comm
GetComm ()
 Returns the comm object. More...
 
SpatialDomains::MeshGraphSharedPtr GetGraph ()
 
LibUtilities::BasisSharedPtr GetHomogeneousBasis (void)
 
boost::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)
 

Public Attributes

ExpansionType m_expType
 

Protected Member Functions

boost::shared_ptr< DNekMatGenGlobalMatrixFull (const GlobalLinSysKey &mkey, const boost::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)
 
boost::shared_ptr< GlobalMatrixGenGlobalMatrix (const GlobalMatrixKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
 Generates a global matrix from the given key and map. More...
 
void GlobalEigenSystem (const boost::shared_ptr< DNekMat > &Gmat, Array< OneD, NekDouble > &EigValsReal, Array< OneD, NekDouble > &EigValsImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray)
 
boost::shared_ptr< GlobalLinSysGenGlobalLinSys (const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
 This operation constructs the global linear system of type mkey. More...
 
boost::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...
 
void ReadGlobalOptimizationParameters ()
 
virtual int v_GetNumElmts (void)
 
virtual const Array< OneD,
const boost::shared_ptr
< ExpList > > & 
v_GetBndCondExpansions (void)
 
virtual boost::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 boost::shared_ptr
< ExpList > & 
v_GetTrace ()
 
virtual boost::shared_ptr
< AssemblyMapDG > & 
v_GetTraceMap ()
 
virtual const Array< OneD,
const int > & 
v_GetTraceBndMap ()
 
virtual void v_GetNormals (Array< OneD, Array< OneD, NekDouble > > &normals)
 
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)
 
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, CoeffState coeffstate)
 
virtual void v_HelmSolve (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing)
 
virtual void v_LinearAdvectionDiffusionReactionSolve (const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, 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, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 
virtual void v_ImposeDirichletConditions (Array< OneD, NekDouble > &outarray)
 
virtual void v_FillBndCondFromField ()
 
virtual void v_Reset ()
 Reset geometry information, metrics, matrix managers and geometry information. More...
 
virtual void v_LocalToGlobal (void)
 
virtual void v_GlobalToLocal (void)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
 
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, CoeffState coeffstate)
 
virtual void v_FwdTrans_IterPerExp (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, CoeffState coeffstate)
 
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, CoeffState coeffstate)
 
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_HomogeneousFwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
 
virtual void v_HomogeneousBwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
 
virtual void v_DealiasedProd (const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
 
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, boost::shared_ptr< ExpList > &result)
 
virtual void v_ExtractElmtToBndPhys (int i, Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
 
virtual void v_ExtractPhysToBndElmt (int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
 
virtual void v_GetBoundaryNormals (int i, Array< OneD, Array< OneD, NekDouble > > &normals)
 
virtual void v_ReadGlobalOptimizationParameters ()
 
virtual std::vector
< LibUtilities::FieldDefinitionsSharedPtr
v_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 boost::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 Array< OneD, const
NekDouble
v_HomogeneousEnergy (void)
 
virtual
LibUtilities::TranspositionSharedPtr 
v_GetTransposition (void)
 
virtual NekDouble v_GetHomoLen (void)
 
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, const std::string &varName, const boost::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

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...
 
boost::shared_ptr
< LocalRegions::ExpansionVector
m_exp
 The list of local expansions. More...
 
Collections::CollectionVector m_collections
 
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, int > m_offset_elmt_id
 Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coeffs and m_phys is associated, i.e. for an array of constant expansion size and single shape elements m_phys[n*m_npoints] is the data related to m_exp[m_offset_elmt_id[n]];. More...
 
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
 
BlockMatrixMapShPtr m_blockMat
 
bool m_WaveSpace
 

Private Member Functions

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,
RobinBCInfoSharedPtr
v_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 boost::shared_ptr
< ExpList > & 
v_GetPlane (int n)
 

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

Constructor & Destructor Documentation

Nektar::MultiRegions::ExpList::ExpList ( )

The default constructor.

Creates an empty expansion list. The expansion list will typically be populated by a derived class (namely one of MultiRegions::ExpList1D, MultiRegions::ExpList2D or MultiRegions::ExpList3D).

Definition at line 95 of file ExpList.cpp.

References Nektar::MultiRegions::eNoType, and SetExpType().

95  :
96  m_comm(),
97  m_session(),
98  m_graph(),
99  m_ncoeffs(0),
100  m_npoints(0),
101  m_coeffs(),
102  m_phys(),
103  m_physState(false),
104  m_exp(MemoryManager<LocalRegions::ExpansionVector>
105  ::AllocateSharedPtr()),
106  m_coeff_offset(),
107  m_phys_offset(),
109  m_blockMat(MemoryManager<BlockMatrixMap>::AllocateSharedPtr()),
110  m_WaveSpace(false)
111  {
113  }
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession)

The default constructor.

Creates an empty expansion list. The expansion list will typically be populated by a derived class (namely one of MultiRegions::ExpList1D, MultiRegions::ExpList2D or MultiRegions::ExpList3D).

Definition at line 121 of file ExpList.cpp.

References Nektar::MultiRegions::eNoType, and SetExpType().

122  :
123  m_comm(pSession->GetComm()),
124  m_session(pSession),
125  m_graph(),
126  m_ncoeffs(0),
127  m_npoints(0),
128  m_coeffs(),
129  m_phys(),
130  m_physState(false),
131  m_exp(MemoryManager<LocalRegions::ExpansionVector>
132  ::AllocateSharedPtr()),
133  m_coeff_offset(),
134  m_phys_offset(),
136  m_blockMat(MemoryManager<BlockMatrixMap>::AllocateSharedPtr()),
137  m_WaveSpace(false)
138  {
140  }
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
Nektar::MultiRegions::ExpList::ExpList ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)

The default constructor.

Creates an empty expansion list. The expansion list will typically be populated by a derived class (namely one of MultiRegions::ExpList1D, MultiRegions::ExpList2D or MultiRegions::ExpList3D).

Definition at line 148 of file ExpList.cpp.

References Nektar::MultiRegions::eNoType, and SetExpType().

150  :
151  m_comm(pSession->GetComm()),
152  m_session(pSession),
153  m_graph(pGraph),
154  m_ncoeffs(0),
155  m_npoints(0),
156  m_coeffs(),
157  m_phys(),
158  m_physState(false),
159  m_exp(MemoryManager<LocalRegions::ExpansionVector>
160  ::AllocateSharedPtr()),
161  m_coeff_offset(),
162  m_phys_offset(),
164  m_blockMat(MemoryManager<BlockMatrixMap>::AllocateSharedPtr()),
165  m_WaveSpace(false)
166  {
168  }
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
Nektar::MultiRegions::ExpList::ExpList ( const ExpList in,
const std::vector< unsigned int > &  eIDs,
const bool  DeclareCoeffPhysArrays = true 
)

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

References Nektar::MultiRegions::eNoType, m_coeffs, m_exp, m_ncoeffs, m_npoints, m_phys, and SetExpType().

177  :
178  m_comm(in.m_comm),
179  m_session(in.m_session),
180  m_graph(in.m_graph),
181  m_ncoeffs(0),
182  m_npoints(0),
183  m_coeffs(),
184  m_phys(),
185  m_physState(false),
186  m_exp(MemoryManager<LocalRegions::ExpansionVector>
187  ::AllocateSharedPtr()),
188  m_coeff_offset(),
189  m_phys_offset(),
191  m_blockMat(MemoryManager<BlockMatrixMap>::AllocateSharedPtr()),
192  m_WaveSpace(false)
193  {
195 
196  for (int i=0; i < eIDs.size(); ++i)
197  {
198  (*m_exp).push_back( (*(in.m_exp))[eIDs[i]]);
199  m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
200  m_npoints += (*m_exp)[i]->GetTotPoints();
201  }
202 
203  if(DeclareCoeffPhysArrays)
204  {
205  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
206  m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
207  }
208  }
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
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 215 of file ExpList.cpp.

References Nektar::MultiRegions::eNoType, m_coeffs, m_ncoeffs, m_npoints, m_phys, and SetExpType().

215  :
216  m_comm(in.m_comm),
217  m_session(in.m_session),
218  m_graph(in.m_graph),
219  m_ncoeffs(in.m_ncoeffs),
220  m_npoints(in.m_npoints),
221  m_physState(false),
222  m_exp(in.m_exp),
223  m_collections(in.m_collections),
224  m_coll_coeff_offset(in.m_coll_coeff_offset),
225  m_coll_phys_offset(in.m_coll_phys_offset),
226  m_coeff_offset(in.m_coeff_offset),
227  m_phys_offset(in.m_phys_offset),
228  m_offset_elmt_id(in.m_offset_elmt_id),
229  m_globalOptParam(in.m_globalOptParam),
230  m_blockMat(in.m_blockMat),
231  m_WaveSpace(false)
232  {
234 
235  if(DeclareCoeffPhysArrays)
236  {
237  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs, 0.0);
238  m_phys = Array<OneD, NekDouble>(m_npoints, 0.0);
239  }
240  }
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:985
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:982
Collections::CollectionVector m_collections
Definition: ExpList.h:979
Nektar::MultiRegions::ExpList::~ExpList ( )
virtual

The default destructor.

Definition at line 258 of file ExpList.cpp.

259  {
260  }

Member Function Documentation

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

References v_AddFwdBwdTraceIntegral().

2041  {
2042  v_AddFwdBwdTraceIntegral(Fwd,Bwd,outarray);
2043  }
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2338
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 2022 of file ExpList.h.

References v_AddTraceIntegral().

2026  {
2027  v_AddTraceIntegral(Fx,Fy,outarray);
2028  }
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2321
void Nektar::MultiRegions::ExpList::AddTraceIntegral ( const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 2030 of file ExpList.h.

References v_AddTraceIntegral().

2033  {
2034  v_AddTraceIntegral(Fn,outarray);
2035  }
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2321
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 809 of file ExpList.h.

References v_AppendFieldData().

812  {
813  v_AppendFieldData(fielddef,fielddata);
814  }
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:2108
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 819 of file ExpList.h.

References v_AppendFieldData().

823  {
824  v_AppendFieldData(fielddef,fielddata,coeffs);
825  }
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:2108
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 1424 of file ExpList.cpp.

Referenced by Nektar::MultiRegions::DisContField1D::DisContField1D(), and Nektar::MultiRegions::DisContField3D::DisContField3D().

1425  {
1426 
1427  }
void Nektar::MultiRegions::ExpList::BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
inline

Definition at line 1609 of file ExpList.h.

References v_BwdTrans().

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

1613  {
1614  v_BwdTrans(inarray,outarray,coeffstate);
1615  }
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2546
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 1620 of file ExpList.h.

References v_BwdTrans_IterPerExp().

Referenced by Nektar::MultiRegions::ContField1D::BwdTrans(), Nektar::MultiRegions::ContField2D::BwdTrans(), and Nektar::MultiRegions::ContField3D::v_BwdTrans().

1623  {
1624  v_BwdTrans_IterPerExp(inarray,outarray);
1625  }
virtual void v_BwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1231
void Nektar::MultiRegions::ExpList::ClearGlobalLinSysManager ( void  )

Definition at line 3091 of file ExpList.cpp.

References v_ClearGlobalLinSysManager().

3092  {
3094  }
virtual void v_ClearGlobalLinSysManager(void)
Definition: ExpList.cpp:1905
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 2952 of file ExpList.cpp.

References Nektar::iterator, m_coeff_offset, m_coll_coeff_offset, m_coll_phys_offset, m_collections, m_comm, m_exp, m_phys_offset, and m_session.

Referenced by Nektar::MultiRegions::ExpList1D::ExpList1D(), Nektar::MultiRegions::ExpList2D::ExpList2D(), and Nektar::MultiRegions::ExpList3D::ExpList3D().

2953  {
2955  vector<std::pair<LocalRegions::ExpansionSharedPtr,int> > > collections;
2957  vector<std::pair<LocalRegions::ExpansionSharedPtr,int> > >::iterator it;
2958 
2959  // Figure out optimisation parameters if provided in
2960  // session file or default given
2961  Collections::CollectionOptimisation colOpt(m_session, ImpType);
2962  ImpType = colOpt.GetDefaultImplementationType();
2963 
2964  bool autotuning = colOpt.IsUsingAutotuning();
2965  bool verbose = (m_session->DefinesCmdLineArgument("verbose")) &&
2966  (m_comm->GetRank() == 0);
2967  int collmax = (colOpt.GetMaxCollectionSize() > 0
2968  ? colOpt.GetMaxCollectionSize()
2969  : 2*m_exp->size());
2970 
2971  // clear vectors in case previously called
2972  m_collections.clear();
2973  m_coll_coeff_offset.clear();
2974  m_coll_phys_offset.clear();
2975 
2976  // Loop over expansions, and create collections for each element type
2977  for (int i = 0; i < m_exp->size(); ++i)
2978  {
2979  collections[(*m_exp)[i]->DetShapeType()].push_back(
2980  std::pair<LocalRegions::ExpansionSharedPtr,int> ((*m_exp)[i],i));
2981  }
2982 
2983  for (it = collections.begin(); it != collections.end(); ++it)
2984  {
2985  LocalRegions::ExpansionSharedPtr exp = it->second[0].first;
2986 
2987  Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(exp);
2988  vector<StdRegions::StdExpansionSharedPtr> collExp;
2989 
2990  int prevCoeffOffset = m_coeff_offset[it->second[0].second];
2991  int prevPhysOffset = m_phys_offset [it->second[0].second];
2992  int collcnt;
2993 
2994  m_coll_coeff_offset.push_back(prevCoeffOffset);
2995  m_coll_phys_offset .push_back(prevPhysOffset);
2996 
2997  if(it->second.size() == 1) // single element case
2998  {
2999  collExp.push_back(it->second[0].first);
3000 
3001  // if no Imp Type provided and No settign in xml file.
3002  // reset impTypes using timings
3003  if(autotuning)
3004  {
3005  impTypes = colOpt.SetWithTimings(collExp,
3006  impTypes, verbose);
3007  }
3008 
3009  Collections::Collection tmp(collExp, impTypes);
3010  m_collections.push_back(tmp);
3011  }
3012  else
3013  {
3014  // set up first geometry
3015  collExp.push_back(it->second[0].first);
3016  int prevnCoeff = it->second[0].first->GetNcoeffs();
3017  int prevnPhys = it->second[0].first->GetTotPoints();
3018  collcnt = 1;
3019 
3020  for (int i = 1; i < it->second.size(); ++i)
3021  {
3022  int nCoeffs = it->second[i].first->GetNcoeffs();
3023  int nPhys = it->second[i].first->GetTotPoints();
3024  int coeffOffset = m_coeff_offset[it->second[i].second];
3025  int physOffset = m_phys_offset [it->second[i].second];
3026 
3027  // check to see if next elmt is different or
3028  // collmax reached and if so end collection
3029  // and start new one
3030  if(prevCoeffOffset + nCoeffs != coeffOffset ||
3031  prevnCoeff != nCoeffs ||
3032  prevPhysOffset + nPhys != physOffset ||
3033  prevnPhys != nPhys || collcnt >= collmax)
3034  {
3035 
3036  // if no Imp Type provided and No
3037  // settign in xml file. reset
3038  // impTypes using timings
3039  if(autotuning)
3040  {
3041  impTypes = colOpt.SetWithTimings(collExp,
3042  impTypes,
3043  verbose);
3044  }
3045 
3046  Collections::Collection tmp(collExp, impTypes);
3047  m_collections.push_back(tmp);
3048 
3049 
3050  // start new geom list
3051  collExp.clear();
3052 
3053  m_coll_coeff_offset.push_back(coeffOffset);
3054  m_coll_phys_offset .push_back(physOffset);
3055  collExp.push_back(it->second[i].first);
3056  collcnt = 1;
3057  }
3058  else // add to list of collections
3059  {
3060  collExp.push_back(it->second[i].first);
3061  collcnt++;
3062  }
3063 
3064  // if end of list finish up collection
3065  if (i == it->second.size() - 1)
3066  {
3067  // if no Imp Type provided and No
3068  // settign in xml file.
3069  if(autotuning)
3070  {
3071  impTypes = colOpt.SetWithTimings(collExp,
3072  impTypes,verbose);
3073  }
3074 
3075  Collections::Collection tmp(collExp, impTypes);
3076  m_collections.push_back(tmp);
3077  collExp.clear();
3078  collcnt = 0;
3079 
3080  }
3081 
3082  prevCoeffOffset = coeffOffset;
3083  prevPhysOffset = physOffset;
3084  prevnCoeff = nCoeffs;
3085  prevnPhys = nPhys;
3086  }
3087  }
3088  }
3089  }
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:985
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:982
Collections::CollectionVector m_collections
Definition: ExpList.h:979
void Nektar::MultiRegions::ExpList::DealiasedProd ( const Array< OneD, NekDouble > &  inarray1,
const Array< OneD, NekDouble > &  inarray2,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
inline

Definition at line 1751 of file ExpList.h.

References v_DealiasedProd().

1756  {
1757  v_DealiasedProd(inarray1,inarray2,outarray,coeffstate);
1758  }
virtual void v_DealiasedProd(const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.cpp:2450
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 1417 of file ExpList.h.

References m_exp.

1418  {
1419  unsigned int i;
1420  int returnval = 0;
1421 
1422  for(i= 0; i < (*m_exp).size(); ++i)
1423  {
1424  returnval = (std::max)(returnval,
1425  (*m_exp)[i]->EvalBasisNumModesMax());
1426  }
1427 
1428  return returnval;
1429  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
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 1434 of file ExpList.h.

References m_exp.

1436  {
1437  unsigned int i;
1438  Array<OneD,int> returnval((*m_exp).size(),0);
1439 
1440  for(i= 0; i < (*m_exp).size(); ++i)
1441  {
1442  returnval[i]
1443  = (std::max)(returnval[i],(*m_exp)[i]->EvalBasisNumModesMax());
1444  }
1445 
1446  return returnval;
1447  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
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 2091 of file ExpList.h.

References v_EvaluateBoundaryConditions().

Referenced by Nektar::MultiRegions::DisContField1D::DisContField1D(), Nektar::MultiRegions::DisContField2D::DisContField2D(), and Nektar::MultiRegions::DisContField3D::DisContField3D().

2096  {
2097  v_EvaluateBoundaryConditions(time, varName, x2_in, x3_in);
2098  }
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:2829
void Nektar::MultiRegions::ExpList::ExtractCoeffsToCoeffs ( const boost::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 2145 of file ExpList.cpp.

References v_ExtractCoeffsToCoeffs().

2146  {
2147  v_ExtractCoeffsToCoeffs(fromExpList,fromCoeffs,toCoeffs);
2148  }
virtual void v_ExtractCoeffsToCoeffs(const boost::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Definition: ExpList.cpp:2234
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 2136 of file ExpList.cpp.

References v_ExtractDataToCoeffs().

2141  {
2142  v_ExtractDataToCoeffs(fielddef,fielddata,field,coeffs);
2143  }
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:2158
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.

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

Definition at line 2156 of file ExpList.h.

References v_ExtractElmtToBndPhys().

2159  {
2160  v_ExtractElmtToBndPhys(i, elmt, boundary);
2161  }
virtual void v_ExtractElmtToBndPhys(int i, Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
Definition: ExpList.cpp:2665
void Nektar::MultiRegions::ExpList::ExtractFileBCs ( const std::string &  fileName,
const std::string &  varName,
const boost::shared_ptr< ExpList locExpList 
)
protected

Definition at line 1911 of file ExpList.cpp.

References ASSERTL0, Nektar::LibUtilities::FieldIO::Import(), and m_session.

Referenced by Nektar::MultiRegions::DisContField3D::v_EvaluateBoundaryConditions(), and Nektar::MultiRegions::DisContField2D::v_EvaluateBoundaryConditions().

1915  {
1916  string varString = fileName.substr(0, fileName.find_last_of("."));
1917  int j, k, len = varString.length();
1918  varString = varString.substr(len-1, len);
1919 
1920  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1921  std::vector<std::vector<NekDouble> > FieldData;
1922 
1923  LibUtilities::FieldIO f(m_session->GetComm());
1924  f.Import(fileName, FieldDef, FieldData);
1925 
1926  bool found = false;
1927  for (j = 0; j < FieldDef.size(); ++j)
1928  {
1929  for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
1930  {
1931  if (FieldDef[j]->m_fields[k] == varName)
1932  {
1933  // Copy FieldData into locExpList
1934  locExpList->ExtractDataToCoeffs(
1935  FieldDef[j], FieldData[j],
1936  FieldDef[j]->m_fields[k],
1937  locExpList->UpdateCoeffs());
1938  found = true;
1939  }
1940  }
1941  }
1942 
1943  ASSERTL0(found, "Could not find variable '"+varName+
1944  "' in file boundary condition "+fileName);
1945  locExpList->BwdTrans_IterPerExp(
1946  locExpList->GetCoeffs(),
1947  locExpList->UpdatePhys());
1948  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
void Nektar::MultiRegions::ExpList::ExtractPhysToBndElmt ( int  i,
const Array< OneD, const NekDouble > &  phys,
Array< OneD, NekDouble > &  bndElmt 
)
inline

Definition at line 2163 of file ExpList.h.

References v_ExtractPhysToBndElmt().

2166  {
2167  v_ExtractPhysToBndElmt(i, phys, bndElmt);
2168  }
virtual void v_ExtractPhysToBndElmt(int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
Definition: ExpList.cpp:2704
void Nektar::MultiRegions::ExpList::ExtractTracePhys ( Array< OneD, NekDouble > &  outarray)
inline

Definition at line 2065 of file ExpList.h.

References v_ExtractTracePhys().

2066  {
2067  v_ExtractTracePhys(outarray);
2068  }
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2372
void Nektar::MultiRegions::ExpList::ExtractTracePhys ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 2071 of file ExpList.h.

References v_ExtractTracePhys().

2074  {
2075  v_ExtractTracePhys(inarray,outarray);
2076  }
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2372
void Nektar::MultiRegions::ExpList::FillBndCondFromField ( void  )
inline

Fill Bnd Condition expansion from the values stored in expansion.

Definition at line 1845 of file ExpList.h.

References v_FillBndCondFromField().

1846  {
1848  }
virtual void v_FillBndCondFromField()
Definition: ExpList.cpp:2527
void Nektar::MultiRegions::ExpList::FwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
inline

Definition at line 1580 of file ExpList.h.

References v_FwdTrans().

1584  {
1585  v_FwdTrans(inarray,outarray,coeffstate);
1586  }
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2553
void Nektar::MultiRegions::ExpList::FwdTrans_BndConstrained ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

Definition at line 614 of file ExpList.cpp.

References m_coeff_offset, and m_phys_offset.

617  {
618  int i;
619 
620  Array<OneD,NekDouble> e_outarray;
621 
622  for(i= 0; i < (*m_exp).size(); ++i)
623  {
624  (*m_exp)[i]->FwdTrans_BndConstrained(inarray+m_phys_offset[i],
625  e_outarray = outarray+m_coeff_offset[i]);
626  }
627  }
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
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 1591 of file ExpList.h.

References v_FwdTrans_IterPerExp().

1594  {
1595  v_FwdTrans_IterPerExp(inarray,outarray);
1596  }
virtual void v_FwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:604
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 678 of file ExpList.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBwdTrans, Nektar::eDIAGONAL, 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_offset_elmt_id, m_phys_offset, and NEKERROR.

Referenced by GetBlockMatrix().

680  {
681  int i,cnt1;
682  int n_exp = 0;
683  DNekScalMatSharedPtr loc_mat;
684  DNekScalBlkMatSharedPtr BlkMatrix;
685  map<int,int> elmt_id;
686  LibUtilities::ShapeType ShapeType = gkey.GetShapeType();
687 
688  if(ShapeType != LibUtilities::eNoShapeType)
689  {
690  for(i = 0 ; i < (*m_exp).size(); ++i)
691  {
692  if((*m_exp)[m_offset_elmt_id[i]]->DetShapeType()
693  == ShapeType)
694  {
695  elmt_id[n_exp++] = m_offset_elmt_id[i];
696  }
697  }
698  }
699  else
700  {
701  n_exp = (*m_exp).size();
702  for(i = 0; i < n_exp; ++i)
703  {
704  elmt_id[i] = m_offset_elmt_id[i];
705  }
706  }
707 
708  Array<OneD,unsigned int> nrows(n_exp);
709  Array<OneD,unsigned int> ncols(n_exp);
710 
711  switch(gkey.GetMatrixType())
712  {
714  {
715  // set up an array of integers for block matrix construction
716  for(i = 0; i < n_exp; ++i)
717  {
718  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
719  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
720  }
721  }
722  break;
724  {
725  // set up an array of integers for block matrix construction
726  for(i = 0; i < n_exp; ++i)
727  {
728  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
729  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
730  }
731  }
732  break;
733  case StdRegions::eMass:
738  {
739  // set up an array of integers for block matrix construction
740  for(i = 0; i < n_exp; ++i)
741  {
742  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
743  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
744  }
745  }
746  break;
747 
749  {
750  // set up an array of integers for block matrix construction
751  for(i = 0; i < n_exp; ++i)
752  {
753  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
754  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
755  }
756  }
757  break;
758 
760  {
761  // set up an array of integers for block matrix construction
762  for(i = 0; i < n_exp; ++i)
763  {
764  nrows[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
765  ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
766  }
767  }
768  break;
769 
770  default:
771  {
773  "Global Matrix creation not defined for this type "
774  "of matrix");
775  }
776  }
777 
778  MatrixStorage blkmatStorage = eDIAGONAL;
780  ::AllocateSharedPtr(nrows,ncols,blkmatStorage);
781 
782  int nvarcoeffs = gkey.GetNVarCoeffs();
783  int eid;
784  Array<OneD, NekDouble> varcoeffs_wk;
785 
786  for(i = cnt1 = 0; i < n_exp; ++i)
787  {
788  // need to be initialised with zero size for non variable coefficient case
789  StdRegions::VarCoeffMap varcoeffs;
790 
791  eid = elmt_id[i];
792  if(nvarcoeffs>0)
793  {
794  StdRegions::VarCoeffMap::const_iterator x;
795  for (x = gkey.GetVarCoeffs().begin(); x != gkey.GetVarCoeffs().end(); ++x)
796  {
797  varcoeffs[x->first] = x->second + m_phys_offset[eid];
798  }
799  }
800 
801  LocalRegions::MatrixKey matkey(gkey.GetMatrixType(),
802  (*m_exp)[eid]->DetShapeType(),
803  *(*m_exp)[eid],
804  gkey.GetConstFactors(),
805  varcoeffs );
806 
807  loc_mat = boost::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[elmt_id.find(i)->second])->GetLocMatrix(matkey);
808  BlkMatrix->SetBlock(i,i,loc_mat);
809  }
810 
811  return BlkMatrix;
812  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:185
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
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 1986 of file ExpList.cpp.

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

Referenced by v_GetFieldDefinitions().

1994  {
1995  int startenum = (int) LibUtilities::eSegment;
1996  int endenum = (int) LibUtilities::eHexahedron;
1997  int s = 0;
1999 
2000  ASSERTL1(NumHomoDir == HomoBasis.num_elements(),"Homogeneous basis is not the same length as NumHomoDir");
2001  ASSERTL1(NumHomoDir == HomoLen.size(),"Homogeneous length vector is not the same length as NumHomDir");
2002 
2003  // count number of shapes
2004  switch((*m_exp)[0]->GetShapeDimension())
2005  {
2006  case 1:
2007  startenum = (int) LibUtilities::eSegment;
2008  endenum = (int) LibUtilities::eSegment;
2009  break;
2010  case 2:
2011  startenum = (int) LibUtilities::eTriangle;
2012  endenum = (int) LibUtilities::eQuadrilateral;
2013  break;
2014  case 3:
2015  startenum = (int) LibUtilities::eTetrahedron;
2016  endenum = (int) LibUtilities::eHexahedron;
2017  break;
2018  }
2019 
2020  for(s = startenum; s <= endenum; ++s)
2021  {
2022  std::vector<unsigned int> elementIDs;
2023  std::vector<LibUtilities::BasisType> basis;
2024  std::vector<unsigned int> numModes;
2025  std::vector<std::string> fields;
2026 
2027  bool first = true;
2028  bool UniOrder = true;
2029  int n;
2030 
2031  shape = (LibUtilities::ShapeType) s;
2032 
2033  for(int i = 0; i < (*m_exp).size(); ++i)
2034  {
2035  if((*m_exp)[i]->GetGeom()->GetShapeType() == shape)
2036  {
2037  elementIDs.push_back((*m_exp)[i]->GetGeom()->GetGlobalID());
2038  if(first)
2039  {
2040  for(int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
2041  {
2042  basis.push_back((*m_exp)[i]->GetBasis(j)->GetBasisType());
2043  numModes.push_back((*m_exp)[i]->GetBasis(j)->GetNumModes());
2044  }
2045 
2046  // add homogeneous direction details if defined
2047  for(n = 0 ; n < NumHomoDir; ++n)
2048  {
2049  basis.push_back(HomoBasis[n]->GetBasisType());
2050  numModes.push_back(HomoBasis[n]->GetNumModes());
2051  }
2052 
2053  first = false;
2054  }
2055  else
2056  {
2057  ASSERTL0((*m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],"Routine is not set up for multiple bases definitions");
2058 
2059  for(int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
2060  {
2061  numModes.push_back((*m_exp)[i]->GetBasis(j)->GetNumModes());
2062  if(numModes[j] != (*m_exp)[i]->GetBasis(j)->GetNumModes())
2063  {
2064  UniOrder = false;
2065  }
2066  }
2067  // add homogeneous direction details if defined
2068  for(n = 0 ; n < NumHomoDir; ++n)
2069  {
2070  numModes.push_back(HomoBasis[n]->GetNumModes());
2071  }
2072  }
2073  }
2074  }
2075 
2076 
2077  if(elementIDs.size() > 0)
2078  {
2081  AllocateSharedPtr(shape, elementIDs, basis,
2082  UniOrder, numModes,fields,
2083  NumHomoDir, HomoLen, homoStrips,
2084  HomoSIDs, HomoZIDs, HomoYIDs);
2085  fielddef.push_back(fdef);
2086  }
2087  }
2088  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:118
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
void Nektar::MultiRegions::ExpList::GeneralMatrixOp ( const GlobalMatrixKey gkey,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
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 2129 of file ExpList.h.

References v_GeneralMatrixOp().

Referenced by Nektar::MultiRegions::ContField3D::GenerateDirBndCondForcing().

2134  {
2135  v_GeneralMatrixOp(gkey,inarray,outarray,coeffstate);
2136  }
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2575
void Nektar::MultiRegions::ExpList::GeneralMatrixOp_IterPerExp ( const GlobalMatrixKey gkey,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

Definition at line 829 of file ExpList.cpp.

References Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_coeff_offset, m_globalOptParam, m_offset_elmt_id, m_phys_offset, and MultiplyByBlockMatrix().

Referenced by Nektar::MultiRegions::ContField3D::v_GeneralMatrixOp(), Nektar::MultiRegions::ContField1D::v_GeneralMatrixOp(), Nektar::MultiRegions::ContField2D::v_GeneralMatrixOp(), and v_GeneralMatrixOp().

833  {
834  const Array<OneD, const bool> doBlockMatOp
835  = m_globalOptParam->DoBlockMatOp(gkey.GetMatrixType());
836  const Array<OneD, const int> num_elmts
837  = m_globalOptParam->GetShapeNumElements();
838 
839  Array<OneD,NekDouble> tmp_outarray;
840  int cnt = 0;
841  int eid;
842  for(int n = 0; n < num_elmts.num_elements(); ++n)
843  {
844  if(doBlockMatOp[n])
845  {
846  const LibUtilities::ShapeType vType
847  = m_globalOptParam->GetShapeList()[n];
848  const MultiRegions::GlobalMatrixKey vKey(gkey, vType);
849  if (cnt < m_offset_elmt_id.num_elements())
850  {
851  eid = m_offset_elmt_id[cnt];
852  MultiplyByBlockMatrix(vKey,inarray + m_coeff_offset[eid],
853  tmp_outarray = outarray + m_coeff_offset[eid]);
854  cnt += num_elmts[n];
855  }
856  }
857  else
858  {
859  int i;
860  int nvarcoeffs = gkey.GetNVarCoeffs();
861 
862  for(i= 0; i < num_elmts[n]; ++i)
863  {
864  // need to be initialised with zero size for non variable coefficient case
865  StdRegions::VarCoeffMap varcoeffs;
866 
867  eid = m_offset_elmt_id[cnt++];
868  if(nvarcoeffs>0)
869  {
870  StdRegions::VarCoeffMap::const_iterator x;
871  for (x = gkey.GetVarCoeffs().begin(); x != gkey.GetVarCoeffs().end(); ++x)
872  {
873  varcoeffs[x->first] = x->second + m_phys_offset[eid];
874  }
875  }
876 
877  StdRegions::StdMatrixKey mkey(gkey.GetMatrixType(),
878  (*m_exp)[eid]->DetShapeType(),
879  *((*m_exp)[eid]),
880  gkey.GetConstFactors(),varcoeffs);
881 
882  (*m_exp)[eid]->GeneralMatrixOp(inarray + m_coeff_offset[eid],
883  tmp_outarray = outarray+m_coeff_offset[eid],
884  mkey);
885  }
886  }
887  }
888  }
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:326
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 1194 of file ExpList.cpp.

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

Referenced by Nektar::MultiRegions::DisContField2D::GetGlobalBndLinSys(), Nektar::MultiRegions::DisContField3D::GetGlobalBndLinSys(), and Nektar::MultiRegions::DisContField1D::GetGlobalBndLinSys().

1197  {
1198  boost::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
1199  const map<int,RobinBCInfoSharedPtr> vRobinBCInfo = GetRobinBCInfo();
1200 
1201  MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
1202 
1203  if (vType >= eSIZE_GlobalSysSolnType)
1204  {
1205  ASSERTL0(false,"Matrix solution type not defined");
1206  }
1207  std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
1208 
1209  return GetGlobalLinSysFactory().CreateInstance(vSolnType,mkey,
1210  vExpList,locToGloMap);
1211  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
boost::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:859
const char *const GlobalSysSolnTypeMap[]
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:780
GlobalLinSysFactory & GetGlobalLinSysFactory()
GlobalLinSysSharedPtr Nektar::MultiRegions::ExpList::GenGlobalLinSys ( const GlobalLinSysKey mkey,
const boost::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 1175 of file ExpList.cpp.

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

Referenced by Nektar::MultiRegions::ContField3D::GenGlobalLinSys(), Nektar::MultiRegions::ContField1D::GenGlobalLinSys(), and Nektar::MultiRegions::ContField2D::GenGlobalLinSys().

1178  {
1179  GlobalLinSysSharedPtr returnlinsys;
1180  boost::shared_ptr<ExpList> vExpList = GetSharedThisPtr();
1181 
1182  MultiRegions::GlobalSysSolnType vType = mkey.GetGlobalSysSolnType();
1183 
1184  if (vType >= eSIZE_GlobalSysSolnType)
1185  {
1186  ASSERTL0(false,"Matrix solution type not defined");
1187  }
1188  std::string vSolnType = MultiRegions::GlobalSysSolnTypeMap[vType];
1189 
1190  return GetGlobalLinSysFactory().CreateInstance( vSolnType, mkey,
1191  vExpList, locToGloMap);
1192  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
boost::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Definition: ExpList.h:859
const char *const GlobalSysSolnTypeMap[]
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:52
GlobalLinSysFactory & GetGlobalLinSysFactory()
GlobalMatrixSharedPtr Nektar::MultiRegions::ExpList::GenGlobalMatrix ( const GlobalMatrixKey mkey,
const boost::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 897 of file ExpList.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBwdTrans, 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_npoints, m_offset_elmt_id, m_phys_offset, m_session, and NEKERROR.

Referenced by Nektar::MultiRegions::ContField3D::GetGlobalMatrix(), and Nektar::MultiRegions::ContField2D::GetGlobalMatrix().

900  {
901  int i,j,n,gid1,gid2,cntdim1,cntdim2;
902  NekDouble sign1,sign2;
903  DNekScalMatSharedPtr loc_mat;
904 
905  unsigned int glob_rows;
906  unsigned int glob_cols;
907  unsigned int loc_rows;
908  unsigned int loc_cols;
909 
910  bool assembleFirstDim;
911  bool assembleSecondDim;
912 
913  switch(mkey.GetMatrixType())
914  {
916  {
917  glob_rows = m_npoints;
918  glob_cols = locToGloMap->GetNumGlobalCoeffs();
919 
920  assembleFirstDim = false;
921  assembleSecondDim = true;
922  }
923  break;
925  {
926  glob_rows = locToGloMap->GetNumGlobalCoeffs();
927  glob_cols = m_npoints;
928 
929  assembleFirstDim = true;
930  assembleSecondDim = false;
931  }
932  break;
933  case StdRegions::eMass:
937  {
938  glob_rows = locToGloMap->GetNumGlobalCoeffs();
939  glob_cols = locToGloMap->GetNumGlobalCoeffs();
940 
941  assembleFirstDim = true;
942  assembleSecondDim = true;
943  }
944  break;
945  default:
946  {
948  "Global Matrix creation not defined for this type "
949  "of matrix");
950  }
951  }
952 
953  COOMatType spcoomat;
954  CoordType coord;
955 
956  int nvarcoeffs = mkey.GetNVarCoeffs();
957  int eid;
958 
959  // fill global matrix
960  for(n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
961  {
962  // need to be initialised with zero size for non variable coefficient case
963  StdRegions::VarCoeffMap varcoeffs;
964 
965  eid = m_offset_elmt_id[n];
966  if(nvarcoeffs>0)
967  {
968  StdRegions::VarCoeffMap::const_iterator x;
969  for (x = mkey.GetVarCoeffs().begin(); x != mkey.GetVarCoeffs().end(); ++x)
970  {
971  varcoeffs[x->first] = x->second + m_phys_offset[eid];
972  }
973  }
974 
975  LocalRegions::MatrixKey matkey(mkey.GetMatrixType(),
976  (*m_exp)[eid]->DetShapeType(),
977  *((*m_exp)[eid]),
978  mkey.GetConstFactors(),varcoeffs);
979 
980  loc_mat = boost::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[m_offset_elmt_id[n]])->GetLocMatrix(matkey);
981 
982  loc_rows = loc_mat->GetRows();
983  loc_cols = loc_mat->GetColumns();
984 
985  for(i = 0; i < loc_rows; ++i)
986  {
987  if(assembleFirstDim)
988  {
989  gid1 = locToGloMap->GetLocalToGlobalMap (cntdim1 + i);
990  sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
991  }
992  else
993  {
994  gid1 = cntdim1 + i;
995  sign1 = 1.0;
996  }
997 
998  for(j = 0; j < loc_cols; ++j)
999  {
1000  if(assembleSecondDim)
1001  {
1002  gid2 = locToGloMap
1003  ->GetLocalToGlobalMap(cntdim2 + j);
1004  sign2 = locToGloMap
1005  ->GetLocalToGlobalSign(cntdim2 + j);
1006  }
1007  else
1008  {
1009  gid2 = cntdim2 + j;
1010  sign2 = 1.0;
1011  }
1012 
1013  // sparse matrix fill
1014  coord = make_pair(gid1,gid2);
1015  if( spcoomat.count(coord) == 0 )
1016  {
1017  spcoomat[coord] = sign1*sign2*(*loc_mat)(i,j);
1018  }
1019  else
1020  {
1021  spcoomat[coord] += sign1*sign2*(*loc_mat)(i,j);
1022  }
1023  }
1024  }
1025  cntdim1 += loc_rows;
1026  cntdim2 += loc_cols;
1027  }
1028 
1030  ::AllocateSharedPtr(m_session,glob_rows,glob_cols,spcoomat);
1031  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:185
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
std::map< CoordType, NekDouble > COOMatType
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
double NekDouble
std::pair< IndexType, IndexType > CoordType
DNekMatSharedPtr Nektar::MultiRegions::ExpList::GenGlobalMatrixFull ( const GlobalLinSysKey mkey,
const boost::shared_ptr< AssemblyMapCG > &  locToGloMap 
)
protected

Definition at line 1034 of file ExpList.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), 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_offset_elmt_id, and m_phys_offset.

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

1035  {
1036  int i,j,n,gid1,gid2,loc_lda,eid;
1037  NekDouble sign1,sign2,value;
1038  DNekScalMatSharedPtr loc_mat;
1039 
1040  int totDofs = locToGloMap->GetNumGlobalCoeffs();
1041  int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
1042 
1043  unsigned int rows = totDofs - NumDirBCs;
1044  unsigned int cols = totDofs - NumDirBCs;
1045  NekDouble zero = 0.0;
1046 
1047  DNekMatSharedPtr Gmat;
1048  int bwidth = locToGloMap->GetFullSystemBandWidth();
1049 
1050  int nvarcoeffs = mkey.GetNVarCoeffs();
1051  MatrixStorage matStorage;
1052 
1053  map<int, RobinBCInfoSharedPtr> RobinBCInfo = GetRobinBCInfo();
1054 
1055  switch(mkey.GetMatrixType())
1056  {
1057  // case for all symmetric matices
1060  if( (2*(bwidth+1)) < rows)
1061  {
1063  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows,cols,zero,matStorage,bwidth,bwidth);
1064  }
1065  else
1066  {
1067  matStorage = ePOSITIVE_DEFINITE_SYMMETRIC;
1068  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows,cols,zero,matStorage);
1069  }
1070 
1071  break;
1072  default: // Assume general matrix - currently only set up for full invert
1073  {
1074  matStorage = eFULL;
1075  Gmat = MemoryManager<DNekMat>::AllocateSharedPtr(rows,cols,zero,matStorage);
1076  }
1077  }
1078 
1079  // fill global symmetric matrix
1080  for(n = 0; n < (*m_exp).size(); ++n)
1081  {
1082  // need to be initialised with zero size for non variable coefficient case
1083  StdRegions::VarCoeffMap varcoeffs;
1084 
1085  eid = m_offset_elmt_id[n];
1086  if(nvarcoeffs>0)
1087  {
1088  StdRegions::VarCoeffMap::const_iterator x;
1089  for (x = mkey.GetVarCoeffs().begin(); x != mkey.GetVarCoeffs().end(); ++x)
1090  {
1091  varcoeffs[x->first] = x->second + m_phys_offset[eid];
1092  }
1093  }
1094 
1095  LocalRegions::MatrixKey matkey(mkey.GetMatrixType(),
1096  (*m_exp)[eid]->DetShapeType(),
1097  *((*m_exp)[eid]),
1098  mkey.GetConstFactors(),varcoeffs);
1099 
1100  loc_mat = boost::dynamic_pointer_cast<LocalRegions::Expansion>((*m_exp)[n])->GetLocMatrix(matkey);
1101 
1102 
1103  if(RobinBCInfo.count(n) != 0) // add robin mass matrix
1104  {
1106 
1107  // declare local matrix from scaled matrix.
1108  int rows = loc_mat->GetRows();
1109  int cols = loc_mat->GetColumns();
1110  const NekDouble *dat = loc_mat->GetRawPtr();
1112  Blas::Dscal(rows*cols,loc_mat->Scale(),new_mat->GetRawPtr(),1);
1113 
1114  // add local matrix contribution
1115  for(rBC = RobinBCInfo.find(n)->second;rBC; rBC = rBC->next)
1116  {
1117  (*m_exp)[n]->AddRobinMassMatrix(rBC->m_robinID,rBC->m_robinPrimitiveCoeffs,new_mat);
1118  }
1119 
1120  NekDouble one = 1.0;
1121  // redeclare loc_mat to point to new_mat plus the scalar.
1122  loc_mat = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,new_mat);
1123  }
1124 
1125  loc_lda = loc_mat->GetColumns();
1126 
1127  for(i = 0; i < loc_lda; ++i)
1128  {
1129  gid1 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + i) - NumDirBCs;
1130  sign1 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + i);
1131  if(gid1 >= 0)
1132  {
1133  for(j = 0; j < loc_lda; ++j)
1134  {
1135  gid2 = locToGloMap->GetLocalToGlobalMap(m_coeff_offset[n] + j) - NumDirBCs;
1136  sign2 = locToGloMap->GetLocalToGlobalSign(m_coeff_offset[n] + j);
1137  if(gid2 >= 0)
1138  {
1139  // When global matrix is symmetric,
1140  // only add the value for the upper
1141  // triangular part in order to avoid
1142  // entries to be entered twice
1143  if((matStorage == eFULL)||(gid2 >= gid1))
1144  {
1145  value = Gmat->GetValue(gid1,gid2) + sign1*sign2*(*loc_mat)(i,j);
1146  Gmat->SetValue(gid1,gid2,value);
1147  }
1148  }
1149  }
1150  }
1151  }
1152  }
1153 
1154  return Gmat;
1155  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
double NekDouble
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
Definition: ExpList.h:780
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 1464 of file ExpList.h.

References m_exp.

1465  {
1466  int returnval = 0;
1467  int cnt;
1468  int nbase = (*m_exp)[0]->GetNumBases();
1469 
1470  for(int i = 0; i < (*m_exp).size(); ++i)
1471  {
1472  cnt = 1;
1473  for(int j = 0; j < nbase; ++j)
1474  {
1475  cnt *= (int)(scale*((*m_exp)[i]->GetNumPoints(j)));
1476  }
1477  returnval += cnt;
1478  }
1479  return returnval;
1480  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
void Nektar::MultiRegions::ExpList::GetBCValues ( Array< OneD, NekDouble > &  BndVals,
const Array< OneD, NekDouble > &  TotField,
int  BndID 
)
inline

Definition at line 1763 of file ExpList.h.

References v_GetBCValues().

1767  {
1768  v_GetBCValues(BndVals,TotField,BndID);
1769  }
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
Definition: ExpList.cpp:2456
const DNekScalBlkMatSharedPtr & Nektar::MultiRegions::ExpList::GetBlockMatrix ( const GlobalMatrixKey gkey)
protected

Definition at line 814 of file ExpList.cpp.

References GenBlockMatrix(), Nektar::iterator, and m_blockMat.

Referenced by MultiplyByBlockMatrix(), MultiplyByElmtInvMass(), Nektar::MultiRegions::DisContField3D::v_GeneralMatrixOp(), Nektar::MultiRegions::DisContField2D::v_GeneralMatrixOp(), Nektar::MultiRegions::DisContField3D::v_HelmSolve(), Nektar::MultiRegions::DisContField2D::v_HelmSolve(), and Nektar::MultiRegions::DisContField1D::v_HelmSolve().

816  {
817  BlockMatrixMap::iterator matrixIter = m_blockMat->find(gkey);
818 
819  if(matrixIter == m_blockMat->end())
820  {
821  return ((*m_blockMat)[gkey] = GenBlockMatrix(gkey));
822  }
823  else
824  {
825  return matrixIter->second;
826  }
827  }
BlockMatrixMapShPtr m_blockMat
Definition: ExpList.h:1003
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
Definition: ExpList.cpp:678
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
const Array< OneD, const boost::shared_ptr< ExpList > > & Nektar::MultiRegions::ExpList::GetBndCondExpansions ( )
inline

Definition at line 1973 of file ExpList.h.

References v_GetBndCondExpansions().

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

1974  {
1975  return v_GetBndCondExpansions();
1976  }
virtual const Array< OneD, const boost::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Definition: ExpList.cpp:2257
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::GetBndConditions ( )
inline

Definition at line 2079 of file ExpList.h.

References v_GetBndConditions().

2080  {
2081  return v_GetBndConditions();
2082  }
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Definition: ExpList.cpp:2808
void Nektar::MultiRegions::ExpList::GetBndElmtExpansion ( int  i,
boost::shared_ptr< ExpList > &  result 
)
inline

Definition at line 2150 of file ExpList.h.

References v_GetBndElmtExpansion().

2152  {
2153  v_GetBndElmtExpansion(i, result);
2154  }
virtual void v_GetBndElmtExpansion(int i, boost::shared_ptr< ExpList > &result)
Definition: ExpList.cpp:2656
SpatialDomains::BoundaryConditionShPtr Nektar::MultiRegions::ExpList::GetBoundaryCondition ( const SpatialDomains::BoundaryConditionCollection collection,
unsigned int  index,
const std::string &  variable 
)
staticprotected

Definition at line 2860 of file ExpList.cpp.

References ASSERTL1.

Referenced by Nektar::MultiRegions::DisContField2D::FindPeriodicEdges(), Nektar::MultiRegions::DisContField3D::FindPeriodicFaces(), Nektar::MultiRegions::DisContField1D::FindPeriodicVertices(), Nektar::MultiRegions::DisContField1D::GenerateBoundaryConditionExpansion(), Nektar::MultiRegions::DisContField3D::GenerateBoundaryConditionExpansion(), Nektar::MultiRegions::DisContField2D::GenerateBoundaryConditionExpansion(), Nektar::MultiRegions::DisContField1D::SetBoundaryConditionExpansion(), and Nektar::MultiRegions::DisContField3DHomogeneous1D::SetupBoundaryConditions().

2864  {
2865  SpatialDomains::BoundaryConditionCollection::const_iterator collectionIter = collection.find(regionId);
2866  ASSERTL1(collectionIter != collection.end(), "Unable to locate collection "+boost::lexical_cast<string>(regionId));
2867  const SpatialDomains::BoundaryConditionMapShPtr boundaryConditionMap = (*collectionIter).second;
2868  SpatialDomains::BoundaryConditionMap::const_iterator conditionMapIter = boundaryConditionMap->find(variable);
2869  ASSERTL1(conditionMapIter != boundaryConditionMap->end(), "Unable to locate condition map.");
2870  const SpatialDomains::BoundaryConditionShPtr boundaryCondition = (*conditionMapIter).second;
2871  return boundaryCondition;
2872  }
boost::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
Definition: Conditions.h:214
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:208
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
void Nektar::MultiRegions::ExpList::GetBoundaryNormals ( int  i,
Array< OneD, Array< OneD, NekDouble > > &  normals 
)
inline

Definition at line 2170 of file ExpList.h.

References v_GetBoundaryNormals().

2172  {
2173  v_GetBoundaryNormals(i, normals);
2174  }
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:2745
void Nektar::MultiRegions::ExpList::GetBoundaryToElmtMap ( Array< OneD, int > &  ElmtID,
Array< OneD, int > &  EdgeID 
)
inline
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 1865 of file ExpList.h.

References m_coeffs.

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

1866  {
1867  return m_coeffs[i];
1868  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
int Nektar::MultiRegions::ExpList::GetCoeff_Offset ( int  n) const
inline
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 1834 of file ExpList.h.

References m_coeffs.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous2D::EvaluateBoundaryConditions(), Nektar::MultiRegions::DisContField3DHomogeneous1D::EvaluateBoundaryConditions(), Nektar::MultiRegions::ExpList1D::PostProcess(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField1D::v_GetBndElmtExpansion(), and Nektar::MultiRegions::ExpList3DHomogeneous1D::v_HomogeneousEnergy().

1835  {
1836  return m_coeffs;
1837  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
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 1874 of file ExpList.h.

References m_coeffs.

1875  {
1876  return m_coeffs[i];
1877  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
boost::shared_ptr<LibUtilities::Comm> Nektar::MultiRegions::ExpList::GetComm ( )
inline

Returns the comm object.

Definition at line 871 of file ExpList.h.

References m_comm.

872  {
873  return m_comm;
874  }
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
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 1794 of file ExpList.h.

References ASSERTL2, and m_exp.

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

1795  {
1796  ASSERTL2(eid <= (*m_exp).size(),
1797  "eid is larger than number of elements");
1798  return (*m_exp)[eid]->GetCoordim();
1799  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:240
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 1684 of file ExpList.h.

References v_GetCoords().

Referenced by v_WriteTecplotZone().

1688  {
1689  v_GetCoords(coord_0,coord_1,coord_2);
1690  }
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
Definition: ExpList.cpp:2595
const boost::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 1917 of file ExpList.h.

References m_exp.

Referenced by Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), Nektar::MultiRegions::ContField3DHomogeneous2D::ContField3DHomogeneous2D(), Nektar::MultiRegions::AssemblyMapCG::CreateGraph(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous2D::DisContField3DHomogeneous2D(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous1D::GetBCValues(), GetExpIndex(), Nektar::MultiRegions::LocTraceToTraceMap::LocTraceToTraceMap(), Nektar::MultiRegions::DisContField3DHomogeneous1D::NormVectorIProductWRTBase(), Nektar::MultiRegions::ExpList1D::PostProcess(), Nektar::MultiRegions::LocTraceToTraceMap::Setup2D(), Nektar::MultiRegions::LocTraceToTraceMap::Setup3D(), Nektar::MultiRegions::AssemblyMapCG::SetUpUniversalC0ContMap(), Nektar::MultiRegions::AssemblyMapDG::SetUpUniversalDGMap(), Nektar::MultiRegions::AssemblyMapDG::SetUpUniversalTraceMap(), v_ExtractElmtToBndPhys(), v_ExtractPhysToBndElmt(), Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBoundaryNormals(), v_GetBoundaryNormals(), v_GetCoords(), Nektar::MultiRegions::ExpList3DHomogeneous1D::v_HomogeneousEnergy(), Nektar::MultiRegions::AssemblyMapCG::v_LinearSpaceMap(), and v_WriteTecplotHeader().

1918  {
1919  return m_exp;
1920  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
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 1908 of file ExpList.h.

References m_exp.

1909  {
1910  return (*m_exp)[n];
1911  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
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 1243 of file ExpList.cpp.

References ASSERTL0, GetCoordim(), and m_exp.

1245  {
1246  Array<OneD, NekDouble> stdCoord(GetCoordim(0),0.0);
1247  for (int i = 0; i < (*m_exp).size(); ++i)
1248  {
1249  if ((*m_exp)[i]->GetGeom()->ContainsPoint(gloCoord))
1250  {
1251  return (*m_exp)[i];
1252  }
1253  }
1254  ASSERTL0(false, "Cannot find element for this point.");
1255  return (*m_exp)[0]; // avoid warnings
1256  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1794
int Nektar::MultiRegions::ExpList::GetExpIndex ( const Array< OneD, const NekDouble > &  gloCoord,
NekDouble  tol = 0.0,
bool  returnNearestElmt = false 
)

This function returns the index of the local elemental expansion containing the arbitrary point given by gloCoord.

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

1268  {
1269  Array<OneD, NekDouble> Lcoords(gloCoord.num_elements());
1270 
1271  return GetExpIndex(gloCoord,Lcoords,tol,returnNearestElmt);
1272  }
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false)
Definition: ExpList.cpp:1264
int Nektar::MultiRegions::ExpList::GetExpIndex ( const Array< OneD, const NekDouble > &  gloCoords,
Array< OneD, NekDouble > &  locCoords,
NekDouble  tol = 0.0,
bool  returnNearestElmt = false 
)

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

References GetCoordim(), GetExp(), GetNumElmts(), m_exp, m_graph, Nektar::NekPoint< data_type >::SetX(), Nektar::NekPoint< data_type >::SetY(), Nektar::NekPoint< data_type >::SetZ(), Vmath::Vcopy(), and WARNINGL1.

1279  {
1280  NekDouble nearpt = 1e6;
1281 
1282  if (GetNumElmts() == 0)
1283  {
1284  return -1;
1285  }
1286  std::vector<std::pair<int,NekDouble> > elmtIdDist;
1287 
1288  // Manifold case (point may match multiple elements)
1289  if (GetExp(0)->GetCoordim() > GetExp(0)->GetShapeDimension())
1290  {
1292  SpatialDomains::PointGeom w;
1293  NekDouble dist = 0.0;
1294 
1295  // Scan all elements and store those which may contain the point
1296  for (int i = 0; i < (*m_exp).size(); ++i)
1297  {
1298  if ((*m_exp)[i]->GetGeom()->ContainsPoint(gloCoords,
1299  locCoords,
1300  tol, nearpt))
1301  {
1302  w.SetX(gloCoords[0]);
1303  w.SetY(gloCoords[1]);
1304  w.SetZ(gloCoords[2]);
1305 
1306  // Find closest vertex
1307  for (int j = 0; j < (*m_exp)[i]->GetNverts(); ++j) {
1308  v = m_graph->GetVertex(
1309  (*m_exp)[i]->GetGeom()->GetVid(j));
1310  if (j == 0 || dist > v->dist(w))
1311  {
1312  dist = v->dist(w);
1313  }
1314  }
1315  elmtIdDist.push_back(
1316  std::pair<int, NekDouble>(i, dist));
1317  }
1318  }
1319 
1320  // Find nearest element
1321  if (!elmtIdDist.empty())
1322  {
1323  int min_id = elmtIdDist[0].first;
1324  NekDouble min_d = elmtIdDist[0].second;
1325 
1326  for (int i = 1; i < elmtIdDist.size(); ++i)
1327  {
1328  if (elmtIdDist[i].second < min_d) {
1329  min_id = elmtIdDist[i].first;
1330  min_d = elmtIdDist[i].second;
1331  }
1332  }
1333 
1334  // retrieve local coordinate of point
1335  (*m_exp)[min_id]->GetGeom()->GetLocCoords(gloCoords,
1336  locCoords);
1337  return min_id;
1338  }
1339  else
1340  {
1341  return -1;
1342  }
1343  }
1344  // non-embedded mesh (point can only match one element)
1345  else
1346  {
1347  static int start = 0;
1348  int min_id = 0;
1349  NekDouble nearpt_min = 1e6;
1350  Array<OneD, NekDouble> savLocCoords(locCoords.num_elements());
1351 
1352  // restart search from last found value
1353  for (int i = start; i < (*m_exp).size(); ++i)
1354  {
1355  if ((*m_exp)[i]->GetGeom()->ContainsPoint(gloCoords,
1356  locCoords,
1357  tol, nearpt))
1358  {
1359  start = i;
1360  return i;
1361  }
1362  else
1363  {
1364  if(nearpt < nearpt_min)
1365  {
1366  min_id = i;
1367  nearpt_min = nearpt;
1368  Vmath::Vcopy(locCoords.num_elements(),locCoords,1,savLocCoords,1);
1369  }
1370  }
1371  }
1372 
1373  for (int i = 0; i < start; ++i)
1374  {
1375  if ((*m_exp)[i]->GetGeom()->ContainsPoint(gloCoords,
1376  locCoords,
1377  tol, nearpt))
1378  {
1379  start = i;
1380  return i;
1381  }
1382  else
1383  {
1384  if(nearpt < nearpt_min)
1385  {
1386  min_id = i;
1387  nearpt_min = nearpt;
1388  Vmath::Vcopy(locCoords.num_elements(),
1389  locCoords,1,savLocCoords,1);
1390  }
1391  }
1392  }
1393 
1394  if(returnNearestElmt)
1395  {
1396 
1397  std::string msg = "Failed to find point within element to tolerance of "
1398  + boost::lexical_cast<std::string>(tol)
1399  + " using local point ("
1400  + boost::lexical_cast<std::string>(locCoords[0]) +","
1401  + boost::lexical_cast<std::string>(locCoords[1]) +","
1402  + boost::lexical_cast<std::string>(locCoords[1])
1403  + ") in element: "
1404  + boost::lexical_cast<std::string>(min_id);
1405  WARNINGL1(false,msg.c_str());
1406 
1407  Vmath::Vcopy(locCoords.num_elements(),savLocCoords,1,locCoords,1);
1408  return min_id;
1409  }
1410  else
1411  {
1412  return -1;
1413  }
1414 
1415  }
1416  }
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:1917
int GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
Definition: ExpList.h:572
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
double NekDouble
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:219
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1794
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
int Nektar::MultiRegions::ExpList::GetExpSize ( void  )
inline

This function returns the number of elements in the expansion.

Returns
$N_{\mathrm{el}}$, the number of elements in the expansion.

Definition at line 1896 of file ExpList.h.

Referenced by Nektar::MultiRegions::ContField3DHomogeneous1D::ContField3DHomogeneous1D(), Nektar::MultiRegions::ContField3DHomogeneous2D::ContField3DHomogeneous2D(), Nektar::MultiRegions::DisContField3DHomogeneous1D::DisContField3DHomogeneous1D(), Nektar::MultiRegions::DisContField3DHomogeneous2D::DisContField3DHomogeneous2D(), Nektar::MultiRegions::DisContField3D::EvaluateHDGPostProcessing(), Nektar::MultiRegions::DisContField2D::EvaluateHDGPostProcessing(), Nektar::MultiRegions::ExpList0D::ExpList0D(), Nektar::MultiRegions::ExpList1D::ExpList1D(), Nektar::MultiRegions::ExpList2D::ExpList2D(), Nektar::MultiRegions::ExpList2DHomogeneous1D::ExpList2DHomogeneous1D(), Nektar::MultiRegions::ExpList3D::ExpList3D(), Nektar::MultiRegions::ExpList3DHomogeneous2D::ExpList3DHomogeneous2D(), Nektar::MultiRegions::ExpList3DHomogeneous1D::GenExpList3DHomogeneous1D(), Nektar::MultiRegions::DisContField1D::GetNegatedFluxNormal(), Nektar::MultiRegions::DisContField2D::L2_DGDeriv(), Nektar::MultiRegions::ExpList1D::PeriodicEval(), Nektar::MultiRegions::DisContField3D::SameTypeOfBoundaryConditions(), Nektar::MultiRegions::DisContField2D::SameTypeOfBoundaryConditions(), Nektar::MultiRegions::DisContField2D::v_AddFwdBwdTraceIntegral(), Nektar::MultiRegions::DisContField1D::v_AddTraceIntegral(), Nektar::MultiRegions::DisContField2D::v_AddTraceIntegral(), Nektar::MultiRegions::DisContField1D::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField2D::v_ExtractTracePhys(), Nektar::MultiRegions::DisContField3D::v_GetBoundaryToElmtMap(), Nektar::MultiRegions::DisContField2D::v_GetBoundaryToElmtMap(), Nektar::MultiRegions::DisContField1D::v_GetBoundaryToElmtMap(), Nektar::MultiRegions::DisContField1D::v_GetFwdBwdTracePhys(), Nektar::MultiRegions::DisContField2D::v_GetFwdBwdTracePhys(), Nektar::MultiRegions::DisContField3D::v_HelmSolve(), Nektar::MultiRegions::DisContField2D::v_HelmSolve(), Nektar::MultiRegions::DisContField1D::v_HelmSolve(), v_NormVectorIProductWRTBase(), Nektar::MultiRegions::ExpList3D::v_PhysGalerkinProjection1DScaled(), Nektar::MultiRegions::ExpList2D::v_PhysGalerkinProjection1DScaled(), Nektar::MultiRegions::ExpList3D::v_PhysInterp1DScaled(), Nektar::MultiRegions::ExpList2D::v_PhysInterp1DScaled(), Nektar::MultiRegions::ExpList3D::v_ReadGlobalOptimizationParameters(), and Nektar::MultiRegions::ExpList2D::v_ReadGlobalOptimizationParameters().

1897  {
1898  return (*m_exp).size();
1899  }
ExpansionType Nektar::MultiRegions::ExpList::GetExpType ( void  )

Returns the type of the expansion.

Definition at line 245 of file ExpList.cpp.

References m_expType.

246  {
247  return m_expType;
248  }
std::vector<LibUtilities::FieldDefinitionsSharedPtr> Nektar::MultiRegions::ExpList::GetFieldDefinitions ( )
inline

Definition at line 794 of file ExpList.h.

References v_GetFieldDefinitions().

795  {
796  return v_GetFieldDefinitions();
797  }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:2094
void Nektar::MultiRegions::ExpList::GetFieldDefinitions ( std::vector< LibUtilities::FieldDefinitionsSharedPtr > &  fielddef)
inline

Definition at line 800 of file ExpList.h.

References v_GetFieldDefinitions().

801  {
802  v_GetFieldDefinitions(fielddef);
803  }
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
Definition: ExpList.cpp:2094
void Nektar::MultiRegions::ExpList::GetFwdBwdTracePhys ( Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
inline

Definition at line 2045 of file ExpList.h.

References v_GetFwdBwdTracePhys().

2048  {
2049  v_GetFwdBwdTracePhys(Fwd,Bwd);
2050  }
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:2347
void Nektar::MultiRegions::ExpList::GetFwdBwdTracePhys ( const Array< OneD, const NekDouble > &  field,
Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
inline

Definition at line 2052 of file ExpList.h.

References v_GetFwdBwdTracePhys().

2056  {
2057  v_GetFwdBwdTracePhys(field,Fwd,Bwd);
2058  }
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Definition: ExpList.cpp:2347
const NekOptimize::GlobalOptParamSharedPtr& Nektar::MultiRegions::ExpList::GetGlobalOptParam ( void  )
inline

Definition at line 775 of file ExpList.h.

References m_globalOptParam.

776  {
777  return m_globalOptParam;
778  }
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
SpatialDomains::MeshGraphSharedPtr Nektar::MultiRegions::ExpList::GetGraph ( )
inline

Definition at line 876 of file ExpList.h.

References m_graph.

877  {
878  return m_graph;
879  }
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::BasisSharedPtr Nektar::MultiRegions::ExpList::GetHomogeneousBasis ( void  )
inline

Definition at line 882 of file ExpList.h.

References v_GetHomogeneousBasis().

883  {
884  return v_GetHomogeneousBasis();
885  }
virtual LibUtilities::BasisSharedPtr v_GetHomogeneousBasis(void)
Definition: ExpList.h:1372
NekDouble Nektar::MultiRegions::ExpList::GetHomoLen ( void  )
inline

This function returns the Width of homogeneous direction associaed with the homogeneous expansion.

Definition at line 527 of file ExpList.h.

References v_GetHomoLen().

528  {
529  return v_GetHomoLen();
530  }
virtual NekDouble v_GetHomoLen(void)
Definition: ExpList.cpp:1869
const std::vector< bool > & Nektar::MultiRegions::ExpList::GetLeftAdjacentFaces ( void  ) const
inline

Definition at line 2060 of file ExpList.h.

References v_GetLeftAdjacentFaces().

2061  {
2062  return v_GetLeftAdjacentFaces();
2063  }
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Definition: ExpList.cpp:2363
int Nektar::MultiRegions::ExpList::GetNcoeffs ( void  ) const
inline
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 1408 of file ExpList.h.

References m_exp.

1409  {
1410  return (*m_exp)[eid]->GetNcoeffs();
1411  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
void Nektar::MultiRegions::ExpList::GetNormals ( Array< OneD, Array< OneD, NekDouble > > &  normals)
inline

Definition at line 2016 of file ExpList.h.

References v_GetNormals().

2018  {
2019  v_GetNormals(normals);
2020  }
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Definition: ExpList.cpp:2314
int Nektar::MultiRegions::ExpList::GetNpoints ( void  ) const
inline

Returns the total number of quadrature points m_npoints $=Q_{\mathrm{tot}}$.

Definition at line 1485 of file ExpList.h.

References m_npoints.

1486  {
1487  return m_npoints;
1488  }
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 572 of file ExpList.h.

References v_GetNumElmts().

Referenced by GetExpIndex(), v_GetCoords(), and v_WriteTecplotHeader().

573  {
574  return v_GetNumElmts();
575  }
virtual int v_GetNumElmts(void)
Definition: ExpList.h:1056
int Nektar::MultiRegions::ExpList::GetOffset_Elmt_Id ( int  n) const
inline

Get the element id associated with the n th consecutive block of data in m_phys and m_coeffs.

Definition at line 1942 of file ExpList.h.

References m_offset_elmt_id.

Referenced by Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), Nektar::MultiRegions::AssemblyMapCG::CreateGraph(), and Nektar::MultiRegions::AssemblyMapDG::SetUpUniversalDGMap().

1943  {
1944  return m_offset_elmt_id[n];
1945  }
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
void Nektar::MultiRegions::ExpList::GetPeriodicEntities ( PeriodicMap periodicVerts,
PeriodicMap periodicEdges,
PeriodicMap periodicFaces = NullPeriodicMap 
)
inline

Definition at line 785 of file ExpList.h.

References v_GetPeriodicEntities().

789  {
790  v_GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
791  }
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
Definition: ExpList.cpp:2851
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 1887 of file ExpList.h.

References m_phys.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField2D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField1D::v_GetBndElmtExpansion(), Nektar::MultiRegions::DisContField3D::v_GetFwdBwdTracePhys(), Nektar::MultiRegions::DisContField1D::v_GetFwdBwdTracePhys(), and Nektar::MultiRegions::DisContField2D::v_GetFwdBwdTracePhys().

1888  {
1889  return m_phys;
1890  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
int Nektar::MultiRegions::ExpList::GetPhys_Offset ( int  n) const
inline
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 1551 of file ExpList.h.

References m_physState.

1552  {
1553  return m_physState;
1554  }
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
boost::shared_ptr<ExpList>& Nektar::MultiRegions::ExpList::GetPlane ( int  n)
inline

Definition at line 887 of file ExpList.h.

References v_GetPlane().

888  {
889  return v_GetPlane(n);
890  }
virtual boost::shared_ptr< ExpList > & v_GetPlane(int n)
Definition: ExpList.cpp:2874
std::map<int, RobinBCInfoSharedPtr> Nektar::MultiRegions::ExpList::GetRobinBCInfo ( )
inline

Definition at line 780 of file ExpList.h.

References v_GetRobinBCInfo().

Referenced by GenGlobalBndLinSys(), and GenGlobalMatrixFull().

781  {
782  return v_GetRobinBCInfo();
783  }
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
Definition: ExpList.cpp:2841
boost::shared_ptr<LibUtilities::SessionReader> Nektar::MultiRegions::ExpList::GetSession ( )
inline

Returns the session object.

Definition at line 865 of file ExpList.h.

References m_session.

866  {
867  return m_session;
868  }
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
boost::shared_ptr<ExpList> Nektar::MultiRegions::ExpList::GetSharedThisPtr ( )
inline

Returns a shared pointer to the current object.

Definition at line 859 of file ExpList.h.

Referenced by GenGlobalBndLinSys(), and GenGlobalLinSys().

860  {
861  return shared_from_this();
862  }
int Nektar::MultiRegions::ExpList::GetTotPoints ( void  ) const
inline
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 1458 of file ExpList.h.

References m_exp.

1459  {
1460  return (*m_exp)[eid]->GetTotPoints();
1461  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
boost::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::GetTrace ( )
inline

Return a reference to the trace space associated with this expansion list.

Definition at line 2001 of file ExpList.h.

References v_GetTrace().

Referenced by Nektar::MultiRegions::DisContField2D::v_AddFwdBwdTraceIntegral(), Nektar::MultiRegions::DisContField1D::v_AddTraceIntegral(), and Nektar::MultiRegions::DisContField2D::v_AddTraceIntegral().

2002  {
2003  return v_GetTrace();
2004  }
virtual boost::shared_ptr< ExpList > & v_GetTrace()
Definition: ExpList.cpp:2293
const Array< OneD, const int > & Nektar::MultiRegions::ExpList::GetTraceBndMap ( void  )
inline

Definition at line 2011 of file ExpList.h.

References v_GetTraceBndMap().

2012  {
2013  return v_GetTraceBndMap();
2014  }
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Definition: ExpList.cpp:2309
boost::shared_ptr< AssemblyMapDG > & Nektar::MultiRegions::ExpList::GetTraceMap ( void  )
inline

Definition at line 2006 of file ExpList.h.

References v_GetTraceMap().

Referenced by v_GetTraceBndMap().

2007  {
2008  return v_GetTraceMap();
2009  }
virtual boost::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Definition: ExpList.cpp:2301
LibUtilities::TranspositionSharedPtr Nektar::MultiRegions::ExpList::GetTransposition ( void  )
inline

This function returns the transposition class associaed with the homogeneous expansion.

Definition at line 520 of file ExpList.h.

References v_GetTransposition().

521  {
522  return v_GetTransposition();
523  }
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
Definition: ExpList.cpp:1861
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 1502 of file ExpList.h.

References m_WaveSpace.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous1D::v_GetBndElmtExpansion().

1503  {
1504  return m_WaveSpace;
1505  }
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 536 of file ExpList.h.

References v_GetYIDs().

537  {
538  return v_GetYIDs();
539  }
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
Definition: ExpList.cpp:1885
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 513 of file ExpList.h.

References v_GetZIDs().

Referenced by v_WriteTecplotZone().

514  {
515  return v_GetZIDs();
516  }
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
Definition: ExpList.cpp:1877
void Nektar::MultiRegions::ExpList::GlobalEigenSystem ( const boost::shared_ptr< DNekMat > &  Gmat,
Array< OneD, NekDouble > &  EigValsReal,
Array< OneD, NekDouble > &  EigValsImag,
Array< OneD, NekDouble > &  EigVecs = NullNekDouble1DArray 
)
protected
void Nektar::MultiRegions::ExpList::GlobalToLocal ( void  )
inline
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 1967 of file ExpList.cpp.

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

1970  {
1971  NekDouble err = 0.0, errh1;
1972  int i;
1973 
1974  for (i = 0; i < (*m_exp).size(); ++i)
1975  {
1976  errh1 = (*m_exp)[i]->H1(inarray + m_phys_offset[i],
1977  soln + m_phys_offset[i]);
1978  err += errh1*errh1;
1979  }
1980 
1981  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceSum);
1982 
1983  return sqrt(err);
1984  }
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
double NekDouble
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
void Nektar::MultiRegions::ExpList::HelmSolve ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const FlagList flags,
const StdRegions::ConstFactorMap factors,
const StdRegions::VarCoeffMap varcoeff = StdRegions::NullVarCoeffMap,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray 
)
inline

Solve helmholtz problem.

Definition at line 1642 of file ExpList.h.

References v_HelmSolve().

1649  {
1650  v_HelmSolve(inarray, outarray, flags, factors, varcoeff, dirForcing);
1651  }
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing)
Definition: ExpList.cpp:2395
void Nektar::MultiRegions::ExpList::HomogeneousBwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal,
bool  Shuff = true,
bool  UnShuff = true 
)
inline

Definition at line 1738 of file ExpList.h.

References v_HomogeneousBwdTrans().

1744  {
1745  v_HomogeneousBwdTrans(inarray,outarray,coeffstate,Shuff,UnShuff);
1746  }
virtual void v_HomogeneousBwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:2440
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 497 of file ExpList.h.

References v_HomogeneousEnergy().

498  {
499  return v_HomogeneousEnergy();
500  }
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
Definition: ExpList.cpp:1853
void Nektar::MultiRegions::ExpList::HomogeneousFwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal,
bool  Shuff = true,
bool  UnShuff = true 
)
inline

Definition at line 1725 of file ExpList.h.

References v_HomogeneousFwdTrans().

1731  {
1732  v_HomogeneousFwdTrans(inarray,outarray,coeffstate,Shuff,UnShuff);
1733  }
virtual void v_HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
Definition: ExpList.cpp:2430
void Nektar::MultiRegions::ExpList::ImposeDirichletConditions ( Array< OneD, NekDouble > &  outarray)
inline

Impose Dirichlet Boundary Conditions onto Array.

Definition at line 1839 of file ExpList.h.

References v_ImposeDirichletConditions().

1841  {
1842  v_ImposeDirichletConditions(outarray);
1843  }
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:2519
NekDouble Nektar::MultiRegions::ExpList::Integral ( const Array< OneD, const NekDouble > &  inarray)
inline

Definition at line 490 of file ExpList.h.

References v_Integral().

491  {
492  return v_Integral(inarray);
493  }
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Definition: ExpList.cpp:1839
void Nektar::MultiRegions::ExpList::IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
inline

Definition at line 1559 of file ExpList.h.

References v_IProductWRTBase().

Referenced by Nektar::MultiRegions::ContField3D::v_FwdTrans(), Nektar::MultiRegions::ContField3D::v_HelmSolve(), Nektar::MultiRegions::DisContField3D::v_HelmSolve(), Nektar::MultiRegions::DisContField2D::v_HelmSolve(), and Nektar::MultiRegions::DisContField1D::v_HelmSolve().

1563  {
1564  v_IProductWRTBase(inarray,outarray, coeffstate);
1565  }
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2560
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 1570 of file ExpList.h.

References v_IProductWRTBase_IterPerExp().

Referenced by Nektar::MultiRegions::ContField2D::IProductWRTBase(), Nektar::MultiRegions::ContField1D::IProductWRTBase(), v_FwdTrans_IterPerExp(), and Nektar::MultiRegions::ContField3D::v_IProductWRTBase().

1573  {
1574  v_IProductWRTBase_IterPerExp(inarray,outarray);
1575  }
virtual void v_IProductWRTBase_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:356
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 383 of file ExpList.cpp.

References m_coeff_offset, and m_phys_offset.

386  {
387  int i;
388 
389  Array<OneD,NekDouble> e_outarray;
390 
391  for(i = 0; i < (*m_exp).size(); ++i)
392  {
393  (*m_exp)[i]->IProductWRTDerivBase(dir,inarray+m_phys_offset[i],
394  e_outarray = outarray+m_coeff_offset[i]);
395  }
396  }
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
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 (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
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 410 of file ExpList.cpp.

References ASSERTL0, ASSERTL1, Nektar::NekOptimize::eIProductWRTDerivBase, GetCoordim(), m_coll_coeff_offset, m_coll_phys_offset, and m_collections.

412  {
413  Array<OneD, NekDouble> tmp0,tmp1,tmp2;
414  // assume coord dimension defines the size of Deriv Base
415  int dim = GetCoordim(0);
416 
417  ASSERTL1(inarray.num_elements() >= dim,"inarray is not of sufficient dimension");
418 
419  switch(dim)
420  {
421  case 1:
422  for (int i = 0; i < m_collections.size(); ++i)
423  {
424  m_collections[i].ApplyOperator(
426  inarray[0] + m_coll_phys_offset[i],
427  tmp0 = outarray + m_coll_coeff_offset[i]);
428  }
429  break;
430  case 2:
431  for (int i = 0; i < m_collections.size(); ++i)
432  {
433  m_collections[i].ApplyOperator(
435  inarray[0] + m_coll_phys_offset[i],
436  tmp0 = inarray[1] + m_coll_phys_offset[i],
437  tmp1 = outarray + m_coll_coeff_offset[i]);
438  }
439  break;
440  case 3:
441  for (int i = 0; i < m_collections.size(); ++i)
442  {
443  m_collections[i].ApplyOperator(
445  inarray[0] + m_coll_phys_offset[i],
446  tmp0 = inarray[1] + m_coll_phys_offset[i],
447  tmp1 = inarray[2] + m_coll_phys_offset[i],
448  tmp2 = outarray + m_coll_coeff_offset[i]);
449  }
450  break;
451  default:
452  ASSERTL0(false,"Dimension of inarray not correct");
453  break;
454  }
455  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:985
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1794
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:982
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
Collections::CollectionVector m_collections
Definition: ExpList.h:979
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 477 of file ExpList.h.

References v_L2().

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

480  {
481  return v_L2(inarray, soln);
482  }
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Definition: ExpList.cpp:1809
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,
CoeffState  coeffstate = eLocal,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray 
)
inline

Solve Advection Diffusion Reaction.

Definition at line 1657 of file ExpList.h.

References v_LinearAdvectionDiffusionReactionSolve().

1664  {
1665  v_LinearAdvectionDiffusionReactionSolve(velocity,inarray, outarray,
1666  lambda, coeffstate,dirForcing);
1667  }
virtual void v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:2406
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,
CoeffState  coeffstate = eLocal,
const Array< OneD, const NekDouble > &  dirForcing = NullNekDouble1DArray 
)
inline

Solve Advection Diffusion Reaction.

Definition at line 1669 of file ExpList.h.

References v_LinearAdvectionReactionSolve().

1676  {
1677  v_LinearAdvectionReactionSolve(velocity,inarray, outarray,
1678  lambda, coeffstate,dirForcing);
1679  }
virtual void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ExpList.cpp:2418
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 1770 of file ExpList.cpp.

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

1773  {
1774  NekDouble err = 0.0;
1775 
1776  if (soln == NullNekDouble1DArray)
1777  {
1778  err = Vmath::Vmax(m_npoints, inarray, 1);
1779  }
1780  else
1781  {
1782  for (int i = 0; i < m_npoints; ++i)
1783  {
1784  err = max(err, abs(inarray[i] - soln[i]));
1785  }
1786  }
1787 
1788  m_comm->GetRowComm()->AllReduce(err, LibUtilities::ReduceMax);
1789 
1790  return err;
1791  }
static Array< OneD, NekDouble > NullNekDouble1DArray
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:765
double NekDouble
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: ExpList.h:907
void Nektar::MultiRegions::ExpList::LocalToGlobal ( void  )
inline
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 326 of file ExpList.cpp.

References Nektar::eWrapper, and GetBlockMatrix().

Referenced by GeneralMatrixOp_IterPerExp().

330  {
331  // Retrieve the block matrix using the given key.
332  const DNekScalBlkMatSharedPtr& blockmat = GetBlockMatrix(gkey);
333  int nrows = blockmat->GetRows();
334  int ncols = blockmat->GetColumns();
335 
336  // Create NekVectors from the given data arrays
337  NekVector<NekDouble> in (ncols,inarray, eWrapper);
338  NekVector< NekDouble> out(nrows,outarray,eWrapper);
339 
340  // Perform matrix-vector multiply.
341  out = (*blockmat)*in;
342  }
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:814
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
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 565 of file ExpList.cpp.

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

Referenced by v_FwdTrans_IterPerExp().

568  {
569  GlobalMatrixKey mkey(StdRegions::eInvMass);
570  const DNekScalBlkMatSharedPtr& InvMass = GetBlockMatrix(mkey);
571 
572  // Inverse mass matrix
573  NekVector<NekDouble> out(m_ncoeffs,outarray,eWrapper);
574  if(inarray.get() == outarray.get())
575  {
576  NekVector<NekDouble> in(m_ncoeffs,inarray); // copy data
577  out = (*InvMass)*in;
578  }
579  else
580  {
581  NekVector<NekDouble> in(m_ncoeffs,inarray,eWrapper);
582  out = (*InvMass)*in;
583  }
584  }
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:814
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
void Nektar::MultiRegions::ExpList::MultiplyByInvMassMatrix ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
inline

Definition at line 1631 of file ExpList.h.

References v_MultiplyByInvMassMatrix().

1635  {
1636  v_MultiplyByInvMassMatrix(inarray,outarray,coeffstate);
1637  }
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Definition: ExpList.cpp:2386
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 1774 of file ExpList.h.

References v_NormVectorIProductWRTBase().

1779  {
1780  v_NormVectorIProductWRTBase(V1,V2,outarray,BndID);
1781  }
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:2464
void Nektar::MultiRegions::ExpList::NormVectorIProductWRTBase ( Array< OneD, Array< OneD, NekDouble > > &  V,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 1783 of file ExpList.h.

References v_NormVectorIProductWRTBase().

1786  {
1787  v_NormVectorIProductWRTBase(V, outarray);
1788  }
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
Definition: ExpList.cpp:2464
void Nektar::MultiRegions::ExpList::PhysDeriv ( Direction  edir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d 
)
inline

Definition at line 1714 of file ExpList.h.

References v_PhysDeriv().

1718  {
1719  v_PhysDeriv(edir, inarray,out_d);
1720  }
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:490
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 1695 of file ExpList.h.

References v_PhysDeriv().

1699  {
1700  v_PhysDeriv(inarray,out_d0,out_d1,out_d2);
1701  }
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:490
void Nektar::MultiRegions::ExpList::PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d 
)
inline

Definition at line 1706 of file ExpList.h.

References v_PhysDeriv().

1710  {
1711  v_PhysDeriv(dir,inarray,out_d);
1712  }
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:490
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 557 of file ExpList.h.

References v_PhysGalerkinProjection1DScaled().

561  {
562  v_PhysGalerkinProjection1DScaled(scale, inarray, outarray);
563  }
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1900
NekDouble Nektar::MultiRegions::ExpList::PhysIntegral ( void  )

This function integrates a function $f(\boldsymbol{x})$ over the domain consisting of all the elements of the expansion.

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

References ASSERTL1, m_phys, and m_physState.

279  {
280  ASSERTL1(m_physState == true,
281  "local physical space is not true ");
282 
283  return PhysIntegral(m_phys);
284  }
NekDouble PhysIntegral(void)
This function integrates a function over the domain consisting of all the elements of the expansion...
Definition: ExpList.cpp:278
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
NekDouble Nektar::MultiRegions::ExpList::PhysIntegral ( const Array< OneD, const NekDouble > &  inarray)

This function integrates a function $f(\boldsymbol{x})$ over the domain consisting of all the elements of the expansion.

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

References m_phys_offset.

305  {
306  int i;
307  NekDouble sum = 0.0;
308 
309  for(i = 0; i < (*m_exp).size(); ++i)
310  {
311  sum += (*m_exp)[i]->Integral(inarray + m_phys_offset[i]);
312  }
313 
314  return sum;
315  }
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:991
double NekDouble
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 545 of file ExpList.h.

References v_PhysInterp1DScaled().

549  {
550  v_PhysInterp1DScaled(scale, inarray,outarray);
551  }
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1894
void Nektar::MultiRegions::ExpList::ReadGlobalOptimizationParameters ( )
inlineprotected
void Nektar::MultiRegions::ExpList::Reset ( )
inline

Reset geometry information and reset matrices.

Definition at line 371 of file ExpList.h.

References v_Reset().

372  {
373  v_Reset();
374  }
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:1437
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 1805 of file ExpList.h.

References m_coeffs.

1806  {
1807  m_coeffs[i] = val;
1808  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
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 1815 of file ExpList.h.

References m_coeffs.

1816  {
1817  m_coeffs[i] = val;
1818  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
void Nektar::MultiRegions::ExpList::SetCoeffsArray ( Array< OneD, NekDouble > &  inarray)
inline

Set the m_coeffs array to inarray.

Definition at line 1821 of file ExpList.h.

References m_coeffs.

1822  {
1823  m_coeffs = inarray;
1824  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
void Nektar::MultiRegions::ExpList::SetExpType ( ExpansionType  Type)
void Nektar::MultiRegions::ExpList::SetHomo1DSpecVanVisc ( Array< OneD, NekDouble visc)
inline

This function sets the Spectral Vanishing Viscosity in homogeneous1D expansion.

Definition at line 504 of file ExpList.h.

References v_SetHomo1DSpecVanVisc().

505  {
507  }
virtual void v_SetHomo1DSpecVanVisc(Array< OneD, NekDouble > visc)
Definition: ExpList.h:1380
void Nektar::MultiRegions::ExpList::SetModifiedBasis ( const bool  modbasis)
inline

Set Modified Basis for the stability analysis.

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

References m_phys.

1509  {
1510  m_phys[i] = val;
1511  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
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 1522 of file ExpList.h.

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

1524  {
1525  ASSERTL0(inarray.num_elements() == m_npoints,
1526  "Input array does not have correct number of elements.");
1527 
1528  Vmath::Vcopy(m_npoints,&inarray[0],1,&m_phys[0],1);
1529  m_physState = true;
1530  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
void Nektar::MultiRegions::ExpList::SetPhysArray ( Array< OneD, NekDouble > &  inarray)
inline

Sets the array m_phys.

Definition at line 1533 of file ExpList.h.

References m_phys.

1534  {
1535  m_phys = inarray;
1536  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
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 1542 of file ExpList.h.

References m_physState.

1543  {
1544  m_physState = physState;
1545  }
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
void Nektar::MultiRegions::ExpList::SetUpPhysNormals ( )
inline
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 1494 of file ExpList.h.

References m_WaveSpace.

1495  {
1496  m_WaveSpace = wavespace;
1497  }
void Nektar::MultiRegions::ExpList::SmoothField ( Array< OneD, NekDouble > &  field)
inline

Smooth a field across elements.

Definition at line 1601 of file ExpList.h.

References v_SmoothField().

1602  {
1603  v_SmoothField(field);
1604  }
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Definition: ExpList.cpp:636
boost::shared_ptr< ExpList > & Nektar::MultiRegions::ExpList::UpdateBndCondExpansion ( int  i)
inline

Definition at line 1978 of file ExpList.h.

References v_UpdateBndCondExpansion().

1979  {
1980  return v_UpdateBndCondExpansion(i);
1981  }
virtual boost::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
Definition: ExpList.cpp:2265
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & Nektar::MultiRegions::ExpList::UpdateBndConditions ( )
inline

Definition at line 2086 of file ExpList.h.

References v_UpdateBndConditions().

2087  {
2088  return v_UpdateBndConditions();
2089  }
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
Definition: ExpList.cpp:2819
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 1953 of file ExpList.h.

References m_coeffs.

Referenced by Nektar::MultiRegions::DisContField3DHomogeneous2D::EvaluateBoundaryConditions(), and Nektar::MultiRegions::DisContField3DHomogeneous1D::EvaluateBoundaryConditions().

1954  {
1955  return m_coeffs;
1956  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
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 1964 of file ExpList.h.

References m_phys, and m_physState.

1965  {
1966  m_physState = true;
1967  return m_phys;
1968  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:965
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 1983 of file ExpList.h.

References v_Upwind().

1988  {
1989  v_Upwind(Vec, Fwd, Bwd, Upwind);
1990  }
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:2273
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 1992 of file ExpList.h.

References v_Upwind().

1997  {
1998  v_Upwind(Vn, Fwd, Bwd, Upwind);
1999  }
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:2273
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::DisContField2D, and Nektar::MultiRegions::DisContField3D.

Definition at line 2338 of file ExpList.cpp.

References ASSERTL0.

Referenced by AddFwdBwdTraceIntegral().

2342  {
2343  ASSERTL0(false,
2344  "This method is not defined or valid for this class type");
2345  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void Nektar::MultiRegions::ExpList::v_AddTraceIntegral ( const Array< OneD, const NekDouble > &  Fx,
const Array< OneD, const NekDouble > &  Fy,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField2D.

Definition at line 2321 of file ExpList.cpp.

References ASSERTL0.

Referenced by AddTraceIntegral().

2325  {
2326  ASSERTL0(false,
2327  "This method is not defined or valid for this class type");
2328  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void Nektar::MultiRegions::ExpList::v_AddTraceIntegral ( const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::DisContField2D, Nektar::MultiRegions::DisContField3D, and Nektar::MultiRegions::DisContField1D.

Definition at line 2330 of file ExpList.cpp.

References ASSERTL0.

2333  {
2334  ASSERTL0(false,
2335  "This method is not defined or valid for this class type");
2336  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void Nektar::MultiRegions::ExpList::v_AppendFieldData ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata 
)
protectedvirtual

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

Definition at line 2108 of file ExpList.cpp.

References m_coeffs.

Referenced by AppendFieldData().

2109  {
2110  v_AppendFieldData(fielddef,fielddata,m_coeffs);
2111  }
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
Definition: ExpList.cpp:2108
void Nektar::MultiRegions::ExpList::v_AppendFieldData ( LibUtilities::FieldDefinitionsSharedPtr fielddef,
std::vector< NekDouble > &  fielddata,
Array< OneD, NekDouble > &  coeffs 
)
protectedvirtual

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

Definition at line 2113 of file ExpList.cpp.

References m_coeff_offset.

2114  {
2115  int i;
2116  // Determine mapping from element ids to location in
2117  // expansion list
2118  // Determine mapping from element ids to location in
2119  // expansion list
2120  map<int, int> ElmtID_to_ExpID;
2121  for(i = 0; i < (*m_exp).size(); ++i)
2122  {
2123  ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2124  }
2125 
2126  for(i = 0; i < fielddef->m_elementIDs.size(); ++i)
2127  {
2128  int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
2129  int datalen = (*m_exp)[eid]->GetNcoeffs();
2130  fielddata.insert(fielddata.end(),&coeffs[m_coeff_offset[eid]],&coeffs[m_coeff_offset[eid]]+datalen);
2131  }
2132 
2133  }
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
void Nektar::MultiRegions::ExpList::v_BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField2D, Nektar::MultiRegions::ContField1D, Nektar::MultiRegions::ExpListHomogeneous1D, Nektar::MultiRegions::ExpListHomogeneous2D, and Nektar::MultiRegions::ContField3D.

Definition at line 2546 of file ExpList.cpp.

References v_BwdTrans_IterPerExp().

Referenced by BwdTrans().

2549  {
2550  v_BwdTrans_IterPerExp(inarray,outarray);
2551  }
virtual void v_BwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1231
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::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 1231 of file ExpList.cpp.

References Nektar::StdRegions::eBwdTrans, m_coll_coeff_offset, m_coll_phys_offset, and m_collections.

Referenced by BwdTrans_IterPerExp(), and v_BwdTrans().

1233  {
1234  Array<OneD, NekDouble> tmp;
1235  for (int i = 0; i < m_collections.size(); ++i)
1236  {
1237  m_collections[i].ApplyOperator(Collections::eBwdTrans,
1238  inarray + m_coll_coeff_offset[i],
1239  tmp = outarray + m_coll_phys_offset[i]);
1240  }
1241  }
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
Definition: ExpList.h:985
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:982
Collections::CollectionVector m_collections
Definition: ExpList.h:979
void Nektar::MultiRegions::ExpList::v_ClearGlobalLinSysManager ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::ContField2D, Nektar::MultiRegions::ContField1D, Nektar::MultiRegions::ContField3D, Nektar::MultiRegions::ContField3DHomogeneous1D, and Nektar::MultiRegions::ContField3DHomogeneous2D.

Definition at line 1905 of file ExpList.cpp.

References ASSERTL0.

Referenced by ClearGlobalLinSysManager().

1906  {
1907  ASSERTL0(false,
1908  "This method is not defined or valid for this class type");
1909  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void Nektar::MultiRegions::ExpList::v_DealiasedProd ( const Array< OneD, NekDouble > &  inarray1,
const Array< OneD, NekDouble > &  inarray2,
Array< OneD, NekDouble > &  outarray,
CoeffState  coeffstate = eLocal 
)
protectedvirtual

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

Definition at line 2450 of file ExpList.cpp.

References ASSERTL0.

Referenced by DealiasedProd().

2451  {
2452  ASSERTL0(false,
2453  "This method is not defined or valid for this class type");
2454  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
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::DisContField2D, Nektar::MultiRegions::DisContField3DHomogeneous1D, Nektar::MultiRegions::DisContField3D, Nektar::MultiRegions::DisContField1D, and Nektar::MultiRegions::DisContField3DHomogeneous2D.

Definition at line 2829 of file ExpList.cpp.

References ASSERTL0.

Referenced by EvaluateBoundaryConditions().

2834  {
2835  ASSERTL0(false,
2836  "This method is not defined or valid for this class type");
2837  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void Nektar::MultiRegions::ExpList::v_ExtractCoeffsToCoeffs ( const boost::shared_ptr< ExpList > &  fromExpList,
const Array< OneD, const NekDouble > &  fromCoeffs,
Array< OneD, NekDouble > &  toCoeffs 
)
protectedvirtual

Reimplemented in Nektar::MultiRegions::ExpListHomogeneous1D.

Definition at line 2234 of file ExpList.cpp.

References m_coeff_offset, and m_offset_elmt_id.

Referenced by ExtractCoeffsToCoeffs().

2235  {
2236  int i;
2237  int offset = 0;
2238 
2239  for(i = 0; i < (*m_exp).size(); ++i)
2240  {
2241  std::vector<unsigned int> nummodes;
2242  int eid = m_offset_elmt_id[i];
2243  for(int j= 0; j < fromExpList->GetExp(eid)->GetNumBases(); ++j)
2244  {
2245  nummodes.push_back(fromExpList->GetExp(eid)->GetBasisNumModes(j));
2246  }
2247 
2248  (*m_exp)[eid]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes,0,
2249  &toCoeffs[m_coeff_offset[eid]]);
2250 
2251  offset += fromExpList->GetExp(eid)->GetNcoeffs();
2252  }
2253  }
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
Definition: ExpList.h:999
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::ExpListHomogeneous1D, and Nektar::MultiRegions::ExpListHomogeneous2D.

Definition at line 2158 of file ExpList.cpp.

References ASSERTL0, GetNcoeffs(), Nektar::LibUtilities::GetNumberOfCoefficients(), m_coeff_offset, m_exp, and Vmath::Vcopy().

Referenced by ExtractDataToCoeffs().

2163  {
2164  int i, expId;
2165  int offset = 0;
2166  int modes_offset = 0;
2167  int datalen = fielddata.size()/fielddef->m_fields.size();
2168 
2169  // Find data location according to field definition
2170  for(i = 0; i < fielddef->m_fields.size(); ++i)
2171  {
2172  if(fielddef->m_fields[i] == field)
2173  {
2174  break;
2175  }
2176  offset += datalen;
2177  }
2178 
2179  ASSERTL0(i != fielddef->m_fields.size(),
2180  "Field (" + field + ") not found in file.");
2181 
2182  // Determine mapping from element ids to location in expansion list
2183  map<int, int> elmtToExpId;
2184 
2185  // Loop in reverse order so that in case where using a Homogeneous
2186  // expansion it sets geometry ids to first part of m_exp
2187  // list. Otherwise will set to second (complex) expansion
2188  for(i = (*m_exp).size()-1; i >= 0; --i)
2189  {
2190  elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2191  }
2192 
2193  for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
2194  {
2195  // Reset modes_offset in the case where all expansions of
2196  // the same order.
2197  if (fielddef->m_uniOrder == true)
2198  {
2199  modes_offset = 0;
2200  }
2201 
2202  datalen = LibUtilities::GetNumberOfCoefficients(fielddef->m_shapeType,
2203  fielddef->m_numModes, modes_offset);
2204 
2205  const int elmtId = fielddef->m_elementIDs[i];
2206  if (elmtToExpId.count(elmtId) == 0)
2207  {
2208  offset += datalen;
2209  modes_offset += (*m_exp)[0]->GetNumBases();
2210