Last change
on this file since 5453 was
5301,
checked in by ole, 17 years ago
|
Refactored generation of culvert polygons to a robust calculation.
|
File size:
1.1 KB
|
Line | |
---|
1 | """ |
---|
2 | |
---|
3 | This little test script is used to test creating polygons at the end of a culvert inlet and outlet. |
---|
4 | It needs to be called once only during an ANUGA run to create the required polygons for enquiring |
---|
5 | the total energy at both ends of the culvert and transferring flow |
---|
6 | May need to include ability to have a function that controls the blockage level of the culvert |
---|
7 | |
---|
8 | """ |
---|
9 | |
---|
10 | from anuga.utilities.polygon import plot_polygons |
---|
11 | from culvert_polygons import create_culvert_polygons |
---|
12 | |
---|
13 | # Culvert location |
---|
14 | x0 = 5.0; y0 = 5.0 # One end |
---|
15 | x1 = 15.0; y1 = 20.0 # Other end |
---|
16 | |
---|
17 | # Culvert Size |
---|
18 | culvert_width=2.4 |
---|
19 | culvert_height=1.2 |
---|
20 | |
---|
21 | |
---|
22 | # Call function |
---|
23 | P = create_culvert_polygons(end_point0=[x0, y0], |
---|
24 | end_point1=[x1, y1], |
---|
25 | width=culvert_width, |
---|
26 | height=culvert_height) |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | culv_polygon = [[x0,y0], [x1,y1]] |
---|
31 | plot_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.