Commit 94bd1ab
authored
Update convergence criterion for MLMG (BLAST-WarpX#6408)
In BLAST-WarpX#2410, the convergence
criterion of the MLMG solver was modified so as to use the norm of `b`
(whenever `|b|` is not zero), to evaluate the relative error in the
Poisson equation (written as `Ax = b`) and decide when to stop the
iterations.
However, there are cases where this it not suitable. A typical case is
when the user fixes a large value of the potential at the boundaries (or
on the embedded boundary), and also has a very low-charge beam in the
simulation. In this case, the residual is dominated by the potential
created by the boundaries, but the norm of `b` (which depends on the
charge density of the beam) is very low, resulting in a large
`resid/bnorm`. In some cases, this large `resid/bnorm` can even trigger
the error `MLMG failing so lets stop here` because of this check in
AMREX:
https://github.com/AMReX-Codes/amrex/blob/development/Src/LinearSolvers/MLMG/AMReX_MLMG.H#L539
Instead, with this PR, we always use the maximum of the norm of `b` and
of the initial residual `resid0` to evaluate the relative error in the
Poisson equation - instead of using directly the maximum of the norm of
`b`.
I also checked that this fixes the issue mentioned here:
BLAST-WarpX#6161 (comment)
The changes in the checksum is because of the change in convergence
criterion.1 parent d158107 commit 94bd1ab
File tree
5 files changed
+23
-28
lines changed- Regression/Checksum/benchmarks_json
- Source/ablastr/fields
5 files changed
+23
-28
lines changedLines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 153 | | |
158 | 154 | | |
159 | 155 | | |
| |||
231 | 227 | | |
232 | 228 | | |
233 | 229 | | |
234 | | - | |
| 230 | + | |
235 | 231 | | |
236 | 232 | | |
237 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | 264 | | |
269 | 265 | | |
270 | 266 | | |
| |||
274 | 270 | | |
275 | 271 | | |
276 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
| |||
404 | 403 | | |
405 | 404 | | |
406 | 405 | | |
407 | | - | |
| 406 | + | |
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
| |||
0 commit comments