matrix-free PETScKrylovMatrix works in 1.0, but is broken in fenics-dev
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
High
|
Johan Hake |
Bug Description
Consider the following snippet (due to Christian Clason):
#####
from dolfin import *
mesh = UnitSquare(32, 32)
V = FunctionSpace(mesh, 'CG', 1)
bc = DirichletBC(V, Constant(0.0), lambda x, on_boundary: on_boundary)
u = TrialFunction(V); v = TestFunction(V);
A, b = assemble_system( inner(grad(u), grad(v))*dx, Constant(1.0)*v*dx, bc)
class KrylovMatrix(
def __init__(self) :
def mult(self, *args) :
y = PETScVector(
y = Function(V)
solve(A,
x_petsc = PETScVector(
KrylovSolver = PETScKrylovSolv
KrylovSolver.
print (y.vector(
#####
This code works with Dolfin from the fenics PPA:
[pef@doodson:/tmp]$ dpkg -l python-dolfin
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Description
+++-===
ii python-dolfin 1.0.0-2~ppa1~natty1 Python interface for DOLFIN
[pef@doodson:/tmp]$ python testMatrixFreeK
1.93697136644e-08
but fails with Dolfin from the fenics-dev PPA:
[pef@caoimhe:/tmp]$ dpkg -l python-dolfin
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Description
+++-===
ii python-dolfin 1.0.0-2+
[pef@caoimhe:/tmp]$ python testMatrixFreeK
Traceback (most recent call last):
File "testMatrixFree
KrylovSolve
File "testMatrixFree
A.mult(
TypeError: in method 'GenericMatrix_
Changed in dolfin: | |
status: | New → Confirmed |
milestone: | none → trunk |
assignee: | nobody → Johan Hake (johan-hake) |
Changed in dolfin: | |
importance: | Undecided → High |
status: | Confirmed → Fix Committed |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |