Repository navigation
Constant properties: producers declare their pure outputs; phase simplified - #164
Merged
petlenz merged 6 commits intoOct 21, 2026
Conversation
constant_scalar, poisson_ratio_from_moduli, linear_elasticity, the Eshelby and depolarisation tensors, isotropic_tangent, isotropic_moduli, scalar_split, weighted_sum, phase and the global mean-field composite. With constant phases the global composite runs its kernel once. phase relays its outputs and reads its inputs by key.
The concentrations and the strains are separate callbacks; the concentrations are declared constant over the phase reads and the strains run after them.
This was referenced Oct 21, 2026
…nt-properties-producers
…stant-properties-local
…nt-properties-producers
…-local mean_field_strain: concentrations computed once for constant phases
petlenz
merged commit Oct 21, 2026
3f6eefe
into
feature/constant-properties-engine
0 of 3 checks passed
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.
The producers declare their pure outputs constant (part 2 of 3, split from #161; stacked on #163). As a result, the global mean-field composite of constant phases runs its kernel once: per update, Mori–Tanaka goes from 7.0 to 0.09 µs and self-consistent from 12.6 to 0.5 µs, with identical results.
What
Producers declaring their pure outputs (with
constant_outputoradd_callback(...).constant()from Constant properties: engine and API #163):constant_scalarvaluepoisson_ratio_from_modulivaluelinear_elasticitytangenttensorisotropic_tangenttangentisotropic_modulitensorphase(one group; not constant when the tangent comes over a local edge, i.e. the previous pass's)scalar_splitweighted_sumtangentmean_field_composite_globalphasesimplified: each output and the input it republishes form arelay, andinput(key)reads the<key>_source/<key>_propertypair (null without a source).add_callback(...).constant().tangent_sourceorfraction_sourcenow fails at construction with a clear message, instead of as a wiring error atfinalize().Not constant, as before: stresses, the local composites, and anything reading a history or a local edge.
docs/mean_field.md§3 describes when the global composite is computed once.Measured
Global composite: matrix plus aligned spheroids (aspect ratio 5, c = 0.2),
linear_stresson top, 2000 updates with a changing strain,-O2.Tests
MeanField.ConstantPhasesAreHomogenisedOnce:kernel_registry::add, is called once over five updates with a changing strain;Phase.*(3 tests, written before the refactor): inconsistent parameters (initial tangent without a local edge, unknown edge, empty source, Eshelby in 2D), a negative fraction, and which tensors are relayed. Against the old code only the empty-source checks failed.Gates (GCC 14, fetched dependencies): 1180/1180 tests, each also under ASan, 0 warnings. The build has no
NDEBUG, so the whole suite ran with verification on: none of the declarations above changes on a rerun (self-consistent included).