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

Diff of /trunk/dudley/test/python/run_escriptOnDudley.py

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

revision 3891 by caltinay, Wed Feb 1 06:16:25 2012 UTC revision 3892 by jfenwick, Tue Apr 10 08:57:23 2012 UTC
# Line 40  NE=4 # number elements, must be even Line 40  NE=4 # number elements, must be even
40    
41  class Test_SharedOnDudley(Test_Shared):  class Test_SharedOnDudley(Test_Shared):
42    def setUp(self):    def setUp(self):
43      self.domain=Rectangle(NE,NE)          self.domain=Rectangle(NE,NE)
44      self.tol=0.001          self.tol=0.001
45    def tearDown(self):    def tearDown(self):
46      del self.domain          del self.domain
47      del self.tol          del self.tol
48    
49  class Test_DomainOnDudley(Test_Domain):  class Test_DomainOnDudley(Test_Domain):
50     def setUp(self):     def setUp(self):
# Line 105  class Test_DataOpsOnDudley(Test_Dump, Te Line 105  class Test_DataOpsOnDudley(Test_Dump, Te
105    
106  class Test_TableInterpolationOnDudley(Test_TableInterpolation):  class Test_TableInterpolationOnDudley(Test_TableInterpolation):
107      def setUp(self):      def setUp(self):
108      self.domain=Brick(4,4,4)          self.domain=Brick(4,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)]
111          #We aren't testing DiracDeltaFunctions              #We aren't testing DiracDeltaFunctions
112      self.xn=5   # number of grids on x axis          self.xn=5       # number of grids on x axis
113      self.yn=5   # number of grids on y axis          self.yn=5       # number of grids on y axis
114      self.zn=5          self.zn=5
115    
116      def tearDown(self):      def tearDown(self):
117      del self.domain          del self.domain
118      del self.functionspaces          del self.functionspaces
119    
120                
121                            
122                            
123  class Test_CSVOnDudley(Test_saveCSV):  class Test_CSVOnDudley(Test_saveCSV):
124     def setUp(self):     def setUp(self):
125         self.domain =Rectangle(NE,NE+1)         self.domain =Rectangle(NE,NE+1)
126         self.linecount1=31       #see test_save1 for the meaning of these params         self.linecount1=31               #see test_save1 for the meaning of these params
127         self.linecount2=25         self.linecount2=25
128         self.line_expected=[0.25, 0., 0.25]         self.line_expected=[0.25, 0., 0.25]
129                
# Line 132  class Test_CSVOnDudley(Test_saveCSV): Line 132  class Test_CSVOnDudley(Test_saveCSV):
132                
133     #This test checks to see that all FunctionSpaces can be saved     #This test checks to see that all FunctionSpaces can be saved
134     def test_singleFS(self):     def test_singleFS(self):
135      fname=os.path.join(DUDLEY_WORKDIR, "test_singlefs.csv")          fname=os.path.join(DUDLEY_WORKDIR, "test_singlefs.csv")
136      fss=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),          fss=[ContinuousFunction(self.domain), Function(self.domain), ReducedFunction(self.domain),
137      FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain),          FunctionOnBoundary(self.domain), ReducedFunctionOnBoundary(self.domain),
138      DiracDeltaFunctions(self.domain)]          DiracDeltaFunctions(self.domain)]
139      for f in fss:          for f in fss:
140          d=Data(7,f)                  d=Data(7,f)
141          print("Testing "+str(f)+"\n")                  print("Testing "+str(f)+"\n")
142          saveDataCSV(fname, D=d)                  saveDataCSV(fname, D=d)
143    
144     def test_multiFS(self):     def test_multiFS(self):
145      fname=os.path.join(DUDLEY_WORKDIR, "test_multifs.csv")          fname=os.path.join(DUDLEY_WORKDIR, "test_multifs.csv")
146      sol=Data(8,Solution(self.domain))          sol=Data(8,Solution(self.domain))
147      ctsfn=Data(9,ContinuousFunction(self.domain))          ctsfn=Data(9,ContinuousFunction(self.domain))
148      #test line 0          #test line 0
149      dirac=Data(-1,DiracDeltaFunctions(self.domain))          dirac=Data(-1,DiracDeltaFunctions(self.domain))
150      saveDataCSV(fname, A=sol, B=ctsfn, C=dirac)          saveDataCSV(fname, A=sol, B=ctsfn, C=dirac)
151      #test line 1          #test line 1
152      fun=Data(5,Function(self.domain))          fun=Data(5,Function(self.domain))
153      rfun=Data(3,ReducedFunction(self.domain))          rfun=Data(3,ReducedFunction(self.domain))
154      saveDataCSV(fname, A=sol,B=ctsfn,C=fun, D=rfun)          saveDataCSV(fname, A=sol,B=ctsfn,C=fun, D=rfun)
155      #test line 2          #test line 2
156      bound=Data(1,FunctionOnBoundary(self.domain))          bound=Data(1,FunctionOnBoundary(self.domain))
157      rbound=Data(3,ReducedFunctionOnBoundary(self.domain))          rbound=Data(3,ReducedFunctionOnBoundary(self.domain))
158      saveDataCSV(fname,A=sol,B=ctsfn,C=bound, D=rbound)          saveDataCSV(fname,A=sol,B=ctsfn,C=bound, D=rbound)
159    
160                
161  if __name__ == '__main__':  if __name__ == '__main__':
162     suite = unittest.TestSuite()     suite = unittest.TestSuite()
163     suite.addTest(unittest.makeSuite(Test_SharedOnDudley))     suite.addTest(unittest.makeSuite(Test_SharedOnDudley))

Legend:
Removed from v.3891  
changed lines
  Added in v.3892

  ViewVC Help
Powered by ViewVC 1.1.26