Changeset 2341


Ignore:
Timestamp:
Feb 6, 2006, 4:26:06 PM (19 years ago)
Author:
nicholas
Message:

Added friction comparision for building, Fiddled with loops fro create buildings

Location:
development/momentum_sink
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • development/momentum_sink/create_buildings.py

    r2338 r2341  
    2121    #W = WidtH/8
    2222    #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]]
    2424    print outer_polygon
    2525    m.add_region_from_polygon(outer_polygon, tags={'wall':[0,1,2], 'wave':[3]})
    2626
    2727    # inner polygons => building boundaries
    28     depth = 15
    29     wh = depth/2 # depth of building side to oncoming wave
    30     breadth = 22
    31     lh = breadth/2 # breadth of building
     28    depth = 15 # depth of building side to oncoming wave
     29    wh = depth/2
     30    breadth = 15 # breadth of building
     31    lh = breadth/2
    3232    print "building footprint"
    3333    print depth * breadth , "m^2"
     34    block = 625
     35    BL = block**0.5
     36    print BL
    3437    #[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]]
    3943            m.add_hole_from_polygon(polygon, tags={'wall':[0,1,2,3]})# Adds holes with reflective boundaries.       
    4044            #print polygon
     45           
     46            print B
    4147
    42     m.add_circle([20,70], 5, hole=True, tag='wall')
     48        print D
    4349
    4450    m.generate_mesh(maximum_triangle_area=maximum_triangle_area)
  • development/momentum_sink/run_buildings.py

    r2339 r2341  
    1616
    1717from create_buildings import create_mesh
     18#from building_generator import create_mesh
    1819
    1920from pmesh.mesh import importMeshFromFile
     
    2425t0 = time.time()
    2526
    26 meshname, triagle_count = cache(create_mesh,(100),
     27meshname, triagle_count = cache(create_mesh,(10),
    2728                                {'mesh_file':meshname,
    2829                                 'triangles_in_name':True}
     
    6970
    7071domain.set_boundary( {'wall': Br,'wave': Bd, 'back': Bt, 'exterior':Bd} )
    71 
     72domain.set_region(Set_region('mound', 'friction', 3, location='unique vertices'))
    7273#Evolve
    7374t0 = time.time()
Note: See TracChangeset for help on using the changeset viewer.