On May 14, 2007, at 11:55 AM, Matt Koch wrote:
Would it be
>>> myFaces = mesh.getFaces(where=x>1 & x<5)
in that case?
Unfortunately, we don't support that syntax yet.
The way of specifying boundary conditions needs to all be updated to
use "where=" syntax. The "hack" I showed previously for doing fixed
flux boundary conditions *does* use "where=", however, and that
general technique will almost certainly become the official way to do
it, so "where=" should be made to work for all boundary conditions
sooner rather than later.
Also, I assume this would work for something that is not a simple,
single rectangular box? Say I have two plates in xyz space, where
the extent is infinite in the z-direction, the plates are parallel
to the xz-plane, separated by a distance h in the y-direction, and
have thickness t in the y-direction. If I were to pull this in from
GMsh, how would I extract the two surfaces that face each other? or
is there another way, outside of GMsh, to do something like this?
I'm not sure I understand; you want to solve in the interior of each
of the plates? The plates are not connected? I imagine that should
work, but it's not a case we've thought about. FiPy was really
designed to solve within topologically simple domains. Anyway, if
that is what you mean, then you'll just want to write a "where="
statement or a "filter=" statement that describes the boundaries.
___ ___ | z
/ /| / /| |
/ / | / / | |
/__/ | /__/ | |
| | | | | | |________ y
| | / | | / /
| | / | | / /
|__|/ |__|/ / x
y0 y0 y0 y0
+ + +
t t 2t
+ +
h h
If this picture describes what you're doing, then I would say
def myfaces(face, wanted):
return face.getCenter()[1] == wanted
boundaryFaces1 = mesh.getFaces(filter=myfaces, wanted=y0)
boundaryFaces2 = mesh.getFaces(filter=myfaces, wanted=y0 + t)
boundaryFaces3 = mesh.getFaces(filter=myfaces, wanted=y0 + t + h)
boundaryFaces4 = mesh.getFaces(filter=myfaces, wanted=y0 + 2 * t
+ h)
This assumes you want different boundary conditions on different
boundaries; if they're all the same, then you could just say
something like
def myfaces(face, wants):
for want in wants:
if face.getCenter()[1] == want:
return 1
return 0
boundaryFaces1 = mesh.getFaces(filter=myfaces, wanted=(y0, y0 +
t, y0 + t + h, y0 + 2 * t + h))
*If* you're using the "hack" and can use "where=", then say
boundary1.setValue(1, where=(faceY == y0))
boundary2.setValue(1, where=(faceY == y0 + t))
:
:
and so on, or just:
boundary.setValue(1, where=(faceY == y0) | (faceY == y0 + t) | ...)
And yes, I probably did receive a bounced e-mail message, but as
usual, probably ignored it. I just have to remember to use the
right address in the "From" field. My fault.
Feel free to subscribe both. I believe we can shut off mail delivery
for all but one of them so you won't get double messages, but you can
post from either address.