Hi
I am trying to solve polygonal domain for Raviart-Thomas elements.
In that. i will use interpolate or projection over through vectorFunctionspace in the following codes like some error occur:
X = VectorFunctionSpace(mesh, "RT", 2)
Y = FunctionSpace(mesh, "CG", 1)
Z = FunctionSpace(mesh, "CG", 1)
W = MixedFunctionSpace([X,Y,Y,Y,Y,Y,Y])
then i use TestFunctions(W) ,TairlFunctions(W) after that i get error on Shape mismatch on projection should used like codes
pd0 = Expression(('-pi*(1+pi*pi)*cos(pi*x[1])*sin(pi*x[2])','-pi*(1+pi*pi)*sin(pi*x[1])*cos(pi*x[2])'))
x = Function(X)
pd = project(pd0, X)
then, If i use projection
x = Function(X)
m = interpolate(pd0 ,X)
pd1 = grad(m)
pd = project(pd1, X)
then following error occur are
File "poly.py", line 62, in
m = interpolate(pd0 ,X)
File "/usr/lib/python2.7/dist-packages/dolfin/fem/interpolation.py", line 64, in interpolate
Pv.interpolate(v)
RuntimeError:
*** -------------------------------------------------------------------------
*** Error: Unable to interpolate function into function space.
*** Reason: Rank of function (1) does not match rank of function space (2).
*** Where: This error was encountered inside FunctionSpace.cpp.
*** Process: 0
*** -------------------------------------------------------------------------
then i solve variational inequality
a0 = inner(p-pd,pt)*dx + inner(div(pt),p1)*dx
Can anybody clarify this to me?
Thank you