Changeset 719


Ignore:
Timestamp:
Dec 23, 2004, 10:26:09 AM (20 years ago)
Author:
duncan
Message:

removing an annomaly in the meshdict, triangle attribute structure to remove an error in least_squares

Location:
inundation/ga/storm_surge/pmesh
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py

    r698 r719  
    372372                else:
    373373                    neighbors +=  "-1 "
    374         if triangles_attributes[index] == ['']:
     374        #Warning even though a list is past, only the first value
     375        #is written.  There's an assumption that the list only
     376        # contains one item. This assumption is made since the
     377        #dict that's being passed around is also be used to communicate
     378        # with triangle, and it seems to have the option of returning
     379        # more than one value for triangle attributex
     380        if triangles_attributes[index][0] == ['']:
    375381            att = ""
    376382        else:
    377             att = str(triangles_attributes[index])
     383            att = str(triangles_attributes[index][0])
    378384        fd.write(str(index) + " "
    379385                 + str(tri[0]) + " "
  • inundation/ga/storm_surge/pmesh/load_mesh/loadASCIIHarness.py

    r578 r719  
    152152        meshDict['generatedsegmentlist'] = [(0, 1), (1, 4), (2, 0),
    153153                                            (0, 3), (4, 2)]
    154         meshDict['generatedtriangleattributelist'] = ['1.3', '1.3',
    155                                                       '1.3', '1.3']
     154        meshDict['generatedtriangleattributelist'] = [['1.3'], ['1.3'],
     155                                                      ['1.3'], ['1.3']]
    156156        meshDict['generatedpointattributelist'] = [[1.2,2.], [1.2,2.], [1.2,2.], [1.2,2.], [1.2,3.]]
    157157        meshDict['generatedtriangleneighborlist'] = [[-1, 2, 3], [3, 2, -1],
  • inundation/ga/storm_surge/pmesh/mesh.py

    r714 r719  
    461461        if not re.match('A',self.mode):
    462462            self.mode += 'A' # A - output region attribute list for triangles
    463         if not re.match('V',self.mode):
     463        if not re.match('V',self.mode) and not re.match('Q',self.mode):
    464464            self.mode += 'V' # V - output info about what Triangle is doing
    465465       
     
    819819        for tri in self.meshTriangles: 
    820820            trianglelist.append((tri.vertices[0].index,tri.vertices[1].index,tri.vertices[2].index)) 
    821             triangleattributelist.append(tri.attribute)
     821            triangleattributelist.append([tri.attribute])
    822822            neighborlist = [-1,-1,-1]
    823823            for neighbor,index in map(None,tri.neighbors,
     
    831831        meshDict['generatedtriangleneighborlist'] = triangleneighborlist
    832832       
    833         #print "*(*("
     833        #print "*)*)"
    834834        #print meshDict
    835         #print "*(*("
     835        #print "*)*)"
    836836
    837837        return meshDict
     
    17011701    newmesh = None
    17021702    if ofile[-4:]== ".xya":
    1703         print "loading " + ofile
     1703        #print "loading " + ofile
    17041704        try:
    17051705            dict = load_mesh.loadASCII.load_xya_file(ofile, delimiter = ',')
  • inundation/ga/storm_surge/pmesh/meshHarness.py

    r714 r719  
    10121012if __name__ == "__main__":
    10131013    suite = unittest.makeSuite(meshTestCase,'test')
    1014     #suite = unittest.makeSuite(meshTestCase,'testautoSegment')
     1014    #suite = unittest.makeSuite(meshTestCase,'test_import_mesh')
    10151015    runner = unittest.TextTestRunner() #verbosity=2)
    10161016    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.