Changeset 4859


Ignore:
Timestamp:
Nov 28, 2007, 11:42:09 AM (16 years ago)
Author:
duncan
Message:

check the last triangle fit/interp speed up. Upgrading the code to time runs

Location:
anuga_core/source/anuga
Files:
9 edited

Legend:

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

    r4839 r4859  
    2222import tempfile
    2323import profile , pstats
     24from math import sqrt
     25from Numeric import array
     26
     27from anuga.fit_interpolate.search_functions import search_times, \
     28     reset_search_times
    2429
    2530from anuga.fit_interpolate.interpolate import Interpolate
     
    3136from anuga.fit_interpolate.interpolate import benchmark_interpolate
    3237from anuga.coordinate_transforms.geo_reference import Geo_reference
     38from anuga.fit_interpolate.general_fit_interpolate import \
     39     get_build_quadtree_time
     40
     41"""
     42
     43Code from the web;
     44
     45from ctypes import *
     46from ctypes.wintypes import DWORD
     47
     48SIZE_T = c_ulong
     49
     50class _MEMORYSTATUS(Structure):
     51_fields_ = [("dwLength", DWORD),
     52("dwMemoryLength", DWORD),
     53("dwTotalPhys", SIZE_T),
     54("dwAvailPhys", SIZE_T),
     55("dwTotalPageFile", SIZE_T),
     56("dwAvailPageFile", SIZE_T),
     57("dwTotalVirtual", SIZE_T),
     58("dwAvailVirtualPhys", SIZE_T)]
     59def show(self):
     60for field_name, field_type in self._fields_:
     61print field_name, getattr(self, field_name)
     62
     63memstatus = _MEMORYSTATUS()
     64windll.kernel32.GlobalMemoryStatus(byref(memstatus ))
     65memstatus.show()
     66
     67
     68_______________________________
     69
     70from ctypes import *
     71from ctypes.wintypes import *
     72
     73class MEMORYSTATUS(Structure):
     74_fields_ = [
     75('dwLength', DWORD),
     76('dwMemoryLoad', DWORD),
     77('dwTotalPhys', DWORD),
     78('dwAvailPhys', DWORD),
     79('dwTotalPageFile', DWORD),
     80('dwAvailPageFile', DWORD),
     81('dwTotalVirtual', DWORD),
     82('dwAvailVirtual', DWORD),
     83]
     84
     85def winmem():
     86x = MEMORYSTATUS()
     87windll.kernel32.GlobalMemoryStatus(byref(x))
     88return x
     89
     90"""
    3391
    3492def mem_usage():
     
    76134              save=False,
    77135              verbose=False,
    78               run_profile=False):
     136              run_profile=False,
     137              gridded=True):
    79138        '''
    80139        num_of_points
     
    84143        #print "max_points_per_cell", max_points_per_cell
    85144
    86         geo = Geo_reference(xllcorner = 2.0,
    87                  yllcorner = 2.0)
     145        geo = None #Geo_reference(xllcorner = 2.0, yllcorner = 2.0)
    88146        mesh_dict = self._build_regular_mesh_dict(maxArea=maxArea,
    89147                                                  is_segments=segments_in_mesh,
     
    91149                                                  geo=geo)
    92150        points_dict = self._build_points_dict(num_of_points=num_of_points,
    93                                                   geo=geo)
    94 
    95 
     151                                              gridded=gridded,
     152                                              verbose=verbose)
     153
     154        #print "len(mesh_dict['triangles'])",len(mesh_dict['triangles'])
    96155        if is_fit is True:
    97156            op = "Fit_"
     
    107166       
    108167        domain = Domain(mesh_dict['vertices'], mesh_dict['triangles'],
    109                         use_cache=False, verbose=False,
     168                        use_cache=False, verbose=verbose,
    110169                                     geo_reference=geo)
    111170        #Initial time and memory
     
    119178                                     points_dict['point_attributes'],
    120179                                     geo_reference=geo)
     180        del points_dict
    121181        if is_fit is True:
    122182
     
    152212            else:
    153213                domain.set_quantity('elevation',points,filename=filename,
    154                                     use_cache=False)
     214                                    use_cache=False, verbose=verbose)
    155215            if not use_file_type == None:
    156216                os.remove(fileName)
     
    189249                                       geospatial,
    190250                                       mesh_origin=geo,
    191                                        max_points_per_cell=max_points_per_cell)
     251                                       max_points_per_cell=max_points_per_cell,
     252                                       verbose=verbose)
    192253        time_taken_sec = (time.time()-t0)
    193254        m1 = mem_usage()
     
    197258            memory_used = (m1 - m0)
    198259        #print 'That took %.2f seconds' %time_taken_sec
    199         return time_taken_sec, memory_used, len(mesh_dict['triangles'])
     260
     261        # return the times spent in first cell searching and
     262        # backing up.
     263       
     264        search_one_cell_time, search_more_cells_time = search_times()
     265        reset_search_times()
     266        #print "bench - search_one_cell_time",search_one_cell_time
     267        #print "bench - search_more_cells_time", search_more_cells_time
     268        #print "bench - build_quadtree_time", get_build_quadtree_time()
     269        return time_taken_sec, memory_used, len(mesh_dict['triangles']), \
     270               search_one_cell_time, search_more_cells_time, \
     271               get_build_quadtree_time()
     272   
    200273
    201274    def _build_regular_mesh_dict(self,
     
    207280        # pretty regular size, with some segments thrown in.
    208281
    209         #x_min =
    210         m = Mesh()
     282        # don't pass in the geo ref.
     283        # it is applied in domain
     284        m = Mesh() #geo_reference=geo)
    211285        m.addUserVertex(0,0)
    212286        m.addUserVertex(1.0,0)
     
    254328        return mesh_dict
    255329
    256     def _build_points_dict(self, num_of_points=20000,
    257                                  geo=None):
     330    def _build_points_dict(self, num_of_points=20000
     331                           , gridded=True, verbose=False):
    258332       
    259333        points_dict = {}
     
    261335        point_atts = []
    262336
     337        if gridded is True:
     338            grid = int(sqrt(num_of_points))
     339       
    263340        for point in range(num_of_points):
    264             points.append([random(), random()])
     341            if gridded is True:
     342
     343                # point starts at 0.0
     344                # the 2 and 0.25 is to make sure all points are in the
     345                # range 0 - 1
     346                points.append([float(point/grid)/float(grid*1.1)+0.0454,
     347                               float(point%grid)/float(grid*1.1)+0.0454])
     348            else:
     349                points.append([random(), random()])
    265350            point_atts.append(10.0)
    266351
    267352        points_dict['points'] = points
    268353        points_dict['point_attributes'] = point_atts
     354       
     355        for point in points:
     356            assert point[0] < 1.0
     357            assert point[1] < 1.0
     358            assert point[0] > 0.0
     359            assert point[1] > 0.0
     360           
     361        if verbose is True:
     362            pass
     363            #print "points", points
     364            #import sys; sys.exit()
     365           
     366                                   
     367           
    269368        return points_dict
    270369
     
    272371#-------------------------------------------------------------
    273372if __name__ == "__main__":
    274         b = BenchmarkLeastSquares()
    275         b._build_regular_mesh_dict()
    276373        b._build_points_dict()
  • anuga_core/source/anuga/fit_interpolate/fit.py

    r4838 r4859  
    3737from anuga.utilities.polygon import in_and_outside_polygon
    3838from anuga.fit_interpolate.search_functions import search_tree_of_vertices
     39
    3940from anuga.utilities.cg_solve import conjugate_gradient
    4041from anuga.utilities.numerical_tools import ensure_numeric, gradient
     
    9192        """
    9293        # Initialise variabels
    93 
    9494        if alpha is None:
    9595
     
    255255            assert z.shape[0] == point_coordinates.shape[0]
    256256
    257             self.AtA = Sparse(m,m)
     257            AtA = Sparse(m,m)
    258258            # The memory damage has been done by now.
    259            
     259        else:
     260             AtA = self.AtA #Did this for speed, did ~nothing
    260261        self.point_count += point_coordinates.shape[0]
    261262        #print "_build_matrix_AtA_Atz - self.point_count", self.point_count
     
    276277        if verbose: print 'Building fitting matrix from %d points' %n       
    277278        #Compute matrix elements for points inside the mesh
     279        triangles = self.mesh.triangles #Did this for speed, did ~nothing
    278280        for d, i in enumerate(inside_poly_indices):
    279281            #For each data_coordinate point
     
    284286           
    285287            if element_found is True:
    286                 j0 = self.mesh.triangles[k,0] #Global vertex id for sigma0
    287                 j1 = self.mesh.triangles[k,1] #Global vertex id for sigma1
    288                 j2 = self.mesh.triangles[k,2] #Global vertex id for sigma2
     288                j0 = triangles[k,0] #Global vertex id for sigma0
     289                j1 = triangles[k,1] #Global vertex id for sigma1
     290                j2 = triangles[k,2] #Global vertex id for sigma2
    289291
    290292                sigmas = {j0:sigma0, j1:sigma1, j2:sigma2}
     
    300302                   
    301303                    for k in js:
    302                         self.AtA[j,k] += sigmas[j]*sigmas[k]
     304                        AtA[j,k] += sigmas[j]*sigmas[k]
    303305            else:
    304306                msg = 'Could not find triangle for point', x
    305307                raise Exception(msg)
    306    
     308            self.AtA = AtA
    307309       
    308310    def fit(self, point_coordinates_or_filename=None, z=None,
     
    324326         
    325327        """
    326 
    327328        # use blocking to load in the point info
    328329        if type(point_coordinates_or_filename) == types.StringType:
     
    337338
    338339            for i, geo_block in enumerate(G_data):
    339                 if verbose is True and 0 == i%200: # round every 5 minutes
    340                     # But this is dependant on the # of Triangles, so it
    341                     #isn't every 5 minutes.
     340                if verbose is True and 0 == i%200:
     341                    # The time this will take
     342                    # is dependant on the # of Triangles
    342343                       
    343344                    print 'Processing Block %d' %i
     
    353354
    354355                points = geo_block.get_data_points(absolute=True)
     356                #print "fit points", points
    355357                z = geo_block.get_attributes(attribute_name=attribute_name)
    356358                self.build_fit_subset(points, z, verbose=verbose)
  • anuga_core/source/anuga/fit_interpolate/general_fit_interpolate.py

    r4779 r4859  
    3636from anuga.geospatial_data.geospatial_data import Geospatial_data, \
    3737     ensure_absolute
     38from anuga.fit_interpolate.search_functions import set_last_triangle
    3839
    3940# tests fail if 2 is used
    4041MAX_VERTICES_PER_CELL = 13 # A value of 8 or lower can cause problems,
    4142                           # if a vert has 9 triangles.
     43                           
     44build_quadtree_time = 0
     45
     46def get_build_quadtree_time():
     47    return build_quadtree_time
    4248
    4349class FitInterpolate:
     
    8288              a mesh origin, since geospatial has its own mesh origin.
    8389        """
    84 
     90        global build_quadtree_time
    8591        if max_vertices_per_cell == None:
    8692            max_vertices_per_cell = MAX_VERTICES_PER_CELL
    87 
    8893        if mesh is None:
    8994            # Fixme (DSG) Throw errors if triangles or vertex_coordinates
     
    103108        if verbose: print 'FitInterpolate: Building quad tree'
    104109        # This stores indices of vertices
     110        t0 = time.time()
     111        #print "self.mesh.get_extent(absolute=True)", \
     112              #self.mesh.get_extent(absolute=True)
    105113        self.root = build_quadtree(self.mesh,
    106114                                   max_points_per_cell = max_vertices_per_cell)
    107         #print "self.root",self.root.show() 
     115        #print "self.root",self.root.show()
    108116       
     117        build_quadtree_time =  time.time()-t0
     118        set_last_triangle()
    109119       
    110120    def __repr__(self):
  • anuga_core/source/anuga/fit_interpolate/profile_long_benchmark.py

    r4839 r4859  
    1212ben = BenchmarkLeastSquares()
    1313
    14 ofile = 'lbm_results.csv'
    1514delimiter = ','
    1615
    1716use_least_squares_list = [False]
    18 is_fit_list = [True]
    19 num_of_points_list = [1000] #, 500, 10000, 100000] #, 10000000]
    20 maxArea_list = [0.0001] #,0.00001] #, 0.0000001] #, 0.06, 0.00001, 0.0000001]
    21 max_points_per_cell_list = [8]
     17is_fit_list = [True, False]
     18# 45 is for the interp example
     19# 4617 is 3 points per triangle
     20#30780 is 20 points per triangle
     21# 92340 is 60 points per triangle
     22num_of_points_list = [92340] #[45,4617,30780,92340,] #, 500, 10000, 100000] #, 10000000]
     23maxArea_list = [0.001] #,0.00001] #, 0.0000001] #, 0.06, 0.00001, 0.0000001]
     24max_points_per_cell_list = [13]
    2225use_file_type_list = ['pts']
     26run_profile = True
    2327
     28
     29if run_profile is True:
     30    ofile = 'profiling_lbm_results.csv'
     31else:
     32    ofile = 'lbm_results.csv'
    2433fd = open(ofile,'a')
    2534# write the title line
     
    3140         "max_points_per_cell" + delimiter +
    3241         "is_fit" + delimiter +
     42         "search_one_cell_time" + delimiter +
     43         "search_more_cells_time" + delimiter +
     44         "build_quadtree_time" + delimiter +
    3345         "mem"  + delimiter +
    3446         "time" + delimiter + "\n")
     
    4153                for max_points_per_cell in max_points_per_cell_list:
    4254   
    43                     time, mem, num_tri = ben.trial(
     55                    time, mem, num_tri, one_t, more_t, quad_t = ben.trial(
    4456                        num_of_points=num_of_points
    4557                        ,maxArea=maxArea
     
    4961                        ,use_file_type=use_file_type
    5062                        ,save=True
    51                         ,run_profile=True
     63                        ,run_profile=run_profile
    5264                        )
    5365                    print "time",time
     
    6072                             str(max_points_per_cell) + delimiter +
    6173                             str(is_fit) + delimiter +
     74                             str(one_t) + delimiter +
     75                             str(more_t) + delimiter +
     76                             str(quad_t) + delimiter +
    6277                             str(mem)  + delimiter +
    6378                             str(time) + delimiter + "\n")
  • anuga_core/source/anuga/fit_interpolate/run_long_benchmark.py

    r4839 r4859  
    1212ben = BenchmarkLeastSquares()
    1313
    14 ofile = 'lbm_results.csv'
    1514delimiter = ','
    1615
    1716use_least_squares_list = [False]
    18 is_fit_list = [True, False]
    19 num_of_points_list = [50, 1000] #, 500, 10000, 100000] #, 10000000]
    20 maxArea_list = [0.01, 0.001, 0.0001] #,0.00001] #, 0.0000001] #, 0.06, 0.00001, 0.0000001]
    21 max_points_per_cell_list = [8]
     17is_fit_list = [True] #[True, False]
     18
     19# a maxArea of 0.00001 gives 155195 triangles
     20# Simulating Cairns. Seemed to take too long to run.  Need to Try again.
     21 
     22#maxArea_list = [0.00001]
     23#num_of_points_list = [1863558]
     24
     25# a maxArea of 0.0001 gives 15568 triangles
     26#maxArea_list = [0.0001]
     27#num_of_points_list = [46704]
     28
     29# a maxArea of 0.001 gives 1539 triangles
     30#   3 points/tri is 4617
     31#  20 points/tri is 30780
     32# 132 points/tri is 203148
     33#maxArea_list = [0.001]
     34#num_of_points_list = [4617,30780,203148]
     35#num_of_points_list = [203148]
     36
     37# a maxArea of 0.005 gives 319 triangles
     38#   3 points/tri is 957
     39#  20 points/tri is 6380
     40# 132 points/tri is 42108
     41#maxArea_list = [0.005]
     42#num_of_points_list = [957,6380,42108]
     43
     44# a maxArea of 0.01 gives 150 triangles
     45#   3 points/tri is 450
     46#  20 points/tri is 3000
     47# 132 points/tri is 19800
     48#maxArea_list = [0.01]
     49#num_of_points_list = [450,3000] #,19800]
     50
     51# Quick check
     52maxArea_list = [0.61]
     53num_of_points_list = [4]
     54
     55
     56
     57
     58max_points_per_cell_list = [13]
    2259use_file_type_list = ['pts']
     60run_profile =   False # True #True # False #
     61gridded_list = [True] #, False]
    2362
     63
     64if run_profile is True:
     65    ofile = 'profiling_lbm_results.csv'
     66else:
     67    ofile = 'lbm_results.csv'
    2468fd = open(ofile,'a')
    2569# write the title line
     
    3175         "max_points_per_cell" + delimiter +
    3276         "is_fit" + delimiter +
     77         "is_gridded" + delimiter +
     78         "search_one_cell_time" + delimiter +
     79         "search_more_cells_time" + delimiter +
     80         "build_quadtree_time" + delimiter +
    3381         "mem"  + delimiter +
    3482         "time" + delimiter + "\n")
     
    3684
    3785for is_fit in is_fit_list:
    38     for maxArea in maxArea_list:
    39         for use_file_type in use_file_type_list:
    40             for num_of_points in num_of_points_list:
    41                 for max_points_per_cell in max_points_per_cell_list:
     86    for gridded in gridded_list:
     87        for maxArea in maxArea_list:
     88            for use_file_type in use_file_type_list:
     89                for num_of_points in num_of_points_list:
     90                    for max_points_per_cell in max_points_per_cell_list:
    4291   
    43                     time, mem, num_tri = ben.trial(
    44                         num_of_points=num_of_points
    45                         ,maxArea=maxArea
    46                         ,max_points_per_cell=max_points_per_cell
    47                         ,is_fit=is_fit
    48                         ,segments_in_mesh=False
    49                         ,use_file_type=use_file_type
    50                         ,save=True
     92                        time, mem, num_tri, one_t, more_t, quad_t = ben.trial(
     93                            num_of_points=num_of_points
     94                            ,maxArea=maxArea
     95                            ,max_points_per_cell=max_points_per_cell
     96                            ,is_fit=is_fit
     97                            ,segments_in_mesh=False
     98                            ,use_file_type=use_file_type
     99                            ,save=True
     100                            ,verbose=False
     101                            ,run_profile=run_profile
     102                            ,gridded=gridded
    51103                        )
    52104                    print "time",time
     
    59111                             str(max_points_per_cell) + delimiter +
    60112                             str(is_fit) + delimiter +
     113                             str(gridded) + delimiter +
     114                             str(one_t) + delimiter +
     115                             str(more_t) + delimiter +
     116                             str(quad_t) + delimiter +
    61117                             str(mem)  + delimiter +
    62118                             str(time) + delimiter + "\n")
  • anuga_core/source/anuga/fit_interpolate/search_functions.py

    r4791 r4859  
    77"""
    88from Numeric import dot
     9import time
     10
     11from Numeric import array
    912
    1013from anuga.utilities.numerical_tools import get_machine_precision
     14from anuga.config import max_float
     15
     16initial_search_value = 'uncomment search_functions code first'#0
     17search_one_cell_time = initial_search_value
     18search_more_cells_time = initial_search_value
     19
     20#FIXME test what happens if a
     21LAST_TRIANGLE = [[-10,[(array([max_float,max_float]),
     22                        array([max_float,max_float]),
     23                        array([max_float,max_float])),
     24                       (array([1,1]),array([0,0]),array([-1.1,-1.1]))]]]
    1125
    1226def search_tree_of_vertices(root, mesh, x):
     
    2842
    2943    """
     44    global search_one_cell_time
     45    global search_more_cells_time
     46
    3047    #Find triangle containing x:
    3148    element_found = False
     
    3653    sigma1 = -10.0
    3754    k = -10.0
    38            
     55
     56    # Search the last triangle first
     57    element_found, sigma0, sigma1, sigma2, k = \
     58                   _search_triangles_of_vertices(mesh,
     59                                                 last_triangle, x)
     60    #print "last_triangle", last_triangle
     61    if element_found is True:
     62        #print "last_triangle", last_triangle
     63        return element_found, sigma0, sigma1, sigma2, k
     64       
     65   
     66   
     67    #t0 = time.time()
    3968    # Get triangles in the cell that the point is in.
    4069    # Triangle is a list, first element triangle_id,
     
    4271    triangles = root.search(x[0], x[1])
    4372    is_more_elements = True
    44 
     73   
    4574    element_found, sigma0, sigma1, sigma2, k = \
    4675                   _search_triangles_of_vertices(mesh,
    4776                                                 triangles, x)
     77    #search_one_cell_time += time.time()-t0
     78    #print "search_one_cell_time",search_one_cell_time
     79    #t0 = time.time()
    4880    while not element_found and is_more_elements:
    4981        triangles, branch = root.expand_search()
     
    5789            element_found, sigma0, sigma1, sigma2, k = \
    5890                       _search_triangles_of_vertices(mesh,triangles, x)
    59 
     91        #search_more_cells_time += time.time()-t0
     92    #print "search_more_cells_time", search_more_cells_time
     93       
    6094    return element_found, sigma0, sigma1, sigma2, k
    6195
     
    71105    fit and interpolate.
    72106    """
    73 
     107    global last_triangle
     108   
    74109    # these statments are needed if triangles is empty
    75110    #Find triangle containing x:
     
    93128        if element_found is True:
    94129            # Don't look for any other triangles in the triangle list
     130            last_triangle = [[k,tri_verts_norms]]
    95131            break
    96132    return element_found, sigma0, sigma1, sigma2, k
     
    100136def find_triangle_compute_interpolation(triangle, n0, n1, n2, x):
    101137    """Compute linear interpolation of point x and triangle k in mesh.
    102     It is assumed that x belongs to triangle k.
     138    It is assumed that x belongs to triangle k.max_float
    103139    """
    104140
     
    113149   
    114150    if  x[0] > max(xi0[0], xi1[0], xi2[0]) + epsilon:
     151        # print "max(xi0[0], xi1[0], xi2[0])", max(xi0[0], xi1[0], xi2[0])
    115152        return False,0,0,0
    116153    if  x[0] < min(xi0[0], xi1[0], xi2[0]) - epsilon:
     
    125162   
    126163    # Compute interpolation - return as soon as possible
     164    #  print "(xi0-xi1)", (xi0-xi1)
     165    # print "n0", n0
     166    # print "dot((xi0-xi1), n0)", dot((xi0-xi1), n0)
    127167   
    128168    sigma0 = dot((x-xi1), n0)/dot((xi0-xi1), n0)
     
    152192    #    element_found = False
    153193    return True, sigma0, sigma1, sigma2
     194
     195def set_last_triangle():
     196    global last_triangle
     197    last_triangle = LAST_TRIANGLE
     198   
     199def search_times():
     200
     201    global search_one_cell_time
     202    global search_more_cells_time
     203
     204    return search_one_cell_time, search_more_cells_time
     205
     206def reset_search_times():
     207
     208    global search_one_cell_time
     209    global search_more_cells_time
     210    search_one_cell_time = initial_search_value
     211    search_more_cells_time = initial_search_value
  • anuga_core/source/anuga/fit_interpolate/test_fit.py

    r4838 r4859  
    131131   
    132132    def test_smooth_attributes_to_meshIV(self):
    133         """ Testing 2 attributes smoothed to the mesh
    134         """
     133        # Testing 2 attributes smoothed to the mesh
     134       
    135135
    136136        a = [0.0, 0.0]
     
    708708
    709709    def test_smooth_attributes_to_mesh_function(self):
    710         """ Testing 2 attributes smoothed to the mesh
    711         """
     710        #Testing 2 attributes smoothed to the mesh
     711       
    712712
    713713        a = [0.0, 0.0]
     
    10961096if __name__ == "__main__":
    10971097    suite = unittest.makeSuite(Test_Fit,'test')
    1098     #suite = unittest.makeSuite(Test_Fit,'test_fit_to_mesh_pts_passing_mesh_in')
     1098    #suite = unittest.makeSuite(Test_Fit,'test_smooth_attributes_to_mesh_function')
    10991099    #suite = unittest.makeSuite(Test_Fit,'')
    11001100    runner = unittest.TextTestRunner(verbosity=1)
  • anuga_core/source/anuga/fit_interpolate/test_search_functions.py

    r4666 r4859  
    33
    44import unittest
    5 from search_functions import search_tree_of_vertices
     5from search_functions import search_tree_of_vertices, set_last_triangle
    66from search_functions import _search_triangles_of_vertices
    77
     
    4949
    5050        root = build_quadtree(mesh, max_points_per_cell = 1)
     51        set_last_triangle()
    5152
    5253        x = [0.2, 0.7]
     
    6667
    6768        root = build_quadtree(mesh, max_points_per_cell = 4)
     69        set_last_triangle()
    6870
    6971        for x in [[0.6, 0.3], [0.1, 0.2], [0.7,0.7],
     
    9698        for m in range(8):
    9799            root = build_quadtree(mesh, max_points_per_cell = m)
     100            set_last_triangle()
    98101            #print m, root.show()
    99102
     
    121124
    122125        root = build_quadtree(mesh, max_points_per_cell = 4)
     126        set_last_triangle()
    123127
    124128        # One point
  • anuga_core/source/anuga/utilities/sparse.py

    r4769 r4859  
    5757
    5858        i,j = key
     59        # removing these asserts will not speed things up
    5960        assert 0 <= i < self.M
    6061        assert 0 <= j < self.N       
     
    6970       
    7071        i,j = key
     72        # removing these asserts will not speed things up
    7173        assert 0 <= i < self.M
    7274        assert 0 <= j < self.N               
Note: See TracChangeset for help on using the changeset viewer.