Skip to content

fix: restore plastic strain zeroing on remesh gap elements - #93

Open
echoi wants to merge 2 commits into
masterfrom
fix/restore-bottom-plstrain
Open

echoi wants to merge 2 commits into
masterfrom
fix/restore-bottom-plstrain

Conversation

@echoi

@echoi echoi commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Zero plastic strain, delta plastic strain, and strain on elements that lie fully or partially outside the old mesh after remeshing (gap elements from remeshing_option=11 restore_bottom, or any remesh that expands the domain). These elements were previously inheriting spurious non-zero plastic strain from the nearest old boundary element via the kNN first-pass copy in inject_field(). Applies the existing (previously unused) boundary_field() helper, which blends each field toward 0 proportionally to empty_vec — fully zeroing purely-gap elements and partially correcting straddling elements.
  • Fixes a stale parameter name in examples/core-complex-mmg.cfg: output_averaged_fields was never registered by input.cxx (the actual option is sim.is_outputting_averaged_fields, per examples/defaults.cfg), so it was silently ignored. Checked all other .cfg files under examples/, benchmarks/, and gospl_driver/examples/ for the same stale name — this was the only occurrence.

Test plan

  • Rerun a restore_bottom remesh case and confirm gap elements no longer carry nonzero plastic strain.
  • Confirm core-complex-mmg.cfg now parses is_outputting_averaged_fields correctly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rqf5nW3ahreo3Skp1Lpss6

echoi and others added 2 commits September 4, 2026 21:24
…er remesh

After nearest-neighbor interpolation, elements that lie fully or partially
outside the old mesh (gap elements created by remeshing_option=11
restore_bottom, or any remesh that expands the domain) incorrectly inherit
non-zero plastic strain from the nearest old boundary element via the kNN
first-pass copy.

Apply the existing boundary_field() helper to plstrain, delta_plstrain, and
strain immediately after inject_field().  boundary_field() blends each
field toward 0 proportionally to empty_vec (fraction of ACM sample points
outside the old mesh), so purely gap elements are fully zeroed and straddling
elements are partially corrected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…elds

examples/core-complex-mmg.cfg used the old parameter name, which
input.cxx never registered (the current option is
sim.is_outputting_averaged_fields, per examples/defaults.cfg). Checked
all other .cfg files under examples/, benchmarks/, and
gospl_driver/examples/ for the same stale name; this was the only one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqf5nW3ahreo3Skp1Lpss6

@chaseshyu chaseshyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updates are great and ready to merge but were blocked because Debian Bullseye LTS ended recently. A fix PR has been sent to fix this CI error #94.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants