Ignore:
Timestamp:
Jun 1, 2007, 4:06:46 PM (17 years ago)
Author:
nick
Message:

update run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/test_dampier_2006/test.py

    r4288 r4525  
    33import os
    44
    5 import project
     5#import project
     6#from Numeric import allclose
    67from anuga.pmesh.mesh_interface import create_mesh_from_regions
    78from anuga.shallow_water import Domain
    89from anuga.shallow_water import File_boundary
     10from time import localtime, strftime, gmtime
    911
    1012home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
     
    1315state = 'western_australia'
    1416scenario_name = 'dampier'
    15 scenario = 'dampier_tsunami_scenario_2006'
     17scenario = 'test_dampier'
    1618an = 'anuga'
    1719bo = 'boundaries'
     20topo = 'topographies'
     21out = 'outputs'
    1822urs = 'urs'
    1923gridded = '1_10000'
    20 best_boundary_sww_file = 'o_test_8500_12000.sww'
     24#best_boundary_sww_file = 'o_test_8500_12000.sww'
     25best_boundary_sww_file = 'o_8500_12000_no_zone.sww'
     26
     27time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
     28gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
     29run_time = time+'_run'
     30print 'gtime: ', gtime
     31print 'time: ', time
     32
    2133
    2234mesh_filename = 'small.tsh' # this will be local
    23 best_boundary_sww = os.path.join(data,state,scenario_name,
    24                                  scenario,an,bo,best_boundary_sww_file)
     35best_boundary_sww = os.path.join(home,data,state,scenario,an,bo,best_boundary_sww_file)
     36#J:\inundation\data\western_australia\dampier_tsunami_scenario_2006\anuga\topographies
     37                                 
     38elevation_file = 'dampier_combined_elevation_smallest.txt'
     39smallest_elevation= os.path.join(home,data,state,scenario,an,topo,elevation_file)
     40
     41output= os.path.join(home,data,state,scenario,an,out,run_time)
    2542
    2643#pro_instance = project.Project([data,state,scenario_name],
    2744#                                       outputdir_name=outputdir_name)
    2845
    29 poly_all = [[250000,7660000],[280000,7660000],
    30                              [280000,7630000]]
     46#poly_all = [[250000,7660000],[280000,7660000], [280000,7630000]]
     47poly_all = [[469000,7760000],[470000,7758000],[468000,7758000]]
     48
     49print 'create mesh'
    3150create_mesh_from_regions(poly_all,
    3251                             boundary_tags={'back': [0,1,2]},
     
    3857print domain.statistics()
    3958
    40 domain.set_quantity('stage', 0.0)
     59domain.set_quantity('stage', 2.4)
    4160domain.set_quantity('friction', 0.01)
     61domain.set_name(scenario_name)
     62domain.set_datadir(output)
     63
     64print 'set elevation',smallest_elevation
     65
    4266domain.set_quantity('elevation',
    43 #                    filename = project.combined_dir_name + '.pts',
    44 # MUST USE TXT FILES FOR CACHING TO WORK!
    45                     filename = project.combined_smaller_dir_name + '.txt',
     67                    filename = smallest_elevation,
    4668                    use_cache = True,
    4769                    verbose = True,
    4870                    alpha = 0.1)
    49    
     71                   
     72
     73print 'best_boundary_sww',best_boundary_sww
     74
     75print 'get file boundary'
    5076Bf = File_boundary(best_boundary_sww,
    51                   domain,  use_cache=False, verbose=True)
     77                  domain,  time_thinning=24, use_cache=False, verbose=True)
     78                 
     79domain.set_boundary({'back': Bf})
     80                     
     81                     
     82#t0 = time.time()
     83
     84print 'evolve'
     85for t in domain.evolve(yieldstep = 120, finaltime = 3400):
     86    domain.write_time()
     87    domain.write_boundary_statistics(tags = 'back')
     88
     89
     90
     91
Note: See TracChangeset for help on using the changeset viewer.