Skip to content

refactor: extract s_write_field helper in post_process s_save_data#1600

Open
SVS87 wants to merge 3 commits into
MFlowCode:masterfrom
SVS87:refactor/write-field-helper
Open

refactor: extract s_write_field helper in post_process s_save_data#1600
SVS87 wants to merge 3 commits into
MFlowCode:masterfrom
SVS87:refactor/write-field-helper

Conversation

@SVS87

@SVS87 SVS87 commented Jun 15, 2026

Copy link
Copy Markdown

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)

  • Bug fix
  • Refactor

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.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

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)
  • Or add label claude-full-review — Claude full review via label

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
@SVS87 SVS87 requested a review from sbryngelson as a code owner June 15, 2026 08:02
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.45%. Comparing base (b4be438) to head (0926d3d).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/post_process/m_start_up.fpp 88.88% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1600      +/-   ##
==========================================
- Coverage   60.51%   60.45%   -0.07%     
==========================================
  Files          83       83              
  Lines       19905    19852      -53     
  Branches     2950     2951       +1     
==========================================
- Hits        12046    12001      -45     
+ Misses       5866     5858       -8     
  Partials     1993     1993              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbryngelson sbryngelson marked this pull request as draft June 15, 2026 12:44
@SVS87 SVS87 marked this pull request as ready for review June 19, 2026 06:50
@sbryngelson sbryngelson marked this pull request as draft June 20, 2026 05:59
@SVS87 SVS87 marked this pull request as ready for review June 21, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant