43 namespace MultiRegions
59 "Iterative static condensation.");
63 "XxtMultiLevelStaticCond",
65 "Xxt multi-level static condensation.");
88 const boost::weak_ptr<ExpList> &pExpList,
89 const boost::shared_ptr<AssemblyMap>
97 "This constructor is only valid when using static "
100 == pLocToGloMap->GetGlobalSysSolnType(),
101 "The local to global map is not set up for the requested "
111 const boost::weak_ptr<ExpList> &pExpList,
116 const boost::shared_ptr<AssemblyMap>
143 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
146 = pLocToGloMap->GetLocalToGlobalBndMap();
147 unsigned int nGlo = pLocToGloMap->GetNumGlobalBndCoeffs();
148 unsigned int nEntries = pLocToGloMap->GetNumLocalBndCoeffs();
153 for (i = 0; i < nEntries; ++i)
155 vCounts[vMap[i]] += 1.0;
159 pLocToGloMap->UniversalAssembleBnd(vCounts);
163 for (i = 0; i < nEntries; ++i)
168 m_map = pLocToGloMap->GetLocalToGlobalBndMap();
177 boost::shared_ptr<AssemblyMap> pLocToGloMap)
182 unsigned int nElmt =
m_schurCompl->GetNumberOfBlockRows();
184 unsigned int iCount = 0;
185 unsigned int rCount = 0;
186 unsigned int nRows = 0;
187 unsigned int nEntries = 0;
188 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
189 unsigned int nLocal = pLocToGloMap->GetNumLocalBndCoeffs();
191 = pLocToGloMap->GetLocalToGlobalBndSign();
192 bool doSign = pLocToGloMap->GetSignChange();
193 unsigned int i = 0, j = 0, k = 0, n = 0;
199 for (n = 0; n < nElmt; ++n)
202 vSizes[n] = loc_mat->GetRows();
203 nEntries += vSizes[n]*vSizes[n];
216 for(n = iCount = 0; n < nElmt; ++n)
219 nRows = loc_mat->GetRows();
221 for(i = 0; i < nRows; ++i)
223 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(iCount + i);
224 for(j = 0; j < nRows; ++j)
226 k = rCount + i*vSizes[n] + j;
227 m_Ai[k] = iCount + i;
228 m_Aj[k] = iCount + j;
229 m_Ar[k] = (*loc_mat)(i,j);
232 m_Ar[k] *= vMapSign[iCount+i]*vMapSign[iCount+j];
238 if (gid1 < numDirBnd)
245 = pLocToGloMap->GetGlobalToUniversalBndMap()[gid1];
249 rCount += vSizes[n]*vSizes[n];
260 const boost::weak_ptr<ExpList> &pExpList,
265 const boost::shared_ptr<AssemblyMap> &l2gMap)
269 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
270 sys->Initialise(l2gMap);
virtual ~GlobalLinSysXxtStaticCond()
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
DNekScalBlkMatSharedPtr m_schurCompl
Block Schur complement matrix.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Array< OneD, double > m_Ar
DNekScalBlkMatSharedPtr m_C
Block matrix.
boost::shared_ptr< GlobalLinSysXxtStaticCond > GlobalLinSysXxtStaticCondSharedPtr
static GlobalLinSysSharedPtr create(const GlobalLinSysKey &pLinSysKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
static std::string className
Name of class.
DNekScalBlkMatSharedPtr m_invD
Block matrix.
virtual void v_AssembleSchurComplement(boost::shared_ptr< AssemblyMap > locToGloMap)
Assemble the Schur complement matrix.
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
static std::string className2
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Describe a linear system.
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.
GlobalLinSysXxtStaticCond(const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.
Array< OneD, unsigned int > m_Aj
virtual GlobalLinSysStaticCondSharedPtr v_Recurse(const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const boost::shared_ptr< AssemblyMap > &locToGloMap)
Array< OneD, unsigned int > m_Ai
boost::shared_ptr< AssemblyMap > m_locToGloMap
Local to global map.
GlobalLinSysFactory & GetGlobalLinSysFactory()
void nektar_crs_stats(struct crs_data *data)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
struct Xxt::crs_data * m_crsData
void CreateMap(const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
DNekScalBlkMatSharedPtr m_BinvD
Block matrix.
Array< OneD, NekDouble > m_locToGloSignMult
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
boost::shared_ptr< GlobalLinSysStaticCond > GlobalLinSysStaticCondSharedPtr
const boost::weak_ptr< ExpList > m_expList
Local Matrix System.