Ignore:
Timestamp:
May 15, 2006, 2:26:21 PM (19 years ago)
Author:
ole
Message:

Implemented Domain(meshfile) variant widely, updated documentation and added more statistics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/mesh.py

    r2778 r2866  
    6060
    6161
    62     def __init__(self, coordinates, triangles, boundary = None,
    63                  tagged_elements = None, geo_reference = None,
    64                  use_inscribed_circle = False):
     62    def __init__(self, coordinates, triangles,
     63                 boundary=None,
     64                 tagged_elements=None,
     65                 geo_reference=None,
     66                 use_inscribed_circle=False,
     67                 verbose=False):
    6568        """
    6669        Build triangles from x,y coordinates (sequence of 2-tuples or
     
    7376        from Numeric import array, zeros, Int, Float, maximum, sqrt, sum
    7477
    75        
    76         General_mesh.__init__(self, coordinates, triangles, geo_reference)
     78        General_mesh.__init__(self, coordinates, triangles,
     79                              geo_reference, verbose=verbose)
     80
     81        if verbose: print 'Initialising mesh'         
    7782
    7883        N = self.number_of_elements
     
    9499
    95100        #Initialise each triangle
     101        if verbose: print 'Mesh: Computing centroids and radii'       
    96102        for i in range(N):
    97             #if i % (N/10) == 0: print '(%d/%d)' %(i, N)
     103            if verbose and i % ((N+10)/10) == 0: print '(%d/%d)' %(i, N)
    98104
    99105            x0 = V[i, 0]; y0 = V[i, 1]
     
    144150
    145151        #Build neighbour structure
     152        if verbose: print 'Mesh: Building neigbour structure'               
    146153        self.build_neighbour_structure()
    147154
    148155        #Build surrogate neighbour structure
     156        if verbose: print 'Mesh: Building surrogate neigbour structure'
    149157        self.build_surrogate_neighbour_structure()
    150158
    151159        #Build boundary dictionary mapping (id, edge) to symbolic tags
     160        if verbose: print 'Mesh: Building boundary dictionary'
    152161        self.build_boundary_dictionary(boundary)
    153162
    154163        #Build tagged element  dictionary mapping (tag) to array of elements
     164        if verbose: print 'Mesh: Building tagged elements dictionary'       
    155165        self.build_tagged_elements_dictionary(tagged_elements)
    156166
     
    159169
    160170        #FIXME check integrity?
     171        if verbose: print 'Mesh: Done'               
    161172
    162173    def __repr__(self):
Note: See TracChangeset for help on using the changeset viewer.