Hi everyone,

here is my question of the day...
I have a 2D grid, but I would like to have the exterior to be in a circular
geometry. with a boundary condition c=1 at the exterior, so on the exterior
circle

Naively I wrote this few lines to set the concentration c=1 everywhere out
of this big circle of radius CX:

X, Y = mesh.getFaceCenters()
facesOutside =  ((X-CX)**2+(Y-CX)**2 >= CX*CX )
BCs = (FixedValue(faces=facesOutside, value=1))


and I get the error


/home/julien/Dropbox/allinonelevelset/levelset.py in <module>()
    127 X, Y = mesh.getFaceCenters()
    128 facesOutside =  ((X-CX)**2+(Y-CY)**2 >= CX*CY -0.1 )
--> 129 BCs = (FixedValue(faces=facesOutside, value=1))
    130
    131

/usr/local/lib/python2.6/dist-packages/FiPy-2.2_dev-py2.6.egg/fipy/boundaryConditions/boundaryCondition.pyc
in __init__(self, faces, value)
     77         self.value = value
     78
---> 79         if not (self.faces | self.faces.mesh.exteriorFaces
     80                 == self.faces.mesh.exteriorFaces).value.all():
     81             raise IndexError, 'Face list has interior faces'

AttributeError: 'numpy.ndarray' object has no attribute 'mesh'
WARNING: Failure executing file: <levelset.py>

what is the problem ? or is there even a better way of doing that ?

Julien

Reply via email to