Changeset 5173


Ignore:
Timestamp:
Mar 18, 2008, 5:05:34 PM (17 years ago)
Author:
ole
Message:

Beautified demos

Location:
anuga_core/documentation/user_manual/demos
Files:
2 edited

Legend:

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

    r3982 r5173  
    1616# Setup computational domain
    1717#------------------------------------------------------------------------------
    18 length = 10.
    19 width = 5.
    20 dx = dy = 1           # Resolution: Length of subdivisions on both axes
     18points, vertices, boundary = rectangular_cross(10, 5,
     19                                               len1=10.0, len2=5.0) # Mesh
    2120
    22 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
    23                                                len1=length, len2=width)
    24 
    25 domain = Domain(points, vertices, boundary)   # Create domain
     21domain = Domain(points, vertices, boundary)  # Create domain
    2622domain.set_name('channel1')                  # Output name
    2723
     
    3531domain.set_quantity('elevation', topography) # Use function for elevation
    3632domain.set_quantity('friction', 0.01)        # Constant friction
    37 domain.set_quantity('stage',
    38                     expression='elevation')        # Dry
    39 #domain.set_quantity('stage',
    40 #                     expression='elevation + 0.1') # Wet
     33domain.set_quantity('stage',                 # Dry bed
     34                    expression='elevation + 0.0') 
    4135
    4236
     
    5448#------------------------------------------------------------------------------
    5549for t in domain.evolve(yieldstep = 0.2, finaltime = 40.0):
    56     domain.write_time()
     50    print domain.timestepping_statistics()
    5751
    5852
  • anuga_core/documentation/user_manual/demos/channel3.py

    r4673 r5173  
    1919length = 40.
    2020width = 5.
    21 #dx = dy = 1           # Resolution: Length of subdivisions on both axes
    22 dx = dy = .1           # Resolution: Length of subdivisions on both axes
     21dx = dy = .05           # Resolution: Length of subdivisions on both axes
    2322
    2423points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
     
    2625domain = Domain(points, vertices, boundary)   
    2726domain.set_name('channel3')                  # Output name
     27print domain.statistics()
    2828
    2929
     
    4040    for i in range(N):
    4141
    42         #Step
     42        # Step
    4343        if 10 < x[i] < 12:
    4444            z[i] += 0.4 - 0.05*y[i]       
    4545       
    46         #Constriction
     46        # Constriction
    4747        if 27 < x[i] < 29 and y[i] > 3:
    4848            z[i] += 2       
     
    7575#------------------------------------------------------------------------------
    7676for t in domain.evolve(yieldstep = 0.2, finaltime = 16.0):
    77     domain.write_time()
     77    print domain.timestepping_statistics()
    7878
    7979
Note: See TracChangeset for help on using the changeset viewer.