Changeset 3421
- Timestamp:
- Jul 25, 2006, 4:17:37 PM (18 years ago)
- Location:
- development/dam_2006
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
development/dam_2006/create_mesh.py
r3420 r3421 9 9 from coordinate_transforms.geo_reference import Geo_reference 10 10 11 import project 12 def generate( gate_position, is_course = False):11 12 def generate(mesh_filename, gate_position, is_course = False): 13 13 #Basic geometry 14 14 15 x left= - gate_position15 xedge = - gate_position 16 16 xright = 3.0 - gate_position 17 17 ybottom = 0 18 18 ytop = 0.4 19 xdam = 0.0 19 xdam = 0.0 20 xleft = -5.0 20 21 21 22 #Outline … … 29 30 point_dam_bottom = [xdam, ybottom] 30 31 32 # Catchment seperation 33 point_edge_top = [xedge, ytop] 34 point_edge_bottom = [xedge, ybottom] 35 31 36 32 37 m = Mesh() … … 38 43 point_ne, 39 44 point_dam_top, 45 point_edge_top, 40 46 point_nw, 41 47 point_sw, 48 point_edge_bottom, 42 49 point_dam_bottom] 43 50 44 51 dict['segments'] = [[0,1], [1,2], [2,3], [3,4], 45 [4,5], [5,0], #The outer border 46 [2,5]] #Separator 52 [4,5], [5,6], [6,7 ],[7,0], #The outer border 53 [2,7], #dam Separator 54 [3,6]] #edge Separator 47 55 48 56 dict['segment_tags'] = ['wall', … … 52 60 'wall', 53 61 'wall', 62 'wall', 63 'wall', 64 '', 54 65 ''] #Interior 55 66 … … 59 70 dam = m.add_region(0.0000001,(ytop - ybottom)/2) 60 71 # this is the location of the region. 72 dam.setTag("dam") 61 73 62 dam.setTag("dam") 74 75 dam = m.add_region(- gate_position - 0.0000001,(ytop - ybottom)/2) 76 # this is the location of the region. 77 dam.setTag("catchment") 78 79 63 80 if is_course: 64 81 m.generate_mesh(maximum_triangle_area=0.01) … … 66 83 m.generate_mesh(maximum_triangle_area=0.0001) 67 84 68 m.export_mesh_file( project.mesh_filename)85 m.export_mesh_file(mesh_filename) 69 86 print "mesh created" 70 87 71 88 #------------------------------------------------------------- 72 89 if __name__ == "__main__": 73 pass90 generate("aa.tsh", 0.75, is_course = True) -
development/dam_2006/project.py
r3321 r3421 38 38 #community_scenario = gaugedir + 'community_onslow.csv' 39 39 #gaugetimeseries = gaugedir + 'onslow' 40 depth_filename = 40 41 41 42 -
development/dam_2006/run_dam.py
r3420 r3421 51 51 #------------------------------------------------------------------------- 52 52 53 create_mesh.generate(0.75, is_course=False) # this creates the mesh 53 create_mesh.generate(project.mesh_filename, 54 0.75, 55 is_course=True) # this creates the mesh 56 #is_course=False) # this creates the mesh 54 57 55 58 head,tail = path.split(project.mesh_filename) … … 87 90 88 91 domain.set_region(Set_region('dam','stage',0.2, 92 location = 'unique vertices')) 93 domain.set_region(Set_region('catchment','elevation',-1, 94 location = 'unique vertices')) 95 domain.set_region(Set_region('catchment','stage',-1, 89 96 location = 'unique vertices')) 90 97 … … 105 112 print 'finished' 106 113 114 points = [[-0.1,0.2], 115 [-0.2,0.2], 116 [-0.3,0.2], 117 [-0.4,0.2], 118 [-0.5,0.2], 119 ] 120 121 #------------------------------------------------------------------------- 122 # Calc gauge info 123 #------------------------------------------------------------------------- 124 #interpolate_sww2csv(project.basename +".sww", 125 # points, 126 # "depth.csv", 127 # "velocity.csv") 128 107 129 #------------------------------------------------------------- 108 130 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.