2010/10/13 Daniel Wheeler <[email protected]>

>
>
> On Tue, Oct 12, 2010 at 5:26 PM, BIN ZHANG <[email protected]> wrote:
>
>> Dear Daniel:
>>
>> Thanks a lot for your suggestions. Now I'm actually able to solve the
>> problem with normal boundary conditions. But I still have one extra
>> question, is it possible for me to use complicated boundaries like the one
>> shown in the attachment. For the white circle on the left, I would have
>> phi=0, and for the white circle on the right, I would have phi=1.
>>
>> I tried to define these boundaries using mesh.getInteriorFaces(), but I
>> got an error about:  "Face list has interior faces"
>>
>> Is there a way to enforce these complicated boundaries in fipy?
>>
>
> You can't have interior boundary conditions in FiPy. Cast the boundary
> condition to a volume integral and apply a source term based on location or
> use Benny's suggestion, which can more accurately capture the boundary.
>

You can however add new terms so as to have internal boundaries :-)
I patch fipy to allow for a diffusion term over an internal membrame. This
works ok.

It would be nice if the design of fipy makes it possible to do this without
patching fipy.
You can see the example here:
http://gitorious.org/microchanit/microchanit/blobs/master/patch/patchfipyrev3871.diff
if you search on diffusiontermmembrane. The problem to do this easily in
fipy is in
fipy/terms/equation.py, with the variable self.orderedKeys

Another way to indicate a class inheriting from DiffusionTerm may not be
added to that class should be found in my opinion. Eg, one can have a class
membervalue (like class.ADDITIONTERM) indicating with what term the class
can be added. So new terms have to explicitly declare to what to add them,
instead of storing this in equation.py. That would allow me having this
custom term in my implementation without requiring to patch fipy to include
it.

PS: some other things in that patch are no longer needed due to the great
speedup in trunk now on adding meshes. Thanks for that ! I do still need a
more elaborate periodic mesh however and my editor pylint check chokes on
combining tabs with 4 spaces in a py file....

Benny



> --
> Daniel Wheeler
>

Reply via email to