Changeset 8359 for trunk/anuga_work/development/gareth/tests/runup_sinusoid
- Timestamp:
- Mar 13, 2012, 3:46:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
r8358 r8359 18 18 #Setup computational domain 19 19 #--------- 20 points, vertices, boundary = anuga.rectangular_cross(40,40 )20 points, vertices, boundary = anuga.rectangular_cross(40,40, len1=1., len2=1.) 21 21 22 22 domain=Domain(points,vertices,boundary) # Create Domain … … 25 25 domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1}) 26 26 #domain.set_store_vertices_uniquely(True) 27 domain.minimum_allowed_height=0.001 27 28 28 29 #------------------ … … 30 31 #------------------ 31 32 scale_me=1.0 33 34 #domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave 35 32 36 def topography(x,y): 33 37 return (-x/2.0 +0.05*numpy.sin((x+y)*50.0))*scale_me … … 67 71 # Associate boundary tags with boundary objects 68 72 #---------------------------------------------- 69 domain.set_boundary({'left': Br, 'right': B d, 'top': Br, 'bottom':Br})73 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br}) 70 74 71 75 #------------------------------ … … 75 79 for t in domain.evolve(yieldstep=0.1,finaltime=20.0): 76 80 print domain.timestepping_statistics() 81 xx = domain.quantities['xmomentum'].centroid_values 82 yy = domain.quantities['ymomentum'].centroid_values 83 dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values 84 dd = (dd)*(dd>1.0e-03)+1.0e-06 85 vv = ( (xx/dd)**2 + (yy/dd)**2 )**0.5 86 vv = vv*(dd>1.0e-03) 87 print 'Peak velocity is: ', vv.max(), vv.argmax() 77 88 78 89 print 'Finished'
Note: See TracChangeset
for help on using the changeset viewer.