source: anuga_core/source/anuga/pmesh/view_tsh.py @ 7711

Last change on this file since 7711 was 7711, checked in by hudson, 14 years ago

Refactored geometry classes to live in their own folder.

File size: 1.1 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 anuga.pyvolution.pmesh2domain import pmesh_to_domain_instance
11from anuga.pyvolution.util import file_function
12from anuga.geometry.polygon import Polygon_function, read_polygon
13from realtime_visualisation_new import *
14
15#-------
16# Domain
17
18
19#-------------------------------------------------------------
20if __name__ == "__main__":
21    """
22    View a mesh and data points with attributes.
23    """
24    import os, sys
25    usage = "usage: %s mesh_input.tsh scale_z"%os.path.basename(sys.argv[0])
26
27    #print len(sys.argv)
28    #print sys.argv
29
30    if len(sys.argv) < 2:
31        print usage
32    else:
33        mesh_file = sys.argv[1]
34
35        scale_z = 1.0
36        if len(sys.argv) > 2:
37            scale_z = float(sys.argv[2])
38
39
40
41    print 'Creating domain from', mesh_file
42    domain = pmesh_to_domain_instance(mesh_file, Domain)
43    print "Number of triangles = ", len(domain)
44
45    visualiser =  Visualiser(domain, scale_z = scale_z)
46    visualiser.update_quantity('stage')
Note: See TracBrowser for help on using the repository browser.