• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FEniCS / ufl / 42614087104
83%

Build:
DEFAULT BRANCH: main
Ran 09 Nov 2026 12:06PM UTC
Jobs 1
Files 110
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Nov 2026 12:01PM UTC coverage: 81.486% (+0.5%) from 81.032%
42614087104

push

github

web-flow
Differentiate the dual slot of base form operators (#544)

* Fix dual-slot form argument counting

* Compare the stored function space in Interpolate.__eq__

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Fix dual-slot form argument handling

* Only differentiate derivative nodes in the base form operator chain rule

The chain rule dF/du = ∂F/∂u + Σ Action(∂F/∂N, dN/du) computes ∂F/∂N by
mapping the derivative rules over every integrand and FormSum component
of F. Integrands without a derivative node do not depend on `u` through
N, but they were passed through unchanged, so they leaked into ∂F/∂N.
For `derivative(J, u) + F` this gave a spurious Action(F, dN/du), and
for a FormSum with a Cofunction it raised a TypeError.

Map integrands without a derivative node to zero, and drop the empty
Forms that this leaves in a FormSum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Differentiate the dual slot of base form operators

A base form operator N(u; v*) is linear in its dual slot v*. When v*
depends on u, the product rule gives

    D[N(u; v*(u))][û] = ∂N/∂u(u; v*)[û] + N(u; Dv*[û]),

but only the first term was computed. For J = j(I u) with I an
interpolation, dJ/du is the adjoint interpolation I*(j'(I u)), whose
dual slot j'(I u) carries all of its dependence on u. The second
derivative of J was therefore ZeroBaseForm instead of I* j''(I u) I.

Add the dual-slot term, as N(u; Dv*) when Dv* is a Form and as
Action(N(u; v̂), Dv*) otherwise. To differentiate the result again:

- A BaseFormOperatorDerivative whose inner derivative is a FormSum or an
  Action is differentiated with `derivative`, by linearity and the
  Leibniz rule.
- `derivative` of a Form with base form operators expands its inner
  derivatives first.
- The Leibniz rule for Action numbers the new argument after the
  arguments of the Action, expands the derivatives of both slots and
  drops vanishing terms. `action` no longer requires a BaseForm on the
  left, s... (continued)

454 of 469 new or added lines in 15 files covered. (96.8%)

9 existing lines in 5 files now uncovered.

10946 of 13433 relevant lines covered (81.49%)

0.81 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
77.95
-0.95% ufl/action.py
5
79.24
1.6% ufl/algorithms/apply_derivatives.py
3
98.45
ufl/algorithms/restructure_base_form.py
1
93.44
0.59% ufl/algorithms/replace.py
1
82.35
-0.12% ufl/differentiation.py

Coverage Regressions

Lines Coverage ∆ File
4
82.35
-0.12% ufl/differentiation.py
2
77.95
-0.95% ufl/action.py
1
82.46
8.77% ufl/adjoint.py
1
93.7
0.78% ufl/core/base_form_operator.py
1
89.23
1.15% ufl/form.py
Jobs
ID Job ID Ran Files Coverage
1 42614087104.1 09 Nov 2026 12:06PM UTC 110
81.49
GitHub Action Run
Source Files on build 42614087104
  • Tree
  • List 110
  • Changed 16
  • Source Changed 0
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 85eadabc on github
  • Prev Build on main (#42027036586)
  • Next Build on main (#42707065667)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc