Changeset 9096
- Timestamp:
- Apr 26, 2014, 2:19:41 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/operators/run_set_elevation.py
r8928 r9096 15 15 from anuga import Time_boundary 16 16 17 #------------------------------------------------------------------------------18 # Setup computational domain19 #------------------------------------------------------------------------------20 length = 24.21 width = 5.22 dx = dy = 0.2 #.1 # Resolution: Length of subdivisions on both axes23 24 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),25 len1=length, len2=width)26 domain = Domain(points, vertices, boundary)27 domain.set_name('set_elevation') # Output name28 print domain.statistics()29 domain.set_quantities_to_be_stored({'elevation': 2,30 'stage': 2})31 17 32 18 #------------------------------------------------------------------------------ 33 # S etup initial conditions19 # Stage and Elevation Functions 34 20 #------------------------------------------------------------------------------ 35 21 def topography(x,y): … … 81 67 82 68 83 def pole(t): 69 def pole(x,y,t): 70 71 z = topography(x,y) 72 if t<10: 73 return z 74 elif t>12: 75 return z 76 else: 77 return z+1.0 84 78 85 if t<10:86 return 0.087 elif t>12:88 return 0.089 else:90 return 1.091 79 80 81 #------------------------------------------------------------------------------ 82 # Setup computational domain 83 #------------------------------------------------------------------------------ 84 length = 24. 85 width = 5. 86 dx = dy = 0.2 #.1 # Resolution: Length of subdivisions on both axes 87 88 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), 89 len1=length, len2=width) 90 domain = Domain(points, vertices, boundary) 91 domain.set_name() # Output name based on script name 92 print domain.statistics() 93 domain.set_quantities_to_be_stored({'elevation': 2, 94 'stage': 2}) 95 96 #------------------------------------------------------------------------------ 97 # Setup initial conditions 98 #------------------------------------------------------------------------------ 92 99 93 100 domain.set_quantity('elevation', topography) # elevation is a function … … 108 115 #------------------------------------------------------------------------------ 109 116 110 from anuga .operators.set_elevation_operatorsimport Set_elevation_operator117 from anuga import Set_elevation_operator 111 118 op1 = Set_elevation_operator(domain, elevation=pole, radius=0.5, center = (12.0,3.0)) 112 119 113 from anuga .operators.set_elevationimport Set_elevation120 from anuga import Set_elevation 114 121 op2 = Set_elevation(domain, elevation = topography) 115 122
Note: See TracChangeset
for help on using the changeset viewer.