Fixes #1656: preserve MHD calculations with case optimization#1658
Open
StevenXue98 wants to merge 1 commit into
Open
Fixes #1656: preserve MHD calculations with case optimization#1658StevenXue98 wants to merge 1 commit into
StevenXue98 wants to merge 1 commit into
Conversation
StevenXue98
marked this pull request as ready for review
July 18, 2026 07:51
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1658 +/- ##
=======================================
Coverage 59.53% 59.53%
=======================================
Files 83 83
Lines 21119 21119
Branches 3132 3132
=======================================
Hits 12574 12574
Misses 6439 6439
Partials 2106 2106 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
Replace case-optimization guards based on
num_dimswith guards based onnum_velsfor three-component MHD calculations in the HLL and LF Riemann solvers.MFC retains three velocity and magnetic-field components in 1D and 2D MHD cases. The previous dimensional guards compiled out required magnetic-pressure, relativistic-state, and energy-flux calculations in case-optimized lower-dimensional builds, causing the standard 2D MHD rotor example to produce NaNs.
The revised guards continue pruning three-component expressions from optimized lower-dimensional non-MHD builds while retaining them when
num_vels=3.Closes #1656.
Type of change
Testing
Tested with GNU Fortran 13.3.0 and Open MPI 4.1.6 on CPU with the following case-optimized HLL MHD cases:
All cases completed successfully with exit code 0. These runs cover the corrected HLL paths for ideal and relativistic MHD in both 1D and 2D.
Checklist
Check these like this
[x]to indicate which of the below applies.See the developer guide for full coding standards.
GPU changes (expand if you modified
src/simulation/)AI code reviews
Reviews are not retriggered automatically. To request a review, comment on the PR:
@claude full review— Claude full review (also triggers on PR open/reopen/ready)claude-full-review— Claude full review via label