Skip to content

Epic: property engine 2 — hardening (finite-strain partials, engine split, hot path, one way to do it) #237

Open
0 of 6 issues completed

Description

@petlenz

Why

Epic #221 puts the concepts in place: a typed, inspectable graph, iteration groups, residual systems with the implicit-function-theorem tangent, declared partials with a finite-difference check, history kinds, checkpoints, and one error contract (#231). A review of #222–#231 found no design flaw, but three things keep the engine from being future-proof:

  1. Finite strain cannot be differentiated. core/derivatives.h packs every rank-2 value into 6 Mandel components and keeps only its symmetric part. As a result:
  2. core/property_engine.h has become one class doing six jobs. It grows from 609 lines on main to 1359 lines with Property engine: residual systems set up at run time (#218) #229: graph building, scheduling and constant folding, iteration groups, derivative plans, residual-system solving, and history state. Every new feature touches the same file, and the units cannot be tested on their own.
  3. The hot path is unmeasured. The FFT host evaluates millions of points per iteration. The review found allocations on hot paths:

Two more things block usefulness rather than correctness:

  • there are two ways to do most things (old derivative outputs next to partials, vector_newton / backward_euler next to system, the deprecated declaration API);
  • docs/writing_a_material.md predates partials, systems and the error contract.

Target

  • Every value the graph carries can be differentiated: symmetric tensors as Mandel-6, general tensors as full-9, with the layout chosen from the declared kind.
  • The engine is a thin facade over separately tested units, with no file over about 400 lines.
  • update() and differentiate() allocate nothing after the first call. A benchmark in the repo shows the cost per point against main for elasticity, J2 on system, the damage chain with derivatives, and a composite group.
  • There is one way to declare a callback, get a tangent and solve a local system. The old paths are removed after a deprecation release.
  • A material author can write a new model from the guide alone. The guide's example compiles as part of the tests.

Phases (merge order)

Already open and in scope

Decisions

Done when

  • Every phase is merged.
  • The benchmark table is in the H3 PR and there is no regression against main.
  • check_partials passes for every material, including neo_hooke and hencky_elasticity.
  • grep -r deprecated include/ is empty after H4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions