On 10/1/07, Zhiwen Liang <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Professor Garcia and I are working on the Cahn Hilliard simulations
> using Fipy. But we could not get the viewer works. The mesh we use is
> an unstructured 2D mesh created by GMSH.
That should be fine.
> If we use the fipy.viewers, it gives an IndexError with the following
> traceback:
>
> File "canh.py", line 178, in ?
> viewer.plot()
> File "/Users/liangz/stow/Fipy//lib/python2.3/site-packages/fipy/
> viewers/gistViewer/gist2DViewer.py", line 133, in plot
> xCoords = numerix.take(vertexCoords[:,0], numerix.array
> (vertexIDs).flat)
> File "/Users/liangz/stow/Fipy//lib/python2.3/site-packages/fipy/
> tools/numerix.py", line 1235, in take
> taken = NUMERIX.take(a, indices, axis=axis)
> File "/Users/liangz/stow/Numpy-1.0.1//lib/python2.3/site-packages/
> numpy/core/fromnumeric.py", line 51, in take
> return take(indices, axis, out, mode)
> IndexError: index out of range for array
Can you also post your script? Gist still requires the old Numeric module, but
that is not the error you are getting. Which version of fipy are you using?
> It seems that the program is having trouble finding the x coordinate.
>
> If we use Mayavi, it gives the MAError with the following traceback:
>
> File "canh.py", line 175, in ?
> viewer = MayaviViewer(vars = var, limits = {'datamin': 0.,
> 'datamax': 1.0})
> File "/Users/liangz/stow/Fipy//lib/python2.3/site-packages/fipy/
> viewers/mayaviViewer/mayaviViewer.py", line 101, in __init__
> self.structures.append(self._getStructure(var.getMesh()))
> File "/Users/liangz/stow/Fipy//lib/python2.3/site-packages/fipy/
> viewers/mayaviViewer/mayaviViewer.py", line 105, in _getStructure
> cellVertexIDs = [[int(ID) for ID in IDs] for IDs in
> mesh._getOrderedCellVertexIDs()]
> File "/Users/liangz/stow/Numpy-1.0.1//lib/python2.3/site-packages/
> numpy/core/ma.py", line 787, in __int__
> raise MAError, 'Cannot convert masked element to a Python int.'
> numpy.core.ma.MAError: Cannot convert masked element to a Python int.
I tried the "examples/diffusion/circle.py" example with mayavi and it seems
to work okay. Can you post your script and I'll try running it.
> Also troubles with the coordinates.
>
> I saw a very beautiful pictures of the Cahn Hilliard examples on the
> website of Fipy. But it is not included in the example directory. I
> wonder what viewer it used and if possible, could you refer me to
> more resources how we can make this work?
Try "python examples/cahnHilliard/input2D.py --numberOfElements=10000
--numberOfSteps=1000" in your base fipy directory.
> We would greatly appreciate your help! Have a nice day!
Thanks for your feedback. Keep it up.
Cheers
> Thanks,
> Zhiwen
--
Daniel Wheeler