Fluid structure interaction suite
ilu.cc
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 
17 
18 #include <parsed_lac/ilu.h>
19 
20 #ifdef DEAL_II_WITH_TRILINOS
21 
22 using namespace dealii;
23 
24 namespace ParsedLAC
25 {
26  ILUPreconditioner::ILUPreconditioner(const std::string &name,
27  const unsigned int &ilu_fill,
28  const double &ilu_atol,
29  const double &ilu_rtol,
30  const unsigned int &overlap)
31  : ParameterAcceptor(name)
32  , PreconditionILU()
33  , ilu_fill(ilu_fill)
34  , ilu_atol(ilu_atol)
35  , ilu_rtol(ilu_rtol)
36  , overlap(overlap)
37  {
39  }
40 
41  void
43  {
44  add_parameter("Fill-in", ilu_fill, "Additional fill-in.");
45 
46  add_parameter("ILU atol",
47  ilu_atol,
48  "The amount of perturbation to add to diagonal entries.");
49 
50  add_parameter("ILU rtol", ilu_rtol, "Scaling factor for diagonal entries.");
51 
52  add_parameter("Overlap", overlap, "Overlap between processors.");
53  }
54 
55  template <typename Matrix>
56  void
58  {
60 
61  data.ilu_fill = ilu_fill;
62  data.ilu_atol = ilu_atol;
63  data.ilu_rtol = ilu_rtol;
64  data.overlap = overlap;
65  this->initialize(matrix, data);
66  }
67 } // namespace ParsedLAC
68 
69 template void
71  dealii::TrilinosWrappers::SparseMatrix>(
72  const dealii::TrilinosWrappers::SparseMatrix &);
73 
74 #endif
static void initialize(const std::string &filename="", const std::string &output_filename="", const ParameterHandler::OutputStyle output_style_for_output_filename=ParameterHandler::Short, ParameterHandler &prm=ParameterAcceptor::prm, const ParameterHandler::OutputStyle output_style_for_filename=ParameterHandler::DefaultStyle)
void add_parameter(const std::string &entry, ParameterType &parameter, const std::string &documentation="", ParameterHandler &prm_=prm, const Patterns::PatternBase &pattern=*Patterns::Tools::Convert< ParameterType >::to_pattern())
void initialize_preconditioner(const Matrix &matrix)
Initialize the preconditioner using matrix.
Definition: ilu.cc:57
unsigned int overlap
Overlap between processors.
Definition: ilu.h:125
unsigned int ilu_fill
This specifies the amount of additional fill-in elements besides the original sparse matrix structure...
Definition: ilu.h:78
double ilu_rtol
Scaling factor for diagonal entries.
Definition: ilu.h:110
void add_parameters()
Declare preconditioner options.
Definition: ilu.cc:42
double ilu_atol
The amount of perturbation to add to diagonal entries.
Definition: ilu.h:94
Definition: amg.h:28