Changeset 291


Ignore:
Timestamp:
Sep 11, 2004, 12:38:07 AM (20 years ago)
Author:
ole
Message:

Cleaned up in get_vertex_values

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/mesh.py

    r288 r291  
    541541        return vertex_coordinates
    542542 
    543     def get_vertices(unique = False):
     543    def get_vertices(self, unique=False):
    544544        """Get connectivity
    545545        If unique is True give them only once as stored internally.
     
    548548
    549549        if unique is True:
    550             V = self.domain.vertices
     550            return self.vertices
    551551        else:
    552            
    553 
     552            from Numeric import reshape, array, Int
     553               
     554            m = len(self)  #Number of volumes
     555            M = 3*m        #Total number of unique vertices
     556            return reshape(array(range(M)).astype(Int), (m,3))
    554557
    555558#FIXME: May get rid of
  • inundation/ga/storm_surge/pyvolution/quantity.py

    r288 r291  
    279279        if reduction is None:
    280280            reduction = self.domain.reduction
    281 
     281           
     282        #Create connectivity
     283        V = self.domain.get_vertices(unique=smooth)
     284                       
    282285        if smooth == True:
    283286
    284287            N = len(self.domain.vertexlist)
    285288            A = zeros(N, precision)
    286             V = self.domain.get_vertices(smooth=True)
    287            
     289
    288290            #Smoothing loop
    289291            for k in range(N):
     
    311313            #Don't smooth
    312314
    313             m = len(self)  #Number of volumes
    314             M = 3*m        #Total number of unique vertices
    315 
    316315            A = self.vertex_values.flat
    317316
    318             #Create connectivity
    319             V = reshape(array(range(M)).astype(Int), (m,3))
    320            
    321317            #Do vertex coordinates   
    322318            if xy is True:               
Note: See TracChangeset for help on using the changeset viewer.