Changes between Initial Version and Version 1 of InternalBoundaries


Ignore:
Timestamp:
Jun 9, 2010, 3:40:25 PM (12 years ago)
Author:
hudson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InternalBoundaries

    v1 v1  
     1= Buildings, Bridges and Dams =
     2
     3A new feature in ANUGA 1.2 lets you create create arbitrary geometry to represent solid structures. These take the form of holes within the mesh, and can be given arbitrary boundary properties, just like the edges of the domain.
     4
     5The demo code can be found within demos/buildings.py, part of which is reproduced here:
     6
     7{{{
     8length = 50
     9width = 10
     10resolution = 0.15 # make this number smaller to make the simulation more accurate
     11
     12# Create the "world" as a long, skinny channel
     13boundary_poly = poly_from_box(0, length, 0, width)
     14
     15# Place 3 buildings downstream
     16building_polys = [  poly_from_box(10, 15, 2.5, 7.5),        # upstream box
     17                    poly_from_box(22.5, 27.5, 1.5, 6.5),    # middle box
     18                    poly_from_box(35, 40, 3.5, 8.5)]        # downstream box
     19
     20# create a domain mesh, with 3 building holes in it
     21domain = anuga.create_domain_from_regions(boundary_poly,
     22                                            boundary_tags={'left': [0],
     23                                                   'bottom': [1],
     24                                                   'right': [2],
     25                                                   'top': [3]},
     26                                            maximum_triangle_area = resolution,
     27                                            mesh_filename = 'building.msh',
     28                                            interior_holes = building_polys,
     29                                            use_cache=True, # to speed it up
     30                                            verbose=True)   # log output on
     31}}}
     32
     33Note the new parameter to create_domain_from_regions:
     34{{{
     35interior_holes = building_polys
     36}}}
     37This lets you specify a list of polygons to be cut out of the mesh.
     38
     39The internal boundaries have their own boundary tag:
     40{{{exterior}}}
     41which can be set just like any other boundary.
     42