Skip to content

Commit

Permalink
Merge pull request #166 from firedrakeproject/new_fd_interpolate
Browse files Browse the repository at this point in the history
Update use of `firedrake.interpolate` with new symbolic version
  • Loading branch information
JHopeCollins authored Feb 12, 2024
2 parents 68d8b34 + 1740fb8 commit 5f09851
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion case_studies/stratigraphic_model/mms.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def function_space(self, mesh):

for i in range(1):
t.assign(t+dt)
s_exact = fd.interpolate((t+1)*fd.sin((x+2*y)), Z)
s_exact = fd.Function(Z).interpolate((t+1)*fd.sin((x+2*y)))
solver.solve()
A = fd.errornorm(s, s_exact)/fd.norm(s_exact)
PETSc.Sys.Print("E :%s" % A)
Expand Down
2 changes: 1 addition & 1 deletion utils/mg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def high_order_icosahedral_mesh_hierarchy(mh, degree, R0):
meshes = []
for m in mh:
X = fd.VectorFunctionSpace(m, "Lagrange", degree)
new_coords = fd.interpolate(m.coordinates, X)
new_coords = fd.Function(X).interpolate(m.coordinates)
x, y, z = new_coords
r = (x**2 + y**2 + z**2)**0.5
new_coords.interpolate(R0*new_coords/r)
Expand Down
2 changes: 1 addition & 1 deletion utils/shallow_water/galewsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def depth_expression(x, y, z):
W = fd.VectorFunctionSpace(mesh, V.ufl_element())

# initialise depth from coordinates
coords = fd.interpolate(mesh.coordinates, W)
coords = fd.Function(W).interpolate(mesh.coordinates)
h = fd.Function(V)
h.dat.data[:] = depth_calculation(coords.dat.data_ro)

Expand Down

0 comments on commit 5f09851

Please sign in to comment.