Hi Prabhu Prabhu Ramachandran wrote: > Been a while since we exchanged emails. Lots of new projects (and a wee issue of two new babies) has been keeping me busy. But I'm getting back to doing some CFD/GFD diagnostics again finally.
> Sounds very cool. I've been down with a fever past couple of days and > am still battling my older emails. ;-) Nothing serious I hope! > I did notice in the code that you loop over VTK arrays. If you used > tvtk you can do this using numpy arrays without the need for an > expensive for loop in Python. You are right - I noticed that loops like this are slow. I have replaced two expensive operation with vtkPointDataToCellData (getting cell-wise quantities for surface integrals). I can see why tvtk would be better - another good reason to move to mayavi2. > Gerard> For those interested in the hacking aspect, it's > Gerard> interesting because you have the change the active scalar > Gerard> in a vtk dataset, so there cannot be one dataset, ie. the > Gerard> active scalar required for the iso-surface is different > Gerard> from the scalar you want to plot on the iso-surface. The > Gerard> only way around this appears to be to make a deep copy of > Gerard> the output of the contour filter, modify the active scalar > Gerard> of this copy and make this object the output of the > Gerard> filter. > > I believe you can do this in another way: > > In [1]: import vtk > > In [2]: c = vtk.vtkContourFilter() > > In [3]: c = vtk.vtkContourFilter() > > In [4]: c.SetInputArrayToProcess? Ah yes - one of the less documented/google-able features of VTK. However, an additional problem is that I want to add arrays (the newly computed fluxes to the vtkPolyData output of vtkContourFilter. vtk is not so keen on filter.GetOutput().GetPointData().AddArray(flux), so it still looks like I have to make a copy. > Gerard> Prabhu, after people have had a change to give feedback, > Gerard> are you happy with this being committed? We have started > > Sure, no problem. I don't think I'll make a new release though. > MayaVi2 is the future. That's fine. I have promised myself that I will not write anything new for mayavi1.x and start working on mayavi2 instead. I'm partly motivated to have a copy of the filter in the public domain because I refer to it in a paper I've submitted with a colleague, which contains general python/vtk/mayavi propaganda. Thanks for the feedback. Gerard. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ MayaVi-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mayavi-users
