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

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

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

revision 2314 by phornby, Sat Oct 18 11:00:08 2008 UTC revision 2315 by gross, Wed Mar 18 00:38:48 2009 UTC
# Line 50  try: Line 50  try:
50  except KeyError:  except KeyError:
51       FINLEY_TEST_DATA='.'       FINLEY_TEST_DATA='.'
52    
53  FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"  FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
54    
55  NE=6 # number of element in each spatial direction (must be even)  NE=8 # number of element in each spatial direction (must be even)
56    
57  class Test_PoissonOnFinley(Test_Poisson):  class Test_PoissonOnFinley(Test_Poisson):
58     RES_TOL=1.e-7     RES_TOL=1.e-7
59     ABS_TOL=1.e-8     ABS_TOL=1.e-8
60     def setUp(self):     def setUp(self):
61          self.domain = Rectangle(NE,NE,2)          self.domain = Rectangle(NE,NE,2,useFullElementOrder=True)
62     def tearDown(self):     def tearDown(self):
63          del self.domain          del self.domain
64    
# Line 67  class Test_AssemblePDEwithFinley_2Do1_Co Line 67  class Test_AssemblePDEwithFinley_2Do1_Co
67     RES_TOL=1.e-7     RES_TOL=1.e-7
68     ABS_TOL=1.e-8     ABS_TOL=1.e-8
69     def setUp(self):     def setUp(self):
70         d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)         # d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
71         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
72         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
73         d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)         # d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
74         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
75         d2.setX(d2.getX()+[0.5,0.])         # d2.setX(d2.getX()+[0.5,0.])
76         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
77           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_2Do1_Contact.fly"))
78     def tearDown(self):     def tearDown(self):
79          del self.domain          del self.domain
80    
# Line 81  class Test_AssemblePDEwithFinley_2Do2_Co Line 82  class Test_AssemblePDEwithFinley_2Do2_Co
82     RES_TOL=1.e-7     RES_TOL=1.e-7
83     ABS_TOL=1.e-8     ABS_TOL=1.e-8
84     def setUp(self):     def setUp(self):
85         d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)         # d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
86         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
87         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
88         d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)         # d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
89         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
90         d2.setX(d2.getX()+[0.5,0.])         # d2.setX(d2.getX()+[0.5,0.])
91         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
92           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_2Do2_Contact.fly"))
93     def tearDown(self):     def tearDown(self):
94          del self.domain          del self.domain
95    
# Line 95  class Test_AssemblePDEwithFinley_3Do1_Co Line 97  class Test_AssemblePDEwithFinley_3Do1_Co
97     RES_TOL=1.e-7     RES_TOL=1.e-7
98     ABS_TOL=1.e-8     ABS_TOL=1.e-8
99     def setUp(self):     def setUp(self):
100         d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)         # d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
101         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
102         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
103         d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)         # d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
104         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
105         d2.setX(d2.getX()+[0.5,0.,0.])         # d2.setX(d2.getX()+[0.5,0.,0.])
106         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
107           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_3Do1_Contact.fly"))
108     def tearDown(self):     def tearDown(self):
109          del self.domain          del self.domain
110    
# Line 109  class Test_AssemblePDEwithFinley_3Do2_Co Line 112  class Test_AssemblePDEwithFinley_3Do2_Co
112     RES_TOL=1.e-7     RES_TOL=1.e-7
113     ABS_TOL=1.e-8     ABS_TOL=1.e-8
114     def setUp(self):     def setUp(self):
115         d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)         # d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
116         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
117         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
118         d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)         # d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
119         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
120         d2.setX(d2.getX()+[0.5,0.,0.])         # d2.setX(d2.getX()+[0.5,0.,0.])
121         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
122           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_3Do2_Contact.fly"))
123     def tearDown(self):     def tearDown(self):
124          del self.domain          del self.domain
125    
# Line 124  class Test_AssemblePDEwithFinley_2Do1_Co Line 128  class Test_AssemblePDEwithFinley_2Do1_Co
128     RES_TOL=1.e-7     RES_TOL=1.e-7
129     ABS_TOL=1.e-8     ABS_TOL=1.e-8
130     def setUp(self):     def setUp(self):
131         d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)         # d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
132         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
133         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
134         d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)         # d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
135         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
136         d2.setX(d2.getX()+[0.5,0.])         # d2.setX(d2.getX()+[0.5,0.])
137         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
138           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_2Do1_Contact_withElementsOnFace.fly"))
139     def tearDown(self):     def tearDown(self):
140          del self.domain          del self.domain
141    
# Line 138  class Test_AssemblePDEwithFinley_2Do2_Co Line 143  class Test_AssemblePDEwithFinley_2Do2_Co
143     RES_TOL=1.e-7     RES_TOL=1.e-7
144     ABS_TOL=1.e-8     ABS_TOL=1.e-8
145     def setUp(self):     def setUp(self):
146         d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)         # d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
147         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
148         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
149         d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)         # d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
150         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
151         d2.setX(d2.getX()+[0.5,0.])         # d2.setX(d2.getX()+[0.5,0.])
152         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
153           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_2Do2_Contact_withElementsOnFace.fly"))
154     def tearDown(self):     def tearDown(self):
155          del self.domain          del self.domain
156    
# Line 152  class Test_AssemblePDEwithFinley_3Do1_Co Line 158  class Test_AssemblePDEwithFinley_3Do1_Co
158     RES_TOL=1.e-7     RES_TOL=1.e-7
159     ABS_TOL=1.e-8     ABS_TOL=1.e-8
160     def setUp(self):     def setUp(self):
161         d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)         # d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
162         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
163         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
164         d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)         # d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
165         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
166         d2.setX(d2.getX()+[0.5,0.,0.])         # d2.setX(d2.getX()+[0.5,0.,0.])
167         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
168           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_3Do1_Contact_withElementsOnFace.fly"))
169     def tearDown(self):     def tearDown(self):
170          del self.domain          del self.domain
171    
# Line 166  class Test_AssemblePDEwithFinley_3Do2_Co Line 173  class Test_AssemblePDEwithFinley_3Do2_Co
173     RES_TOL=1.e-7     RES_TOL=1.e-7
174     ABS_TOL=1.e-8     ABS_TOL=1.e-8
175     def setUp(self):     def setUp(self):
176         d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)         # d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
177         x1 = ContinuousFunction(d1).getX()         # x1 = ContinuousFunction(d1).getX()
178         ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))         # ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
179         d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)         # d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
180         ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))         # ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
181         d2.setX(d2.getX()+[0.5,0.,0.])         # d2.setX(d2.getX()+[0.5,0.,0.])
182         self.domain = JoinFaces([d1,d2],optimize=False)         # self.domain = JoinFaces([d1,d2],optimize=False)
183           self.domain=ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"mesh_3Do2_Contact_withElementsOnFace.fly"))
184     def tearDown(self):     def tearDown(self):
185          del self.domain          del self.domain
186    
187  if __name__ == '__main__':  if __name__ == '__main__':
188     suite = unittest.TestSuite()     suite = unittest.TestSuite()
189     if True :     if True :
190        # These tests use JoinFaces and are not MPI parallel        suite.addTest(unittest.makeSuite(Test_PoissonOnFinley))
191        if getMPISizeWorld() == 1:        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact))
192          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact))
193          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact))
194          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact))
195          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace))
196          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace))
197          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace))
198          suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace))        suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace))
         suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace))  
   
199     else:     else:
200        pass        pass
201    

Legend:
Removed from v.2314  
changed lines
  Added in v.2315

  ViewVC Help
Powered by ViewVC 1.1.26