Comment 8 for bug 1153105

Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 1153105] Re: possibly inaccurate FE solves for high-order elements in trunk

On 03/11/2013 09:53 AM, Marie Rognes wrote:
> (1) Try specifying the degree for the Expression (help(Expression)):
>
> psiexpr = Expression("x[0]*x[0] + 2*x[1]*x[1]", degree=2)
>
> (2) Run instant-clean
>
> (3) See if the results are more as expected
>
> [(2) should not be necessary, but that might be a separate bug]

On might get the impression that the generated C++ Expression relies on
the degree. That is not the case. Only the form which uses the
expression, should be recompiled. Which seems to be the case, btw:

from dolfin import *
mesh = UnitSquareMesh(2,2)
# Triggers JIT compilation
e = Expression("x[0]+x[1]", degree=1)

# Triggers JIT compilation
assemble(e*dx, mesh=mesh)

# No not trigger JIT compilation
e = Expression("x[0]+x[1]", degree=4)

# Triggers JIT compilation
assemble(e*dx, mesh=mesh)

Johan