57 "Iterative static condensation.");
62 "Xxt multi-level static condensation.");
85 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
92 "This constructor is only valid when using static "
95 pLocToGloMap->GetGlobalSysSolnType(),
96 "The local to global map is not set up for the requested "
108 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
133 std::shared_ptr<AssemblyMap> pLocToGloMap)
136 unsigned int nElmt =
m_schurCompl->GetNumberOfBlockRows();
138 unsigned int iCount = 0;
139 unsigned int rCount = 0;
140 unsigned int nRows = 0;
141 unsigned int nEntries = 0;
142 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
143 unsigned int nLocal = pLocToGloMap->GetNumLocalBndCoeffs();
145 pLocToGloMap->GetLocalToGlobalBndSign();
146 bool doSign = pLocToGloMap->GetSignChange();
147 unsigned int i = 0, j = 0, k = 0, n = 0;
153 for (n = 0; n < nElmt; ++n)
156 vSizes[n] = loc_mat->GetRows();
157 nEntries += vSizes[n] * vSizes[n];
170 for (n = iCount = 0; n < nElmt; ++n)
173 nRows = loc_mat->GetRows();
175 for (i = 0; i < nRows; ++i)
177 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(iCount + i);
178 for (j = 0; j < nRows; ++j)
180 k = rCount + i * vSizes[n] + j;
181 m_Ai[k] = iCount + i;
182 m_Aj[k] = iCount + j;
183 m_Ar[k] = (*loc_mat)(i, j);
186 m_Ar[k] *= vMapSign[iCount + i] * vMapSign[iCount + j];
192 if (gid1 < numDirBnd)
199 pLocToGloMap->GetGlobalToUniversalBndMap()[gid1];
203 rCount += vSizes[n] * vSizes[n];
220 const std::shared_ptr<AssemblyMap> &l2gMap)
224 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
225 sys->Initialise(l2gMap);
235 boost::ignore_unused(pNumRows, pNumDir);
237 int nLocal = pLocToGloMap->GetLocalToGlobalBndSign().size();
240 if (pLocToGloMap->GetSignChange())
243 Vmath::Vmul(nLocal, pLocToGloMap->GetLocalToGlobalBndSign(), 1, pInput,
248 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
virtual 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.
virtual 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.
virtual 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
virtual ~GlobalLinSysXxtStaticCond()
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
The above copyright notice and this permission notice shall be included.
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.