Phase C (#90): FD-verify the generated consistent tangent end-to-end - #103
Merged
Conversation
…via numsim-materials numerical_diff_checker
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.
What
Ticks the "point numsim-materials'
numerical_diff_checkerat a codegen-generated material" box of the verification spine (#90). Independently verifies the strain-coupled consistent tangent shipped in #101.The prior tangent e2e (
ResidualReturnMapConsistentTangentHasCouplingTerm) pins specific rank-4 components against a hand-derived closed form. This adds a check that finite-differences the wholedσ/dεthrough the real property graph: the checker perturbs the strain, re-solves the Newton (reverting thezhistory so each sample restarts from the samez_old), and compares every component against the emitteddstress_dstrain. Because the coupling is captured by the re-solve rather than by construction, this is a genuinely independent check — it would catch any component the closed-form assertions didn't enumerate.Verification
max_rel_error = 5.4e-11across 8 loading steps (smooth response ⇒ tight central-difference agreement); gate at< 1e-6(5 orders of margin, not flaky).rel = 0.71, and the checker's worst-component diagnostics point exactly at the coupling entries (C(0,0,1,1): analytical0vs numericalc·ε₀₀). A verification test that can't fail is worthless; this one fails on the exact defect it exists to catch.Notes
NCG_TENSOR_E2E); reusestangent_checker<policy>(thenumerical_diff_checker<Traits, tensor2, tensor2>alias) exactly as the numsim-materials J2 tests do.