Changeset 824


Ignore:
Timestamp:
Feb 1, 2005, 2:12:49 PM (20 years ago)
Author:
prow
Message:

Fixed some bugs. See docs.

File:
1 edited

Legend:

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

    r822 r824  
    790790        pointlist=[]
    791791        pointattributelist=[]
    792        
    793792        index = 0
    794793        for vertex in self.userVertices:
     
    843842        pointattributelist=[]
    844843
    845         index = 0
     844
     845        self.maxVertexIndex=0
    846846        for vertex in self.meshVertices:
    847             vertex.index = index
     847            vertex.index = self.maxVertexIndex
    848848            pointlist.append((vertex.x,vertex.y))
    849849            pointattributelist.append((vertex.attributes))           
    850             index += 1
     850            self.maxVertexIndex += 1
    851851
    852852        meshDict['generatedpointlist'] = pointlist
     
    925925        #print genDict
    926926        #print "@#@#@#"
    927        
    928         index = 0
     927
     928        self.maxVertexIndex = 0
    929929        for point in genDict['generatedpointlist']:
    930930            v=Vertex(point[0], point[1])
    931             v.index = index
    932             index +=1
     931            v.index =  self.maxVertexIndex
     932            self.maxVertexIndex +=1
    933933            self.meshVertices.append(v)
    934934
     
    21822182        """
    21832183
    2184         new_triangle1 = Triangle(new_point,triangle.vertices[0],triangle.vertices[1],attribute = None, neighbors = None)
    2185         new_triangle2 = Triangle(new_point,triangle.vertices[2],triangle.vertices[0],attribute = None, neighbors = None)
     2184        new_triangle1 = Triangle(new_point,triangle.vertices[0],triangle.vertices[1],attribute = triangle.attribute, neighbors = None)
     2185        new_triangle2 = Triangle(new_point,triangle.vertices[2],triangle.vertices[0],attribute = triangle.attribute, neighbors = None)
    21862186
    21872187        new_triangle1.setNeighbors(triangle.neighbors[2],None,new_triangle2)
     
    22602260        new_coordinate = [((a[0]-b[0])/2+b[0]),((a[1]-b[1])/2+b[1])]
    22612261        newVertex = Vertex(new_coordinate[0],new_coordinate[1], attributes = attributes)
     2262        mesh.maxVertexIndex+=1
     2263        newVertex.index = mesh.maxVertexIndex
     2264        mesh.meshVertices.append(newVertex)
    22622265        return newVertex
    22632266
Note: See TracChangeset for help on using the changeset viewer.