43 namespace MultiRegions
88 ContField2D::ContField2D():
92 m_globalLinSysManager(
93 boost::bind(&
ContField2D::GenGlobalLinSys, this, _1),
94 std::string(
"GlobalLinSys"))
123 const std::string &variable,
124 const bool DeclareCoeffPhysArrays,
125 const bool CheckIfSingularSystem,
127 DisContField2D(pSession,graph2D,variable,false,DeclareCoeffPhysArrays,ImpType),
129 m_globalLinSysManager(
130 boost::bind(&
ContField2D::GenGlobalLinSys, this, _1),
131 std::string(
"GlobalLinSys"))
137 CheckIfSingularSystem,
142 if (
m_session->DefinesCmdLineArgument(
"verbose"))
174 const std::string &variable,
175 bool DeclareCoeffPhysArrays,
176 const bool CheckIfSingularSystem):
179 m_globalLinSysManager(
180 boost::bind(&
ContField2D::GenGlobalLinSys, this, _1),
181 std::string(
"GlobalLinSys"))
189 CheckIfSingularSystem,
194 if (
m_session->DefinesCmdLineArgument(
"verbose"))
214 m_locToGloMap(In.m_locToGloMap),
215 m_globalMat(In.m_globalMat),
216 m_globalLinSysManager(In.m_globalLinSysManager)
308 if(inarray.data() == outarray.data())
323 if(inarray.data() == outarray.data())
413 ->GetBndCondCoeffsToGlobalCoeffsMap(bndcnt++)]
479 Gmat->EigenSolve(Real,Imag,Evecs);
550 if(contNcoeffs - NumDirBcs > 0)
569 "To use method must have a AssemblyMap "
578 (*m_globalMat)[mkey] = glo_matrix;
582 glo_matrix = matrixIter->second;
607 "To use method must have a AssemblyMap "
621 BwdTrans(inarray,outarray,coeffstate);
633 FwdTrans(inarray,outarray,coeffstate);
657 map<int, vector<ExtraDirDof> > &extraDirDofs =
660 for (it = extraDirDofs.begin(); it != extraDirDofs.end(); ++it)
662 for (i = 0; i < it->second.size(); ++i)
664 tmp[it->second.at(i).get<1>()] =
666 it->second.at(i).get<0>()]*it->second.at(i).get<2>();
683 tmp[bndMap[bndcnt++]] = sign * coeffs[j];
712 sign =
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
713 coeffs[j] = sign * tmp[bndMap[bndcnt++]];
730 "nreg is out or range since this many boundary "
731 "regions to not exist");
736 for(
int j = 0; j < nreg; ++j)
743 sign =
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
744 coeffs[j] = sign * tmp[bndMap[bndcnt++]];
878 const bool PhysSpaceForcing)
911 ->GetBndCondCoeffsToGlobalCoeffsMap(bndcnt++)]
924 Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
972 mat->Multiply(inarray,outarray);
1028 ->GetBndCondCoeffsToGlobalCoeffsMap(bndcnt++)]
1039 Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Template method virtual forwarder for FwdTrans().
boost::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
void LaplaceSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const Array< OneD, Array< OneD, NekDouble > > &variablecoeffs=NullNekDoubleArrayofArray, NekDouble time=0.0, CoeffState coeffstate=eLocal)
Solves the two-dimensional Laplace equation, subject to the boundary conditions specified.
void LocalToGlobal(bool useComm=true)
Gathers the global coefficients from the local coefficients .
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_FillBndCondFromField()
AssemblyMapCGSharedPtr m_locToGloMap
(A shared pointer to) the object which contains all the required information for the transformation f...
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Performs the global forward transformation of a function , subject to the boundary conditions specifi...
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
#define sign(a, b)
return the sign(b)*a
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
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)
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions()
Returns the boundary conditions.
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose the Dirichlet Boundary Conditions on outarray.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
GlobalLinSysSharedPtr GenGlobalLinSys(const GlobalLinSysKey &mkey)
boost::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Performs the backward transformation of the spectral/hp element expansion.
PeriodicMap m_periodicEdges
A map which identifies pairs of periodic edges.
std::map< ConstFactorType, NekDouble > ConstFactorMap
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
boost::shared_ptr< DNekMat > DNekMatSharedPtr
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > m_globalLinSysManager
A manager which collects all the global linear systems being assembled, such that they should be cons...
boost::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool useComm)
Gathers the global coefficients from the local coefficients .
bool SameTypeOfBoundaryConditions(const DisContField2D &In)
bool isSet(const FlagType &key) const
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
boost::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Template method virtual forwarder for FwdTrans().
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Template method virtual forwarded for SmoothField().
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
GlobalMatrixMapShPtr m_globalMat
(A shared pointer to) a list which collects all the global matrices being assembled, such that they should be constructed only once.
void GlobalSolve(const GlobalLinSysKey &key, const Array< OneD, const NekDouble > &rhs, Array< OneD, NekDouble > &inout, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solves the linear system specified by the key key.
GlobalMatrixSharedPtr GetGlobalMatrix(const GlobalMatrixKey &mkey)
Returns the global matrix specified by mkey.
virtual ~ContField2D()
The default destructor.
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Calculates the result of the multiplication of a global matrix of type specified by mkey with a vecto...
LibUtilities::SessionReaderSharedPtr m_session
Session.
ContField2D()
The default constructor.
void Neg(int n, T *x, const int incx)
Negate x = -x.
virtual void v_GlobalToLocal(void)
void Assemble()
Assembles the global coefficients from the local coefficients .
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
Template method virtual forwarder for GetBndConditions().
Describe a linear system.
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Calculates the inner product of a function with respect to all global expansion modes ...
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
Describes a matrix with ordering defined by a local to global map.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
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, const bool PhysSpaceForcing)
Solves the two-dimensional Helmholtz equation, subject to the boundary conditions specified...
bool LocToGloMapIsDefined() const
Returns true if a local to global map is defined.
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Template method virtual forwarder for MultiplyByInvMassMatrix().
void MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Multiply a solution by the inverse mass matrix.
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
GlobalLinSysSharedPtr GetGlobalLinSys(const GlobalLinSysKey &mkey)
Returns the linear system specified by the key mkey.
void LinearAdvectionEigs(const NekDouble ax, const NekDouble ay, Array< OneD, NekDouble > &Real, Array< OneD, NekDouble > &Imag, Array< OneD, NekDouble > &Evecs=NullNekDouble1DArray)
Compute the eigenvalues of the linear advection operator.
virtual void v_ClearGlobalLinSysManager(void)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
void GlobalToLocal(void)
Scatters from the global coefficients to the local coefficients .
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
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)