-
Notifications
You must be signed in to change notification settings - Fork 111
Refactor m_riemann_solvers
Module (HLLD Solver)
#909
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
Pull Request Overview
This PR refactors the HLLD Riemann solver implementation in the m_riemann_solvers module to make the code more concise and maintainable by replacing many element‐wise assignments with vectorized (array slice) assignments.
- Replaced individual assignments of magnetic fields and state vectors with array constructors and slicing.
- Consolidated duplicate flux computations into vectorized updates.
- Updated indexing for momentum and magnetic fluxes using concise slice notation.
Comments suppressed due to low confidence (1)
src/simulation/m_riemann_solvers.fpp:3217
- Verify that the vectorized indexing for the momentum flux assignment correctly corresponds to the intended physical indices and ordering.
flux_rs${XYZ}$_vf(j, k, l, [contxe + dir_idx(1), contxe + dir_idx(2), contxe + dir_idx(3)]) = F_hlld([2, 3, 4])
PR Code Suggestions ✨No code suggestions found for the PR. |
Pushed after making sure it passed HLLD specific tests which initially failed, yet I was able to resolve the issues. |
I will reverse the vectorization here if it turns to be error-prone as alleged. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #909 +/- ##
==========================================
+ Coverage 44.03% 44.15% +0.11%
==========================================
Files 68 68
Lines 18395 18347 -48
Branches 2227 2227
==========================================
Hits 8101 8101
+ Misses 8991 8943 -48
Partials 1303 1303 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Spencer Bryngelson <sbryngelson@gmail.com>
User description
Description
Reduced PR from (#855),
Essentially, I refactored math-critical items in
s_hlld_riemann_solver
subroutine.PR Type
Enhancement
Description
Refactored HLLD Riemann solver for improved code clarity
Replaced individual array assignments with array constructors
Simplified magnetic field and state vector computations
Consolidated flux calculations using vectorized operations
Changes diagram
Changes walkthrough 📝
m_riemann_solvers.fpp
HLLD solver refactoring with array operations
src/simulation/m_riemann_solvers.fpp