I apologise if this question is trivial, but I couldn’t find any answer. It seams to me that I cannot define a Vector Space of RT functions: From a mathematical point of view, it should be a tensor in (L^2)^{2x2}, each line being in Hdiv.
But even if
RTel = VectorElement(‘RT’,mesh.ufl_cell(), 1)
RT = FunctionSpace(mesh,RTel)
work without an error,
then for a function w = Function(RT)
I cannot assemble neither assemble(inner(w,w)*dx) nor assemble(dot(div(w), div(w)) * dx)
Hi,
indeed I also get the error you mentioned. As suggested above, you can define a Mixed FunctionSpace of two RT components and reconstruct the corresponding tensor w as follows:
from dolfin import *
from ufl import shape
mesh = UnitSquareMesh(10, 10)
Ve = FiniteElement("RT", mesh.ufl_cell(), 1)
V = FunctionSpace(mesh, MixedElement([Ve, Ve]))
u = Function(V)
u1, u2 = split(u)
e1 = as_vector([1, 0])
e2 = as_vector([0, 1])
w = outer(u1, e1)+outer(u2, e2)
print(shape(w))
assemble(inner(w, w)*dx)
assemble(dot(div(w), div(w))*dx)