Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None option for Riesz Representation in derivatives #3552

Merged
merged 11 commits into from
May 8, 2024
7 changes: 6 additions & 1 deletion firedrake/adjoint_utils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ def _define_riesz_map_form(self, riesz_representation, V):
@no_annotations
def _ad_convert_type(self, value, options=None):
# `_ad_convert_type` is not annoated unlike to `_ad_convert_riesz`
dham marked this conversation as resolved.
Show resolved Hide resolved
return self._ad_convert_riesz(value, options=options)
options = {} if options is None else options
derivative_space = options.get("derivative_space", "primal")
if derivative_space == "primal":
return self._ad_convert_riesz(value, options=options)
else:
return value

def _ad_restore_at_checkpoint(self, checkpoint):
if isinstance(checkpoint, CheckpointBase):
Expand Down
Loading