-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
Runtime interface | ||
================= | ||
|
||
The compile-time configuration of the solvers used in AMGCL is not always | ||
convenient, especially if the solvers are used inside a software package or | ||
another library. That is why AMGCL provides runtime interface, which allows to | ||
postpone the configuration until, well, runtime. The classes inside | ||
:cpp:any:`amgcl::runtime` namespace correspond to their compile-time | ||
alternatives, but the only template parameter they have is the backend to use. | ||
The runtime classes accept parameters only as ``boost::property_tree::ptree`` | ||
for obvious reasons. Here is an example of using a runtime-configurable | ||
solver: | ||
|
||
.. code-block:: cpp | ||
#include <amgcl/backend/builtin.hpp> | ||
#include <amgcl/runtime.hpp> | ||
... | ||
boost::property_tree::ptree prm; | ||
prm.put("precond.coarsening.type", amgcl::runtime::coarsening::smoothed_aggregation); | ||
prm.put("precond.relaxation.type", amgcl::runtime::relaxation::spai0); | ||
prm.put("solver.type", amgcl::runtime::solver::gmres); | ||
amgcl::make_solver< | ||
amgcl::runtime::amg<Backend>, | ||
amgcl::runtime::iterative_solver<Backend> | ||
> solve(A, prm); | ||
.. doxygenenum:: amgcl::runtime::coarsening::type | ||
|
||
.. doxygenenum:: amgcl::runtime::relaxation::type | ||
|
||
.. doxygenenum:: amgcl::runtime::solver::type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters