Skip to content

Tension-field materials: TFTSplit, TFT fixes, strain energy for all laws - #36

Draft
hverhelst wants to merge 13 commits into
mainfrom
tft-membranes
Draft

hverhelst wants to merge 13 commits into
mainfrom
tft-membranes

Conversation

@hverhelst

@hverhelst hverhelst commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • New gsMaterialMatrixTFTSplit: the split tension-field model of Zhang & Kiendl, with an exact local solve (ExactLocalSolve 0/1/2) and a relaxed energy W_eff.
  • gsMaterialMatrixTFT (truncated TFT):
    • linear base laws now use the mid-surface wrinkle state;
    • optional Eta regularisation, on stress and tangent or tangent only;
    • guards for degenerate and non-finite states;
    • fixed shear factor in the theta check.
  • Strain energy eval3D_energy / eval3D_energy_C: Linear, Nonlinear (except Material::SvK), TFTSplit, truncated TFT (NaN where wrinkled) and Composite (per unit area).
  • Unit tests for all of the above, including FD checks of S = dW/dE and of the tangents.

The wrinkling drivers that use this are in gismo/gsStructuralAnalysis (branch tft-membranes).

Update: contravariant metric in gsMaterialMatrixBaseDim

FIXED: gsMaterialMatrixBaseDim, three more places where contravariant data was read from or stored as the covariant metric/basis (dim-2 deformed read, dim-3 m_acon_ori/m_acon_def stores); no reader today, no result changes
NEW: gsMaterialMatrixLinear_test: 2D SvK tensor on a sheared planar patch against the closed-form plane-stress tensor in contravariant components, plus a unit-square control

Behaviour change: 2D SvK on non-orthonormal planar patches

This branch reads the 2D undeformed contravariant metric from the contravariant storage. On main, that read took
the covariant metric. As a result, gsMaterialMatrixLinear<2>, and getMaterialMatrix<2> with Material = SvK, give
different results on every planar patch whose metric is not the identity, for example a scaled or sheared plate.

Example: example_shell2D with defaults (a 2 × 1 plate) gives a minimum deformation of −0.0633172, where main gives
−0.00244949. The new value equals the result of the same case with --composite, a material that never used that
member.

The new oracle test fails on main with relative error 4.78 and passes on this branch. Full suite on this branch:
582 tests pass (measured before 8396fc9).

Code in other modules that runs 2D SvK membranes on non-unit planar patches will see changed results. This was not
checked: only gsKLShell was built.

Interplay with #37

#37 (gsMaterialMatrixComposite fixes) also adds unittests/gsMaterialMatrixComposite_test.cpp, so merging the two
gives one add/add conflict. Resolve it by keeping both halves in one suite. With both merged, the full suite passes:
585 tests. Measured before 8396fc9, which rewrote unittests/gsMaterialMatrixComposite_test.cpp and touched gsMaterialMatrixComposite.h: the conflict resolution and the count need re-checking. After the merge, reword the eval3D_energy doxygen remark "dW/dε equals VectorN only for B = 0": with #37,
VectorN includes B.

Update: review fixes (8396fc9, 503a41a)

IMPROVED: gsMaterialMatrixTFTSplit evaluation batches the wrapped law: two calls (eval3D_vector, eval3D_matrix) over all points and fibres, instead of one call per point. Single-point calls remain only for dmatrix at wrinkled points, energy_C and the exact-mode providers. The class doxygen states the call count. The speed-up was not timed.
IMPROVED: TFTSplit checks. The public wrinkle() keeps all of its option and provider checks; its contract is unchanged. The eval3D_* path calls an unchecked core instead, and the Exact* option relation is validated once per evaluation, in wrinkleOptions().
API: new protected member gsMaterialMatrixTFTSplit::_wrinkleCore<bool Checked>, which subclasses can see. Inside eval3D_*, the per-point invariants (provider present, sizes) are now asserts only, so release builds do not check them.
FIXED: the central-difference step in the eval3D_*_C path of TFTSplit is now relative to the metric scale, h = 1e-5·max|C_ij|, instead of a fixed 1e-5. Results change only for metrics far from unit scale.
FIXED: doxygen comments of MaterialOutput::Theta and ::Gamma, which were copies of the TensionField comment.
IMPROVED: doxygen \ref → @ref; file header for gsMaterialMatrixTFTSplit_.cpp.
IMPROVED: tests. Every test the PR adds states its property, oracle and the origin of its tolerance. The exact float comparisons are commented as exact by construction; no CHECK changed. Helpers now sit inside their suites, in an anonymous namespace (503a41a for the wrinkle-assembler suite), and the gsInfo stream state is restored after the wrinkle-assembler tests.

