Integration along a zero level set

I have a technical question. When evaluating an integral (or a form) along a zero level set, what if the zero level set falls exactly on a side of an element (e.g. the edge of a triangle)? And suppose the integrand contains piecewise discontinuous functions (e.g. the gradient of a Lagrange FE functions).

How is this detected? Which side of the edge is used in evaluating the integral? Is an average taken? Probably whatever element the integration point falls into is used.

Hi,

If you use InterpolateToP1 from ngsxfem we avoid exact zeros at vertices and simply move it up (or down) to a small value. The value is 1e-14 by default, but you can set it via the ngsxfemglobals.eps_P1_perturbation = ... or in InterpolateToP1(lset_ho,lsetp1, eps_perturbation=1-16).

So, we do not really allow for a situation of double-valued (due to discontinuities in the mesh) fields on the zero level. As you guessed, the integration point will end up in one element and that’s where the integrand coefficient function will be evaluated.

Best, Christoph

Thank you for the clarification.