Is adjoint_inc_timestep neccessary for a repeated matrix-vector solve.

Asked by Gabriel Balaban

When the script below is run the replay_dolfin() function fails, but if the time-stepping information is added then the replay works! Doing the same thing with a series of variational problem solves without the timestepping information is ok as well. Is there something special about the matrix vector solves that requires them to always need time-stepping information?

from dolfin import *
from dolfin_adjoint import *

mesh = UnitSquareMesh(4,4)
V = FunctionSpace(mesh, "CG", 1)

u = TrialFunction(V)
v = TestFunction(V)

a = inner(grad(u), grad(v))*dx
u = Function(V, name = "solution")

bc = DirichletBC(V, 0, "on_boundary")

source = Expression("t*sin(x[0])*sin(x[1])", t = 0.0)
f = source*v*dx

t = 0.0
dt = 0.1

A = assemble(a)
for i in range(2):
    t += dt
    source.t = t
    F = assemble(f)
    solve(A, u.vector(), F, "cg", "ilu")

adj_html("forward.html", "forward")

Question information

English Edit question
dolfin-adjoint Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Patrick Farrell (pefarrell) said :

This is definitely a bug. I'll take a look at it now.

Revision history for this message
Gabriel Balaban (gabrib) said :

Thanks Patrick! It looks innocent at the moment but it's good know that you are checking to see if there is anything more to this.

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

That bug is now fixed in r726.

Can you help with this problem?

Provide an answer of your own, or ask Gabriel Balaban for more information if necessary.

To post a message you must log in.