Changeset 4831
- Timestamp:
- Nov 20, 2007, 10:56:13 AM (17 years ago)
- Location:
- anuga_core/source/anuga/pmesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/pmesh/mesh.py
r4830 r4831 1106 1106 mode is a string that sets conditions on the mesh generations 1107 1107 see triangle_instructions.txt for a definition of the commands 1108 PreCondition: maxArea is a double 1108 1109 PreCondition: maxArea is a double between 1e-20 and 1e30 or is a 1110 string. 1109 1111 """ 1110 1112 #print "mode ",mode … … 1137 1139 if maxArea != None: 1138 1140 self.mode += 'a' + str(maxArea) 1141 try: 1142 self.mode += 'a' + '%20.20f' %maxArea 1143 except TypeError: 1144 self.mode += 'a' + str(maxArea) 1145 #print "self.mode", self.mode 1139 1146 #FIXME (DSG-DSG) This isn't explained. 1140 1147 if isRegionalMaxAreas: -
anuga_core/source/anuga/pmesh/test_mesh.py
r4663 r4831 2324 2324 self.failUnless(points_ab==points_new, 2325 2325 'FAILED!') 2326 2327 def mode_string_float_problems(self): 2328 numbers = [0.0000000001,1000000000000.0, 1e-19,1e19, 1e-25,1e30,1e40, 2329 1e41,'0.00001','0.000000000000000000000000000000000001'] 2330 numbers = [1e-21,1e-20,1e30,1e35,1e40] 2331 for num in numbers: 2332 mode = 'a' + str(num) 2333 #print " mode += 'a' + str(num)", mode 2334 print "=====================" 2335 2336 try: 2337 mode = 'a' + '%20.20f' %num 2338 except TypeError: 2339 mode = 'a' + str(num) 2340 print "mode += 'a' + '%20.20f' %num", mode 2341 #print "", mode 2326 2342 2327 2343 … … 2332 2348 yes = False 2333 2349 return yes 2334 2335 2336 2350 2337 2351 #------------------------------------------------------------- 2338 2352 if __name__ == "__main__": 2339 2353 suite = unittest.makeSuite(meshTestCase,'test') 2340 #suite = unittest.makeSuite(meshTestCase,' test_exportoutlinefile')2354 #suite = unittest.makeSuite(meshTestCase,'mode_string_float_problems') 2341 2355 #suite = unittest.makeSuite(meshTestCase,'test_exportPointsFile') 2342 2356 runner = unittest.TextTestRunner() # verbosity=2)
Note: See TracChangeset
for help on using the changeset viewer.