source: anuga_work/development/near_shore_PMD/create_mesh.py @ 5093

Last change on this file since 5093 was 5093, checked in by duncan, 16 years ago

Add more to simulation

File size: 1.6 KB
Line 
1"""Create mesh for near shore PMD
2"""
3
4from anuga.pmesh.mesh_interface import create_mesh_from_regions
5
6
7xslope = 5.0 # Distance between the boundary ande the start of the slope
8
9
10def generate(mesh_filename, maximum_triangle_area=300000):
11    """
12    """
13    # Basic geometry and bounding polygon
14    xleft   = -100  # Beach
15    xright  = 10000  # wave generated here
16    ytop    = 15000
17    ybottom = -15000
18
19    point_sw = [xleft, ybottom]
20    point_se = [xright, ybottom]
21    point_nw = [xleft, ytop]   
22    point_ne = [xright, ytop]
23
24    bounding_polygon = [point_se,
25                        point_ne,
26                        point_nw,
27                        point_sw]
28
29    # local refinement
30    xleft   = -80
31    xright  = 500
32    ytop    = 1000
33    ybottom = -1000
34
35    point_sw = [xleft, ybottom]
36    point_se = [xright, ybottom]
37    point_nw = [xleft, ytop]   
38    point_ne = [xright, ytop]
39   
40    polygon_2 = [point_se,
41                        point_ne,
42                        point_nw,
43                        point_sw]
44
45    interior_regions = [[polygon_2, maximum_triangle_area/10.]]
46   
47    m = create_mesh_from_regions(bounding_polygon,
48                                 boundary_tags={'wall': [1, 2, 3],
49                                                'wave': [0]},     
50                                 maximum_triangle_area=maximum_triangle_area,
51                                 interior_regions=interior_regions,
52                                 filename=mesh_filename,
53                                 verbose=True)
54    print "mesh created"
55
56   
57#-------------------------------------------------------------
58if __name__ == "__main__":
59    generate("aa.tsh")
Note: See TracBrowser for help on using the repository browser.