[1040] | 1 | |
---|
| 2 | import os, sys |
---|
| 3 | sys.path.append('..') |
---|
| 4 | |
---|
| 5 | from mesh import * |
---|
| 6 | from coordinate_transforms.geo_reference import Geo_reference |
---|
| 7 | |
---|
| 8 | #------------------------------------------------------------- |
---|
| 9 | if __name__ == "__main__": |
---|
| 10 | |
---|
[1048] | 11 | |
---|
| 12 | bellambi_northing = 6195000.0 |
---|
| 13 | north_beach_northing = 6183000.0 |
---|
[1086] | 14 | north_beach_easting = 308500 |
---|
[1048] | 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 |
---|
[1086] | 24 | |
---|
[1040] | 25 | # from 100m dem |
---|
[1048] | 26 | geo = Geo_reference(xllcorner = inner_center_easting, |
---|
| 27 | yllcorner = inner_center_northing, |
---|
[1040] | 28 | zone = 56) |
---|
[1048] | 29 | print "***********************" |
---|
| 30 | print "geo ref", geo |
---|
| 31 | print "***********************" |
---|
| 32 | |
---|
[1040] | 33 | m = Mesh(geo_reference=geo) |
---|
| 34 | |
---|
[2276] | 35 | factor = 1000 #low res 10000, high res 1000 |
---|
| 36 | |
---|
| 37 | poly = [[west, north_beach_northing - border], #sw |
---|
[1040] | 38 | [west, bellambi_northing + border], #nw |
---|
[1048] | 39 | [sea_boundary, |
---|
| 40 | bellambi_northing + border], #n_sea_boundary |
---|
[1040] | 41 | [east, bellambi_northing + border], #ne |
---|
| 42 | [east, north_beach_northing - border], #se |
---|
[1048] | 43 | [sea_boundary, |
---|
| 44 | north_beach_northing - border] #s_sea_boundary |
---|
[1040] | 45 | ] |
---|
[2276] | 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) |
---|
[1040] | 56 | |
---|
| 57 | |
---|
[1086] | 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 | |
---|
[2276] | 66 | poly = [ |
---|
[1086] | 67 | [flagstaff_x,flagstaff_y], #n |
---|
| 68 | [west_x,west_y], #w |
---|
| 69 | [north_beach_easting,north_beach_northing], #s |
---|
| 70 | ] |
---|
[2276] | 71 | m.add_region_from_polygon(poly, max_triangle_area=factor*10) |
---|
[1086] | 72 | |
---|
[1074] | 73 | #m.generateMesh() |
---|
| 74 | m.generateMesh("pzq28.0za1000000a") |
---|
[1040] | 75 | |
---|
[1086] | 76 | m.export_mesh_file("wollongong_4regions.msh") |
---|
[1074] | 77 | #m.export_mesh_file("wollongong_highres_a28.tsh") |
---|
[1040] | 78 | |
---|