Fluid structure interaction suite
amg_petsc.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 //
3 // Copyright (C) 2015 by the deal2lkit authors
4 //
5 // This file is part of the deal2lkit library.
6 //
7 // The deal2lkit library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal2lkit distribution.
13 //
14 //-----------------------------------------------------------
15 
16 #ifndef amg_petsc_preconditioner_h
17 #define amg_petsc_preconditioner_h
18 
19 #include <deal.II/base/config.h>
20 
21 #ifdef DEAL_II_WITH_PETSC
22 
24 
26 
27 namespace ParsedLAC
28 {
36  : public dealii::ParameterAcceptor,
37  public dealii::PETScWrappers::PreconditionBoomerAMG
38  {
39  public:
40  using RelaxationType = dealii::PETScWrappers::PreconditionBoomerAMG::
41  AdditionalData::RelaxationType;
46  const std::string &name = "",
47  const bool symmetric_operator = false,
48  const double strong_threshold = 0.25,
49  const double max_row_sum = 0.9,
50  const unsigned int aggressive_coarsening_num_levels = 0,
51  const bool output_details = false,
52  const RelaxationType relaxation_type_up = RelaxationType::SORJacobi,
53  const RelaxationType relaxation_type_down = RelaxationType::SORJacobi,
55  RelaxationType::GaussianElimination,
56  const unsigned int n_sweeps_coarse = 1,
57  const double tol = 0.0,
58  const unsigned int max_iter = 1,
59  const bool w_cycle = false);
60 
64  void
65  initialize(const dealii::PETScWrappers::MatrixBase &matrix);
66 
67  private:
71  void
73 
80 
87 
99  double max_row_sum;
100 
107 
113 
118 
123 
128 
132  unsigned int n_sweeps_coarse;
133 
137  double tol;
138 
142  unsigned int max_iter;
143 
148  bool w_cycle;
149  };
150 
151 
152 } // namespace ParsedLAC
153 
154 #endif // DEAL_II_WITH_PETSC
155 
156 #endif
A parsed AMG preconditioner which uses parameter files to choose between different options.
Definition: amg_petsc.h:38
double strong_threshold
Threshold of when nodes are considered strongly connected.
Definition: amg_petsc.h:86
unsigned int aggressive_coarsening_num_levels
Number of levels of aggressive coarsening.
Definition: amg_petsc.h:106
bool symmetric_operator
Set this flag to true if you have a symmetric system matrix and you want to use a solver which assume...
Definition: amg_petsc.h:79
RelaxationType relaxation_type_coarse
Choose relaxation type coarse.
Definition: amg_petsc.h:127
PETScWrappers::PreconditionBoomerAMG::AdditionalData::RelaxationType RelaxationType
Definition: amg_petsc.h:41
unsigned int n_sweeps_coarse
Choose number of sweeps on coarse grid.
Definition: amg_petsc.h:132
RelaxationType relaxation_type_up
Choose relaxation type up.
Definition: amg_petsc.h:117
PETScAMGPreconditioner(const std::string &name="", const bool symmetric_operator=false, const double strong_threshold=0.25, const double max_row_sum=0.9, const unsigned int aggressive_coarsening_num_levels=0, const bool output_details=false, const RelaxationType relaxation_type_up=RelaxationType::SORJacobi, const RelaxationType relaxation_type_down=RelaxationType::SORJacobi, const RelaxationType relaxation_type_coarse=RelaxationType::GaussianElimination, const unsigned int n_sweeps_coarse=1, const double tol=0.0, const unsigned int max_iter=1, const bool w_cycle=false)
Constructor.
Definition: amg_petsc.cc:32
double tol
Choose BommerAMG tolerance.
Definition: amg_petsc.h:137
void add_parameters()
Declare preconditioner options.
Definition: amg_petsc.cc:65
double max_row_sum
If set to a value smaller than 1.0 then diagonally dominant parts of the matrix are treated as having...
Definition: amg_petsc.h:99
bool w_cycle
Defines whether a w-cycle should be used instead of the standard setting of a v-cycle.
Definition: amg_petsc.h:148
unsigned int max_iter
Choose BommerAMG maximum number of cycles.
Definition: amg_petsc.h:142
RelaxationType relaxation_type_down
Choose relaxation type down.
Definition: amg_petsc.h:122
bool output_details
Setting this flag to true produces debug output from HYPRE, when the preconditioner is constructed.
Definition: amg_petsc.h:112
Definition: amg.h:28