Fluid structure interaction suite
ParsedLAC::AMGPreconditioner Class Reference

A parsed AMG preconditioner which uses parameter files to choose between different options. More...

#include <amg.h>

Inheritance diagram for ParsedLAC::AMGPreconditioner:
[legend]

Public Member Functions

 AMGPreconditioner (const std::string &name="", const bool &elliptic=true, const bool &higher_order_elements=false, 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 (const Matrix &matrix)
 Initialize the preconditioner using matrix. More...
 
void set_constant_modes (const std::vector< std::vector< bool >> &constant_modes)
 Set the constant modes of the AMG preconditioner. More...
 
- Public Member Functions inherited from ParameterAcceptor
 ParameterAcceptor (const std::string &section_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 &parameter, 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
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (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
 
- Public Member Functions inherited from TrilinosWrappers::PreconditionAMG
 ~PreconditionAMG () override
 
void initialize (const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
 
void initialize (const Epetra_RowMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
 
void initialize (const SparseMatrix &matrix, const Teuchos::ParameterList &ml_parameters)
 
void initialize (const Epetra_RowMatrix &matrix, const Teuchos::ParameterList &ml_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 reinit ()
 
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_Operatortrilinos_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_Operatortrilinos_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
 
- Public Member Functions inherited from TrilinosWrappers::PreconditionBase
 PreconditionBase ()
 
void clear ()
 
MPI_Comm get_mpi_communicator () const
 
void transpose ()
 
void serialize (Archive &ar, const unsigned int version)
 
Epetra_Operatortrilinos_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_Operatortrilinos_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 ()
 Declare preconditioner 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...
 
bool higher_order_elements
 Determines whether the matrix that the preconditioner is built upon is generated from linear or higher-order elements. 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...
 
std::string var_const_modes
 Specifies the variable associated to the constant modes (near null space) of the matrix. 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...
 
std::vector< std::vector< bool > > constant_modes
 Constant modes of the matrix. More...
 

Additional Inherited Members

- Public Types inherited from TrilinosWrappers::PreconditionAMG
typedef ::types::global_dof_index size_type
 
- Public Types inherited from TrilinosWrappers::PreconditionBase
typedef ::types::global_dof_index size_type
 
- Static Public Member Functions inherited from ParameterAcceptor
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 ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Static Public Member Functions inherited from TrilinosWrappers::PreconditionAMG
static ::ExceptionBaseExcNonMatchingMaps (std::string arg1)
 
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Static Public Member Functions inherited from TrilinosWrappers::PreconditionBase
static ::ExceptionBaseExcNonMatchingMaps (std::string arg1)
 
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Public Attributes inherited from ParameterAcceptor
boost::signals2::signal< void()> declare_parameters_call_back
 
boost::signals2::signal< void()> parse_parameters_call_back
 
- Static Public Attributes inherited from ParameterAcceptor
static ParameterHandler prm
 
- Protected Attributes inherited from ParameterAcceptor
const std::string section_name
 
std::vector< std::string > subsections
 
- Protected Attributes inherited from TrilinosWrappers::PreconditionAMG
Teuchos::RCP< Epetra_Operatorpreconditioner
 
Epetra_MpiComm communicator
 
- Protected Attributes inherited from TrilinosWrappers::PreconditionBase
Teuchos::RCP< Epetra_Operatorpreconditioner
 
Epetra_MpiComm communicator
 

Detailed Description

A parsed AMG preconditioner which uses parameter files to choose between different options.

This object is a TrilinosWrappers::PreconditionAMG which can be called in place of the preconditioner.

Definition at line 35 of file amg.h.

Constructor & Destructor Documentation

◆ AMGPreconditioner()

ParsedLAC::AMGPreconditioner::AMGPreconditioner ( const std::string &  name = "",
const bool &  elliptic = true,
const bool &  higher_order_elements = false,
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.cc.

References add_parameters().

Member Function Documentation

◆ initialize()

◆ set_constant_modes()

void ParsedLAC::AMGPreconditioner::set_constant_modes ( const std::vector< std::vector< bool >> &  constant_modes)

Set the constant modes of the AMG preconditioner.

Definition at line 154 of file amg.cc.

References constant_modes.

◆ add_parameters()

void ParsedLAC::AMGPreconditioner::add_parameters ( )
private

Member Data Documentation

◆ elliptic

bool ParsedLAC::AMGPreconditioner::elliptic
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 83 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ higher_order_elements

bool ParsedLAC::AMGPreconditioner::higher_order_elements
private

Determines whether the matrix that the preconditioner is built upon is generated from linear or higher-order elements.

Definition at line 89 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ n_cycles

unsigned int ParsedLAC::AMGPreconditioner::n_cycles
private

Defines how many multigrid cycles should be performed by the preconditioner.

Definition at line 95 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ w_cycle

bool ParsedLAC::AMGPreconditioner::w_cycle
private

Defines whether a w-cycle should be used instead of the standard setting of a v-cycle.

Definition at line 101 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ aggregation_threshold

double ParsedLAC::AMGPreconditioner::aggregation_threshold
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 112 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ var_const_modes

std::string ParsedLAC::AMGPreconditioner::var_const_modes
private

Specifies the variable associated to the constant modes (near null space) of the matrix.

In the case var_const_modes is equal to "none", constant modes will not be computed.

Definition at line 119 of file amg.h.

◆ smoother_sweeps

unsigned int ParsedLAC::AMGPreconditioner::smoother_sweeps
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 131 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ smoother_overlap

unsigned int ParsedLAC::AMGPreconditioner::smoother_overlap
private

Determines the overlap in the SSOR/Chebyshev error smoother when run in parallel.

Definition at line 137 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ output_details

bool ParsedLAC::AMGPreconditioner::output_details
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 144 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ smoother_type

std::string ParsedLAC::AMGPreconditioner::smoother_type
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 157 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ coarse_type

std::string ParsedLAC::AMGPreconditioner::coarse_type
private

Determines which solver to use on the coarsest level.

The same settings as for the smoother type are possible.

Definition at line 163 of file amg.h.

Referenced by add_parameters(), and initialize().

◆ constant_modes

std::vector<std::vector<bool> > ParsedLAC::AMGPreconditioner::constant_modes
private

Constant modes of the matrix.

Definition at line 168 of file amg.h.

Referenced by initialize(), and set_constant_modes().


The documentation for this class was generated from the following files: