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

Expression in interior facets

+4 votes

Hi

I'm trying to define an expression to multiply a term of the bilinear form in which itegral is over the facets, but I'm having problems.
I think the expression should be defined differently than in the case where the integral is over the element where it works.

I show you a simplified retail of code to focus the problem.

mesh = BoxMesh(-5, -5, 0, 5, 5, 5, 10, 10, 5)
V = FunctionSpace(mesh, 'DG', 2)

I define the interface:

class crack (SubDomain):
    def inside (self,x,on_boundary):
        tol=1E-12
        return (between(x[1],(-tol,tol)) and (x[2]< 2.+tol))
crack=crack() 
interior = FacetFunction("size_t", mesh) 
interior.set_all(0) 
crack.mark(interior,1) 
dS = Measure("dS")[interior] 
n = FacetNormal(mesh)

here is my problem, I want to define R(x), for example:

R=Expression('10+x[2]*x[2]')

term of bilinear form where R is taking place

a3=R*dot(jump(u,n), jump(v, n))*dS(1)

I think that R has to be projected into the facets whith piecewises second order functions but I don't know the way.

asked Jun 26, 2014 by ajaome FEniCS Novice (450 points)
edited Jun 27, 2014 by ajaome

1 Answer

+2 votes
 
Best answer

Try to apply trace operators as
{}=avg.
That is

a3=avg(R)*dot(jump(u,n), jump(v, n))*dS(1)
answered Jul 1, 2014 by Celorrio FEniCS Novice (500 points)
selected Oct 15, 2015 by ajaome

I have done several experiments and it seems that it works fine. It solves the error: "Discontinuous type Coefficient must be restricted"

I thought it could be solved by the function restriction, but I did not succeed, any idea about its use? is it appropriate for this problem?

restriction = Restriction(interior, 1)
...