Rev | Line | |
---|
[1266] | 1 | """ |
---|
| 2 | Script to view tsh file using faster vpython graphics |
---|
| 3 | """ |
---|
[1296] | 4 | import sys |
---|
| 5 | from os import sep, path |
---|
| 6 | sys.path.append('..'+sep+'pyvolution') |
---|
[1266] | 7 | |
---|
[1296] | 8 | |
---|
[1266] | 9 | from shallow_water import Domain |
---|
| 10 | from pmesh2domain import pmesh_to_domain_instance |
---|
[2622] | 11 | from pyvolution.util import file_function |
---|
| 12 | from utilities.polygon import Polygon_function, read_polygon |
---|
[1266] | 13 | from Numeric import zeros, Float, maximum, minimum |
---|
| 14 | from realtime_visualisation_new import * |
---|
| 15 | |
---|
| 16 | #------- |
---|
| 17 | # Domain |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #------------------------------------------------------------- |
---|
| 21 | if __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 | |
---|
[1363] | 46 | visualiser = Visualiser(domain, scale_z = scale_z) |
---|
| 47 | visualiser.update_quantity('stage') |
---|
Note: See
TracBrowser
for help on using the repository browser.