Ignore:
Timestamp:
Feb 10, 2012, 10:34:08 AM (12 years ago)
Author:
pittj
Message:

update for the new experiments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/mem_time_tests/parameters/timelen/ex1.py

    r8328 r8331  
    1111#set up variables to store the results and the log files of each experiment
    1212f = sys.argv[1]
     13g = float(f)/100.0
    1314home = os.getenv('INUNDATIONHOME')
    1415scenariodirV = add_directories(home, ["data","mem_time_test", "parameters",
     
    1718log._setup = False
    1819
    19 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage here
     20log.timingInfo(msg=('variable1,'+str(f))) #write the variable to be measured to file
     21
     22log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     23
     24log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage here
    2025
    2126#------------------------------------------------------------------------------
     
    2732domain.set_datadir(scenariodirV) 
    2833
    29 log.resource_usage_timing(prefix = 'AfterMesh') #get memory usage here
     34log.resource_usage_timing(prefix = 'aftermesh') #get memory usage here
    3035#------------------------------------------------------------------------------
    3136# Setup initial conditions
    3237#------------------------------------------------------------------------------
    3338def topography(x, y):
    34     return -x/10 # linear bed slope
     39    return 0 # linear bed slope
    3540domain.set_quantity('elevation', topography) # Use function for elevation
    3641domain.set_quantity('friction', 0.01) # Constant friction
    37 domain.set_quantity('stage',expression='elevation')
     42domain.set_quantity('stage', 10)
    3843
    3944log.resource_usage_timing(prefix='afterinitialconditions')#get memory usage here
     
    4247# Setup boundary conditions
    4348#------------------------------------------------------------------------------
    44 Bi = anuga.Dirichlet_boundary([0.4, 0, 0]) # Inflow
    4549Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    46 domain.set_boundary({'left': Bi, 'right': Br, 'top': Br, 'bottom': Br})
     50domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    4751
    4852log.resource_usage_timing(prefix='afterboundary')#get memory usage here
     
    5155# Evolve system through time
    5256#------------------------------------------------------------------------------
    53 for t in domain.evolve(yieldstep=0.2, finaltime=f):
     57for t in domain.evolve(yieldstep=g, finaltime=f):
    5458    print domain.timestepping_statistics()
    5559
    5660
    5761log.resource_usage_timing(prefix='aftersimulation') #get memory usage here
    58 
     62log.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.