55 "Iterative static condensation.");
60 "Xxt multi-level static condensation.");
83 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
90 "This constructor is only valid when using static "
93 pLocToGloMap->GetGlobalSysSolnType(),
94 "The local to global map is not set up for the requested "
106 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
131 std::shared_ptr<AssemblyMap> pLocToGloMap)
134 unsigned int nElmt =
m_schurCompl->GetNumberOfBlockRows();
136 unsigned int iCount = 0;
137 unsigned int rCount = 0;
138 unsigned int nRows = 0;
139 unsigned int nEntries = 0;
140 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
141 unsigned int nLocal = pLocToGloMap->GetNumLocalBndCoeffs();
143 pLocToGloMap->GetLocalToGlobalBndSign();
144 bool doSign = pLocToGloMap->GetSignChange();
145 unsigned int i = 0, j = 0, k = 0, n = 0;
151 for (n = 0; n < nElmt; ++n)
154 vSizes[n] = loc_mat->GetRows();
155 nEntries += vSizes[n] * vSizes[n];
168 for (n = iCount = 0; n < nElmt; ++n)
171 nRows = loc_mat->GetRows();
173 for (i = 0; i < nRows; ++i)
175 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(iCount + i);
176 for (j = 0; j < nRows; ++j)
178 k = rCount + i * vSizes[n] + j;
179 m_Ai[k] = iCount + i;
180 m_Aj[k] = iCount + j;
181 m_Ar[k] = (*loc_mat)(i, j);
184 m_Ar[k] *= vMapSign[iCount + i] * vMapSign[iCount + j];
190 if (gid1 < numDirBnd)
197 pLocToGloMap->GetGlobalToUniversalBndMap()[gid1];
201 rCount += vSizes[n] * vSizes[n];
218 const std::shared_ptr<AssemblyMap> &l2gMap)
222 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
223 sys->Initialise(l2gMap);
229 [[maybe_unused]]
const int pNumRows,
232 [[maybe_unused]]
const int pNumDir)
234 int nLocal = pLocToGloMap->GetLocalToGlobalBndSign().size();
237 if (pLocToGloMap->GetSignChange())
240 Vmath::Vmul(nLocal, pLocToGloMap->GetLocalToGlobalBndSign(), 1, pInput,
245 Vmath::Vmul(nLocal, pLocToGloMap->GetLocalToGlobalBndSign(), 1, pOutput,
#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.
const std::weak_ptr< ExpList > m_expList
Local Matrix System.
Describe a linear system.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
DNekScalBlkMatSharedPtr m_schurCompl
Block Schur complement matrix.
std::weak_ptr< AssemblyMap > m_locToGloMap
Local to global map.
DNekScalBlkMatSharedPtr m_BinvD
Block matrix.
DNekScalBlkMatSharedPtr m_C
Block matrix.
DNekScalBlkMatSharedPtr m_invD
Block matrix.
Array< OneD, double > m_Ar
Array< OneD, unsigned int > m_Aj
Array< OneD, unsigned int > m_Ai
struct Xxt::crs_data * m_crsData
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.
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 > &locToGloMap) override
GlobalLinSysXxtStaticCond(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.
void v_AssembleSchurComplement(std::shared_ptr< AssemblyMap > locToGloMap) override
Assemble the Schur complement matrix.
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 className
Name of class.
static std::string className2
~GlobalLinSysXxtStaticCond() override
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
@ eXxtMultiLevelStaticCond
std::shared_ptr< GlobalLinSysXxtStaticCond > GlobalLinSysXxtStaticCondSharedPtr
std::shared_ptr< GlobalLinSysStaticCond > GlobalLinSysStaticCondSharedPtr
GlobalLinSysFactory & GetGlobalLinSysFactory()
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Zero(int n, T *x, const int incx)
Zero vector.
void nektar_crs_stats(struct crs_data *data)
static struct crs_data * Init(unsigned int pRank, const Nektar::Array< OneD, unsigned long > pId, const Nektar::Array< OneD, unsigned int > pAi, const Nektar::Array< OneD, unsigned int > pAj, const Nektar::Array< OneD, NekDouble > pAr, const LibUtilities::CommSharedPtr &pComm)
Initialise the matrix-solve.
static void Solve(Nektar::Array< OneD, NekDouble > pX, struct crs_data *pCrs, Nektar::Array< OneD, NekDouble > pB)
Solve the matrix system for a given input vector b.