44 namespace MultiRegions
53 "Diagonal Preconditioning");
62 const boost::shared_ptr<GlobalLinSys> &plinsys,
65 m_preconType(pLocToGloMap->GetPreconType())
90 ASSERTL0(0,
"Unsupported solver type");
100 boost::shared_ptr<MultiRegions::ExpList> expList =
101 ((
m_linsys.lock())->GetLocMat()).lock();
105 int i,j,n,cnt,gid1,gid2;
109 int nInt = nGlobal - nDir;
116 int nElmt = expList->GetNumElmts();
117 for(n = cnt = 0; n < nElmt; ++n)
119 loc_mat = (
m_linsys.lock())->GetBlock(expList->GetOffset_Elmt_Id(n));
120 loc_row = loc_mat->GetRows();
122 for(i = 0; i < loc_row; ++i)
128 for(j = 0; j < loc_row; ++j)
139 value = vOutput[gid1 + nDir]
140 + sign1*sign2*(*loc_mat)(i,j);
141 vOutput[gid1 + nDir] = value;
165 int rows = nGlobalBnd - nDirBnd;
171 for (
unsigned int i = 0; i < rows; ++i)
173 vOutput[nDirBnd + i] = diagonals[i];
197 int nNonDir = nGlobal-nDir;
205 "No Preconditioning");
214 const boost::shared_ptr<GlobalLinSys> &plinsys,
217 m_preconType(pLocToGloMap->GetPreconType())
242 Vmath::Vcopy(pInput.num_elements(), pInput, 1, pOutput, 1);
boost::shared_ptr< AssemblyMap > m_locToGloMap
#define ASSERTL0(condition, msg)
boost::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
PreconFactory & GetPreconFactory()
void StaticCondDiagonalPreconditionerSum(void)
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
virtual void v_BuildPreconditioner()
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
const boost::weak_ptr< GlobalLinSys > m_linsys
virtual void v_InitObject()
virtual void v_InitObject()
Array< OneD, NekDouble > AssembleStaticCondGlobalDiagonals()
Performs global assembly of diagonal entries to global Schur complement matrix.
PreconditionerDiagonal(const boost::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
PreconditionerNull(const boost::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
Array< OneD, NekDouble > m_diagonals
void DiagonalPreconditionerSum(void)
static PreconditionerSharedPtr create(const boost::shared_ptr< GlobalLinSys > &plinsys, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
static std::string className
Name of class.
static PreconditionerSharedPtr create(const boost::shared_ptr< GlobalLinSys > &plinsys, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
static std::string className
Name of class.
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.
virtual void v_BuildPreconditioner()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.