DUNE-FEM (unstable)

petscavailable.hh
1#ifndef DUNE_FEM_PETSCAVAILABLE_HH
2#define DUNE_FEM_PETSCAVAILABLE_HH
3
4#include <limits>
5
6#include <dune/fem/io/parameter.hh>
7#include <dune/fem/solver/inverseoperatorinterface.hh>
8#include <dune/fem/solver/parameter.hh>
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 //=====================================================================
17 // Implementation of available solver/preconditioners for
18 // PETSc matrix based Krylov solvers
19 //=====================================================================
20
27 {
28 protected:
29 enum class PetscSolver {
30 cg = SolverParameter::cg,
31 bicgstab = SolverParameter::bicgstab,
32 gmres = SolverParameter::gmres,
33 minres = SolverParameter::minres,
34 bicg = SolverParameter::bicg,
35 preonly = SolverParameter::preonly,
36 kspoptions = 0
37 };
38
39
40 public:
41 static std::vector< int > supportedSolverMethods()
42 {
43 return std::vector< int > ({
44 SolverParameter::gmres, // default solver
45 SolverParameter::cg,
46 SolverParameter::bicgstab,
47 SolverParameter::minres,
48 SolverParameter::bicg,
49 SolverParameter::preonly });
50 }
51
52 static std::vector< int > supportedPreconditionMethods()
53 {
54 return std::vector< int > ({
55 SolverParameter::none, // no preconditioning
56 SolverParameter::oas, // Overlapping Additive Schwarz
57 SolverParameter::gauss_seidel, // SOR with omega = 1
58 SolverParameter::sor, // SOR
59 SolverParameter::ssor, // symmetric SOR
60 SolverParameter::jacobi, // Jacobi preconditioning
61 SolverParameter::ilu, // ILU preconditioning
62 SolverParameter::icc // Incomplete Cholesky factorization
63 });
64 }
65
66 static std::vector<std::string> extraPreconditionMethods()
67 {
68 return std::vector< std::string > (
69 {"kspoptions", // = 0, // use command line options -ksp...
70 "hypre", // = -1, // Hypre preconditioning
71 "ml", // = -2, // ML preconditioner (from Trilinos)
72 "lu", // = -3, // LU factorization
73 "pcgamg", // = -4 // Petsc internal AMG
74 });
75 }
76 };
77
79
80 } // namespace Fem
81
82} // namespace Dune
83
84#endif // #ifndef DUNE_FEM_PETSCINVERSEOPERATORS_HH
PETSc KSP solver context for PETSc Mat and PETSc Vec.
Definition: petscavailable.hh:27
constexpr GeometryType none(unsigned int dim)
Returns a GeometryType representing a singular of dimension dim.
Definition: type.hh:471
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)