← Back to team overview

dolfin team mailing list archive

Re: Interesting issue with interpolate(?)

 

Quoting Marie Rognes <meg@xxxxxxxxx>:

>
> 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.
>
>
> ||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?)

Could be, quadrature uses the UFL guesstimate which just looks at the element
degree. And I think it is 'tricked' by the RT element when doing this (as I
recall it). You can set the quadrature order through metadata of the Measure to
increase the order manually, then tensor and quadrature should at least agree.
Do note that tensor representation ignores the metadata input (which is a bug).

Kristian

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




References