[SciPy-dev] RE: new compiler

Rob rob at pythonemproject.com
Sun Dec 30 11:44:47 CST 2001


Its a very simple mesh generator.  It you follow the links on my web
page to the EMAP code, there is a new link there that takes you right to
the EMAP5 code and docs.  I'm trying to come up with a total python port
package.   So far the mesh generator, sift works with pure MOM or pure
FEM, but not with hybrids.  I had real trouble converting linked C
structures to python classes, since some of the structure members are
arrays.  There is no simple way of doing this.  Paul Dubois is helping
me, but i bit the bullet, and removed those array classes with the
result of having to add about 20 additional numpy arrays in one of my
program versions.  Here is an example of what I am trying to do.  It
doesn't work:

from Numeric import *

class CellUnit:

    def __init__(self):
        self.start=0
        self.stop=0
        self.end=0
        self.arr=zeros((20))
        self.cellu=map(lambda dummy: CellUnit, self.arr)

    def CellU(self):
        return self.cellu

u=CellUnit().CellU()
v=CellUnit().CellU()

u[0].start=3
u[0].step=5
v[0].start=8
v[0].step=18

print 3,5,8,18

print u[0].start
print u[0].step
print v[0].start
print u[0].step
--------------------------------------------------------
Hey Rob,

> I see a new compiler in CVS!  Rob.

Yep, its there.  There is quite a bit more functionality such as
inlining
C/C++ within Python, but I haven't done much testing on Unix at all. 
Also,
the documentation isn't finished.  I'm hoping to finish in early
January.

As far as changes to stuff you do in your FDTD code, the compiled_exec()
function has been renamed to blitz(), and you don't have to pass in the
locals() anymore if you don't want to.

So,

    scipy.compiled_exec(expr,locals())

can now be called with:

    scipy.blitz(expr)

So far, I think your the only one besides me that uses this thing, so
the
change shouldn't cause many people problems.

>
> ps. I'm now working on my FEM-MOM simulator stuff.  I'm porting into
> Python the mesh generator called "sift".  Its a bear.

What kind of mesh generator is it?  Is there a web link?

eric



-- 
The Numeric Python EM Project

www.pythonemproject.com



More information about the Scipy-dev mailing list