Open tkarna opened 7 years ago
I've seen this appear, e.g.
from firedrake import *
import numpy as np
mesh = UnitIntervalMesh(10)
space = VectorFunctionSpace(mesh, "Lagrange", 1)
F = Function(space, name="F")
v = np.float64(1.0)
G = interpolate(v * F, space)
leads to an error, but in Firedrake
Traceback (most recent call last):
File "test.py", line 14, in <module>
G = interpolate(v * F, space)
File "[...]/build/firedrake/firedrake/src/firedrake/firedrake/interpolation.py", line 37, in interpolate
return Interpolator(expr, V, subset=subset, access=access).interpolate()
File "[...]/build/firedrake/firedrake/src/firedrake/firedrake/interpolation.py", line 57, in __init__
self.callable = make_interpolator(expr, V, subset, access)
File "[...]/build/firedrake/firedrake/src/firedrake/firedrake/interpolation.py", line 68, in make_interpolator
assert isinstance(expr, ufl.classes.Expr)
AssertionError
Applying a BC
G = Function(space, name="G")
DirichletBC(space, v * F, "on_boundary").apply(G)
also leads to an error.
numpy.float64*Function
evaluation fails in some cases. Example:dies with
So apparently this only occurs with
VectorFunctionSpace
, and if you doscalar*Function
multiplication.