On Fri, Mar 1, 2013 at 11:47 AM, Pierre de Buyl <[email protected]> wrote:

> Hi everyone,
>
> I have a question that is related to my other thread "Axisymmetric
> geometry",
> but the point is different.
>
> I need to compute "\int dtheta sin(theta) cos(theta) n(r,theta)" where n
> is a
> fipy cellvariable that is solution to my equation.
>
> Right now, I use n( (x,y,z) ) to evaluate the solution at a point in
> space. Are
> there better solutions to this problem?


Make sure you pass "order=1" as an argument to "__call__" (this should
probably be the default now) otherwise you are just picking the closest
cell center value.

    | __call__(self, points=None, order=0, nearestCellIDs=None)
    |      Interpolates the CellVariable to a set of points using a
    |      method that has a memory requirement on the order of Ncells by
    |      Npoints in general, but uses only Ncells when the
    |      CellVariable's mesh is a UniformGrid object.

If this isn't good enough have a look at Scipy's interpolation tools which
I think has been improved greatly of late.

-- 
Daniel Wheeler
_______________________________________________
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