source: inundation/pyvolution/view_tsh.py @ 2622

Last change on this file since 2622 was 2622, checked in by steve, 19 years ago

Updated merimbula viewer

File size: 1.2 KB
Line 
1"""
2Script to view tsh file using faster vpython graphics
3"""
4import sys
5from os import sep, path
6sys.path.append('..'+sep+'pyvolution')
7
8
9from shallow_water import Domain
10from pmesh2domain import pmesh_to_domain_instance
11from pyvolution.util import file_function
12from utilities.polygon import Polygon_function, read_polygon
13from Numeric import zeros, Float, maximum, minimum
14from realtime_visualisation_new import *
15
16#-------
17# Domain
18
19
20#-------------------------------------------------------------
21if __name__ == "__main__":
22    """
23    View a mesh and data points with attributes.
24    """
25    import os, sys
26    usage = "usage: %s mesh_input.tsh scale_z"%os.path.basename(sys.argv[0])
27
28    #print len(sys.argv)
29    #print sys.argv
30
31    if len(sys.argv) < 2:
32        print usage
33    else:
34        mesh_file = sys.argv[1]
35
36        scale_z = 1.0
37        if len(sys.argv) > 2:
38            scale_z = float(sys.argv[2])
39
40
41
42    print 'Creating domain from', mesh_file
43    domain = pmesh_to_domain_instance(mesh_file, Domain)
44    print "Number of triangles = ", len(domain)
45
46    visualiser =  Visualiser(domain, scale_z = scale_z)
47    visualiser.update_quantity('stage')
Note: See TracBrowser for help on using the repository browser.