← Back to team overview

dolfin team mailing list archive

Re: Interesting issue with interpolate(?)

 



Marie Rognes wrote:
I have a slightly interesting issue, possibly with interpolate:

Say I have a RT_0 function u. I want to interpolate this function onto a DG_1 function Pi_u. Since RT_0 \subset DG_1, I would expect to get the same function. This does not seem
to be the case at the moment.


Need to be careful interpolating in discontinuous spaces because you will pick up the 'last' evaluated term, i.e. you can't be sure which on side the function will be evaluated on. This could be the issue. Have a look inside the interpolate functions in Function.cpp.

Garth


||u||_0 =  1.12846688033
||Pi_u||_0 =  1.2624381173

being the output of:

from dolfin import *

mesh = UnitSquare(2, 2)

V_h = FunctionSpace(mesh, "RT", 0)
u = Function(V_h, ("pow(x[0],2)", "1.0"))
u.interpolate()
print "||u||_0 = ", norm(u)

W_h = VectorFunctionSpace(mesh, "DG", 1)
Pi_u = Function(W_h)
Pi_u.interpolate(u)
print "||Pi_u||_0 = ", norm(Pi_u)


(Tested both using tensor and quadrature representation.
Tensor and quad differ somewhat for the norm(u).
Is the quadrature default to integrate RTs using
"too low" a quadrature rule still?)



--
Marie
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




Follow ups

References