DUNE-FEM (unstable)

parameterdoc.hh
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
14namespace 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
26template <class Scheme>
27auto 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(
35A scheme finds a solution `u=ufl.TrialFunction` for a given variational equation.
36The main method is `solve` which takes a discrete functions as `target` argument to
37store the solution. The method always uses a Newton method to solve the problem.
38The linear solver used in each iteration of the Newton method can be chosen
39using the `solver` parameter in the constructor of the scheme. Available solvers are:
40)doc"
41+ str.first +
42R"doc(
43In 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
45first argument and the solver to use as second, e.g.,
46'solver=("suitesparse","umfpack")'.
47
48The 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 +
69R"doc(
70The functionality of some of the preconditioners listed for petsc will
71depend on the petsc installation.
72)doc";
73return doc;
74 }
75
76#endif
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)