Ignore:
Timestamp:
Apr 1, 2009, 3:19:07 PM (16 years ago)
Author:
rwilson
Message:

Back-merge from Numeric trunk to numpy branch.

Location:
branches/numpy/anuga/fit_interpolate
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/fit_interpolate/fit.py

    r6553 r6689  
    260260            # The memory damage has been done by now.
    261261        else:
    262              AtA = self.AtA #Did this for speed, did ~nothing
     262             AtA = self.AtA # Did this for speed, did ~nothing
    263263        self.point_count += point_coordinates.shape[0]
    264264
     
    267267                                        self.mesh_boundary_polygon,
    268268                                        closed=True,
    269                                         verbose=False) # Too much output if True
    270 
     269                                        verbose=False) # Suppress output
    271270       
    272271        n = len(inside_indices)
     
    283282           
    284283            if element_found is True:
    285                 j0 = triangles[k,0] #Global vertex id for sigma0
    286                 j1 = triangles[k,1] #Global vertex id for sigma1
    287                 j2 = triangles[k,2] #Global vertex id for sigma2
     284                j0 = triangles[k,0] # Global vertex id for sigma0
     285                j1 = triangles[k,1] # Global vertex id for sigma1
     286                j2 = triangles[k,2] # Global vertex id for sigma2
    288287
    289288                sigmas = {j0:sigma0, j1:sigma1, j2:sigma2}
     
    304303                                         self.mesh_boundary_polygon,
    305304                                         closed=True,
    306                                          verbose=False) # Too much output if True               
     305                                         verbose=False) # Suppress output
    307306                msg = 'Point (%f, %f) is not inside mesh boundary' % tuple(x)
    308307                assert flag is True, msg               
     
    318317                raise RuntimeError, msg
    319318
    320             self.AtA = AtA
     319               
     320        self.AtA = AtA
    321321
    322322       
  • branches/numpy/anuga/fit_interpolate/interpolate.py

    r6553 r6689  
    835835                raise msg
    836836
     837            # Ensure 'mesh_boundary_polygon' is defined
     838            mesh_boundary_polygon = None
     839           
    837840            if triangles is not None and vertex_coordinates is not None:
    838841                # Check that all interpolation points fall within
     
    894897                                'requires the latter.')
    895898
    896             # Plot boundary and interpolation points
    897             if verbose is True:
     899            # Plot boundary and interpolation points,
     900            # but only if if 'mesh_boundary_polygon' has data.
     901            if verbose is True and mesh_boundary_polygon is not None:
    898902                import sys
    899903                if sys.platform == 'win32':
  • branches/numpy/anuga/fit_interpolate/test_interpolate.py

    r6441 r6689  
    919919        triangles = [[0,1,3], [1,0,2], [0,4,5], [0,5,2]] #abd bac aef afc
    920920
    921         point_coords_absolute = [[-2.0, 2.0],
    922                                  [-1.0, 1.0],
    923                                  [0.0, 2.0],
    924                                  [1.0, 1.0],
    925                                  [2.0, 1.0],
    926                                  [0.0, 0.0],
    927                                  [1.0, 0.0],
    928                                  [0.0, -1.0],
     921        point_coords_absolute = [[-2.0,  2.0],
     922                                 [-1.0,  1.0],
     923                                 [ 0.0, 2.0],
     924                                 [ 1.0, 1.0],
     925                                 [ 2.0, 1.0],
     926                                 [ 0.0, 0.0],
     927                                 [ 1.0, 0.0],
     928                                 [ 0.0, -1.0],
    929929                                 [-0.2, -0.5],
    930930                                 [-0.9, -1.5],
    931                                  [0.5, -1.9],
    932                                  [3.0, 1.0]]
     931                                 [ 0.5, -1.9],
     932                                 [ 3.0, 1.0]]
    933933
    934934        geo = Geo_reference(57, 100, 500)
     
    967967
    968968
    969         point_coords = [[-2.0, 2.0],
    970                         [-1.0, 1.0],
    971                         [0.0, 2.0],
    972                         [1.0, 1.0],
    973                         [2.0, 1.0],
    974                         [0.0, 0.0],
    975                         [1.0, 0.0],
    976                         [0.0, -1.0],
     969        point_coords = [[-2.0,  2.0],
     970                        [-1.0,  1.0],
     971                        [ 0.0, 2.0],
     972                        [ 1.0, 1.0],
     973                        [ 2.0, 1.0],
     974                        [ 0.0, 0.0],
     975                        [ 1.0, 0.0],
     976                        [ 0.0, -1.0],
    977977                        [-0.2, -0.5],
    978978                        [-0.9, -1.5],
    979                         [0.5, -1.9],
    980                         [3.0, 1.0]]
     979                        [ 0.5, -1.9],
     980                        [ 3.0, 1.0]]
    981981
    982982        interp = Interpolate(vertices, triangles)
     
    10301030
    10311031
    1032         point_coords = [[-2.0, 2.0],
    1033                         [-1.0, 1.0],
    1034                         [0.0, 2.0],
    1035                         [1.0, 1.0],
    1036                         [2.0, 1.0],
    1037                         [0.0, 0.0],
    1038                         [1.0, 0.0],
    1039                         [0.0, -1.0],
     1032        point_coords = [[-2.0,  2.0],
     1033                        [-1.0,  1.0],
     1034                        [ 0.0, 2.0],
     1035                        [ 1.0, 1.0],
     1036                        [ 2.0, 1.0],
     1037                        [ 0.0, 0.0],
     1038                        [ 1.0, 0.0],
     1039                        [ 0.0, -1.0],
    10401040                        [-0.2, -0.5],
    10411041                        [-0.9, -1.5],
    1042                         [0.5, -1.9],
    1043                         [3.0, 1.0]]
     1042                        [ 0.5, -1.9],
     1043                        [ 3.0, 1.0]]
    10441044
    10451045        interp = Interpolate(vertices, triangles)
  • branches/numpy/anuga/fit_interpolate/test_search_functions.py

    r6553 r6689  
    113113                if k >= 0:
    114114                    V = mesh.get_vertex_coordinates(k) # nodes for triangle k
     115                    assert is_inside_triangle(x, V, closed=True)
    115116                    assert is_inside_polygon(x, V)
    116117                    assert found is True
Note: See TracChangeset for help on using the changeset viewer.