[WIP] Allow Hypre MLMG bottom solver - #7223
Open
roelof-groenewald wants to merge 2 commits into
Open
Conversation
Adds a `WarpX_HYPRE` build option (mirroring `WarpX_PETSC`) which enables
`AMReX_HYPRE`, and plumbs the AMReX MLMG bottom solver settings through the
electrostatic solvers so that HYPRE (BoomerAMG) can be used for the solve on
the coarsest multigrid level.
The new options are collected in `ablastr::fields::MLMGOptions` and are
exposed as
warpx.self_fields_bottom_solver
warpx.self_fields_bottom_verbosity
warpx.self_fields_bottom_max_iters
warpx.self_fields_bottom_relative_tolerance
warpx.self_fields_bottom_absolute_tolerance
warpx.self_fields_max_coarsening_level
with matching PICMI keyword arguments. HYPRE's own options are read by AMReX
from the `hypre` input file namespace, for which a `pywarpx.hypre` bucket is
added.
A strong bottom solver only pays off when the coarsest multigrid level is
still a sizeable problem, which is why the coarsening depth is exposed as
well.
HYPRE is currently not supported for the embedded boundary and RZ solves,
since `amrex::MLEBNodeFDLaplacian` does not implement `fillIJMatrix`/`fillRHS`
yet; requesting it there (or without a HYPRE build, or in 1D) now aborts with
a descriptive message.
Adds `test_3d_electrostatic_sphere_lab_frame_hypre`, gated on `WarpX_HYPRE`,
which limits the coarsening depth so that the bottom solve is a non-trivial
problem.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
amrex::MLEBNodeFDLaplacian can now assemble its matrix, so the guard only needs to reject RZ, where the radial metrics are still missing. Adds test_3d_electrostatic_sphere_eb_mixed_bc_hypre, a copy of the mixed PEC/Neumann embedded-boundary sphere test that caps coarsening so the HYPRE bottom solve is a real problem. Its checksums agree with the non-HYPRE test to 2e-11. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Member
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR allows setting the bottom solve in the MLMG iterative solver to use the Hypre library. It also exposes several other bottom solve settings that can be used to help optimize the Poisson solver for a given problem.
Needs:
Closes #7210.