Changeset 4282 for anuga_work
- Timestamp:
- Feb 27, 2007, 9:39:30 AM (18 years ago)
- Location:
- anuga_work/production/dampier_2006
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/build_dampier.py
r4246 r4282 33 33 from anuga.geospatial_data.geospatial_data import * 34 34 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files 35 from anuga_parallel.parallel_abstraction import get_processor_name 35 36 36 37 # Application specific imports … … 45 46 46 47 start_screen_catcher(project.output_build_time_dir) 48 print "Processor Name:",get_processor_name() 47 49 48 50 print 'USER: ', project.user … … 128 130 G_other.export_points_file(project.combined_dir_name + '_other' + '.pts') 129 131 130 print 'start reading:',project.combined_dir_name + '.pts' 131 G = Geospatial_data(file_name = project.combined_dir_name + '.pts') 132 print 'start export',project.combined_dir_name + '.txt' 133 G.export_points_file(project.combined_dir_name + '.txt') 132 print 'start reading:',project.combined_smaller_dir_name + '.txt' 133 G = Geospatial_data(file_name = project.combined_smaller_dir_name + '.txt') 134 print 'start split' 135 G_smallest, G_other = G.split(0.1,True) 136 137 print 'start export',project.combined_smallest_dir_name + '.txt' 138 #G.export_points_file(project.combined_smaller_dir_name + '.txt') 139 #G_smallest.export_points_file(project.combined_smallest_dir_name + '.txt') 134 140 ''' 135 141 #------------------------------------------------------------------------- … … 152 158 cache(urs2sww, 153 159 (boundaries_in_dir_name, 154 project.boundaries_dir_name 1),160 project.boundaries_dir_name+'2'), 155 161 {'verbose': True, 156 162 'minlat': project.south_boundary, … … 158 164 'minlon': project.west_boundary, 159 165 'maxlon': project.east_boundary, 160 'mint': 0, 'maxt': 40000,166 'mint': 8500, 'maxt': 12000, 161 167 # 'origin': domain.geo_reference.get_origin(), 162 168 'mean_stage': project.tide, -
anuga_work/production/dampier_2006/get_timeseries.py
r4247 r4282 24 24 # sww file created from URS boundary 25 25 production_dirs = {#'20070206_005106_run': '10000 yr wave height'} 26 ' boundaries': 'URS boundary condition'}26 '20070223_031527_run': 'URS boundary condition'} 27 27 28 28 is_parallel = False … … 42 42 if label_id == 'boundaries': 43 43 file_loc = project.boundaries_in_dir 44 swwfile = file_loc + sep + '200 61102_221245_build' + sep + 'dampier.sww'44 swwfile = file_loc + sep + '20070223_031527_run' + sep + 'dampier.sww' 45 45 print 'hi' 46 46 #else: … … 51 51 52 52 texname, elev_output = sww2timeseries(swwfiles, 53 project.gauges_dir_name ,53 project.gauges_dir_name_test, 54 54 production_dirs, 55 55 report = False, … … 71 71 if label_id == 'boundaries': 72 72 file_loc = project.boundaries_in_dir 73 swwfile = file_loc + sep + '200 61102_221245_build' + sep + 'dampier.sww'73 swwfile = file_loc + sep + '20070223_031527_run' + sep + 'dampier.sww' 74 74 else: 75 75 file_loc = project.output_dir + label_id + sep … … 78 78 79 79 texname, elev_output = sww2timeseries(swwfiles, 80 project.gauges_dir_name ,80 project.gauges_dir_name_test, 81 81 production_dirs, 82 82 report = False, -
anuga_work/production/dampier_2006/project.py
r4246 r4282 6 6 import sys 7 7 from time import localtime, strftime, gmtime 8 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon #number_mesh_triangles8 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles 9 9 from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_from_latlon_to_utm 10 10 from anuga.utilities.system_tools import get_user_name … … 25 25 build_time = time+'_build' 26 26 run_time = time+'_run' 27 temp_time = time+'_temp' 27 28 print 'gtime: ', gtime 28 29 … … 45 46 #final topo name 46 47 combined_name ='dampier_combined_elevation' 47 combined_smaller_name = 'dampier_combined_elevation_smaller' 48 combined_smaller_name = 'dampier_combined_elevation_small' 49 combined_smallest_name = 'dampier_combined_elevation_smallest' 48 50 49 51 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'070112'+sep+'points'+sep 50 52 topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep 51 53 topographies_time_dir = topographies_dir+build_time+sep 54 55 temp_dir = home+sep+state+sep+scenario+sep+'anuga'+sep 56 temp_dir_name = temp_dir + temp_time+sep 52 57 53 58 # input topo file location … … 67 72 combined_dir_name = topographies_dir + combined_name 68 73 combined_time_dir_name = topographies_time_dir + combined_name 69 combined_smaller_name_dir = topographies_dir + combined_smaller_name 74 combined_smaller_dir_name = topographies_dir + combined_smaller_name 75 combined_smallest_dir_name = topographies_dir + combined_smallest_name 70 76 #combined_time_dir_final_name = topographies_time_dir + combined_final_name 71 77 … … 78 84 boundaries_source = '' 79 85 boundaries_name = 'o' 80 boundaries_name1 = 'o_new' 86 boundaries_name1 = 'o_new1' 87 boundaries_name2 = 'o_test' 81 88 82 89 #boundaries locations 83 boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries' 84 #boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+'1_10000'+sep90 #boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep 91 boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+'1_10000'+sep 85 92 boundaries_in_dir_name = boundaries_in_dir + boundaries_name 86 93 boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep 87 94 boundaries_dir_name = boundaries_dir + boundaries_name 88 95 boundaries_dir_name1 = boundaries_dir + boundaries_name1 96 boundaries_dir_name2 = boundaries_dir + boundaries_name2 97 boundaries_dir_name3 = boundaries_dir + boundaries_name+'_test_8500_12000' 98 boundaries_dir_name4 = boundaries_dir + boundaries_name+'_8500_12000_no_zone' 99 89 100 #boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep 90 101 #boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing … … 98 109 #gauges 99 110 gauge_name = 'dampier_gauges_up2.csv' #'dampier.csv' 111 gauge_name_test = 'dampier_gauges_up_test.csv' #'dampier.csv' 100 112 gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep 101 113 gauges_dir_name = gauges_dir + gauge_name 114 gauges_dir_name_test = gauges_dir + gauge_name_test 115 102 116 103 117 #buildings_filename = gauges_dir + 'dampier_res_nexis.csv' … … 109 123 refzone = 50 110 124 south_boundary = degminsec2decimal_degrees(-20,58,0) 111 north_boundary = degminsec2decimal_degrees(-20,13,0) 125 #north_boundary = degminsec2decimal_degrees(-20,13,0) 126 north_boundary = degminsec2decimal_degrees(-19,30,0) 112 127 west_boundary = degminsec2decimal_degrees(116,15,0) 113 128 east_boundary = degminsec2decimal_degrees(117,11,0) … … 128 143 print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0 129 144 130 res_poly_all = 100000145 res_poly_all = 400000 131 146 #res_poly_all = 500000 132 147 … … 139 154 140 155 poly_dampier = read_polygon(polygons_dir+'dampier_town.csv') 141 res_dampier = 500 156 res_dampier = 1000 157 #res_dampier = 500 142 158 #res_dampier = 5000 143 159 … … 146 162 147 163 poly_karratha_town = read_polygon(polygons_dir+'karratha_townv2.csv') 148 res_karratha_town = 500 164 res_karratha_town = 1000 165 #res_karratha_town = 500 149 166 #res_karratha_town = 5000 150 167 … … 226 243 [poly_ref_nw5,res_ref_nw5],[poly_ref_nw6,res_ref_nw6], 227 244 [poly_ref_nw7,res_ref_nw7],[poly_ref_nw8,res_ref_nw8]] 228 229 #trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) 230 # 231 #print 'min number triangles', trigs_min 245 246 interior_regions_test = [[poly_dampier,res_dampier], 247 [poly_karratha,res_karratha],[poly_karratha_town,res_karratha_town]] 248 249 trigs_min = number_mesh_triangles(interior_regions_test, poly_all, res_poly_all) 250 251 print 'min number triangles', trigs_min 232 252 233 253 ################################################################### -
anuga_work/production/dampier_2006/run_dampier.py
r4246 r4282 34 34 from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier 35 35 from anuga_parallel.parallel_abstraction import get_processor_name 36 from anuga.caching import myhash 36 37 # Application specific imports 37 38 import project # Definition of file names and polygons … … 81 82 82 83 sys.exit() 83 ''' 84 84 85 if myid == 0: 85 86 86 87 print 'start create mesh from regions' 88 # print 'project.res_poly_all',project.res_poly_all 89 # print 'project.interior_regions_test',project.interior_regions_test 90 # print 'meshes_dir_name',meshes_dir_name 87 91 create_mesh_from_regions(project.poly_all, 88 92 boundary_tags={'back': [2,3], 'side': [0, 1, 4], 89 93 'ocean': [5]}, 90 94 maximum_triangle_area=project.res_poly_all, 91 interior_regions=project.interior_regions ,95 interior_regions=project.interior_regions_test, 92 96 filename=meshes_dir_name, 93 97 use_cache=True, … … 96 100 # to sync all processors are ready 97 101 barrier() 102 ''' 103 create_mesh_from_regions(project.poly_all, 104 boundary_tags={'back': [2,3], 'side': [0, 1, 4], 105 'ocean': [5]}, 106 maximum_triangle_area=project.res_poly_all, 107 interior_regions=project.interior_regions_test, 108 filename=meshes_dir_name, 109 use_cache=True, 110 verbose=True) 98 111 99 112 #------------------------------------------------------------------------- … … 101 114 #------------------------------------------------------------------------- 102 115 print 'Setup computational domain' 103 domain = Domain(meshes_dir_name, use_cache=True, verbose=True) 116 from caching import cache 117 domain = cache(Domain, (meshes_dir_name), {'use_cache':True, 'verbose':True}, verbose=True) 118 print 'domain id', id(domain) 119 print 'myhash', myhash(domain) 120 104 121 print domain.statistics() 122 105 123 boundaries_dir_name=project.boundaries_dir_name 106 124 … … 108 126 109 127 from anuga.shallow_water.data_manager import urs2sww 110 128 ''' 111 129 # put above distribute 112 130 print 'boundary file is: ',project.boundaries_dir_name … … 129 147 ) 130 148 barrier() 131 149 ''' 132 150 133 151 #------------------------------------------------------------------------- … … 148 166 # filename = project.combined_dir_name + '.pts', 149 167 # MUST USE TXT FILES FOR CACHING TO WORK! 150 filename = project.combined_ dir_name + '.txt',151 use_cache = False,168 filename = project.combined_smaller_dir_name + '.txt', 169 use_cache = True, 152 170 verbose = True, 153 171 alpha = 0.1) … … 166 184 # Set domain parameters 167 185 #------------------------------------------------------ 168 186 print 'domain id', id(domain) 169 187 domain.set_name(project.scenario_name) 170 188 domain.set_datadir(project.output_run_time_dir) … … 174 192 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 175 193 domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK) 194 print 'domain id', id(domain) 195 domain.beta_h = 0 196 domain.limit2007 = 1 176 197 177 198 #------------------------------------------------------------------------- … … 180 201 print 'Available boundary tags', domain.get_boundary_tags() 181 202 print 'domain id', id(domain) 182 print 'Reading Boundary file' 183 Bf = File_boundary(boundaries_dir_name + '.sww', 203 print 'Reading Boundary file',project.boundaries_dir_name4 + '.sww' 204 #Bf = File_boundary(boundaries_dir_name + '.sww', 205 Bf = File_boundary(project.boundaries_dir_name4 + '.sww', 184 206 domain, time_thinning=4, use_cache=True, verbose=True) 185 207 … … 204 226 t0 = time.time() 205 227 206 for t in domain.evolve(yieldstep = 120, finaltime = 9000):228 for t in domain.evolve(yieldstep = 60, finaltime = 9000): 207 229 domain.write_time() 208 230 domain.write_boundary_statistics(tags = 'ocean')
Note: See TracChangeset
for help on using the changeset viewer.