Changeset 3623


Ignore:
Timestamp:
Sep 19, 2006, 3:21:56 PM (18 years ago)
Author:
jack
Message:

Moved the run_offline.py into the examples directory.

Location:
anuga_core/source/anuga
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/examples/run_offline.py

    r3619 r3623  
    1 from offline import OfflineVisualiser
     1##########
     2# Demonstration of the VTK sww Visualiser
     3# Jack Kelly
     4# September 2006
     5##########
    26
     7# Import the offline visualiser
     8from anuga.visualiser import OfflineVisualiser
     9
     10# The argument to OfflineVisualiser is the path to a sww file
    311o = OfflineVisualiser("../../swollen_viewer/tests/cylinders.sww")
    4 #o = OfflineVisualiser("../../../../swollen_viewer/tests/karratha_100m.sww")
     12
     13# Specify the height-based-quantities to render.
     14# Remember to set dynamic=True for time-varying quantities
    515o.render_quantity_height("elevation", dynamic=False)
    616o.render_quantity_height("stage", dynamic=True)
     17
     18# Colour the stage:
     19# Either with an RGB value as a 3-tuple of Floats,
    720#o.colour_height_quantity('stage', (0.0, 0.0, 0.8))
     21# Or with a function of the quantities at that point, such as the stage height:
     22# 0 and 10 are the minimum and maximum values of the stage.
    823o.colour_height_quantity('stage', (lambda q:q['stage'], 0, 10))
     24# Or with the magnitude of the momentum at that point:
     25# Needs the sqrt function from Numeric. Again, 0 and 10 define the colour range.
     26#o.colour_height_quantity('stage', (lambda q:sqrt((q['xmomentum'] ** 2) +
     27#                                                 (q['ymomentum'] ** 2)), 0, 10))
     28
     29# Precaching the height-based quantities reduces the time taken to draw each
     30# frame, but increases the time taken when the visualiser starts.
    931o.precache_height_quantities()
     32
     33# Start the visualiser (in its own thread).
    1034o.run()
  • anuga_core/source/anuga/visualiser/__init__.py

    r3465 r3623  
    1 from vtk_realtime_visualiser import *
    2 
     1from realtime import RealtimeVisualiser
     2from offline import OfflineVisualiser
     3from visualiser import Visualiser
Note: See TracChangeset for help on using the changeset viewer.