Changeset 4567
- Timestamp:
- Jun 28, 2007, 5:27:17 PM (17 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4563 r4567 89 89 pmesh_to_domain_instance 90 90 from anuga.abstract_2d_finite_volumes.util import get_revision_number, \ 91 remove_lone_verts, sww2timeseries 91 remove_lone_verts, sww2timeseries, get_centroid_values 92 92 from anuga.load_mesh.loadASCII import export_mesh_file 93 93 # formula mappings … … 5448 5448 5449 5449 def get_maximum_inundation_data(filename, polygon=None, time_interval=None, 5450 use_centroid_values=False, 5450 5451 verbose=False): 5451 5452 """Compute maximum run up height from sww file. … … 5513 5514 elevation = fid.variables['elevation'][:] 5514 5515 stage = fid.variables['stage'][:] 5516 5517 5518 # Here's where one could convert nodal information to centroid information 5519 # but is probably something we need to write in C. 5520 # Here's a Python thought which is NOT finished!!! 5521 if use_centroid_values is True: 5522 x = get_centroid_values(x, volumes) 5523 y = get_centroid_values(y, volumes) 5524 elevation = get_centroid_values(elevation, volumes) 5515 5525 5516 5526 … … 5574 5584 maximal_runup_location = None 5575 5585 for i in timesteps: 5576 depth = stage[i,:] - elevation 5586 if use_centroid_values is True: 5587 stage_i = get_centroid_values(stage[i,:], volumes) 5588 else: 5589 stage_i = stage[i,:] 5590 5591 depth = stage_i - elevation 5577 5592 5578 5593 # Get wet nodes i.e. nodes with depth>0 within given region and timesteps -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r4563 r4567 7080 7080 runup = get_maximum_inundation_elevation(swwfile) 7081 7081 location = get_maximum_inundation_location(swwfile) 7082 #print runup, location 7082 7083 assert allclose(runup, 11) 7083 7084 assert allclose(location[0], 15) … … 7086 7087 runup = get_maximum_inundation_elevation(swwfile, time_interval=[45,50]) 7087 7088 location = get_maximum_inundation_location(swwfile, time_interval=[45,50]) 7089 #print runup, location 7088 7090 assert allclose(runup, 1) 7089 7091 assert allclose(location[0], 65) … … 7093 7095 runup = get_maximum_inundation_elevation(swwfile, polygon=p) 7094 7096 location = get_maximum_inundation_location(swwfile, polygon=p) 7097 #print runup, location 7095 7098 assert allclose(runup, 4) 7096 7099 assert allclose(location[0], 50)
Note: See TracChangeset
for help on using the changeset viewer.