- Thank you received: 1
error when using Integrate
3 years 11 months ago #3413
by JSR
error when using Integrate was created by JSR
I'm trying to integrate a function over a subset of the domain, but I keep getting the following error
The function is called using
where f is a GridFunction, and lset_haspos is defined by:
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
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
3 years 11 months 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
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
Time to create page: 0.094 seconds