- Timestamp:
- Feb 10, 2012, 10:34:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/mem_time_tests/scenarios/channelflow/ex1.py
r8328 r8331 19 19 log._setup = False 20 20 21 log.resource_usage_timing(prefix = 'BeforeSimulation')#get memory usage 21 log.timingInfo(msg=('variable1,'+str(length))) #write the variable to be measured to file 22 log.timingInfo(msg=('variable2,'+str(lower))) #write the variable to be measured to file 23 log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation 24 25 log.resource_usage_timing(prefix = 'beforesimulation')#get memory usage 22 26 #------------------------------------------------------------------------------ 23 27 # Setup computational domain 24 28 #------------------------------------------------------------------------------ 25 points, vertices, boundary = anuga.rectangular_cross( 50,150,len1=length, len2=length) # Mesh29 points, vertices, boundary = anuga.rectangular_cross(100,300,len1=length, len2=length) # Mesh 26 30 domain = anuga.Domain(points, vertices, boundary) # Create domain 27 31 domain.set_datadir(scenariodirV) 28 32 domain.set_name('channel1.sww') # Output name 29 33 30 log.resource_usage_timing(prefix = ' AfterMesh') #get memory usage34 log.resource_usage_timing(prefix = 'aftermesh') #get memory usage 31 35 #-------------------------------------------------------------------------- 32 36 # Setup Initial Conditions 33 37 #-------------------------------------------------------------------------- 34 38 def topography(x, y): 35 z = -x/1039 z = 0 36 40 N = len(x) 37 41 … … 52 56 # Setup boundary conditions 53 57 #------------------------------------------------------------------------------ 54 Bi = anuga.Dirichlet_boundary([0.5, 1 , 0]) # Inflow55 Bo = anuga.Dirichlet_boundary([- 100,0,0])58 Bi = anuga.Dirichlet_boundary([0.5, 10, 0]) # Inflow 59 Bo = anuga.Dirichlet_boundary([-0.5,0,0]) #outflow 56 60 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 57 61 domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br}) … … 61 65 # Evolve system through time 62 66 #------------------------------------------------------------------------------ 63 for t in domain.evolve(yieldstep= 0.2, finaltime=40.0):67 for t in domain.evolve(yieldstep=120, finaltime=3600): 64 68 domain.write_time() 65 69 66 70 log.resource_usage_timing(prefix='aftersimulation') #get memory usage 71 log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
Note: See TracChangeset
for help on using the changeset viewer.