Ignore:
Timestamp:
Sep 14, 2012, 9:56:39 PM (11 years ago)
Author:
steve
Message:

Added extra unit tests for set_stage and set_elevation operators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/pmesh/mesh_quadtree.py

    r7872 r8578  
    2424
    2525import numpy as num
     26import sys
    2627 
    2728
     
    4142        It contains optimisations and search patterns specific to meshes.
    4243    """
    43     def __init__(self, mesh):
     44    def __init__(self, mesh, verbose=False):
    4445        """Build quad tree for mesh.
    4546
     
    6061       
    6162        normals = mesh.get_normals()
    62        
     63
     64        if verbose :
     65            print '['+60*' '+']',
     66            sys.stdout.flush()
     67
     68        M = N/60
     69
    6370        # Check each triangle
    64         for i in range(N):
     71        for i in xrange(N):
     72
     73            if verbose and i%M == 0 :
     74                #restart_line()
     75                print '\r['+(i/M)*'.'+(60-(i/M))*' ' +']',
     76                sys.stdout.flush()
     77
    6578            i3 = 3*i
    6679            x0, y0 = V[i3, :]
     
    6881            x2, y2 = V[i3+2, :]
    6982
     83            #FIXME SR: Should save memory by just using triangle id!
    7084            node_data = [i, V[i3:i3+3, :], normals[i, :]]
    7185
     
    7488                             min([y0, y1, y2]), max([y0, y1, y2])), \
    7589                             node_data))
     90
     91        if verbose:
     92            print ''
    7693
    7794    def search_fast(self, point):
Note: See TracChangeset for help on using the changeset viewer.