Skip to content

mean_field_strain: concentrations computed once for constant phases - #165

Merged
petlenz merged 2 commits into
feature/constant-properties-producersfrom
feature/constant-properties-local
Oct 21, 2026
Merged

petlenz merged 2 commits into
feature/constant-properties-producersfrom
feature/constant-properties-local

Conversation

@petlenz

@petlenz petlenz commented Oct 21, 2026

Copy link
Copy Markdown
Member

mean_field_strain splits its concentrations from its strains, so that with constant phases the localisation computes its concentrations once (part 3 of 3, split from #161; stacked on #164).

What

  • Concentrations and strains are separate callbacks. The concentrations are declared constant over the phase reads, and the strains run after them:
    auto &concentrations{base::add_callback(&mean_field_strain::compute_concentrations, m_A).constant(phase_reads)};
    base::add_callback(&mean_field_strain::compute_strains, m_eps).runs_after(concentrations);
    With constant phases the concentrations are computed once and only the strains every update. A phase read over a local edge (nonlinear) recomputes them every pass. The strains are history and stay in the loop.
  • docs/mean_field.md describes the split.

Measured

The same phases as in #164 through mean_field_strain, linear_stress per phase and mean_field_composite_local_linear, 2000 committed steps, -O2 -DNDEBUG.

kernel before after stress checksum
Mori–Tanaka 4.51 µs / update 1.14 µs identical
self-consistent 10.38 µs / update 1.64 µs identical

Tests

  • MeanFieldLocal.ConstantPhasesAreLocalisedWithConcentrationsComputedOnce: a counting Mori–Tanaka kernel is called once over five committed steps, with stresses and strains equal to plain Mori–Tanaka. It failed before the split.
  • Ordering: strain_<inclusion> has no callback of its own. Without the writer edges from Constant properties: engine and API #163 it ran after stiff::stress in some hash orders. test_mean_field_local and test_short_fibre_composite were repeated 10× each, all passing.

Gates (GCC 14, fetched dependencies): 1182/1182 tests, each also under ASan, 0 warnings. The tree is identical to the last commit of #161, whose 14 docs/materials report checks passed.

The concentrations and the strains are separate callbacks; the concentrations
are declared constant over the phase reads and the strains run after them.
@petlenz
petlenz merged commit 11a5da8 into feature/constant-properties-producers Oct 21, 2026
3 checks passed
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.

1 participant