Changeset 406
- Timestamp:
- Oct 15, 2004, 9:54:37 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/meshHarness.py
r369 r406 620 620 #print "****************** fileName", fileName 621 621 m.exportASCIItrianglulationfile(fileName) 622 print "******************"623 print "m", m624 print "******************"622 #print "******************" 623 #print "m", m 624 #print "******************" 625 625 m_returned = importMeshFromFile(fileName) 626 print "m_returned",m_returned627 print "******************"626 #print "m_returned",m_returned 627 #print "******************" 628 628 #print "****************** fileName", fileName 629 629 os.remove(fileName) … … 838 838 # self.failUnless(userVert.y == inputVert.y, 839 839 # 'y duplicate verts not removed') 840 841 842 def test_removeDuplicatedVertices(self): 843 844 fileName = tempfile.mktemp(".txt") 845 file = open(fileName,"w") 846 file.write(" 1 ?? ??\n\ 847 0.0 0.0\n\ 848 1.0 0.0\n\ 849 1.0 1.0\n\ 850 0.0 1.0\n\ 851 0.0 0.0\n\ 852 END\n\ 853 2 ?? ??\n\ 854 10.0 10.0\n\ 855 10.0 20.0\n\ 856 20.0 20.0\n\ 857 10.0 10.0\n\ 858 END\n\ 859 END\n") 860 file.close() 861 862 863 a = Vertex (0.0, 0.0) #, attributes = [1.1]) 864 b = Vertex (0.0, 40.0) #, attributes = [1.2]) 865 c = Vertex (40.0,40.0) #, attributes = [1.3]) 866 d = Vertex (40.0,0.0) #, attributes = [1.4]) 867 868 s1 = Segment(a,b) 869 s2 = Segment(b,c) 870 s3 = Segment(c,d) 871 s4 = Segment(d,a) 872 873 m = Mesh(userVertices=[a,b,c,d], userSegments=[s1,s2,s3,s4]) 874 dict = importUngenerateFile(fileName) 875 m.addVertsSegs(dict) 876 877 self.failUnless(len(m.userSegments) ==11, 878 'Segments not deleted.') 879 self.failUnless(len(m.userVertices) == 11, 880 'Vertex deleted, instead of segment.') 881 self.failUnless(m.userSegments[10].vertices[0] == m.userVertices[10], 882 'Vertex deleted, instead of segment.') 883 self.failUnless(m.userSegments[10].vertices[1] == m.userVertices[8], 884 'Vertex deleted, instead of segment.') 840 885 841 886 #------------------------------------------------------------- 842 887 if __name__ == "__main__": 843 suite = unittest.makeSuite(meshTestCase,'tes zt')888 suite = unittest.makeSuite(meshTestCase,'test') 844 889 runner = unittest.TextTestRunner() 845 890 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.