On Jul 31, 2012, at 11:19 AM, Daniel Wheeler wrote:

> This might be crazy slow if this is done point by point. Might be better to 
> create the interpolated phi array beforehand in one shot and then do the 
> integral. 

Another option is not to interpolate at all and use FiPy's cell-centered values:

x, = mesh.getCellCenters()
s = numerix.argsort(x)
numerix.exp(-scipy.quad(phi.getValues()[s], 0, x[s])[0])

Because these are cell-centered values, there are probably edge effects to 
worry about.

The sort is probably not necessary on a Grid1D, but it's safer.
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to