← Back to team overview

fenics team mailing list archive

misleading message with interpolate?

 

If we run this simple program, which interpolates the quadratic  x*y
onto a mesh of the unit square and then integrate it, it gives
the exact answer .25.  This is not surprising, but the warning
message

  Automatic selection of expression element: <CG? on a <? of degree 1>>

is.  What does the "degree 1" refer to.  I interpreted it to be warning
me that the expression was interpolated into the P1 element space, but
that cannot be correct, since then I would not have gotten the exat
integral.

Code:

from dolfin import *
mesh = UnitSquare(4,4)
V = FunctionSpace(mesh,'CG',2)
f = interpolate(Expression("x[0]*x[1]"),V)
print(assemble(f*dx, mesh=mesh))


Output:

Warning: Converting real-valued parameter to double, might loose precision.
Automatic selection of expression element: <CG? on a <? of degree 1>>
Warning: Converting real-valued parameter to double, might loose precision.
0.25



Follow ups