error when using Integrate

More
4 years 3 weeks ago #3413 by JSR
I'm trying to integrate a function over a subset of the domain, but I keep getting the following error
Code:
File "/usr/local/ngsxfem/lib/python3/dist-packages/xfem/__init__.py", line 304, in Integrate_X_special_args heapsize=heapsize) netgen.libngpy._meshing.NgException: lsets need to be GridFunctions!


The function is called using
Code:
stopcritval = sqrt(Integrate(levelset_domain=lset_haspos, cf=f, mesh=mesh))

where f is a GridFunction, and lset_haspos is defined by:
Code:
lsetp1 = GridFunction(H1(mesh,order=1)) InterpolateToP1(lset,lsetp1) lset_haspos = { "levelset" : lsetp1, "domain_type" : HASPOS, "subdivlvl" : 0}

As far as I can tell, all arguments are of the right type, so I have no idea why I'm being told that "lsets need to be GridFunctions". Does anyone know what I'm doing wrong?

thanks,

Julien
More
4 years 3 weeks ago #3414 by schruste
Replied by schruste on topic error when using Integrate
Dear Julien,

HASPOS is not a DOMAIN_TYPE (but a COMBINED_DOMAIN_TYPE). This leads to the fact that the dictionary lset_haspos does not fit the interface. If you want to integrate on the part where the level set function is positive, simply use "domain_type": POS.

I have to admit that the Exception is not really helpful and rather misleading. I will have a look at that.

Best,
Christoph
More
4 years 3 weeks ago #3415 by JSR
Replied by JSR on topic error when using Integrate
Hi Christoph,

Switching to POS did the trick.

thanks for the fast reply,

Julien
Time to create page: 0.099 seconds