LUSolver assumes repeated use of a single matrix
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dolfin-adjoint |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
The dolfin-adjoint LUSolver assumes that a single matrix is used repeatedly. The following example:
#!/usr/bin/env python
from dolfin import *
from dolfin_adjoint import *
mesh = Rectangle(0.0, 0.0, 1.0, 1.0, 10, 10)
space = FunctionSpace(mesh, "CG", 1)
mass = assemble(
rhs = assemble(
F = Function(space)
solver = LUSolver()
solver.solve(mass, F.vector(), rhs)
print assemble(F * dx)
leads to the error:
Original exception was:
Traceback (most recent call last):
File "./dolfin-
solver = LUSolver()
File "/usr/lib/
self.operator = args[0].form
IndexError: tuple index out of range
while:
#!/usr/bin/env python
from dolfin import *
from dolfin_adjoint import *
mesh = Rectangle(0.0, 0.0, 1.0, 1.0, 10, 10)
space = FunctionSpace(mesh, "CG", 1)
mass = assemble(
rhs = assemble(
F = Function(space)
solver = LUSolver(mass)
solver.solve(mass, F.vector(), rhs)
print assemble(F * dx)
leads to the error:
Original exception was:
Traceback (most recent call last):
File "./dolfin-
solver.
File "/usr/lib/
raise libadjoint.
libadjoint.
Each of these is valid when used with dolfin.
Changed in dolfin-adjoint: | |
status: | New → Fix Committed |