/[escript]/branches/symbolic_from_3470/dudley/test/python/run_escriptOnDudley.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/dudley/test/python/run_escriptOnDudley.py

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

revision 2628 by jfenwick, Tue Aug 25 03:50:00 2009 UTC revision 2644 by jfenwick, Wed Sep 2 04:14:03 2009 UTC
# Line 26  from esys.escript import * Line 26  from esys.escript import *
26  from esys.finley import Rectangle  from esys.finley import Rectangle
27  import sys  import sys
28  import os  import os
29  from test_objects import Test_Dump, Test_SetDataPointValue  from test_objects import Test_Dump, Test_SetDataPointValue, Test_saveCSV
30  from test_objects import Test_Domain  from test_objects import Test_Domain
31    
32  from test_shared import Test_Shared  from test_shared import Test_Shared
# Line 168  class Test_TableInterpolation(unittest.T Line 168  class Test_TableInterpolation(unittest.T
168      zz=x0.interpolateTable(arr,0,1,100,x1,0,1)      zz=x0.interpolateTable(arr,0,1,100,x1,0,1)
169            
170                    
171            
172    class Test_CSVOnFinley(Test_saveCSV):
173       def setUp(self):
174           self.domain =Rectangle(NE,NE+1,2)
175           self.linecount1=20       #see test_save1 for the meaning of these params
176           self.linecount2=69
177          
178       def tearDown(self):
179           del self.domain
180          
181       #This test checks to see that all FunctionSpaces can be saved
182       def test_singleFS(self):
183        fname="test_singlefs.csv"
184        fss=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),
185        FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain),
186        FunctionOnContactZero(self.domain), FunctionOnContactOne(self.domain),
187        ReducedFunctionOnContactZero(self.domain), ReducedFunctionOnContactOne(self.domain)]
188        for f in fss:
189            d=Data(7,f)
190            print "Testing "+str(f)+"\n"
191            saveDataCSV(fname, D=d)
192    
193       def test_multiFS(self):
194        fname="test_multifs.csv"
195        sol=Data(8,Solution(self.domain))
196        ctsfn=Data(9,ContinuousFunction(self.domain))
197        #test line 0
198        dirac=Data(-1,DiracDeltaFunction(self.domain))
199        saveDataCSV(fname, A=sol, B=ctsfn, C=dirac)
200        #test line 1
201        fun=Data(5,Function(self.domain))
202        rfun=Data(3,ReducedFunction(self.domain))
203        saveDataCSV(fname, A=sol,B=ctsfn,C=fun, D=rfun)
204        #test line 2
205        bound=Data(1,FunctionOnBoundary(self.domain))
206        rbound=Data(3,ReducedFunctionOnBoundary(self.domain))
207        saveDataCSV(fname,A=sol,B=ctsfn,C=bound, D=rbound)
208        #test line 3
209        conzz=Data(7,FunctionOnContactZero(self.domain))
210        rconz=Data(8,ReducedFunctionOnContactZero(self.domain))
211        saveDataCSV(fname,A=sol,B=ctsfn, C=conzz, D=rconz)
212        #check for cross line exceptions
213        self.failUnlessRaises(RuntimeError, saveDataCSV, fname, A=dirac, B=rfun)
214        self.failUnlessRaises(RuntimeError, saveDataCSV, fname, A=bound, B=conzz)
215    
216        
217  if __name__ == '__main__':  if __name__ == '__main__':
218     suite = unittest.TestSuite()     suite = unittest.TestSuite()
219     suite.addTest(unittest.makeSuite(Test_SharedOnFinley))     suite.addTest(unittest.makeSuite(Test_SharedOnFinley))
220     suite.addTest(unittest.makeSuite(Test_DataOpsOnFinley))     suite.addTest(unittest.makeSuite(Test_DataOpsOnFinley))
221     suite.addTest(unittest.makeSuite(Test_DomainOnFinley))     suite.addTest(unittest.makeSuite(Test_DomainOnFinley))
222     suite.addTest(unittest.makeSuite(Test_TableInterpolation))     suite.addTest(unittest.makeSuite(Test_TableInterpolation))
223       suite.addTest(unittest.makeSuite(Test_CSVOnFinley))
224     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
225     if not s.wasSuccessful(): sys.exit(1)     if not s.wasSuccessful(): sys.exit(1)
226    

Legend:
Removed from v.2628  
changed lines
  Added in v.2644

  ViewVC Help
Powered by ViewVC 1.1.26