I am forwarding this to the list as Sergey is having problems posting
for some reason.
Begin forwarded message:
From: Sergey Astanin <[EMAIL PROTECTED]>
Date: June 29, 2007 2:52:38 PM EDT
To: [EMAIL PROTECTED]
Subject: question about faces and list failure
Hello,
<offtopic>Few days ago I tried FiPy and have to tell that I am
delighted with it. Basically in few hours I learned the interface
of FiPy
and wrote a 100-line simulation code which is more or less equivalent
to more than 6500 lines of C++ code which I am maintaining. And I have
to say it seems to be quite effective in terms of performance. I think
FiPy may provide a huge productivity improvement, especially in
academic environment. It is quite flexible and has a big potential.
And in addition it is Free as in Speech. So I want to thank all the
developers of this software. I like it and hope it will develop
further.</offtopic>
Now I am trying to figure out how to select a subset of faces. The
problem is how to define a boundary condition on a part of the
boundary, and another boundary condition on the rest of the boundary.
For example, I am interested in a part of the external boundary where
((y==0) and (z < z0)). I tried this:
mesh=Grid3D(...)
faces=filter(lambda f: f.getCenter()[2] < z0, mesh.getFacesBottom())
but this does not work because mesh.getFacesBottom() gives me an array
of integers (FaceIDs?):
Traceback (most recent call last):
File "test3d.py", line 143, in ?
simulation()
File "test3d.py", line 70, in simulation
faces=filter(lambda f: f.getCenter()[2] < z0,
mesh.getFacesBottom())
File "test3d.py", line 70, in <lambda>
faces=filter(lambda f: f.getCenter()[2] < z0,
mesh.getFacesBottom())
AttributeError: 'numpy.int32' object has no attribute 'getCenter'
If these integers are FaceIDs, I did not find a way to convert them to
Face objects, so I cannot find out how I can process them.
Is there a way to select a subset of faces based on a geometrical
condition?
Best regards,
Sergey