source: inundation-numpy-branch/pmesh/create_gong.py @ 3330

Last change on this file since 3330 was 2276, checked in by duncan, 19 years ago

adding new pmesh.mesh interface

File size: 2.6 KB
Line 
1
2import os, sys
3sys.path.append('..')
4
5from mesh import *
6from coordinate_transforms.geo_reference import Geo_reference
7
8#-------------------------------------------------------------
9if __name__ == "__main__":
10
11
12    bellambi_northing = 6195000.0
13    north_beach_northing = 6183000.0
14    north_beach_easting = 308500
15    border = 12000.0
16    west = 301000.0 # From the map
17    inner_east = 310000.0 # From the map
18    inner_west_south = 303000.0 # From the map
19    inner_west_north = 307000.0  # From the map
20    east = 328421.0
21    sea_boundary = (east+inner_east)/2
22    inner_center_easting =  ( inner_east +inner_west_north)/2
23    inner_center_northing = (bellambi_northing + north_beach_northing)/2
24
25    # from 100m dem
26    geo = Geo_reference(xllcorner = inner_center_easting,
27                        yllcorner = inner_center_northing,
28                        zone = 56)
29    print "***********************"
30    print "geo ref", geo
31    print "***********************"
32   
33    m = Mesh(geo_reference=geo)
34   
35    factor = 1000 #low res 10000, high res 1000
36   
37    poly = [[west, north_beach_northing - border],  #sw
38                         [west, bellambi_northing + border],  #nw
39                         [sea_boundary,
40                          bellambi_northing + border],  #n_sea_boundary
41                         [east, bellambi_northing + border], #ne
42                         [east, north_beach_northing - border],    #se
43                         [sea_boundary,
44                          north_beach_northing - border]    #s_sea_boundary
45                         ]
46    tags = {'wall':[0,1,2,3,4,5]}
47
48    m.add_region_from_polygon(poly, tags, max_triangle_area=factor*1000)
49    poly =  [
50        [inner_west_south,north_beach_northing], #sw
51        [inner_west_north,bellambi_northing],   #nw
52        [inner_east,bellambi_northing], #ne
53        [inner_east,north_beach_northing] #se
54        ]
55    m.add_region_from_polygon(poly, max_triangle_area=factor*100)
56   
57
58    #Even more inner points
59    flagstaff_x = 308000
60    flagstaff_y = 6189000
61    west_x = 305000
62    west_y = 6185000
63   
64    north_beach_northing = 6183000.0
65   
66    poly = [
67                         [flagstaff_x,flagstaff_y], #n
68                         [west_x,west_y],   #w
69                         [north_beach_easting,north_beach_northing], #s
70                         ]
71    m.add_region_from_polygon(poly, max_triangle_area=factor*10)
72   
73    #m.generateMesh()
74    m.generateMesh("pzq28.0za1000000a") 
75   
76    m.export_mesh_file("wollongong_4regions.msh")
77    #m.export_mesh_file("wollongong_highres_a28.tsh")
78   
Note: See TracBrowser for help on using the repository browser.