Changeset 326
- Timestamp:
- Sep 20, 2004, 6:13:57 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/bed_w_eden_boundary.py
r324 r326 14 14 15 15 #Create basic mesh (1km x 1km) 16 points, vertices, boundary = rectangular( 10, 10, 100, 100)16 points, vertices, boundary = rectangular(50, 50, 100, 100) 17 17 18 18 #Create shallow water domain 19 19 domain = Domain(points, vertices, boundary) 20 20 domain.smooth = False 21 domain.visualise = True21 domain.visualise = False 22 22 domain.default_order=2 23 23 domain.store = True #Store for visualisation purposes … … 28 28 ####################### 29 29 #Bed-slope and friction 30 #domain.set_quantity('elevation', lambda x,y: -20*ones(x.shape))30 domain.set_quantity('elevation', lambda x,y: 0.*ones(x.shape)) 31 31 32 domain.set_quantity('elevation', lambda x,y: -(x+y)/3)32 #domain.set_quantity('elevation', lambda x,y: -(x+y)/3) 33 33 domain.set_quantity('friction', 0.1) 34 34 … … 46 46 47 47 Br = Reflective_boundary(domain) 48 Bd = Dirichlet_boundary([ 0. ,0.,0.])48 Bd = Dirichlet_boundary([1. ,0.,0.]) 49 49 Bw = Time_boundary(domain=domain, 50 f=lambda t: [(1*sin(t*pi )), 0.0, 0.0])50 f=lambda t: [(1*sin(t*pi/20)), 0.0, 0.0]) 51 51 52 52 Bf = File_boundary(domain, filename) 53 53 54 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})55 #domain.set_boundary({'left': Bf, 'right': Br, 'top': Br, 'bottom': Br})54 #domain.set_boundary({'left': Bw, 'right': Br, 'top': Br, 'bottom': Br}) 55 domain.set_boundary({'left': Bf, 'right': Br, 'top': Br, 'bottom': Br}) 56 56 57 57 … … 65 65 ###################### 66 66 #Evolution 67 for t in domain.evolve(yieldstep = 6 , finaltime = 385*15*60):67 for t in domain.evolve(yieldstep = 60, finaltime = 385*15*60): 68 68 domain.write_time() 69 69 -
inundation/ga/storm_surge/pyvolution/generic_boundary_conditions.py
r324 r326 222 222 if t > self.T[-1]: raise msg 223 223 224 oldindex = self.index 225 224 226 #Find slot 225 227 while t > self.T[self.index]: self.index += 1 226 228 while t < self.T[self.index]: self.index -= 1 227 229 228 230 if oldindex != self.index: 231 print 'Changing from %d to %d' %(oldindex, self.index) 232 233 229 234 #t is now between index and index+1 230 235 ratio = (t - self.T[self.index])/(self.T[self.index+1] - self.T[self.index])
Note: See TracChangeset
for help on using the changeset viewer.