/[escript]/trunk/finley/test/python/run_visualization_interface.py
ViewVC logotype

Diff of /trunk/finley/test/python/run_visualization_interface.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2255 by ksteube, Thu Oct 9 05:35:24 2008 UTC revision 2256 by jfenwick, Mon Feb 9 06:20:32 2009 UTC
# Line 70  class Test_VisualizationInterface(unitte Line 70  class Test_VisualizationInterface(unitte
70       return True       return True
71    
72     # Compare two elements (stored as space-separated strings of integers) after mapping node labels     # Compare two elements (stored as space-separated strings of integers) after mapping node labels
73     def elementCompareWithMap(self, e1, e2, map):     def elementCompareWithMap(self, e1, e2, mappy):
74       if e2 == None: return False       if e2 == None: return False
75       vector1 = e1.split()       vector1 = e1.split()
76       vector2 = e2.split()       vector2 = e2.split()
77       if len(vector1) != len(vector2): return False       if len(vector1) != len(vector2): return False
78       for i in range(0, len(vector1)):       for i in range(0, len(vector1)):
79         if int(vector1[i]) < 0: return False         if int(vector1[i]) < 0: return False
80         if int(vector1[i]) >= len(map): return False         if int(vector1[i]) >= len(mappy): return False
81         if map[int(vector1[i])] != int(vector2[i]): return False         if mappy[int(vector1[i])] != int(vector2[i]): return False
82       return True       return True
83    
84     def compareDataSetWithMap(self, d1, d2, map):     def compareDataSetWithMap(self, d1, d2, mappy):
85       if len(d1) != len(d2): return False       if len(d1) != len(d2): return False
86       for i in range(0, len(d1)):       for i in range(0, len(d1)):
87         if map[i] < 0: return False         if mappy[i] < 0: return False
88         if map[i] >= len(d1): return False         if mappy[i] >= len(d1): return False
89         if not self.numericCompareL2(d1[i], d2[map[i]]): return False         if not self.numericCompareL2(d1[i], d2[mappy[i]]): return False
90       return True       return True
91    
92     # Compare two VTK files which were generated by Finley method saveVTK     # Compare two VTK files which were generated by Finley method saveVTK
# Line 152  class Test_VisualizationInterface(unitte Line 152  class Test_VisualizationInterface(unitte
152       for i in range(0, len(nodeList1)):       for i in range(0, len(nodeList1)):
153         nodeMap1to2.append(-1)         nodeMap1to2.append(-1)
154       for i in range(0, len(nodeList1)):       for i in range(0, len(nodeList1)):
155         str = nodeList1[i]         resstr = nodeList1[i]
156         for j in range(len(nodeList2)-1, -1, -1):         for j in range(len(nodeList2)-1, -1, -1):
157           if self.numericCompareL2(str, nodeList2[j]):           if self.numericCompareL2(resstr, nodeList2[j]):
158             nodeMap1to2[i] = j             nodeMap1to2[i] = j
159             nodeList2[j] = None             nodeList2[j] = None
160             break             break
# Line 181  class Test_VisualizationInterface(unitte Line 181  class Test_VisualizationInterface(unitte
181       for i in range(0, len(elementList1)):       for i in range(0, len(elementList1)):
182         elementMap1to2.append(-1)         elementMap1to2.append(-1)
183       for i in range(0, len(elementList1)):       for i in range(0, len(elementList1)):
184         str = elementList1[i]         resstr = elementList1[i]
185         for j in range(len(elementList2)-1, -1, -1):         for j in range(len(elementList2)-1, -1, -1):
186           if self.elementCompareWithMap(str, elementList2[j], nodeMap1to2):           if self.elementCompareWithMap(resstr, elementList2[j], nodeMap1to2):
187             elementMap1to2[i] = j             elementMap1to2[i] = j
188             elementList2[j] = None             elementList2[j] = None
189             break             break

Legend:
Removed from v.2255  
changed lines
  Added in v.2256

  ViewVC Help
Powered by ViewVC 1.1.26