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

Problems with assembling FacetArea(mesh)

0 votes

Hi!
I`m trying to calculate weighted combinations of flux jump over the all edges.
If u is solution from FunctionSpace(mesh, 'Lagrange', 1), where mesh is irregular triangulation of UnitSquareMesh

n = FacetNormal(mesh)
h_edges = FacetArea(mesh)
R_E = (sqrt(h_edges)*jump(grad(u),n))**2*dS
result = assemble(R_E)

Then the error is: Discontinuous type Coefficient must be restricted.

But, for example

h_cells = CellVolume(mesh)
R_T = (h_cells*f)**2*dx
result = assemble(R_T)

works fine.

A value what I want to get is
Sum over all interior edges E:
h_E * || jump(grad(u) * n) ||_E**2
where ||.||_E is L2 norm over edge E and h_E is its length

Thanks!

closed with the note: As it turned out, FacetArea(mesh) is not FacetFunction(mesh), so It should be restrict ("+")
asked Apr 12, 2016 by ashoka FEniCS Novice (270 points)
closed Apr 15, 2016 by ashoka
...