SWIG does not pass correct type to PETScKrylovSolver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The following code fails with
TypeError: in method 'new_Function', argument 1 of type 'dolfin::Function const &'
from dolfin import *
def boundary(
return on_boundary
mesh = UnitSquare(32, 32)
V = FunctionSpace(mesh, 'CG', 1)
bc = DirichletBC(V, Constant(0.0), boundary)
u = TrialFunction(V)
v = TestFunction(V)
a = inner(grad(u), grad(v))*dx
class NewtonMatrix(
def __init__(self) :
def mult(self, *args) :
du = Function(V,args[0])
f = du*v*dx
problem = VariationalProb
dy = problem.solve()
args[1][:] = down_cast(
y_petsc = PETScVector(
x_petsc = PETScVector(
NewtonSolver = PETScKrylovSolv
NewtonSolver.
Changed in dolfin: | |
status: | New → Confirmed |
Changed in dolfin: | |
importance: | Undecided → Medium |
Changed in dolfin: | |
status: | Confirmed → Fix Committed |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |