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

Last change on this file since 5571 was 3564, checked in by ole, 18 years ago

Moved more supporting files into shallow_water.
Moved old least_squares to obsolete_code

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 anuga.pyvolution.pmesh2domain import pmesh_to_domain_instance
11from anuga.pyvolution.util import file_function
12from anuga.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.