Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Nektar::MultiRegions::ExpList2D Class Reference

Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expansions. More...

#include <ExpList2D.h>

Inheritance diagram for Nektar::MultiRegions::ExpList2D:
Inheritance graph
[legend]
Collaboration diagram for Nektar::MultiRegions::ExpList2D:
Collaboration graph
[legend]

Public Member Functions

 ExpList2D ()
 Default constructor. More...
 
 ExpList2D (const ExpList2D &In, const bool DeclareCoeffPhysArrays=true)
 Copy constructor. More...
 
 ExpList2D (const ExpList2D &In, const std::vector< unsigned int > &eIDs, const bool DeclareCoeffPhysArrays=true)
 Constructor copying only elements defined in eIds. More...
 
 ExpList2D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph2D, const bool DelcareCoeffPhysArrays=true, const std::string &var="DefaultVar")
 Sets up a list of local expansions based on an input mesh. More...
 
 ExpList2D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::ExpansionMap &expansions, const bool DeclareCoeffPhysArrays=true)
 Sets up a list of local expansions based on an expansion Map. More...
 
 ExpList2D (const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::BasisKey &TriBa, const LibUtilities::BasisKey &TriBb, const LibUtilities::BasisKey &QuadBa, const LibUtilities::BasisKey &QuadBb, const SpatialDomains::MeshGraphSharedPtr &graph2D, const LibUtilities::PointsType TriNb=LibUtilities::SIZE_PointsType)
 Sets up a list of local expansions based on an input mesh and separately defined basiskeys. More...
 
 ExpList2D (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const ExpListSharedPtr > &bndConstraint, const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > &bndCond, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph3D, const PeriodicMap &periodicFaces, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar")
 
 ExpList2D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::CompositeMap &domain, const SpatialDomains::MeshGraphSharedPtr &graph3D, const std::string variable="DefaultVar")
 Specialised constructor for Neumann boundary conditions in DisContField3D and ContField3D. More...
 
virtual ~ExpList2D ()
 Destructor. More...
 
- Public Member Functions inherited from Nektar::MultiRegions::ExpList
 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)
 

Protected Member Functions

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)
 Upwind the Fwd and Bwd states based on the one- dimensional normal velocity field given by Vn. More...
 
void v_GetNormals (Array< OneD, Array< OneD, NekDouble > > &normals)
 For each local element, copy the normals stored in the element list into the array normals. More...
 
- Protected Member Functions inherited from Nektar::MultiRegions::ExpList
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 boost::shared_ptr
< ExpList > & 
v_GetTrace ()
 
virtual boost::shared_ptr
< AssemblyMapDG > & 
v_GetTraceMap ()
 
virtual const Array< OneD,
const int > & 
v_GetTraceBndMap ()
 
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_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 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_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_ClearGlobalLinSysManager (void)
 
void ExtractFileBCs (const std::string &fileName, const std::string &varName, const boost::shared_ptr< ExpList > locExpList)
 

Private Member Functions

void SetCoeffPhysOffsets (void)
 Definition of the total number of degrees of freedom and quadrature points and offsets to access datax. More...
 
virtual void v_SetUpPhysNormals ()
 Set up the normals on each expansion. More...
 
virtual void v_ReadGlobalOptimizationParameters ()
 
virtual void v_WriteVtkPieceHeader (std::ostream &outfile, int expansion, int istrip)
 
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)
 

Additional Inherited Members

- Public Attributes inherited from Nektar::MultiRegions::ExpList
ExpansionType m_expType
 
