Refactor m_riemann_solvers Module (HLLD Solver)#909
Refactor m_riemann_solvers Module (HLLD Solver)#909sbryngelson merged 6 commits intoMFlowCode:masterfrom
m_riemann_solvers Module (HLLD Solver)#909Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
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_solversubroutine.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 operationssrc/simulation/m_riemann_solvers.fpp