/[escript]/branches/intelc_win32/finley/test/python/run_generators.py
ViewVC logotype

Contents of /branches/intelc_win32/finley/test/python/run_generators.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 742 - (show annotations)
Sat Jun 24 11:27:16 2006 UTC (16 years, 1 month ago) by woo409
File MIME type: text/x-python
File size: 5824 byte(s)
+ Initial commit of win32 port using intel c++ compiler 9.1.x for Windows
+ This version is failing some file handling tests in python
1 # $Id$
2
3
4 """
5 checks the mesh generators against the reference meshes in test_meshes
6 """
7
8 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
9 http://www.access.edu.au
10 Primary Business: Queensland, Australia"""
11 __license__="""Licensed under the Open Software License version 3.0
12 http://www.opensource.org/licenses/osl-3.0.php"""
13
14 import sys
15 import os
16 import unittest
17 from esys.escript import *
18 from esys.finley import Interval,Rectangle,Brick,JoinFaces
19
20 FINLEY_TEST_DATA_PATH=os.environ['FINLEY_TEST_DATA']+"/data_meshes/"
21 #ifdef _WIN32
22 FINLEY_TEST_DATA_PATH = FINLEY_TEST_DATA_PATH+"win32/"
23 #endif
24 FINLEY_WORKDIR_PATH=os.environ['FINLEY_WORKDIR']+"/"
25
26 TEST_FILE_EXT=".test"
27 class Test_Generators(unittest.TestCase):
28
29 def checker(self,dom,reference):
30 dom_file=FINLEY_WORKDIR_PATH+TEST_FILE_EXT
31 dom.write(dom_file)
32 dom_string=open(dom_file).read().splitlines()
33 ref_string=open(FINLEY_TEST_DATA_PATH+reference).read().splitlines()
34 self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")
35 for l in range(1,len(ref_string)):
36 self.failUnlessEqual(dom_string[l].strip(),ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),dom_string[l].strip()))
37
38 def test_hex_1D_order1(self):
39 file="hex_1D_order1.msh"
40 my_dom=Interval(1,1)
41 self.checker(my_dom,file)
42
43 def test_hex_1D_order1_onFace(self):
44 file="hex_1D_order1_onFace.msh"
45 my_dom=Interval(1,1,useElementsOnFace=1)
46 self.checker(my_dom,file)
47
48 # def test_hex_1D_order2(self):
49 # file="hex_1D_order2.msh"
50 # my_dom=Interval(1,2)
51 # self.checker(my_dom,file)
52 #
53 # def test_hex_1D_order2_onFace(self):
54 # file="hex_1D_order2_onFace.msh"
55 # my_dom=Interval(1,2,useElementsOnFace=1)
56 # self.checker(my_dom,file)
57 #
58 # def test_hex_2D_order1(self):
59 # file="hex_2D_order1.msh"
60 # my_dom=Rectangle(1,1,1)
61 # self.checker(my_dom,file)
62 #
63 # def test_hex_2D_order1_onFace(self):
64 # file="hex_2D_order1_onFace.msh"
65 # my_dom=Rectangle(1,1,1,useElementsOnFace=1)
66 # self.checker(my_dom,file)
67 #
68 # def test_hex_2D_order2(self):
69 # file="hex_2D_order2.msh"
70 # my_dom=Rectangle(1,1,2)
71 # self.checker(my_dom,file)
72 #
73 # def test_hex_2D_order2_onFace(self):
74 # file="hex_2D_order2_onFace.msh"
75 # my_dom=Rectangle(1,1,2,useElementsOnFace=1)
76 # self.checker(my_dom,file)
77 #
78 # def test_hex_3D_order1(self):
79 # file="hex_3D_order1.msh"
80 # my_dom=Brick(1,1,1,1)
81 # self.checker(my_dom,file)
82 #
83 # def test_hex_3D_order1_onFace(self):
84 # file="hex_3D_order1_onFace.msh"
85 # my_dom=Brick(1,1,1,1,useElementsOnFace=1)
86 # self.checker(my_dom,file)
87 #
88 # def test_hex_3D_order2(self):
89 # file="hex_3D_order2.msh"
90 # my_dom=Brick(1,1,1,2)
91 # self.checker(my_dom,file)
92 #
93 # def test_hex_3D_order2_onFace(self):
94 # file="hex_3D_order2_onFace.msh"
95 # my_dom=Brick(1,1,1,2,useElementsOnFace=1)
96 # self.checker(my_dom,file)
97 #
98 # def test_hex_contact_2D_order1(self):
99 # file="hex_contact_2D_order1.msh"
100 # ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)
101 # ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)
102 # ms2.setX(ms2.getX()+[0,0.5])
103 # my_dom=JoinFaces([ms1,ms2])
104 # self.checker(my_dom,file)
105 #
106 # def test_hex_contact_2D_order1_onFace(self):
107 # file="hex_contact_2D_order1_onFace.msh"
108 # ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)
109 # ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)
110 # ms2.setX(ms2.getX()+[0,0.5])
111 # my_dom=JoinFaces([ms1,ms2])
112 # self.checker(my_dom,file)
113 #
114 # def test_hex_contact_2D_order2(self):
115 # file="hex_contact_2D_order2.msh"
116 # ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)
117 # ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)
118 # ms2.setX(ms2.getX()+[0,0.5])
119 # my_dom=JoinFaces([ms1,ms2])
120 # self.checker(my_dom,file)
121 #
122 # def test_hex_contact_2D_order2_onFace(self):
123 # file="hex_contact_2D_order2_onFace.msh"
124 # ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)
125 # ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)
126 # ms2.setX(ms2.getX()+[0,0.5])
127 # my_dom=JoinFaces([ms1,ms2])
128 # self.checker(my_dom,file)
129 #
130 # def test_hex_contact_3D_order1(self):
131 # file="hex_contact_3D_order1.msh"
132 # ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)
133 # ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)
134 # ms2.setX(ms2.getX()+[0,0,0.5])
135 # my_dom=JoinFaces([ms1,ms2])
136 # self.checker(my_dom,file)
137 #
138 # def test_hex_contact_3D_order1_onFace(self):
139 # file="hex_contact_3D_order1_onFace.msh"
140 # ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)
141 # ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)
142 # ms2.setX(ms2.getX()+[0,0,0.5])
143 # my_dom=JoinFaces([ms1,ms2])
144 # self.checker(my_dom,file)
145 #
146 # def test_hex_contact_3D_order2(self):
147 # file="hex_contact_3D_order2.msh"
148 # ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)
149 # ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)
150 # ms2.setX(ms2.getX()+[0,0,0.5])
151 # my_dom=JoinFaces([ms1,ms2])
152 # self.checker(my_dom,file)
153 #
154 # def test_hex_contact_3D_order2_onFace(self):
155 # file="hex_contact_3D_order2_onFace.msh"
156 # ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)
157 # ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)
158 # ms2.setX(ms2.getX()+[0,0,0.5])
159 # my_dom=JoinFaces([ms1,ms2])
160 # self.checker(my_dom,file)
161
162 if __name__ == '__main__':
163 suite = unittest.TestSuite()
164 suite.addTest(unittest.makeSuite(Test_Generators))
165 s=unittest.TextTestRunner(verbosity=2).run(suite)
166 if s.wasSuccessful():
167 sys.exit(0)
168 else:
169 sys.exit(1)

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26