15#ifndef dealii_trilinos_tpetra_precondition_h
16#define dealii_trilinos_tpetra_precondition_h
26#ifdef DEAL_II_TRILINOS_WITH_TPETRA
33# include <Teuchos_BLAS_types.hpp>
34# include <Teuchos_ConfigDefs.hpp>
35# include <Teuchos_ParameterList.hpp>
36# include <Teuchos_RCPDecl.hpp>
37# include <Tpetra_Operator.hpp>
53 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
131 Teuchos::RCP<TpetraTypes::LinearOperator<Number, MemorySpace>>
171 <<
"The sparse matrix the preconditioner is based on "
172 <<
"uses a map that is not compatible to the one in vector " << arg1
173 <<
". Check preconditioner and matrix setup.");
180 "The chosen preconditioner does not support transposing the matrix.");
188 Teuchos::RCP<TpetraTypes::LinearOperator<Number, MemorySpace>>
207# ifdef DEAL_II_TRILINOS_WITH_IFPACK2
217 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
248 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
277 <<
"You tried to select the preconditioner type <" << arg1 <<
">\n"
278 <<
"but this preconditioner is not supported by Trilinos/Ifpack22\n"
279 <<
"due to one of the following reasons:\n"
280 <<
"* This preconditioner does not exist\n"
281 <<
"* This preconditioner has a specialized constructor not supported by the Ifpack2 Factory.\n"
282 <<
"* This preconditioner is not (yet) supported by Trilinos/Ifpack2\n"
283 <<
"* Trilinos/Ifpack2 was not configured for its use.");
308 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
353 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
437 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
524 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
549 const double eta = 1.5,
620 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
712 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
805 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
917 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
1001 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
1104 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
1127 const double omega = 1.,
1184 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
1206 const double omega = 1,
1257 template <
typename Number,
typename MemorySpace = ::MemorySpace::Host>
1279 const double omega = 1,
IndexSet locally_owned_range_indices() const
virtual void Tvmult(Vector< Number, MemorySpace > &dst, const Vector< Number, MemorySpace > &src) const
Apply the transpose preconditioner.
IndexSet locally_owned_domain_indices() const
Teuchos::ParameterList parameter_list
The list of preconditioner parameters.
void clear()
Destructor. Destroys the preconditioner, leaving an object like just after having called the construc...
virtual void vmult(::Vector< Number > &dst, ::Vector< Number > &src) const
Apply the preconditioner.
Teuchos::RCP< TpetraTypes::LinearOperator< Number, MemorySpace > > preconditioner
Teuchos::RCP< TpetraTypes::LinearOperator< Number, MemorySpace > > trilinos_rcp() const
Access to underlying Trilinos data.
virtual void Tvmult(::Vector< Number > &dst, ::Vector< Number > &src) const
Apply the transpose preconditioner.
PreconditionBase()=default
Constructor. Does not do anything. The initialize function of the derived classes will have to create...
const TpetraTypes::LinearOperator< Number, MemorySpace > & trilinos_operator() const
Access to underlying Trilinos data.
virtual void vmult(Vector< Number, MemorySpace > &dst, const Vector< Number, MemorySpace > &src) const
Apply the preconditioner.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
PreconditionBlockJacobi()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
PreconditionChebyshev()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
PreconditionILUT()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
PreconditionILU()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A)
Initializes the preconditioner for the matrix A.
PreconditionIdentity()=default
Construct identity preconditioner.
std::string preconditioner_type
PreconditionIfpackBase(const std::string &preconditioner_type)
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A)
void set_parameter_list(Teuchos::ParameterList ¶meter_list)
Set the parameter list for the preconditioner.
PreconditionIfpack(const std::string &preconditioner_type)
Construct a new custom Ifpack2 preconditioner.
PreconditionJacobi()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
PreconditionL1GaussSeidel()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
PreconditionL1Jacobi()
Constructor.
PreconditionSOR()
Constructor.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
void initialize(const SparseMatrix< Number, MemorySpace > &A, const AdditionalData &additional_data=AdditionalData())
Compute the preconditioner based on the given matrix and parameters.
PreconditionSSOR()
Constructor.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcTrilinosIpack2PreconditionerUnsupported(std::string arg1)
static ::ExceptionBase & ExcNonMatchingMaps(std::string arg1)
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcTransposeNotSupported()
Tpetra::Operator< Number, LO, GO, NodeType< MemorySpace > > LinearOperator
Standardized data struct to pipe additional flags to the preconditioner.
The set of additional parameters to tune the preconditioner.
int block_overlap
Amount of overlap between blocks.
double omega
Relaxation damping factor.
int n_local_parts
Number of blocks per processor.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
AdditionalData(const int n_local_parts=1, const double omega=1., const int block_overlap=0, const int n_sweeps=1)
Constructor.
The set of additional parameters to tune the preconditioner.
int n_local_parts
Number of blocks per processor.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
int overlap
Overlap between processor local matrices.
AdditionalData(const int n_local_parts=1, const double omega=1, const int overlap=0, const int n_sweeps=1)
Constructor.
double omega
Relaxation damping factor.
The set of additional parameters to tune the preconditioner.
int overlap
Overlap between processor local matrices.
int n_local_parts
Number of blocks per processor.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
AdditionalData(const int n_local_parts=1, const double omega=1, const int overlap=1, const int n_sweeps=1)
Constructor.
double omega
Relaxation damping factor.
The set of additional parameters to tune the preconditioner.
double eigenvalue_ratio
Estimated ratio between maximum and minimum eigenvalue.
AdditionalData(const int degree=1, const double max_eigenvalue=10., const double min_eigenvalue=1., const double eigenvalue_ratio=30., const double min_diagonal=1e-12, const bool nonzero_starting=false)
Constructor.
int degree
Degree of the Chebyshev polynomial.
bool nonzero_starting
Do not zero starting entries of solution vector.
double min_diagonal
Threshold below which entries will be fixed.
The set of additional parameters to tune the preconditioner.
AdditionalData(const double ilut_drop=0., const double ilut_fill=0., const double ilut_atol=0., const double ilut_rtol=1., const int overlap=0)
Constructor.
double ilut_rtol
Factor to scale all diagonal entries by before factorization.
double ilut_fill
Amount of additional fill-in.
double ilut_atol
Constant to be added to each diagonal entry before factorization.
int overlap
Overlap between processor local matrices.
double ilut_drop
Threshold for dropping entries.
The set of additional parameters to tune the preconditioner.
double ilu_atol
Constant to be added to each diagonal entry before factorization.
int ilu_fill
Amount of additional fill-in.
AdditionalData(const int ilu_fill=0, const double ilu_atol=0., const double ilu_rtol=1., const int overlap=0)
Constructor.
double ilu_rtol
Factor to scale all diagonal entries by before factorization.
int overlap
Overlap between processor local matrices.
The set of additional parameters to tune the preconditioner.
double omega
Relaxation damping factor.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
double min_diagonal
Threshold below which entries will be fixed.
bool fix_diagonal
Whether or not to enlarge entries below a threshold.
AdditionalData(const double omega=1., const bool fix_diagonal=false, const double min_diagonal=0., const int n_sweeps=1)
Constructor.
The set of additional parameters to tune the preconditioner.
bool fix_diagonal
Whether or not to enlarge entries below a threshold.
double eta
Threshold parameter for diagonal correction.
double omega
Relaxation damping factor.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
AdditionalData(const double omega=1, const double eta=1.5, const bool fix_diagonal=false, const double min_diagonal=0, const int n_sweeps=1)
Constructor.
double min_diagonal
Threshold below which entries will be fixed.
The set of additional parameters to tune the preconditioner.
double omega
Relaxation damping factor.
AdditionalData(const double omega=1., const bool fix_diagonal=false, const double min_diagonal=0., const int n_sweeps=1)
Constructor.
bool fix_diagonal
Whether or not to enlarge entries below a threshold.
double min_diagonal
Threshold below which entries will be fixed.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
The set of additional parameters to tune the preconditioner.
bool fix_diagonal
Whether or not to enlarge entries below a threshold.
double omega
Relaxation damping factor.
int overlap
Overlap between processor local matrices.
AdditionalData(const double omega=1., const int overlap=0, const bool fix_diagonal=false, const double min_diagonal=0., const int n_sweeps=1)
Constructor.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
double min_diagonal
Threshold below which entries will be fixed.
The set of additional parameters to tune the preconditioner.
bool fix_diagonal
Whether or not to enlarge entries below a threshold.
int n_sweeps
Set how often the preconditioner should be applied during vmult() or Tvmult().
AdditionalData(const double omega=1., const int overlap=0, const bool fix_diagonal=false, const double min_diagonal=0., const int n_sweeps=1)
Constructor.
double min_diagonal
Threshold below which entries will be fixed.
int overlap
Overlap between processor local matrices.
double omega
Relaxation damping factor.