Raviart-Thomas Vector Space

Dear Community,

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)

Thank you,

I think you need to use RTel = FiniteElement(‘RT’, mesh.ufl_cell(), 1)

1 Like

Yes but this gives me a vector, I would like to have a matrix, to approximate for instance stress tensors in elasticity.

Don’t know if this helps, but you could work with the components like this:

w1, w2 = Function(RT).split()

assemble( ( dot(w1,w1) +dot(w2,w2) )  * dx )

Try RT = VectorFunctionSpace(mesh, RTel) to generate the tensor element. Raviart-Thomas is a vector element by construction.

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)