89 m_globalLinSysManager(
91 std::string(
"GlobalLinSys")),
119 const std::string &variable,
120 const bool DeclareCoeffPhysArrays,
121 const bool CheckIfSingularSystem,
123 :
DisContField(pSession, graph, variable, false, DeclareCoeffPhysArrays,
126 m_globalLinSysManager(
128 std::string(
"GlobalLinSys"))
135 if (
m_session->DefinesCmdLineArgument(
"verbose"))
166 const std::string &variable,
bool DeclareCoeffPhysArrays,
167 const bool CheckIfSingularSystem)
168 :
DisContField(In, graph, variable, false, DeclareCoeffPhysArrays),
170 m_globalLinSysManager(
172 std::string(
"GlobalLinSys")),
173 m_GJPData(In.m_GJPData)
182 if (
m_session->DefinesCmdLineArgument(
"verbose"))
200 :
DisContField(In, DeclareCoeffPhysArrays), m_locToGloMap(In.m_locToGloMap),
201 m_globalMat(In.m_globalMat),
202 m_globalLinSysManager(In.m_globalLinSysManager), m_GJPData(In.m_GJPData)
215 m_globalLinSysManager(
217 std::string(
"GlobalLinSys"))
375 wsp[map[bndcnt + j]] +=
sign[bndcnt + j] * bndcoeff[j];
382 wsp[map[bndcnt + j]] += bndcoeff[bndcnt + j];
438 Gmat->EigenSolve(Real, Imag, Evecs);
500 if (contNcoeffs - NumDirBcs > 0)
517 "To use method must have a AssemblyMap "
526 (*m_globalMat)[mkey] = glo_matrix;
530 glo_matrix = matrixIter->second;
552 "To use method must have a AssemblyMap "
580 outarray[map[bndcnt + j]] =
sign[bndcnt + j] * bndcoeff[j];
587 outarray[map[bndcnt + j]] = bndcoeff[j];
596 set<int> &ParallelDirBndSign =
m_locToGloMap->GetParallelDirBndSign();
598 for (
auto &it : ParallelDirBndSign)
605 for (
auto &it : ParallelDirBndSign)
610 set<ExtraDirDof> ©LocalDirDofs =
m_locToGloMap->GetCopyLocalDirDofs();
611 for (
auto &it : copyLocalDirDofs)
613 outarray[std::get<0>(it)] = outarray[std::get<1>(it)] * std::get<2>(it);
635 bcoeffs[j] =
sign[bndcnt + j] * coeffs[bndmap[bndcnt + j]];
642 bcoeffs[j] = coeffs[bndmap[bndcnt + j]];
656 "nreg is out or range since this many boundary "
657 "regions to not exist");
667 for (
int j = 0; j < nreg; ++j)
676 bcoeffs[j] =
sign[bndcnt + j] * coeffs[bndmap[bndcnt + j]];
683 bcoeffs[j] = coeffs[bndmap[bndcnt + j]];
811 if (PhysSpaceForcing)
844 wsp[map[bndcnt + j]] +=
sign[bndcnt + j] * bndcoeff[j];
851 wsp[map[bndcnt + j]] += bndcoeff[j];
948 if (PhysSpaceForcing)
983 wsp[map[bndcnt + j]] +=
sign[bndcnt + j] * bndcoeff[j];
990 wsp[map[bndcnt + j]] += bndcoeff[j];
1087 if (PhysSpaceForcing)
1122 wsp[map[bndcnt + j]] +=
sign[bndcnt + j] * bndcoeff[j];
1129 wsp[map[bndcnt + j]] += bndcoeff[j];
1158 ASSERTL0(
false,
"SemiImplicit GJPStabilisation not implemented for "
1159 "LinearAdvectionReactionSolve().")
1230 bool clearLocalMatrices)
1236 for (
int n = 0; n <
m_exp->size(); ++n)
1238 LinSys->DropStaticCondBlock(n);
1240 if (clearLocalMatrices)
1242 LinSys->DropBlock(n);
1271 outarray[map[bndcnt + j]] +=
sign[bndcnt + j] * bndcoeff[j];
1278 outarray[map[bndcnt + j]] += bndcoeff[j];
1308 outarray[map[bndcnt + j]] +=
sign[bndcnt + j] * bndcoeff[j];
1315 outarray[map[bndcnt + j]] += bndcoeff[j];
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define sign(a, b)
return the sign(b)*a
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
~ContField() override
The default destructor.
void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs) override
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > m_globalLinSysManager
A manager which collects all the global linear systems being assembled, such that they should be cons...
void v_ImposeRobinConditions(Array< OneD, NekDouble > &outarray) override
Add Robin Boundary Conditions forcing to outarray.
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)
Solves the two-dimensional Laplace equation, subject to the boundary conditions specified.
GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const StdRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing) override
GlobalLinSysSharedPtr GenGlobalLinSys(const GlobalLinSysKey &mkey)
AssemblyMapCGSharedPtr m_locToGloMap
(A shared pointer to) the object which contains all the required information for the transformation f...
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Template method virtual forwarder for FwdTrans().
int v_GetPoolCount(std::string) override
void v_SmoothField(Array< OneD, NekDouble > &field) override
Template method virtual forwarded for SmoothField().
GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const StdRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing) override
Solves the two-dimensional Helmholtz equation, subject to the boundary conditions specified.
void v_ClearGlobalLinSysManager(void) override
void v_GlobalToLocal(void) override
void v_UnsetGlobalLinSys(GlobalLinSysKey, bool) override
void v_LocalToGlobal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool useComm) override
Gathers the global coefficients from the local coefficients .
GlobalLinSysKey v_LinearAdvectionReactionSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const StdRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing) override
void v_ImposeNeumannConditions(Array< OneD, NekDouble > &outarray) override
Add Neumann Boundary Conditions forcing to outarray.
GlobalMatrixMapShPtr m_globalMat
(A shared pointer to) a list which collects all the global matrices being assembled,...
void v_AvgAssemble(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool useComm) override
Assembly and average of the global coefficients from the local coefficients .
GlobalLinSysSharedPtr GetGlobalLinSys(const GlobalLinSysKey &mkey)
Returns the linear system specified by the key mkey.
void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray) override
Impose the Dirichlet Boundary Conditions on outarray.
void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Template method virtual forwarder for MultiplyByInvMassMatrix().
GlobalMatrixSharedPtr GetGlobalMatrix(const GlobalMatrixKey &mkey)
Returns the global matrix specified by mkey.
ContField()
The default constructor.
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.
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.
GJPStabilisationSharedPtr m_GJPData
Data for Gradient Jump Penalisation (GJP) stabilisaiton.
This class is the abstractio n of a global discontinuous two- dimensional spectral/hp element expansi...
PeriodicMap m_periodicEdges
A map which identifies pairs of periodic edges.
PeriodicMap m_periodicFaces
A map which identifies pairs of periodic faces.
bool SameTypeOfBoundaryConditions(const DisContField &In)
Check to see if expansion has the same BCs as In.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition structure definition on the diff...
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
Base class for all multi-elemental spectral/hp expansions.
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all local expansion modes .
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
std::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
std::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
LibUtilities::SessionReaderSharedPtr m_session
Session.
void MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the backward transformation of the global spectral/hp element exp...
std::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
Describe a linear system.
Describes a matrix with ordering defined by a local to global map.
bool LocToGloMapIsDefined() const
Returns true if a local to global map is defined.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
std::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
@ eLinearAdvectionReaction
@ eLinearAdvectionDiffusionReaction
@ eLinearAdvectionDiffusionReactionGJP
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Neg(int n, T *x, const int incx)
Negate x = -x.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.