Changeset 3128


Ignore:
Timestamp:
Jun 9, 2006, 12:34:16 PM (19 years ago)
Author:
ole
Message:

Fixed potential for excessive memory use

Location:
inundation/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/general_mesh.py

    r3106 r3128  
    11
    2 from Numeric import concatenate, reshape, take
     2from Numeric import concatenate, reshape, take, allclose
    33from Numeric import array, zeros, Int, Float, sqrt, sum
    44
     
    213213            V0 = self.geo_reference.get_absolute(V[:,0:2])
    214214            V1 = self.geo_reference.get_absolute(V[:,2:4])
    215             V2 = self.geo_reference.get_absolute(V[:,4:6])           
    216            
    217             V = concatenate( (V0, V1, V2), axis=1 )
    218 
    219 
     215            V2 = self.geo_reference.get_absolute(V[:,4:6])
     216
     217            if not allclose(V0, V[:,0:2]):
     218                # Only create new object if necessary (as it takes memory)
     219                V = concatenate( (V0, V1, V2), axis=1 )
     220
     221               
    220222        if obj is True:
    221223            #return concatenate( (V[:,0:2], V[:,2:4], V[:,4:6]), axis=0)
  • inundation/pyvolution/neighbour_mesh.py

    r3086 r3128  
    449449
    450450
    451         # Assemble dictionary of boundary segments and choose starting point 
     451        # Assemble dictionary of boundary segments and choose starting point
    452452        segments = {}
    453453        inverse_segments = {}
     454        p0 = None
    454455        mindist = sqrt(sum((pmax-pmin)**2)) #Start value across entire mesh
    455456        for i, edge_id in self.boundary.keys():
Note: See TracChangeset for help on using the changeset viewer.