Last change
on this file since 1452 was
1363,
checked in by steve, 20 years ago
|
Changes to visualisation. Can use visualise_color_stage to color stage, but it uses python update (slow).
|
File size:
1.1 KB
|
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 |
---|
| 11 | from util import file_function, Polygon_function, read_polygon |
---|
| 12 | from Numeric import zeros, Float, maximum, minimum |
---|
| 13 | from realtime_visualisation_new import * |
---|
| 14 | |
---|
| 15 | #------- |
---|
| 16 | # Domain |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #------------------------------------------------------------- |
---|
| 20 | if __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 | |
---|
[1363] | 45 | visualiser = Visualiser(domain, scale_z = scale_z) |
---|
| 46 | visualiser.update_quantity('stage') |
---|
Note: See
TracBrowser
for help on using the repository browser.