From f69bca6fca56edae2d37ef36c2919b75b80df903 Mon Sep 17 00:00:00 2001 From: Iglesia Dolci Date: Sun, 8 Dec 2024 10:39:52 +0000 Subject: [PATCH] Small fix. --- firedrake/adjoint_utils/function.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firedrake/adjoint_utils/function.py b/firedrake/adjoint_utils/function.py index ed4c73e60a..bf13e363b7 100644 --- a/firedrake/adjoint_utils/function.py +++ b/firedrake/adjoint_utils/function.py @@ -226,7 +226,7 @@ def _ad_convert_riesz(self, value, options=None): options = {} if options is None else options riesz_representation = options.get("riesz_representation", "L2") solver_options = options.get("solver_options", {}) - mensure_options = options.get("mensure_options", {}) + measure_options = options.get("measure_options", {}) V = options.get("function_space", self.function_space()) if value == 0.: # In adjoint-based differentiation, value == 0. arises only when @@ -245,7 +245,7 @@ def _ad_convert_riesz(self, value, options=None): ret = Function(V) a = self._define_riesz_map_form( - riesz_representation, V, mensure_options) + riesz_representation, V, measure_options) firedrake.solve(a == value, ret, **solver_options) return ret @@ -256,18 +256,18 @@ def _ad_convert_riesz(self, value, options=None): raise ValueError( "Unknown Riesz representation %s" % riesz_representation) - def _define_riesz_map_form(self, riesz_representation, V, mensure_options): + def _define_riesz_map_form(self, riesz_representation, V, measure_options): from firedrake import TrialFunction, TestFunction u = TrialFunction(V) v = TestFunction(V) if riesz_representation == "L2": - a = firedrake.inner(u, v)*firedrake.dx(**mensure_options) + a = firedrake.inner(u, v)*firedrake.dx(**measure_options) elif riesz_representation == "H1": - a = firedrake.inner(u, v)*firedrake.dx(**mensure_options) \ + a = firedrake.inner(u, v)*firedrake.dx(**measure_options) \ + firedrake.inner(firedrake.grad(u), firedrake.grad(v) - ) * firedrake.dx(**mensure_options) + ) * firedrake.dx(**measure_options) else: raise NotImplementedError(