Changeset 2030
- Timestamp:
- Nov 15, 2005, 11:41:55 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pmesh/test_mesh.py
r2029 r2030 135 135 m = Mesh(userVertices=[v0,v1,v2,v3], userSegments=[s1,s2,s3,s4,s5], 136 136 regions=[r1,r2] ) 137 m.generateMesh("QApz", maxArea = 36 ) 138 self.failUnless(len(m.meshTriangles) == 6, 139 'test_regionalMaxArea 2:generated mesh is wrong!') 140 137 m.generateMesh("QApz", maxArea = 36 ) 138 139 if sys.platform == 'win32': #Windows 140 self.failUnless(len(m.meshTriangles) == 6, 141 'testregion_with_maxarea 2: # of tris is wrong!') 142 else: 143 self.failUnless(len(m.meshTriangles) == 7, 144 'testregion_with_maxarea 2: # of tris is wrong!') 145 146 141 147 ## Another test case 142 148 r1 = Region(3, 1, tag = 1.3, maxArea = 8) … … 145 151 regions=[r1,r2] ) 146 152 m.generateMesh("QApz", maxArea = 36 ) 147 #print "len(m.meshTriangles)",len(m.meshTriangles) 148 self.failUnless(len(m.meshTriangles) == 8, 149 'test_regionalMaxArea 3:generated mesh is wrong!') 150 153 #print "len(m.meshTriangles)",len(m.meshTriangles) 154 155 if sys.platform == 'win32': #Windows 156 self.failUnless(len(m.meshTriangles) == 8, 157 'testregion_with_maxarea 3: # of tris is wrong!') 158 else: 159 self.failUnless(len(m.meshTriangles) == 10, 160 'testregion_with_maxarea 3: # of tris is wrong!') 161 162 151 163 ## Another test case 152 164 r1 = Region(3, 1, tag = 1.3 ) … … 154 166 m = Mesh(userVertices=[v0,v1,v2,v3], userSegments=[s1,s2,s3,s4,s5], 155 167 regions=[r1,r2] ) 156 m.generateMesh("QApz", maxArea = 8 ) 157 self.failUnless(len(m.meshTriangles) == 8, 158 'test_regionalMaxArea 4:generated mesh is wrong!') 168 m.generateMesh("QApz", maxArea = 8 ) 169 if sys.platform == 'win32': #Windows 170 self.failUnless(len(m.meshTriangles) == 8, 171 'testregion_with_maxarea 4: # of tris is wrong!') 172 else: 173 self.failUnless(len(m.meshTriangles) == 10, 174 'testregion_with_maxarea 4: # of tris is wrong!') 175 159 176 160 177 ## Another test case … … 947 964 file.close() 948 965 #os.remove(fileName) 949 print "lFile",lFile 950 self.failUnless(lFile[0] == "" and 966 967 if sys.platform == 'win32': #Windows 968 self.failUnless(lFile[0] == "" and 951 969 lFile[1] == "0.0,0.0" and 952 970 lFile[2] == "0.0,3.0" and … … 955 973 lFile[5] == "3.0,1.0" and 956 974 lFile[6] == "1.5,1.5" 975 , 976 'exported Ascii xya file is wrong') 977 else: 978 self.failUnless(lFile[0] == "" and 979 lFile[1] == "0.0,0.0" and 980 lFile[2] == "0.0,3.0" and 981 lFile[3] == "3.0,3.0" and 982 lFile[4] == "1.0,2.0" and 983 lFile[5] == "3.0,1.0" 957 984 , 958 985 'exported Ascii xya file is wrong')
Note: See TracChangeset
for help on using the changeset viewer.