Skip to content

Commit

Permalink
runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Jan 14, 2016
1 parent 8623db3 commit ec62069
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@

table.citation td {
float: left;
min-width: 5%;
max-width: 80%;
}

pre {
box-shadow: 0px 1px 6px 0px lightgray;
}

dl.class {
padding: 5px;
box-shadow: -3px 0px 5px 0px lightgray;
box-shadow: 0px 1px 6px 0px lightgray;
}

dl.type {
padding: 5px;
box-shadow: 0px 1px 6px 0px lightgray;
}

pre {
Expand Down
33 changes: 33 additions & 0 deletions docs/runtime.rst
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
2 changes: 1 addition & 1 deletion docs/solvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Each of the solvers in AMGCL provides two overloads for the ``operator()``:
for a time step will act as a reasonably good preconditioner for several
subsequent time steps [DeSh12]_.

.. cpp:function:: boost::tuple<size_t, scalar_type> operator()(const Matrix &A, const Precond &P, const Vec1 &rhs, Vec2 &&x) const
.. cpp:function:: boost::tuple<size_t, scalar_type> operator()(const Precond &P, const Vec1 &rhs, Vec2 &&x) const

Computes the solution for the given right-hand side ``rhs``. The system
matrix is the same that was used for the setup of the preconditioner ``P``.
Expand Down

0 comments on commit ec62069

Please sign in to comment.