Changeset 4427
- Timestamp:
- May 15, 2007, 4:12:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/alpha_validation/find_alpha.py
r3970 r4427 1 1 2 from abstract_2d_finite_volumes import domain 2 from anuga.abstract_2d_finite_volumes import domain 3 from anuga.shallow_water import Domain 4 from anuga.geospatial_data.geospatial_data import Geospatial_data 5 from anuga.coordinate_transforms import Geo_reference 6 from anuga.pmesh.mesh_interface import create_mesh_from_regions 7 from anuga.shallow_water import Reflective_boundary 3 8 4 9 5 10 6 create_mesh_from_regions(project.bounding_polygon, 7 boundary_tags={'back': [7, 8], 'side': [0, 6], 8 'ocean': [1, 2, 3, 4, 5]}, 11 poly_topo = [[664000,7752000],[664000,7754000], 12 [666000,7754000],[666000,7752000]] 13 mesh_dir_name = 'temp.msh' 14 15 create_mesh_from_regions(poly_topo, 16 boundary_tags={'back': [2], 'side': [1,3], 17 'ocean': [0]}, 9 18 maximum_triangle_area=100000, 10 interior_regions=interior_regions, 11 # filename=meshes_time_dir_name, 12 filename=meshes_dir_name, 13 use_cache=True, 19 filename=mesh_dir_name, 20 use_cache=False, 14 21 verbose=True) 15 22 16 23 24 topo_dir_name = 'pt_hedland_export.txt' 25 sample = 'sample.txt' 26 remainder ='remainder.txt' 27 #split topo data 28 G = Geospatial_data(file_name = topo_dir_name) 29 print 'start split' 30 G_small, G_other = G.split(0.1,True) 17 31 18 alphas = [0.001, 0.01, 0.1, 1.0, 10.0, 100.0] 32 #print 'start export' 33 #G_small.export_points_file(sample) 34 #G_other.export_points_file(remainder) 35 36 37 #alphas = [0.001, 0.01, 0.1, 1.0, 10.0, 100.0] 38 alphas = [1] 19 39 domains = {} 40 20 41 print 'Setup computational domain' 21 42 for alpha in alphas: 22 43 23 domain = Domain(meshes_dir_name, use_cache=True, verbose=True) 44 #think about making domain absolute when it is created 45 geo_ref=Geo_reference(zone = 0, xllcorner = 0.0, yllcorner = 0.0) 46 47 # domain = Domain(mesh_dir_name,geo_reference=geo_ref, use_cache=False, verbose=True) 48 domain = Domain(mesh_dir_name, use_cache=False, verbose=True) 24 49 print domain.statistics() 25 50 domain.set_quantity('elevation', 26 filename = project.topographies_dir + build_time + sep + project.combined_final_name + '.pts',51 geospatial_data = G_other, 27 52 use_cache = True, 28 53 verbose = True, 29 54 alpha = alpha) 55 domains[alpha]=domain 56 domain.set_name('temp'+str(alpha)) 57 domain.set_datadir('.') 58 print'set_boundary' 59 # points=[[665000,7753000],[665100,7753000]] 60 points=G_small.get_data_points() 61 print'geo',domain.geo_reference,points[0:10] 62 #gets relative point from sample 63 points=domain.geo_reference.change_points_geo_ref(points) 64 65 point_elevation=G_small.get_attributes(attribute_name='elevation') 66 67 print'poin',points[0:10],point_elevation[0:10] 68 print'quantities',domain.get_quantity_names() 69 hmm=domain.quantities['elevation'].get_values(interpolation_points=points) 70 print'hmm',hmm[0:10],len(points),len(hmm) 71 72 # for i in si 73 74 # Br = Reflective_boundar[y(domain) 75 76 # domain.set_boundary({'back': Br, 77 # 'side': Br, 78 # 'ocean': Br}) 79 80 # for t in domain.evolve(yieldstep = 1, finaltime = 1): 81 # domain.write_time() 82 83 84 85 86 # from file load x,y,z data 87 # use file xy data to find predicted z data from domain 88 # determine error and repeat
Note: See TracChangeset
for help on using the changeset viewer.