44 namespace MultiRegions
60 "PETSc static condensation.");
64 "PETScMultiLevelStaticCond",
66 "PETSc multi-level static condensation.");
89 const boost::weak_ptr<ExpList> &pExpList,
90 const boost::shared_ptr<AssemblyMap>
98 "This constructor is only valid when using static "
101 == pLocToGloMap->GetGlobalSysSolnType(),
102 "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>
144 int i, j, n, cnt, gid1, gid2, loc_lda;
147 const int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
157 pLocToGloMap->GetGlobalToUniversalBndMapUnique(),
163 for(n = cnt = 0; n <
m_schurCompl->GetNumberOfBlockRows(); ++n)
166 loc_lda = loc_mat->GetRows();
168 for(i = 0; i < loc_lda; ++i)
170 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + i)-nDirDofs;
171 sign1 = pLocToGloMap->GetLocalToGlobalBndSign(cnt + i);
175 for(j = 0; j < loc_lda; ++j)
177 gid2 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + j)
179 sign2 = pLocToGloMap->GetLocalToGlobalBndSign(cnt + j);
183 value = sign1*sign2*(*loc_mat)(i,j);
185 m_matrix, gid1ro, gid2ro, value, ADD_VALUES);
194 MatAssemblyBegin(
m_matrix, MAT_FINAL_ASSEMBLY);
195 MatAssemblyEnd (
m_matrix, MAT_FINAL_ASSEMBLY);
201 SetUpSolver(pLocToGloMap->GetIterativeTolerance());
206 const boost::weak_ptr<ExpList> &pExpList,
211 const boost::shared_ptr<AssemblyMap> &l2gMap)
215 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
216 sys->Initialise(l2gMap);
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
boost::shared_ptr< GlobalLinSysPETScStaticCond > GlobalLinSysPETScStaticCondSharedPtr
void SetUpMatVec()
Construct PETSc matrix and vector handles.
boost::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
DNekScalBlkMatSharedPtr m_schurCompl
Block Schur complement matrix.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
DNekScalBlkMatSharedPtr m_C
Block matrix.
void CalculateReordering(const Array< OneD, const int > &glo2uniMap, const Array< OneD, const int > &glo2unique, const AssemblyMapSharedPtr &pLocToGloMap)
Calculate a reordering of universal IDs for PETSc.
GlobalLinSysPETScStaticCond(const GlobalLinSysKey &mkey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.
void SetUpSolver(NekDouble tolerance)
Set up KSP solver object.
DNekScalBlkMatSharedPtr m_invD
Block matrix.
vector< int > m_reorderedMap
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
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)
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Describe a linear system.
void SetUpScatter()
Set up PETSc local (equivalent to Nektar++ global) and global (equivalent to universal) scatter maps...
static std::string className2
virtual void v_AssembleSchurComplement(boost::shared_ptr< AssemblyMap > locToGloMap)
Assemble the Schur complement matrix.
virtual ~GlobalLinSysPETScStaticCond()
static std::string className
Name of class.
GlobalLinSysFactory & GetGlobalLinSysFactory()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
DNekScalBlkMatSharedPtr m_BinvD
Block matrix.
static GlobalLinSysSharedPtr create(const GlobalLinSysKey &pLinSysKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
boost::shared_ptr< GlobalLinSysStaticCond > GlobalLinSysStaticCondSharedPtr