source: development/momentum_sink/compare_sww.py @ 2395

Last change on this file since 2395 was 2395, checked in by nicholas, 19 years ago

Updated compare_sww.py. Increased distance of rear boundary and changed to dirichlet

File size: 1.0 KB
Line 
1"""Read in sww file, interpolate at specified locations and  times
2"""
3
4from os import sep
5import project
6from pyvolution.util import file_function
7import Numeric
8#from friction_block #import test
9
10#print "test", test
11#import sys
12#sys.exit()
13
14
15#swwfile = project.outputname + '.sww'
16#swwfile = project.outputdir + sep  + 'FrictionBlock_0.01_3.sww'
17swwfile = project.outputdir + sep  + 'Buildings_3662.sww'
18gauge_depth = Numeric.arrayrange(0, 700, 20)
19gauge_breadth = 100
20gauge_locations = []
21
22for GD in gauge_depth:
23    gauge_location = [GD,gauge_breadth]
24    gauge_locations.append(gauge_location)
25
26quantities = ['stage','elevation','xmomentum']
27gauges = file_function(swwfile,
28                  quantities = quantities,
29                  interpolation_points = gauge_locations,
30                  verbose = True,
31                  use_cache = True)
32
33times = [150,500]
34
35for gauge, _ in enumerate(gauge_locations):
36    print "gauge", gauge
37    for time in times:
38        print "results ", gauges(time, gauge)
Note: See TracBrowser for help on using the repository browser.