52 "Direct static condensation.");
57 "Direct multi-level static condensation.");
80 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
87 "This constructor is only valid when using static "
90 pLocToGloMap->GetGlobalSysSolnType(),
91 "The local to global map is not set up for the requested "
103 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
124 int nBndDofs = pLocToGloMap->GetNumGlobalBndCoeffs();
125 int NumDirBCs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
126 unsigned int rows = nBndDofs - NumDirBCs;
127 int bwidth = pLocToGloMap->GetBndSystemBandWidth();
139 if ((2 * (bwidth + 1)) < rows)
173 int i, j, n, cnt, gid1, gid2;
176 int nBndDofs = pLocToGloMap->GetNumGlobalBndCoeffs();
177 int NumDirBCs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
184 unsigned int rows = nBndDofs - NumDirBCs;
185 unsigned int cols = nBndDofs - NumDirBCs;
188 int bwidth = pLocToGloMap->GetBndSystemBandWidth();
199 rows, cols, 0.0, matStorage, bwidth, bwidth);
204 "Insufficient memory for GlobalLinSys.");
220 "Unknown matrix storage type of type not set up");
227 for (n = cnt = 0; n < SchurCompl->GetNumberOfBlockRows(); ++n)
229 loc_mat = SchurCompl->GetBlock(n, n);
230 loc_lda = loc_mat->GetRows();
233 for (i = 0; i < loc_lda; ++i)
235 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + i) - NumDirBCs;
236 sign1 = pLocToGloMap->GetLocalToGlobalBndSign(cnt + i);
240 for (j = 0; j < loc_lda; ++j)
242 gid2 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + j) -
244 sign2 = pLocToGloMap->GetLocalToGlobalBndSign(cnt + j);
252 if ((matStorage ==
eFULL) || (gid2 >= gid1))
254 value = Gmat->GetValue(gid1, gid2) +
255 sign1 * sign2 * (*loc_mat)(i, j);
256 Gmat->SetValue(gid1, gid2, value);
277 const std::shared_ptr<AssemblyMap> &l2gMap)
281 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
282 sys->Initialise(l2gMap);
295 pLocToGloMap->AssembleBnd(pInput, tmp);
297 const int nHomDofs = pNumRows - pNumDir;
298 DNekVec Vin(nHomDofs, tmp + pNumDir);
305 pLocToGloMap->GlobalToLocalBnd(global, pOutput);
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
DNekLinSysSharedPtr m_linSys
Basic linear system object.
~GlobalLinSysDirectStaticCond() override
static GlobalLinSysSharedPtr create(const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
static std::string className2
GlobalLinSysDirectStaticCond(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.
MatrixStorage DetermineMatrixStorage(const std::shared_ptr< AssemblyMap > &locToGloMap)
Matrix Storage type for known matrices.
static std::string className
Name of class.
GlobalLinSysStaticCondSharedPtr v_Recurse(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const std::shared_ptr< AssemblyMap > &l2gMap) override
void v_SolveLinearSystem(const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) override
Solve the linear system for given input and output vectors.
void v_AssembleSchurComplement(std::shared_ptr< AssemblyMap > pLocToGloMap) override
const GlobalLinSysKey m_linSysKey
Key associated with this linear system.
Describe a linear system.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
DNekScalBlkMatSharedPtr m_schurCompl
Block Schur complement matrix.
DNekScalBlkMatSharedPtr m_BinvD
Block matrix.
DNekScalBlkMatSharedPtr m_C
Block matrix.
DNekScalBlkMatSharedPtr m_invD
Block matrix.
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
@ eDirectMultiLevelStaticCond
std::shared_ptr< GlobalLinSysDirectStaticCond > GlobalLinSysDirectStaticCondSharedPtr
std::shared_ptr< GlobalLinSysStaticCond > GlobalLinSysStaticCondSharedPtr
GlobalLinSysFactory & GetGlobalLinSysFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
@ eLinearAdvectionReaction
@ eLinearAdvectionDiffusionReaction
std::vector< double > w(NPUPPER)
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC
std::shared_ptr< DNekMat > DNekMatSharedPtr
PointerWrapper
Specifies if the pointer passed to a NekMatrix or NekVector is copied into an internal representation...