Feature/solverfactory
This MR introduces a solver factory that can assemble solvers to a given LinearOperator, that are fully configurable via a ParameterTree
.
It is based on a compile-time registry that can register class templates at compile time.
This compile time registry can then be added to a ParameterizedObjectFactory
.
We've introduced tree types of these Factories:
DirectSolverFactory
PreconditionerFactory
IterativeSolverFactory
We provide Macros for registering class templates. For example a preconditioner can be registered like that:
DUNE_REGISTER_PRECONDITIONER("ssor", default_preconditoner_BL_creator<Dune::SeqSSOR>());
where default_preconditoner_BL_creator<Dune::SeqSSOR>()
could also be replaced by a object that creates the preconditoner from a matrix and a ParameterTree
.
The solver factory can then be used like this:
std::shared_ptr<MatrixAdapter<Vector,Vector>> op = std::make_shared<MatrixAdapter<Vector,Vector>>(A);
std::shared_ptr<Dune::InverseOperator<Vector, Vector>> solver = getSolverFromFactory(op, solverConfig);
where solverConfig
is a ParameterTree containing a configuration tree:
[CGWithAMG]
type = cgsolver
verbose = 1
maxit = 1000
reduction = 1e-5
[CGWithAMG.preconditioner]
type = amg
iterations = 1
relaxation = 1
maxLevel = 10
It is planned to have a library "libduneistl" at some point that contains preconditioners and solvers for the most often used template parameters.
Merge request reports
Activity
added feature label
added 1 commit
- 61bcda46 - rename parameter for ILU Preconditioner to order
added 2 commits
mentioned in issue #26 (closed)
added 104 commits
-
ed5cbea9...5c3840ae - 85 commits from branch
master
- a1dfb706 - [factory] add typeregistry and test
- e3a83fbd - create a solverrepositry but need constructors that take shared_ptr
- da4a4aee - create SolverRepository, PreconditionerRepositiory and test
- 567de208 - add IterativeSolver s from solvers.hh to SolverRepository
- ff7798de - add direct solvers
- ec193abf - clean up
- be51ffa2 - extent test
- 6cd6f448 - add ParSSOR preconditioner
- fb39c4b3 - add blockpreconditioner
- cd8dce0a - add AMG to SolverRepository
- 43760533 - add NonoverlappingBlockPreconditioner
- 73602a4c - throw exceptions if direct solvers are not available
- 047c7cc4 - fix CI errors and warnings
- 37cdc9a2 - add parameter doc and cleanup
- 1c4cae58 - add more smoother to the AMG in the SolverRepository
- ed24c0cf - add BiCGSTAG_ILU test to the solverrepositorytest
- 7335ff04 - rename parameter for ILU Preconditioner to order
- 6a95b0a8 - add fastAMG to SolverRepository
- 14b94f40 - add KAMG to SolverRepository
Toggle commit list-
ed5cbea9...5c3840ae - 85 commits from branch
added 6 commits
- c2ea6174 - add `addRegistryToFactory` function to registry.hh
- 98ab8f79 - refactor SolverRepository to use the registry and ParameterizedObjectFactories
- 40b99cc7 - add duneistl lib with precompiled solver but yields a SIGART currently
- 24342c46 - simplify DirectSolverFactory
- 66e8c7f4 - make duneistl a static library
- 7ec96766 - extent library to compile for multiple block types
Toggle commit listadded 35 commits
-
ac9b81d2...9e5267ef - 5 commits from branch
master
- 3490f1bc - [factory] add typeregistry and test
- 2330dc7f - create a solverrepositry but need constructors that take shared_ptr
- c0232d87 - create SolverRepository, PreconditionerRepositiory and test
- 63aca6fd - add IterativeSolver s from solvers.hh to SolverRepository
- 5347a671 - add direct solvers
- 77fc20e8 - clean up
- 33141681 - extent test
- 5aee3c0a - add ParSSOR preconditioner
- 2d656598 - add blockpreconditioner
- 7e24cf1b - add AMG to SolverRepository
- dd29c7c4 - add NonoverlappingBlockPreconditioner
- 37511744 - throw exceptions if direct solvers are not available
- a18d7c2d - fix CI errors and warnings
- d279bae9 - add parameter doc and cleanup
- c00f5912 - add more smoother to the AMG in the SolverRepository
- c49a3d73 - add BiCGSTAG_ILU test to the solverrepositorytest
- 0b108d73 - rename parameter for ILU Preconditioner to order
- cdc5a77a - add fastAMG to SolverRepository
- 68ec30a7 - add KAMG to SolverRepository
- ba4558ba - add `addRegistryToFactory` function to registry.hh
- a120ecce - refactor SolverRepository to use the registry and ParameterizedObjectFactories
- a1fd2cc8 - add duneistl lib with precompiled solver but yields a SIGART currently
- 4885cae0 - simplify DirectSolverFactory
- 7d244400 - make duneistl a static library
- 38d6eed5 - extent library to compile for multiple block types
- acd2496f - link DUNE_LIBS properly
- 7b6b8383 - use DUNE_INLINE_VARIABLE
- 9a3256eb - introduce addRegisteredDirectSolversToFactory method
- 0c3e8966 - add the other direct solvers to the registry
- 595b0233 - add Preconditioner- and IterativeSolverFactory
Toggle commit list-
ac9b81d2...9e5267ef - 5 commits from branch
added 2 commits
added 1 commit
- de3cc18d - [registry] define custom creators for suitesparse solvers
added 1 commit
- 22af0304 - [solverfactory] add second default creator for preconditoners with block level
added 6 commits
- 3400cd9d - [solverfactory] remove UniqueTag and move register function in anonymous
- bf86e585 - [solverfactory] add more field type for solverregistry and adapt type checks...
- 97b36075 - [solverfactory] move everything into Dune namespace
- 437cbd26 - [solverfactory] Register more preconditioners
- 845ba1a4 - [solverfactory] register more iterative solvers
- 11fee01f - [solverfactory] add preconditioners and iterativesolvers to libduneistl
Toggle commit list