Changeset 2636
- Timestamp:
- Mar 30, 2006, 5:45:12 PM (17 years ago)
- Location:
- inundation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/examples/island.py
r2635 r2636 28 28 29 29 #Create basic mesh 30 N = 4031 points, vertices, boundary = rectangular(N, N, 100, 100)32 33 34 30 create_mesh_from_regions( [[0,0], [100,0], [100,100], [0,100]], 35 31 boundary_tags = {'bottom': [0], … … 37 33 'top': [2], 38 34 'left': [3]}, 39 maximum_triangle_area = 2 5,35 maximum_triangle_area = 20, 40 36 filename = 'island.msh' 41 , interior_regions=[ ([[50,25], [70,25], [70,75], [50,75]], 1)]37 , interior_regions=[ ([[50,25], [70,25], [70,75], [50,75]], 3)] 42 38 ) 43 39 44 40 45 41 46 47 48 42 #Create shallow water domain 49 #domain = Domain(points, vertices, boundary)50 43 domain = Domain(mesh_filename = 'island.msh') 51 44 domain.smooth = False … … 84 77 return z 85 78 86 domain.set_quantity('friction', 0.0) 79 #domain.set_quantity('friction', 0.1) #Honky dory 80 domain.set_quantity('friction', 2) #Creep 87 81 domain.set_quantity('elevation', island) 88 82 domain.set_quantity('stage', 1) … … 96 90 Bd = Dirichlet_boundary([1, 0, 0]) 97 91 98 #domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})99 92 domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd}) 100 93 domain.check_integrity() … … 106 99 107 100 import time 108 for t in domain.evolve(yieldstep = 1, finaltime = 500):101 for t in domain.evolve(yieldstep = 1, finaltime = 100): 109 102 domain.write_time() 110 if allclose(t, 100):111 Q = domain.get_quantity('stage')112 Q_s = Quantity(domain)113 Q_s.set_values(slump)114 domain.set_quantity('stage', Q + Q_s)103 #if allclose(t, 100): 104 # Q = domain.get_quantity('stage') 105 # Q_s = Quantity(domain) 106 # Q_s.set_values(slump) 107 # domain.set_quantity('stage', Q + Q_s) 115 108 #print ' Volume: ', domain.get_quantity('stage').get_integral() 116 109 -
inundation/pyvolution/shallow_water_ext.c
r2635 r2636 381 381 //New code: Adjust momentum to guarantee speeds are physical 382 382 // ensure h is non negative 383 384 383 //FIXME (Ole): This is only implemented in this C extension and 384 // has no Python equivalent 385 385 if (hc <= 0.0) { 386 386 wc[k] = zc[k];
Note: See TracChangeset
for help on using the changeset viewer.