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;
198 const typename VectorType::value_type
omega;
205template <
typename MatrixType,
typename VectorType>
207 const std::string &preconditioning,
208 const typename VectorType::value_type &omega)
209 : preconditioning(preconditioning)
214template <
typename MatrixType,
typename VectorType>
222template <
typename MatrixType,
typename VectorType>
230template <
typename MatrixType,
typename VectorType>
234 Assert(A !=
nullptr, ExcNoMatrixGivenToUse());
239template <
typename MatrixType,
typename VectorType>
243 Assert(A !=
nullptr, ExcNoMatrixGivenToUse());
249template <
typename MatrixType,
typename VectorType>
252 const VectorType &src)
const
254 if (preconditioning ==
"none")
260 Assert(A !=
nullptr, ExcNoMatrixGivenToUse());
262 if (preconditioning ==
"jacobi")
264 A->precondition_Jacobi(dst, src, omega);
266 else if (preconditioning ==
"sor")
268 A->precondition_SOR(dst, src, omega);
270 else if (preconditioning ==
"ssor")
272 A->precondition_SSOR(dst, src, omega);
280template <
typename MatrixType,
typename VectorType>
284 const VectorType &src)
const
286 if (preconditioning ==
"none")
292 Assert(A !=
nullptr, ExcNoMatrixGivenToUse());
294 if (preconditioning ==
"jacobi")
296 A->precondition_Jacobi(dst, src, omega);
298 else if (preconditioning ==
"sor")
300 A->precondition_TSOR(dst, src, omega);
302 else if (preconditioning ==
"ssor")
304 A->precondition_SSOR(dst, src, omega);
312template <
typename MatrixType,
typename VectorType>
316 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.)
ObserverPointer< 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()