time-integrated functional depending on constant-in-time control
Issue #75
new
In the attached example (based on test_firedrake/identity/test_identity) I have a functional with a time integral that explicitly depends on the control, a function s
. Because s
doesn't actually get touched during the forward model this seems to confuse dolfin-adjoint with the following error:
LibadjointErrorInvalidInputs: Error in adj_iteration_count: No iteration found for supplied variable w_2:1:0:Forward
This can be worked around by adding a spurious projection to itself of s every time step (commented out in the example test). The same issue seems to be present in firedrake-adjoint and dolfin-adjoint.
The following code works for me:
I had to include the functions u0 and u1 to pass the taylor test. I am not entirely sure why. I also wonder what's the cost of doing the
assign
for the control variable. Now you need to save also the design variable even though it is a constant.