Skip to content

Commit

Permalink
Document preconditioners
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Dec 20, 2020
1 parent 5306d4b commit 116bb07
Show file tree
Hide file tree
Showing 5 changed files with 420 additions and 25 deletions.
14 changes: 7 additions & 7 deletions amgcl/preconditioner/schur_pressure_correction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ class schur_pressure_correction {
// as approximation for the Kuu^-1 (as in SIMPLEC algorithm)
bool simplec_dia;

int debug;
int verbose;

params() : type(1), approx_schur(false), adjust_p(1), simplec_dia(true), debug(0) {}
params() : type(1), approx_schur(false), adjust_p(1), simplec_dia(true), verbose(0) {}

#ifndef AMGCL_NO_BOOST
params(const boost::property_tree::ptree &p)
Expand All @@ -122,7 +122,7 @@ class schur_pressure_correction {
AMGCL_PARAMS_IMPORT_VALUE(p, approx_schur),
AMGCL_PARAMS_IMPORT_VALUE(p, adjust_p),
AMGCL_PARAMS_IMPORT_VALUE(p, simplec_dia),
AMGCL_PARAMS_IMPORT_VALUE(p, debug)
AMGCL_PARAMS_IMPORT_VALUE(p, verbose)
{
size_t n = 0;

Expand Down Expand Up @@ -170,7 +170,7 @@ class schur_pressure_correction {
);
}

check_params(p, {"usolver", "psolver", "type", "approx_schur", "adjust_p", "simplec_dia", "pmask_size", "debug"},
check_params(p, {"usolver", "psolver", "type", "approx_schur", "adjust_p", "simplec_dia", "pmask_size", "verbose"},
{"pmask", "pmask_pattern"});
}

Expand All @@ -182,7 +182,7 @@ class schur_pressure_correction {
AMGCL_PARAMS_EXPORT_VALUE(p, path, approx_schur);
AMGCL_PARAMS_EXPORT_VALUE(p, path, adjust_p);
AMGCL_PARAMS_EXPORT_VALUE(p, path, simplec_dia);
AMGCL_PARAMS_EXPORT_VALUE(p, path, debug);
AMGCL_PARAMS_EXPORT_VALUE(p, path, verbose);
}
#endif
} prm;
Expand Down Expand Up @@ -407,7 +407,7 @@ class schur_pressure_correction {
}
}

if (prm.debug >= 2) {
if (prm.verbose >= 2) {
io::mm_write("Kuu.mtx", *Kuu);
io::mm_write("Kpp.mtx", *Kpp);
}
Expand Down Expand Up @@ -588,7 +588,7 @@ class schur_pressure_correction {

template <typename I, typename E>
void report(const std::string &name, const std::tuple<I, E> &c) const {
if (prm.debug >= 1) {
if (prm.verbose >= 1) {
std::cout << name << " (" << std::get<0>(c) << ", " << std::get<1>(c) << ")\n";
}
}
Expand Down
2 changes: 2 additions & 0 deletions docs/bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Bibliography
.. [BeGL05] Benzi, Michele, Gene H. Golub, and Jörg Liesen. `Numerical solution of saddle point problems <https://doi.org/10.1017/S0962492904000212>`_. Acta numerica 14 (2005): 1-137.
.. [BrGr02] Bröker, Oliver, and Marcus J. Grote. `Sparse approximate inverse smoothers for geometric and algebraic multigrid <https://doi.org/10.1016/S0168-9274(01)00110-6>`_. Applied numerical mathematics 41.1 (2002): 61-80.
.. [BrMH85] Brandt, A., McCormick, S., & Huge, J. (1985). Algebraic multigrid (AMG) for sparse matrix equations. Sparsity and its Applications, 257.
.. [BrCC15] Brown, Geoffrey L., David A. Collins, and Zhangxin Chen. "Efficient preconditioning for algebraic multigrid and red-black ordering in adaptive-implicit black-oil simulations." SPE Reservoir Simulation Symposium. Society of Petroleum Engineers, 2015.
.. [CaGP73] Caretto, L. S., et al. `Two calculation procedures for steady, three-dimensional flows with recirculation <https://doi.org/10.1007/BFb0112677>`_. Proceedings of the third international conference on numerical methods in fluid mechanics. Springer Berlin Heidelberg, 1973.
.. [ChPa15] Chow, Edmond, and Aftab Patel. `Fine-grained parallel incomplete LU factorization <https://doi.org/10.1137/140968896>`_. SIAM journal on Scientific Computing 37.2 (2015): C169-C193.
.. [DeSh12] Demidov, D. E., and Shevchenko, D. V. `Modification of algebraic multigrid for effective GPGPU-based solution of nonstationary hydrodynamics problems <https://doi.org/10.1016/j.jocs.2012.08.008>`_. Journal of Computational Science 3.6 (2012): 460-462.
Expand All @@ -20,6 +21,7 @@ Bibliography
.. [GhKK12] P. Ghysels, P. Kłosiewicz, and W. Vanroose. `Improving the arithmetic intensity of multigrid with the help of polynomial smoothers <https://doi.org/10.1002/nla.1808>`_. Numer. Linear Algebra Appl. 2012;19:253-267.
.. [GiSo11] Van Gijzen, Martin B., and Peter Sonneveld. `Algorithm 913: An elegant IDR (s) variant that efficiently exploits biorthogonality properties <https://doi.org/10.1145/2049662.2049667>`_. ACM Transactions on Mathematical Software (TOMS) 38.1 (2011): 5.
.. [GmHJ15] Gmeiner, Björn, et al. `A quantitative performance study for Stokes solvers at the extreme scale <https://doi.org/10.1016/j.jocs.2016.06.006>`_. Journal of Computational Science 17 (2016): 509-521.
.. [Grie14] Gries, Sebastian, et al. "Preconditioning for efficiently applying algebraic multigrid in fully implicit reservoir simulations." SPE Journal 19.04 (2014): 726-736.
.. [Meye05] S. Meyers, Effective C++: 55 specific ways to improve your programs and designs, Pearson Education, 2005.
.. [Saad03] Saad, Yousef. Iterative methods for sparse linear systems. Siam, 2003.
.. [SaTu08] Sala, Marzio, and Raymond S. Tuminaro. `A new Petrov-Galerkin smoothed aggregation preconditioner for nonsymmetric linear systems <https://doi.org/10.1137/060659545>`_. SIAM Journal on Scientific Computing 31.1 (2008): 143-166.
Expand Down
2 changes: 1 addition & 1 deletion docs/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Components
AMGCL defines the following algorithmic components:

.. toctree::
:maxdepth: 2
:maxdepth: 3

components/backends
components/value_types
Expand Down
18 changes: 9 additions & 9 deletions docs/components/iter_solvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CG
--

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
cg
amgcl::solver::cg

.. rubric:: Include ``<amgcl/solver/cg.hpp>``

Expand Down Expand Up @@ -107,7 +107,7 @@ BiCGStab
--------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
bicgstab
amgcl::solver::bicgstab

.. rubric:: Include ``<amgcl/solver/bicgstab.hpp>``

Expand Down Expand Up @@ -163,7 +163,7 @@ BiCGStab(L)
-----------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
bicgstabl
amgcl::solver::bicgstabl

.. rubric:: Include ``<amgcl/solver/bicgstabl.hpp>``

Expand Down Expand Up @@ -231,7 +231,7 @@ GMRES
-----

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
gmres
amgcl::solver::gmres

.. rubric:: Include ``<amgcl/solver/gmres.hpp>``

Expand Down Expand Up @@ -290,7 +290,7 @@ GMRES
----------------------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
lgmres
amgcl::solver::lgmres

.. rubric:: Include ``<amgcl/solver/lgmres.hpp>``

Expand Down Expand Up @@ -364,7 +364,7 @@ Flexible GMRES (FGMRES)
-----------------------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
fgmres
amgcl::solver::fgmres

.. rubric:: Include ``<amgcl/solver/fgmres.hpp>``

Expand Down Expand Up @@ -422,7 +422,7 @@ IDR(s)
------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
idrs
amgcl::solver::idrs

.. rubric:: Include ``<amgcl/solver/idrs.hpp>``

Expand Down Expand Up @@ -498,7 +498,7 @@ Richardson iteration
--------------------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
richardson
amgcl::solver::richardson

.. rubric:: Include ``<amgcl/solver/richardson.hpp>``

Expand Down Expand Up @@ -550,7 +550,7 @@ PreOnly
-------

.. cpp:class:: template <class Backend, class InnerProduct = amgcl::detail::default_inner_product> \
preonly
amgcl::solver::preonly

.. rubric:: Include ``<amgcl/solver/preonly.hpp>``

Expand Down

0 comments on commit 116bb07

Please sign in to comment.