On May 26, 2011, at 1:56 AM, Fangohr H. wrote:
> The command doesn't seem to work for a single item: > >>>> v((2.5,3.2)) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File > "/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/FiPy-2.1.1-py2.7.egg/fipy/variables/cellVariable.py", > line 197, in __call__ > nearestCellIDs = self.getMesh()._getNearestCellID(points) > File > "/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/FiPy-2.1.1-py2.7.egg/fipy/meshes/numMesh/uniformGrid2D.py", > line 598, in _getNearestCellID > i[i < 0] = 0 > IndexError: 0-d arrays can't be indexed. > > > But works in the multi-point syntax (so solves my problem): > >>>> v(((2.5,),(3.2,))) > array([ 2.5]) Correct, this is the right way to do it. The other was my mistake (that's what I get for posting code without testing it).
