Skip to content

Plate bending demo with symbolic interpolation operators - #5401

Open
pbrubeck wants to merge 31 commits into
mainfrom
pbrubeck/plate-bending-demo
Open

pbrubeck wants to merge 31 commits into
mainfrom
pbrubeck/plate-bending-demo

Conversation

@pbrubeck

@pbrubeck pbrubeck commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Assisted by OpenAI Codex and Claude Code.

Summary

Add a plate bending demo. Each of its three nonconforming methods replaces a function in one term of the variational form by its canonical interpolant into a second space. The demo writes this interpolant with a symbolic interpolate inside the form. Both spaces are on the same mesh, so the form compiler applies the interpolation inside each element kernel (same-mesh support from #5258).

plate_bending.py.rst
├── MITC (Reissner–Mindlin)       interpolate(grad(w) - beta, N1curl)        shear term
├── Modified Morley (Kirchhoff)   grad(interpolate(w, P1))                    membrane term
└── Discrete Kirchhoff triangle   grad(interpolate(grad(w), Rotated-BR))      bending term

The demo shows that the Morley method does not converge in the membrane limit of a plate under tension, and that the modified Morley method does. It then compares the rotation errors of the three methods in the broken H¹ seminorm.

Changes for users:

  • DirichletBC now accepts Morley spaces. A constant boundary value goes directly to elements that have point evaluation degrees of freedom; any other value is interpolated or projected as before.

     DirichletBC(V, g, sub_domain)
    -  Morley: NotImplementedError
    +  Morley: interpolate/project g, as for other elements
  • firedrake.pyplot plots functions in spaces whose basis is not the pullback of the reference basis (Morley, Hermite, reduced Hermite, Raviart–Thomas, Bernardi–Raugel, rotated Bernardi–Raugel). Before it samples them, it interpolates them into a broken Lagrange space.

Evidence

  • Before: no demo; DirichletBC(FunctionSpace(mesh, "Morley", 2), 0, "on_boundary") raises NotImplementedError; plots of mapped elements sample the reference basis.
    After: the demo runs and prints the values in its tables:

    n MITC rate Modified Morley rate Discrete Kirchhoff rate
    4 4.260e-02 -- 4.519e-02 -- 2.453e-02 --
    8 3.002e-02 0.50 3.127e-02 0.53 1.290e-02 0.93
    16 1.711e-02 0.81 1.808e-02 0.79 6.516e-03 0.99
    32 8.992e-03 0.93 9.602e-03 0.91 3.261e-03 1.00

    At t = 10⁻⁴, the Morley error stays at 8.0e-03 while the modified Morley error decreases at rate 1.89.

  • Tests that pass:

    • test_demos_run.py -k "plate_bending or no_missing": 2 passed, 0 skipped.
    • test_plotting.py -k "mapped or pullback": 7 passed.
    • test_zany_convergence.py -k kirchhoff: 1 passed.
    • test_bcs.py -k morley: passed on 1 and 2 processes.
  • make srclint is clean. The Sphinx HTML build succeeds, and the page shows the three element diagrams and the surface plot.

Implementation details

  • docs/Makefile compiles the TikZ diagrams in demos/*/*.tex with pdflatex and converts them to SVG with pdftocairo. The docs CI job installs poppler-utils for pdftocairo.
  • A column-pairs table class in the docs theme separates the error and rate columns of each method.
  • test_helmholtz_zany.py is renamed to test_zany_convergence.py, and it now also tests the convergence of the discrete Kirchhoff triangle.

Merge Danger

Door: two-way

Blast Radius: demos, plotting, DirichletBC

The DirichletBC change affects every boundary condition: a numeric value is now converted to UFL before it is applied. The docs build now needs pdflatex and pdftocairo for every demo diagram.

🤖 Generated with Claude Code

@pbrubeck pbrubeck added the LLM used An LLM was used in the production of this PR label Aug 27, 2026
@pbrubeck pbrubeck changed the title Plate bending demo using MITC Demos for symbolic interpolation inside a variational form Aug 27, 2026
@UZerbinati UZerbinati self-assigned this Aug 27, 2026
@pbrubeck
pbrubeck force-pushed the pbrubeck/form-interp-tsfc branch 10 times, most recently from 37fe40f to 4cce203 Compare September 10, 2026 16:38
@pbrubeck
pbrubeck force-pushed the pbrubeck/plate-bending-demo branch from 4cd06f0 to 1a5c69e Compare September 10, 2026 23:15
@pbrubeck pbrubeck added base:main Run this PR using a main (dev) build and removed base:main Run this PR using a main (dev) build labels Sep 10, 2026
@pbrubeck
pbrubeck force-pushed the pbrubeck/form-interp-tsfc branch 7 times, most recently from 49f2247 to 243649b Compare September 17, 2026 20:44
@pbrubeck
pbrubeck force-pushed the pbrubeck/plate-bending-demo branch from aac3f9a to d86c8c5 Compare September 17, 2026 20:44
@pbrubeck
pbrubeck removed this pull request from stack #5402 September 30, 2026 11:06
@pbrubeck
pbrubeck added this pull request to stack #5493 September 30, 2026 11:15
@pbrubeck
pbrubeck removed this pull request from stack #5493 October 22, 2026 13:57
@pbrubeck
pbrubeck added this pull request to stack #5550 October 22, 2026 13:57
@pbrubeck
pbrubeck force-pushed the pbrubeck/form-interp-tsfc branch from c407caf to 0e10a44 Compare October 29, 2026 17:23
pbrubeck and others added 3 commits November 19, 2026 19:56
The commuting property of the scalar and Nédélec interpolants is only
used to justify the MITC reduced constraint, so state it there.  The list
of methods now follows the sentence that introduces it, the discrete
Kirchhoff method is described as a plate under in-plane tension, and the
Reissner-Mindlin energy ends with a comma before its "where" clause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E4waqaawTixm9QfuVW76Hg
Compare the Morley and modified Morley methods at epsilon = 1e-4. The
Morley error does not decrease under refinement, while the modified
Morley method converges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pbrubeck
pbrubeck force-pushed the pbrubeck/plate-bending-demo branch from 0b74432 to d24996c Compare November 19, 2026 19:58
@pbrubeck pbrubeck changed the title Demos for symbolic interpolation inside a variational form Plate bending demo with symbolic reduction operators Nov 19, 2026
pbrubeck and others added 4 commits November 19, 2026 20:15
Introduce the test rotation of the bending form, explain the t^{-2}
scaling of the shear term, write delta for the perturbation parameter
so it does not clash with the strain, define V_h and W_h before they are
used, and call grad(beta) the rotation gradient rather than the
curvature. Correct the claim about the Morley form at D = 0 and the
reason for weak boundary conditions. Accent Nédélec in the diagram and
update the discrete Kirchhoff errors to what the demo prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiE9EbBapfyhts8ndUSq73
pdf2svg is not installed on the docs CI runner; pdftocairo ships with
poppler-utils, which texlive-full already pulls in. Stop tracking the
generated SVGs, since CI rebuilds them and differing copies would dirty the
tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiE9EbBapfyhts8ndUSq73
The Morley degrees of freedom on the boundary are the vertex values and
the mean normal derivatives on the edges, which the clamped data
determines. Drop Morley from the strong BC guard and replace the Nitsche
terms in the plate bending demo with a DirichletBC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiE9EbBapfyhts8ndUSq73
Reuse the Morley solver in the membrane limit and refresh the tutorial
figure. Conjugate the Kirchhoff test function and evaluate scalar
Dirichlet data against the dual basis when required. Check the linear
Morley trace and normal derivative moments in the boundary regression.

Honor UFL pullback overrides when plotting and stop diagram conversion
when LaTeX fails.

Assisted-by: OpenAI Codex
pbrubeck and others added 12 commits November 28, 2026 02:49
Keep the plate-bending tutorial, its figures, and its registration in the demo tests. Use a restricted Morley space for the clamped boundary and interpolate the Kirchhoff solution to cubic Lagrange for plotting.
Define the applied tension and scaled deflection, introduce the test rotation and clamped Morley space, and vary the thickness in the membrane-limit study.

Assisted-by: OpenAI Codex
Introduce the three reduction operators up front, describe every element
space by its role and degrees of freedom, and explain why each reduction
is needed. The code is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the SVG diagrams of the demos in make copy_demos with pdflatex and
pdftocairo, instead of committing the generated files. Install
poppler-utils in the docs job for pdftocairo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop Morley from the strong BC guard again and replace the restricted
Morley space in the plate bending demo with a DirichletBC.

The merge fb56d42 reverted these branch changes, which this commit
restores from a clean merge of the same parents:
- the evaluation of scalar Dirichlet data against the dual basis in
  DirichletBC, and test_morley_constant_bc;
- the docs/Makefile rule that compiles the TikZ diagrams, and the
  .gitignore entry for the generated SVGs. This replaces the loop that
  178d18f added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compile the TikZ diagrams in copy_demos into build/diagrams and write
the SVGs straight to source/demos, so that no generated file lands in
demos/ and no .gitignore entry is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge fb56d42 reverted these branch changes, which this commit
restores from a clean merge of the same parents:
- FunctionPlotter interpolates functions in mapped elements into broken
  Lagrange before it samples them, with its two tests;
- test_discrete_kirchhoff.py;
- the column-pairs table style.

With the plotting fix, the demo plots the reduced Hermite solution
directly, without the interpolation into DG3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_helmholtz_zany.py is where solve() with zany elements is tested.
Give the module a general docstring and move the description of the
Helmholtz problem to helmholtz(), with the solution that the code uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In test_morley_constant_bc, assign the boundary condition and the test
function separately, explain each check, and check the rank-local
normal derivative moments with parallel_assert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file now tests the convergence of the discrete Kirchhoff triangle as
well as of the Helmholtz problem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Call each operator the canonical interpolant into its space, defined by
its degrees of freedom. Keep "reduction operator" only for the MITC
shear interpolant, as in Brezzi, Bathe and Fortin. Measure the rotation
error in the broken H1 seminorm, and expand MITC at its first use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pefarrell
pefarrell previously approved these changes Dec 3, 2026
Put the summary of the demo and its author in an emphasis block, and
link the Argyris element. Define each canonical interpolant by the
equations that match its degrees of freedom, cross-reference
interpolate and Constant, and set the defined terms deflection and
rotation in bold. Explain that the limiting Morley matrix is singular
because the linear Lagrange interpolant has a nontrivial nullspace.

Cite the paper of each method in the list of the three methods. Call
the cellwise gradient the broken gradient, and measure the deflection
error of the membrane study in the broken H1 seminorm. Remove repeated
statements of the clamped boundary conditions, of the vertex values
that the linear Lagrange interpolant keeps, and of the membrane limit
of the Morley method. Say how the reduced Hermite element sets the
value at the barycentre. Label the arrows in the element diagrams as
interpolation operators, and rewrap the prose at 80 columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pbrubeck
pbrubeck force-pushed the pbrubeck/plate-bending-demo branch from 4858b59 to cd6a944 Compare December 3, 2026 15:13
@pbrubeck pbrubeck changed the title Plate bending demo with symbolic reduction operators Plate bending demo with symbolic interpolation operators Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

base:main Run this PR using a main (dev) build documentation LLM used An LLM was used in the production of this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants