Skip to content

Commit

Permalink
ZeroBaseForm rather than Zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Ig-dolci committed Feb 27, 2025
1 parent 575cc0a commit dcbb2fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ufl/algorithms/apply_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ def external_operator(self, N, *dfs):
*N.ufl_operands, derivatives=derivatives, argument_slots=new_args
)
elif df == 0:
extop = Zero(N.ufl_shape)
extop = ZeroBaseForm(N.arguments())
else:
raise NotImplementedError(
"Frechet derivative of external operators need to be provided!"
Expand Down Expand Up @@ -1401,8 +1401,6 @@ def base_form_operator_derivative(self, o, f, dummy_w, dummy_v, dummy_cd):
return ZeroBaseForm(arguments)
# We need to go through the dag first to record the pending operations
mapped_expr = map_expr_dag(rules, f, vcache=self.vcaches[key], rcache=self.rcaches[key])
if isinstance(mapped_expr, Zero):
mapped_expr = ZeroBaseForm(f.arguments())
mapped_f = rules.coefficient(f)
if mapped_f != 0:
# If dN/dN needs to return an Argument in N space
Expand Down

0 comments on commit dcbb2fe

Please sign in to comment.