Changeset 5119 for anuga_core/source/anuga/utilities
- Timestamp:
- Mar 4, 2008, 5:33:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/test_polygon.py
r5086 r5119 49 49 50 50 f = Polygon_function( [(p2, 2.0)] ) 51 z = f([5, 5, 27, 35], [5, 9, 8, -5]) # First and last inside p251 z = f([5, 5, 27, 35], [5, 9, 8, -5]) # First and last inside p2 52 52 assert allclose(z, [2,0,0,2]) 53 53 … … 70 70 71 71 f = Polygon_function( [(p1, 10.0)] ) 72 z = f([430000,480000], [490000,7720000]) # first outside, second inside72 z = f([430000,480000], [490000,7720000]) # first outside, second inside 73 73 74 74 assert allclose(z, [0,10]) … … 82 82 geo = Geo_reference(56, 200, 1000) 83 83 84 # Make points 'absolute'84 # Make points 'absolute' 85 85 p1 = [[200,1000], [210,1000], [210,1010], [200,1010]] 86 86 p2 = [[200,1000], [210,1010], [215,1005], [220, 1010], [225,1000], 87 87 [230,1010], [240,990]] 88 88 89 f = Polygon_function( [(p1, 1.0)], geo_reference = geo)89 f = Polygon_function( [(p1, 1.0)], geo_reference=geo) 90 90 z = f([5, 5, 27, 35], [5, 9, 8, -5]) #Two first inside p1 91 91 … … 93 93 94 94 95 f = Polygon_function( [(p2, 2.0)], geo_reference = geo)95 f = Polygon_function( [(p2, 2.0)], geo_reference=geo) 96 96 z = f([5, 5, 27, 35], [5, 9, 8, -5]) #First and last inside p2 97 97 assert allclose(z, [2,0,0,2]) 98 98 99 99 100 # Combined101 f = Polygon_function( [(p1, 1.0), (p2, 2.0)], geo_reference = geo)100 # Combined 101 f = Polygon_function( [(p1, 1.0), (p2, 2.0)], geo_reference=geo) 102 102 z = f([5, 5, 27, 35], [5, 9, 8, -5]) 103 103 assert allclose(z, [2,1,0,2]) 104 104 105 105 106 # Check that it would fail without geo106 # Check that it would fail without geo 107 107 f = Polygon_function( [(p1, 1.0), (p2, 2.0)]) 108 108 z = f([5, 5, 27, 35], [5, 9, 8, -5]) … … 122 122 assert allclose(z, [10,14,0,0]) 123 123 124 # Combined124 # Combined 125 125 f = Polygon_function( [(p1, test_function), (p2, 2.0)] ) 126 126 z = f([5, 5, 27, 35], [5, 9, 8, -5]) … … 128 128 129 129 130 # Combined w default130 # Combined w default 131 131 f = Polygon_function( [(p1, test_function), (p2, 2.0)], default = 3.14) 132 132 z = f([5, 5, 27, 35], [5, 9, 8, -5]) … … 134 134 135 135 136 # Combined w default func136 # Combined w default func 137 137 f = Polygon_function( [(p1, test_function), (p2, 2.0)], 138 138 default = test_function)
Note: See TracChangeset
for help on using the changeset viewer.