On Mar 14, 2012, at 3:04 AM, Andreas Hasenkopf wrote:

> attached are my mesh and the script. In the gmsh options I have
> unchecked everything but triangles and tetrahedra as fipy does not
> support something else (as written in the fipy documentation).

Thanks for this. I can certainly reproduce the problem. I'll let you know when 
I've found a solution (which will probably only be available with the release 
of FiPy 3.0).

> Thanks for the interpolation tip. Additionaly I found an older related
> post on the mailing list. Trying this with my script I get different
> error messages, e.g.:
> - potential((2.2,1.1)) causes "TypeError: object of type 'float' has no
> len()"
> - potential(2.2,1.1) has the same effect
> - passing one or two 2D numpy array(s) (as one would use for 2D plots in
> matplotlib) causes a MemoryError

You have two issues here:

First, you're asking for the value at a 2D coordinate from a 3D CellVariable. 
FiPy has no idea what that means. *I* have no idea what that means.

Second, the __call__ routine expects a vector of coordinates, such as returned 
by mesh.getCellCenters(). Even a single coordinate must be passed as a vector, 
e.g.

print potential([[2.2],
                 [1.1],
                 [1.0]])


_______________________________________________
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