dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07878
Use of LinearSolver
LinearSolver is now a general wrapper for all linear solvers
(rather than a base class for linear solvers). Creating a LinearSolver
and reusing it instead of calling solve() multiple times gives
about 5% speedup.
It's a subclass of Parametrized, meaning that it's possible to set
parameters. For example, it should be possible to do
LinearSolver solver(gmres, amg);
solver.set("Krylov relative tolerance", 1e-6);
solver.set("Krylov absolute tolerance". 1e-6);
solver.solve(A, x, b);
and have those parameters passed on to the backend (for example
PETSc).
For those of you interested in setting special parameters to different
backends, the available parameters are listed in
dolfin/parameter/DefaultParameters.h
and they are accessed in the different backends by for example
tol = get("Krylov relative tolerance");
Supply a patch if there are parameters you think are missing.
We probably should not support all parameters for all backends.
--
Anders
Follow ups