Making calls to adj_inc_timestep automatic when new time value is assigned to a special time constant
A code with the pattern:
# ... timesteps = list of time values
t = Constant(
# ... initialization
for timestep in xrange(
# ... solve equations
Could be written with less explicit annotation:
# ... initialization, timesteps = list of time values
t = Constant(
# ... initialization
for timestep in xrange(
# ... solve equations
If dolfin-adjoint gave special treatment to a Constant with a particular name,
e.g. "TIME", or subclassed Constant with TimeConstant class, following the
behavioural pattern of this code:
def Time(t0=0.0):
t = Constant(t0, name="TIME")
return t
def assign_time(t, tvalue):
if t._assigned_to:
else:
# ... initialization, timesteps = list of time values
t = Time(t0=
# ... initialization
for timestep in xrange(
# ... solve equations
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by