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

Jump of DG function over vertex

+1 vote

Hi all, I have the following code that calculates the point evaluation of a function at the bottom left corner of the unit square $(0,0)$:

from dolfin import *

mesh = UnitSquareMesh(10,10)
Pk = FiniteElement("DG", mesh.ufl_cell(), 1)
V1 = FunctionSpace(mesh, Pk)

u = interpolate(Expression("x[0]+10",degree = 1),V1)
left = CompiledSubDomain("(std::abs(x[0]) < DOLFIN_EPS) && on_boundary")
corner = CompiledSubDomain("(std::abs(x[0]) < DOLFIN_EPS) && (std::abs(x[1]) < DOLFIN_EPS) && on_boundary")

def blcorner_func(x):
    return near(x[0],0.0) and near(x[1],0.0)

Define domain for point integral

corner_domain = VertexFunction("size_t", mesh, 0)
corner = AutoSubDomain(blcorner_func)
corner.mark(corner_domain, 1)
dC = dP(subdomain_data=corner_domain)
print assemble(u*dC)

How can I adapt this to calculate the jump of a function over the vertex, by this I mean that one can consider the vertex as the intersection of two facets, and then the jump would be the difference of the limit value of the function considered from each "side" of the vertex. I.e., the difference of the function restricted to each facet.

asked Mar 15, 2017 by ellya FEniCS Novice (170 points)
...