Skip to content

Commit

Permalink
Fix pullback of double derivatives on Piola type elements (#312)
Browse files Browse the repository at this point in the history
* Add handling of case where a split returns a form with no arguments (they have all been reduced to zeros).

* Add test case

* Add test and some error handling

* Apply restriction in formsplitter

* Fix docstring

* Fix apply pullback on piola mapped elements for double derivatives
  • Loading branch information
jorgensd authored Oct 7, 2024
1 parent 8384202 commit 2125dce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ufl/algorithms/apply_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
Imag,
Indexed,
IndexSum,
Jacobian,
JacobianDeterminant,
JacobianInverse,
ListTensor,
Product,
Expand Down Expand Up @@ -672,7 +674,7 @@ def reference_grad(self, o):
f = o.ufl_operands[0]

valid_operand = f._ufl_is_in_reference_frame_ or isinstance(
f, (JacobianInverse, SpatialCoordinate)
f, (JacobianInverse, SpatialCoordinate, Jacobian, JacobianDeterminant)
)
if not valid_operand:
raise ValueError("ReferenceGrad can only wrap a reference frame type!")
Expand Down

0 comments on commit 2125dce

Please sign in to comment.