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

This class is the abstraction of a global discontinuous two- dimensional spectral/hp element expansion which approximates the solution of a set of partial differential equations. More...

#include <DisContField1D.h>

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

Public Member Functions

 DisContField1D ()
 Default constructor. More...
 
 DisContField1D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph1D, const std::string &variable, const bool SetUpJustDG=true)
 Constructs a 1D discontinuous field based on a mesh and boundary conditions. More...
 
 DisContField1D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::CompositeMap &domain, const SpatialDomains::BoundaryConditions &Allbcs, const std::string &variable, bool SetToOneSpaceDimensions=false)
 Constructor for a DisContField1D from a List of subdomains New Constructor for arterial network. More...
 
 DisContField1D (const DisContField1D &In)
 Constructs a 1D discontinuous field based on an existing field. More...
 
 DisContField1D (const ExpList1D &In)
 Constructs a 1D discontinuous field based on an existing field. (needed in order to use ContField( const ExpList1D &In) constructor. More...
 
virtual ~DisContField1D ()
 Destructor. More...
 
GlobalLinSysSharedPtr GetGlobalBndLinSys (const GlobalLinSysKey &mkey)
 For a given key, returns the associated global linear system. More...
 
std::vector< bool > & GetNegatedFluxNormal (void)
 
- Public Member Functions inherited from Nektar::MultiRegions::ExpList1D
 ExpList1D ()
 The default constructor. More...
 
 ExpList1D (const ExpList1D &In, const bool DeclareCoeffPhysArrays=true)
 The copy constructor. More...
 
 ExpList1D (const ExpList1D &In, const std::vector< unsigned int > &eIDs, const bool DeclareCoeffPhysArrays=true)
 Constructor copying only elements defined in eIds. More...
 
 ExpList1D (const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::BasisKey &Ba, const SpatialDomains::MeshGraphSharedPtr &graph1D)
 Construct an ExpList1D from a given graph. More...
 
 ExpList1D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph1D, const bool DeclareCoeffPhysArrays=true)
 This constructor sets up a list of local expansions based on an input graph1D. More...
 
 ExpList1D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::CompositeMap &domain, const bool DeclareCoeffPhysArrays=true, const std::string var="DefaultVar", bool SetToOneSpaceDimension=false)
 This constructor sets up a list of local expansions based on an input compositeMap. More...
 
 ExpList1D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::CompositeMap &domain, const SpatialDomains::MeshGraphSharedPtr &graph2D, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar")
 Specialised constructor for Neumann boundary conditions in DisContField2D and ContField2D. More...
 
 ExpList1D (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::CompositeMap &domain, const SpatialDomains::MeshGraphSharedPtr &graph1D, int i, const bool DeclareCoeffPhysArrays=true)
 
 ExpList1D (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const ExpListSharedPtr > &bndConstraint, const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > &bndCond, const LocalRegions::ExpansionVector &locexp, const SpatialDomains::MeshGraphSharedPtr &graph2D, const PeriodicMap &periodicEdges, const bool DeclareCoeffPhysArrays=true, const std::string variable="DefaultVar")
 Specialised constructor for trace expansions. More...
 
virtual ~ExpList1D ()
 Destructor. More...
 
void PostProcess (LibUtilities::KernelSharedPtr kernel, Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray, NekDouble h, int elmId=0)
 Performs the post-processing on a specified element. More...
 
void PeriodicEval (Array< OneD, NekDouble > &inarray1, Array< OneD, NekDouble > &inarray2, NekDouble h, int nmodes, Array< OneD, NekDouble > &outarray)
 Evaluates the global spectral/hp expansion at some arbitray set of points. More...
 
void ParNormalSign (Array< OneD, NekDouble > &normsign)
 Set up the normals on each expansion. 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 GenerateBoundaryConditionExpansion (const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::BoundaryConditions &bcs, const std::string variable)
 Discretises the boundary conditions. More...
 
void FindPeriodicVertices (const SpatialDomains::BoundaryConditions &bcs, const std::string variable)
 Generate a associative map of periodic vertices in a mesh. More...
 
virtual ExpListSharedPtrv_GetTrace ()
 
virtual AssemblyMapDGSharedPtrv_GetTraceMap (void)
 
virtual void v_AddTraceIntegral (const Array< OneD, const NekDouble > &Fn, 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)
 This method extracts the "forward" and "backward" trace data from the array field and puts the data into output vectors Fwd and Bwd. More...
 
virtual void v_ExtractTracePhys (Array< OneD, NekDouble > &outarray)
 
virtual void v_ExtractTracePhys (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This method extracts the trace (verts in 1D) from the field inarray and puts the values in outarray. More...
 
void SetBoundaryConditionExpansion (const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::BoundaryConditions &bcs, const std::string variable, Array< OneD, MultiRegions::ExpListSharedPtr > &bndCondExpansions, Array< OneD, SpatialDomains::BoundaryConditionShPtr > &bndConditions)
 Populates the list of boundary condition expansions. More...
 
void SetMultiDomainBoundaryConditionExpansion (const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::BoundaryConditions &bcs, const std::string variable, Array< OneD, MultiRegions::ExpListSharedPtr > &bndCondExpansions, Array< OneD, SpatialDomains::BoundaryConditionShPtr > &bndConditions, int subdomain)
 Populates the list of boundary condition expansions in multidomain case. More...
 
void GenerateFieldBnd1D (SpatialDomains::BoundaryConditions &bcs, const std::string variable)
 
virtual std::map< int,
RobinBCInfoSharedPtr
v_GetRobinBCInfo ()
 
virtual const Array< OneD,
const
MultiRegions::ExpListSharedPtr > & 
v_GetBndCondExpansions ()
 
virtual const Array< OneD,
const
SpatialDomains::BoundaryConditionShPtr > & 
v_GetBndConditions ()
 
virtual
MultiRegions::ExpListSharedPtr
v_UpdateBndCondExpansion (int i)
 
virtual Array< OneD,
SpatialDomains::BoundaryConditionShPtr > & 
v_UpdateBndConditions ()
 
virtual void v_GetBoundaryToElmtMap (Array< OneD, int > &ElmtID, Array< OneD, int > &VertID)
 
virtual void v_GetBndElmtExpansion (int i, boost::shared_ptr< ExpList > &result)
 
virtual void v_Reset ()
 Reset this field, so that geometry information can be updated. More...
 
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)
 Evaluate all boundary conditions at a given time.. More...
 
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)
 Solve the Helmholtz equation. More...
 
- Protected Member Functions inherited from Nektar::MultiRegions::ExpList1D
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)
 Upwind the Fwd and Bwd states based on the velocity field given by Vec. More...
 
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)
 Populate normals with the normals of all expansions. 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 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_AddFwdBwdTraceIntegral (const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
 
virtual const std::vector< bool > & v_GetLeftAdjacentFaces (void) const
 
virtual void v_MultiplyByInvMassMatrix (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
 
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_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_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_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)
 

Protected Attributes

int m_numDirBndCondExpansions
 The number of boundary segments on which Dirichlet boundary conditions are imposed. More...
 
Array< OneD,
MultiRegions::ExpListSharedPtr
m_bndCondExpansions
 Discretised boundary conditions. More...
 
Array< OneD,
SpatialDomains::BoundaryConditionShPtr
m_bndConditions
 An array which contains the information about the boundary condition on the different boundary regions. More...
 
GlobalLinSysMapShPtr m_globalBndMat
 Global boundary matrix. More...
 
ExpListSharedPtr m_trace
 Trace space storage for points between elements. More...
 
AssemblyMapDGSharedPtr m_traceMap
 Local to global DG mapping for trace space. More...
 
std::set< int > m_boundaryVerts
 A set storing the global IDs of any boundary edges. More...
 
PeriodicMap m_periodicVerts
 A map which identifies groups of periodic vertices. More...
 
std::vector< int > m_periodicFwdCopy
 A vector indicating degress of freedom which need to be copied from forwards to backwards space in case of a periodic boundary condition. More...
 
std::vector< int > m_periodicBwdCopy
 
std::vector< bool > m_leftAdjacentVerts
 
- 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...
 

Private Member Functions

void SetUpDG (const std::string &variable)
 
bool IsLeftAdjacentVertex (const int n, const int e)
 
SpatialDomains::BoundaryConditionsSharedPtr GetDomainBCs (const SpatialDomains::CompositeMap &domain, const SpatialDomains::BoundaryConditions &Allbcs, const std::string &variable)
 

Private Attributes

std::vector< bool > m_negatedFluxNormal
 

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)
 

Detailed Description

This class is the abstraction of a global discontinuous two- dimensional spectral/hp element expansion which approximates the solution of a set of partial differential equations.

This class augments the list of local expansions inherited from ExpList1D with boundary conditions. Inter-element boundaries are handled using an discontinuous Galerkin scheme.

Definition at line 55 of file DisContField1D.h.

Constructor & Destructor Documentation

Nektar::MultiRegions::DisContField1D::DisContField1D ( )

Default constructor.

Constructs an empty expansion list with no boundary conditions.

Definition at line 58 of file DisContField1D.cpp.

58  :
59  ExpList1D(),
62  {
63  }
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:77
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
Nektar::MultiRegions::DisContField1D::DisContField1D ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr graph1D,
const std::string &  variable,
const bool  SetUpJustDG = true 
)

Constructs a 1D discontinuous field based on a mesh and boundary conditions.

An expansion list for the boundary expansions is generated first for the field. These are subsequently evaluated for time zero. The trace map is then constructed.

Parameters
graph1DA mesh, containing information about the domain and the spectral/hp element expansions.
bcsInformation about the enforced boundary conditions.
variableThe session variable associated with the boundary conditions to enforce.
solnTypeType of global system to use.

Definition at line 78 of file DisContField1D.cpp.

References Nektar::MultiRegions::ExpList::ApplyGeomInfo(), Nektar::MultiRegions::ExpList::EvaluateBoundaryConditions(), FindPeriodicVertices(), GenerateBoundaryConditionExpansion(), Nektar::MultiRegions::ExpList::GetBoundaryToElmtMap(), m_bndCondExpansions, Nektar::MultiRegions::ExpList::m_session, SetUpDG(), and Nektar::MultiRegions::ExpList::SetUpPhysNormals().

83  : ExpList1D(pSession,graph1D),
86  {
87  SpatialDomains::BoundaryConditions bcs(m_session, graph1D);
88 
89  GenerateBoundaryConditionExpansion(graph1D,bcs,variable);
90  EvaluateBoundaryConditions(0.0, variable);
91  ApplyGeomInfo();
92  FindPeriodicVertices(bcs,variable);
93 
94  if(SetUpJustDG)
95  {
96  SetUpDG(variable);
97  }
98  else
99  {
100  int i;
101  Array<OneD, int> ElmtID, VertexID;
102  GetBoundaryToElmtMap(ElmtID, VertexID);
103 
104  for(i = 0; i < m_bndCondExpansions.num_elements(); ++i)
105  {
107  locExpList = m_bndCondExpansions[i];
108 
110  (*m_exp)[ElmtID[i]]->
111  as<LocalRegions::Expansion1D>();
113  locExpList->GetExp(0)->
114  as<LocalRegions::Expansion0D>();
115 
116  exp0d->SetAdjacentElementExp(VertexID[i], exp1d);
117  }
118 
120  }
121 
122  }
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:77
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble=NekConstants::kNekUnsetDouble, const NekDouble=NekConstants::kNekUnsetDouble)
Definition: ExpList.h:2094
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
void FindPeriodicVertices(const SpatialDomains::BoundaryConditions &bcs, const std::string variable)
Generate a associative map of periodic vertices in a mesh.
void SetUpDG(const std::string &variable)
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2147
void ApplyGeomInfo()
Apply geometry information to each expansion.
Definition: ExpList.cpp:1424
boost::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:49
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
void GenerateBoundaryConditionExpansion(const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::BoundaryConditions &bcs, const std::string variable)
Discretises the boundary conditions.
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
boost::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:53
Nektar::MultiRegions::DisContField1D::DisContField1D ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr graph1D,
const SpatialDomains::CompositeMap domain,
const SpatialDomains::BoundaryConditions Allbcs,
const std::string &  variable,
bool  SetToOneSpaceDimension = false 
)

Constructor for a DisContField1D from a List of subdomains New Constructor for arterial network.

Constructor for use in multidomain computations where a domain list can be passed instead of graph1D

Parameters
domainSubdomain specified in the inputfile from which the DisContField1D is set up

Definition at line 443 of file DisContField1D.cpp.

References Nektar::MultiRegions::ExpList::ApplyGeomInfo(), Nektar::MultiRegions::ExpList::EvaluateBoundaryConditions(), FindPeriodicVertices(), GenerateBoundaryConditionExpansion(), GetDomainBCs(), and SetUpDG().

449  :
450  ExpList1D(pSession,graph1D,domain, true,variable,SetToOneSpaceDimension),
453  {
454  SpatialDomains::BoundaryConditionsSharedPtr DomBCs = GetDomainBCs(domain,Allbcs,variable);
455 
456  GenerateBoundaryConditionExpansion(graph1D,*DomBCs,variable);
457  EvaluateBoundaryConditions(0.0, variable);
458  ApplyGeomInfo();
459  FindPeriodicVertices(*DomBCs,variable);
460 
461  SetUpDG(variable);
462  }
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:77
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble=NekConstants::kNekUnsetDouble, const NekDouble=NekConstants::kNekUnsetDouble)
Definition: ExpList.h:2094
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
void FindPeriodicVertices(const SpatialDomains::BoundaryConditions &bcs, const std::string variable)
Generate a associative map of periodic vertices in a mesh.
SpatialDomains::BoundaryConditionsSharedPtr GetDomainBCs(const SpatialDomains::CompositeMap &domain, const SpatialDomains::BoundaryConditions &Allbcs, const std::string &variable)
void SetUpDG(const std::string &variable)
void ApplyGeomInfo()
Apply geometry information to each expansion.
Definition: ExpList.cpp:1424
void GenerateBoundaryConditionExpansion(const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::BoundaryConditions &bcs, const std::string variable)
Discretises the boundary conditions.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
boost::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
Definition: Conditions.h:271
Nektar::MultiRegions::DisContField1D::DisContField1D ( const DisContField1D In)

Constructs a 1D discontinuous field based on an existing field.

Constructs a field as a copy of an existing field.

Parameters
InExisting DisContField1D object to copy.

Definition at line 468 of file DisContField1D.cpp.

468  :
469  ExpList1D(In),
470  m_bndCondExpansions(In.m_bndCondExpansions),
471  m_bndConditions(In.m_bndConditions),
472  m_globalBndMat(In.m_globalBndMat),
473  m_trace(In.m_trace),
474  m_traceMap(In.m_traceMap),
475  m_boundaryVerts(In.m_boundaryVerts),
476  m_periodicVerts(In.m_periodicVerts),
477  m_periodicFwdCopy(In.m_periodicFwdCopy),
478  m_periodicBwdCopy(In.m_periodicBwdCopy),
479  m_leftAdjacentVerts(In.m_leftAdjacentVerts)
480  {
481  }
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:77
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
GlobalLinSysMapShPtr m_globalBndMat
Global boundary matrix.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
std::set< int > m_boundaryVerts
A set storing the global IDs of any boundary edges.
ExpListSharedPtr m_trace
Trace space storage for points between elements.
std::vector< int > m_periodicFwdCopy
A vector indicating degress of freedom which need to be copied from forwards to backwards space in ca...
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
Nektar::MultiRegions::DisContField1D::DisContField1D ( const ExpList1D In)

Constructs a 1D discontinuous field based on an existing field. (needed in order to use ContField( const ExpList1D &In) constructor.

Constructs a field as a copy of an existing explist1D field.

Parameters
InExisting ExpList1D object to copy.

Definition at line 488 of file DisContField1D.cpp.

488  :
489  ExpList1D(In)
490  {
491  }
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:77
Nektar::MultiRegions::DisContField1D::~DisContField1D ( )
virtual

Destructor.

Definition at line 496 of file DisContField1D.cpp.

497  {
498  }

Member Function Documentation

void Nektar::MultiRegions::DisContField1D::FindPeriodicVertices ( const SpatialDomains::BoundaryConditions bcs,
const std::string  variable 
)
protected

Generate a associative map of periodic vertices in a mesh.

Parameters
graph1DA mesh containing information about the domain and the spectral/hp element expansion.
bcsInformation about the boundary conditions.
variableSpecifies the field.
periodicVerticesMap into which the list of periodic vertices is placed.

Definition at line 560 of file DisContField1D.cpp.

References ASSERTL0, Nektar::StdRegions::eNoOrientation, Nektar::SpatialDomains::ePeriodic, Nektar::MultiRegions::ExpList::GetBoundaryCondition(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryConditions(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::iterator, Nektar::MultiRegions::ExpList::m_graph, m_periodicVerts, Nektar::MultiRegions::ExpList::m_session, Nektar::LibUtilities::ReduceSum, and Vmath::Vsum().

Referenced by DisContField1D().

563  {
565  = bcs.GetBoundaryRegions();
567  = bcs.GetBoundaryConditions();
568 
570  = boost::dynamic_pointer_cast<
571  SpatialDomains::MeshGraph1D>(m_graph);
572  SpatialDomains::BoundaryRegionCollection::const_iterator it;
573 
575  m_session->GetComm()->GetRowComm();
576 
577  int i, region1ID, region2ID;
578 
580 
581  map<int,int> BregionToVertMap;
582 
583  // Construct list of all periodic Region and their global vertex on
584  // this process.
585  for (it = bregions.begin(); it != bregions.end(); ++it)
586  {
587  locBCond = GetBoundaryCondition(bconditions, it->first, variable);
588 
589  if (locBCond->GetBoundaryConditionType()
591  {
592  continue;
593  }
594 
595  int id = (*(it->second->begin()->second))[0]->GetGlobalID();
596 
597  BregionToVertMap[it->first] = id;
598  }
599 
601  set<int> islocal;
602 
603  int n = vComm->GetSize();
604  int p = vComm->GetRank();
605 
606  Array<OneD, int> nregions(n, 0);
607  nregions[p] = BregionToVertMap.size();
608  vComm->AllReduce(nregions, LibUtilities::ReduceSum);
609 
610  int totRegions = Vmath::Vsum(n, nregions, 1);
611 
612  Array<OneD, int> regOffset(n, 0);
613 
614  for (i = 1; i < n; ++i)
615  {
616  regOffset[i] = regOffset[i-1] + nregions[i-1];
617  }
618 
619  Array<OneD, int> bregmap(totRegions, 0);
620  Array<OneD, int> bregid (totRegions, 0);
621  for(i = regOffset[p], iit = BregionToVertMap.begin();
622  iit != BregionToVertMap.end(); ++iit, ++i)
623  {
624  bregid [i] = iit->first;
625  bregmap[i] = iit->second;
626  islocal.insert(iit->first);
627  }
628 
629  vComm->AllReduce(bregmap, LibUtilities::ReduceSum);
630  vComm->AllReduce(bregid, LibUtilities::ReduceSum);
631 
632  for (int i = 0; i < totRegions; ++i)
633  {
634  BregionToVertMap[bregid[i]] = bregmap[i];
635  }
636 
637  // Construct list of all periodic pairs local to this process.
638  for (it = bregions.begin(); it != bregions.end(); ++it)
639  {
640  locBCond = GetBoundaryCondition(bconditions, it->first, variable);
641 
642  if (locBCond->GetBoundaryConditionType()
644  {
645  continue;
646  }
647 
648  // Identify periodic boundary region IDs.
649  region1ID = it->first;
650  region2ID = boost::static_pointer_cast<
651  SpatialDomains::PeriodicBoundaryCondition>(
652  locBCond)->m_connectedBoundaryRegion;
653 
654  ASSERTL0(BregionToVertMap.count(region1ID) != 0,
655  "Cannot determine vertex of region1ID");
656 
657  ASSERTL0(BregionToVertMap.count(region2ID) != 0,
658  "Cannot determine vertex of region2ID");
659 
660  PeriodicEntity ent(BregionToVertMap[region2ID],
662  islocal.count(region2ID) != 0);
663 
664  m_periodicVerts[BregionToVertMap[region1ID]].push_back(ent);
665  }
666  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:206
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
Definition: ExpList.h:913
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:215
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< MeshGraph1D > MeshGraph1DSharedPtr
Definition: MeshGraph1D.h:86
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:2864
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:208
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition: Vmath.cpp:723
struct Nektar::MultiRegions::_PeriodicEntity PeriodicEntity
void Nektar::MultiRegions::DisContField1D::GenerateBoundaryConditionExpansion ( const SpatialDomains::MeshGraphSharedPtr graph1D,
const SpatialDomains::BoundaryConditions bcs,
const std::string  variable 
)
protected

Discretises the boundary conditions.

Generate the boundary condition expansion list

Parameters
graph1DA mesh, containing information about the domain and the spectral/hp element expansions.
bcsInformation about the enforced boundary conditions.
variableThe session variable associated with the boundary conditions to enforce.

Definition at line 510 of file DisContField1D.cpp.

References Nektar::SpatialDomains::ePeriodic, Nektar::MultiRegions::ExpList::GetBoundaryCondition(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryConditions(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::iterator, m_bndCondExpansions, m_bndConditions, and SetBoundaryConditionExpansion().

Referenced by DisContField1D().

514  {
515  int cnt = 0;
516 
518  = bcs.GetBoundaryRegions();
520  = bcs.GetBoundaryConditions();
521  SpatialDomains::BoundaryRegionCollection::const_iterator it;
522 
523  // count the number of non-periodic boundary points
524  for (it = bregions.begin(); it != bregions.end(); ++it)
525  {
526  const SpatialDomains::BoundaryConditionShPtr boundaryCondition =
527  GetBoundaryCondition(bconditions, it->first, variable);
528  if (boundaryCondition->GetBoundaryConditionType() !=
530  {
532  for (bregionIt = it->second->begin();
533  bregionIt != it->second->end(); bregionIt++)
534  {
535  cnt += bregionIt->second->size();
536  }
537  }
538  }
539 
541  = Array<OneD,MultiRegions::ExpListSharedPtr>(cnt);
542 
544  = Array<OneD,SpatialDomains::BoundaryConditionShPtr>(cnt);
545 
546  SetBoundaryConditionExpansion(graph1D,bcs,variable,
548  m_bndConditions);
549  }
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
void SetBoundaryConditionExpansion(const SpatialDomains::MeshGraphSharedPtr &graph1D, const SpatialDomains::BoundaryConditions &bcs, const std::string variable, Array< OneD, MultiRegions::ExpListSharedPtr > &bndCondExpansions, Array< OneD, SpatialDomains::BoundaryConditionShPtr > &bndConditions)
Populates the list of boundary condition expansions.
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:206
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:215
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:2864
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:208
void Nektar::MultiRegions::DisContField1D::GenerateFieldBnd1D ( SpatialDomains::BoundaryConditions bcs,
const std::string  variable 
)
protected
SpatialDomains::BoundaryConditionsSharedPtr Nektar::MultiRegions::DisContField1D::GetDomainBCs ( const SpatialDomains::CompositeMap domain,
const SpatialDomains::BoundaryConditions Allbcs,
const std::string &  variable 
)
private

Definition at line 333 of file DisContField1D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL1, Nektar::SpatialDomains::BoundaryConditions::GetBoundaryConditions(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::iterator, and Nektar::MultiRegions::ExpList::m_session.

Referenced by DisContField1D().

337  {
339 
341 
343  map<int,int> GeometryToRegionsMap;
344 
345  SpatialDomains::BoundaryRegionCollection::const_iterator it;
346 
348  = Allbcs.GetBoundaryRegions();
350  = Allbcs.GetBoundaryConditions();
351 
352  // Set up a map of all boundary regions
353  for(it = bregions.begin(); it != bregions.end(); ++it)
354  {
356  for (bregionIt = it->second->begin();
357  bregionIt != it->second->end(); bregionIt++)
358  {
359  // can assume that all regions only contain one point in 1D
360  // Really do not need loop above
361  int id = (*(bregionIt->second))[0]->GetGlobalID();
362  GeometryToRegionsMap[id] = it->first;
363  }
364  }
365 
367  map<int,SpatialDomains::GeometrySharedPtr> EndOfDomain;
368 
369  // Now find out which points in domain have only one vertex
370  for(domIt = domain.begin(); domIt != domain.end(); ++domIt)
371  {
372  SpatialDomains::Composite geomvector = domIt->second;
373  for(int i = 0; i < geomvector->size(); ++i)
374  {
375  for(int j = 0; j < 2; ++j)
376  {
377  int vid = (*geomvector)[i]->GetVid(j);
378  if(EndOfDomain.count(vid) == 0)
379  {
380  EndOfDomain[vid] = (*geomvector)[i]->GetVertex(j);
381  }
382  else
383  {
384  EndOfDomain.erase(vid);
385  }
386  }
387  }
388  }
389  ASSERTL1(EndOfDomain.size() == 2,"Did not find two ends of domain");
390 
392  int numNewBc = 1;
393  for(regIt = EndOfDomain.begin(); regIt != EndOfDomain.end(); ++regIt)
394  {
395  if(GeometryToRegionsMap.count(regIt->first) != 0) // Set up boundary condition up
396  {
397  map<int,int>::iterator iter = GeometryToRegionsMap.find(regIt->first);
398  ASSERTL1(iter != GeometryToRegionsMap.end(),"Failied to find GeometryToRegionMap");
399  int regionId = iter->second;
400  SpatialDomains::BoundaryRegionCollection::const_iterator bregionsIter = bregions.find(regionId);
401  ASSERTL1(bregionsIter != bregions.end(),"Failed to find boundary region");
402  SpatialDomains::BoundaryRegionShPtr breg = bregionsIter->second;
403  returnval->AddBoundaryRegions (regionId,breg);
404 
405  SpatialDomains::BoundaryConditionCollection::const_iterator bconditionsIter = bconditions.find(regionId);
406  ASSERTL1(bconditionsIter != bconditions.end(),"Failed to find boundary collection");
407  SpatialDomains::BoundaryConditionMapShPtr bcond = bconditionsIter->second;
408  returnval->AddBoundaryConditions(regionId,bcond);
409  }
410  else // Set up an undefined region.
411  {
412  SpatialDomains::BoundaryRegionShPtr breg(MemoryManager<SpatialDomains::BoundaryRegion>::AllocateSharedPtr());
413 
414  // Set up Composite (GemetryVector) to contain vertex and put into bRegion
415  SpatialDomains::Composite gvec(MemoryManager<SpatialDomains::GeometryVector>::AllocateSharedPtr());
416  gvec->push_back(regIt->second);
417  (*breg)[regIt->first] = gvec;
418 
419  returnval->AddBoundaryRegions(bregions.size()+numNewBc,breg);
420 
422 
423  // Set up just boundary condition for this variable.
424  SpatialDomains::BoundaryConditionShPtr notDefinedCondition(MemoryManager<SpatialDomains::NotDefinedBoundaryCondition>::AllocateSharedPtr(m_session, "0"));
425  (*bCondition)[variable] = notDefinedCondition;
426 
427  returnval->AddBoundaryConditions(bregions.size()+numNewBc,bCondition);
428  ++numNewBc;
429 
430  }
431  }
432 
433  return returnval;
434  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
std::map< int, Composite >::const_iterator CompositeMapConstIter
Definition: MeshGraph.h:117
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:206
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:215
boost::shared_ptr< GeometryVector > Composite
Definition: MeshGraph.h:114
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
Definition: Conditions.h:214
boost::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
Definition: Conditions.h:271
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
boost::shared_ptr< BoundaryRegion > BoundaryRegionShPtr
Definition: Conditions.h:204
GlobalLinSysSharedPtr Nektar::MultiRegions::DisContField1D::GetGlobalBndLinSys ( const GlobalLinSysKey mkey)

For a given key, returns the associated global linear system.

Definition at line 789 of file DisContField1D.cpp.

References ASSERTL0, ASSERTL1, Nektar::MultiRegions::eDirectFullMatrix, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::MultiRegions::ExpList::GenGlobalBndLinSys(), Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::iterator, m_globalBndMat, and m_traceMap.

Referenced by v_HelmSolve().

791  {
792  ASSERTL0(mkey.GetMatrixType() == StdRegions::eHybridDGHelmBndLam,
793  "Routine currently only tested for HybridDGHelmholtz");
794 
795  ASSERTL1(mkey.GetGlobalSysSolnType() != eDirectFullMatrix,
796  "Full matrix global systems are not supported for HDG "
797  "expansions");
798 
799  ASSERTL1(mkey.GetGlobalSysSolnType()
800  ==m_traceMap->GetGlobalSysSolnType(),
801  "The local to global map is not set up for the requested "
802  "solution type");
803 
804  GlobalLinSysSharedPtr glo_matrix;
805  GlobalLinSysMap::iterator matrixIter = m_globalBndMat->find(mkey);
806 
807  if (matrixIter == m_globalBndMat->end())
808  {
809  glo_matrix = GenGlobalBndLinSys(mkey,m_traceMap);
810  (*m_globalBndMat)[mkey] = glo_matrix;
811  }
812  else
813  {
814  glo_matrix = matrixIter->second;
815  }
816 
817  return glo_matrix;
818  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
boost::shared_ptr< GlobalLinSys > GenGlobalBndLinSys(const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocTo...
Definition: ExpList.cpp:1194
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
GlobalLinSysMapShPtr m_globalBndMat
Global boundary matrix.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:52
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
vector< bool > & Nektar::MultiRegions::DisContField1D::GetNegatedFluxNormal ( void  )

Definition at line 821 of file DisContField1D.cpp.

References Nektar::MultiRegions::ExpList::GetExpSize(), m_negatedFluxNormal, and m_traceMap.

Referenced by v_AddTraceIntegral().

822  {
823  if(m_negatedFluxNormal.size() == 0)
824  {
825  Array<OneD, Array<OneD, LocalRegions::ExpansionSharedPtr> >
826  &elmtToTrace = m_traceMap->GetElmtToTrace();
827 
828  m_negatedFluxNormal.resize(2*GetExpSize());
829 
830  for(int i = 0; i < GetExpSize(); ++i)
831  {
832 
833  for(int v = 0; v < 2; ++v)
834  {
835 
837  elmtToTrace[i][v]->as<LocalRegions::Expansion0D>();
838 
839  if(vertExp->GetLeftAdjacentElementExp()->GetGeom()->GetGlobalID() != (*m_exp)[i]->GetGeom()->GetGlobalID())
840  {
841  m_negatedFluxNormal[2*i+v] = true;
842  }
843  else
844  {
845  m_negatedFluxNormal[2*i+v] = false;
846  }
847  }
848  }
849 
850  }
851 
852  return m_negatedFluxNormal;
853  }
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
boost::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:49
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
bool Nektar::MultiRegions::DisContField1D::IsLeftAdjacentVertex ( const int  n,
const int  e 
)
private

Definition at line 278 of file DisContField1D.cpp.

References ASSERTL2, Nektar::iterator, m_boundaryVerts, Nektar::MultiRegions::ExpList::m_exp, m_periodicVerts, m_trace, and m_traceMap.

Referenced by SetUpDG().

279  {
282  m_traceMap->GetElmtToTrace()[n][e]->as<LocalRegions::Expansion0D>();
283 
284 
285  bool fwd = true;
286  if (traceEl->GetLeftAdjacentElementVertex () == -1 ||
287  traceEl->GetRightAdjacentElementVertex() == -1)
288  {
289  // Boundary edge (1 connected element). Do nothing in
290  // serial.
291  it = m_boundaryVerts.find(traceEl->GetElmtId());
292 
293  // If the edge does not have a boundary condition set on
294  // it, then assume it is a partition edge or periodic.
295  if (it == m_boundaryVerts.end())
296  {
297  int traceGeomId = traceEl->GetGeom0D()->GetGlobalID();
299  traceGeomId);
300 
301  if (pIt != m_periodicVerts.end() && !pIt->second[0].isLocal)
302  {
303  fwd = traceGeomId == min(traceGeomId,pIt->second[0].id);
304  }
305  else
306  {
307  int offset = m_trace->GetPhys_Offset(traceEl->GetElmtId());
308  fwd = m_traceMap->
309  GetTraceToUniversalMapUnique(offset) >= 0;
310  }
311  }
312  }
313  else if (traceEl->GetLeftAdjacentElementVertex () != -1 &&
314  traceEl->GetRightAdjacentElementVertex() != -1)
315  {
316  // Non-boundary edge (2 connected elements).
317  fwd = dynamic_cast<Nektar::StdRegions::StdExpansion*>
318  (traceEl->GetLeftAdjacentElementExp().get()) ==
319  (*m_exp)[n].get();
320  }
321  else
322  {
323  ASSERTL2(false, "Unconnected trace element!");
324  }
325 
326  return fwd;
327  }
boost::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:49
The base class for all shapes.
Definition: StdExpansion.h:69
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:240
std::set< int > m_boundaryVerts
A set storing the global IDs of any boundary edges.
ExpListSharedPtr m_trace
Trace space storage for points between elements.
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
void Nektar::MultiRegions::DisContField1D::SetBoundaryConditionExpansion ( const SpatialDomains::MeshGraphSharedPtr graph1D,
const SpatialDomains::BoundaryConditions bcs,
const std::string  variable,
Array< OneD, MultiRegions::ExpListSharedPtr > &  bndCondExpansions,
Array< OneD, SpatialDomains::BoundaryConditionShPtr > &  bndConditions 
)
protected

Populates the list of boundary condition expansions.

Parameters
graph1DA mesh containing information about the domain and the Spectral/hp element expansion.
bcsInformation about the boundary conditions.
variableSpecifies the field.
bndCondExpansionsArray of ExpList1D objects each containing a 1D spectral/hp element expansion on a single boundary region.
bncConditionsArray of BoundaryCondition objects which contain information about the boundary conditions on the different boundary regions.

Definition at line 681 of file DisContField1D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::SpatialDomains::eDirichlet, Nektar::SpatialDomains::eNeumann, Nektar::SpatialDomains::eNotDefined, Nektar::SpatialDomains::ePeriodic, Nektar::SpatialDomains::eRobin, Nektar::MultiRegions::ExpList::GetBoundaryCondition(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryConditions(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::iterator, and Nektar::NekMeshUtils::vert.

Referenced by GenerateBoundaryConditionExpansion().

689  {
690  int k;
691  int cnt = 0;
692 
694  = bcs.GetBoundaryRegions();
696  = bcs.GetBoundaryConditions();
697  SpatialDomains::BoundaryRegionCollection::const_iterator it;
698 
702 
703  cnt = 0;
704  // list Dirichlet boundaries first
705  for (it = bregions.begin(); it != bregions.end(); ++it)
706  {
707  locBCond = GetBoundaryCondition(
708  bconditions, it->first, variable);
709 
710  if (locBCond->GetBoundaryConditionType() ==
712 
713  {
715  for (bregionIt = it->second->begin();
716  bregionIt != it->second->end(); bregionIt++)
717  {
718  for (k = 0; k < bregionIt->second->size(); k++)
719  {
720  if ((vert = boost::dynamic_pointer_cast
721  <SpatialDomains::PointGeom>(
722  (*bregionIt->second)[k])))
723  {
724  locPointExp
727  bndCondExpansions[cnt] = locPointExp;
728  bndConditions[cnt++] = locBCond;
729  }
730  else
731  {
732  ASSERTL0(false,
733  "dynamic cast to a vertex failed");
734  }
735  }
736  }
737  }
738  } // end if Dirichlet
739 
740  // then, list the other (non-periodic) boundaries
741  for (it = bregions.begin(); it != bregions.end(); ++it)
742  {
743  locBCond = GetBoundaryCondition(bconditions, it->first, variable);
744 
745  switch(locBCond->GetBoundaryConditionType())
746  {
749  case SpatialDomains::eNotDefined: // presume this will be reused as Neuman, Robin or Dirichlet later
750  {
752  for (bregionIt = it->second->begin();
753  bregionIt != it->second->end(); bregionIt++)
754  {
755  for (k = 0; k < bregionIt->second->size(); k++)
756  {
757  if((vert = boost::dynamic_pointer_cast
758  <SpatialDomains::PointGeom>(
759  (*bregionIt->second)[k])))
760  {
761  locPointExp
764  bndCondExpansions[cnt] = locPointExp;
765  bndConditions[cnt++] = locBCond;
766  }
767  else
768  {
769  ASSERTL0(false,
770  "dynamic cast to a vertex failed");
771  }
772  }
773  }
774  }
775  // do nothing for these types
778  break;
779  default:
780  ASSERTL0(false,"This type of BC not implemented yet");
781  break;
782  }
783  }
784  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:206
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:215
boost::shared_ptr< ExpList0D > ExpList0DSharedPtr
Shared pointer to an ExpList0D object.
Definition: ExpList0D.h:54
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:2864
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:208
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
void Nektar::MultiRegions::DisContField1D::SetMultiDomainBoundaryConditionExpansion ( const SpatialDomains::MeshGraphSharedPtr graph1D,
const SpatialDomains::BoundaryConditions bcs,
const std::string  variable,
Array< OneD, MultiRegions::ExpListSharedPtr > &  bndCondExpansions,
Array< OneD, SpatialDomains::BoundaryConditionShPtr > &  bndConditions,
int  subdomain 
)
protected

Populates the list of boundary condition expansions in multidomain case.

void Nektar::MultiRegions::DisContField1D::SetUpDG ( const std::string &  variable)
private

Definition at line 124 of file DisContField1D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::SpatialDomains::ePeriodic, Nektar::MultiRegions::_PeriodicEntity::id, IsLeftAdjacentVertex(), Nektar::MultiRegions::_PeriodicEntity::isLocal, Nektar::iterator, m_bndCondExpansions, m_bndConditions, m_boundaryVerts, Nektar::MultiRegions::ExpList::m_exp, m_globalBndMat, Nektar::MultiRegions::ExpList::m_graph, m_leftAdjacentVerts, m_periodicBwdCopy, m_periodicFwdCopy, m_periodicVerts, Nektar::MultiRegions::ExpList::m_session, m_trace, m_traceMap, Nektar::MultiRegions::NullExpListSharedPtr, Nektar::LocalRegions::Expansion0D::SetAdjacentElementExp(), and Nektar::MultiRegions::ExpList::SetUpPhysNormals().

Referenced by DisContField1D().

125  {
126  // Check for multiple calls
128  {
129  return;
130  }
131 
133  boost::dynamic_pointer_cast<SpatialDomains::MeshGraph1D>(
134  m_graph);
135 
137 
142  *m_exp,graph1D,
144 
145  m_trace = boost::dynamic_pointer_cast<ExpList>(trace);
146 
148  AllocateSharedPtr(m_session, graph1D, trace, *this,
150  m_periodicVerts, variable);
151 
152  // Scatter trace points to 1D elements. For each element, we find
153  // the trace point associated to each vertex. The element then
154  // retains a pointer to the trace space points, to ensure
155  // uniqueness of normals when retrieving from two adjoining
156  // elements which do not lie in a plane.
157 
158  int ElmtPointGeom = 0;
159  int TracePointGeom = 0;
162  for (int i = 0; i < m_exp->size(); ++i)
163  {
164  exp1d = (*m_exp)[i]->as<LocalRegions::Expansion1D>();
165  for (int j = 0; j < exp1d->GetNverts(); ++j)
166  {
167  ElmtPointGeom = (exp1d->GetGeom1D())->GetVid(j);
168 
169  for (int k = 0; k < m_trace->GetExpSize(); ++k)
170  {
171  TracePointGeom = m_trace->GetExp(k)->GetGeom()->GetVid(0);
172 
173  if (TracePointGeom == ElmtPointGeom)
174  {
175  exp0d = m_trace->GetExp(k)->as<LocalRegions::Expansion0D>();
176  exp0d->SetAdjacentElementExp(j,exp1d);
177  break;
178  }
179  }
180  }
181  }
182 
184 
185  int cnt, n, e;
186 
187  // Identify boundary verts
188  for(cnt = 0, n = 0; n < m_bndCondExpansions.num_elements(); ++n)
189  {
190  if (m_bndConditions[n]->GetBoundaryConditionType() !=
192  {
193  for(e = 0; e < m_bndCondExpansions[n]->GetExpSize(); ++e)
194  {
195  m_boundaryVerts.insert(
196  m_traceMap->GetBndCondTraceToGlobalTraceMap(cnt+e));
197  }
198  }
199  else
200  {
201  ASSERTL0(false,"Periodic verts need setting up");
202  }
203  cnt += m_bndCondExpansions[n]->GetExpSize();
204  }
205 
206  // Set up left-adjacent edge list.
207  m_leftAdjacentVerts.resize(2*((*m_exp).size()));
208 
209  // count size of trace
210  for (cnt = n = 0; n < m_exp->size(); ++n)
211  {
212  for (int v = 0; v < (*m_exp)[n]->GetNverts(); ++v, ++cnt)
213  {
215  }
216  }
217 
218 
219  boost::unordered_map<int,pair<int,int> > perVertToExpMap;
220  boost::unordered_map<int,pair<int,int> >::iterator it2;
221  for (n = 0; n < m_exp->size(); ++n)
222  {
223  for (int v = 0; v < (*m_exp)[n]->GetNverts(); ++v)
224  {
226  (*m_exp)[n]->GetGeom()->GetVid(v));
227 
228  if (it != m_periodicVerts.end())
229  {
230  perVertToExpMap[it->first] = make_pair(n,v);
231  }
232  }
233  }
234 
235 
236  // Set up mapping to copy Fwd of periodic bcs to Bwd of other edge.
237  for (n = 0; n < m_exp->size(); ++n)
238  {
239  for (int v = 0; v < (*m_exp)[n]->GetNverts(); ++v)
240  {
241  int vertGeomId = (*m_exp)[n]->GetGeom()->GetVid(v);
242 
243  // Check to see if this face is periodic.
244  PeriodicMap::iterator it = m_periodicVerts.find(vertGeomId);
245 
246  if (it != m_periodicVerts.end())
247  {
248  const PeriodicEntity &ent = it->second[0];
249  it2 = perVertToExpMap.find(ent.id);
250 
251  if (it2 == perVertToExpMap.end())
252  {
253  if (m_session->GetComm()->GetRowComm()->GetSize() > 1 &&
254  !ent.isLocal)
255  {
256  continue;
257  }
258  else
259  {
260  ASSERTL1(false, "Periodic vert not found!");
261  }
262  }
263 
264  int offset = m_trace->GetPhys_Offset((m_traceMap->GetElmtToTrace())
265  [n][v]->GetElmtId());
266  m_periodicFwdCopy.push_back(offset);
267 
268  int offset2 = m_trace->GetPhys_Offset((m_traceMap->GetElmtToTrace())
269  [it2->second.first]
270  [it2->second.second]->GetElmtId());
271  m_periodicBwdCopy.push_back(offset2);
272  }
273  }
274  }
275  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
ExpList()
The default constructor.
Definition: ExpList.cpp:95
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1398
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
boost::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:49
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
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
bool IsLeftAdjacentVertex(const int n, const int e)
GlobalLinSysMapShPtr m_globalBndMat
Global boundary matrix.
boost::shared_ptr< ExpList0D > ExpList0DSharedPtr
Shared pointer to an ExpList0D object.
Definition: ExpList0D.h:54
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
boost::shared_ptr< MeshGraph1D > MeshGraph1DSharedPtr
Definition: MeshGraph1D.h:86
std::set< int > m_boundaryVerts
A set storing the global IDs of any boundary edges.
ExpListSharedPtr m_trace
Trace space storage for points between elements.
std::vector< int > m_periodicFwdCopy
A vector indicating degress of freedom which need to be copied from forwards to backwards space in ca...
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
struct Nektar::MultiRegions::_PeriodicEntity PeriodicEntity
#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< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:53
void Nektar::MultiRegions::DisContField1D::v_AddTraceIntegral ( const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1035 of file DisContField1D.cpp.

References Nektar::LibUtilities::BasisManager(), Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::MultiRegions::ExpList::GetCoeff_Offset(), Nektar::MultiRegions::ExpList::GetExpSize(), GetNegatedFluxNormal(), Nektar::MultiRegions::ExpList::GetTrace(), Nektar::MultiRegions::ExpList::m_exp, and m_traceMap.

1038  {
1039  int n,offset, t_offset;
1040 
1041  Array<OneD, Array<OneD, LocalRegions::ExpansionSharedPtr> >
1042  &elmtToTrace = m_traceMap->GetElmtToTrace();
1043 
1044  vector<bool> negatedFluxNormal = GetNegatedFluxNormal();
1045 
1046  for (n = 0; n < GetExpSize(); ++n)
1047  {
1048  // Number of coefficients on each element
1049  int e_ncoeffs = (*m_exp)[n]->GetNcoeffs();
1050 
1051  offset = GetCoeff_Offset(n);
1052 
1053  // Implementation for every points except Gauss points
1054  if ((*m_exp)[n]->GetBasis(0)->GetBasisType() !=
1056  {
1057  t_offset = GetTrace()->GetCoeff_Offset(elmtToTrace[n][0]->GetElmtId());
1058  if(negatedFluxNormal[2*n])
1059  {
1060  outarray[offset] -= Fn[t_offset];
1061  }
1062  else
1063  {
1064  outarray[offset] += Fn[t_offset];
1065  }
1066 
1067  t_offset = GetTrace()->GetCoeff_Offset(elmtToTrace[n][1]->GetElmtId());
1068 
1069  if(negatedFluxNormal[2*n+1])
1070  {
1071  outarray[offset+(*m_exp)[n]->GetVertexMap(1)] -= Fn[t_offset];
1072  }
1073  else
1074  {
1075  outarray[offset+(*m_exp)[n]->GetVertexMap(1)] += Fn[t_offset];
1076  }
1077 
1078  }
1079  else
1080  {
1081 #if 0
1082  DNekMatSharedPtr m_Ixm;
1084  const LibUtilities::PointsKey
1085  BS_p(e_ncoeffs,LibUtilities::eGaussGaussLegendre);
1086  const LibUtilities::BasisKey
1087  BS_k(LibUtilities::eGauss_Lagrange,e_ncoeffs,BS_p);
1088 
1089  BASE = LibUtilities::BasisManager()[BS_k];
1090 
1091  Array<OneD, NekDouble> coords(3, 0.0);
1092 
1093  int j;
1094 
1095  for(p = 0; p < 2; ++p)
1096  {
1097  NekDouble vertnorm = 0.0;
1098  for (int i=0; i<((*m_exp)[n]->
1099  GetVertexNormal(p)).num_elements(); i++)
1100  {
1101  vertnorm += ((*m_exp)[n]->GetVertexNormal(p))[i][0];
1102  coords[0] = vertnorm ;
1103  }
1104 
1105  t_offset = GetTrace()->GetPhys_Offset(n+p);
1106 
1107  if (vertnorm >= 0.0)
1108  {
1109  m_Ixm = BASE->GetI(coords);
1110 
1111 
1112  for (j = 0; j < e_ncoeffs; j++)
1113  {
1114  outarray[offset + j] +=
1115  (m_Ixm->GetPtr())[j] * Fn[t_offset];
1116  }
1117  }
1118 
1119  if (vertnorm < 0.0)
1120  {
1121  m_Ixm = BASE->GetI(coords);
1122 
1123  for (j = 0; j < e_ncoeffs; j++)
1124  {
1125  outarray[offset + j] -=
1126  (m_Ixm->GetPtr())[j] * Fn[t_offset];
1127  }
1128  }
1129  }
1130 #else
1131  int j;
1132  static DNekMatSharedPtr m_Ixm, m_Ixp;
1133  static int sav_ncoeffs = 0;
1134  if(!m_Ixm.get() || e_ncoeffs != sav_ncoeffs)
1135  {
1137  const LibUtilities::PointsKey
1138  BS_p(e_ncoeffs,LibUtilities::eGaussGaussLegendre);
1139  const LibUtilities::BasisKey
1140  BS_k(LibUtilities::eGauss_Lagrange,e_ncoeffs,BS_p);
1141 
1142  BASE = LibUtilities::BasisManager()[BS_k];
1143 
1144  Array<OneD, NekDouble> coords(1, 0.0);
1145 
1146  coords[0] = -1.0;
1147  m_Ixm = BASE->GetI(coords);
1148 
1149  coords[0] = 1.0;
1150  m_Ixp = BASE->GetI(coords);
1151 
1152  sav_ncoeffs = e_ncoeffs;
1153  }
1154 
1155  t_offset = GetTrace()->GetCoeff_Offset(elmtToTrace[n][0]->GetElmtId());
1156  if(negatedFluxNormal[2*n])
1157  {
1158  for (j = 0; j < e_ncoeffs; j++)
1159  {
1160  outarray[offset + j] -=
1161  (m_Ixm->GetPtr())[j] * Fn[t_offset];
1162  }
1163  }
1164  else
1165  {
1166  for (j = 0; j < e_ncoeffs; j++)
1167  {
1168  outarray[offset + j] +=
1169  (m_Ixm->GetPtr())[j] * Fn[t_offset];
1170  }
1171  }
1172 
1173  t_offset = GetTrace()->GetCoeff_Offset(elmtToTrace[n][1]->GetElmtId());
1174  if (negatedFluxNormal[2*n+1])
1175  {
1176  for (j = 0; j < e_ncoeffs; j++)
1177  {
1178  outarray[offset + j] -=
1179  (m_Ixp->GetPtr())[j] * Fn[t_offset];
1180  }
1181  }
1182  else
1183  {
1184  for (j = 0; j < e_ncoeffs; j++)
1185  {
1186  outarray[offset + j] +=
1187  (m_Ixp->GetPtr())[j] * Fn[t_offset];
1188  }
1189  }
1190 #endif
1191  }
1192  }
1193  }
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n...
Definition: ExpList.h:1929
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:54
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:47
BasisManagerT & BasisManager(void)
boost::shared_ptr< ExpList > & GetTrace()
Definition: ExpList.h:2004
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:977
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
double NekDouble
std::vector< bool > & GetNegatedFluxNormal(void)
boost::shared_ptr< Basis > BasisSharedPtr
void Nektar::MultiRegions::DisContField1D::v_EvaluateBoundaryConditions ( const NekDouble  time = 0.0,
const std::string  varName = "",
const NekDouble  x2_in = NekConstants::kNekUnsetDouble,
const NekDouble  x3_in = NekConstants::kNekUnsetDouble 
)
protectedvirtual

Evaluate all boundary conditions at a given time..

Based on the expression $g(x,t)$ for the boundary conditions, this function evaluates the boundary conditions for all boundaries at time-level t.

Parameters
timeThe time at which the boundary conditions should be evaluated.
bndCondExpansionsList of boundary expansions.
bndConditionsInformation about the boundary conditions.

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1324 of file DisContField1D.cpp.

References ASSERTL0, Nektar::SpatialDomains::eDirichlet, Nektar::SpatialDomains::eNeumann, Nektar::SpatialDomains::eNotDefined, Nektar::SpatialDomains::eRobin, Nektar::MultiRegions::ExpList::GetCoeff(), Nektar::NekConstants::kNekUnsetDouble, m_bndCondExpansions, and m_bndConditions.

1329  {
1330  int i;
1331 
1332  Array<OneD, NekDouble> x0(1);
1333  Array<OneD, NekDouble> x1(1);
1334  Array<OneD, NekDouble> x2(1);
1335 
1336  for (i = 0; i < m_bndCondExpansions.num_elements(); ++i)
1337  {
1338  if (time == 0.0 || m_bndConditions[i]->IsTimeDependent())
1339  {
1340  m_bndCondExpansions[i]->GetCoords(x0, x1, x2);
1341 
1342  if (x2_in != NekConstants::kNekUnsetDouble && x3_in !=
1344  {
1345  x1[0] = x2_in;
1346  x2[0] = x3_in;
1347  }
1348 
1349  if (m_bndConditions[i]->GetBoundaryConditionType() ==
1351  {
1352  m_bndCondExpansions[i]->SetCoeff(0,
1353  (boost::static_pointer_cast<SpatialDomains
1354  ::DirichletBoundaryCondition>(m_bndConditions[i])
1355  ->m_dirichletCondition).Evaluate(x0[0],x1[0],x2[0],time));
1356  m_bndCondExpansions[i]->SetPhys(0,m_bndCondExpansions[i]->GetCoeff(0));
1357  }
1358  else if (m_bndConditions[i]->GetBoundaryConditionType()
1360  {
1361  m_bndCondExpansions[i]->SetCoeff(0,
1362  (boost::static_pointer_cast<SpatialDomains
1363  ::NeumannBoundaryCondition>(m_bndConditions[i])
1364  ->m_neumannCondition).Evaluate(x0[0],x1[0],x2[0],time));
1365  }
1366  else if (m_bndConditions[i]->GetBoundaryConditionType()
1368  {
1369  m_bndCondExpansions[i]->SetCoeff(0,
1370  (boost::static_pointer_cast<SpatialDomains
1371  ::RobinBoundaryCondition>(m_bndConditions[i])
1372  ->m_robinFunction).Evaluate(x0[0],x1[0],x2[0],time));
1373 
1374  m_bndCondExpansions[i]->SetPhys(0,
1375  (boost::static_pointer_cast<SpatialDomains
1376  ::RobinBoundaryCondition>(m_bndConditions[i])
1377  ->m_robinPrimitiveCoeff).Evaluate(x0[0],x1[0],x2[0],time));
1378 
1379  }
1380  else if (m_bndConditions[i]->GetBoundaryConditionType()
1382  {
1383  }
1384  else
1385  {
1386  ASSERTL0(false, "This type of BC not implemented yet");
1387  }
1388  }
1389  }
1390  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
static const NekDouble kNekUnsetDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
NekDouble GetCoeff(int i)
Get the i th value (coefficient) of m_coeffs.
Definition: ExpList.h:1868
void Nektar::MultiRegions::DisContField1D::v_ExtractTracePhys ( Array< OneD, NekDouble > &  outarray)
protectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 990 of file DisContField1D.cpp.

References ASSERTL1, Nektar::MultiRegions::ExpList::m_phys, and Nektar::MultiRegions::ExpList::m_physState.

992  {
993  ASSERTL1(m_physState == true,"local physical space is not true ");
994  v_ExtractTracePhys(m_phys, outarray);
995  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
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
void Nektar::MultiRegions::DisContField1D::v_ExtractTracePhys ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

This method extracts the trace (verts in 1D) from the field inarray and puts the values in outarray.

It assumes the field is C0 continuous so that it can overwrite the edge data when visited by the two adjacent elements.

Parameters
inarrayAn array containing the 1D data from which we wish to extract the edge data.
outarrayThe resulting edge information.

This will not work for non-boundary expansions

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1010 of file DisContField1D.cpp.

References ASSERTL1, Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::MultiRegions::ExpList::GetPhys_Offset(), m_trace, and m_traceMap.

1013  {
1014  // Loop over elemente and collect forward expansion
1015  int nexp = GetExpSize();
1016  int n,p,offset,phys_offset;
1017 
1018  ASSERTL1(outarray.num_elements() >= m_trace->GetExpSize(),
1019  "input array is of insufficient length");
1020 
1021  for (n = 0; n < nexp; ++n)
1022  {
1023  phys_offset = GetPhys_Offset(n);
1024 
1025  for (p = 0; p < (*m_exp)[n]->GetNverts(); ++p)
1026  {
1027  offset = m_trace->GetPhys_Offset(
1028  (m_traceMap->GetElmtToTrace())[n][p]->GetElmtId());
1029  (*m_exp)[n]->GetVertexPhysVals(p, inarray + phys_offset,
1030  outarray[offset]);
1031  }
1032  }
1033  }
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
Definition: ExpList.h:1937
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
ExpListSharedPtr m_trace
Trace space storage for points between elements.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
virtual const Array<OneD,const MultiRegions::ExpListSharedPtr>& Nektar::MultiRegions::DisContField1D::v_GetBndCondExpansions ( void  )
inlineprotectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 218 of file DisContField1D.h.

References m_bndCondExpansions.

219  {
220  return m_bndCondExpansions;
221  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
virtual const Array<OneD,const SpatialDomains::BoundaryConditionShPtr>& Nektar::MultiRegions::DisContField1D::v_GetBndConditions ( void  )
inlineprotectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Reimplemented in Nektar::MultiRegions::ContField1D.

Definition at line 224 of file DisContField1D.h.

References m_bndConditions.

225  {
226  return m_bndConditions;
227  }
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
void Nektar::MultiRegions::DisContField1D::v_GetBndElmtExpansion ( int  i,
boost::shared_ptr< ExpList > &  result 
)
protectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1447 of file DisContField1D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::MultiRegions::ExpList::GetBoundaryToElmtMap(), Nektar::MultiRegions::ExpList::GetCoeff_Offset(), Nektar::MultiRegions::ExpList::GetCoeffs(), Nektar::MultiRegions::ExpList::GetExp(), Nektar::MultiRegions::ExpList::GetPhys(), Nektar::MultiRegions::ExpList::GetPhys_Offset(), m_bndCondExpansions, and Vmath::Vcopy().

1449  {
1450  int n, cnt, nq;
1451  int offsetOld, offsetNew;
1452  Array<OneD, NekDouble> tmp1, tmp2;
1453  std::vector<unsigned int> eIDs;
1454 
1455  Array<OneD, int> ElmtID,EdgeID;
1456  GetBoundaryToElmtMap(ElmtID,EdgeID);
1457 
1458  // Skip other boundary regions
1459  for (cnt = n = 0; n < i; ++n)
1460  {
1461  cnt += m_bndCondExpansions[n]->GetExpSize();
1462  }
1463 
1464  // Populate eIDs with information from BoundaryToElmtMap
1465  for (n = 0; n < m_bndCondExpansions[i]->GetExpSize(); ++n)
1466  {
1467  eIDs.push_back(ElmtID[cnt+n]);
1468  }
1469 
1470  // Create expansion list
1471  result =
1473 
1474  // Copy phys and coeffs to new explist
1475  for (n = 0; n < result->GetExpSize(); ++n)
1476  {
1477  nq = GetExp(ElmtID[cnt+n])->GetTotPoints();
1478  offsetOld = GetPhys_Offset(ElmtID[cnt+n]);
1479  offsetNew = result->GetPhys_Offset(n);
1480  Vmath::Vcopy(nq, tmp1 = GetPhys()+ offsetOld, 1,
1481  tmp2 = result->UpdatePhys()+ offsetNew, 1);
1482 
1483  nq = GetExp(ElmtID[cnt+n])->GetNcoeffs();
1484  offsetOld = GetCoeff_Offset(ElmtID[cnt+n]);
1485  offsetNew = result->GetCoeff_Offset(n);
1486  Vmath::Vcopy(nq, tmp1 = GetCoeffs()+ offsetOld, 1,
1487  tmp2 = result->UpdateCoeffs()+ offsetNew, 1);
1488  }
1489  }
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:1837
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n...
Definition: ExpList.h:1929
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
Definition: ExpList.h:1937
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:1920
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2147
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition: ExpList.h:1890
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
void Nektar::MultiRegions::DisContField1D::v_GetBoundaryToElmtMap ( Array< OneD, int > &  ElmtID,
Array< OneD, int > &  VertID 
)
protectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1394 of file DisContField1D.cpp.

References ASSERTL1, Nektar::MultiRegions::ExpList::GetExpSize(), m_bndCondExpansions, and m_bndConditions.

1396  {
1397  map<int, int> VertGID;
1398  int i,n,id;
1399  int bid,cnt,Vid;
1400  int nbcs = m_bndConditions.num_elements();
1401 
1402  // make sure arrays are of sufficient length
1403  if (ElmtID.num_elements() != nbcs)
1404  {
1405  ElmtID = Array<OneD, int>(nbcs,-1);
1406  }
1407  else
1408  {
1409  fill(ElmtID.get(), ElmtID.get()+nbcs, -1);
1410  }
1411 
1412  if (VertID.num_elements() != nbcs)
1413  {
1414  VertID = Array<OneD, int>(nbcs);
1415  }
1416 
1417  // setup map of all global ids along boundary
1418  for (cnt = n = 0; n < m_bndCondExpansions.num_elements(); ++n)
1419  {
1420  Vid = m_bndCondExpansions[n]->GetExp(0)->GetGeom()->GetVertex(0)->GetVid();
1421  VertGID[Vid] = cnt++;
1422  }
1423 
1424  // Loop over elements and find verts that match;
1426  for(cnt = n = 0; n < GetExpSize(); ++n)
1427  {
1428  exp = (*m_exp)[n];
1429  for(i = 0; i < exp->GetNverts(); ++i)
1430  {
1431  id = exp->GetGeom()->GetVid(i);
1432 
1433  if (VertGID.count(id) > 0)
1434  {
1435  bid = VertGID.find(id)->second;
1436  ASSERTL1(ElmtID[bid] == -1,"Edge already set");
1437  ElmtID[bid] = n;
1438  VertID[bid] = i;
1439  cnt ++;
1440  }
1441  }
1442  }
1443 
1444  ASSERTL1(cnt == nbcs,"Failed to visit all boundary condtiions");
1445  }
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
#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::DisContField1D::v_GetFwdBwdTracePhys ( Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
protectedvirtual

Generate the forward or backward state for each trace point.

Parameters
FwdForward state.
BwdBackward state.

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 860 of file DisContField1D.cpp.

References Nektar::MultiRegions::ExpList::m_phys.

862  {
863  v_GetFwdBwdTracePhys(m_phys,Fwd,Bwd);
864  }
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:956
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
void Nektar::MultiRegions::DisContField1D::v_GetFwdBwdTracePhys ( const Array< OneD, const NekDouble > &  field,
Array< OneD, NekDouble > &  Fwd,
Array< OneD, NekDouble > &  Bwd 
)
protectedvirtual

This method extracts the "forward" and "backward" trace data from the array field and puts the data into output vectors Fwd and Bwd.

We first define the convention which defines "forwards" and "backwards". First an association is made between the vertex of each element and its corresponding vertex in the trace space using the mapping m_traceMap. The element can either be left-adjacent or right-adjacent to this trace edge (see Expansion0D::GetLeftAdjacentElementExp). Boundary edges are never left-adjacent since elemental left-adjacency is populated first.

If the element is left-adjacent we extract the vertex trace data from field into the forward trace space Fwd; otherwise, we place it in the backwards trace space Bwd. In this way, we form a unique set of trace normals since these are always extracted from left-adjacent elements.

Parameters
fieldis a NekDouble array which contains the 1D data from which we wish to extract the backward and forward orientated trace/edge arrays.
FwdThe resulting forwards space.
BwdThe resulting backwards space.

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 893 of file DisContField1D.cpp.

References ASSERTL0, Nektar::SpatialDomains::eDirichlet, Nektar::SpatialDomains::eNeumann, Nektar::SpatialDomains::eNotDefined, Nektar::SpatialDomains::ePeriodic, Nektar::SpatialDomains::eRobin, Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::MultiRegions::ExpList::GetPhys(), Nektar::MultiRegions::ExpList::GetPhys_Offset(), m_bndCondExpansions, m_bndConditions, m_leftAdjacentVerts, m_periodicBwdCopy, m_periodicFwdCopy, m_trace, m_traceMap, and Vmath::Zero().

897  {
898  // Counter variables
899  int n, v;
900 
901  // Number of elements
902  int nElements = GetExpSize();
903 
904  // Initial index of each element
905  int phys_offset;
906 
907  Array<OneD, Array<OneD, LocalRegions::ExpansionSharedPtr> >
908  &elmtToTrace = m_traceMap->GetElmtToTrace();
909 
910  // Set forward and backard state to zero
911  Vmath::Zero(Fwd.num_elements(), Fwd, 1);
912  Vmath::Zero(Bwd.num_elements(), Bwd, 1);
913 
914  int cnt;
915 
916  // Loop on the elements
917  for (cnt = n = 0; n < nElements; ++n)
918  {
919  // Set the offset of each element
920  phys_offset = GetPhys_Offset(n);
921 
922  for(v = 0; v < 2; ++v, ++cnt)
923  {
924  int offset = m_trace->GetPhys_Offset(elmtToTrace[n][v]->GetElmtId());
925 
926  if (m_leftAdjacentVerts[cnt])
927  {
928  (*m_exp)[n]->GetVertexPhysVals(v, field + phys_offset,
929  Fwd[offset]);
930  }
931  else
932  {
933  (*m_exp)[n]->GetVertexPhysVals(v, field + phys_offset,
934  Bwd[offset]);
935  }
936  }
937  }
938 
939  // Fill boundary conditions into missing elements.
940  int id = 0;
941 
942  for(cnt = n = 0; n < m_bndCondExpansions.num_elements(); ++n)
943  {
944  if (m_bndConditions[n]->GetBoundaryConditionType() ==
946  {
947  id = m_trace->GetPhys_Offset(m_traceMap->GetBndCondTraceToGlobalTraceMap(cnt));
948  Bwd[id] = m_bndCondExpansions[n]->GetPhys()[0]; //this is not getting the correct value?
949  cnt++;
950  }
951  else if (m_bndConditions[n]->GetBoundaryConditionType() ==
953  m_bndConditions[n]->GetBoundaryConditionType() ==
955  {
956  ASSERTL0((m_bndCondExpansions[n]->GetPhys())[0]==0.0,
957  "Method not set up for non-zero Neumann "
958  "boundary condition");
959  id = m_trace->GetPhys_Offset(m_traceMap->GetBndCondTraceToGlobalTraceMap(cnt));
960  Bwd[id] = Fwd[id];
961 
962  cnt++;
963  }
964  else if (m_bndConditions[n]->GetBoundaryConditionType() ==
966  {
967  // Do nothing
968  }
969  else if (m_bndConditions[n]->GetBoundaryConditionType() !=
971  {
972  ASSERTL0(false,
973  "Method not set up for this boundary condition.");
974  }
975  }
976 
977  // Copy any periodic boundary conditions.
978  for (n = 0; n < m_periodicFwdCopy.size(); ++n)
979  {
980  Bwd[m_periodicBwdCopy[n]] = Fwd[m_periodicFwdCopy[n]];
981  }
982 
983  // Do parallel exchange for forwards/backwards spaces.
984  m_traceMap->UniversalTraceAssemble(Fwd);
985  m_traceMap->UniversalTraceAssemble(Bwd);
986 
987  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
Definition: ExpList.h:1937
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition: ExpList.h:1890
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
ExpListSharedPtr m_trace
Trace space storage for points between elements.
std::vector< int > m_periodicFwdCopy
A vector indicating degress of freedom which need to be copied from forwards to backwards space in ca...
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:359
map< int, RobinBCInfoSharedPtr > Nektar::MultiRegions::DisContField1D::v_GetRobinBCInfo ( void  )
protectedvirtual

Search through the edge expansions and identify which ones have Robin/Mixed type boundary conditions. If find a Robin boundary then store the edge id of the boundary condition and the array of points of the physical space boundary condition which are hold the boundary condition primitive variable coefficient at the quatrature points

Returns
std map containing the robin boundary condition info using a key of the element id

There is a next member to allow for more than one Robin boundary condition per element

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1519 of file DisContField1D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SpatialDomains::eRobin, Nektar::MultiRegions::ExpList::GetBoundaryToElmtMap(), m_bndCondExpansions, and m_bndConditions.

1520  {
1521  int i;
1522  map<int, RobinBCInfoSharedPtr> returnval;
1523  Array<OneD, int> ElmtID,VertID;
1524  GetBoundaryToElmtMap(ElmtID,VertID);
1525 
1526  for (i = 0; i < m_bndCondExpansions.num_elements(); ++i)
1527  {
1528  MultiRegions::ExpListSharedPtr locExpList;
1529 
1530  if (m_bndConditions[i]->GetBoundaryConditionType() ==
1532  {
1533  int elmtid;
1534  Array<OneD, NekDouble> Array_tmp;
1535 
1536  locExpList = m_bndCondExpansions[i];
1537 
1538  RobinBCInfoSharedPtr rInfo =
1541  VertID[i],Array_tmp = locExpList->GetPhys());
1542 
1543  elmtid = ElmtID[i];
1544  // make link list if necessary (not likely in
1545  // 1D but needed in 2D & 3D)
1546  if(returnval.count(elmtid) != 0)
1547  {
1548  rInfo->next = returnval.find(elmtid)->second;
1549  }
1550  returnval[elmtid] = rInfo;
1551  }
1552  }
1553 
1554  return returnval;
1555  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
boost::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Definition: ExpList.h:2147
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
virtual ExpListSharedPtr& Nektar::MultiRegions::DisContField1D::v_GetTrace ( )
inlineprotectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 164 of file DisContField1D.h.

References m_trace.

165  {
166  return m_trace;
167  }
ExpListSharedPtr m_trace
Trace space storage for points between elements.
virtual AssemblyMapDGSharedPtr& Nektar::MultiRegions::DisContField1D::v_GetTraceMap ( void  )
inlineprotectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 169 of file DisContField1D.h.

References m_traceMap.

170  {
171  return m_traceMap;
172  }
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
void Nektar::MultiRegions::DisContField1D::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 
)
protectedvirtual

Solve the Helmholtz equation.

Reimplemented from Nektar::MultiRegions::ExpList.

Reimplemented in Nektar::MultiRegions::ContField1D.

Definition at line 1196 of file DisContField1D.cpp.

References Nektar::SpatialDomains::eDirichlet, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::eWrapper, Nektar::MultiRegions::ExpList::GetBlockMatrix(), Nektar::MultiRegions::ExpList::GetExpSize(), GetGlobalBndLinSys(), Nektar::MultiRegions::ExpList::IProductWRTBase(), m_bndCondExpansions, m_bndConditions, Nektar::MultiRegions::ExpList::m_coeff_offset, Nektar::MultiRegions::ExpList::m_ncoeffs, m_traceMap, Vmath::Neg(), Nektar::MultiRegions::NullAssemblyMapSharedPtr, Nektar::Transpose(), and Vmath::Zero().

1203  {
1204  int i,n,cnt,nbndry;
1205  int nexp = GetExpSize();
1206  Array<OneD,NekDouble> f(m_ncoeffs);
1207  DNekVec F(m_ncoeffs,f,eWrapper);
1208  Array<OneD,NekDouble> e_f, e_l;
1209 
1210  //----------------------------------
1211  // Setup RHS Inner product
1212  //----------------------------------
1213  IProductWRTBase(inarray,f);
1214  Vmath::Neg(m_ncoeffs,f,1);
1215 
1216  //----------------------------------
1217  // Solve continuous Boundary System
1218  //----------------------------------
1219  int GloBndDofs = m_traceMap->GetNumGlobalBndCoeffs();
1220  int NumDirBCs = m_traceMap->GetNumLocalDirBndCoeffs();
1221  int e_ncoeffs,id;
1222 
1223  GlobalMatrixKey HDGLamToUKey(
1226  factors,
1227  varcoeff);
1228 
1229  const DNekScalBlkMatSharedPtr &HDGLamToU =
1230  GetBlockMatrix(HDGLamToUKey);
1231 
1232  // Retrieve global trace space storage, \Lambda, from trace expansion
1233  Array<OneD,NekDouble> BndSol = Array<OneD,NekDouble>
1234  (m_traceMap->GetNumLocalBndCoeffs());
1235 
1236 
1237  Array<OneD,NekDouble> BndRhs(GloBndDofs,0.0);
1238  // Zero trace space
1239  Vmath::Zero(GloBndDofs,BndSol,1);
1240 
1241  int LocBndCoeffs = m_traceMap->GetNumLocalBndCoeffs();
1242  Array<OneD, NekDouble> loc_lambda(LocBndCoeffs);
1243  DNekVec LocLambda(LocBndCoeffs,loc_lambda,eWrapper);
1244 
1245  //----------------------------------
1246  // Evaluate Trace Forcing
1247  //----------------------------------
1248  // Determing <u_lam,f> terms using HDGLamToU matrix
1249  for (cnt = n = 0; n < nexp; ++n)
1250  {
1251  nbndry = (*m_exp)[n]->NumDGBndryCoeffs();
1252 
1253  e_ncoeffs = (*m_exp)[n]->GetNcoeffs();
1254  e_f = f+m_coeff_offset[n];
1255  e_l = loc_lambda + cnt;
1256 
1257  // use outarray as tmp space
1258  DNekVec Floc (nbndry, e_l, eWrapper);
1259  DNekVec ElmtFce (e_ncoeffs, e_f, eWrapper);
1260  Floc = Transpose(*(HDGLamToU->GetBlock(n,n)))*ElmtFce;
1261 
1262  cnt += nbndry;
1263  }
1264 
1265  // Assemble into global operator
1266  m_traceMap->AssembleBnd(loc_lambda,BndRhs);
1267 
1268  cnt = 0;
1269  // Copy Dirichlet boundary conditions into trace space
1270  for (i = 0; i < m_bndCondExpansions.num_elements(); ++i)
1271  {
1272  if (m_bndConditions[i]->GetBoundaryConditionType() ==
1274  {
1275  id = m_traceMap->GetBndCondCoeffsToGlobalCoeffsMap(i);
1276  BndSol[id] = m_bndCondExpansions[i]->GetCoeff(0);
1277  }
1278  else
1279  {
1280  id = m_traceMap->GetBndCondCoeffsToGlobalCoeffsMap(i);
1281  BndRhs[id] += m_bndCondExpansions[i]->GetCoeff(0);
1282  }
1283  }
1284 
1285  //----------------------------------
1286  // Solve trace problem
1287  //----------------------------------
1288  if (GloBndDofs - NumDirBCs > 0)
1289  {
1290  GlobalLinSysKey key(StdRegions::eHybridDGHelmBndLam,
1291  m_traceMap,factors);
1293  LinSys->Solve(BndRhs,BndSol,m_traceMap);
1294  }
1295 
1296  //----------------------------------
1297  // Internal element solves
1298  //----------------------------------
1299  GlobalMatrixKey invHDGhelmkey(StdRegions::eInvHybridDGHelmholtz,
1301  factors);
1302 
1303  const DNekScalBlkMatSharedPtr& InvHDGHelm =
1304  GetBlockMatrix(invHDGhelmkey);
1305  DNekVec out(m_ncoeffs,outarray,eWrapper);
1306  Vmath::Zero(m_ncoeffs,outarray,1);
1307 
1308  // get local trace solution from BndSol
1309  m_traceMap->GlobalToLocalBnd(BndSol,loc_lambda);
1310 
1311  // out = u_f + u_lam = (*InvHDGHelm)*f + (LamtoU)*Lam
1312  out = (*InvHDGHelm)*F + (*HDGLamToU)*LocLambda;
1313  }
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
Definition: ExpList.cpp:814
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:1899
GlobalLinSysSharedPtr GetGlobalBndLinSys(const GlobalLinSysKey &mkey)
For a given key, returns the associated global linear system.
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Definition: ExpList.h:988
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
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
AssemblyMapDGSharedPtr m_traceMap
Local to global DG mapping for trace space.
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:382
static AssemblyMapSharedPtr NullAssemblyMapSharedPtr
Definition: AssemblyMap.h:55
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:49
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1562
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:52
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:359
void Nektar::MultiRegions::DisContField1D::v_Reset ( )
protectedvirtual

Reset this field, so that geometry information can be updated.

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 1494 of file DisContField1D.cpp.

References m_bndCondExpansions, and Nektar::MultiRegions::ExpList::v_Reset().

1495  {
1496  ExpList::v_Reset();
1497 
1498  // Reset boundary condition expansions.
1499  for (int n = 0; n < m_bndCondExpansions.num_elements(); ++n)
1500  {
1501  m_bndCondExpansions[n]->Reset();
1502  }
1503  }
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Definition: ExpList.cpp:1437
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
virtual MultiRegions::ExpListSharedPtr& Nektar::MultiRegions::DisContField1D::v_UpdateBndCondExpansion ( int  i)
inlineprotectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 230 of file DisContField1D.h.

231  {
232  return m_bndCondExpansions[i];
233  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
Discretised boundary conditions.
virtual Array<OneD, SpatialDomains::BoundaryConditionShPtr>& Nektar::MultiRegions::DisContField1D::v_UpdateBndConditions ( )
inlineprotectedvirtual

Reimplemented from Nektar::MultiRegions::ExpList.

Definition at line 236 of file DisContField1D.h.

References m_bndConditions.

237  {
238  return m_bndConditions;
239  }
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...

Member Data Documentation

Array<OneD,MultiRegions::ExpListSharedPtr> Nektar::MultiRegions::DisContField1D::m_bndCondExpansions
protected
Array<OneD,SpatialDomains::BoundaryConditionShPtr> Nektar::MultiRegions::DisContField1D::m_bndConditions
protected
std::set<int> Nektar::MultiRegions::DisContField1D::m_boundaryVerts
protected

A set storing the global IDs of any boundary edges.

Definition at line 128 of file DisContField1D.h.

Referenced by IsLeftAdjacentVertex(), and SetUpDG().

GlobalLinSysMapShPtr Nektar::MultiRegions::DisContField1D::m_globalBndMat
protected

Global boundary matrix.

Definition at line 117 of file DisContField1D.h.

Referenced by GetGlobalBndLinSys(), and SetUpDG().

std::vector<bool> Nektar::MultiRegions::DisContField1D::m_leftAdjacentVerts
protected

Definition at line 150 of file DisContField1D.h.

Referenced by SetUpDG(), and v_GetFwdBwdTracePhys().

std::vector<bool> Nektar::MultiRegions::DisContField1D::m_negatedFluxNormal
private

Definition at line 268 of file DisContField1D.h.

Referenced by GetNegatedFluxNormal().

int Nektar::MultiRegions::DisContField1D::m_numDirBndCondExpansions
protected

The number of boundary segments on which Dirichlet boundary conditions are imposed.

Definition at line 102 of file DisContField1D.h.

std::vector<int> Nektar::MultiRegions::DisContField1D::m_periodicBwdCopy
protected

Definition at line 143 of file DisContField1D.h.

Referenced by SetUpDG(), and v_GetFwdBwdTracePhys().

std::vector<int> Nektar::MultiRegions::DisContField1D::m_periodicFwdCopy
protected

A vector indicating degress of freedom which need to be copied from forwards to backwards space in case of a periodic boundary condition.

Definition at line 142 of file DisContField1D.h.

Referenced by SetUpDG(), and v_GetFwdBwdTracePhys().

PeriodicMap Nektar::MultiRegions::DisContField1D::m_periodicVerts
protected

A map which identifies groups of periodic vertices.

Definition at line 134 of file DisContField1D.h.

Referenced by Nektar::MultiRegions::ContField1D::ContField1D(), FindPeriodicVertices(), IsLeftAdjacentVertex(), and SetUpDG().

ExpListSharedPtr Nektar::MultiRegions::DisContField1D::m_trace
protected

Trace space storage for points between elements.

Definition at line 120 of file DisContField1D.h.

Referenced by IsLeftAdjacentVertex(), SetUpDG(), v_ExtractTracePhys(), v_GetFwdBwdTracePhys(), and v_GetTrace().

AssemblyMapDGSharedPtr Nektar::MultiRegions::DisContField1D::m_traceMap
protected