DUNE
dune-fem
2.12-git
Loading...
Searching...
No Matches
dune-fem
dune
fem
solver
parameterdoc.hh
Go to the documentation of this file.
1
#ifndef DUNE_FEM_SOLVER_PARAMETERDOC_HH
2
#define DUNE_FEM_SOLVER_PARAMETERDOC_HH
3
4
#include <
string
>
5
#include <
iostream
>
6
#include <
sstream
>
7
#include <
utility
>
8
#include <
set
>
9
#include <
vector
>
10
#include <
iomanip
>
11
12
#include <
dune/fem/solver/parameter.hh
>
13
14
namespace
Dune
15
{
16
namespace
Fem{
17
18
namespace
detail {
19
20
std::pair< std::string, std::string >
solverString(
const
bool
havePetsc);
21
}
// namespace
22
23
}
24
}
25
26
template
<
class
Scheme>
27
auto
docString
()
28
{
29
bool
havePetsc =
false
;
30
#if HAVE_PETSC
31
havePetsc =
true
;
32
#endif
33
auto
str = Dune::Fem::detail::solverString(havePetsc);
34
std::string
doc = R
"doc(
35
A scheme finds a solution `u=ufl.TrialFunction` for a given variational equation.
36
The main method is `solve` which takes a discrete functions as `target` argument to
37
store the solution. The method always uses a Newton method to solve the problem.
38
The linear solver used in each iteration of the Newton method can be chosen
39
using the `solver` parameter in the constructor of the scheme. Available solvers are:
40
)doc"
41
+ str.first +
42
R
"doc(
43
In addition the direct solvers from the `suitesparse` package can be used with the
44
`numpy` storage. In this case provide a tuple as `solver` argument with "suitesparse" as
45
first argument and the solver to use as second, e.g.,
46
'solver=("suitesparse","umfpack")'.
47
48
The detailed behavior of the schemes can be customized by providing a
49
`parameters` dictionary to the scheme constructor, e.g.,
50
{"nonlinear.tolerance": 1e-3, # tolerance for newton solver
51
"nonlinear.verbose": False, # toggle iteration output
52
"nonlinear.maxiterations": maxInt, # max number of nonlinear iterations
53
"nonlinear.linesearch": True, # use a simple bisection line search
54
"nonlinear.forcing": "none", # can switch to eisenstatwalker
55
"nonlinear.simplified": False, # use a quasi Newton method with single Jacobian evaluation
56
57
"linear.tolerance": 1e-5, # tolerance for linear solver
58
"linear.verbose": False, # toggle linear iteration output
59
"linear.maxiterations":1000, # max number of linear iterations
60
"linear.errormeasure": "absolute", # or "relative" or "residualreduction"
61
62
"linear.preconditioning.method": "jacobi", # (see table below)
63
"linear.preconditioning.hypre.method": "boomeramg", # "pilu-t" "parasails"
64
"linear.preconditioning.iteration": 3, # iterations for preconditioner
65
"linear.preconditioning.relaxation": 1.0, # omega for SOR and ILU
66
"linear.preconditioning.level": 0} # fill-in level for ILU preconditioning
67
)doc"
68
+ str.second +
69
R
"doc(
70
The functionality of some of the preconditioners listed for petsc will
71
depend on the petsc installation.
72
)doc";
73
return
doc;
74
}
75
76
#endif
Dune
docString
auto docString()
Definition
parameterdoc.hh:27
parameter.hh
std::string
iomanip
iostream
std::pair< std::string, std::string >
set
sstream
string
utility
vector
Legal Statements / Impressum
| Hosted by
TU Dresden
&
Uni Heidelberg
| Generated by
1.9.8