Ignore:
Timestamp:
Mar 13, 2012, 3:46:12 PM (13 years ago)
Author:
davies
Message:

balanced_dev: important change to 'protect'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r8358 r8359  
    1818#Setup computational domain
    1919#---------
    20 points, vertices, boundary = anuga.rectangular_cross(40,40)
     20points, vertices, boundary = anuga.rectangular_cross(40,40, len1=1., len2=1.)
    2121
    2222domain=Domain(points,vertices,boundary)    # Create Domain
     
    2525domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1})
    2626#domain.set_store_vertices_uniquely(True)
     27domain.minimum_allowed_height=0.001
    2728
    2829#------------------
     
    3031#------------------
    3132scale_me=1.0
     33
     34#domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave
     35
    3236def topography(x,y):
    3337        return (-x/2.0 +0.05*numpy.sin((x+y)*50.0))*scale_me
     
    6771# Associate boundary tags with boundary objects
    6872#----------------------------------------------
    69 domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom':Br})
     73domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br})
    7074
    7175#------------------------------
     
    7579for t in domain.evolve(yieldstep=0.1,finaltime=20.0):
    7680    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()
    7788
    7889print 'Finished'
Note: See TracChangeset for help on using the changeset viewer.