44 namespace MultiRegions
53 "Diagonal Preconditioning");
62 const boost::shared_ptr<GlobalLinSys> &plinsys,
65 m_preconType(pLocToGloMap->GetPreconType())
88 ASSERTL0(0,
"Unsupported solver type");
98 boost::shared_ptr<MultiRegions::ExpList> expList =
99 ((
m_linsys.lock())->GetLocMat()).lock();
103 int i,j,n,cnt,gid1,gid2;
107 int nInt = nGlobal - nDir;
114 int nElmt = expList->GetNumElmts();
115 for(n = cnt = 0; n < nElmt; ++n)
117 loc_mat = (
m_linsys.lock())->GetBlock(expList->GetOffset_Elmt_Id(n));
118 loc_row = loc_mat->GetRows();
120 for(i = 0; i < loc_row; ++i)
126 for(j = 0; j < loc_row; ++j)
137 value = vOutput[gid1 + nDir]
138 + sign1*sign2*(*loc_mat)(i,j);
139 vOutput[gid1 + nDir] = value;
163 int rows = nGlobalBnd - nDirBnd;
169 for (
unsigned int i = 0; i < rows; ++i)
171 vOutput[nDirBnd + i] = diagonals[i];
195 int nNonDir = nGlobal-nDir;
203 "No Preconditioning");
212 const boost::shared_ptr<GlobalLinSys> &plinsys,
215 m_preconType(pLocToGloMap->GetPreconType())
240 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.