16#ifndef dealii_precondition_selector_h
17#define dealii_precondition_selector_h
31template <
class number>
33template <
class number>
98template <
typename MatrixType = SparseMatrix<
double>,
99 typename VectorType = ::Vector<
double>>
113 const typename VectorType::value_type &
omega = 1.);
146 vmult(VectorType &dst,
const VectorType &src)
const;
153 Tvmult(VectorType &dst,
const VectorType &src)
const;
197 const typename VectorType::value_type
omega;
204template <
typename MatrixType,
typename VectorType>
206 const std::string & preconditioning,
207 const typename VectorType::value_type &omega)
208 : preconditioning(preconditioning)
213template <
typename MatrixType,
typename VectorType>
221template <
typename MatrixType,
typename VectorType>
229template <
typename MatrixType,
typename VectorType>
233 Assert(
A !=
nullptr, ExcNoMatrixGivenToUse());
238template <
typename MatrixType,
typename VectorType>
242 Assert(
A !=
nullptr, ExcNoMatrixGivenToUse());
248template <
typename MatrixType,
typename VectorType>
251 const VectorType &src)
const
253 if (preconditioning ==
"none")
259 Assert(
A !=
nullptr, ExcNoMatrixGivenToUse());
261 if (preconditioning ==
"jacobi")
263 A->precondition_Jacobi(dst, src, omega);
265 else if (preconditioning ==
"sor")
267 A->precondition_SOR(dst, src, omega);
269 else if (preconditioning ==
"ssor")
271 A->precondition_SSOR(dst, src, omega);
279template <
typename MatrixType,
typename VectorType>
283 const VectorType &src)
const
285 if (preconditioning ==
"none")
291 Assert(
A !=
nullptr, ExcNoMatrixGivenToUse());
293 if (preconditioning ==
"jacobi")
295 A->precondition_Jacobi(dst, src, omega);
297 else if (preconditioning ==
"sor")
299 A->precondition_TSOR(dst, src, omega);
301 else if (preconditioning ==
"ssor")
303 A->precondition_SSOR(dst, src, omega);
311template <
typename MatrixType,
typename VectorType>
315 return "none|jacobi|sor|ssor";
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNoMatrixGivenToUse()
#define DeclException0(Exception0)
static ::ExceptionBase & ExcNotImplemented()
const VectorType::value_type omega
#define Assert(cond, exc)
std::string preconditioning
SmartPointer< const MatrixType, PreconditionSelector< MatrixType, VectorType > > A
virtual void vmult(VectorType &dst, const VectorType &src) const
virtual void Tvmult(VectorType &dst, const VectorType &src) const
typename MatrixType::size_type size_type
static std::string get_precondition_names()
void use_matrix(const MatrixType &M)
virtual ~PreconditionSelector() override
PreconditionSelector(const std::string &preconditioning, const typename VectorType::value_type &omega=1.)
types::global_dof_index size_type