On Oct 18, 2006, at 1:14 PM, hzhatlboro wrote:
What is wrong with the program?
* For starters, it's much too complicated for diagnosing your problem. Please realize that we have limited time for supporting FiPy. We need to focus that time on issues that are unique to FiPy. It takes considerable time to wade through lengthy (and largely superfluous) scripts. In this case, the issues with this script don't have much to do with FiPy. There are numerous forums that are more qualified for help with Python and general programming issues, but you will find that they too are much happier to deal with /concise/ examples and questions.
* A 16x90 grid is far too large to be able to see what's going on here. 3x3 is probably sufficient.
* There's no reason to deal with four different phase variables until you can get a single one to work the way you want.
* Iterating over the cells of a mesh with Python for-loops is /never/ the right approach with FiPy (and is almost never the right approach with Python). for-loops are incredibly slow. You always want to being doing operations on whole arrays of values.
* Writing "where=((x==curposX) & (y==curposY))" for each and every cell in your mesh is not what I meant when I told you not to use "cells=". You should be writing a "where=" clause that is true for / all/ the cells you want to set. If you would /please/ tell me what you're /really/ trying to accomplish, we could probably help you write that "where=" clause, but in the meantime, you're going to a great deal of effort to accomplish something contrary to the way FiPy is designed and which may well not even be necessary. Please, please, please tell me what you really are trying to do. Please.
* Testing floating point numbers with == generally doesn't work as expected. That's not a FiPy issue or even a Python issue. It's just the way things are.
* The statement "s=phases" does not do what you think it does.
