tests: cover the five materials that had none - #38
Open
petlenz wants to merge 2 commits into
Open
Conversation
exponential_isotropic_hardening, linear_damage_law, scalar_complement_weight,
strain_energy_state_function and vector_strain_state_function were referenced by
no test. Three are the SECOND of a pair whose first is well covered -- the
exponential hardening beside the linear one, the linear damage law beside the
exponential one, the complement weight beside the identity weight. The first of
a pair gets a test when it is written and the second inherits the assumption
that it is the same shape.
Asserted against the closed forms rather than against recorded output:
exponential hardening H = K_inf (1 - e^-dk), dH = K_inf d e^-dk, plus the
saturation that distinguishes it from linear hardening
linear damage law all three branches, including the 0.999 cap that keeps
(1-d) away from zero, and a zero range not dividing by 0
complement weight value = 1 - source
strain energy d(eps_eq)/d(eps) against a central difference
vector strain |n.eps.m|, and that the derivative carries the sign the
measure discards
The two hardening/damage materials take their input from a specific producer
property, so the tests use a small stub publishing one scalar under a chosen
name. That isolates the material instead of testing it behind a full plasticity
model, and building one context per value also shows it is a pure function of
its input.
Two of my own assertions were wrong first and are worth recording: I read
'hardening_modulus' as H when it is dH -- the material publishes H as
'hardening_stress' -- and asserted H < K_inf at kappa = 20, which is
mathematically true and numerically false once exp(-160) underflows.
weighted_sum, also listed in #34, is covered on feature/tangent-source-consumers
and is not duplicated here.
Closes #34.
Member
Author
|
Critical review. No findings. What I probed:
The two errors worth keeping visible are already in the PR body: I read |
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.
Closes #34.
Asserted against closed forms rather than recorded output:
exponential_isotropic_hardeningH = K_inf(1-e^{-δκ}),dH = K_inf δ e^{-δκ}, plus the saturation distinguishing it from linear hardeninglinear_damage_law0.999cap that keeps(1-d)away from zero, and a zero range not dividing by zeroscalar_complement_weightvalue = 1 - sourcestrain_energy_state_functiond(ε_eq)/dεagainst a central differencevector_strain_state_function|n·ε·m|, and that the derivative carries the sign the measure discardsThe hardening and damage materials read a specific producer property, so the tests use a small stub publishing one scalar under a chosen name. That isolates the material rather than testing it behind a full plasticity model, and one context per value also shows it is a pure function of its input.
Two of my own assertions were wrong first
I read
hardening_modulusasHwhen it isdH— the material publishesHashardening_stress— and assertedH < K_infat κ=20, which is mathematically true and numerically false onceexp(-160)underflows. Both are fixed; recording them because a test written from a guessed property name is worth less than no test.weighted_sum, also listed in #34, is covered on #29 and not duplicated here.