@@ -14,7 +14,8 @@ system using the geometric multigrid method. The constructor of
1414class of various linear operator
1515classes, :cpp: `MLABecLaplacian `, :cpp: `MLPoisson `,
1616:cpp: `MLNodeLaplacian `, etc. We choose the type of linear operator
17- class according to the type the linear system to solve.
17+ class according to the type the linear system to solve. Examples of the
18+ linear operators include
1819
1920- :cpp: `MLABecLaplacian ` for cell-centered canonical form (equation :eq: `eqn::abeclap `).
2021
@@ -321,7 +322,7 @@ There are many parameters that can be set. Here we discuss some
321322commonly used ones.
322323
323324:cpp: `MLLinOp::setVerbose(int) `, :cpp: `MLMG::setVerbose(int) ` and
324- :cpp: `MLMG:setBottomVerbose(int) ` control the verbosity of the
325+ :cpp: `MLMG:: setBottomVerbose(int) ` control the verbosity of the
325326linear operator, multigrid solver and the bottom solver, respectively.
326327
327328The multigrid solver is an iterative solver. The maximal number of
@@ -379,7 +380,7 @@ Available choices the bottom solver are
379380
380381- :cpp: `MLMG::BottomSolver::petsc `: Currently for cell-centered only.
381382
382- The :cpp: `LPInfo ` class can be used control the agglomeration and
383+ The :cpp: `LPInfo ` class can be used to control the agglomeration and
383384consolidation strategy for multigrid coarsening.
384385
385386- :cpp: `LPInfo::setAgglomeration(bool) ` (by default true) can be used
@@ -848,4 +849,76 @@ An example (implemented in the ``MultiComponent`` tutorial) might be:
848849
849850See ``amrex-tutorials/ExampleCodes/LinearSolvers/MultiComponent `` for a complete working example.
850851
851- .. solver reuse
852+
853+ Curl-Curl
854+ =========
855+
856+ The curl-curl solver supports solving the linear system arising from the
857+ discretized form of
858+
859+ .. math :: \nabla \times (\alpha \nabla \times \mathbf{E}) + \beta \mathbf{E} = \mathbf{f},
860+
861+ where :math: `\mathbf {E}` and :math: `\mathbf {f}` are defined on grid edges,
862+ :math: `\alpha ` is a positive scalar, and :math: `\beta ` is a non-negative
863+ scalar (either a constant or a field). An :cpp: `Array ` of three
864+ :cpp: `MultiFab `\ s is used to store the components of :math: `\mathbf {E}` and
865+ :math: `\mathbf {f}`. It's the user's responsibility to ensure that the
866+ right-hand-side data are consistent on edges shared by multiple
867+ :cpp: `Box `\ es. If needed, you can call :cpp: `MLCurlCurl::prepareRHS ` to
868+ perform this synchronization.
869+
870+ The solver supports 1D, 2D and 3D. Note that even in the 1D and 2D cases,
871+ :math: `\mathbf {E}` still has three components, one for each spatial
872+ direction.
873+
874+ Open Boundary Poisson Solver
875+ ============================
876+
877+ To solve Poisson's equation for isolated sources (i.e., no sources outside
878+ the boundary), there are several options. One option is to use :cpp: `MLMG `
879+ and :cpp: `MLPoisson ` with Dirichlet boundary conditions. The Dirichlet
880+ boundary values can be computed using the multipole method, as done in the
881+ Castro code (see e.g.,
882+ https://amrex-astro.github.io/Castro/docs/file/Gravity_8H.html#_CPPv49multipole).
883+ Another option is to use the FFT based solver
884+ :cpp: `amrex::FFT::PoissonOpenBC ` (see chapter :ref: `Chap:FFT `). A third
885+ option is :cpp: `amrex::OpenBCSolver `, which implements the James's method
886+ ("The Solution of Poisson's Equation for Isolated Source
887+ Distributions", R. A. James, 1977, Journal of Computational Physics, 25,
888+ 71). Below are some of the member functions of :cpp: `OpenBCSolver `.
889+
890+ .. highlight :: c++
891+
892+ ::
893+
894+ OpenBCSolver (const Vector<Geometry>& a_geom,
895+ const Vector<BoxArray>& a_grids,
896+ const Vector<DistributionMapping>& a_dmap,
897+ const LPInfo& a_info = LPInfo());
898+
899+ Real solve (const Vector<MultiFab*>& a_sol,
900+ const Vector<MultiFab const*>& a_rhs,
901+ Real a_tol_rel, Real a_tol_abs);
902+
903+
904+ GMRES
905+ =====
906+
907+ AMReX provides a template implementation of the generalized minimal residual
908+ method (GMRES). The class template parameters are :cpp: `V ` for a linear
909+ algebra vector class and :cpp: `M ` for a linear operator class. The linear
910+ algebra vector class can contain one or several :cpp: `MultiFab `\ s, or your
911+ own data container. The linear operator class represents a matrix
912+ conceptually. Although it does not need to store the matrix explicitly, it
913+ must be able to apply the matrix vector product for a given vector. It also
914+ must provide some basic operations such as dot product and linear
915+ combination. For the full set of requirements on the operator class, see
916+ https://amrex-codes.github.io/amrex/doxygen/classamrex_1_1GMRES.html#details.
917+
918+ An example of using GMRES combined with a Jacobi preconditioner to solve
919+ Poisson's equation can be found at
920+ https://amrex-codes.github.io/amrex/tutorials_html/LinearSolvers_Tutorial.html.
921+
922+ AMReX also provides :cpp: `GMRESMLMGT `, a class template that solves the
923+ linear system in :cpp: `MLMG ` using GMRES with :cpp: `MLMG ` itself serving as
924+ the preconditioner.
0 commit comments