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

FEniCS / ufl / 32257537194
80%

Build:
DEFAULT BRANCH: main
Ran 19 Aug 2026 01:22PM UTC
Jobs 1
Files 109
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

19 Aug 2026 01:16PM UTC coverage: 79.746% (+0.2%) from 79.553%
32257537194

push

github

web-flow
Cancel contractions of the Jacobian with its inverse (#496)

* Cancel contractions of the Jacobian with its inverse

Preserve Jacobian, JacobianInverse and JacobianDeterminant during
geometry lowering, and cancel J-Jinv contractions into Kronecker
deltas before the inverse is expanded into individual matrix entries.
Eliminate the resulting Identity tensors by contraction against the
remaining factors, and cancel reciprocal factors within products,
such as detJ**2 * (1/detJ)**2.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Address review: convert to DAGTraverser, add tests

IndexSumSimplifier (and its JacobianCanceller/IdentityEliminator
subclasses) and ReciprocalCanceller were plain MultiFunctions; convert
them to DAGTraverser, matching the convention used by the rest of the
newer algorithms modules (apply_derivatives.py,
apply_coefficient_split.py). This switches the driver function from
map_integrand_dags (the MultiFunction-compatible entry point) to
map_integrands, since a DAGTraverser is called directly rather than
through map_expr_dag.

Add test/test_cancel_jacobian_products.py, covering JacobianCanceller
and IdentityEliminator on both contraction orders (J.K and K.J),
ReciprocalCanceller on both a fully- and a partially-cancelling
reciprocal product, the full pass end-to-end on a div-div form over a
contravariant Piola-mapped (Raviart-Thomas) element (verifying both
the size reduction and that the opt-in flag defaults to off), and a
no-op check on a form with no Jacobian contractions to cancel.

* Address review: test mathematical correctness, not just size/absence

The div-div test only checked that the cancelled integrand's string
representation was shorter than the uncancelled one -- a check that
would pass even for a wrong simplification, as long as it happened to
produce something smaller.

Replace it with two meaningful checks against the intermediate result
cancel_jacobian_products actually produces (before further geometry
... (continued)

201 of 229 new or added lines in 2 files covered. (87.77%)

9989 of 12526 relevant lines covered (79.75%)

0.8 hits per line

Uncovered Changes

Lines Coverage ∆ File
23
89.4
ufl/algorithms/cancel_jacobian_products.py
5
92.06
-7.94% ufl/algorithms/compute_form_data.py
Jobs
ID Job ID Ran Files Coverage
1 32257537194.1 19 Aug 2026 01:22PM UTC 109
79.75
GitHub Action Run
Source Files on build 32257537194
  • Tree
  • List 109
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ebbfdfa9 on github
  • Prev Build on main (#32009042654)
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