Skip to content

Commit

Permalink
Fix on new versions of Firedrake
Browse files Browse the repository at this point in the history
  • Loading branch information
danshapero committed Jan 23, 2024
1 parent 3546e49 commit 9f79fbf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions demos/kangerd/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,17 @@ def regularization(u):
σ_x = firedrake.Function(Δ)
σ_y = firedrake.Function(Δ)

u_o.dat.data[:] = velocity_data["vx"][indices[:, 1], indices[:, 0]]
v_o.dat.data[:] = velocity_data["vy"][indices[:, 1], indices[:, 0]]
σ_x.dat.data[:] = velocity_data["ex"][indices[:, 1], indices[:, 0]]
σ_y.dat.data[:] = velocity_data["ey"][indices[:, 1], indices[:, 0]]
try:
permutation = point_set.topology._dm_renumbering.indices[:point_set.cell_set.size]
u_o.dat.data[:] = velocity_data["vx"][indices[:, 1], indices[:, 0]][permutation]
v_o.dat.data[:] = velocity_data["vy"][indices[:, 1], indices[:, 0]][permutation]
σ_x.dat.data[:] = velocity_data["ex"][indices[:, 1], indices[:, 0]][permutation]
σ_y.dat.data[:] = velocity_data["ey"][indices[:, 1], indices[:, 0]][permutation]
except AttributeError:
u_o.dat.data[:] = velocity_data["vx"][indices[:, 1], indices[:, 0]]
v_o.dat.data[:] = velocity_data["vy"][indices[:, 1], indices[:, 0]]
σ_x.dat.data[:] = velocity_data["ex"][indices[:, 1], indices[:, 0]]
σ_y.dat.data[:] = velocity_data["ey"][indices[:, 1], indices[:, 0]]

problem = icepack.statistics.StatisticsProblem(
simulation=lambda u: u.copy(deepcopy=True),
Expand Down

0 comments on commit 9f79fbf

Please sign in to comment.