Ignore:
Timestamp:
Jan 17, 2009, 2:56:59 PM (15 years ago)
Author:
ole
Message:

Moved interpolate_polyline out of Interpolation class - it had nothing to do with it anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/fit_interpolate/test_interpolate.py

    r6183 r6185  
    18531853        John Jakeman works. It has been exercised somewhat by tests of sts boundary, but never before separately.
    18541854        """
    1855 
    1856         a = [-1.0, 0.0]
    1857         b = [3.0, 4.0]
    1858         c = [4.0, 1.0]
    1859         d = [-3.0, 2.0] #3
    1860         e = [-1.0, -2.0]
    1861         f = [1.0, -2.0] #5
    1862 
    1863         vertices = [a, b, c, d,e,f]
    1864         triangles = [[0,1,3], [1,0,2], [0,4,5], [0,5,2]] #abd bac aef afc
    1865 
    1866 
    1867         point_coords = [[-2.0, 2.0],
    1868                         [-1.0, 1.0],
    1869                         [0.0, 2.0],
    1870                         [1.0, 1.0],
    1871                         [2.0, 1.0],
    1872                         [0.0, 0.0],
    1873                         [1.0, 0.0],
    1874                         [0.0, -1.0],
    1875                         [-0.2, -0.5],
    1876                         [-0.9, -1.5],
    1877                         [0.5, -1.9],
    1878                         [3.0, 1.0]]
    1879 
    1880         interp = Interpolate(vertices, triangles)
    1881                
    18821855       
    18831856        f = num.array([58.06150614, 58.06150614, 58.06150614])
     
    18961869        z_ref = [0., 0., 0., 58.06150614, 0., 0., 58.06150614]
    18971870       
    1898         z = interp.interpolate_polyline(f, vertex_coordinates, gauge_neighbour_id, point_coordinates)
     1871        z = interpolate_polyline(f, vertex_coordinates, gauge_neighbour_id, point_coordinates)
    18991872        assert num.allclose(z, z_ref)
    19001873       
     
    19021875        f = num.array([58.06150614, 158.06150614, 258.06150614])
    19031876        z_ref = [0., 0., 0., 208.06150645, 0., 0., 108.0615061]       
    1904         z = interp.interpolate_polyline(f, vertex_coordinates, gauge_neighbour_id, point_coordinates)
     1877        z = interpolate_polyline(f, vertex_coordinates, gauge_neighbour_id, point_coordinates)
    19051878        assert num.allclose(z, z_ref)       
    19061879                       
     
    19191892        gauge_neighbour_id = [1, 2, -1]
    19201893                                               
    1921         z = interp.interpolate_polyline(f, vertex_coordinates, gauge_neighbour_id, point_coordinates)
     1894        z = interpolate_polyline(f, vertex_coordinates, gauge_neighbour_id, point_coordinates)
    19221895        z_ref = [1.1, 4.5, 5., 7.4, 11., 0.]
    19231896        #print z
Note: See TracChangeset for help on using the changeset viewer.