16 #ifndef dealii_trilinos_precondition_h 17 #define dealii_trilinos_precondition_h 20 #include <deal.II/base/config.h> 22 #ifdef DEAL_II_WITH_TRILINOS 24 # include <deal.II/base/subscriptor.h> 26 # include <deal.II/lac/trilinos_vector.h> 27 # include <deal.II/lac/la_parallel_vector.h> 31 # ifdef DEAL_II_WITH_MPI 32 # include <Epetra_MpiComm.h> 34 # include <Epetra_SerialComm.h> 36 # include <Epetra_Map.h> 38 # include <Teuchos_ParameterList.hpp> 39 # include <Epetra_RowMatrix.h> 40 # include <Epetra_Vector.h> 43 class Ifpack_Preconditioner;
44 class Ifpack_Chebyshev;
47 class MultiLevelPreconditioner;
51 DEAL_II_NAMESPACE_OPEN
55 template <
typename number>
class Vector;
148 const ::Vector<double> &src)
const;
155 const ::Vector<double> &src)
const;
162 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
169 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
213 <<
"The sparse matrix the preconditioner is based on " 214 <<
"uses a map that is not compatible to the one in vector " 216 <<
". Check preconditioner and matrix setup.");
232 #ifdef DEAL_II_WITH_MPI 372 const unsigned int overlap = 0,
468 const unsigned int overlap = 0,
557 const double omega = 1,
662 const double omega = 1,
664 const unsigned int overlap = 0,
775 const double omega = 1,
777 const unsigned int overlap = 0,
901 const unsigned int overlap = 0);
1020 const unsigned int overlap = 0);
1129 const unsigned int overlap = 0);
1372 const bool w_cyle =
false,
1374 const std::vector<std::vector<bool> > &
constant_modes = std::vector<std::vector<bool> > (0),
1537 void initialize (
const Epetra_RowMatrix &matrix,
1553 const Teuchos::ParameterList &ml_parameters);
1562 void initialize (
const Epetra_RowMatrix &matrix,
1563 const Teuchos::ParameterList &ml_parameters);
1571 template <
typename number>
1572 void initialize (const ::SparseMatrix<number> &deal_ii_sparse_matrix,
1574 const double drop_tolerance = 1e-13,
1575 const ::SparsityPattern *use_this_sparsity =
nullptr);
1611 #if defined(DOXYGEN) || DEAL_II_TRILINOS_VERSION_GTE(11,14,0) 1648 const bool w_cyle =
false,
1650 const std::vector<std::vector<bool> > &
constant_modes = std::vector<std::vector<bool> > (0),
1789 void initialize (
const Epetra_CrsMatrix &matrix,
1804 Teuchos::ParameterList &muelu_parameters);
1811 void initialize (
const Epetra_CrsMatrix &matrix,
1812 Teuchos::ParameterList &muelu_parameters);
1820 template <
typename number>
1821 void initialize (const ::SparseMatrix<number> &deal_ii_sparse_matrix,
1823 const double drop_tolerance = 1e-13,
1824 const ::SparsityPattern *use_this_sparsity =
nullptr);
1892 const ::Vector<double> &src)
const;
1899 const ::Vector<double> &src)
const;
1906 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
1914 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
1952 const MPI::Vector &src)
const 1959 const int ierr =
preconditioner->ApplyInverse (src.trilinos_vector(),
1960 dst.trilinos_vector());
1967 const MPI::Vector &src)
const 1975 const int ierr =
preconditioner->ApplyInverse (src.trilinos_vector(),
1976 dst.trilinos_vector());
1993 const ::Vector<double> &src)
const 1997 AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
1999 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2001 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2002 const_cast<double *
>(src.begin()));
2004 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2011 const ::Vector<double> &src)
const 2015 AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
2017 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2019 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2020 const_cast<double *
>(src.begin()));
2023 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2039 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2041 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2042 const_cast<double *
>(src.
begin()));
2044 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2057 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2059 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2060 const_cast<double *
>(src.
begin()));
2063 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2076 DEAL_II_NAMESPACE_CLOSE
2078 #endif // DEAL_II_WITH_TRILINOS
static ::ExceptionBase & ExcTrilinosError(int arg1)
AdditionalData(const unsigned int block_size=1, const std::string &block_creation_type="linear", const double omega=1, const double min_diagonal=0, const unsigned int overlap=0, const unsigned int n_sweeps=1)
unsigned int smoother_sweeps
IndexSet locally_owned_range_indices() const
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
#define AssertDimension(dim1, dim2)
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
double aggregation_threshold
std::vector< std::vector< bool > > constant_modes
AdditionalData(const bool elliptic=true, const unsigned int n_cycles=1, const bool w_cyle=false, const double aggregation_threshold=1e-4, const std::vector< std::vector< bool > > &constant_modes=std::vector< std::vector< bool > >(0), const unsigned int smoother_sweeps=2, const unsigned int smoother_overlap=0, const bool output_details=false, const char *smoother_type="Chebyshev", const char *coarse_type="Amesos-KLU")
unsigned int smoother_overlap
AdditionalData(const double omega=1, const double min_diagonal=0, const unsigned int overlap=0, const unsigned int n_sweeps=1)
virtual void vmult(MPI::Vector &dst, const MPI::Vector &src) const
const char * smoother_type
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
std::shared_ptr< Epetra_Map > vector_distributor
#define AssertThrow(cond, exc)
AdditionalData(const unsigned int ilu_fill=0, const double ilu_atol=0., const double ilu_rtol=1., const unsigned int overlap=0)
unsigned int smoother_sweeps
AdditionalData(const unsigned int block_size=1, const std::string &block_creation_type="linear", const double omega=1, const double min_diagonal=0, const unsigned int n_sweeps=1)
AdditionalData(const unsigned int overlap=0)
size_type memory_consumption() const
std::string block_creation_type
#define DeclException1(Exception1, type1, outsequence)
double aggregation_threshold
const char * smoother_type
#define Assert(cond, exc)
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
AdditionalData(const unsigned int degree=1, const double max_eigenvalue=10., const double eigenvalue_ratio=30., const double min_eigenvalue=1., const double min_diagonal=1e-12, const bool nonzero_starting=false)
std::vector< std::vector< bool > > constant_modes
AdditionalData(const bool elliptic=true, const bool higher_order_elements=false, const unsigned int n_cycles=1, const bool w_cyle=false, const double aggregation_threshold=1e-4, const std::vector< std::vector< bool > > &constant_modes=std::vector< std::vector< bool > >(0), const unsigned int smoother_sweeps=2, const unsigned int smoother_overlap=0, const bool output_details=false, const char *smoother_type="Chebyshev", const char *coarse_type="Amesos-KLU")
size_type local_size() const
AdditionalData(const double ilut_drop=0., const unsigned int ilut_fill=0, const double ilut_atol=0., const double ilut_rtol=1., const unsigned int overlap=0)
AdditionalData(const double omega=1, const double min_diagonal=0, const unsigned int overlap=0, const unsigned int n_sweeps=1)
Epetra_Operator & trilinos_operator() const
size_type memory_consumption() const
std::shared_ptr< SparseMatrix > trilinos_matrix
std::shared_ptr< SparseMatrix > trilinos_matrix
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
virtual void Tvmult(MPI::Vector &dst, const MPI::Vector &src) const
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
static ::ExceptionBase & ExcNonMatchingMaps(std::string arg1)
IndexSet locally_owned_domain_indices() const
std::string block_creation_type
AdditionalData(const unsigned int ic_fill=0, const double ic_atol=0., const double ic_rtol=1., const unsigned int overlap=0)
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
~PreconditionBase()=default
std::shared_ptr< Epetra_Operator > preconditioner
unsigned int smoother_overlap
AdditionalData(const unsigned int block_size=1, const std::string &block_creation_type="linear", const double omega=1, const double min_diagonal=0, const unsigned int overlap=0, const unsigned int n_sweeps=1)
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
void vmult(MPI::Vector &dst, const MPI::Vector &src) const
::types::global_dof_index size_type
void Tvmult(MPI::Vector &dst, const MPI::Vector &src) const
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
Epetra_MpiComm communicator
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
MPI_Comm get_mpi_communicator() const
AdditionalData(const double omega=1, const double min_diagonal=0, const unsigned int n_sweeps=1)
bool higher_order_elements
std::string block_creation_type