Reference documentation for deal.II version 9.3.3
|
#include <deal.II/lac/precondition_selector.h>
Public Types | |
using | size_type = typename MatrixType::size_type |
Public Member Functions | |
PreconditionSelector (const std::string &preconditioning, const typename VectorType::value_type &omega=1.) | |
virtual | ~PreconditionSelector () override |
void | use_matrix (const MatrixType &M) |
size_type | m () const |
size_type | n () const |
virtual void | vmult (VectorType &dst, const VectorType &src) const |
virtual void | Tvmult (VectorType &dst, const VectorType &src) const |
Static Public Member Functions | |
static std::string | get_precondition_names () |
static ::ExceptionBase & | ExcNoMatrixGivenToUse () |
Protected Attributes | |
std::string | preconditioning |
Private Attributes | |
SmartPointer< const MatrixType, PreconditionSelector< MatrixType, VectorType > > | A |
const VectorType::value_type | omega |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
std::atomic< unsigned int > | counter |
std::map< std::string, unsigned int > | counter_map |
std::vector< std::atomic< bool > * > | validity_pointers |
const std::type_info * | object_info |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
template<typename StreamType > | |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
static std::mutex | mutex |
void | check_no_subscribers () const noexcept |
Selects the preconditioner. The constructor of this class takes the name of the preconditioning and the damping parameter omega
of the preconditioning and the use_matrix
function takes the matrix that is used by the matrix-builtin precondition functions. Each time, the operator()
function is called, this preselected preconditioner, this matrix and this omega
is used for the preconditioning. This class is designed for being used as argument of the solve
function of a Solver
and it covers the selection of all matrix-builtin precondition functions. The selection of other preconditioners, like BlockSOR or ILU should be handled in derived classes by the user.
The simplest use of this class is the following:
The same example where also the SolverSelector
class is used reads
Now the use of the SolverSelector
in combination with the PreconditionSelector
allows the user to select both, the solver and the preconditioner, at the beginning of their program and each time the solver is started (that is several times e.g. in a nonlinear iteration) this preselected solver and preconditioner is called.
Definition at line 100 of file precondition_selector.h.