On Apr 25, 2012, at 4:22 PM, Yun Tao wrote:

> I'm trying to generate the diffusion pattern of a bivariate_normal. However, 
> so far a main obstacle is to form the distribution on top of a 2D mesh. The 
> bivariate_normal function from matplotlib.mlab takes axial arguments that are 
> spit out by numpy.meshgrid. But it's clear that the underlying mesh 
> construction of meshgrid is different from Grid2D from fipy:

There are several examples that show how to obtain the coordinates of the cell 
centers, e.g.,

http://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.anisotropy.html?highlight=getcellcenters
http://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.circle.html?highlight=getcellcenters
http://www.ctcms.nist.gov/fipy/examples/levelSet/generated/examples.levelSet.advection.circle.html?highlight=getcellcenters
http://www.ctcms.nist.gov/fipy/examples/phase/generated/examples.phase.anisotropy.html?highlight=getcellcenters

The only difference I can see is that np.meshgrid() returns a shaped result, 
where as FiPy's .getCellCenters() just returns lists of numbers. That's just 
fine; matplotlib.mlab.bivariate_normal() will return z in the same shape as X 
and Y and FiPy wants its values unshaped.
_______________________________________________
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