43 namespace MultiRegions
55 string GlobalLinSysXxtStaticCond::className =
57 "XxtStaticCond", GlobalLinSysXxtStaticCond::create,
58 "Iterative static condensation.");
60 string GlobalLinSysXxtStaticCond::className2 =
62 "XxtMultiLevelStaticCond", GlobalLinSysXxtStaticCond::create,
63 "Xxt multi-level static condensation.");
84 GlobalLinSysXxtStaticCond::GlobalLinSysXxtStaticCond(
86 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
93 "This constructor is only valid when using static "
96 pLocToGloMap->GetGlobalSysSolnType(),
97 "The local to global map is not set up for the requested "
109 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
133 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
136 unsigned int nGlo = pLocToGloMap->GetNumGlobalBndCoeffs();
137 unsigned int nEntries = pLocToGloMap->GetNumLocalBndCoeffs();
142 for (i = 0; i < nEntries; ++i)
144 vCounts[vMap[i]] += 1.0;
148 pLocToGloMap->UniversalAssembleBnd(vCounts);
152 for (i = 0; i < nEntries; ++i)
157 m_map = pLocToGloMap->GetLocalToGlobalBndMap();
166 std::shared_ptr<AssemblyMap> pLocToGloMap)
171 unsigned int nElmt =
m_schurCompl->GetNumberOfBlockRows();
173 unsigned int iCount = 0;
174 unsigned int rCount = 0;
175 unsigned int nRows = 0;
176 unsigned int nEntries = 0;
177 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
178 unsigned int nLocal = pLocToGloMap->GetNumLocalBndCoeffs();
180 pLocToGloMap->GetLocalToGlobalBndSign();
181 bool doSign = pLocToGloMap->GetSignChange();
182 unsigned int i = 0, j = 0, k = 0, n = 0;
188 for (n = 0; n < nElmt; ++n)
191 vSizes[n] = loc_mat->GetRows();
192 nEntries += vSizes[n] * vSizes[n];
205 for (n = iCount = 0; n < nElmt; ++n)
208 nRows = loc_mat->GetRows();
210 for (i = 0; i < nRows; ++i)
212 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(iCount + i);
213 for (j = 0; j < nRows; ++j)
215 k = rCount + i * vSizes[n] + j;
216 m_Ai[k] = iCount + i;
217 m_Aj[k] = iCount + j;
218 m_Ar[k] = (*loc_mat)(i, j);
221 m_Ar[k] *= vMapSign[iCount + i] * vMapSign[iCount + j];
227 if (gid1 < numDirBnd)
234 pLocToGloMap->GetGlobalToUniversalBndMap()[gid1];
238 rCount += vSizes[n] * vSizes[n];
255 const std::shared_ptr<AssemblyMap> &l2gMap)
259 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
260 sys->Initialise(l2gMap);
#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, NekDouble > m_locToGloSignMult
Array< OneD, double > m_Ar
Array< OneD, unsigned int > m_Aj
Array< OneD, unsigned int > m_Ai
struct Xxt::crs_data * m_crsData
void CreateMap(const std::shared_ptr< AssemblyMap > &pLocToGloMap)
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.
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.
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
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.