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

Restrict an expression twice

0 votes

I would like to implement such an expression in the UFL language:
$$ \int_{\Gamma} [ < \mathrm{cof} ( D^2 u) > \nabla u ] v \mathrm{dS} $$
However if I write

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

it says "ffc cannot restrict an expression twice". How can I come over this problem?

asked Jul 12, 2015 by str FEniCS User (1,600 points)
edited Jul 12, 2015 by str

Hi, perhaps you can factor it out yourself into something that the compiler can handle. The restricted term in the form can be fit into the identity jump(a*v)=jump(a)*avg(v)+avg(a)*jump(v) with a = avg(u). Then intuitively the doubly restricted terms should behave such that avg(avg(u))=avg(u) and jump(avg(u))=0 and thus jump(avg(u)*v)=avg(u)*jump(v).

...