Dear all,
for post processing, I need to integrate over different domains equal to circles with identical centres but different radii.
That’s why I am wondering how I could efficiently (in terms of code which has to be written) define integration domains needed.
As far as I can see, it is not possible to define a subclass of SubDomain having a constructor asking for the domain radius as argument: The following code
class intDomain(SubDomain):
def _ _ init _ _(self,r):
self.r=r
def inside (self,x,on_boundary):
return np.sqrt(np.power(x[0]-ct_pos[0],2)+np.power(x[1]-ct_pos[1],2))<(r)
#MeshFunction used for marking integration domain
cfDomain=MeshFunction("size_t",mesh,2)
cfDomain.set_all(0)
intDomain_obj=intDomain(r=0.32)
intDomain_obj.mark(cfDomain,1) #integration domain
dx_cf=Measure("dx",domain=mesh,subdomain_data=cfDomain)
threw an error:
Traceback (most recent call last):
File "test.py", line 58, in <module>
intDomain_obj.mark(cfDomain,1) #integration domain
File "/usr/lib/python3/dist-packages/dolfin/cpp/mesh.py", line 4814, in mark
self._mark(*args)
TypeError: in method ‘SubDomain__mark’, argument 1 of type ‘dolfin::SubDomain const *’
Does anybody have an idea for an approach to this issue?