Changeset 4460


Ignore:
Timestamp:
May 18, 2007, 4:07:12 PM (17 years ago)
Author:
ole
Message:

Faster code for get_disconnected_triangles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/general_mesh.py

    r4376 r4460  
    11
    22from Numeric import concatenate, reshape, take, allclose
    3 from Numeric import array, zeros, Int, Float, sqrt, sum
     3from Numeric import array, zeros, Int, Float, sqrt, sum, arange
    44
    55from anuga.coordinate_transforms.geo_reference import Geo_reference
     
    359359        M = len(self) # Number of triangles
    360360        K = 3*M       # Total number of unique vertices
    361         T = reshape(array(range(K)).astype(Int), (M,3))
    362 
     361       
     362        #T = reshape(array(range(K)).astype(Int), (M,3))
     363        T = reshape(arange(K).astype(Int), (M,3))  # Faster
     364       
    363365        return T     
    364366
Note: See TracChangeset for help on using the changeset viewer.