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:

Dan,
    I did the installation of  Python24.  I am seeing more of the examples,
but not all.  For example, one that fails is
'C:\Python24\FiPy-1.1\examples\diffusion\circle.py'
with the error message "Unable to create a Gist2DViewer".
Is this expected?  I do find the Gist viewer files down in the directory
'C:\Python24\Lib\site-packages\fipy\viewers\gistViewer', but somehow
my installation does not reach it or execute it.  I added this address to
the PYTHONPATH, but it didn't seem to matter.
Terry McDaniel
Seagate Research     (209) 295-6735



             Daniel Wheeler                                            
             <[EMAIL PROTECTED]                                         
             ist.gov>                                                   To
             No Phone Info             [EMAIL PROTECTED]    
             Available                                                  cc
                                       [email protected]                   
                                                                   Subject
             07/20/2006 08:49          Re: Pylab trial                 
             AM                                                        









On Jul 19, 2006, at 6:45 PM, [EMAIL PROTECTED] wrote:



      Dan,
         I tried the little trial that you suggested:

            >>> import pylab
            >>> pylab.plot((1,2,3))
            >>> pylab.show()

      It seemed to have some problems.....(See attached file:
      Pylab_trial.rtf)

      The command      >>> import pylab        yielded complaints the first
      time,
      but not the second. (?)

The second import does nothing as an import for that module has already
occurred previously
in the session.

I also get the same problem with

   >>> import pylab

having tried it myself. This is most likely a compatibility problem between
this particular version of enthought python
and the Matplotlib plotting package.  So, I have gone ahead and reinstalled
a later version of enthought python on
my Windows machine and everything seems to work fine. Sorry that the
instructions on the webpage didn't work as expected.

Anyway, I would recommend starting over. Here are some new instructions:

    1) Download enthon-python2.4-1.0.0.beta4.exe from <

    2) Download pysparse-0.34.032.win32-py2.4.exe from  <
         Make sure you get the py2.4 version, NOT py2.3.

   3) Download FiPy-1.1.win32.zip from <
http://www.ctcms.nist.gov/fipy/download/> and unpack and run the Windows
installer.
        Make sure it uses Python24 during installation. It prompts you at
the beginning of the install process.

You can remove C:\Python23 if you wish, you don't have to. Just be sure to
run the Python24 version of IDLE when you use FiPy.

This should get you up and running and Matplotlib working properly. You
shouldn't need to do any other tweaks. The difference
is that Matplotlib is included with this version of enthought python and
doesn't need installing separately.

      Terry McDaniel
      Seagate Research     (209) 295-6735
      <Pylab_trial.rtf>

Cheers

Daniel Wheeler





Daniel Wheeler



Reply via email to