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

coefficients depended on facets and '+', '-' operators

+1 vote

Hello,

I will be grateful if anybody help me with the following.
I have a FacetFunction and I mark the facets with 0,1,2.
I need to multiply the integral on Facets marked with 2 with the following

 + abs3(abs_uhF)*dot(grad(uh)('+'), grad(vh)('+'))*dS(2) +
     + abs3(abs_uhF)*dot(grad(uh)('-'), grad(vh)('-'))*dS(2)

where

def abs3(v):
        return (sqrt(v('+')) - 2.0*sqrt(v('-'))-m + abs(sqrt(v('+'))\
                                    -2.0*sqrt(v('-'))-m))/(2.0*(D-m))

and

abs_uh = assemble(1/cell_volume*dot(grad(uh), grad(uh))*wh*dx)
   abs_uhF = Function(W, abs_uh)

(wh = Function(DG0) and uh= Function(CG1))

I want to be sure that what I do is correct. I just want to add to the bilinear form the integral on
facets marked with 2 multiplied with |\grad u_h|_K^+ - 2*|\grad u_h|_K^- - m whenever this is positive.
How can I print the exact values of abs3(abs_uhF) on the facets?

Thank you very much in advance!
Fotini

asked Jul 4, 2014 by fotini.karakatsani FEniCS Novice (500 points)
...