Open jrmaddison opened 5 years ago
There are two issues here:
_real_mangle
assumes scalar RealFunctionSpace (one could fix that by just making a vector of 1 of appropriate shape)
I don't think the rest of the code will work.
Some related examples:
from firedrake import *
mesh = UnitIntervalMesh(10)
vspace = VectorFunctionSpace(mesh, "R", degree=0, dim=2)
v_F = Function(vspace, name="v_F")
v_F.assign(Constant((1.0, 1.0)))
print(assemble(dot(v_F, Constant((1.0, 1.0))) * dx))
and:
from firedrake import *
mesh = UnitIntervalMesh(10)
tspace = TensorFunctionSpace(mesh, "R", degree=0, shape=(2, 2))
t_F = Function(tspace, name="t_F")
t_F.assign(Constant(((1.0, 1.0), (1.0, 1.0))))
print(assemble(inner(t_F, Constant(((1.0, 1.0), (1.0, 1.0)))) * dx))
lead to LoopyError s (long error messages). Switching "R" to "DG" yields the correct results.
For example:
leads to the error