- Static Protected Member Functions inherited from Nektar::MultiRegions::ExpList
static
SpatialDomains::BoundaryConditionShPtr 
GetBoundaryCondition (const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
 
- Protected Attributes inherited from Nektar::MultiRegions::ExpList
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
 
boost::unordered_map< int, int > m_elmtToExpId
 Mapping from geometry ID of element to index inside m_exp. More...
 

Detailed Description

Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expansions.

This multi-elemental expansion, which does not exhibit any coupling between the expansion on the separate elements, can be formulated as,

\[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. This class inherits all its variables and member functions from the base class ExpList.

Definition at line 60 of file ExpList2D.h.

Constructor & Destructor Documentation

Nektar::MultiRegions::ExpList2D::ExpList2D ( )

Default constructor.

Definition at line 69 of file ExpList2D.cpp.

References Nektar::MultiRegions::e2D, and Nektar::MultiRegions::ExpList::SetExpType().

69  :
70  ExpList()
71  {
72  SetExpType(e2D);
73  }
ExpList()
The default constructor.
Definition: ExpList.cpp:95
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
Nektar::MultiRegions::ExpList2D::ExpList2D ( const ExpList2D In,
const bool  DeclareCoeffPhysArrays = true 
)

Copy constructor.

Parameters
InExpList2D object to copy.

Definition at line 87 of file ExpList2D.cpp.

References Nektar::MultiRegions::e2D, and Nektar::MultiRegions::ExpList::SetExpType().

89  :
90  ExpList(In,DeclareCoeffPhysArrays)
91  {
92  SetExpType(e2D);
93  }
ExpList()
The default constructor.
Definition: ExpList.cpp:95
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
Nektar::MultiRegions::ExpList2D::ExpList2D ( const ExpList2D In,
const std::vector< unsigned int > &  eIDs,
const bool  DeclareCoeffPhysArrays = true 
)

Constructor copying only elements defined in eIds.

Parameters
InExpList2D object to copy.
eIDsId of elements that should be copied.

Definition at line 99 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::MultiRegions::ExpList::CreateCollections(), Nektar::MultiRegions::e2D, Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::MultiRegions::ExpList::m_globalOptParam, Nektar::MultiRegions::ExpList::ReadGlobalOptimizationParameters(), SetCoeffPhysOffsets(), and Nektar::MultiRegions::ExpList::SetExpType().

102  :
103  ExpList(In,eIDs,DeclareCoeffPhysArrays)
104  {
105  SetExpType(e2D);
106 
107  // Setup Default optimisation information.
108  int nel = GetExpSize();
111 
112  // set up offset arrays.
114 
117  }
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:2956
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
Nektar::MultiRegions::ExpList2D::ExpList2D ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr graph2D,
const bool  DeclareCoeffPhysArrays = true,
const std::string &  var = "DefaultVar" 
)

Sets up a list of local expansions based on an input mesh.

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

Parameters
graph2DA mesh, containing information about the domain and the spectral/hp element expansion.

Definition at line 132 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::MultiRegions::ExpList::CreateCollections(), Nektar::MultiRegions::e2D, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eNodalTriElec, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::BasisKey::GetBasisType(), Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::MultiRegions::ExpList::m_coeffs, Nektar::MultiRegions::ExpList::m_globalOptParam, Nektar::MultiRegions::ExpList::m_ncoeffs, Nektar::MultiRegions::ExpList::m_npoints, Nektar::MultiRegions::ExpList::m_phys, Nektar::MultiRegions::ExpList::ReadGlobalOptimizationParameters(), SetCoeffPhysOffsets(), and Nektar::MultiRegions::ExpList::SetExpType().

136  :
137  ExpList(pSession,graph2D)
138  {
139  SetExpType(e2D);
140 
141  int elmtid=0;
147 
148  const SpatialDomains::ExpansionMap &expansions
149  = graph2D->GetExpansions(var);
150 
151  SpatialDomains::ExpansionMap::const_iterator expIt;
152  for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
153  {
155  SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
156 
157  if ((TriangleGeom = boost::dynamic_pointer_cast<SpatialDomains
158  ::TriGeom>(expIt->second->m_geomShPtr)))
159  {
160  LibUtilities::BasisKey TriBa
161  = expIt->second->m_basisKeyVector[0];
162  LibUtilities::BasisKey TriBb
163  = expIt->second->m_basisKeyVector[1];
164 
165  // This is not elegantly implemented needs re-thinking.
166  if (TriBa.GetBasisType() == LibUtilities::eGLL_Lagrange)
167  {
168  LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
169  TriBa.GetNumModes(),
170  TriBa.GetPointsKey());
171 
174  ::AllocateSharedPtr(newBa,TriBb,TriNb,
175  TriangleGeom);
176  Ntri->SetElmtId(elmtid++);
177  (*m_exp).push_back(Ntri);
178  }
179  else
180  {
182  ::AllocateSharedPtr(TriBa,TriBb,
183  TriangleGeom);
184  tri->SetElmtId(elmtid++);
185  (*m_exp).push_back(tri);
186  }
187  m_ncoeffs += (TriBa.GetNumModes()*(TriBa.GetNumModes()+1))/2
188  + TriBa.GetNumModes()*(TriBb.GetNumModes()
189  -TriBa.GetNumModes());
190  m_npoints += TriBa.GetNumPoints()*TriBb.GetNumPoints();
191  }
192  else if ((QuadrilateralGeom = boost::dynamic_pointer_cast<
193  SpatialDomains::QuadGeom>(expIt->second->m_geomShPtr)))
194  {
195  LibUtilities::BasisKey QuadBa
196  = expIt->second->m_basisKeyVector[0];
197  LibUtilities::BasisKey QuadBb
198  = expIt->second->m_basisKeyVector[1];
199 
201  ::AllocateSharedPtr(QuadBa,QuadBb,
202  QuadrilateralGeom);
203  quad->SetElmtId(elmtid++);
204  (*m_exp).push_back(quad);
205 
206  m_ncoeffs += QuadBa.GetNumModes()*QuadBb.GetNumModes();
207  m_npoints += QuadBa.GetNumPoints()*QuadBb.GetNumPoints();
208  }
209  else
210  {
211  ASSERTL0(false, "dynamic cast to a proper Geometry2D "
212  "failed");
213  }
214 
215  }
216 
217  // set up element numbering
218  for(int i = 0; i < (*m_exp).size(); ++i)
219  {
220  (*m_exp)[i]->SetElmtId(i);
221  }
222 
223  // Setup Default optimisation information.
224  int nel = GetExpSize();
227 
228 
229  // set up offset arrays.
231 
232  if (DeclareCoeffPhysArrays)
233  {
234  // Set up m_coeffs, m_phys.
235  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs);
236  m_phys = Array<OneD, NekDouble>(m_npoints);
237  }
238 
241  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
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
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Principle Orthogonal Functions .
Definition: BasisType.h:46
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:293
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
boost::shared_ptr< GeometryVector > Composite
Definition: MeshGraph.h:114
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:2956
Lagrange for SEM basis .
Definition: BasisType.h:53
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
2D Nodal Electrostatic Points on a Triangle
Definition: PointsType.h:68
std::map< int, ExpansionShPtr > ExpansionMap
Definition: MeshGraph.h:174
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:291
boost::shared_ptr< NodalTriExp > NodalTriExpSharedPtr
Definition: NodalTriExp.h:379
Nektar::MultiRegions::ExpList2D::ExpList2D ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::ExpansionMap expansions,
const bool  DeclareCoeffPhysArrays = true 
)

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

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

Parameters
expansionsA vector containing information about the domain and the spectral/hp element expansion.

Definition at line 258 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::MultiRegions::ExpList::CreateCollections(), Nektar::MultiRegions::e2D, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eNodalTriElec, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::BasisKey::GetBasisType(), Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::MultiRegions::ExpList::m_coeffs, Nektar::MultiRegions::ExpList::m_globalOptParam, Nektar::MultiRegions::ExpList::m_ncoeffs, Nektar::MultiRegions::ExpList::m_npoints, Nektar::MultiRegions::ExpList::m_phys, Nektar::MultiRegions::ExpList::ReadGlobalOptimizationParameters(), SetCoeffPhysOffsets(), and Nektar::MultiRegions::ExpList::SetExpType().

261  :ExpList(pSession)
262  {
263  SetExpType(e2D);
264 
265  int elmtid=0;
271 
273  for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
274  {
276  SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
277 
278  if ((TriangleGeom = boost::dynamic_pointer_cast<SpatialDomains
279  ::TriGeom>(expIt->second->m_geomShPtr)))
280  {
281  LibUtilities::BasisKey TriBa
282  = expIt->second->m_basisKeyVector[0];
283  LibUtilities::BasisKey TriBb
284  = expIt->second->m_basisKeyVector[1];
285 
286  // This is not elegantly implemented needs re-thinking.
287  if (TriBa.GetBasisType() == LibUtilities::eGLL_Lagrange)
288  {
289  LibUtilities::BasisKey newBa(LibUtilities::eOrtho_A,
290  TriBa.GetNumModes(),
291  TriBa.GetPointsKey());
292 
295  ::AllocateSharedPtr(newBa,TriBb,TriNb,
296  TriangleGeom);
297  Ntri->SetElmtId(elmtid++);
298  (*m_exp).push_back(Ntri);
299  }
300  else
301  {
303  ::AllocateSharedPtr(TriBa,TriBb,
304  TriangleGeom);
305  tri->SetElmtId(elmtid++);
306  (*m_exp).push_back(tri);
307  }
308  m_ncoeffs += (TriBa.GetNumModes()*(TriBa.GetNumModes()+1))/2
309  + TriBa.GetNumModes()*(TriBb.GetNumModes()
310  -TriBa.GetNumModes());
311  m_npoints += TriBa.GetNumPoints()*TriBb.GetNumPoints();
312  }
313  else if ((QuadrilateralGeom = boost::dynamic_pointer_cast<
314  SpatialDomains::QuadGeom>(expIt->second->m_geomShPtr)))
315  {
316  LibUtilities::BasisKey QuadBa
317  = expIt->second->m_basisKeyVector[0];
318  LibUtilities::BasisKey QuadBb
319  = expIt->second->m_basisKeyVector[1];
320 
322  ::AllocateSharedPtr(QuadBa,QuadBb,
323  QuadrilateralGeom);
324  quad->SetElmtId(elmtid++);
325  (*m_exp).push_back(quad);
326 
327  m_ncoeffs += QuadBa.GetNumModes()*QuadBb.GetNumModes();
328  m_npoints += QuadBa.GetNumPoints()*QuadBb.GetNumPoints();
329  }
330  else
331  {
332  ASSERTL0(false, "dynamic cast to a proper Geometry2D "
333  "failed");
334  }
335 
336  }
337 
338  // Setup Default optimisation information.
339  int nel = GetExpSize();
342 
343 
344  // set up offset arrays.
346 
347  if (DeclareCoeffPhysArrays)
348  {
349  // Set up m_coeffs, m_phys.
350  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs);
351  m_phys = Array<OneD, NekDouble>(m_npoints);
352  }
353 
356  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
std::map< int, ExpansionShPtr >::const_iterator ExpansionMapConstIter
Definition: MeshGraph.h:176
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
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
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
Principle Orthogonal Functions .
Definition: BasisType.h:46
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:293
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
boost::shared_ptr< GeometryVector > Composite
Definition: MeshGraph.h:114
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:2956
Lagrange for SEM basis .
Definition: BasisType.h:53
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
2D Nodal Electrostatic Points on a Triangle
Definition: PointsType.h:68
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:291
boost::shared_ptr< NodalTriExp > NodalTriExpSharedPtr
Definition: NodalTriExp.h:379
Nektar::MultiRegions::ExpList2D::ExpList2D ( const LibUtilities::SessionReaderSharedPtr pSession,
const LibUtilities::BasisKey TriBa,
const LibUtilities::BasisKey TriBb,
const LibUtilities::BasisKey QuadBa,
const LibUtilities::BasisKey QuadBb,
const SpatialDomains::MeshGraphSharedPtr graph2D,
const LibUtilities::PointsType  TriNb = LibUtilities::SIZE_PointsType 
)

Sets up a list of local expansions based on an input mesh and separately defined basiskeys.

Given a mesh graph2D, containing information about the domain and the a list of basiskeys, this constructor fills the list of local expansions {m_exp} with the proper expansions, calculates the total number of quadrature points $\boldsymbol{x}_i$ and local expansion coefficients $\hat{u}^e_n$ and allocates memory for the arrays m_coeffs and m_phys.

Parameters
TriBaA BasisKey, containing the definition of the basis in the first coordinate direction for triangular elements
TriBbA BasisKey, containing the definition of the basis in the second coordinate direction for triangular elements
QuadBaA BasisKey, containing the definition of the basis in the first coordinate direction for quadrilateral elements
QuadBbA BasisKey, containing the definition of the basis in the second coordinate direction for quadrilateral elements
graph2DA mesh, containing information about the domain and the spectral/hp element expansion.
TriNbThe PointsType of possible nodal points

Definition at line 384 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::MultiRegions::ExpList::CreateCollections(), Nektar::MultiRegions::e2D, Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::MultiRegions::ExpList::m_coeffs, Nektar::MultiRegions::ExpList::m_globalOptParam, Nektar::MultiRegions::ExpList::m_ncoeffs, Nektar::MultiRegions::ExpList::m_npoints, Nektar::MultiRegions::ExpList::m_phys, Nektar::MultiRegions::ExpList::m_physState, Nektar::MultiRegions::ExpList::ReadGlobalOptimizationParameters(), SetCoeffPhysOffsets(), Nektar::MultiRegions::ExpList::SetExpType(), and Nektar::LibUtilities::SIZE_PointsType.

391  :ExpList(pSession, graph2D)
392  {
393  SetExpType(e2D);
394 
395  int elmtid=0;
400 
401  const SpatialDomains::ExpansionMap &expansions =
402  graph2D->GetExpansions();
403  m_ncoeffs = 0;
404  m_npoints = 0;
405 
406  m_physState = false;
407 
408  SpatialDomains::ExpansionMap::const_iterator expIt;
409  for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
410  {
412  SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
413 
414  if ((TriangleGeom = boost::dynamic_pointer_cast<SpatialDomains::
415  TriGeom>(expIt->second->m_geomShPtr)))
416  {
417  if (TriNb < LibUtilities::SIZE_PointsType)
418  {
420  AllocateSharedPtr(TriBa, TriBb, TriNb,
421  TriangleGeom);
422  Ntri->SetElmtId(elmtid++);
423  (*m_exp).push_back(Ntri);
424  }
425  else
426  {
428  AllocateSharedPtr(TriBa, TriBb, TriangleGeom);
429  tri->SetElmtId(elmtid++);
430  (*m_exp).push_back(tri);
431  }
432 
433  m_ncoeffs += (TriBa.GetNumModes()*(TriBa.GetNumModes()+1))/2
434  + TriBa.GetNumModes() * (TriBb.GetNumModes() -
435  TriBa.GetNumModes());
436  m_npoints += TriBa.GetNumPoints()*TriBb.GetNumPoints();
437  }
438  else if ((QuadrilateralGeom = boost::dynamic_pointer_cast<
439  SpatialDomains::QuadGeom>(expIt->second->m_geomShPtr)))
440  {
442  AllocateSharedPtr(QuadBa, QuadBb, QuadrilateralGeom);
443  quad->SetElmtId(elmtid++);
444  (*m_exp).push_back(quad);
445 
446  m_ncoeffs += QuadBa.GetNumModes()*QuadBb.GetNumModes();
447  m_npoints += QuadBa.GetNumPoints()*QuadBb.GetNumPoints();
448  }
449  else
450  {
451  ASSERTL0(false,
452  "dynamic cast to a proper Geometry2D failed");
453  }
454 
455  }
456 
457  // Setup Default optimisation information.
458  int nel = GetExpSize();
461 
462  // Set up m_coeffs, m_phys and offset arrays.
464  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs);
465  m_phys = Array<OneD, NekDouble>(m_npoints);
466 
469  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
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
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
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
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:293
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
boost::shared_ptr< GeometryVector > Composite
Definition: MeshGraph.h:114
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:2956
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
std::map< int, ExpansionShPtr > ExpansionMap
Definition: MeshGraph.h:174
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:291
boost::shared_ptr< NodalTriExp > NodalTriExpSharedPtr
Definition: NodalTriExp.h:379
Nektar::MultiRegions::ExpList2D::ExpList2D ( const LibUtilities::SessionReaderSharedPtr pSession,
const Array< OneD, const ExpListSharedPtr > &  bndConstraint,
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > &  bndCond,
const LocalRegions::ExpansionVector locexp,
const SpatialDomains::MeshGraphSharedPtr graph3D,
const PeriodicMap periodicFaces,
const bool  DeclareCoeffPhysArrays = true,
const std::string  variable = "DefaultVar" 
)

