Changeset 6472 for branches/numpy/anuga/shallow_water/test_data_manager.py
 Timestamp:
 Mar 5, 2009, 2:48:11 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/numpy/anuga/shallow_water/test_data_manager.py
r6428 r6472 10590 10590 ymomentum = fid.variables['ymomentum'][:] 10591 10591 10592 h = stagez 10593 for i in range(len(stage)): 10594 if num.alltrue(h[i] == 0.0): 10595 assert num.alltrue(xmomentum[i] == 0.0) 10596 assert num.alltrue(ymomentum[i] == 0.0) 10597 else: 10598 msg = ('h[i]=\n%s\ndomain.minimum_storable_height=%s' 10599 % (str(h[i]), str(domain.minimum_storable_height))) 10600 assert num.alltrue(h[i] >= domain.minimum_storable_height), msg 10592 for i in range(stage.shape[0]): 10593 h = stage[i]z # depth vector at time step i 10594 10595 # Check every node location 10596 for j in range(stage.shape[1]): 10597 # Depth being either exactly zero implies 10598 # momentum being zero. 10599 # Or else depth must be greater than or equal to 10600 # the minimal storable height 10601 if h[j] == 0.0: 10602 assert xmomentum[i,j] == 0.0 10603 assert ymomentum[i,j] == 0.0 10604 else: 10605 assert h[j] >= domain.minimum_storable_height 10601 10606 10602 10607 fid.close() … … 10635 10640 10636 10641 # Check runup restricted to a polygon 10637 p = num.array([[50,1], [99,1], [99,49], [50,49]]) + num.array([E, N]) 10642 p = num.array([[50,1], [99,1], [99,49], [50,49]], num.int) + \ 10643 num.array([E, N], num.int) #array default# 10638 10644 10639 10645 runup = get_maximum_inundation_elevation(swwfile, polygon=p)
Note: See TracChangeset
for help on using the changeset viewer.