-
Notifications
You must be signed in to change notification settings - Fork 277
Add a factored-Laplacian MLMG preconditioner for the Darwin GMRES solve #7180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
RemiLehe
merged 18 commits into
BLAST-WarpX:development
from
roelof-groenewald:darwin_mlmg_preconditioner
Sep 3, 2026
+652
−60
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7eb04aa
Add a factored-Laplacian MLMG preconditioner for the Darwin GMRES solve
roelof-groenewald 3597ad3
reset checksum
roelof-groenewald 763e645
Use zero tolerance for preconditioner to fix number of iterations
roelof-groenewald 599d40e
remove unneeded, unreachable 3d assert
roelof-groenewald 3d96a07
Merge remote-tracking branch 'upstream/development' into darwin_mlmg_…
roelof-groenewald dabb620
Update checksum
RemiLehe f7c431a
Apply batched suggestions from code review
roelof-groenewald 6b8255e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3f33cbf
clean-up in picmi.py to reduce code duplication
roelof-groenewald 4fc4c3a
Rename `ComputeSusceptibilityCC` to `ScaledMassMatrixCC`
roelof-groenewald 283d4d7
fix out of bounds array access
roelof-groenewald c2a1447
attempt to fix const correctness issue
roelof-groenewald 1a3be31
second attempt to fix clang-tidy issue
roelof-groenewald 98f1a68
Merge branch 'development' into pr7180
RemiLehe d1f9edc
Apply suggestions from code review
roelof-groenewald 4d52554
Apply batched suggestions from code review
roelof-groenewald 1277406
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 73347dd
Remove confusing comment / description.
roelof-groenewald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
30 changes: 15 additions & 15 deletions
30
Regression/Checksum/benchmarks_json/test_2d_darwin_solver_em_modes_es_picmi.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,26 @@ | ||
| { | ||
| "electron": { | ||
| "particle_momentum_x": 6.34927151314996e-19, | ||
| "particle_momentum_y": 6.409422435076371e-19, | ||
| "particle_momentum_z": 6.66841263185746e-19, | ||
| "particle_position_x": 943.1663587753025, | ||
| "particle_position_y": 60355.016494036, | ||
| "particle_momentum_x": 6.348941729617574e-19, | ||
| "particle_momentum_y": 6.409610177870042e-19, | ||
| "particle_momentum_z": 6.668309310767983e-19, | ||
| "particle_position_x": 943.1657817267967, | ||
| "particle_position_y": 60355.2390525201, | ||
| "particle_weight": 1.463940203059113e+17 | ||
| }, | ||
| "ions": { | ||
| "particle_momentum_x": 1.9313151265758452e-18, | ||
| "particle_momentum_y": 1.9266742336211786e-18, | ||
| "particle_momentum_z": 1.9233575044457035e-18, | ||
| "particle_position_x": 943.1875241816265, | ||
| "particle_position_y": 60358.90549056562, | ||
| "particle_momentum_x": 1.931296499833215e-18, | ||
| "particle_momentum_y": 1.926679490873102e-18, | ||
| "particle_momentum_z": 1.923355061015629e-18, | ||
| "particle_position_x": 943.1876258374203, | ||
| "particle_position_y": 60359.13572213739, | ||
| "particle_weight": 1.463940203059113e+17 | ||
| }, | ||
| "lev=0": { | ||
| "Bx": 0.8518918672501272, | ||
| "By": 1.3910576389057014, | ||
| "Bx": 0.8516024083203164, | ||
| "By": 1.3912823741463232, | ||
| "Bz": 307.2, | ||
| "Ex": 111758764.58429599, | ||
| "Ey": 33475017.00102582, | ||
| "Ez": 102229395.20342489 | ||
| "Ex": 111894288.60163084, | ||
| "Ey": 33775455.97767793, | ||
| "Ez": 102230555.84232913 | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test, could you add an
assertthat checks the average number of GMRes iterations that were needed to converge, during the simulation.This would guard against any future bug or regression of the preconditioner. (This type of bug might otherwise be undetectable, since the outer GMRes algorithm would make sure that we get the correct physics nonetheless. But an incorrect preconditioner might result in many more iterations to get there.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! We would need to read the
stdoutlog to get that information, right? Do you know of a different test that currently does that so I can match the way it is done?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, now that I look into it, I don't think that there is an exact precedent.
It seems that https://github.com/BLAST-WarpX/warpx/blob/development/Examples/Tests/implicit/analysis_petsc_matrix.py#L18 does something similar, but relies on this diagnostic machinery:
https://github.com/BLAST-WarpX/warpx/blob/development/Source/NonlinearSolvers/NewtonSolver.H#L243
which only exists for non-linear solvers.
Maybe this should to be addressed in a follow-up PR.