source: anuga_validation/okushiri_2005/create_mesh.py @ 3636

Last change on this file since 3636 was 3636, checked in by ole, 18 years ago

Work on Okushiri validation (towards recreating 18 Aug 2005 results)

File size: 4.1 KB
Line 
1"""Create mesh for lwru2 validation of the Oshiri island tsunami
2"""
3
4#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5# Assume that the root AnuGA dir is included in your pythonpath
6#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
8from anuga.pmesh.mesh import *
9from anuga.coordinate_transforms.geo_reference import Geo_reference
10
11#-------------------------------------------------------------
12if __name__ == "__main__":
13
14
15    #Basic geometry
16   
17    xleft   = 0
18    xright  = 5.448
19    ybottom = 0
20    ytop    = 3.402
21
22    #Outline
23    point_sw = [xleft, ybottom]
24    point_se = [xright, ybottom]
25    point_nw = [xleft, ytop]   
26    point_ne = [xright, ytop]
27
28    #Midway points (left)
29    point_mtop = [xleft + (xright-xleft)/3+1, ytop]
30    point_mbottom = [xleft + (xright-xleft)/3+1, ybottom]
31
32
33    geo = Geo_reference(xllcorner = xleft,
34                        yllcorner = ybottom)
35   
36                       
37    print "***********************"
38    print "geo ref", geo
39    print "***********************"
40   
41    m = Mesh(geo_reference=geo)
42
43    #Boundary
44    dict = {}
45    dict['points'] = [point_se,   #se
46                      point_ne,
47                      point_mtop,
48                      point_nw,
49                      point_sw,
50                      point_mbottom]
51
52   
53    dict['segments'] = [[0,1], [1,2], [2,3], [3,4],
54                        [4,5], [5,0],  #The outer border
55                        [2,5]]         #Separator
56   
57    dict['segment_tags'] = ['wall',
58                            'wall',
59                            'wall',
60                            'wave',
61                            'wall',
62                            'wall',
63                            '']           #Interior
64
65       
66    m.addVertsSegs(dict)
67
68
69
70
71
72    #Localised refined area for gulleys
73    dict = {}
74    xl = 4.8
75    xr = 5.3
76    yb = 1.6
77    yt = 2.3
78    p0 = [xl, yb]
79    p1 = [xr, yb]
80    p2 = [xr, yt]
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)   
87
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'] = ['', '', '', '', '', '', '', '']
109
110
111    m.addVertsSegs(dict)   
112
113   
114#
115   
116    base_resolution = 1
117
118    ocean = m.addRegionEN(xleft+.1, ybottom+.1)
119    ocean.setMaxArea(0.1*base_resolution)
120
121    mid = m.addRegionEN(point_mbottom[0]+.1, ybottom+.1)
122    mid.setMaxArea(0.0005*base_resolution)
123 
124
125    inner = m.addRegionEN(island_3[0]+.1, island_3[1]+.1)
126    inner.setMaxArea(0.0003*base_resolution)
127
128
129    gulleys = m.addRegionEN(p0[0]+0.1, p0[1]+0.1)
130    gulleys.setMaxArea(0.00005*base_resolution)
131
132
133    # From r 1709 11 August 2005
134    #base_resolution = 100
135    #
136    #ocean = m.addRegionEN(xleft+.1, ybottom+.1)
137    #ocean.setMaxArea(0.01*base_resolution)
138    #
139    #mid = m.addRegionEN(point_mbottom[0]+.1, ybottom+.1)
140    #mid.setMaxArea(0.001*base_resolution)
141
142    #inner = m.addRegionEN(island_3[0]+.1, island_3[1]+.1)
143    #inner.setMaxArea(0.0001*base_resolution)
144
145
146    #gulleys = m.addRegionEN(p0[0]+0.1, p0[1]+0.1)
147    #gulleys.setMaxArea(0.00001*base_resolution)       
148   
149   
150    m.generateMesh('pzq28.0za1000000a')
151
152    import project
153    m.export_mesh_file(project.mesh_filename)
154   
Note: See TracBrowser for help on using the repository browser.