Changeset 4311


Ignore:
Timestamp:
Mar 22, 2007, 8:49:47 AM (17 years ago)
Author:
nick
Message:

updates to dampier

Location:
anuga_work/production/dampier_2006
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/dampier_2006/get_timeseries.py

    r4308 r4311  
    2626                   #'20070307_224017_run': 'URS boundary normal'
    2727                   }
     28>>>>>>> .r4304
    2829
    2930   
     
    5960    texname, elev_output = sww2timeseries(swwfiles,
    6061                                          project.gauges_dir_name_simple,
     62>>>>>>> .r4304
    6163                                          production_dirs,
    6264                                          report = False,
  • anuga_work/production/dampier_2006/get_timeseries_and.py

    r4308 r4311  
    3535bo = 'boundaries'
    3636
    37 run_time = '20070312_030201_run'
     37run_time = '20070321_164505_run'
    3838production_dirs = {#run_time: 'URS evolved data'#,
    3939                   'boundaries': 'URS boundary condition'
     
    9797        print 'boundaries'
    9898#        file_loc = project.boundaries_in_dir
    99 #        swwfile = project.boundaries_dir_name3 + '.sww'
    100         swwfile = project.boundaries_dir_name6+'.sww'
     99        swwfile = project.boundaries_dir_name3 + '.sww'
     100#        swwfile = project.boundaries_dir_name6+'.sww'
    101101    else:
    102102#        file_loc = project.output_dir + label_id + sep
     
    124124
    125125
    126 e_time, e_stage, e_momentum, e_speed, e_elevation = get_data_from_file(evolved_dir_filename)
     126e_header, e_data = get_data_from_file(evolved_dir_filename)
     127
     128e_time = e_data[:,0]
     129e_stage = e_data[:,1]
     130e_momentum = e_data[:,2]
     131e_speed = e_data[:,3]
     132e_elevation = e_data[:,4]
    127133
    128134print'boundary_dir_filename',boundary_dir_filename
    129 b_time, b_stage, b_momentum, b_speed, b_elevation = get_data_from_file(boundary_dir_filename)
     135b_header, b_data = get_data_from_file(boundary_dir_filename)
     136
     137b_time = b_data[:,0]
     138b_stage = b_data[:,1]
     139b_momentum = b_data[:,2]
     140b_speed = b_data[:,3]
     141b_elevation = b_data[:,4]
     142
    130143
    131144# compares the 2 models
     
    139152        b_sample.append(float(b_stage[i]))
    140153        e_sample.append(float(e_stage[k]))
     154        print 'out:', b_time[i], b_stage[i],i, j, b_sample[j],e_stage[j]
    141155        if k <len(e_time): print 'time e equal b:', b_time[i], b_stage[i],i, j, b_sample[j],e_stage[j], e_stage[k],(len(e_time)-1)
    142156        j = j +1
     
    144158
    145159
    146 e_stage.pop()
    147 e_stage.pop()
     160print len(b_sample), len(e_stage)
     161e_stage = e_stage.tolist().pop()
     162e_stage = e_stage.tolist().pop()
    148163 
    149164print len(b_sample), len(e_stage)
     
    157172
    158173                             
     174                             
    159175                                         
  • anuga_work/production/dampier_2006/project.py

    r4308 r4311  
    113113#gauges
    114114gauge_name = 'dampier_gauges_up2.csv' #'dampier.csv'
     115gauge_name_simple = 'dampier_gauges_simple.csv'
    115116gauge_name_test = 'dampier_gauges_up_test.csv' #'dampier.csv'
    116 gauge_name_simple = 'dampier_gauges_simple.csv'
    117117gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
    118118gauges_dir_name = gauges_dir + gauge_name
     119gauges_dir_name_simple = gauges_dir + gauge_name_simple
    119120gauges_dir_name_test = gauges_dir + gauge_name_test
    120 gauges_dir_name_simple = gauges_dir + gauge_name_simple
    121121
    122122
  • anuga_work/production/dampier_2006/run_dampier_simple.py

    r4307 r4311  
    3636from anuga.caching import myhash
    3737# Application specific imports
    38 #import project                 # Definition of file names and polygons
     38import project                 # Definition of file names and polygons
    3939
    4040#------------------------------------------------------------------------------
     
    4343#------------------------------------------------------------------------------
    4444
    45 #start_screen_catcher(project.output_run_time_dir, myid, numprocs)
     45start_screen_catcher(project.output_run_time_dir, myid, numprocs)
    4646print "Processor Name:",get_processor_name()
    4747
     
    5252#boundaries_dir_name = project.boundaries_dir_name
    5353
    54 #tide = project.tide
     54tide = project.tide
    5555
    5656# creates copy of code in output dir
    57 '''
    5857if myid == 0:
    5958    copy_code_files(project.output_run_time_dir,__file__,
    6059                 dirname(project.__file__)+sep+ project.__name__+'.py' )
    6160barrier()
    62 '''
    63 #print 'USER: ', project.user
    64 #print 'min triangles', project.trigs_min,
     61
     62print 'USER: ', project.user
     63print 'min triangles', project.trigs_min,
    6564print 'Note: This is generally about 20% less than the final amount'
    6665
     
    117116                             verbose=True)
    118117'''                           
    119 all = [[469000,7760000],[470000,7758000],[468000,7758000]]
    120 #all = [[470000,7760000],[469000,7758000],[468000,7760000]]
     118#all = [[469000,7760000],[470000,7758000],[468000,7758000]]
     119all = [[470000,7760000],[469000,7758000],[468000,7760000]]
    121120create_mesh_from_regions(all,
    122 #                             boundary_tags={'ocean': [0,1,2]},
    123                              boundary_tags={'ocean': [ 2],'side': [0, 1]},
    124 #                             boundary_tags={'ocean': [ 2],'ref_side': [0, 1]},
    125                              maximum_triangle_area=100000,
    126                              filename=meshes_dir_name,
    127                              use_cache=True,
    128                              verbose=True)
    129 import sys
    130 sys.exit()
     121                             boundary_tags={'ocean': [0,1,2]},
     122#                             boundary_tags={'ocean': [ 2],'side': [0, 1]},
     123                             maximum_triangle_area=50000,
     124                             filename=meshes_dir_name,
     125                             use_cache=False,
     126                             verbose=True)
     127
    131128#-------------------------------------------------------------------------
    132129# Setup computational domain
     
    134131print 'Setup computational domain'
    135132domain = Domain( meshes_dir_name, verbose=True)
    136 
    137133'''
    138134from caching import cache
     
    199195print 'Start Set quantity'
    200196
    201 domain.set_quantity('elevation',
     197#domain.set_quantity('elevation',
    202198#                    filename = project.combined_dir_name + '.pts',
    203199# MUST USE TXT FILES FOR CACHING TO WORK!
    204                     filename = project.combined_smallest_dir_name + '.txt',
    205                     use_cache = True,
    206                     verbose = True,
    207                     alpha = 0.1)
     200#                    filename = project.combined_smallest_dir_name + '.txt',
     201#                    use_cache = True,
     202#                    verbose = True,
     203#                    alpha = 0.1)
     204domain.set_quantity('elevation', -42.3)
     205
    208206print 'Finished Set quantity'
    209207
     
    252250Bd = Dirichlet_boundary([tide,0,0])
    253251
    254 Bo = Dirichlet_boundary([tide+4.0,0,0])
    255 
    256252print'set_boundary'
    257253##domain.set_boundary({'back': Br,
     
    259255##                     'ocean': Bf})
    260256domain.set_boundary({#'back': Br,
    261                      'side': Br,
    262                      'ref_side': Br,
    263                     'ocean': Bd
     257                     'side': Bd,
     258                    'ocean': Bf
    264259                    })
    265260print'finish set boundary'
     
    271266t0 = time.time()
    272267
    273 for t in domain.evolve(yieldstep = 10, finaltime = 3400):
     268for t in domain.evolve(yieldstep = 60, finaltime = 3400):
    274269    domain.write_time()
    275270    domain.write_boundary_statistics(tags = 'ocean')
    276 
    277     if allclose(t, 120):
    278         domain.set_boundary({'side': Br, 'ocean': Bo})
    279 
    280     if allclose(t, 1020):
    281         domain.set_boundary({'side': Br, 'ocean': Bd})
    282271
    283272#for t in domain.evolve(yieldstep = 120, finaltime = 9000):
     
    305294
    306295
    307 
    308 
    309 
    310 
    311 
    312 
    313 
    314 
    315 
Note: See TracChangeset for help on using the changeset viewer.