Changeset 1742 for inundation/validation/LWRU2/create_mesh.py
- Timestamp:
- Aug 23, 2005, 2:56:21 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/validation/LWRU2/create_mesh.py
r1734 r1742 14 14 15 15 #Basic geometry 16 16 17 17 xleft = 0 18 18 xright = 5.448 … … 20 20 ytop = 3.402 21 21 22 #Outline 22 #Outline 23 23 point_sw = [xleft, ybottom] 24 24 point_se = [xright, ybottom] 25 point_nw = [xleft, ytop] 25 point_nw = [xleft, ytop] 26 26 point_ne = [xright, ytop] 27 27 28 28 #Midway points (left) 29 point_ml1 = [xleft + (xright-xleft)/3+1, ytop] 30 point_ml2 = [xleft + (xright-xleft)/3+1, ybottom] 31 32 #Midway points (right) 33 point_mr1 = [xleft + 2*(xright-xleft)/3+0.5, ytop] 34 point_mr2 = [xleft + 2*(xright-xleft)/3+0.5, ybottom] 29 point_mtop = [xleft + (xright-xleft)/3+1, ytop] 30 point_mbottom = [xleft + (xright-xleft)/3+1, ybottom] 35 31 36 32 37 33 geo = Geo_reference(xllcorner = xleft, 38 34 yllcorner = ybottom) 39 40 35 36 41 37 print "***********************" 42 38 print "geo ref", geo 43 39 print "***********************" 44 40 45 41 m = Mesh(geo_reference=geo) 46 42 … … 49 45 dict['points'] = [point_se, #se 50 46 point_ne, 51 point_mr1, 52 point_ml1, 47 point_mtop, 53 48 point_nw, 54 49 point_sw, 55 point_ml2, 56 point_mr2] 50 point_mbottom] 57 51 58 52 59 53 dict['segments'] = [[0,1], [1,2], [2,3], [3,4], 60 [4,5], [5, 6], [6,7], [7,0],#The outer border61 [2, 7], [3,6]] #Separators62 54 [4,5], [5,0], #The outer border 55 [2,5]] #Separator 56 63 57 dict['segment_tags'] = ['wall', 64 'wall',65 58 'wall', 66 59 'wall', … … 68 61 'wall', 69 62 'wall', 70 'wall',71 '', #Interior72 63 ''] #Interior 73 64 65 66 m.addVertsSegs(dict) 74 67 75 m.addVertsSegs(dict) 68 76 69 77 70 … … 87 80 p2 = [xr, yt] 88 81 p3 = [xl, yt] 82 83 dict['points'] = [p0, p1, p2, p3] 84 dict['segments'] = [[0,1], [1,2], [2,3], [3,0]] 85 dict['segment_tags'] = ['', '', '', ''] 86 m.addVertsSegs(dict) 89 87 90 dict['points'] = [p0, p1, p2, p3] 88 #Island area 89 island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5] 90 island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/3] 91 island_2 = [xleft + (xright-xleft)/2+0.3, ybottom + 2*(ytop-ybottom)/3-0.3] 92 island_3 = [xleft + (xright-xleft)/2+0.3, ybottom + (ytop-ybottom)/3+0.3] 93 island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3] 94 island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.2] 95 island_6 = [xl-.01, yb] #OK 96 island_7 = [xl-.01, yt] #OK 97 98 99 dict['points'] = [island_0, island_1, island_2, 100 island_3, island_4, island_5, 101 #p0, p3] 102 island_6, island_7] 103 104 105 dict['segments'] = [[0,1], [1,2], [2,3], [3,4], 106 [4,5], [5,6], [6,7], [7,0]] 107 108 dict['segment_tags'] = ['', '', '', '', '', '', '', ''] 91 109 92 110 93 dict['segments'] = [[0,1], [1,2], [2,3], [3,0]] 94 dict['segment_tags'] = ['', '', '', ''] 95 m.addVertsSegs(dict) 111 m.addVertsSegs(dict) 96 112 113 114 # 115 116 base_resolution = 1 97 117 98 base_resolution = 100 118 ocean = m.addRegionEN(xleft+.1, ybottom+.1) 119 ocean.setMaxArea(0.1*base_resolution) 99 120 100 ocean = m.addRegionEN(xleft+1, ybottom+1) 101 ocean.setMaxArea(0.01*base_resolution) 121 mid = m.addRegionEN(point_mbottom[0]+.1, ybottom+.1) 122 mid.setMaxArea(0.0005*base_resolution) 123 102 124 103 mid = m.addRegionEN(point_ml2[0]+1, ybottom+1) 104 mid.setMaxArea(0.001*base_resolution) 105 106 107 inner = m.addRegionEN(point_mr2[0]+1, ybottom+1) 108 inner.setMaxArea(0.0001*base_resolution) 125 inner = m.addRegionEN(island_3[0]+.1, island_3[1]+.1) 126 inner.setMaxArea(0.00007*base_resolution) 109 127 110 128 111 129 gulleys = m.addRegionEN(p0[0]+0.1, p0[1]+0.1) 112 gulleys.setMaxArea(0.0000 1*base_resolution)113 114 130 gulleys.setMaxArea(0.00002*base_resolution) 131 132 115 133 m.generateMesh('pzq28.0za1000000a') 116 134 117 135 import filenames 118 136 m.export_mesh_file(filenames.mesh_filename) 137
Note: See TracChangeset
for help on using the changeset viewer.