source: development/dam_2006/create_mesh.py @ 3408

Last change on this file since 3408 was 3408, checked in by duncan, 18 years ago

setting up a new simulation

File size: 1.9 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 pmesh.mesh import *
9from coordinate_transforms.geo_reference import Geo_reference
10
11import project
12def generate():
13    #Basic geometry
14   
15    xleft   = -2.25
16    xright  = .75
17    ybottom = 0
18    ytop    = 0.4
19    xdam = 0.0 
20
21    #Outline
22    point_sw = [xleft, ybottom]
23    point_se = [xright, ybottom]
24    point_nw = [xleft, ytop]   
25    point_ne = [xright, ytop]
26
27    # Dam seperation (left)
28    point_dam_top = [xdam, ytop]
29    point_dam_bottom = [xdam, ybottom]
30
31
32    m = Mesh()
33
34    #Boundary
35    # FIXME (DSG-DSG): Update this to use new interface.
36    dict = {}
37    dict['points'] = [point_se,   #se
38                      point_ne,
39                      point_dam_top,
40                      point_nw,
41                      point_sw,
42                      point_dam_bottom]
43
44    dict['segments'] = [[0,1], [1,2], [2,3], [3,4],
45                        [4,5], [5,0],  #The outer border
46                        [2,5]]         #Separator
47   
48    dict['segment_tags'] = ['wall',
49                            'wall',
50                            'wall',
51                            'wall', #back of the dam
52                            'wall',
53                            'wall',
54                            '']           #Interior
55
56       
57    m.addVertsSegs(dict)
58   
59    dam = m.add_region(0.2,0.2) # this is the location of the region.
60    dam.setTag("dam")
61    m.generate_mesh(maximum_triangle_area=0.01)
62    #m.generate_mesh(maximum_triangle_area=0.0001)
63
64    m.export_mesh_file(project.mesh_filename)
65    print "mesh created"
66
67#-------------------------------------------------------------
68if __name__ == "__main__":
69    pass
Note: See TracBrowser for help on using the repository browser.