# Changeset 6472

Ignore:
Timestamp:
Mar 5, 2009, 2:48:11 PM (15 years ago)
Message:

Took Ole's changes to the test_get_maximum_inundation code and made it numpy.

Location:
branches/numpy/anuga/shallow_water
Files:
2 edited

Unmodified
Removed
• ## branches/numpy/anuga/shallow_water/test_data_manager.py

 r6428 ymomentum = fid.variables['ymomentum'][:] h = stage-z for i in range(len(stage)): if num.alltrue(h[i] == 0.0): assert num.alltrue(xmomentum[i] == 0.0) assert num.alltrue(ymomentum[i] == 0.0) else: msg = ('h[i]=\n%s\ndomain.minimum_storable_height=%s' % (str(h[i]), str(domain.minimum_storable_height))) assert num.alltrue(h[i] >= domain.minimum_storable_height), msg for i in range(stage.shape[0]): h = stage[i]-z # depth vector at time step i # Check every node location for j in range(stage.shape[1]): # Depth being either exactly zero implies # momentum being zero. # Or else depth must be greater than or equal to # the minimal storable height if h[j] == 0.0: assert xmomentum[i,j] == 0.0 assert ymomentum[i,j] == 0.0 else: assert h[j] >= domain.minimum_storable_height fid.close() # Check runup restricted to a polygon p = num.array([[50,1], [99,1], [99,49], [50,49]]) + num.array([E, N]) p = num.array([[50,1], [99,1], [99,49], [50,49]], num.int) + \ num.array([E, N], num.int)      #array default# runup = get_maximum_inundation_elevation(swwfile, polygon=p)