Changeset 847
- Timestamp:
- Feb 8, 2005, 1:34:42 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/triangmoduleHarness.py
r651 r847 32 32 trilist = [] 33 33 mode = "Qzcn" 34 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist,trilist, mode) 34 data = triang.genMesh(points,seglist,holelist,regionlist, 35 pointattlist,segattlist,trilist, mode) 35 36 self.failUnless(data['generatedtrianglelist'] ==[(1, 0, 2), (2, 3, 1)], 36 37 'generatedtrianglelist is wrong!') 37 38 #print "data['generatedsegmentlist']",data['generatedsegmentlist'] 38 self.failUnless(data['generatedsegmentlist'] ==[(2, 0), (3, 2), (1, 3), (0, 1)] 39 self.failUnless(data['generatedsegmentlist'] ==[(2, 0), (3, 2), (1, 3), 40 (0, 1)] 39 41 , 'generatedsegmentlist is wrong!') 40 self.failUnless(data['generatedpointlist'] ==[(0.0, 0.0), (0.0, 10.0), (3.0, 0.0), (3.0, 10.0)], 41 ' is wrong!') 42 43 #print "data['generatedtriangleneighborlist']",data['generatedtriangleneighborlist'] 44 self.failUnless(data['generatedtriangleneighborlist'] ==[(-1, 1, -1), (-1, 0, -1)], 42 self.failUnless(data['generatedpointlist'] ==[(0.0, 0.0), (0.0, 10.0), 43 (3.0, 0.0), (3.0, 10.0)], 44 ' is wrong!') 45 46 #print "data['generatedtriangleneighborlist']", 47 #data['generatedtriangleneighborlist'] 48 self.failUnless(data['generatedtriangleneighborlist'] ==[(-1, 1, -1), 49 (-1, 0, -1)], 45 50 'generatedtriangleneighborlist is wrong!') 46 51 … … 60 65 trilist = [] 61 66 mode = "Qzp" 62 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist,trilist, mode) 67 data = triang.genMesh(points,seglist,holelist,regionlist, 68 pointattlist,segattlist,trilist, mode) 63 69 64 70 self.failUnless(data['generatedtrianglelist'] ==[(1, 0, 2), (2, 3, 1)], 65 71 'trianglelist is wrong!') 66 self.failUnless(data['generatedsegmentlist'] ==[(0, 1), (1, 3), (3, 2), (2, 0)], 72 self.failUnless(data['generatedsegmentlist'] ==[(0, 1), (1, 3), 73 (3, 2), (2, 0)], 67 74 'segmentlist is wrong!') 68 self.failUnless(data['generatedpointlist'] ==[(0.0, 0.0), (0.0, 10.0), (3.0, 0.0), (3.0, 10.0)], 69 ' is wrong!') 70 75 self.failUnless(data['generatedpointlist'] ==[(0.0, 0.0), (0.0, 10.0), 76 (3.0, 0.0), (3.0, 10.0)], 77 ' is wrong!') 78 79 def testsegmarker(self): 80 81 points = [] 82 seglist = [] 83 holelist = [] 84 regionlist = [] 85 86 points = [(0.0,0.0),(0.0,10.0),(3.0,0.0),(3.0,10.0)] 87 pointattlist = [[],[],[],[]] 88 regionlist.append( (1.2,1.2,5.0) ) 89 seglist = [(0,1),(1,3),(3,2),(2,0)] 90 segattlist = [1.0,2.0,3.0,4.0] 91 trilist = [] 92 mode = "Qzp" 93 data = triang.genMesh(points,seglist,holelist,regionlist, 94 pointattlist,segattlist,trilist, mode) 95 96 self.failUnless(data['generatedtrianglelist'] ==[(1, 0, 2), (2, 3, 1)], 97 'trianglelist is wrong!') 98 self.failUnless(data['generatedsegmentlist'] ==[(0, 1), (1, 3), 99 (3, 2), (2, 0)], 100 'segmentlist is wrong!') 101 self.failUnless(data['generatedpointlist'] ==[(0.0, 0.0), (0.0, 10.0), 102 (3.0, 0.0), (3.0, 10.0)], 103 ' is wrong!') 104 self.failUnless(data['generatedsegmentmarkerlist'] ==[1,2,3,4], 105 ' is wrong!') 106 71 107 def testbad_region(self): 72 108 … … 83 119 mode = "Qzpn" 84 120 try: 85 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 121 data = triang.genMesh(points,seglist,holelist, 122 regionlist,pointattlist,segattlist, 123 trilist, mode) 86 124 87 125 except TypeError: … … 104 142 trilist = [] 105 143 mode = "Qzpna36a" 106 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 144 data = triang.genMesh(points,seglist,holelist,regionlist, 145 pointattlist,segattlist, trilist, mode) 107 146 self.failUnless(len(data['generatedtrianglelist']) == 2, 108 147 'testregion_with_maxarea 1: # of tris is wrong!') … … 110 149 regionlist = [(3,1,1.0),(1,3,1.0,8.0)] 111 150 mode = "Qzpna36a" 112 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 151 data = triang.genMesh(points,seglist,holelist,regionlist, 152 pointattlist,segattlist, trilist, mode) 113 153 self.failUnless(len(data['generatedtrianglelist']) == 6, 114 154 'testregion_with_maxarea 2: # of tris is wrong!') … … 116 156 regionlist = [(3,1,1.0,8.0),(1,3,1.0,8.0)] 117 157 mode = "Qzpna36a" 118 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 158 data = triang.genMesh(points,seglist,holelist,regionlist, 159 pointattlist,segattlist, trilist, mode) 119 160 self.failUnless(len(data['generatedtrianglelist']) == 8, 120 161 'testregion_with_maxarea 3: # of tris is wrong!') … … 123 164 regionlist = [(3,1,1.0),(1,3,1.0,8.0)] 124 165 mode = "Qzpna8a" 125 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 166 data = triang.genMesh(points,seglist,holelist,regionlist, 167 pointattlist,segattlist, trilist, mode) 126 168 self.failUnless(len(data['generatedtrianglelist']) == 8, 127 169 'testregion_with_maxarea 4: # of tris is wrong!') … … 140 182 mode = "Qzpn" 141 183 try: 142 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 184 data = triang.genMesh(points,seglist,holelist,regionlist, 185 pointattlist,segattlist, trilist, mode) 143 186 144 187 except TypeError: … … 160 203 mode = "Qzpn" 161 204 try: 162 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 205 data = triang.genMesh(points,seglist,holelist,regionlist, 206 pointattlist,segattlist, trilist, mode) 163 207 164 208 except TypeError: … … 180 224 mode = "Qzpn" 181 225 try: 182 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 226 data = triang.genMesh(points,seglist,holelist,regionlist, 227 pointattlist,segattlist, trilist, mode) 183 228 184 229 except TypeError: … … 200 245 mode = "Qzpn" 201 246 try: 202 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 247 data = triang.genMesh(points,seglist,holelist,regionlist, 248 pointattlist,segattlist, trilist, mode) 203 249 204 250 self.failUnless(data['trianglelist'] ==[(1, 0, 2), (2, 3, 1)], … … 227 273 trilist = [] 228 274 mode = "QAzpq" 229 data = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist, trilist, mode) 275 data = triang.genMesh(points,seglist,holelist,regionlist, 276 pointattlist,segattlist, trilist, mode) 230 277 231 278 self.failUnless(data['generatedtriangleattributelist'] ==[[77.0], [77.0], [77.0], [77.0]],
Note: See TracChangeset
for help on using the changeset viewer.