Hi Burak,

Apologies for the slow reply.  If you want to put a boundary condition
on specific
faces it is better to do this in terms of the physical position of the
face. FiPy has no
set internal mappings from ID to physical position. It could be different from
mesh to mesh. If you want to pull out specific faces on which to apply
a boundary condition,
do it something like this:

In [1]: from fipy import *

In [2]: m = Grid2D(nx=4, ny=4, dx=1., dy=1.)

In [15]: x, y = m.getFaceCenters()

In [16]: listOfFaces = m.getFaces(filter=lambda ID: y[ID] < .1 and x[ID] > 2.)

In [17]: listOfFaces
Out[17]: FaceIterator(mesh=UniformGrid2D(dx=1.0, dy=1.0, nx=4, ny=4),
ids=array([2, 3]))

"listOfFaces" is a list of the "bottom" faces to the right of center.
You can now apply
a boundary condition to these faces.

Cheers

On Dec 26, 2007 6:06 AM, Burak Atakan <[EMAIL PROTECTED]> wrote:
>
> Thanks for the last answer. I've a new question:
>
>
> For a 2D-diffusion problem, I would like to fix the concentration (to zero) 
> for
> parts of the bottom (from 0 to 'Ende'),
> while the flux should be zero for the rest.
> For the part where the concentration is fixed I would like to evaluate the
> gradient, finally to get the (species)flux at these positions.
>
>
> I tried the following:
> ###################################
> BCs = (FixedValue(faces=mesh.getFacesBottom()[0:Ende],
>                   value=bot))
>        ...
> for step in range(steps):
>     eq.solve(var=phi,
>              boundaryConditions=BCs,
>              dt=timeStepDuration)
> idsBottom=mesh.getFacesBottom().ids
>
> fl=phi.getFaceGrad()[idsBottom,0]
> ###################################
> However, the fluxes at locations > Ende do not vanish as I expected.
>
> Is there an easier way of getting the gradients or fluxes at the
> boundaries, or
> am I doing something wrong?
> Thanks in advance!
> Burak
>
>
>



-- 
Daniel Wheeler

Reply via email to