Controls for plotting residuals when MLMG fails#598
Merged
baperry2 merged 15 commits intoAMReX-Combustion:developmentfrom Dec 12, 2025
Merged
Controls for plotting residuals when MLMG fails#598baperry2 merged 15 commits intoAMReX-Combustion:developmentfrom
baperry2 merged 15 commits intoAMReX-Combustion:developmentfrom
Conversation
baperry2
requested changes
Dec 12, 2025
Collaborator
baperry2
left a comment
There was a problem hiding this comment.
Just a couple minor things to clean up.
Moved the plotting function to PeleLMeX_Plot.cpp and made the function a member of PeleLM like the other plotting functions. The function was renamed for consistency. Also, made use of GetVecOfPtrs and GetVecOfConstPtrs in the MAC projection.
004b4cf to
542bfc4
Compare
drummerdoc
approved these changes
Dec 12, 2025
baperry2
approved these changes
Dec 12, 2025
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.
When MLMG linear solvers fail to converge, it can be difficult to diagnose why. This PR helps users visualize the state and MLMG residuals after a given solve fails by providing:
pltMLMGResidual_<solver>_<step>_<iters>when MLMG solvers fail. This is accomplished by wrapping MLMG calls in try-catch blocks whenpeleLM.mlmg_fail_plt_residuals = trueThis PR also contains a minor unrelated LaTeX math formatting correction in the Smagorinsky model documentation.
Input parameters for dumping residuals to plot files:
Note that there are no solver-specific parameters for the Nodal projection solve because it is the last solve of a given time step and the maximum number of iterations can be controlled through
nodal_proj.maxiter.As an example, consider setting
diffusion.mlmg_fail_sdc_miniter = 2,diffusion.mlmg_fail_deltaT_miniter = 1, anddiffusion.mlmg_fail_temp_maxiter_after_sdc_deltaT_miniter = 3. This would result in dumping the temperature diffusion residuals for debugging only if the failure occurs after at least 2 SDC iterations and 1 deltaT iterations, and the MLMG solver has performed at least 3 iterations after those minimums have been reached as shown below: