Changeset 5112


Ignore:
Timestamp:
Mar 4, 2008, 3:58:41 PM (16 years ago)
Author:
ole
Message:

Moved work on Will Power's attenuation problem from
runup demo in the user_manual to the debug area so that demo
matches description in manual and also runs.

Used:

svn merge -r 4883:4882 runup.py

to revert modification.

Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/demos/runup.py

    r4883 r5112  
    1010#------------------------------------------------------------------------------
    1111
    12 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
     12from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular
    1313from anuga.shallow_water import Domain
    1414from anuga.shallow_water import Reflective_boundary
     
    2222#------------------------------------------------------------------------------
    2323
    24 points, vertices, boundary = rectangular_cross(10, 10,len1=1.0, len2= 1.0 ) # Basic mesh
     24points, vertices, boundary = rectangular(10, 10) # Basic mesh
    2525
    2626domain = Domain(points, vertices, boundary) # Create domain
     
    3737
    3838def topography(x,y):
    39     return -x/2                              # linear bed slope
     39    return -x/2                             # linear bed slope
    4040    #return x*(-(2.0-x)*.5)                  # curved bed slope
    4141
     
    5454Bd = Dirichlet_boundary([-0.2,0.,0.]) # Constant boundary values
    5555Bw = Time_boundary(domain=domain,     # Time dependent boundary 
    56                    f=lambda t: [(.1*sin(t*2*pi)-0.3) , 0.0, 0.0])
     56                   f=lambda t: [(.1*sin(t*2*pi)-0.3) * exp(-t), 0.0, 0.0])
    5757
    5858# Associate boundary tags with boundary objects
    5959domain.set_boundary({'left': Br, 'right': Bw, 'top': Br, 'bottom': Br})
    6060
    61 #===============================================================================
    62 from anuga.visualiser import RealtimeVisualiser
    63 vis = RealtimeVisualiser(domain)
    64 vis.render_quantity_height("elevation", zScale=1.0, dynamic=False)
    65 vis.render_quantity_height("stage", dynamic=True)
    66 vis.colour_height_quantity('stage', (lambda q:q['stage'], -0.5, 0.5))
    67 vis.start()
    68 #===============================================================================
    6961
    70 import time
    71 t0 = time.time()
    7262#------------------------------------------------------------------------------
    7363# Evolve system through time
     
    7666for t in domain.evolve(yieldstep = 0.1, finaltime = 10.0):
    7767    domain.write_time()
    78     vis.update()
     68   
    7969
    80 vis.evolveFinished()
    81 print 'That took %.2f seconds' %(time.time()-t0)
    8270
Note: See TracChangeset for help on using the changeset viewer.