Is adjoint_inc_timestep neccessary for a repeated matrix-vector solve.
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(
f = source*v*dx
t = 0.0
dt = 0.1
A = assemble(a)
#adj_start_
for i in range(2):
t += dt
source.t = t
F = assemble(f)
bc.apply(A)
bc.apply(F)
solve(A, u.vector(), F, "cg", "ilu")
#adj_
adj_html(
assert(
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Gabriel Balaban for more information if necessary.