This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

"Expecting expand_derivatives to have been applied"

+2 votes

Dear all,

I have been trying to add some artificial viscosity term to my DG code. In particular, I want to add the following term to the bilinear form:

mesh = IntervalMesh(K,Zmin, Zmax)  # 1-D code
DG = FunctionSpace(mesh, "DG", dg_order)
u = TrialFunction(DG)
v = TestFunction(DG)

n = FacetNormal(mesh)
ez = as_vector((1.0,))

... # some other things

a += (avg(u.dx(0)) + 0.5*jump(u.dx(0)))*jump(v)*abs(dot(ez,n("+")))*dS

... # some other things

When I do so, I get weird results and the following message when the FFC just-in-time (JIT) compiler is being called:

Expecting expand_derivatives to have been applied.

What surprises me is that in my code already working, I have a similar term in my bilinear form:

a += (avg(u) + 0.5*jump(u))*jump(v)*abs(dot(ez,n("+")))*dS

but no warning is generated...

Is it not possible to take the jump() or avg() of the derivative? In demo_dg-poisson.py, there are terms using it though:

dot(jump(v, n), avg(grad(u)))*dS

So I am a little confused...
Can anyone help?

Thanks in advance for your time!
Vincent

asked Jul 17, 2014 by V_L FEniCS User (4,440 points)

I have found this message in some of my own code and would really like to know the source of this error.

...