Changeset 319
- Timestamp:
- Sep 17, 2004, 5:03:05 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/cornell_room.py
r317 r319 18 18 print 'Creating domain' 19 19 points, triangles, values = from_polyfile('cornell_room_medres') 20 20 21 21 22 #Create shallow water domain … … 62 63 # 63 64 print 'Initial condition' 65 66 #Define water height as a lump in one corner 67 def height(x, y): 68 from Numeric import zeros, Float 69 70 N = len(x) 71 assert N == len(y) 72 73 xmin = min(x); xmax = max(x) 74 ymin = min(y); ymax = max(y) 75 76 xrange = xmax - xmin 77 yrange = ymax - ymin 78 79 z = zeros(N, Float) 80 for i in range(N): 81 if x[i] <= xmin + 0.25*xrange and y[i] <= ymin + 0.25*yrange: 82 z[i] = 300 83 84 return z 85 86 domain.set_quantity('level', height) 87 64 88 E = domain.quantities['elevation'].vertex_values 65 print max(E) 66 L = E.copy() 67 N = len(L) 68 L[:N/4] += 100 69 domain.set_quantity('level', L) 89 L = domain.quantities['level'].vertex_values 90 domain.set_quantity('level', E+L) 70 91 71 92 #Evolve 72 for t in domain.evolve(yieldstep = 0.0 1, finaltime = 1.0):93 for t in domain.evolve(yieldstep = 0.05, finaltime = 5.0): 73 94 domain.write_time() 74 95
Note: See TracChangeset
for help on using the changeset viewer.