fenics team mailing list archive
-
fenics team
-
Mailing list archive
-
Message #01002
misleading message with interpolate?
-
To:
fenics@xxxxxxxxxxxxxxxxxxx
-
From:
Douglas Arnold <arnold@xxxxxxx>
-
Date:
Thu, 24 Jun 2010 17:57:57 -0500
-
User-agent:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4
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