/[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

branches/domexper/dudley/test/python/run_escriptOnDudley.py revision 3087 by jfenwick, Fri Aug 6 05:25:59 2010 UTC trunk/dudley/test/python/run_escriptOnDudley.py revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 82  class Test_DomainOnDudley(Test_Domain): Line 82  class Test_DomainOnDudley(Test_Domain):
82         # For an MPI-distributed domain some tags may be missing         # For an MPI-distributed domain some tags may be missing
83         if getMPISizeWorld() == 1: self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")         if getMPISizeWorld() == 1: self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")
84         for i in tags: self.failUnless(i in ref_tags,"tag %s is missing."%i)         for i in tags: self.failUnless(i in ref_tags,"tag %s is missing."%i)
    def test_tagsFunctionOnContactOne(self):  
        ref_tags=[]  
        tags=FunctionOnContactOne(self.domain).getListOfTags()  
        self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")  
        for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)  
    def test_tagsFunctionOnContactZero(self):  
        ref_tags=[]  
        tags=FunctionOnContactZero(self.domain).getListOfTags()  
        self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")  
        for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)  
    def test_tagsReducedFunctionOnContactOne(self):  
        ref_tags=[]  
        tags=ReducedFunctionOnContactOne(self.domain).getListOfTags()  
        self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")  
        for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)  
    def test_tagsReducedFunctionOnContactZero(self):  
        ref_tags=[]  
        tags=ReducedFunctionOnContactZero(self.domain).getListOfTags()  
        self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")  
        for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)  
85    
86  class Test_DataOpsOnDudley(Test_Dump, Test_SetDataPointValue, Test_GlobalMinMax, Test_Lazy):  class Test_DataOpsOnDudley(Test_Dump, Test_SetDataPointValue, Test_GlobalMinMax, Test_Lazy):
87     def setUp(self):     def setUp(self):
# Line 127  class Test_TableInterpolationOnDudley(Te Line 107  class Test_TableInterpolationOnDudley(Te
107      def setUp(self):      def setUp(self):
108      self.domain=Rectangle(4,4)      self.domain=Rectangle(4,4)
109      self.functionspaces=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),      self.functionspaces=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),
110          FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain),          FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain)]
         FunctionOnContactZero(self.domain), FunctionOnContactOne(self.domain),  
         ReducedFunctionOnContactZero(self.domain), ReducedFunctionOnContactOne(self.domain)]  
111          #We aren't testing DiracDeltaFunction          #We aren't testing DiracDeltaFunction
112      self.xn=3   # number of grids on x axis      self.xn=3   # number of grids on x axis
113      self.yn=3   # number of grids on y axis      self.yn=3   # number of grids on y axis
# Line 143  class Test_TableInterpolationOnDudley(Te Line 121  class Test_TableInterpolationOnDudley(Te
121                    
122  class Test_CSVOnDudley(Test_saveCSV):  class Test_CSVOnDudley(Test_saveCSV):
123     def setUp(self):     def setUp(self):
124         self.domain =Rectangle(NE,NE+1,2)         self.domain =Rectangle(NE,NE+1)
125         self.linecount1=20       #see test_save1 for the meaning of these params         self.linecount1=31       #see test_save1 for the meaning of these params
126         self.linecount2=69         self.linecount2=25
127           self.line_expected=[0.25, 0., 0.25]
128                
129     def tearDown(self):     def tearDown(self):
130         del self.domain         del self.domain
# Line 155  class Test_CSVOnDudley(Test_saveCSV): Line 134  class Test_CSVOnDudley(Test_saveCSV):
134      fname="test_singlefs.csv"      fname="test_singlefs.csv"
135      fss=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),      fss=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),
136      FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain),      FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain),
     FunctionOnContactZero(self.domain), FunctionOnContactOne(self.domain),  
     ReducedFunctionOnContactZero(self.domain), ReducedFunctionOnContactOne(self.domain),  
137      DiracDeltaFunction(self.domain)]      DiracDeltaFunction(self.domain)]
138      for f in fss:      for f in fss:
139          d=Data(7,f)          d=Data(7,f)
# Line 178  class Test_CSVOnDudley(Test_saveCSV): Line 155  class Test_CSVOnDudley(Test_saveCSV):
155      bound=Data(1,FunctionOnBoundary(self.domain))      bound=Data(1,FunctionOnBoundary(self.domain))
156      rbound=Data(3,ReducedFunctionOnBoundary(self.domain))      rbound=Data(3,ReducedFunctionOnBoundary(self.domain))
157      saveDataCSV(fname,A=sol,B=ctsfn,C=bound, D=rbound)      saveDataCSV(fname,A=sol,B=ctsfn,C=bound, D=rbound)
     #test line 3  
     conzz=Data(7,FunctionOnContactZero(self.domain))  
     rconz=Data(8,ReducedFunctionOnContactZero(self.domain))  
     saveDataCSV(fname,A=sol,B=ctsfn, C=conzz, D=rconz)  
     #check for cross line exceptions  
     self.failUnlessRaises(RuntimeError, saveDataCSV, fname, A=dirac, B=rfun)  
     self.failUnlessRaises(RuntimeError, saveDataCSV, fname, A=bound, B=conzz)  
158    
159            
160  if __name__ == '__main__':  if __name__ == '__main__':
161     suite = unittest.TestSuite()     suite = unittest.TestSuite()
162     suite.addTest(unittest.makeSuite(Test_SharedOnDudley))     #suite.addTest(unittest.makeSuite(Test_SharedOnDudley))
163     suite.addTest(unittest.makeSuite(Test_DataOpsOnDudley))     #suite.addTest(unittest.makeSuite(Test_DataOpsOnDudley))
164     suite.addTest(unittest.makeSuite(Test_DomainOnDudley))     #suite.addTest(unittest.makeSuite(Test_DomainOnDudley))
165     suite.addTest(unittest.makeSuite(Test_TableInterpolationOnDudley))     #suite.addTest(unittest.makeSuite(Test_TableInterpolationOnDudley))
166     suite.addTest(unittest.makeSuite(Test_CSVOnDudley))     suite.addTest(unittest.makeSuite(Test_CSVOnDudley))
167     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
168     if not s.wasSuccessful(): sys.exit(1)     if not s.wasSuccessful(): sys.exit(1)

Legend:
Removed from v.3087  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26