Skip to content

Commit

Permalink
Fix rf. (#3890)
Browse files Browse the repository at this point in the history
* Fix rf
  • Loading branch information
Ig-dolci authored Nov 28, 2024
1 parent dab79d3 commit 021b530
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/firedrake/output/test_adjoint_disk_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ def test_disk_checkpointing_successive_writes():

J = assemble(v*dx)
Jhat = ReducedFunctional(J, Control(u))
assert np.allclose(J, Jhat(1))
assert np.allclose(J, Jhat(Function(cg_space).interpolate(1.)))
pause_disk_checkpointing()
tape.clear_tape()
2 changes: 1 addition & 1 deletion tests/firedrake/regression/test_adjoint_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def test_init_constant():
c2.assign(c1)
J = assemble(c2*dx(domain=mesh))
rf = ReducedFunctional(J, Control(c1))
assert np.isclose(rf(-1.0), -1.0)
assert np.isclose(rf(Function(R, val=-1.0)), -1.0)


@pytest.mark.skipcomplex # Taping for complex-valued 0-forms not yet done
Expand Down

0 comments on commit 021b530

Please sign in to comment.