Hi.
I try to use the following zero() function, see below: https://fenicsproject.org/documentation/dolfin/1.0.1/python/programmers-reference/cpp/GenericMatrix.html
Therefore I wrote a short example:
from dolfin import *
import numpy
mesh = UnitSquareMesh(50,50)
F = FunctionSpace(mesh, "Lagrange", 1)
x = TrialFunction(F)
y = TestFunction(F)
m = inner(grad(x),grad(y))*dx
M = assemble(m)
n = F.dim()
d = mesh.geometry().dim()
dof = F.tabulate_dof_coordinates().reshape(n,d)
o = numpy.array([], dtype=np.intc)
for i in xrange(0, len(dof)):
if (i%100==0):
u = numpy.array([i], dtype=np.intc)
o = numpy.append(o, u)
n = len(o)
M.zero(n, o)
I receive the following error:
NotImplementedError: Wrong number or type of arguments for overloaded function 'Matrix_zero'.
Unfortunately, I have no idea how to solve it.