Dear team,
I am facing a few problems with the real function space, again. I can’t seem to be able to interpolate on a real function, either with a C string expression or UFL. The following sample code
from firedrake import *
mesh = IntervalMesh(10, 1.0)
V = FunctionSpace(mesh, "CG", 1)V_R = FunctionSpace(mesh, "R", 0)
h = Function(V)Z = Function(V_R)
x = SpatialCoordinate(V.mesh())
h = interpolate(x[0], V)Z = interpolate(Expression("1.0"), V_R)Z = interpolate(1.0, V_R)
gives the error
Traceback (most recent call last):File "interpolation_reals.py", line 17, in <module>Z = interpolate(Expression("1.0"), V_R)File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 40, in interpolatereturn Interpolator(expr, V, subset=subset).interpolate()File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 60, in __init__self.callable = make_interpolator(expr, V, subset)File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 129, in make_interpolatorsubset))File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 189, in _interpolatorargs.append(dat(op2.WRITE, V.cell_node_map()[op2.i[0]]))TypeError: 'NoneType' object has no attribute '__getitem__'
I assume this functionality hasn’t been added for the real function space?
Also, I noticed that when the UFL expression doesn’t include a coordinate x, e.g. in h = interpolate(1.0, V), I get the error:
Traceback (most recent call last):File "interpolation_reals.py", line 23, in <module>h = interpolate(1.0, V)File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 40, in interpolatereturn Interpolator(expr, V, subset=subset).interpolate()File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 60, in __init__self.callable = make_interpolator(expr, V, subset)File "/Users/matak/firedrake/src/firedrake/firedrake/interpolation.py", line 94, in make_interpolatorassert isinstance(expr, ufl.classes.Expr)AssertionError
Furthermore, I’m having trouble the exponential UFL expression, e.g.
exp_h = interpolate(exp(x[0]), V)TypeError: nb_float should return float object
Thank you very much for your help,
Anna.
P.S. At the start of every simulation, the following sentence is printed twice and delays the simulation for a couple of seconds:[warn] kq_init: detected broken kqueue; not using.: No such file or directoryWhat does it mean and can we get rid of it?