"""Create mesh for lwru2 validation of the Oshiri island tsunami """ #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Assume that the root AnuGA dir is included in your pythonpath #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! from pmesh.mesh import * from coordinate_transforms.geo_reference import Geo_reference import project def generate(): #Basic geometry xleft = -5.4 xright = .4 ybottom = 0 ytop = 0.4 xdam = 0.0 #Outline point_sw = [xleft, ybottom] point_se = [xright, ybottom] point_nw = [xleft, ytop] point_ne = [xright, ytop] # Dam seperation (left) point_dam_top = [xdam, ytop] point_dam_bottom = [xdam, ybottom] m = Mesh() #Boundary # FIXME (DSG-DSG): Update this to use new interface. dict = {} dict['points'] = [point_se, #se point_ne, point_dam_top, point_nw, point_sw, point_dam_bottom] dict['segments'] = [[0,1], [1,2], [2,3], [3,4], [4,5], [5,0], #The outer border [2,5]] #Separator dict['segment_tags'] = ['wall', 'wall', 'wall', 'wall', #back of the dam 'wall', 'wall', ''] #Interior m.addVertsSegs(dict) dam = m.add_region(0.2,0.2) dam.setTag("dam") #m.generateMesh('pzq28.0za0.01a') #m.generate_mesh('pzq28.0za0.0001) m.generate_mesh(maximum_triangle_area=0.0001) m.export_mesh_file(project.mesh_filename) print "mesh created" #------------------------------------------------------------- if __name__ == "__main__": pass