16 #ifndef dealii_precondition_selector_h 17 #define dealii_precondition_selector_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/smartpointer.h> 24 DEAL_II_NAMESPACE_OPEN
26 template <
class number>
class Vector;
93 template <
typename MatrixType = SparseMatrix<
double>,
94 typename VectorType = ::Vector<
double> >
108 const typename VectorType::value_type &
omega=1.);
137 virtual void vmult (VectorType &dst,
const VectorType &src)
const;
143 virtual void Tvmult (VectorType &dst,
const VectorType &src)
const;
186 const typename VectorType::value_type
omega;
193 template <
typename MatrixType,
typename VectorType>
196 const typename VectorType::value_type &omega) :
197 preconditioning(preconditioning),
201 template <
typename MatrixType,
typename VectorType>
209 template <
typename MatrixType,
typename VectorType>
216 template <
typename MatrixType,
typename VectorType>
220 Assert(A!=
nullptr, ExcNoMatrixGivenToUse());
225 template <
typename MatrixType,
typename VectorType>
229 Assert(A!=
nullptr, ExcNoMatrixGivenToUse());
235 template <
typename MatrixType,
typename VectorType>
237 const VectorType &src)
const 239 if (preconditioning==
"none")
245 Assert(A!=
nullptr, ExcNoMatrixGivenToUse());
247 if (preconditioning==
"jacobi")
249 A->precondition_Jacobi(dst,src,omega);
251 else if (preconditioning==
"sor")
253 A->precondition_SOR(dst,src,omega);
255 else if (preconditioning==
"ssor")
257 A->precondition_SSOR(dst,src,omega);
265 template <
typename MatrixType,
typename VectorType>
267 const VectorType &src)
const 269 if (preconditioning==
"none")
275 Assert(A!=
nullptr, ExcNoMatrixGivenToUse());
277 if (preconditioning==
"jacobi")
279 A->precondition_Jacobi(dst,src,omega);
281 else if (preconditioning==
"sor")
283 A->precondition_TSOR(dst,src,omega);
285 else if (preconditioning==
"ssor")
287 A->precondition_SSOR(dst,src,omega);
295 template <
typename MatrixType,
typename VectorType>
298 return "none|jacobi|sor|ssor";
302 DEAL_II_NAMESPACE_CLOSE
MatrixType::size_type size_type
void use_matrix(const MatrixType &M)
const VectorType::value_type omega
static ::ExceptionBase & ExcNoMatrixGivenToUse()
#define Assert(cond, exc)
#define DeclException0(Exception0)
PreconditionSelector(const std::string &preconditioning, const typename VectorType::value_type &omega=1.)
static std::string get_precondition_names()
virtual void Tvmult(VectorType &dst, const VectorType &src) const
virtual void vmult(VectorType &dst, const VectorType &src) const
static ::ExceptionBase & ExcNotImplemented()
SmartPointer< const MatrixType, PreconditionSelector< MatrixType, VectorType > > A
virtual ~PreconditionSelector()
std::string preconditioning