Changeset 6156
- Timestamp:
- Jan 13, 2009, 3:21:30 PM (16 years ago)
- Location:
- anuga_core/source/anuga/pmesh
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/pmesh/mesh.py
r5931 r6156 22 22 import types 23 23 import exceptions 24 from Numeric import array, Float, Int25 24 26 25 -
anuga_core/source/anuga/pmesh/mesh_interface.py
r5717 r6156 3 3 from anuga.utilities.polygon import point_in_polygon ,populate_polygon 4 4 from anuga.utilities.numerical_tools import ensure_numeric 5 from Numeric import Float 5 import Numeric as num 6 6 from anuga.utilities.polygon import inside_polygon 7 7 … … 150 150 151 151 # Simple check 152 bounding_polygon = ensure_numeric(bounding_polygon, Float)152 bounding_polygon = ensure_numeric(bounding_polygon, num.Float) 153 153 msg = 'Bounding polygon must be a list of points or an Nx2 array' 154 154 assert len(bounding_polygon.shape) == 2, msg -
anuga_core/source/anuga/pmesh/test_mesh.py
r5875 r6156 15 15 from anuga.utilities.polygon import is_inside_polygon ### inside_polygon 16 16 17 from Numeric import alltrue, allclose 17 import Numeric as num 18 18 19 19 class meshTestCase(unittest.TestCase): … … 1658 1658 'test_Mesh2IOTriangulationDict failed. test 2') 1659 1659 1660 self.failUnless( 1660 self.failUnless(num.alltrue(dict['vertices'].flat == verts.flat), 1661 1661 'test_Mesh2IOTriangulationDict failed. test vert') 1662 self.failUnless( 1662 self.failUnless(num.alltrue(dict['vertex_attributes'].flat == vert_as.flat), 1663 1663 'test_Mesh2IOTriangulationDict failed. test vert ats') 1664 1664 1665 self.failUnless( 1665 self.failUnless(num.alltrue(dict['segments'][0] == [0,1]), 1666 1666 'test_Mesh2IODict failed. test 3') 1667 1667 … … 1669 1669 'test_Mesh2IODict failed. test 3') 1670 1670 #print " dict['triangles'][0]", dict['triangles'][0] 1671 self.failUnless( 1671 self.failUnless(num.alltrue(dict['triangles'][0] == [3,2,4]), 1672 1672 'test_Mesh2IODict failed. test 5') 1673 self.failUnless( 1673 self.failUnless(num.alltrue(dict['triangle_neighbors'][0] == [-1,2,3]), 1674 1674 'test_Mesh2IODict failed. test 6') 1675 1675 #print "dict['triangle_tags'][0]", dict['triangle_tags'][0] … … 2181 2181 vert= m.get_user_vertices(absolute=True) 2182 2182 2183 self.failUnless( allclose(vert, points_ab),2183 self.failUnless(num.allclose(vert, points_ab), 2184 2184 'FAILED!') 2185 2185 … … 2198 2198 vert = m.get_user_vertices(absolute=True) 2199 2199 2200 self.failUnless( alltrue(vert.flat ==array(points).flat),2200 self.failUnless(num.alltrue(vert.flat == num.array(points).flat), 2201 2201 'FAILED!') 2202 2202 … … 2216 2216 vert= m.get_user_vertices(absolute=True) 2217 2217 2218 self.failUnless( allclose(vert, points_ab),2218 self.failUnless(num.allclose(vert, points_ab), 2219 2219 'FAILED!') 2220 2220 … … 2233 2233 vert= m.get_user_vertices(absolute=True) 2234 2234 2235 self.failUnless( allclose(vert, points_ab),2235 self.failUnless(num.allclose(vert, points_ab), 2236 2236 'FAILED!') 2237 2237 … … 2254 2254 'FAILED!') 2255 2255 vert= m.get_user_vertices(absolute=True) 2256 self.failUnless( allclose(vert, points_ab),2256 self.failUnless(num.allclose(vert, points_ab), 2257 2257 'FAILED!') 2258 2258 vert= m.get_user_vertices(absolute=False) 2259 2259 points_new = m.geo_reference.get_absolute(vert) 2260 2260 2261 self.failUnless( allclose(points_ab, points_new),2261 self.failUnless(num.allclose(points_ab, points_new), 2262 2262 'FAILED!') 2263 2263 -
anuga_core/source/anuga/pmesh/view_tsh.py
r3564 r6156 11 11 from anuga.pyvolution.util import file_function 12 12 from anuga.utilities.polygon import Polygon_function, read_polygon 13 from Numeric import zeros, Float, maximum, minimum14 13 from realtime_visualisation_new import * 15 14
Note: See TracChangeset
for help on using the changeset viewer.