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> 25 # include <deal.II/base/std_cxx11/shared_ptr.h> 27 # include <deal.II/lac/trilinos_vector_base.h> 28 # include <deal.II/lac/la_parallel_vector.h> 30 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
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> 41 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
44 class Ifpack_Preconditioner;
45 class Ifpack_Chebyshev;
48 class MultiLevelPreconditioner;
52 DEAL_II_NAMESPACE_OPEN
56 template <
typename number>
class Vector;
149 const ::Vector<double> &src)
const;
156 const ::Vector<double> &src)
const;
163 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
170 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
214 <<
"The sparse matrix the preconditioner is based on " 215 <<
"uses a map that is not compatible to the one in vector " 217 <<
". Check preconditioner and matrix setup.");
233 #ifdef DEAL_II_WITH_MPI 373 const unsigned int overlap = 0,
469 const unsigned int overlap = 0,
558 const double omega = 1,
663 const double omega = 1,
665 const unsigned int overlap = 0,
776 const double omega = 1,
778 const unsigned int overlap = 0,
902 const unsigned int overlap = 0);
1021 const unsigned int overlap = 0);
1130 const unsigned int overlap = 0);
1373 const bool w_cyle =
false,
1375 const std::vector<std::vector<bool> > &
constant_modes = std::vector<std::vector<bool> > (0),
1538 void initialize (
const Epetra_RowMatrix &matrix,
1554 const Teuchos::ParameterList &ml_parameters);
1563 void initialize (
const Epetra_RowMatrix &matrix,
1564 const Teuchos::ParameterList &ml_parameters);
1572 template <
typename number>
1573 void initialize (const ::SparseMatrix<number> &deal_ii_sparse_matrix,
1575 const double drop_tolerance = 1e-13,
1576 const ::SparsityPattern *use_this_sparsity = 0);
1612 #if defined(DOXYGEN) || DEAL_II_TRILINOS_VERSION_GTE(11,14,0) 1649 const bool w_cyle =
false,
1651 const std::vector<std::vector<bool> > &
constant_modes = std::vector<std::vector<bool> > (0),
1790 void initialize (
const Epetra_CrsMatrix &matrix,
1805 Teuchos::ParameterList &muelu_parameters);
1812 void initialize (
const Epetra_CrsMatrix &matrix,
1813 Teuchos::ParameterList &muelu_parameters);
1821 template <
typename number>
1822 void initialize (const ::SparseMatrix<number> &deal_ii_sparse_matrix,
1824 const double drop_tolerance = 1e-13,
1825 const ::SparsityPattern *use_this_sparsity = 0);
1879 const AdditionalData &additional_data = AdditionalData());
1898 const ::Vector<double> &src)
const;
1905 const ::Vector<double> &src)
const;
1912 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
1920 const ::LinearAlgebra::distributed::Vector<double> &src)
const;
1958 const VectorBase &src)
const 1965 const int ierr =
preconditioner->ApplyInverse (src.trilinos_vector(),
1966 dst.trilinos_vector());
1973 const VectorBase &src)
const 1981 const int ierr =
preconditioner->ApplyInverse (src.trilinos_vector(),
1982 dst.trilinos_vector());
1999 const ::Vector<double> &src)
const 2003 AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
2005 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2007 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2008 const_cast<double *
>(src.begin()));
2010 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2017 const ::Vector<double> &src)
const 2021 AssertDimension (static_cast<TrilinosWrappers::types::int_type>(src.size()),
2023 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2025 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2026 const_cast<double *
>(src.begin()));
2029 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2045 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2047 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2048 const_cast<double *
>(src.
begin()));
2050 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2063 Epetra_Vector tril_dst (View,
preconditioner->OperatorDomainMap(),
2065 Epetra_Vector tril_src (View,
preconditioner->OperatorRangeMap(),
2066 const_cast<double *
>(src.
begin()));
2069 const int ierr =
preconditioner->ApplyInverse (tril_src, tril_dst);
2082 DEAL_II_NAMESPACE_CLOSE
2084 #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 Tvmult(VectorBase &dst, const VectorBase &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())
#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)
std_cxx11::shared_ptr< SparseMatrix > trilinos_matrix
AdditionalData(const unsigned int overlap=0)
size_type memory_consumption() const
virtual void vmult(VectorBase &dst, const VectorBase &src) const
std_cxx11::shared_ptr< Epetra_Map > vector_distributor
std::string block_creation_type
std_cxx11::shared_ptr< Epetra_Operator > preconditioner
#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())
std_cxx11::shared_ptr< SparseMatrix > trilinos_matrix
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
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())
void vmult(VectorBase &dst, const VectorBase &src) const
void Tvmult(VectorBase &dst, const VectorBase &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())
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())
::types::global_dof_index size_type
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