Hi Matt,
Thanks for your interest. I'll try and answer your questions below.
On Jan 16, 2007, at 11:23 PM, Matt Koch wrote:
Hello there,
I am brand new new FiPy, in fact just seem to have managed to
install it on Windows 2000 and Slackware 10.2 Linux.
Good. Did you use subversion to get the latest version of fipy or did
you install 1.1?
This seems like enormously powerful software! I have read some
documentation and briefly reviewed the mailing list. There is one
entry (http://www.mail-archive.com/[email protected]/msg00116.html)
that seems to speak to the subject, but it is a little too advanced
for me.
This exchange discusses wedge shaped meshes that are a requirement
for faking cylindrical coordinates using
Cartesian discretization. If you want to solve a 2D cylindrical
problem, you need to create a 3D wedge shaped mesh.
This may be possible in gmsh and then you can use the Gmsh importer
to read the mesh and run it in fipy. We can discuss this
further if this is what you decide on doing. You may also be able to
bury the cylindrical prefactors inside the term's coefficient.
I would have to look more closely at your equations.
I am just wondering how to set up a problem in cylindrical (r,z)
rather than rectangular (x,y) coordinates. Is there a command I
should call or is there an object I have to initialize in order to
switch on cylindrical coordinates? From the above entry, I am
almost guessing that one would have to implement their own
divergences and such in cylindrical coordinates by adding the
radius in proper places of the divergences and such in rectangular
coordinates? That can't be right!?
The wedge shaped mesh will take care of this, although there is some
loss of accuracy. I have never measured the error,
but I have been informed that this is an acceptable method. I think
refactoring the discretization and various gradient operators
for cylindrical coordinates would be quite an involved process at
this point and I wouldn't recommend it.
Also, other than using GMsh (which is incredibly awesome software,
by the way), how I can I create somewhat more complicated domains
than the simple lines, squares and circles used in most of the
examples. Can I generate such geometry in FiPy, and can I mesh that
then? All I have seen thus far is meshing commands for lines,
rectangles or circles. How would I create and mesh, say, a Tee shape?
You can splice meshes in fipy, which is more straightforward than
using gmsh for some problems.
To create a T mesh, you need just create two rectangular meshes and
add them together as below. Remember the
vertices and faces have to be perfectly aligned and not overlapping
>>> from fipy import *
>>> mesh1 = Grid2D(nx=6, ny=2) + (-3.0, 6.0)
>>> mesh2 = Grid2D(nx=2, ny=6)
>>> mesh = mesh1 + mesh2
>>> print mesh.getCellCenters()
[[-2.5 6.5]
[-1.5 6.5]
[-0.5 6.5]
[ 0.5 6.5]
[ 1.5 6.5]
[ 2.5 6.5]
[-2.5 7.5]
[-1.5 7.5]
[-0.5 7.5]
[ 0.5 7.5]
[ 1.5 7.5]
[ 2.5 7.5]
[ 0.5 0.5]
[ 1.5 0.5]
[ 0.5 1.5]
[ 1.5 1.5]
[ 0.5 2.5]
[ 1.5 2.5]
[ 0.5 3.5]
[ 1.5 3.5]
[ 0.5 4.5]
[ 1.5 4.5]
[ 0.5 5.5]
[ 1.5 5.5]]
Thanks,
Matt Koch
Cheers
--
Daniel Wheeler