Hi Yongbin,
Here is the code fitting your script. I use hybrid dg jumps here as you use a hybrid DG formulation:
Code:
a_jumps = BilinearForm(X)
a_jumps += (ubar-uu)*(vbar-vv) * dx(element_boundary = True)
AUNvec = UN.vec.CreateVector()
a_jumps.Apply(UN.vec,AUNvec)
jump_norm = sqrt(InnerProduct(AUNvec,UN.vec))
print(jump_norm)
Alternatively, if you are interested in the standard DG jumps the code looks as follows:
Code:
uuOther = CoefficientFunction((ux.Other(), uy.Other()))
vvOther = CoefficientFunction((vx.Other(), vy.Other()))
a_jumps = BilinearForm(X)
a_jumps += (uuOther-uu)*(vvOther-vv) * dx(skeleton = True)
AUNvec = UN.vec.CreateVector()
a_jumps.Apply(UN.vec,AUNvec)
jump_norm = sqrt(InnerProduct(AUNvec,UN.vec))
print(jump_norm)
Alternatives? I think this is the most straight-forward way to do it. As of now there is no "Integrate" equivalent that would allow you to integrate the skeleton-terms directly. However, I think the above approach is also very natural.
Best,
Christoph