| Hi Terry, Again, thanks for your feedback. In this case the circle diffusion problem uses an unstructured mesh, and thus, requires a viewer that can display unstructured data. At the moment, Gist is the only viewer that satisfies that purpose. For most FiPy examples, the viewer is chosen by the function "fipy.viewers.make()" in the "__init__.py" of the "fipy.viewers" module. This function examines which viewers are available and then chooses a viewer appropriately. In this example we specify the Gist viewer via "fipy.viewers.gistViewer.gist2DViewer". Unfortunately, Gist is awful on Windows and so we don't recommend it on that platform. This example should really use the make() functionality to find a suitable viewer when gist is unavailable. Instead of Gist, you can use Mayavi to display unstructured meshes if required. To set up Mayavi correctly, you need to implement the following steps: 1) Get PyVTK and install from <http://www.ctcms.nist.gov/fipy/download/> 2) Move C:\Python24\Lib\site-packages\vtk_python\vtkRenderingPythonTkWidgets.dll to C:\Python24\ 3) Set up interactive viewing with IDLE - Click on ``Start`` - Click on ``Programs`` - Click on ``Python 2.4 (Enthought Edition)`` - Right click on ``IDLE (Python GUI)`` and click on ``Create Shortcut`` which creates ``IDLE (Python GUI)(2)`` - Right click on ``IDLE (Python GUI)(2)`` - Click on properties - Add the ``-n`` option to ``Target`` being sure to leave a space after the last quote and before ``-n`` - Drag and drop ``IDLE (Python GUI)(2)`` to the desktop to create an icon. 4) To see the script you are interested in, replace the following lines in 'examples/diffusion/circle.py': ... try: ... from fipy.viewers.gistViewer.gist2DViewer import Gist2DViewer ... viewer = Gist2DViewer(vars=phi, ... limits={'datamin': -1, 'datamax': 1.}) ... viewer.plotMesh() ... raw_input("Irregular circular mesh. Press <return> to proceed...") ... except: ... print "Unable to create a Gist2DViewer" with ... from fipy.viewers.mayaviViewer.mayaviViewer import MayaviViewer ... viewer = MayaviViewer(vars=phi, limits={'datamin': -1, 'datamax': 1.}) ... viewer.plot() ... raw_input("Irregular circular mesh. Press <return> to proceed...") This last step just tells the script to use the Mayavi viewer rather than the gist viewer. These steps are a bit funky, but the behavior of the viewers is mostly out of our control. On Jul 20, 2006, at 7:51 PM, [EMAIL PROTECTED] wrote:
Daniel Wheeler |
- Re: Pylab trial Daniel Wheeler
- Re: Pylab trial Daniel Wheeler