Tests: the full suite passed 582/582 on the working tree before the last comment-only edits and helper moves. After those, the Nonlinear, TFT and TFTSplit suites pass (162 tests). After 503a41a, the wrinkle-assembler suite passes (4 tests). The full suite has not been re-run on 8396fc9 or 503a41a.

🤖 Generated with Claude Code

hverhelst and others added 9 commits November 5, 2026 23:53
… defects

New:
- gsMaterialMatrixTFTSplit: tension-field split with closed-form wrinkle
  direction, eta-regularisation, Exact mode (exact wrinkled-state solve,
  symmetric tangent, linear=false only), Midsurface option and fallback
  counters; shared helpers in gismo::detail_tftsplit (gsMaterialMatrixTFT.h).
- MaterialOutput WrinkleDir / WrinkleIntensity / GammaHat, stress_type
  100-104, eval3D_pstressDir for TFT and Split.
- Tests: gsMaterialMatrixLinear_test, gsMaterialMatrixTFTSplit_test,
  gsMaterialMatrixWrinkleOutputs_test; extended Nonlinear and TFT suites.
- Doxygen and README for the above.

Fixes (each with a regression test that failed before the fix):
- dCijkl_impl passed tensor g12 to Cfun, which takes Voigt 2*g12.
- TFT hyperelastic tangent was returned transposed; linear=true TFT
  tangent had a sign error in df/dE.
- TFT outputs used the unmodified stress.
- 2D _getMetricUndeformed_impl stored the covariant metric in m_Acon_ori.
- Compressible Cauchy stress returned zeros; now S/J.
- hasUndeformed() tested the deformed geometry.
- eval3D_pstressDir used a wrong frame/layout; now [d_min | d_max | N].
- _evalPStress / _evalPStrain on degenerate frames (G1 x G2 = 0): finite
  in 2D (N = e3), explicit NaN in 3D; _evalPStrain no longer overwrites
  S(2,2) and the normal with the third eigenpair. Non-degenerate results
  are unchanged.

Full unit-test run: 474 / 474 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015qurMNbDqCjWHyF4r7nicQ
…rames

- _tensionField returns taut (1) when the unmodified principal strains (strain
  criterion), stresses (stress criterion) or both (mixed) are not finite, as
  gsMaterialMatrixTFTSplit already does. A NaN deformed-to-reference metric
  ratio (inverted element) no longer reaches the theta root finders; the NaN
  still reaches the stress and the residual.
- detail_tftsplit::principalStressFrame: degenerate-frame guard of
  _evalPStress (10 eps test; planar basis -> N = e3, otherwise NaN).
- MaterialOutput legend: 1 taut, 0 wrinkled, -1 slack.

Finite, non-degenerate results are unchanged. gsMaterialMatrix suites pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in theta check

For a linear base law, the decorator fed the theta search a mid-surface stress N with a strain E at height z, while
the classification used the z-dependent stress. On curved states every root was rejected ("Everything failed??"),
theta fell back to 0 and Newton did not converge (hanging blanket, SvK airbag).

For linear == true the classification, theta search, gamma, modified stress, tangent and strain outputs are now all
built from the one mid-surface pair (N = C E_mid, E_mid), with the base law's TensionField criterion and the same
tolerances as gsMaterialMatrixTFTSplit. Results match Split with eta = 0: flat sheet and 5x5 blanket identical,
SvK airbag uz_M 0.208223846446 for both at load 1 (previously TFT stalled at 0.79); the 25x25 blanket reaches load 1.
linear == false is unchanged apart from the shear fix below.

_check_theta_full used 2 m1 m2 on the engineering shear strain E(2), counting the shear twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lit (eta 0)

