Hello,

    I am plotting a bunch of streamlines using the 'flow' command in a for 
loop. After plotting each streamline, I store the values of coordinates and 
field magnitude along the line in a file, then I move to the next streamline.

Here it is a sample of the code (Bx,By and Bz represent the vector field 
components):



from enthought.mayavi.mlab import *

options.offscreen = True

x = np.array([0,1,2,3,4])
y = np.array([2,2,2,2,2])
z = np.array([0,1,2,3,4])


for i in range(x) :
    for k in range(z) :

        fl = flow(Bx,By,Bz,seedtype='point',integration_direction='forward')
        fl.seed.widget.position = [x[i], y[i], z[k]]


        dataset = fl.outputs[0]
        

        fl.remove
            
        xS, yS, zS = dataset.points.to_array().T
        Bmod = dataset.point_data.scalars.to_array()
        

        ##store xS, yS, zS, Bmod to a file


This is the problem: during the loop the memory used (VIRT, RES, %MEM in the 
"top" terminal command) increases abruptly in a couple of loop!
I read some discussions on the web about this and I tried to add clf(), gfc() 
and/or close() after the fl.remove, but nothing happens...

Notice that I run my script after ssh-ing to another machine which is faster 
than mine, even I suppose it is not the source of the problem.

Anyone has any hints?

Cheers!

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to