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

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

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

revision 981 by gross, Tue Feb 13 09:40:12 2007 UTC revision 982 by gross, Mon Feb 19 23:55:52 2007 UTC
# Line 169  class Test_Dump(unittest.TestCase): Line 169  class Test_Dump(unittest.TestCase):
169     #===========================================================================     #===========================================================================
170     def test_DumpAndLoad_Expanded_Solution_Rank0(self):     def test_DumpAndLoad_Expanded_Solution_Rank0(self):
171         file="expanded_solution_rank0.nc"         file="expanded_solution_rank0.nc"
172           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
173           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
174           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
175         d=Data(length(self.solution.getX())*self.arg0,self.solution)         d=Data(length(self.solution.getX())*self.arg0,self.solution)
176         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
177    
178     def test_DumpAndLoad_Expanded_Solution_Rank1(self):     def test_DumpAndLoad_Expanded_Solution_Rank1(self):
179         file="expanded_solution_rank1.nc"         file="expanded_solution_rank1.nc"
180           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
181           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
182           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
183         d=Data(length(self.solution.getX())*self.arg1,self.solution)         d=Data(length(self.solution.getX())*self.arg1,self.solution)
184         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
185    
186     def test_DumpAndLoad_Expanded_Solution_Rank2(self):     def test_DumpAndLoad_Expanded_Solution_Rank2(self):
187         file="expanded_solution_rank2.nc"         file="expanded_solution_rank2.nc"
188           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
189           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
190           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
191         d=Data(length(self.solution.getX())*self.arg2,self.solution)         d=Data(length(self.solution.getX())*self.arg2,self.solution)
192         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
193    
194     def test_DumpAndLoad_Expanded_Solution_Rank3(self):     def test_DumpAndLoad_Expanded_Solution_Rank3(self):
195         file="expanded_solution_rank3.nc"         file="expanded_solution_rank3.nc"
196           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
197           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
198           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
199         d=Data(length(self.solution.getX())*self.arg3,self.solution)         d=Data(length(self.solution.getX())*self.arg3,self.solution)
200         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
201    
202     def test_DumpAndLoad_Expanded_Solution_Rank4(self):     def test_DumpAndLoad_Expanded_Solution_Rank4(self):
203         file="expanded_solution_rank4.nc"         file="expanded_solution_rank4.nc"
204           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
205           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
206           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
207         d=Data(length(self.solution.getX())*self.arg4,self.solution)         d=Data(length(self.solution.getX())*self.arg4,self.solution)
208         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
209     #===========================================================================     #===========================================================================
210     def test_DumpAndLoad_Expanded_ReducedSolution_Rank0(self):     def test_DumpAndLoad_Expanded_ReducedSolution_Rank0(self):
211         file="expanded_reduced_solution_rank0.nc"         file="expanded_reduced_solution_rank0.nc"
212           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
213           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
214           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
215         d=Data(length(self.reduced_solution.getX())*self.arg0,self.reduced_solution)         d=Data(length(self.reduced_solution.getX())*self.arg0,self.reduced_solution)
216         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
217    
218     def test_DumpAndLoad_Expanded_ReducedSolution_Rank1(self):     def test_DumpAndLoad_Expanded_ReducedSolution_Rank1(self):
219         file="expanded_reduced_solution_rank1.nc"         file="expanded_reduced_solution_rank1.nc"
220           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
221           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
222           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
223         d=Data(length(self.reduced_solution.getX())*self.arg1,self.reduced_solution)         d=Data(length(self.reduced_solution.getX())*self.arg1,self.reduced_solution)
224         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
225    
226     def test_DumpAndLoad_Expanded_ReducedSolution_Rank2(self):     def test_DumpAndLoad_Expanded_ReducedSolution_Rank2(self):
227         file="expanded_reduced_solution_rank2.nc"         file="expanded_reduced_solution_rank2.nc"
228           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
229           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
230           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
231         d=Data(length(self.reduced_solution.getX())*self.arg2,self.reduced_solution)         d=Data(length(self.reduced_solution.getX())*self.arg2,self.reduced_solution)
232         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
233    
234     def test_DumpAndLoad_Expanded_ReducedSolution_Rank3(self):     def test_DumpAndLoad_Expanded_ReducedSolution_Rank3(self):
235         file="expanded_reduced_solution_rank3.nc"         file="expanded_reduced_solution_rank3.nc"
236           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
237           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
238           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
239         d=Data(length(self.reduced_solution.getX())*self.arg3,self.reduced_solution)         d=Data(length(self.reduced_solution.getX())*self.arg3,self.reduced_solution)
240         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
241    
242     def test_DumpAndLoad_Expanded_ReducedSolution_Rank4(self):     def test_DumpAndLoad_Expanded_ReducedSolution_Rank4(self):
243         file="expanded_reduced_solution_rank4.nc"         file="expanded_reduced_solution_rank4.nc"
244           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
245           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
246           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
247         d=Data(length(self.reduced_solution.getX())*self.arg4,self.reduced_solution)         d=Data(length(self.reduced_solution.getX())*self.arg4,self.reduced_solution)
248         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
249     #===========================================================================     #===========================================================================
250     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank0(self):     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank0(self):
251         file="expanded_continuous_function_rank0.nc"         file="expanded_continuous_function_rank0.nc"
252           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
253           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
254           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
255         d=Data(length(self.continuous_function.getX())*self.arg0,self.continuous_function)         d=Data(length(self.continuous_function.getX())*self.arg0,self.continuous_function)
256         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
257    
258     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank1(self):     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank1(self):
259         file="expanded_continuous_function_rank1.nc"         file="expanded_continuous_function_rank1.nc"
260           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
261           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
262           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
263         d=Data(length(self.continuous_function.getX())*self.arg1,self.continuous_function)         d=Data(length(self.continuous_function.getX())*self.arg1,self.continuous_function)
264         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
265    
266     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank2(self):     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank2(self):
267         file="expanded_continuous_function_rank2.nc"         file="expanded_continuous_function_rank2.nc"
268           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
269           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
270           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
271         d=Data(length(self.continuous_function.getX())*self.arg2,self.continuous_function)         d=Data(length(self.continuous_function.getX())*self.arg2,self.continuous_function)
272         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
273    
# Line 239  class Test_Dump(unittest.TestCase): Line 278  class Test_Dump(unittest.TestCase):
278    
279     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank4(self):     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank4(self):
280         file="expanded_continuous_function_rank4.nc"         file="expanded_continuous_function_rank4.nc"
281           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
282           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
283           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
284         d=Data(length(self.continuous_function.getX())*self.arg4,self.continuous_function)         d=Data(length(self.continuous_function.getX())*self.arg4,self.continuous_function)
285         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
286    
287     #===========================================================================     #===========================================================================
288     def test_DumpAndLoad_Expanded_Function_Rank0(self):     def test_DumpAndLoad_Expanded_Function_Rank0(self):
289         file="expanded_function_rank0.nc"         file="expanded_function_rank0.nc"
290           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
291           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
292           # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
293         d=Data(length(self.function.getX())*self.arg0,self.function)         d=Data(length(self.function.getX())*self.arg0,self.function)
294         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
295    
296     def test_DumpAndLoad_Expanded_Function_Rank1(self):     def test_DumpAndLoad_Expanded_Function_Rank1(self):
297         file="expanded_function_rank1.nc"         file="expanded_function_rank1.nc"
298           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
299           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
300           # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
301         d=Data(length(self.function.getX())*self.arg1,self.function)         d=Data(length(self.function.getX())*self.arg1,self.function)
302         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
303    
304     def test_DumpAndLoad_Expanded_Function_Rank2(self):     def test_DumpAndLoad_Expanded_Function_Rank2(self):
305         file="expanded_function_rank2.nc"         file="expanded_function_rank2.nc"
306           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
307           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
308           # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
309         d=Data(length(self.function.getX())*self.arg2,self.function)         d=Data(length(self.function.getX())*self.arg2,self.function)
310         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
311    
312     def test_DumpAndLoad_Expanded_Function_Rank3(self):     def test_DumpAndLoad_Expanded_Function_Rank3(self):
313         file="expanded_function_rank3.nc"         file="expanded_function_rank3.nc"
314           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
315           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
316           # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
317         d=Data(length(self.function.getX())*self.arg3,self.function)         d=Data(length(self.function.getX())*self.arg3,self.function)
318         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
319    
320     def test_DumpAndLoad_Expanded_Function_Rank4(self):     def test_DumpAndLoad_Expanded_Function_Rank4(self):
321         file="expanded_function_rank4.nc"         file="expanded_function_rank4.nc"
322           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
323           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
324           # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
325         d=Data(length(self.function.getX())*self.arg4,self.function)         d=Data(length(self.function.getX())*self.arg4,self.function)
326         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
327    
328     #===========================================================================     #===========================================================================
329     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank0(self):     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank0(self):
330         file="expanded_function_on_boundary_rank0.nc"         file="expanded_function_on_boundary_rank0.nc"
331           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
332           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
333           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
334         d=Data(length(self.function_on_boundary.getX())*self.arg0,self.function_on_boundary)         d=Data(length(self.function_on_boundary.getX())*self.arg0,self.function_on_boundary)
335         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
336    
337     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank1(self):     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank1(self):
338         file="expanded_function_on_boundary_rank1.nc"         file="expanded_function_on_boundary_rank1.nc"
339           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
340           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
341           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
342         d=Data(length(self.function_on_boundary.getX())*self.arg1,self.function_on_boundary)         d=Data(length(self.function_on_boundary.getX())*self.arg1,self.function_on_boundary)
343         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
344    
345     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank2(self):     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank2(self):
346         file="expanded_function_on_boundary_rank2.nc"         file="expanded_function_on_boundary_rank2.nc"
347           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
348           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
349           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
350         d=Data(length(self.function_on_boundary.getX())*self.arg2,self.function_on_boundary)         d=Data(length(self.function_on_boundary.getX())*self.arg2,self.function_on_boundary)
351         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
352    
353     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank3(self):     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank3(self):
354         file="expanded_function_on_boundary_rank3.nc"         file="expanded_function_on_boundary_rank3.nc"
355           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
356           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
357           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
358         d=Data(length(self.function_on_boundary.getX())*self.arg3,self.function_on_boundary)         d=Data(length(self.function_on_boundary.getX())*self.arg3,self.function_on_boundary)
359         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
360    
361     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank4(self):     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank4(self):
362         file="expanded_function_on_boundary_rank4.nc"         file="expanded_function_on_boundary_rank4.nc"
363           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
364           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
365           self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
366         d=Data(length(self.function_on_boundary.getX())*self.arg4,self.function_on_boundary)         d=Data(length(self.function_on_boundary.getX())*self.arg4,self.function_on_boundary)
367         self._diffDataObjects(d,file)         self._diffDataObjects(d,file)
368    
# Line 299  class Test_Dump(unittest.TestCase): Line 371  class Test_Dump(unittest.TestCase):
371  class Test_DumpOnFinley(Test_Dump):  class Test_DumpOnFinley(Test_Dump):
372     def setUp(self):     def setUp(self):
373         self.domain =Rectangle(NE,NE+1,2)         self.domain =Rectangle(NE,NE+1,2)
374           self.domain_with_different_number_of_samples =Rectangle(2*NE,NE+1,2)
375           self.domain_with_different_number_of_data_points_per_sample =Rectangle(2*NE,NE+1,2,integrationOrder=2)
376           self.domain_with_different_sample_ordering =Rectangle(1,(NE+1)*NE,2)
377         self.solution = Solution(self.domain)         self.solution = Solution(self.domain)
378         self.reduced_solution = ReducedSolution(self.domain)         self.reduced_solution = ReducedSolution(self.domain)
379         self.continuous_function = ContinuousFunction(self.domain)         self.continuous_function = ContinuousFunction(self.domain)

Legend:
Removed from v.981  
changed lines
  Added in v.982

  ViewVC Help
Powered by ViewVC 1.1.26