Dear all,
I tried to obtain integration points for a ngsxfem model which I could then use as a reference in an integral computation wrt. another code. I would be perfect to obtain the integration points element-wise and with additional information whether the respective element is cut or not.
However, I struggled to find the integration points anywhere. In the “Integrate” function in “init.py” in xfem, I found this “Integrate_X_special_args” which could get “ip_container” as an input. Unfortunately, I think this function is not working, but I think the purpose of it is what I am looking for.
Is there a way to obtain integration points for a CutFEM problem?
I would appreciate any help
As I first model, I wanted to integrate simply a constant function. My model would look like:
#import netgen.gui
# ngsolve stuff
from ngsolve import *
from ngsolve.webgui import *
# basic geometry features (for the background mesh)
from netgen.occ import *
# visualization stuff
from ngsolve.internal import *
# basic xfem functionality
from xfem import *
geo = OCCGeometry(unit_square_shape.Scale((0,0,0),3).Move((-1.5,-1.5,0)), dim=2)
mesh = Mesh(geo.GenerateMesh(maxh=0.5,quad_dominated=True))
levelset = (sqrt(sqrt(x**2+y**2)) - 1.0)
lsetp1 = GridFunction(H1(mesh,order=1))
InterpolateToP1(levelset,lsetp1)
f = CoefficientFunction(1)
order = 2
dx = dCut(levelset=lsetp1, domain_type=NEG, order=order)
integral = Integrate(f * dx, mesh=mesh)
Best,
Michael Loibl