Changeset 2341
- Timestamp:
- Feb 6, 2006, 4:26:06 PM (19 years ago)
- Location:
- development/momentum_sink
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
development/momentum_sink/create_buildings.py
r2338 r2341 21 21 #W = WidtH/8 22 22 #L = W 23 outer_polygon = [[0,0],[ WidtH,0],[WidtH,WidtH],[0,WidtH]]23 outer_polygon = [[0,0],[2*WidtH,0],[2*WidtH,WidtH],[0,WidtH]] 24 24 print outer_polygon 25 25 m.add_region_from_polygon(outer_polygon, tags={'wall':[0,1,2], 'wave':[3]}) 26 26 27 27 # inner polygons => building boundaries 28 depth = 15 29 wh = depth/2 # depth of building side to oncoming wave30 breadth = 2231 lh = breadth/2 # breadth of building28 depth = 15 # depth of building side to oncoming wave 29 wh = depth/2 30 breadth = 15 # breadth of building 31 lh = breadth/2 32 32 print "building footprint" 33 33 print depth * breadth , "m^2" 34 block = 625 35 BL = block**0.5 36 print BL 34 37 #[12.5,37.5,62.5,87.5,112.5,137.5,162.5,187.5] 35 36 for W in [12.5,37.5,62.5,87.5,112.5,137.5,162.5,187.5]: 37 for L in [12.5,37.5,62.5,87.5,112.5,137.5,162.5,187.5]: 38 polygon = [[W-wh,L-lh],[W+wh,L-lh],[W+wh,L+lh],[W-wh,L+lh]] 38 D = WidtH/2 + BL/2 39 B = BL/2 40 for D in [112.5,137.5,162.5,187.5]: 41 for B in [12.5,37.5,62.5,87.5,112.5,137.5,162.5,187.5]: 42 polygon = [[D-wh,B-lh],[D+wh,B-lh],[D+wh,B+lh],[D-wh,B+lh]] 39 43 m.add_hole_from_polygon(polygon, tags={'wall':[0,1,2,3]})# Adds holes with reflective boundaries. 40 44 #print polygon 45 46 print B 41 47 42 m.add_circle([20,70], 5, hole=True, tag='wall')48 print D 43 49 44 50 m.generate_mesh(maximum_triangle_area=maximum_triangle_area) -
development/momentum_sink/run_buildings.py
r2339 r2341 16 16 17 17 from create_buildings import create_mesh 18 #from building_generator import create_mesh 18 19 19 20 from pmesh.mesh import importMeshFromFile … … 24 25 t0 = time.time() 25 26 26 meshname, triagle_count = cache(create_mesh,(10 0),27 meshname, triagle_count = cache(create_mesh,(10), 27 28 {'mesh_file':meshname, 28 29 'triangles_in_name':True} … … 69 70 70 71 domain.set_boundary( {'wall': Br,'wave': Bd, 'back': Bt, 'exterior':Bd} ) 71 72 domain.set_region(Set_region('mound', 'friction', 3, location='unique vertices')) 72 73 #Evolve 73 74 t0 = time.time()
Note: See TracChangeset
for help on using the changeset viewer.