Changeset 2632 for inundation/examples/island.py
- Timestamp:
- Mar 29, 2006, 4:33:30 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/examples/island.py
r2621 r2632 7 7 8 8 9 #------------------------------------------------------------------------------ -9 #------------------------------------------------------------------------------ 10 10 # Import necessary modules 11 #------------------------------------------------------------------------------ -11 #------------------------------------------------------------------------------ 12 12 13 13 # Standard modules … … 21 21 22 22 23 #------------------------------------------------------------------------------ -23 #------------------------------------------------------------------------------ 24 24 # Setup computational domain 25 #------------------------------------------------------------------------------ -25 #------------------------------------------------------------------------------ 26 26 27 27 #Create basic mesh … … 37 37 maximum_triangle_area = 25, 38 38 filename = 'island.msh', 39 interior_regions=[ ([[5 5,25], [75,25],40 [7 5,75], [55,75]], 3)]39 interior_regions=[ ([[50,25], [70,25], 40 [70,75], [50,75]], 3)] 41 41 ) 42 42 … … 63 63 64 64 65 #------------------------------------------------------------------------------ -65 #------------------------------------------------------------------------------ 66 66 # Setup initial conditions 67 #------------------------------------------------------------------------------ -67 #------------------------------------------------------------------------------ 68 68 69 69 def island(x, y): … … 73 73 return z 74 74 75 domain.set_quantity('friction', 0.0)75 domain.set_quantity('friction', 2.0) 76 76 domain.set_quantity('elevation', island) 77 77 domain.set_quantity('stage', 1) 78 78 79 79 80 #------------------------------------------------------------------------------ -80 #------------------------------------------------------------------------------ 81 81 # Setup boundary conditions (all reflective) 82 #------------------------------------------------------------------------------ -82 #------------------------------------------------------------------------------ 83 83 84 84 Br = Reflective_boundary(domain) … … 88 88 89 89 90 #------------------------------------------------------------------------------ -90 #------------------------------------------------------------------------------ 91 91 # Evolve system through time 92 #------------------------------------------------------------------------------ -92 #------------------------------------------------------------------------------ 93 93 94 94 import time 95 for t in domain.evolve(yieldstep = 0.5, finaltime = 100):95 for t in domain.evolve(yieldstep = 1, finaltime = 100): 96 96 domain.write_time() 97 #for t in domain.evolve(yieldstep = 0.05, finaltime = 5): 98 # domain.write_time() 99 # #print ' Volume: ', domain.get_quantity('stage').get_integral() 97 100 98 101 print 'Done'
Note: See TracChangeset
for help on using the changeset viewer.