Skip to content

Commit

Permalink
fix interface in more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dham committed Jan 2, 2025
1 parent c408ee3 commit da47938
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/firedrake/regression/test_adjoint_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,13 +976,13 @@ def test_lvs_constant_jacobian(constant_jacobian):

J_hat = ReducedFunctional(J, Control(u))

dJ = J_hat.derivative(options={"riesz_representation": None})
dJ = J_hat.derivative()
assert np.allclose(dJ.dat.data_ro, 2 * assemble(inner(u_ref, test) * dx).dat.data_ro)

u_ref = Function(space, name="u").interpolate(X[0] - 0.1)
J_hat(u_ref)

dJ = J_hat.derivative(options={"riesz_representation": None})
dJ = J_hat.derivative()
assert np.allclose(dJ.dat.data_ro, 2 * assemble(inner(u_ref, test) * dx).dat.data_ro)


Expand Down Expand Up @@ -1036,6 +1036,6 @@ def test_bdy_control():
der_analytical1 = assemble(derivative((u_analytical**2) * dx, b))
J = assemble(sol * sol * dx)
J_hat = ReducedFunctional(J, [Control(a), Control(b)])
adj_derivatives = J_hat.derivative(options={"riesz_representation": "l2"})
adj_derivatives = J_hat.derivative()
assert np.allclose(adj_derivatives[0].dat.data_ro, der_analytical0.dat.data_ro)
assert np.allclose(adj_derivatives[1].dat.data_ro, der_analytical1.dat.data_ro)

0 comments on commit da47938

Please sign in to comment.