Fluid structure interaction suite
amg_muelu.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2022 by Luca Heltai
4 //
5 // This file is part of the FSI-suite platform, based on the deal.II library.
6 //
7 // The FSI-suite platform is free software; you can use it, redistribute it,
8 // and/or modify it under the terms of the GNU Lesser General Public License as
9 // published by the Free Software Foundation; either version 3.0 of the License,
10 // or (at your option) any later version. The full text of the license can be
11 // found in the file LICENSE at the top level of the FSI-suite platform
12 // distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef amg_muelu_preconditioner_h
17 #define amg_muelu_preconditioner_h
18 
19 #include <deal.II/base/config.h>
20 
22 
23 #if defined(DEAL_II_WITH_TRILINOS) && defined(DEAL_II_TRILINOS_WITH_MUELU)
24 
26 
27 namespace ParsedLAC
28 {
36  : public dealii::ParameterAcceptor,
37  public dealii::TrilinosWrappers::PreconditionAMGMueLu
38  {
39  public:
43  AMGMueLuPreconditioner(const std::string &name = "",
44  const bool &elliptic = true,
45  const unsigned int &n_cycles = 1,
46  const bool &w_cycle = false,
47  const double &aggregation_threshold = 1e-4,
48  const unsigned int &smoother_sweeps = 2,
49  const unsigned int &smoother_overlap = 0,
50  const bool &output_details = false,
51  const std::string &smoother_type = "Chebyshev",
52  const std::string &coarse_type = "Amesos-KLU");
53 
57  template <typename Matrix>
58  void
59  initialize_preconditioner(const Matrix &matrix);
60 
61  using dealii::TrilinosWrappers::PreconditionAMGMueLu::initialize;
62 
63  private:
67  void
69 
77  bool elliptic;
78 
83  unsigned int n_cycles;
84 
89  bool w_cycle;
90 
101 
112  unsigned int smoother_sweeps;
113 
118  unsigned int smoother_overlap;
119 
126 
138  std::string smoother_type;
139 
144  std::string coarse_type;
145  };
146 
147 
148 } // namespace ParsedLAC
149 
150 #endif // DEAL_II_WITH_TRILINOS
151 
152 #endif
A parsed AMG preconditioner based on MueLu which uses parameter files to choose between different opt...
Definition: amg_muelu.h:38
unsigned int smoother_overlap
Determines the overlap in the SSOR/Chebyshev error smoother when run in parallel.
Definition: amg_muelu.h:118
std::string smoother_type
Determines which smoother to use for the AMG cycle.
Definition: amg_muelu.h:138
void initialize_preconditioner(const Matrix &matrix)
Initialize the preconditioner using matrix.
Definition: amg_muelu.cc:146
unsigned int smoother_sweeps
Determines how many sweeps of the smoother should be performed.
Definition: amg_muelu.h:112
std::string coarse_type
Determines which solver to use on the coarsest level.
Definition: amg_muelu.h:144
void add_parameters()
Add all parameter options.
Definition: amg_muelu.cc:55
AMGMueLuPreconditioner(const std::string &name="", const bool &elliptic=true, 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.
Definition: amg_muelu.cc:28
unsigned int n_cycles
Defines how many multigrid cycles should be performed by the preconditioner.
Definition: amg_muelu.h:83
bool output_details
If this flag is set to true, then internal information from the ML preconditioner is printed to scree...
Definition: amg_muelu.h:125
bool elliptic
Determines whether the AMG preconditioner should be optimized for elliptic problems (ML option smooth...
Definition: amg_muelu.h:77
double aggregation_threshold
This threshold tells the AMG setup how the coarsening should be performed.
Definition: amg_muelu.h:100
bool w_cycle
Defines whether a w-cycle should be used instead of the standard setting of a v-cycle.
Definition: amg_muelu.h:89
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Definition: amg.h:28