Pins the behaviour of 6c214d4. A flat reference square is deformed into a curved surface (quadratic bump) and
evaluated with SvK wrapped by gsMaterialMatrixTFT<3,real_t,true> and by gsMaterialMatrixTFTSplit with eta = 0, at
wrinkled, taut and slack states. Asserted: TFT strain, stress and principal strain do not vary through the thickness
(with a control that the wrapped law's strain does vary by > 1e-4 relative); strain and stress equal Split to 1e-12
relative; single-point and single-row calls agree with the block call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gsMaterialMatrixTFT gains the options Eta (0..1, default 0) and
EtaTangentOnly (default false). With Eta > 0 the wrinkled/slack stress and
tangent are blended with the base law as in Zhang & Kiendl (Eqs. 35/40):
S_eff = (1-eta) S' + eta S, C_eff = (1-eta) J + eta C; the slack factor is
SlackMultiplier if > 0, else Eta. EtaTangentOnly keeps the pure
tension-field stress and blends only the tangent. Eta = 0 runs the
original statements unchanged.

Tests: TFT(Eta) equals TFTSplit(Eta) on wrinkled/taut/slack points,
tangent-only leaves stress and strain unchanged, FD check of the blended
tangent at Eta 0.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin eval3D_pstrain with Eta > 0 at wrinkled, taut and slack points (both
variants) and the slack-factor rule SlackMultiplier > 0 over Eta for
stress, tangent, strain and pstrain against TFTSplit. Keep the deformed
geometry of the FD tangent test alive for the whole evaluation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- bracketed Newton-bisection scalar pass, taut check at gamma = 0
- tolerance relative to the relaxed stress with a round-off floor;
  options ExactTol, ExactStagTol, ExactMaxIt
- acceptance: minimum test first, taut/slack reclassification inside a
  band, otherwise saddle or wrong branch (linearised fallback)
- separate counters and result flags (nonconverged, saddle, wrong branch,
  stagnated, taut, slack, skipped, 2x2); legacy sums kept
- docs: Pipkin relaxation and KKT partition; truncated TFT non-variational
- tests: exact-solve hardening; homogeneous wrinkled patch test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d exact solve

- gsMaterialMatrixBase: eval3D_energy / eval3D_energy_C virtuals, MaterialOutput::Energy
  through gsMaterialMatrixEval.
- W for gsMaterialMatrixLinear and every gsMaterialMatrixNonlinear variant (NH, MR, NH_ext, OG;
  compressible/incompressible; all implementations).
- gsMaterialMatrixTFTSplit: relaxed energy W_eff (NaN where no potential exists) and a globalised
  minimisation of Phi(v) = W(E + v⊗v) for the Exact mode, option ExactLocalSolve
  (0 legacy, 1 minimise where the legacy solve hands off (default), 2 minimise only).
- Tests: S = dW/dE by finite differences for every variant, W(0) = 0, W_eff gradient,
  KKT and brute-force global-minimum checks on anisotropic inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecks to tests

- gsMaterialMatrixTFT::eval3D_energy: wrapped W where taut, slack factor times W
  where slack (same factor as the stress), NaN where wrinkled (no potential).
- gsMaterialMatrixComposite::eval3D_energy: thickness-integrated energy per unit
  reference area, 1/2 e.A.e + e.B.k + 1/2 k.D.k, from the class's own A, B, D.
- gsMaterialMatrixBase: energy doc lists the new implementations.
- Tests: TFT energy (taut/slack/wrinkled/mixed/FD/shape, both variants); new
  gsMaterialMatrixComposite_test; 3D, large-strain and VectorN energy FD for
  Nonlinear and Linear; TFTSplit class-level W_eff FD, NaN case and
  ExactLocalSolve modes 1/2/3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etch flat-state test

- gsMaterialMatrixNonlinear: remove the unreachable Material::SvK path
  (getMaterialMatrix maps SvK to gsMaterialMatrixLinear); static_assert against
  it; fix swapped compressible/incompressible doc labels.
- gsMaterialMatrixTFT / TFTSplit: SlackMultiplier >= 0 (both) and Eta in [0,1]
  (TFTSplit) are checked at the first evaluation; option docs state the ranges.
- gsMaterialMatrixBaseDim::_evalStretch: the flat-state shortcut tested the trace
  of the Cartesian 2x2 block and fired for any state with l1^2 + l2^2 = 2; it now
  tests B against the tangent-plane projector (frame-invariant).
- TFTSplit docs: start rules, polish/stall/budget conditions of the exact solve.
- Tests for the option checks and the stretch shortcut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
>
class gsMaterialMatrixNonlinear : public gsMaterialMatrixBaseDim<dim,T>
{
static_assert(mat != Material::SvK, "gsMaterialMatrixNonlinear does not implement Material::SvK; use gsMaterialMatrixLinear (getMaterialMatrix maps Material::SvK to it)");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let s just remove SvK enum (then it fails loudly during compilation)

…-patch oracle

- Three more places stored or read the covariant metric/basis where the
  contravariant one belongs: the dim-2 deformed Acon_def read and the
  dim-3 m_acon_def / m_acon_ori stores. Nothing reads these values today,
  so no result changes.
- gsMaterialMatrixLinear_test: the 2D SvK tensor on a sheared planar patch
  against the closed-form plane-stress tensor in contravariant components,
  built from the patch Jacobian alone, plus a unit-square control. On main
  (covariant metric used) the skewed check fails with relative error 4.78.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hverhelst and others added 2 commits November 20, 2026 16:25
…espace inside the suite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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