On Aug 9, 2008, at 10:15 AM, franck kalala wrote:
Thanks for the answer. Then how do I set this initial value phi(x)=0 for x<0 phi(x)=1 for x>0
In FiPy 1.2:
>>> x = mesh.getCellCenters()[..., 0]
>>> phi.setValue(0, where=x < 0)
>>> phi.setValue(1, where=x > 0)
You should also specify what happens at x == 0.
If you're using trunk/ then the first line would be
>>> x, = mesh.getCellCenters()