Specialized constructor for trace expansions. Store expansions for the trace space used in DisContField3D

Parameters
bndConstraintArray of ExpList2D objects each containing a 2D spectral/hp element expansion on a single boundary region.
bndCondArray of BoundaryCondition objects which contain information about the boundary conditions on the different boundary regions.
locexpComplete domain expansion list.
graph3D3D mesh corresponding to the expansion list.
periodicFacesList of periodic faces.
DeclareCoeffPhysArraysIf true, set up m_coeffs, m_phys arrays

Definition at line 487 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::MultiRegions::ExpList::CreateCollections(), Nektar::MultiRegions::e2D, Nektar::SpatialDomains::eDirichlet, Nektar::LibUtilities::BasisKey::GetBasisType(), Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::LocalRegions::Expansion2D::GetGeom2D(), Nektar::LocalRegions::Expansion3D::GetGeom3D(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsType(), Nektar::iterator, Nektar::MultiRegions::ExpList::m_coeffs, Nektar::MultiRegions::ExpList::m_globalOptParam, Nektar::MultiRegions::ExpList::m_ncoeffs, Nektar::MultiRegions::ExpList::m_npoints, Nektar::MultiRegions::ExpList::m_phys, Nektar::LibUtilities::ReduceSum, SetCoeffPhysOffsets(), Nektar::MultiRegions::ExpList::SetExpType(), and Vmath::Vsum().

495  :
496  ExpList(pSession, graph3D)
497  {
498  SetExpType(e2D);
499 
500  int i, j, id, elmtid=0;
501  set<int> facesDone;
502 
506  LocalRegions::QuadExpSharedPtr FaceQuadExp;
510 
511  // First loop over boundary conditions to renumber
512  // Dirichlet boundaries
513  for (i = 0; i < bndCond.num_elements(); ++i)
514  {
515  if (bndCond[i]->GetBoundaryConditionType()
517  {
518  for (j = 0; j < bndConstraint[i]->GetExpSize(); ++j)
519  {
520  LibUtilities::BasisKey bkey0 = bndConstraint[i]
521  ->GetExp(j)->GetBasis(0)->GetBasisKey();
522  LibUtilities::BasisKey bkey1 = bndConstraint[i]
523  ->GetExp(j)->GetBasis(1)->GetBasisKey();
524  exp2D = bndConstraint[i]->GetExp(j)
525  ->as<LocalRegions::Expansion2D>();
526  FaceGeom = exp2D->GetGeom2D();
527 
528  //if face is a quad
529  if((FaceQuadGeom = boost::dynamic_pointer_cast<
530  SpatialDomains::QuadGeom>(FaceGeom)))
531  {
533  ::AllocateSharedPtr(bkey0, bkey1, FaceQuadGeom);
534  facesDone.insert(FaceQuadGeom->GetFid());
535  FaceQuadExp->SetElmtId(elmtid++);
536  (*m_exp).push_back(FaceQuadExp);
537  }
538  //if face is a triangle
539  else if((FaceTriGeom = boost::dynamic_pointer_cast<
540  SpatialDomains::TriGeom>(FaceGeom)))
541  {
543  ::AllocateSharedPtr(bkey0, bkey1, FaceTriGeom);
544  facesDone.insert(FaceTriGeom->GetFid());
545  FaceTriExp->SetElmtId(elmtid++);
546  (*m_exp).push_back(FaceTriExp);
547  }
548  else
549  {
550  ASSERTL0(false,"dynamic cast to a proper face geometry failed");
551  }
552  }
553  }
554  }
555 
557  pair<LibUtilities::BasisKey,
558  LibUtilities::BasisKey> > > faceOrders;
560  pair<LibUtilities::BasisKey,
561  LibUtilities::BasisKey> > >::iterator it;
562 
563  for(i = 0; i < locexp.size(); ++i)
564  {
565  exp3D = locexp[i]->as<LocalRegions::Expansion3D>();
566  for (j = 0; j < exp3D->GetNfaces(); ++j)
567  {
568  FaceGeom = exp3D->GetGeom3D()->GetFace(j);
569  id = FaceGeom->GetFid();
570 
571  if(facesDone.count(id) != 0)
572  {
573  continue;
574  }
575  it = faceOrders.find(id);
576 
577  if (it == faceOrders.end())
578  {
579  LibUtilities::BasisKey face_dir0
580  = locexp[i]->DetFaceBasisKey(j,0);
581  LibUtilities::BasisKey face_dir1
582  = locexp[i]->DetFaceBasisKey(j,1);
583 
584  faceOrders.insert(
585  std::make_pair(
586  id, std::make_pair(
587  FaceGeom,
588  std::make_pair(face_dir0, face_dir1))));
589  }
590  else // variable modes/points
591  {
592  LibUtilities::BasisKey face0 =
593  locexp[i]->DetFaceBasisKey(j,0);
594  LibUtilities::BasisKey face1 =
595  locexp[i]->DetFaceBasisKey(j,1);
596  LibUtilities::BasisKey existing0 =
597  it->second.second.first;
598  LibUtilities::BasisKey existing1 =
599  it->second.second.second;
600 
601  int np11 = face0 .GetNumPoints();
602  int np12 = face1 .GetNumPoints();
603  int np21 = existing0.GetNumPoints();
604  int np22 = existing1.GetNumPoints();
605  int nm11 = face0 .GetNumModes ();
606  int nm12 = face1 .GetNumModes ();
607  int nm21 = existing0.GetNumModes ();
608  int nm22 = existing1.GetNumModes ();
609 
610  if ((np22 >= np12 || np21 >= np11) &&
611  (nm22 >= nm12 || nm21 >= nm11))
612  {
613  continue;
614  }
615  else if((np22 < np12 || np21 < np11) &&
616  (nm22 < nm12 || nm21 < nm11))
617  {
618  it->second.second.first = face0;
619  it->second.second.second = face1;
620  }
621  else
622  {
623  ASSERTL0(false,
624  "inappropriate number of points/modes (max "
625  "num of points is not set with max order)");
626  }
627  }
628  }
629  }
630 
631  LibUtilities::CommSharedPtr vComm = pSession->GetComm();
632  int nproc = vComm->GetSize(); // number of processors
633  int facepr = vComm->GetRank(); // ID processor
634 
635  if (nproc > 1)
636  {
637  int fCnt = 0;
638 
639  // Count the number of faces on each partition
640  for(i = 0; i < locexp.size(); ++i)
641  {
642  fCnt += locexp[i]->GetNfaces();
643  }
644 
645  // Set up the offset and the array that will contain the list of
646  // face IDs, then reduce this across processors.
647  Array<OneD, int> faceCnt(nproc,0);
648  faceCnt[facepr] = fCnt;
649  vComm->AllReduce(faceCnt, LibUtilities::ReduceSum);
650 
651  int totFaceCnt = Vmath::Vsum(nproc, faceCnt, 1);
652  Array<OneD, int> fTotOffsets(nproc,0);
653 
654  for (i = 1; i < nproc; ++i)
655  {
656  fTotOffsets[i] = fTotOffsets[i-1] + faceCnt[i-1];
657  }
658 
659  // Local list of the edges per element
660 
661  Array<OneD, int> FacesTotID (totFaceCnt, 0);
662  Array<OneD, int> FacesTotNm0 (totFaceCnt, 0);
663  Array<OneD, int> FacesTotNm1 (totFaceCnt, 0);
664  Array<OneD, int> FacesTotPnts0(totFaceCnt, 0);
665  Array<OneD, int> FacesTotPnts1(totFaceCnt, 0);
666 
667  int cntr = fTotOffsets[facepr];
668 
669  for(i = 0; i < locexp.size(); ++i)
670  {
671  exp3D = locexp[i]->as<LocalRegions::Expansion3D>();
672 
673  int nfaces = locexp[i]->GetNfaces();
674 
675  for(j = 0; j < nfaces; ++j, ++cntr)
676  {
677  LibUtilities::BasisKey face_dir0
678  = locexp[i]->DetFaceBasisKey(j,0);
679  LibUtilities::BasisKey face_dir1
680  = locexp[i]->DetFaceBasisKey(j,1);
681 
682  FacesTotID[cntr] = exp3D->GetGeom3D()->GetFid(j);
683  FacesTotNm0[cntr] = face_dir0.GetNumModes ();
684  FacesTotNm1[cntr] = face_dir1.GetNumModes ();
685  FacesTotPnts0[cntr] = face_dir0.GetNumPoints();
686  FacesTotPnts1[cntr] = face_dir1.GetNumPoints();
687  }
688  }
689 
690  vComm->AllReduce(FacesTotID, LibUtilities::ReduceSum);
691  vComm->AllReduce(FacesTotNm0, LibUtilities::ReduceSum);
692  vComm->AllReduce(FacesTotNm1, LibUtilities::ReduceSum);
693  vComm->AllReduce(FacesTotPnts0, LibUtilities::ReduceSum);
694  vComm->AllReduce(FacesTotPnts1, LibUtilities::ReduceSum);
695 
696  for (i = 0; i < totFaceCnt; ++i)
697  {
698  it = faceOrders.find(FacesTotID[i]);
699 
700  if (it == faceOrders.end())
701  {
702  continue;
703  }
704 
705  LibUtilities::BasisKey existing0 =
706  it->second.second.first;
707  LibUtilities::BasisKey existing1 =
708  it->second.second.second;
709  LibUtilities::BasisKey face0(
710  existing0.GetBasisType(), FacesTotNm0[i],
711  LibUtilities::PointsKey(FacesTotPnts0[i],
712  existing0.GetPointsType()));
713  LibUtilities::BasisKey face1(
714  existing1.GetBasisType(), FacesTotNm1[i],
715  LibUtilities::PointsKey(FacesTotPnts1[i],
716  existing1.GetPointsType()));
717 
718  int np11 = face0 .GetNumPoints();
719  int np12 = face1 .GetNumPoints();
720  int np21 = existing0.GetNumPoints();
721  int np22 = existing1.GetNumPoints();
722  int nm11 = face0 .GetNumModes ();
723  int nm12 = face1 .GetNumModes ();
724  int nm21 = existing0.GetNumModes ();
725  int nm22 = existing1.GetNumModes ();
726 
727  if ((np22 >= np12 || np21 >= np11) &&
728  (nm22 >= nm12 || nm21 >= nm11))
729  {
730  continue;
731  }
732  else if((np22 < np12 || np21 < np11) &&
733  (nm22 < nm12 || nm21 < nm11))
734  {
735  it->second.second.first = face0;
736  it->second.second.second = face1;
737  }
738  else
739  {
740  ASSERTL0(false,
741  "inappropriate number of points/modes (max "
742  "num of points is not set with max order)");
743  }
744  }
745  }
746 
747  for (it = faceOrders.begin(); it != faceOrders.end(); ++it)
748  {
749  FaceGeom = it->second.first;
750 
751  if ((FaceQuadGeom = boost::dynamic_pointer_cast<
752  SpatialDomains::QuadGeom>(FaceGeom)))
753  {
755  ::AllocateSharedPtr(it->second.second.first,
756  it->second.second.second,
757  FaceQuadGeom);
758  FaceQuadExp->SetElmtId(elmtid++);
759  (*m_exp).push_back(FaceQuadExp);
760  }
761  else if ((FaceTriGeom = boost::dynamic_pointer_cast<
762  SpatialDomains::TriGeom>(FaceGeom)))
763  {
765  ::AllocateSharedPtr(it->second.second.first,
766  it->second.second.second,
767  FaceTriGeom);
768  FaceTriExp->SetElmtId(elmtid++);
769  (*m_exp).push_back(FaceTriExp);
770  }
771  }
772 
773  // Setup Default optimisation information.
774  int nel = GetExpSize();
775 
778 
779  // Set up offset information and array sizes
781 
782  // Set up m_coeffs, m_phys.
783  if(DeclareCoeffPhysArrays)
784  {
785  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs);
786  m_phys = Array<OneD, NekDouble>(m_npoints);
787  }
788 
790  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
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
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
boost::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:48
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:293
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry2D.h:59
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:2956
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition: Vmath.cpp:723
boost::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:49
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:291
Nektar::MultiRegions::ExpList2D::ExpList2D ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::CompositeMap domain,
const SpatialDomains::MeshGraphSharedPtr graph3D,
const std::string  variable = "DefaultVar" 
)

Specialised constructor for Neumann boundary conditions in DisContField3D and ContField3D.

Fills the list of local expansions with the segments from the 3D mesh specified by domain. This CompositeMap contains a list of Composites which define the Neumann boundary.

See also
ExpList2D::ExpList2D(SpatialDomains::MeshGraph2D&) for details.
Parameters
domainA domain, comprising of one or more composite regions.
graph3DA mesh, containing information about the domain and the spectral/hp element expansions.

Definition at line 803 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::MultiRegions::ExpList::CreateCollections(), Nektar::MultiRegions::e2D, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eNodalTriElec, Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::MultiRegions::ExpList::m_coeffs, Nektar::MultiRegions::ExpList::m_globalOptParam, Nektar::MultiRegions::ExpList::m_ncoeffs, Nektar::MultiRegions::ExpList::m_npoints, Nektar::MultiRegions::ExpList::m_phys, Nektar::MultiRegions::ExpList::ReadGlobalOptimizationParameters(), SetCoeffPhysOffsets(), and Nektar::MultiRegions::ExpList::SetExpType().

807  :ExpList(pSession, graph3D)
808  {
809 
810  SetExpType(e2D);
811 
812  ASSERTL0(boost::dynamic_pointer_cast<
813  SpatialDomains::MeshGraph3D>(graph3D),
814  "Expected a MeshGraph3D object.");
815 
816  int j, elmtid=0;
817  int nel = 0;
818 
821  SpatialDomains::QuadGeomSharedPtr QuadrilateralGeom;
822 
827 
828  SpatialDomains::CompositeMap::const_iterator compIt;
829  for (compIt = domain.begin(); compIt != domain.end(); ++compIt)
830  {
831  nel += (compIt->second)->size();
832  }
833 
834  for (compIt = domain.begin(); compIt != domain.end(); ++compIt)
835  {
836  for (j = 0; j < compIt->second->size(); ++j)
837  {
838  if ((TriangleGeom = boost::dynamic_pointer_cast<
839  SpatialDomains::TriGeom>((*compIt->second)[j])))
840  {
841  LibUtilities::BasisKey TriBa
842  = boost::dynamic_pointer_cast<
843  SpatialDomains::MeshGraph3D>(graph3D)->
844  GetFaceBasisKey(TriangleGeom, 0, variable);
845  LibUtilities::BasisKey TriBb
846  = boost::dynamic_pointer_cast<
847  SpatialDomains::MeshGraph3D>(graph3D)->
848  GetFaceBasisKey(TriangleGeom,1,variable);
849 
850  if (graph3D->GetExpansions().begin()->second->
851  m_basisKeyVector[0].GetBasisType() ==
853  {
854  ASSERTL0(false,"This method needs sorting");
856 
858  ::AllocateSharedPtr(TriBa,TriBb,TriNb,
859  TriangleGeom);
860  Ntri->SetElmtId(elmtid++);
861  (*m_exp).push_back(Ntri);
862  }
863  else
864  {
866  ::AllocateSharedPtr(TriBa, TriBb,
867  TriangleGeom);
868  tri->SetElmtId(elmtid++);
869  (*m_exp).push_back(tri);
870  }
871 
872  m_ncoeffs
873  += (TriBa.GetNumModes()*(TriBa.GetNumModes()+1))/2
874  + TriBa.GetNumModes()*(TriBb.GetNumModes()
875  -TriBa.GetNumModes());
876  m_npoints += TriBa.GetNumPoints()*TriBb.GetNumPoints();
877  }
878  else if ((QuadrilateralGeom = boost::dynamic_pointer_cast<
879  SpatialDomains::QuadGeom>((*compIt->second)[j])))
880  {
881  LibUtilities::BasisKey QuadBa
882  = boost::dynamic_pointer_cast<
883  SpatialDomains::MeshGraph3D>(graph3D)->
884  GetFaceBasisKey(QuadrilateralGeom, 0,
885  variable);
886  LibUtilities::BasisKey QuadBb
887  = boost::dynamic_pointer_cast<
888  SpatialDomains::MeshGraph3D>(graph3D)->
889  GetFaceBasisKey(QuadrilateralGeom, 1,
890  variable);
891 
893  ::AllocateSharedPtr(QuadBa, QuadBb,
894  QuadrilateralGeom);
895  quad->SetElmtId(elmtid++);
896  (*m_exp).push_back(quad);
897 
898  m_ncoeffs += QuadBa.GetNumModes()*QuadBb.GetNumModes();
899  m_npoints += QuadBa.GetNumPoints()
900  * QuadBb.GetNumPoints();
901  }
902  else
903  {
904  ASSERTL0(false,
905  "dynamic cast to a proper Geometry2D failed");
906  }
907  }
908 
909  }
910 
911  // Setup Default optimisation information.
912  nel = GetExpSize();
915 
916  // Set up m_coeffs, m_phys and offset arrays.
918  m_coeffs = Array<OneD, NekDouble>(m_ncoeffs);
919  m_phys = Array<OneD, NekDouble>(m_npoints);
920 
923  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
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
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:293
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
boost::shared_ptr< GeometryVector > Composite
Definition: MeshGraph.h:114
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
Definition: ExpList.cpp:2956
Lagrange for SEM basis .
Definition: BasisType.h:53
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
Definition: ExpList.cpp:253
2D Nodal Electrostatic Points on a Triangle
Definition: PointsType.h:68
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:291
boost::shared_ptr< NodalTriExp > NodalTriExpSharedPtr
Definition: NodalTriExp.h:379
Nektar::MultiRegions::ExpList2D::~ExpList2D ( )
virtual

Destructor.

Definition at line 79 of file ExpList2D.cpp.

80  {
81  }

Member Function Documentation

void Nektar::MultiRegions::ExpList2D::SetCoeffPhysOffsets ( void  )
private

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

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

Definition at line 1121 of file ExpList2D.cpp.

References Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTriangle, Nektar::MultiRegions::ExpList::m_coeff_offset, Nektar::MultiRegions::ExpList::m_exp, Nektar::MultiRegions::ExpList::m_ncoeffs, Nektar::MultiRegions::ExpList::m_npoints, Nektar::MultiRegions::ExpList::m_offset_elmt_id, and Nektar::MultiRegions::ExpList::m_phys_offset.

Referenced by ExpList2D().

1122  {
1123  int i;
1124 
1125  // Set up offset information and array sizes
1126  m_coeff_offset = Array<OneD,int>(m_exp->size());
1127  m_phys_offset = Array<OneD,int>(m_exp->size());
1128  m_offset_elmt_id = Array<OneD,int>(m_exp->size());
1129 
1130  m_ncoeffs = m_npoints = 0;
1131 
1132  int cnt = 0;
1133  for(i = 0; i < m_exp->size(); ++i)
1134  {
1135  if((*m_exp)[i]->DetShapeType() == LibUtilities::eTriangle)
1136  {
1138  m_phys_offset [i] = m_npoints;
1139  m_offset_elmt_id[cnt++] = i;
1140  m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
1141  m_npoints += (*m_exp)[i]->GetTotPoints();
1142  }
1143  }
1144 
1145  for(i = 0; i < m_exp->size(); ++i)
1146  {
1147  if((*m_exp)[i]->DetShapeType() == LibUtilities::eQuadrilateral)
1148  {
1150  m_phys_offset [i] = m_npoints;
1151  m_offset_elmt_id[cnt++] = i;
1152  m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
1153  m_npoints += (*m_exp)[i]->GetTotPoints();
1154  }
1155  }
1156  }
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
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
void Nektar::MultiRegions::ExpList2D::v_GetNormals ( Array< OneD, Array< OneD, NekDouble > > &  normals)
protectedvirtual

For each local element, copy the normals stored in the element list into the array normals.

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

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1039 of file ExpList2D.cpp.

References Nektar::MultiRegions::AlignFace(), ASSERTL1, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::MultiRegions::ExpList::GetCoordim(), Nektar::LocalRegions::Expansion2D::GetLeftAdjacentElementExp(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::LibUtilities::Interp2D(), Nektar::MultiRegions::ExpList::m_exp, and Nektar::MultiRegions::ExpList::m_phys_offset.

1041  {
1042  Array<OneD, NekDouble> tmp;
1043  int i, j;
1044  const int coordim = GetCoordim(0);
1045 
1046  ASSERTL1(normals.num_elements() >= coordim,
1047  "Output vector does not have sufficient dimensions to "
1048  "match coordim");
1049 
1050  // Process each expansion.
1051  for (i = 0; i < m_exp->size(); ++i)
1052  {
1053  LocalRegions::Expansion2DSharedPtr traceExp = (*m_exp)[i]->as<
1054  LocalRegions::Expansion2D>();
1056  traceExp->GetLeftAdjacentElementExp();
1057 
1058  // Get the number of points and normals for this expansion.
1059  int faceNum = traceExp->GetLeftAdjacentElementFace();
1060  int offset = m_phys_offset[i];
1061 
1062  const Array<OneD, const Array<OneD, NekDouble> > &locNormals
1063  = exp3D->GetFaceNormal(faceNum);
1064 
1065  // Project normals from 3D element onto the same orientation as
1066  // the trace expansion.
1067  StdRegions::Orientation orient = exp3D->GetForient(faceNum);
1068 
1069 
1070  int fromid0,fromid1;
1071 
1073  {
1074  fromid0 = 0;
1075  fromid1 = 1;
1076  }
1077  else
1078  {
1079  fromid0 = 1;
1080  fromid1 = 0;
1081  }
1082 
1083  LibUtilities::BasisKey faceBasis0
1084  = exp3D->DetFaceBasisKey(faceNum, fromid0);
1085  LibUtilities::BasisKey faceBasis1
1086  = exp3D->DetFaceBasisKey(faceNum, fromid1);
1087  LibUtilities::BasisKey traceBasis0
1088  = traceExp->GetBasis(0)->GetBasisKey();
1089  LibUtilities::BasisKey traceBasis1
1090  = traceExp->GetBasis(1)->GetBasisKey();
1091 
1092  const int faceNq0 = faceBasis0.GetNumPoints();
1093  const int faceNq1 = faceBasis1.GetNumPoints();
1094 
1095  for (j = 0; j < coordim; ++j)
1096  {
1097  Array<OneD, NekDouble> traceNormals(faceNq0 * faceNq1);
1098  AlignFace(orient, faceNq0, faceNq1,
1099  locNormals[j], traceNormals);
1101  faceBasis0.GetPointsKey(),
1102  faceBasis1.GetPointsKey(),
1103  traceNormals,
1104  traceBasis0.GetPointsKey(),
1105  traceBasis1.GetPointsKey(),
1106  tmp = normals[j]+offset);
1107  }
1108  }
1109  }
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis...
Definition: Interp.cpp:116
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
boost::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:48
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:1797
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
boost::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:49
void AlignFace(const StdRegions::Orientation orient, const int nquad1, const int nquad2, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Helper function to re-align face to a given orientation.
Definition: ExpList2D.cpp:967
void Nektar::MultiRegions::ExpList2D::v_PhysGalerkinProjection1DScaled ( const NekDouble  scale,
const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
privatevirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1299 of file ExpList2D.cpp.

References Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::MultiRegions::ExpList::m_exp, and Nektar::LibUtilities::PhysGalerkinProject2D().

1303  {
1304  int cnt,cnt1;
1305 
1306  cnt = cnt1 = 0;
1307  for(int i = 0; i < GetExpSize(); ++i)
1308  {
1309  // get new points key
1310  int pt0 = (*m_exp)[i]->GetNumPoints(0);
1311  int pt1 = (*m_exp)[i]->GetNumPoints(1);
1312  int npt0 = (int) pt0*scale;
1313  int npt1 = (int) pt1*scale;
1314 
1315  LibUtilities::PointsKey newPointsKey0(npt0,
1316  (*m_exp)[i]->GetPointsType(0));
1317  LibUtilities::PointsKey newPointsKey1(npt1,
1318  (*m_exp)[i]->GetPointsType(1));
1319 
1320  // Project points;
1322  newPointsKey0,
1323  newPointsKey1,
1324  &inarray[cnt],
1325  (*m_exp)[i]->GetBasis(0)->GetPointsKey(),
1326  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
1327  &outarray[cnt1]);
1328 
1329  cnt += npt0*npt1;
1330  cnt1 += pt0*pt1;
1331  }
1332 
1333  }
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
void PhysGalerkinProject2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
void Nektar::MultiRegions::ExpList2D::v_PhysInterp1DScaled ( const NekDouble  scale,
const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
privatevirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1267 of file ExpList2D.cpp.

References Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::LibUtilities::Interp2D(), and Nektar::MultiRegions::ExpList::m_exp.

1271  {
1272  int cnt,cnt1;
1273 
1274  cnt = cnt1 = 0;
1275  for(int i = 0; i < GetExpSize(); ++i)
1276  {
1277  // get new points key
1278  int pt0 = (*m_exp)[i]->GetNumPoints(0);
1279  int pt1 = (*m_exp)[i]->GetNumPoints(1);
1280  int npt0 = (int) pt0*scale;
1281  int npt1 = (int) pt1*scale;
1282 
1283  LibUtilities::PointsKey newPointsKey0(npt0,
1284  (*m_exp)[i]->GetPointsType(0));
1285  LibUtilities::PointsKey newPointsKey1(npt1,
1286  (*m_exp)[i]->GetPointsType(1));
1287 
1288  // Interpolate points;
1289  LibUtilities::Interp2D((*m_exp)[i]->GetBasis(0)->GetPointsKey(),
1290  (*m_exp)[i]->GetBasis(1)->GetPointsKey(),
1291  &inarray[cnt],newPointsKey0,
1292  newPointsKey1,&outarray[cnt1]);
1293 
1294  cnt += pt0*pt1;
1295  cnt1 += npt0*npt1;
1296  }
1297  }
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis...
Definition: Interp.cpp:116
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
void Nektar::MultiRegions::ExpList2D::v_ReadGlobalOptimizationParameters ( )
privatevirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1175 of file ExpList2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::eTriangle, Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::MultiRegions::ExpList::m_exp, Nektar::MultiRegions::ExpList::m_globalOptParam, and Nektar::MultiRegions::ExpList::m_session.

1176  {
1177  Array<OneD, int> NumShape(2,0);
1178 
1179  for(int i = 0; i < GetExpSize(); ++i)
1180  {
1181  if((*m_exp)[i]->DetShapeType() == LibUtilities::eTriangle)
1182  {
1183  NumShape[0] += 1;
1184  }
1185  else // Quadrilateral element
1186  {
1187  NumShape[1] += 1;
1188  }
1189  }
1190 
1192  ::AllocateSharedPtr(m_session,2,NumShape);
1193  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
void Nektar::MultiRegions::ExpList2D::v_SetUpPhysNormals ( )
privatevirtual

Set up the normals on each expansion.

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1162 of file ExpList2D.cpp.

References Nektar::MultiRegions::ExpList::m_exp.

1163  {
1164  int i, j;
1165  for (i = 0; i < m_exp->size(); ++i)
1166  {
1167  for (j = 0; j < (*m_exp)[i]->GetNedges(); ++j)
1168  {
1169  (*m_exp)[i]->ComputeEdgeNormal(j);
1170  }
1171  }
1172  }
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
void Nektar::MultiRegions::ExpList2D::v_Upwind ( const Array< OneD, const NekDouble > &  Vn,
const Array< OneD, const NekDouble > &  Fwd,
const Array< OneD, const NekDouble > &  Bwd,
Array< OneD, NekDouble > &  Upwind 
)
protectedvirtual

Upwind the Fwd and Bwd states based on the one- dimensional normal velocity field given by Vn.

One-dimensional upwind.

Parameters
VnVelocity field.
FwdLeft state.
BwdRight state.
UpwindOutput vector.

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 932 of file ExpList2D.cpp.

References Nektar::MultiRegions::ExpList::m_exp, and Nektar::MultiRegions::ExpList::m_phys_offset.

937  {
938  int i,j,f_npoints,offset;
939 
940  // Process each expansion.
941  for(i = 0; i < m_exp->size(); ++i)
942  {
943  // Get the number of points and the data offset.
944  f_npoints = (*m_exp)[i]->GetNumPoints(0)*
945  (*m_exp)[i]->GetNumPoints(1);
946  offset = m_phys_offset[i];
947 
948  // Process each point in the expansion.
949  for(j = 0; j < f_npoints; ++j)
950  {
951  // Upwind based on one-dimensional velocity.
952  if(Vn[offset + j] > 0.0)
953  {
954  Upwind[offset + j] = Fwd[offset + j];
955  }
956  else
957  {
958  Upwind[offset + j] = Bwd[offset + j];
959  }
960  }
961  }
962  }
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
void Nektar::MultiRegions::ExpList2D::v_WriteVtkPieceHeader ( std::ostream &  outfile,
int  expansion,
int  istrip 
)
privatevirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1195 of file ExpList2D.cpp.

1199  {
1200  int i,j;
1201  int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
1202  int nquad1 = (*m_exp)[expansion]->GetNumPoints(1);
1203  int ntot = nquad0*nquad1;
1204  int ntotminus = (nquad0-1)*(nquad1-1);
1205 
1206  Array<OneD,NekDouble> coords[3];
1207  coords[0] = Array<OneD,NekDouble>(ntot,0.0);
1208  coords[1] = Array<OneD,NekDouble>(ntot,0.0);
1209  coords[2] = Array<OneD,NekDouble>(ntot,0.0);
1210  (*m_exp)[expansion]->GetCoords(coords[0],coords[1],coords[2]);
1211 
1212  outfile << " <Piece NumberOfPoints=\""
1213  << ntot << "\" NumberOfCells=\""
1214  << ntotminus << "\">" << endl;
1215  outfile << " <Points>" << endl;
1216  outfile << " <DataArray type=\"Float64\" "
1217  << "NumberOfComponents=\"3\" format=\"ascii\">" << endl;
1218  outfile << " ";
1219  for (i = 0; i < ntot; ++i)
1220  {
1221  for (j = 0; j < 3; ++j)
1222  {
1223  outfile << setprecision(8) << scientific
1224  << (float)coords[j][i] << " ";
1225  }
1226  outfile << endl;
1227  }
1228  outfile << endl;
1229  outfile << " </DataArray>" << endl;
1230  outfile << " </Points>" << endl;
1231  outfile << " <Cells>" << endl;
1232  outfile << " <DataArray type=\"Int32\" "
1233  << "Name=\"connectivity\" format=\"ascii\">" << endl;
1234  for (i = 0; i < nquad0-1; ++i)
1235  {
1236  for (j = 0; j < nquad1-1; ++j)
1237  {
1238  outfile << j*nquad0 + i << " "
1239  << j*nquad0 + i + 1 << " "
1240  << (j+1)*nquad0 + i + 1 << " "
1241  << (j+1)*nquad0 + i << endl;
1242  }
1243  }
1244  outfile << endl;
1245  outfile << " </DataArray>" << endl;
1246  outfile << " <DataArray type=\"Int32\" "
1247  << "Name=\"offsets\" format=\"ascii\">" << endl;
1248  for (i = 0; i < ntotminus; ++i)
1249  {
1250  outfile << i*4+4 << " ";
1251  }
1252  outfile << endl;
1253  outfile << " </DataArray>" << endl;
1254  outfile << " <DataArray type=\"UInt8\" "
1255  << "Name=\"types\" format=\"ascii\">" << endl;
1256  for (i = 0; i < ntotminus; ++i)
1257  {
1258  outfile << "9 ";
1259  }
1260  outfile << endl;
1261  outfile << " </DataArray>" << endl;
1262  outfile << " </Cells>" << endl;
1263  outfile << " <PointData>" << endl;
1264  }