From e0a46c9ce3e95dc916660a200e695f0417aa3037 Mon Sep 17 00:00:00 2001 From: hoffmaao Date: Mon, 21 Sep 2026 07:39:11 -0400 Subject: [PATCH] Read geometric_dimension as attribute or method, for Firedrake 2026 and earlier Firedrake 2026 made Mesh.geometric_dimension an attribute; earlier releases expose it as a method. viscous_power and flow_law called it, so the inversion in icepack/ismip7 could not run on the 2026 environment without this edit, which has lived uncommitted in the editable installs at Rice and on one workstation since 9 June. Landing it so every site can clone rather than rsync (icepack/ismip7#46). --- src/icepack2/model/minimization.py | 3 ++- src/icepack2/model/variational.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/icepack2/model/minimization.py b/src/icepack2/model/minimization.py index 6746fcc..324639c 100644 --- a/src/icepack2/model/minimization.py +++ b/src/icepack2/model/minimization.py @@ -30,7 +30,8 @@ def viscous_power(**kwargs): A, n = map(kwargs.get, parameter_names) mesh = ufl.domain.extract_unique_domain(M) - d = mesh.geometric_dimension() + d = mesh.geometric_dimension # FD2026: attribute; FD<=2025: method + d = d() if callable(d) else d M_2 = (inner(M, M) - tr(M) ** 2 / (d + 1)) / 2 M_n = conditional(eq(n, 1), M_2, M_2 ** ((n + 1) / 2)) diff --git a/src/icepack2/model/variational.py b/src/icepack2/model/variational.py index 599e23a..97d48b5 100644 --- a/src/icepack2/model/variational.py +++ b/src/icepack2/model/variational.py @@ -29,7 +29,8 @@ def flow_law(**kwargs): A, n = map(kwargs.get, ("flow_law_coefficient", "flow_law_exponent")) mesh = ufl.domain.extract_unique_domain(u) - d = mesh.geometric_dimension() + d = mesh.geometric_dimension # FD2026: attribute; FD<=2025: method + d = d() if callable(d) else d ε = sym(grad(u)) M_2 = (inner(M, M) - tr(M) ** 2 / (d + 1)) / 2