Changeset 5173
- Timestamp:
- Mar 18, 2008, 5:05:34 PM (17 years ago)
- Location:
- anuga_core/documentation/user_manual/demos
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/demos/channel1.py
r3982 r5173 16 16 # Setup computational domain 17 17 #------------------------------------------------------------------------------ 18 length = 10. 19 width = 5. 20 dx = dy = 1 # Resolution: Length of subdivisions on both axes 18 points, vertices, boundary = rectangular_cross(10, 5, 19 len1=10.0, len2=5.0) # Mesh 21 20 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 21 domain = Domain(points, vertices, boundary) # Create domain 26 22 domain.set_name('channel1') # Output name 27 23 … … 35 31 domain.set_quantity('elevation', topography) # Use function for elevation 36 32 domain.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 33 domain.set_quantity('stage', # Dry bed 34 expression='elevation + 0.0') 41 35 42 36 … … 54 48 #------------------------------------------------------------------------------ 55 49 for t in domain.evolve(yieldstep = 0.2, finaltime = 40.0): 56 domain.write_time()50 print domain.timestepping_statistics() 57 51 58 52 -
anuga_core/documentation/user_manual/demos/channel3.py
r4673 r5173 19 19 length = 40. 20 20 width = 5. 21 #dx = dy = 1 # Resolution: Length of subdivisions on both axes 22 dx = dy = .1 # Resolution: Length of subdivisions on both axes 21 dx = dy = .05 # Resolution: Length of subdivisions on both axes 23 22 24 23 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), … … 26 25 domain = Domain(points, vertices, boundary) 27 26 domain.set_name('channel3') # Output name 27 print domain.statistics() 28 28 29 29 … … 40 40 for i in range(N): 41 41 42 # Step42 # Step 43 43 if 10 < x[i] < 12: 44 44 z[i] += 0.4 - 0.05*y[i] 45 45 46 # Constriction46 # Constriction 47 47 if 27 < x[i] < 29 and y[i] > 3: 48 48 z[i] += 2 … … 75 75 #------------------------------------------------------------------------------ 76 76 for t in domain.evolve(yieldstep = 0.2, finaltime = 16.0): 77 domain.write_time()77 print domain.timestepping_statistics() 78 78 79 79
Note: See TracChangeset
for help on using the changeset viewer.