Public Member Functions | |
template<typename... Args, typename = std::enable_if_t<::std::conjunction< std::is_convertible<Args, ::gko::deferred_factory_parameter< mg_level_type>>...>::value>> | |
auto | with_mg_level (Args &&... factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename FactoryType, typename = std::enable_if_t<std::is_convertible< FactoryType, ::gko::deferred_factory_parameter<mg_level_type>>::value>> | |
auto | with_mg_level (const std::vector< FactoryType > &factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_level_selector (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args, typename = std::enable_if_t<::std::conjunction< std::is_convertible<Args, ::gko::deferred_factory_parameter< pre_smoother_type>>...>::value>> | |
auto | with_pre_smoother (Args &&... factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename FactoryType, typename = std::enable_if_t<std::is_convertible< FactoryType, ::gko::deferred_factory_parameter<pre_smoother_type>>::value>> | |
auto | with_pre_smoother (const std::vector< FactoryType > &factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args, typename = std::enable_if_t<::std::conjunction< std::is_convertible<Args, ::gko::deferred_factory_parameter< post_smoother_type>>...>::value>> | |
auto | with_post_smoother (Args &&... factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename FactoryType, typename = std::enable_if_t<std::is_convertible< FactoryType, ::gko::deferred_factory_parameter<post_smoother_type>>::value>> | |
auto | with_post_smoother (const std::vector< FactoryType > &factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args, typename = std::enable_if_t<::std::conjunction< std::is_convertible<Args, ::gko::deferred_factory_parameter< mid_smoother_type>>...>::value>> | |
auto | with_mid_smoother (Args &&... factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename FactoryType, typename = std::enable_if_t<std::is_convertible< FactoryType, ::gko::deferred_factory_parameter<mid_smoother_type>>::value>> | |
auto | with_mid_smoother (const std::vector< FactoryType > &factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_post_uses_pre (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_mid_case (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_max_levels (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_min_coarse_rows (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args, typename = std::enable_if_t<::std::conjunction< std::is_convertible<Args, ::gko::deferred_factory_parameter< coarsest_solver_type>>...>::value>> | |
auto | with_coarsest_solver (Args &&... factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename FactoryType, typename = std::enable_if_t<std::is_convertible< FactoryType, ::gko::deferred_factory_parameter<coarsest_solver_type>>::value>> | |
auto | with_coarsest_solver (const std::vector< FactoryType > &factories) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_solver_selector (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_cycle (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_kcycle_base (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_kcycle_rel_tol (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_smoother_relax (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_smoother_iters (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
template<typename... Args> | |
auto | with_default_initial_guess (Args &&... _value) -> std::decay_t< decltype(*(this->self()))> & |
![]() | |
auto | with_criteria (Args &&... factories) -> std::decay_t< decltype(*(this->self()))> & |
auto | with_criteria (const std::vector< FactoryType > &factories) -> std::decay_t< decltype(*(this->self()))> & |
![]() | |
parameters_type & | with_loggers (Args &&... _value) |
Provides the loggers to be added to the factory and its generated objects in a fluent interface. | |
std::unique_ptr< Factory > | on (std::shared_ptr< const Executor > exec) const |
Creates a new factory on the specified executor. | |
Public Attributes | |
std::vector< std::shared_ptr< const LinOpFactory > > | mg_level {} |
MultigridLevel Factory list. | |
std::function< size_type(const size_type, const LinOp *)> | level_selector {nullptr} |
Custom selector size_type (size_type level, const LinOp* fine_matrix) Selector function returns the element index in the vector for any given level index and the matrix of the fine level. | |
std::vector< std::shared_ptr< const LinOpFactory > > | pre_smoother {} |
Pre-smooth Factory list. | |
std::vector< std::shared_ptr< const LinOpFactory > > | post_smoother {} |
Post-smooth Factory list. | |
std::vector< std::shared_ptr< const LinOpFactory > > | mid_smoother {} |
Mid-smooth Factory list. | |
bool | post_uses_pre {true} |
Whether post-smoothing-related calls use corresponding pre-smoothing-related calls. | |
multigrid::mid_smooth_type | mid_case {multigrid::mid_smooth_type::standalone} |
Choose the behavior of mid smoother between two cycles close to each other in the same level. | |
size_type | max_levels {10} |
The maximum number of mg_level (without coarsest solver level) that can be used. | |
size_type | min_coarse_rows {64} |
The minimal number of coarse rows. | |
std::vector< std::shared_ptr< const LinOpFactory > > | coarsest_solver {} |
Coarsest factory list. | |
std::function< size_type(const size_type, const LinOp *)> | solver_selector {nullptr} |
Custom coarsest_solver selector size_type (size_type level, const LinOp *coarsest_matrix) Selector function returns the correct element index in the vector for any given level index and the system matrix. | |
multigrid::cycle | cycle {multigrid::cycle::v} |
Multigrid cycle type. | |
size_type | kcycle_base {1} |
kcycle_base is a factor to choose how often enable FCG/GCR step. | |
double | kcycle_rel_tol {0.25} |
kcycle_rel_tol decides whether run the second iteration of FCG/GCR step. | |
std::complex< double > | smoother_relax {0.9} |
smoother_relax is the relaxation factor of default generated smoother. | |
size_type | smoother_iters {1} |
smoother_iters is the number of iteration of default generated smoother. | |
initial_guess_mode | default_initial_guess {initial_guess_mode::zero} |
Default initial guess mode. | |
![]() | |
std::vector< std::shared_ptr< const stop::CriterionFactory > > | criteria |
Stopping criteria to be used by the solver. | |
Additional Inherited Members | |
![]() | |
using | factory |
std::vector<std::shared_ptr<const LinOpFactory> > gko::solver::Multigrid::parameters_type::coarsest_solver {} |
Coarsest factory list.
If not set, then a direct LU solver will be used as solver on the coarsest level.
multigrid::cycle gko::solver::Multigrid::parameters_type::cycle {multigrid::cycle::v} |
initial_guess_mode gko::solver::Multigrid::parameters_type::default_initial_guess {initial_guess_mode::zero} |
Default initial guess mode.
The available options are under initial_guess_mode.
size_type gko::solver::Multigrid::parameters_type::kcycle_base {1} |
kcycle_base is a factor to choose how often enable FCG/GCR step.
This parameter is ignored on v, w, f cycle. Enable the FCG/GCR step when level % kcycle_base == 0 and the next level is not coarsest level.
double gko::solver::Multigrid::parameters_type::kcycle_rel_tol {0.25} |
kcycle_rel_tol decides whether run the second iteration of FCG/GCR step.
kcycle_rel_tol <= 0: always run one iterations. kcycle_rel_tol == nan: always run two iterations. ||updated_r|| <= kcycle_rel_tol ||r||: run second iteration.
std::function<size_type(const size_type, const LinOp*)> gko::solver::Multigrid::parameters_type::level_selector {nullptr} |
Custom selector size_type (size_type level, const LinOp* fine_matrix) Selector function returns the element index in the vector for any given level index and the matrix of the fine level.
The level 0 is the finest level and it is ascending when going to coarser levels. For each level, this function is used to select the smoothers and multigrid level generation from the respective lists. For example,
It uses the 0-idx element if level < 3, the 1-idx element if level >= 3 and the number of rows of fine matrix > 1024, or the 2-idx elements otherwise.
default selector: use the level as the index when the level < mg_level and reuse the last one when the level >= mg_level
size_type gko::solver::Multigrid::parameters_type::max_levels {10} |
The maximum number of mg_level (without coarsest solver level) that can be used.
If the multigrid hit the max_levels limit, including the coarsest solver level contains max_levels + 1 levels.
multigrid::mid_smooth_type gko::solver::Multigrid::parameters_type::mid_case {multigrid::mid_smooth_type::standalone} |
Choose the behavior of mid smoother between two cycles close to each other in the same level.
The default is multigrid::mid_smooth_type::standalone.
std::vector<std::shared_ptr<const LinOpFactory> > gko::solver::Multigrid::parameters_type::mid_smoother {} |
size_type gko::solver::Multigrid::parameters_type::min_coarse_rows {64} |
The minimal number of coarse rows.
If generation gets the matrix which contains less than min_coarse_rows
, the generation stops.
std::vector<std::shared_ptr<const LinOpFactory> > gko::solver::Multigrid::parameters_type::post_smoother {} |
std::vector<std::shared_ptr<const LinOpFactory> > gko::solver::Multigrid::parameters_type::pre_smoother {} |
Pre-smooth Factory list.
Its size must be 0, 1 or be the same as mg_level's. when size = 0, use default smoother when size = 1, use the first factory when size > 1, use the same selector as mg_level
If this option is not set (i.e. size = 0) then the default smoother is used. The default smoother is one step of iterative refinement with a scalar Jacobi preconditioner.
If any element in the vector is a nullptr
then the smoother application at the corresponding level is skipped.
std::function<size_type(const size_type, const LinOp*)> gko::solver::Multigrid::parameters_type::solver_selector {nullptr} |
Custom coarsest_solver selector size_type (size_type level, const LinOp *coarsest_matrix) Selector function returns the correct element index in the vector for any given level index and the system matrix.
It can be used to choose the sparse iterative solver if the coarsest matrix is still large but the dense solver if the matrix is small enough. For example,
Coarsest solver uses the 0-idx element if the number of rows of the coarsest_matrix > 1024 or 1-idx element for other cases.
default selector: use the first factory