|
| template<typename SmootherFactory, typename CoarseSolver> |
| | multigrid (const std::vector< matrix_type > &levels, const std::vector< matrix_type > &restrictors, const std::vector< matrix_type > &prolongators, SmootherFactory smoother_factory, CoarseSolver coarse_solver, int nu_pre=2, int nu_post=2) |
| | Construct multigrid hierarchy.
|
| | multigrid (const multigrid &)=delete |
| | V-cycle starting from the given level.
|
| multigrid & | operator= (const multigrid &)=delete |
| | multigrid (multigrid &&)=default |
| multigrid & | operator= (multigrid &&)=default |
| void | vcycle (vector_type &x, const vector_type &b, int level=0) const |
| void | wcycle (vector_type &x, const vector_type &b, int level=0) const |
| | W-cycle: like V-cycle but recurses twice at each level.
|
| void | operator() (vector_type &x, const vector_type &b) const |
| | Apply V-cycle as operator() for use as a stand-alone solver iteration.
|
| template<typename VecX, typename VecB> |
| void | solve (VecX &x, const VecB &b) const |
| | Preconditioner interface: solve() applies one V-cycle to M*x = b.
|
| template<typename VecX, typename VecB> |
| void | adjoint_solve (VecX &x, const VecB &b) const |
| | adjoint_solve: same as solve (symmetric for symmetric smoothers)
|
template<typename Value = double, typename Accumulator = void>
class mtl::itl::mg::multigrid< Value, Accumulator >
Multigrid solver/preconditioner.
Smoother must have operator()(VecX&, const VecB&) -> VecX& interface. CoarseSolver must have operator()(VecX&, const VecB&) interface.
Not thread-safe, although vcycle, wcycle, solve and operator() are const: the smoothers and the coarse solver keep scratch (Jacobi's x_new, say) that every cycle writes through std::function. Two threads must not cycle one multigrid object at the same time; give each thread its own (issue 888).