source: anuga_core/source/anuga/culvert_flows/culvert_polygons_example.py @ 7711

Last change on this file since 7711 was 7711, checked in by hudson, 14 years ago

Refactored geometry classes to live in their own folder.

File size: 1.1 KB
Line 
1"""
2
3This little test script is used to test creating polygons at the end of a culvert inlet and outlet.
4It needs to be called once only during an ANUGA run to create the required polygons for enquiring
5the total energy at both ends of the culvert and transferring flow
6May need to include ability to have a function that controls the blockage level of the culvert
7
8"""
9
10from anuga.geometry.polygon import plot_polygons
11from culvert_polygons import create_culvert_polygons
12
13# Culvert location
14x0 = 5.0; y0 = 5.0  # One end
15x1 = 15.0; y1 = 20.0  # Other end
16
17# Culvert Size
18culvert_width=2.4
19culvert_height=1.2
20
21
22# Call function
23P = create_culvert_polygons(end_point0=[x0, y0],
24                            end_point1=[x1, y1],
25                            width=culvert_width,
26                            height=culvert_height)
27
28
29
30culv_polygon = [[x0,y0], [x1,y1]]
31plot_polygons([culv_polygon,
32               P['exchange_polygon0'],
33               P['exchange_polygon1'],
34               P['enquiry_polygon0'],
35               P['enquiry_polygon1']],
36              figname='culvert_polygon_example')
37
38
Note: See TracBrowser for help on using the repository browser.