Changeset 5607 for anuga_work/production/perth/run_perth.py
- Timestamp:
- Aug 5, 2008, 1:17:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/perth/run_perth.py
r5578 r5607 41 41 from anuga.fit_interpolate.benchmark_least_squares import mem_usage 42 42 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 43 from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter 43 44 44 45 # Application specific imports … … 113 114 verbose=True) 114 115 # barrier() 115 116 117 covariance_value,alpha = find_optimal_smoothing_parameter (data_file= kwargs['elevation_file'], 118 alpha_list=[0.001, 0.01, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5], 119 mesh_file = project.meshes_dir_name+'.msh') 120 print 'optimal alpha', covariance_value,alpha 121 116 122 117 123 #------------------------------------------------------------------------- … … 154 160 #barrier() 155 161 162 ## #------------------------------------------------------ 163 ## # Create x,y,z file of mesh vertex!!! 164 ## #------------------------------------------------------ 165 ## coord = domain.get_vertex_coordinates() 166 ## depth = domain.get_quantity('elevation') 167 ## 168 ## # Write vertex coordinates to file 169 ## filename=project.vertex_filename 170 ## fid=open(filename,'w') 171 ## fid.write('x (m), y (m), z(m)\n') 172 ## for i in range(len(coord)): 173 ## pt=coord[i] 174 ## x=pt[0] 175 ## y=pt[1] 176 ## z=depth[i] 177 ## fid.write('%.6f,%.6f,%.6f\n' %(x, y, z)) 178 ## 156 179 157 180 #------------------------------------------------------ … … 186 209 187 210 print 'Available boundary tags', domain.get_boundary_tags() 188 Bf = File_boundary(boundary_urs_out+'.sts', 189 domain, time_thinning=1, 211 Bf = Field_boundary(boundary_urs_out+'.sts', # Change from file_boundary 212 domain, mean_stage= project.tide, 213 time_thinning=1, 190 214 use_cache=True, 191 verbose = True ,192 boundary_polygon=bounding_polygon)215 verbose = True) 216 # boundary_polygon=bounding_polygon) 193 217 194 218 Br = Reflective_boundary(domain) 195 219 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 196 220 221 print dir(Bf) 197 222 print 'start reading boundary file' 223 198 224 199 225 ## Bf = Field_boundary(kwargs['boundary_file'], … … 214 240 t0 = time.time() 215 241 242 using_sts_boundary = True 243 216 244 for t in domain.evolve(yieldstep = project.yieldstep, finaltime = kwargs['finaltime'] 217 245 ,skip_initial_step = False): 218 246 domain.write_time() 219 domain.write_boundary_statistics(tags = 'ocean') 247 domain.write_boundary_statistics(tags = 'ocean') 248 if using_sts_boundary is True: 249 if Bf.values >= 99: 250 domain.set_boundary({'ocean': Bd}) 251 using_sts_boundary = False 220 252 221 253 x, y = domain.get_maximum_inundation_location()
Note: See TracChangeset
for help on using the changeset viewer.