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

How to make interior Neumann bc dependent on FE function

0 votes
L = f*v*dx + g("+")*v("+")*dSs(0)

works when g is a Constant or an Expression.

I'd now like to make this internal Neumann bc proportional to the difference between the solution function on either side of the boundary facets. I've tried the following code

V = FunctionSpace(mesh, "DG", 0)
...
L = f*v*dx + jump(u)*avg(v)*dSs(0)

but get the error

All terms in form must have same rank.

Is jump() the correct function to use here? If so, what's the correct usage in this instance?

related to an answer for: How to set up interior Neumann boundaries
asked Feb 17, 2014 by mdl22 FEniCS Novice (180 points)

1 Answer

+1 vote

Make sure u is a Function and not TrialFunction.

answered Feb 17, 2014 by MiroK FEniCS Expert (80,920 points)
...