15#ifndef dealii_precondition_selector_h
16#define dealii_precondition_selector_h
30template <
class number>
32template <
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";
virtual void vmult(VectorType &dst, const VectorType &src) const
virtual void Tvmult(VectorType &dst, const VectorType &src) const
typename MatrixType::size_type size_type
const VectorType::value_type omega
static std::string get_precondition_names()
void use_matrix(const MatrixType &M)
std::string preconditioning
virtual ~PreconditionSelector() override
PreconditionSelector(const std::string &preconditioning, const typename VectorType::value_type &omega=1.)
SmartPointer< const MatrixType, PreconditionSelector< MatrixType, VectorType > > A
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNoMatrixGivenToUse()
#define DeclException0(Exception0)
#define Assert(cond, exc)
#define DEAL_II_NOT_IMPLEMENTED()