Using the value of a stationary function at finish_time

Asked by Martin Sandve Alnæs

I want to attempt to obtain a cyclic transient state by penalizing the difference between the initial condition control and the final timestep of the state, e.g.:

  J = beta * (u-u0)**2*dx*dt[FINISH_TIME] # + ...

but then libadjoint tries to get the value of u0 at the finish time, and it only has an annotation at the start time:

libadjoint.exceptions.LibadjointErrorInvalidInputs: Error in adj_iteration_count: No iteration found for supplied variable ui_1:98:0:Forward.

Is there a way around this? Is this a problem for including any stationary coefficient in a finish_time term, not only when u0 is an initial condition control?

Question information

English Edit question
dolfin-adjoint Edit question
No assignee Edit question
Solved by:
Martin Sandve Alnæs
Last query:
Last reply:
Revision history for this message
Martin Sandve Alnæs (martinal) said :

I got around it by making a copy of the function, which then happens at finish time I guess, but it would be nice if this was handled by dolfin/lib-adjoint automatically. Maybe if a function is only annotated at the start time it can be considered stationary?

Revision history for this message
Patrick Farrell (pefarrell) said :

Hey Martin,

If you supply a simple, small example I'll add this to my queue.