Changeset 7582
 Timestamp:
 Dec 7, 2009, 9:46:15 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_work/development/classroom/ripcurrent.py
r7581 r7582 11 11 from anuga.shallow_water.shallow_water_domain import Reflective_boundary 12 12 from anuga.shallow_water.shallow_water_domain import Time_boundary 13 from anuga.shallow_water.data_manager import get_mesh_and_quantities_from_file 14 from anuga.fit_interpolate.interpolate import Interpolation_function 13 15 from pylab import figure, quiver, show, cos, sin, pi 14 16 import numpy … … 175 177 # 176 178 # Post processing 177 # 178 179 # Use this 180 181 # from anuga.fit_interpolate.interpolate import Interpolation_function 182 183 # # Get mesh and quantities from sww file 184 # X = get_mesh_and_quantities_from_file(filename, 185 # quantities=quantity_names, 186 # verbose=verbose) 187 # mesh, quantities, time = X 188 189 # # Find all intersections and associated triangles. 190 # segments = mesh.get_intersecting_segments(polyline, verbose=verbose) 191 192 # # Get midpoints 193 # interpolation_points = segment_midpoints(segments) 194 195 # # Interpolate 196 # if verbose: 197 # log.critical('Interpolating  total number of interpolation points = %d' 198 # % len(interpolation_points)) 199 200 # I = Interpolation_function(time, 201 # quantities, 202 # quantity_names=quantity_names, 203 # vertex_coordinates=mesh.nodes, 204 # triangles=mesh.triangles, 205 # interpolation_points=interpolation_points, 206 # verbose=verbose) 207 208 # return segments, I 209 210 211 212 179 # 180 181 # Get mesh and quantities from sww file 182 quantity_names = ['elevation'] + domain.conserved_quantities 183 184 X = get_mesh_and_quantities_from_file(domain.get_name() + '.sww', 185 quantities=quantity_names, 186 verbose=True) 187 188 mesh, quantities, timesteps = X 189 190 191 # Interpolate quantities to gauges 192 I = Interpolation_function(timesteps, 193 quantities, 194 quantity_names=quantity_names, 195 vertex_coordinates=mesh.nodes, 196 triangles=mesh.triangles, 197 interpolation_points=gauges, 198 verbose=True) 199 200 201 202 # Compute velocity field 203 #uu = numpy.array(number_of_gauges) 204 #vv = numpy.array(number_of_gauges) 205 #for t in timesteps: 206 # for i in range(number_of_gauges): 207 # elevation, stage, uh, vh = I(t, point_id=i)# 208 # 209 # depth = stageelevation 210 # uu[i] += uh/depth 211 # vv[i] += vh/depth 213 212 214 213
Note: See TracChangeset
for help on using the changeset viewer.