refactor: extract s_write_field helper in post_process s_save_data#1600
Draft
SVS87 wants to merge 1 commit into
Draft
refactor: extract s_write_field helper in post_process s_save_data#1600SVS87 wants to merge 1 commit into
SVS87 wants to merge 1 commit into
Conversation
Collapse the 38 repeated fill->name->write->clear stanzas in s_save_data into calls to a new private helper s_write_field. The helper optionally slices a scalar_field into out%q_sf, writes varname to the database, and clears varname on return. Also fixes the ib_markers block which was missing the varname clear, and moves the elasticity/hyperelasticity varname clear inside the prim_vars_wrt guard where it belongs. Part of MFlowCode#1523
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1600 +/- ##
==========================================
- Coverage 60.94% 60.87% -0.07%
==========================================
Files 82 82
Lines 19922 19869 -53
Branches 2924 2925 +1
==========================================
- Hits 12141 12096 -45
+ Misses 5805 5797 -8
Partials 1976 1976 ☔ 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
Collapse the 38 repeated fill->name->write->clear stanzas in s_save_data into calls to a new private helper s_write_field. The helper optionally slices a scalar_field into out%q_sf, writes varname to the database, and clears varname on return.
Also fixes the ib_markers block which was missing the varname clear, and moves the elasticity/hyperelasticity varname clear inside the prim_vars_wrt guard where it belongs.
Part of #1523
Type of change (delete unused ones)
Testing
Ran ./mfc.sh test -j 4 locally on Ubuntu/WSL with GNU compiler and MPI. 578 tests passed, 0 failed. Output-neutral by construction — the helper performs the exact same slice, write, and clear in the same order, so database files are bit-identical.
Checklist
Check these like this
[x]to indicate which of the below applies.See the developer guide for full coding standards.
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