A parsed AMG preconditioner based on MueLu which uses parameter files to choose between different options. More...
#include <amg_muelu.h>
Public Member Functions | |
AMGMueLuPreconditioner (const std::string &name="", const bool &elliptic=true, const unsigned int &n_cycles=1, const bool &w_cycle=false, const double &aggregation_threshold=1e-4, const unsigned int &smoother_sweeps=2, const unsigned int &smoother_overlap=0, const bool &output_details=false, const std::string &smoother_type="Chebyshev", const std::string &coarse_type="Amesos-KLU") | |
Constructor. More... | |
template<typename Matrix > | |
void | initialize_preconditioner (const Matrix &matrix) |
Initialize the preconditioner using matrix . More... | |
![]() | |
ParameterAcceptor (const std::string §ion_name="") | |
unsigned int | get_acceptor_id () const |
virtual | ~ParameterAcceptor () override |
virtual void | declare_parameters (ParameterHandler &prm) |
virtual void | parse_parameters (ParameterHandler &prm) |
std::string | get_section_name () const |
std::vector< std::string > | get_section_path () const |
void | add_parameter (const std::string &entry, ParameterType ¶meter, const std::string &documentation="", ParameterHandler &prm_=prm, const Patterns::PatternBase &pattern=*Patterns::Tools::Convert< ParameterType >::to_pattern()) |
void | enter_subsection (const std::string &subsection) |
void | leave_subsection () |
void | enter_my_subsection (ParameterHandler &prm) |
void | leave_my_subsection (ParameterHandler &prm) |
void | serialize (Archive &ar, const unsigned int version) |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
![]() | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
Subscriptor (Subscriptor &&) noexcept | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
Subscriptor & | operator= (Subscriptor &&) noexcept |
void | serialize (Archive &ar, const unsigned int version) |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
![]() | |
PreconditionAMGMueLu () | |
virtual | ~PreconditionAMGMueLu () override=default |
void | initialize (const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData()) |
void | initialize (const Epetra_CrsMatrix &matrix, const AdditionalData &additional_data=AdditionalData()) |
void | initialize (const SparseMatrix &matrix, Teuchos::ParameterList &muelu_parameters) |
void | initialize (const Epetra_CrsMatrix &matrix, Teuchos::ParameterList &muelu_parameters) |
void | initialize (const ::SparseMatrix< number > &deal_ii_sparse_matrix, const AdditionalData &additional_data=AdditionalData(), const double drop_tolerance=1e-13, const ::SparsityPattern *use_this_sparsity=nullptr) |
void | clear () |
size_type | memory_consumption () const |
MPI_Comm | get_mpi_communicator () const |
void | transpose () |
virtual void | vmult (MPI::Vector &dst, const MPI::Vector &src) const |
virtual void | vmult (::Vector< double > &dst, const ::Vector< double > &src) const |
virtual void | vmult (::LinearAlgebra::distributed::Vector< double > &dst, const ::LinearAlgebra::distributed::Vector< double > &src) const |
virtual void | Tvmult (MPI::Vector &dst, const MPI::Vector &src) const |
virtual void | Tvmult (::Vector< double > &dst, const ::Vector< double > &src) const |
virtual void | Tvmult (::LinearAlgebra::distributed::Vector< double > &dst, const ::LinearAlgebra::distributed::Vector< double > &src) const |
void | serialize (Archive &ar, const unsigned int version) |
Epetra_Operator & | trilinos_operator () const |
IndexSet | locally_owned_domain_indices () const |
IndexSet | locally_owned_range_indices () const |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
Epetra_Operator & | trilinos_operator () const |
IndexSet | locally_owned_domain_indices () const |
IndexSet | locally_owned_range_indices () const |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
![]() | |
PreconditionBase () | |
void | clear () |
MPI_Comm | get_mpi_communicator () const |
void | transpose () |
void | serialize (Archive &ar, const unsigned int version) |
Epetra_Operator & | trilinos_operator () const |
IndexSet | locally_owned_domain_indices () const |
IndexSet | locally_owned_range_indices () const |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
Epetra_Operator & | trilinos_operator () const |
IndexSet | locally_owned_domain_indices () const |
IndexSet | locally_owned_range_indices () const |
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 |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
Private Member Functions | |
void | add_parameters () |
Add all parameter options. More... | |
Private Attributes | |
bool | elliptic |
Determines whether the AMG preconditioner should be optimized for elliptic problems (ML option smoothed aggregation SA, using a Chebyshev smoother) or for non-elliptic problems (ML option non- symmetric smoothed aggregation NSSA, smoother is SSOR with underrelaxation). More... | |
unsigned int | n_cycles |
Defines how many multigrid cycles should be performed by the preconditioner. More... | |
bool | w_cycle |
Defines whether a w-cycle should be used instead of the standard setting of a v-cycle. More... | |
double | aggregation_threshold |
This threshold tells the AMG setup how the coarsening should be performed. More... | |
unsigned int | smoother_sweeps |
Determines how many sweeps of the smoother should be performed. More... | |
unsigned int | smoother_overlap |
Determines the overlap in the SSOR/Chebyshev error smoother when run in parallel. More... | |
bool | output_details |
If this flag is set to true, then internal information from the ML preconditioner is printed to screen. More... | |
std::string | smoother_type |
Determines which smoother to use for the AMG cycle. More... | |
std::string | coarse_type |
Determines which solver to use on the coarsest level. More... | |
Additional Inherited Members | |
![]() | |
typedef ::types::global_dof_index | size_type |
![]() | |
typedef ::types::global_dof_index | size_type |
![]() | |
static void | initialize (const std::string &filename="", const std::string &output_filename="", const ParameterHandler::OutputStyle output_style_for_output_filename=ParameterHandler::Short, ParameterHandler &prm=ParameterAcceptor::prm, const ParameterHandler::OutputStyle output_style_for_filename=ParameterHandler::DefaultStyle) |
static void | initialize (std::istream &input_stream, ParameterHandler &prm=ParameterAcceptor::prm) |
static void | clear () |
static void | parse_all_parameters (ParameterHandler &prm=ParameterAcceptor::prm) |
static void | declare_all_parameters (ParameterHandler &prm=ParameterAcceptor::prm) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
![]() | |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
![]() | |
static ::ExceptionBase & | ExcNonMatchingMaps (std::string arg1) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
![]() | |
static ::ExceptionBase & | ExcNonMatchingMaps (std::string arg1) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
![]() | |
boost::signals2::signal< void()> | declare_parameters_call_back |
boost::signals2::signal< void()> | parse_parameters_call_back |
![]() | |
static ParameterHandler | prm |
![]() | |
const std::string | section_name |
std::vector< std::string > | subsections |
![]() | |
Teuchos::RCP< Epetra_Operator > | preconditioner |
Epetra_MpiComm | communicator |
![]() | |
Teuchos::RCP< Epetra_Operator > | preconditioner |
Epetra_MpiComm | communicator |
A parsed AMG preconditioner based on MueLu which uses parameter files to choose between different options.
This object is a TrilinosWrappers::PreconditionAMGMueLu which can be called in place of the preconditioner.
Definition at line 35 of file amg_muelu.h.
ParsedLAC::AMGMueLuPreconditioner::AMGMueLuPreconditioner | ( | const std::string & | name = "" , |
const bool & | elliptic = true , |
||
const unsigned int & | n_cycles = 1 , |
||
const bool & | w_cycle = false , |
||
const double & | aggregation_threshold = 1e-4 , |
||
const unsigned int & | smoother_sweeps = 2 , |
||
const unsigned int & | smoother_overlap = 0 , |
||
const bool & | output_details = false , |
||
const std::string & | smoother_type = "Chebyshev" , |
||
const std::string & | coarse_type = "Amesos-KLU" |
||
) |
Constructor.
Build the preconditioner of a matrix using AMG.
Definition at line 28 of file amg_muelu.cc.
References add_parameters().
template void ParsedLAC::AMGMueLuPreconditioner::initialize_preconditioner< SparseMatrix< double > > | ( | const Matrix & | matrix | ) |
Initialize the preconditioner using matrix
.
Definition at line 146 of file amg_muelu.cc.
References TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::aggregation_threshold, aggregation_threshold, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::coarse_type, coarse_type, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::constant_modes, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::elliptic, elliptic, ParameterAcceptor::initialize(), TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::n_cycles, n_cycles, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::output_details, output_details, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::smoother_overlap, smoother_overlap, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::smoother_sweeps, smoother_sweeps, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::smoother_type, smoother_type, TrilinosWrappers::PreconditionAMGMueLu::AdditionalData::w_cycle, and w_cycle.
|
private |
Add all parameter options.
Definition at line 55 of file amg_muelu.cc.
References ParameterAcceptor::add_parameter(), aggregation_threshold, coarse_type, elliptic, n_cycles, output_details, ParameterAcceptor::prm, smoother_overlap, smoother_sweeps, smoother_type, and w_cycle.
Referenced by AMGMueLuPreconditioner().
|
private |
Determines whether the AMG preconditioner should be optimized for elliptic problems (ML option smoothed aggregation SA, using a Chebyshev smoother) or for non-elliptic problems (ML option non- symmetric smoothed aggregation NSSA, smoother is SSOR with underrelaxation).
Definition at line 77 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
Defines how many multigrid cycles should be performed by the preconditioner.
Definition at line 83 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
Defines whether a w-cycle should be used instead of the standard setting of a v-cycle.
Definition at line 89 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
This threshold tells the AMG setup how the coarsening should be performed.
In the AMG used by ML, all points that strongly couple with the tentative coarse-level point form one aggregate. The term strong coupling is controlled by the variable aggregation_threshold, meaning that all elements that are not smaller than aggregation_threshold times the diagonal element do couple strongly.
Definition at line 100 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
Determines how many sweeps of the smoother should be performed.
When the flag elliptic is set to true, i.e., for elliptic or almost elliptic problems, the polynomial degree of the Chebyshev smoother is set to smoother_sweeps. The term sweeps refers to the number of matrix-vector products performed in the Chebyshev case. In the non-elliptic case, smoother_sweeps sets the number of SSOR relaxation sweeps for post-smoothing to be performed.
Definition at line 112 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
Determines the overlap in the SSOR/Chebyshev error smoother when run in parallel.
Definition at line 118 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
If this flag is set to true, then internal information from the ML preconditioner is printed to screen.
This can be useful when debugging the preconditioner.
Definition at line 125 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
Determines which smoother to use for the AMG cycle.
Possibilities for smoother_type are the following: "Aztec", "IFPACK", "Jacobi", "ML symmetric Gauss-Seidel", "symmetric Gauss-Seidel", "ML Gauss-Seidel", "Gauss-Seidel", "block Gauss-Seidel", "symmetric block Gauss-Seidel", "Chebyshev", "MLS", "Hiptmair", "Amesos-KLU", "Amesos-Superlu", "Amesos-UMFPACK", "Amesos-Superludist", "Amesos-MUMPS", "user-defined", "SuperLU", "IFPACK-Chebyshev", "self", "do-nothing", "IC", "ICT", "ILU", "ILUT", "Block Chebyshev", "IFPACK-Block Chebyshev"
Definition at line 138 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().
|
private |
Determines which solver to use on the coarsest level.
The same settings as for the smoother type are possible.
Definition at line 144 of file amg_muelu.h.
Referenced by add_parameters(), and initialize_preconditioner().