Hi Jonathan,

Thank you for the update. I'll try the MatplotlibStreamViewer with my code and 
try to keep up to date with the ticket resolutions.

Thanks again,
Ryan Smith


On Jun 12, 2013, at 11:32 AM, Jonathan Guyer <[email protected]> wrote:

> On Jun 11, 2013, at 2:34 AM, Ryan Smith <[email protected]> wrote:
> 
>> I would like to use matplotlib's streamplot function to display the fluid 
>> flow in the stokesCavity example. Furthermore, I would like to extend this 
>> for my own simulations of fluid flow (following the same code as 
>> stokesCavity but with different BCs) for an irregular mesh generated from 
>> Gmsh. 
>> 
>> With the stokesCavity example, I initially thought I would be able to call 
>> the streamplot function right away using: 
>> matplotlib.pyplot.streamplot(X, Y, xVelocity.value, yVelocity.value), 
>> however, all these variables are 1D arrays rather than NxN arrays. With a 
>> rectangular grid creating code to change the 1D arrays into NxN may not be 
>> too bad, but for an irregular grid this task seems daunting.
>> 
>> Then I thought the code for the matplotlibVectorViewer function could be 
>> adjusted since matplotlib's streamplot() and quiver() functions take the 
>> same arguments. I looked at the code in the file 
>> FiPy-3.0/fipy/viewers/matplotlibViewer/matplotlibVectorViewer.py, but I'm 
>> lost as to what code to adjust or if I'm adjusting code in the right area.
>> 
>> In short, is there a way to change the matplotlibVectorViewer function from 
>> plotting quiver() to plotting streamplot()?
> 
> I've been meaning to take a look at this for my own work ever since I noticed 
> that Matplotlib had added streamplot(). It definitely wasn't trivial to 
> implement, so I just went ahead and did it because that was going to be 
> easier than trying to explain to you how to do it.
> 
> I opened a ticket <http://matforge.org/fipy/ticket/641> to track the request 
> and you can presently test out the MatplotlibStreamViewer on the 
> ticket641-support_Matplotlib_streamplot branch of our git repo.
> 
> A couple of issues that may or may not affect you (they do affect me, so I 
> will by trying to find solutions):
> 
> * It is not at all easy to remove the streams from the plot, which we need to 
> do for animation. The solution right now requires clearing the axes every 
> time we plot, which means you can't overlay different sets of streams (or 
> streams on any other fields). <http://matforge.org/fipy/ticket/642>
> 
> * The tools to interpolate from arbitrary grid points to the gridded data 
> that streamplot() needs all interpolate onto the convex hull of the original 
> data, which means if you have concavities in your mesh, you will get stream 
> lines crossing where there is no mesh.
> <http://matforge.org/fipy/ticket/643>
> 
> Like I said, I have both of these problems in my own research application, so 
> I will be working on fixing them at some point.
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
> 


_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to