
class Grid2Deff(Grid2D):
def __init__(self,
xmin=0, xmax=1, dx=0.5,
ymin=0, ymax=1, dy=0.5):
Grid2D.__init__(self, xmin, xmax, dx, ymin, ymax, dy)
def ext_gridloop1(self, f):
"""compute a[i,j] = f(xi,yj) in an external routine."""
lx = size(self.xcoor); ly = size(self.ycoor)
a = zeros((lx,ly))
ext_gridloop.gridloop1(a, self.xcoor, self.ycoor, f)
return a
We can also migrate to C and C++ (done later)