19#ifdef DEAL_II_WITH_TRILINOS
25# include <Epetra_MultiVector.h>
27# include <Ifpack_Chebyshev.h>
28# include <Teuchos_ParameterList.hpp>
29# include <Teuchos_RCP.hpp>
30# include <ml_MultiLevelPreconditioner.h>
31# include <ml_include.h>
41 const bool higher_order_elements,
42 const unsigned int n_cycles,
44 const double aggregation_threshold,
45 const std::vector<std::vector<bool>> &constant_modes,
46 const unsigned int smoother_sweeps,
47 const unsigned int smoother_overlap,
48 const bool output_details,
49 const char * smoother_type,
50 const char * coarse_type)
52 , higher_order_elements(higher_order_elements)
55 , aggregation_threshold(aggregation_threshold)
56 , constant_modes(constant_modes)
57 , smoother_sweeps(smoother_sweeps)
58 , smoother_overlap(smoother_overlap)
59 , output_details(output_details)
60 , smoother_type(smoother_type)
61 , coarse_type(coarse_type)
84 if (higher_order_elements)
99# if DEAL_II_TRILINOS_VERSION_GTE(12, 4, 0)
103 parameter_list.set(
"smoother: sweeps",
static_cast<int>(smoother_sweeps));
104 parameter_list.set(
"cycle applications",
static_cast<int>(n_cycles));
112 static_cast<int>(smoother_overlap));
113 parameter_list.set(
"aggregation: threshold", aggregation_threshold);
132 const Epetra_Map &domain_map = matrix.OperatorDomainMap();
153 constant_modes[0].
size() == global_size;
172 static_cast<double>(constant_modes[d][
mode_index]);
195 matrix.trilinos_matrix());
208 matrix.trilinos_matrix());
225 initialize(matrix.trilinos_matrix(), additional_data);
275 template <
typename number>
281 const ::SparsityPattern * use_this_sparsity)
289 const unsigned int n_mpi_processes =
communicator.NumProc();
291 distributor.add_range(my_id * n_rows / n_mpi_processes,
292 (my_id + 1) * n_rows / n_mpi_processes);
332 unsigned int memory =
sizeof(*this);
347 const AdditionalData &,
349 const ::SparsityPattern *);
352 const AdditionalData &,
354 const ::SparsityPattern *);
~PreconditionAMG() override
std::shared_ptr< SparseMatrix > trilinos_matrix
size_type memory_consumption() const
void initialize(const SparseMatrix &matrix, const AdditionalData &additional_data=AdditionalData())
Epetra_MpiComm communicator
Teuchos::RCP< Epetra_Operator > preconditioner
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcMessage(std::string arg1)
TrilinosWrappers::types::int_type global_index(const Epetra_BlockMap &map, const ::types::global_dof_index i)
TrilinosWrappers::types::int_type n_global_rows(const Epetra_CrsGraph &graph)
TrilinosWrappers::types::int_type global_length(const Epetra_MultiVector &vector)
AdditionalData(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 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")
void set_operator_null_space(Teuchos::ParameterList ¶meter_list, std::unique_ptr< Epetra_MultiVector > &distributed_constant_modes, const Epetra_RowMatrix &matrix) const
void set_parameters(Teuchos::ParameterList ¶meter_list, std::unique_ptr< Epetra_MultiVector > &distributed_constant_modes, const Epetra_RowMatrix &matrix) const