/[escript]/trunk/escript/test/python/test_objects.py
ViewVC logotype

Contents of /trunk/escript/test/python/test_objects.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1063 - (show annotations)
Mon Mar 26 08:29:18 2007 UTC (12 years, 4 months ago) by gross
File MIME type: text/x-python
File size: 67200 byte(s)
test for creation of reduced function spaces added.
tests for dumping data on reduced function spaces added.
This showed a small bug with compilation setting for compilation with netCDF which is fixed


1 # $Id:$
2 """
3 Test suite for data objects. at the moment for dump and load only.
4
5 The tests must be linked with some function space class object in the setUp method:
6 to run the use:
7
8 from esys.finley import Brick
9 class Test_DumpOnFinley(Test_Dump):
10 def setUp(self):
11 self.domain =Rectangle(NE,NE+1,2)
12 self.domain_with_different_number_of_samples =Rectangle(2*NE,NE+1,2)
13 self.domain_with_different_number_of_data_points_per_sample =Rectangle(2*NE,NE+1,2,integrationOrder=2)
14 self.domain_with_different_sample_ordering =Rectangle(1,(NE+1)*NE,2)
15 self.filebase="."
16
17 suite = unittest.TestSuite()
18 suite.addTest(unittest.makeSuite(Test_DumpOnFinley))
19 unittest.TextTestRunner(verbosity=2).run(suite)
20
21 @var __author__: name of author
22 @var __copyright__: copyrights
23 @var __license__: licence agreement
24 @var __url__: url entry point on documentation
25 @var __version__: version
26 @var __date__: date of the version
27 """
28
29 __author__="Lutz Gross, l.gross@uq.edu.au"
30 __copyright__=""" Copyright (c) 2006, 2007 by ACcESS MNRF
31 http://www.access.edu.au
32 Primary Business: Queensland, Australia"""
33 __license__="""Licensed under the Open Software License version 3.0
34 http://www.opensource.org/licenses/osl-3.0.php"""
35 __url__="http://www.iservo.edu.au/esys/escript"
36 __version__="$Revision:$"
37 __date__="$Date:$"
38
39 import unittest
40 import os
41 import numarray
42 from esys.escript import *
43
44 class Test_Domain(unittest.TestCase):
45 def test_addTags(self):
46 tag1="A"
47 tag2="B"
48 tag3="C"
49 self.domain.setTagMap(tag1,1)
50 self.failUnless(self.domain.isValidTagName(tag1))
51 self.failUnless(not self.domain.isValidTagName(tag2))
52 self.domain.setTagMap(tag2,2)
53 self.failUnless(self.domain.isValidTagName(tag1))
54 self.failUnless(self.domain.isValidTagName(tag2))
55 self.failUnless(not self.domain.isValidTagName(tag3))
56 self.failUnless(self.domain.getTag(tag1)==1)
57 self.failUnless(self.domain.getTag(tag2)==2)
58 self.failUnlessRaises(RuntimeError,self.domain.getTag,tag3)
59
60 # set tag:
61 s=Scalar(0,Function(self.domain))
62 r=Scalar(0,Function(self.domain))
63 s.setTaggedValue(tag1,1.)
64 r.setTaggedValue(1,1.)
65 s.setTaggedValue(tag2,2.)
66 r.setTaggedValue(2,2.)
67 s.setTaggedValue(tag3,3.)
68 self.failUnless(Lsup(s-r)<=0.)
69 # get tag:
70 names=getTagNames(self.domain)
71 self.failUnless(len(names) == 2)
72 self.failUnless( tag1 in names )
73 self.failUnless( tag2 in names )
74 self.failUnless(self.domain.isValidTagName(tag1))
75 self.failUnless(self.domain.isValidTagName(tag2))
76 # insert tag shortcut:
77 s2=insertTaggedValues(Scalar(0,Function(self.domain)),**{ tag1 : 1., tag2 : 2.})
78 self.failUnless(Lsup(s2-r)<=0.)
79 def test_functionspace_ContinuousFunction(self):
80 fs=ContinuousFunction(self.domain)
81 self.failUnless(fs.getDomain()==self.domain)
82 self.failUnless(self.domain.getDim() == fs.getDim())
83 x=fs.getX()
84 self.failUnless(x.getFunctionSpace() == fs)
85 self.failUnless(x.getShape() == (fs.getDim(),))
86 self.failUnless(inf(x[0])>=0.)
87 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
88 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
89 self.failUnless(sup(x[0])<=1.)
90 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
91 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
92
93 def test_functionspace_Solution(self):
94 fs=Solution(self.domain)
95 self.failUnless(fs.getDomain()==self.domain)
96 self.failUnless(self.domain.getDim() == fs.getDim())
97 x=fs.getX()
98 self.failUnless(x.getFunctionSpace() == fs)
99 self.failUnless(x.getShape() == (fs.getDim(),))
100 self.failUnless(inf(x[0])>=0.)
101 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
102 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
103 self.failUnless(sup(x[0])<=1.)
104 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
105 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
106
107 def test_functionspace_ReducedSolution(self):
108 fs=ReducedSolution(self.domain)
109 self.failUnless(fs.getDomain()==self.domain)
110 self.failUnless(self.domain.getDim() == fs.getDim())
111 x=fs.getX()
112 self.failUnless(x.getFunctionSpace() == fs)
113 self.failUnless(x.getShape() == (fs.getDim(),))
114 self.failUnless(inf(x[0])>=0.)
115 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
116 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
117 self.failUnless(sup(x[0])<=1.)
118 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
119 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
120
121 def test_functionspace_Function(self):
122 fs=Function(self.domain)
123 self.failUnless(fs.getDomain()==self.domain)
124 self.failUnless(self.domain.getDim() == fs.getDim())
125 x=fs.getX()
126 self.failUnless(x.getFunctionSpace() == fs)
127 self.failUnless(x.getShape() == (fs.getDim(),))
128 self.failUnless(inf(x[0])>=0.)
129 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
130 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
131 self.failUnless(sup(x[0])<=1.)
132 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
133 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
134
135 def test_functionspace_ReducedFunction(self):
136 fs=ReducedFunction(self.domain)
137 self.failUnless(fs.getDomain()==self.domain)
138 self.failUnless(self.domain.getDim() == fs.getDim())
139 x=fs.getX()
140 self.failUnless(x.getFunctionSpace() == fs)
141 self.failUnless(x.getShape() == (fs.getDim(),))
142 self.failUnless(inf(x[0])>=0.)
143 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
144 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
145 self.failUnless(sup(x[0])<=1.)
146 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
147 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
148 def test_functionspace_FunctionOnBoundary(self):
149 fs=FunctionOnBoundary(self.domain)
150 self.failUnless(fs.getDomain()==self.domain)
151 self.failUnless(self.domain.getDim() == fs.getDim())
152 x=fs.getX()
153 self.failUnless(x.getFunctionSpace() == fs)
154 self.failUnless(x.getShape() == (fs.getDim(),))
155 self.failUnless(inf(x[0])>=0.)
156 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
157 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
158 self.failUnless(sup(x[0])<=1.)
159 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
160 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
161
162 def test_functionspace_ReducedFunctionOnBoundary(self):
163 fs=ReducedFunctionOnBoundary(self.domain)
164 self.failUnless(fs.getDomain()==self.domain)
165 self.failUnless(self.domain.getDim() == fs.getDim())
166 x=fs.getX()
167 self.failUnless(x.getFunctionSpace() == fs)
168 self.failUnless(x.getShape() == (fs.getDim(),))
169 self.failUnless(inf(x[0])>=0.)
170 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
171 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
172 self.failUnless(sup(x[0])<=1.)
173 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
174 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
175
176 class Test_Dump(unittest.TestCase):
177 arg0=9.81
178 arg1=numarray.array([3.098, -3.111])
179 arg2=numarray.array([[3.82, -3.81, -0.957, 0.892, -1.367], [-4.589, -1.835, -2.679, -1.517, -4.2515], [-4.909, 1.634, -2.883, -2.135, 1.187], [0.6431, 4.638, -4.616, -0.196, -4.370]])
180 arg3=numarray.array([[[-2.3667, -0.040], [-4.7398, -3.2412]], [[-2.125, -2.240], [2.237, -4.279]], [[0.68720, 2.4059], [-2.4964, 3.17453]], [[-4.907, -4.9431], [-0.3604, 0.4269]], [[1.4179, 3.326], [1.356, -0.4610]], [[3.378, 2.0902], [-2.6857, 1.3585]]])
181 arg4=numarray.array([[[[-3.810, -1.3597, -1.5307, 1.099], [-1.828, 0.2526, -1.4429, 2.326], [4.9732, -2.063, 1.3153, -3.809]], [[-4.8902, -4.714, 1.520, -1.931], [-3.8847, 4.3867, 1.894030, 2.432], [-1.2082, -0.8304, 2.2612, 4.6399]]], [[[-4.5922, -3.309, -0.8171, -0.7210], [2.8051, -4.93047, 0.08450, 4.3824], [0.43204, 2.1908, 4.512633, -1.8218]], [[2.2493, -4.190, -2.3893, -4.147], [-2.104, -4.635, -4.2767, -3.53151], [-2.351, -1.6614, 2.9385, 4.099]]], [[[1.710, 0.2235, -3.4917, 0.8713], [-0.2881, 4.6278, 3.603, -2.1211], [-0.565, 4.294, -2.210827, -0.37651]], [[0.6578, -2.869, -2.490, -4.789], [3.232, 2.483, 0.9531, 2.260], [-1.785, 0.42156, -1.8379, 4.212]]]])
182
183 def _diffDataObjects(self,d_ref,file):
184 d_ref.dump(file)
185 d=load(file, self.domain)
186 self.failUnless(not d.isEmpty(),"data in %s are empty."%file)
187 self.failUnless(d_ref.getFunctionSpace() == d.getFunctionSpace(), "wrong function space in %s."%file)
188 self.failUnless(d_ref.getRank() == d.getRank(), "different rank in %s. "%file)
189 self.failUnless(d_ref.getShape() == d.getShape(), "different shape %s. "%file)
190 self.failUnless(Lsup(d_ref-d)<=0., "different entries %s."%file)
191
192 #===========================================================================
193 def test_DumpAndLoad_Constant_Solution_Rank0(self):
194 print loadIsConfigured()
195 if loadIsConfigured():
196 file=os.path.join(self.filebase,"constant_solution_rank0.nc")
197 d=Data(self.arg0,Solution(self.domain))
198 self._diffDataObjects(d,file)
199
200 def test_DumpAndLoad_Constant_Solution_Rank1(self):
201 if loadIsConfigured():
202 file=os.path.join(self.filebase,"constant_solution_rank1.nc")
203 d=Data(self.arg1,Solution(self.domain))
204 self._diffDataObjects(d,file)
205
206 def test_DumpAndLoad_Constant_Solution_Rank2(self):
207 if loadIsConfigured():
208 file=os.path.join(self.filebase,"constant_solution_rank2.nc")
209 d=Data(self.arg2,Solution(self.domain))
210 self._diffDataObjects(d,file)
211
212 def test_DumpAndLoad_Constant_Solution_Rank3(self):
213 if loadIsConfigured():
214 file=os.path.join(self.filebase,"constant_solution_rank3.nc")
215 d=Data(self.arg3,Solution(self.domain))
216 self._diffDataObjects(d,file)
217
218 def test_DumpAndLoad_Constant_Solution_Rank4(self):
219 if loadIsConfigured():
220 file=os.path.join(self.filebase,"constant_solution_rank4.nc")
221 d=Data(self.arg4,Solution(self.domain))
222 self._diffDataObjects(d,file)
223 #===========================================================================
224 def test_DumpAndLoad_Constant_ReducedSolution_Rank0(self):
225 if loadIsConfigured():
226 file=os.path.join(self.filebase,"constant_reduced_solution_rank0.nc")
227 d=Data(self.arg0,ReducedSolution(self.domain))
228 self._diffDataObjects(d,file)
229
230 def test_DumpAndLoad_Constant_ReducedSolution_Rank1(self):
231 if loadIsConfigured():
232 file=os.path.join(self.filebase,"constant_reduced_solution_rank1.nc")
233 d=Data(self.arg1,ReducedSolution(self.domain))
234 self._diffDataObjects(d,file)
235
236 def test_DumpAndLoad_Constant_ReducedSolution_Rank2(self):
237 if loadIsConfigured():
238 file=os.path.join(self.filebase,"constant_reduced_solution_rank2.nc")
239 d=Data(self.arg2,ReducedSolution(self.domain))
240 self._diffDataObjects(d,file)
241
242 def test_DumpAndLoad_Constant_ReducedSolution_Rank3(self):
243 if loadIsConfigured():
244 file=os.path.join(self.filebase,"constant_reduced_solution_rank3.nc")
245 d=Data(self.arg3,ReducedSolution(self.domain))
246 self._diffDataObjects(d,file)
247
248 def test_DumpAndLoad_Constant_ReducedSolution_Rank4(self):
249 if loadIsConfigured():
250 file=os.path.join(self.filebase,"constant_reduced_solution_rank4.nc")
251 d=Data(self.arg4,ReducedSolution(self.domain))
252 self._diffDataObjects(d,file)
253 #===========================================================================
254 def test_DumpAndLoad_Constant_ContinuousFunction_Rank0(self):
255 if loadIsConfigured():
256 file=os.path.join(self.filebase,"constant_continuous_function_rank0.nc")
257 d=Data(self.arg0,ContinuousFunction(self.domain))
258 self._diffDataObjects(d,file)
259
260 def test_DumpAndLoad_Constant_ContinuousFunction_Rank1(self):
261 if loadIsConfigured():
262 file=os.path.join(self.filebase,"constant_continuous_function_rank1.nc")
263 d=Data(self.arg1,ContinuousFunction(self.domain))
264 self._diffDataObjects(d,file)
265
266 def test_DumpAndLoad_Constant_ContinuousFunction_Rank2(self):
267 if loadIsConfigured():
268 file=os.path.join(self.filebase,"constant_continuous_function_rank2.nc")
269 d=Data(self.arg2,ContinuousFunction(self.domain))
270 self._diffDataObjects(d,file)
271
272 def test_DumpAndLoad_Constant_ContinuousFunction_Rank3(self):
273 if loadIsConfigured():
274 file=os.path.join(self.filebase,"constant_continuous_function_rank3.nc")
275 d=Data(self.arg3,ContinuousFunction(self.domain))
276 self._diffDataObjects(d,file)
277
278 def test_DumpAndLoad_Constant_ContinuousFunction_Rank4(self):
279 if loadIsConfigured():
280 file=os.path.join(self.filebase,"constant_continuous_function_rank4.nc")
281 d=Data(self.arg4,ContinuousFunction(self.domain))
282 self._diffDataObjects(d,file)
283
284 #===========================================================================
285 def test_DumpAndLoad_Constant_Function_Rank0(self):
286 if loadIsConfigured():
287 file=os.path.join(self.filebase,"constant_function_rank0.nc")
288 d=Data(self.arg0,Function(self.domain))
289 self._diffDataObjects(d,file)
290
291 def test_DumpAndLoad_Constant_Function_Rank1(self):
292 if loadIsConfigured():
293 file=os.path.join(self.filebase,"constant_function_rank1.nc")
294 d=Data(self.arg1,Function(self.domain))
295 self._diffDataObjects(d,file)
296
297 def test_DumpAndLoad_Constant_Function_Rank2(self):
298 if loadIsConfigured():
299 file=os.path.join(self.filebase,"constant_function_rank2.nc")
300 d=Data(self.arg2,Function(self.domain))
301 self._diffDataObjects(d,file)
302
303 def test_DumpAndLoad_Constant_Function_Rank3(self):
304 if loadIsConfigured():
305 file=os.path.join(self.filebase,"constant_function_rank3.nc")
306 d=Data(self.arg3,Function(self.domain))
307 self._diffDataObjects(d,file)
308
309 #===========================================================================
310 def test_DumpAndLoad_Constant_ReducedFunction_Rank0(self):
311 if loadIsConfigured():
312 file=os.path.join(self.filebase,"constant_reduced_function_rank0.nc")
313 d=Data(self.arg0,ReducedFunction(self.domain))
314 self._diffDataObjects(d,file)
315
316 def test_DumpAndLoad_Constant_ReducedFunction_Rank1(self):
317 if loadIsConfigured():
318 file=os.path.join(self.filebase,"constant_reduced_function_rank1.nc")
319 d=Data(self.arg1,ReducedFunction(self.domain))
320 self._diffDataObjects(d,file)
321
322 def test_DumpAndLoad_Constant_ReducedFunction_Rank2(self):
323 if loadIsConfigured():
324 file=os.path.join(self.filebase,"constant_reduced_function_rank2.nc")
325 d=Data(self.arg2,ReducedFunction(self.domain))
326 self._diffDataObjects(d,file)
327
328 def test_DumpAndLoad_Constant_ReducedFunction_Rank3(self):
329 if loadIsConfigured():
330 file=os.path.join(self.filebase,"constant_reduced_function_rank3.nc")
331 d=Data(self.arg3,ReducedFunction(self.domain))
332 self._diffDataObjects(d,file)
333 def test_DumpAndLoad_Constant_ReducedFunction_Rank4(self):
334 if loadIsConfigured():
335 file=os.path.join(self.filebase,"constant_reduced_function_rank4.nc")
336 d=Data(self.arg4,ReducedFunction(self.domain))
337 self._diffDataObjects(d,file)
338
339 #===========================================================================
340 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank0(self):
341 if loadIsConfigured():
342 file=os.path.join(self.filebase,"constant_function_on_boundary_rank0.nc")
343 d=Data(self.arg0,FunctionOnBoundary(self.domain))
344 self._diffDataObjects(d,file)
345
346 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank1(self):
347 if loadIsConfigured():
348 file=os.path.join(self.filebase,"constant_function_on_boundary_rank1.nc")
349 d=Data(self.arg1,FunctionOnBoundary(self.domain))
350 self._diffDataObjects(d,file)
351
352 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank2(self):
353 if loadIsConfigured():
354 file=os.path.join(self.filebase,"constant_function_on_boundary_rank2.nc")
355 d=Data(self.arg2,FunctionOnBoundary(self.domain))
356 self._diffDataObjects(d,file)
357
358 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank3(self):
359 if loadIsConfigured():
360 file=os.path.join(self.filebase,"constant_function_on_boundary_rank3.nc")
361 d=Data(self.arg3,FunctionOnBoundary(self.domain))
362 self._diffDataObjects(d,file)
363
364 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank4(self):
365 if loadIsConfigured():
366 file=os.path.join(self.filebase,"constant_function_on_boundary_rank4.nc")
367 d=Data(self.arg4,FunctionOnBoundary(self.domain))
368 self._diffDataObjects(d,file)
369
370 #===========================================================================
371 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank0(self):
372 if loadIsConfigured():
373 file=os.path.join(self.filebase,"constant_reduced_function_on_boundary_rank0.nc")
374 d=Data(self.arg0,FunctionOnBoundary(self.domain))
375 self._diffDataObjects(d,file)
376
377 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank1(self):
378 if loadIsConfigured():
379 file=os.path.join(self.filebase,"constant_reduced_function_on_boundary_rank1.nc")
380 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
381 self._diffDataObjects(d,file)
382
383 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank2(self):
384 if loadIsConfigured():
385 file=os.path.join(self.filebase,"constant_reduced_function_on_boundary_rank2.nc")
386 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
387 self._diffDataObjects(d,file)
388
389 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank3(self):
390 if loadIsConfigured():
391 file=os.path.join(self.filebase,"constant_reduced_function_on_boundary_rank3.nc")
392 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
393 self._diffDataObjects(d,file)
394
395 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank4(self):
396 if loadIsConfigured():
397 file=os.path.join(self.filebase,"constant_reduced_function_on_boundary_rank4.nc")
398 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
399 self._diffDataObjects(d,file)
400
401 #===========================================================================
402 def test_DumpAndLoad_Expanded_Solution_Rank0(self):
403 if loadIsConfigured():
404 file=os.path.join(self.filebase,"expanded_solution_rank0.nc")
405 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
406 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
407 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
408 d=Data(length(Solution(self.domain).getX())*self.arg0,Solution(self.domain))
409 self._diffDataObjects(d,file)
410
411 def test_DumpAndLoad_Expanded_Solution_Rank1(self):
412 if loadIsConfigured():
413 file=os.path.join(self.filebase,"expanded_solution_rank1.nc")
414 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
415 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
416 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
417 d=Data(length(Solution(self.domain).getX())*self.arg1,Solution(self.domain))
418 self._diffDataObjects(d,file)
419
420 def test_DumpAndLoad_Expanded_Solution_Rank2(self):
421 if loadIsConfigured():
422 file=os.path.join(self.filebase,"expanded_solution_rank2.nc")
423 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
424 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
425 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
426 d=Data(length(Solution(self.domain).getX())*self.arg2,Solution(self.domain))
427 self._diffDataObjects(d,file)
428
429 def test_DumpAndLoad_Expanded_Solution_Rank3(self):
430 if loadIsConfigured():
431 file=os.path.join(self.filebase,"expanded_solution_rank3.nc")
432 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
433 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
434 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
435 d=Data(length(Solution(self.domain).getX())*self.arg3,Solution(self.domain))
436 self._diffDataObjects(d,file)
437
438 def test_DumpAndLoad_Expanded_Solution_Rank4(self):
439 if loadIsConfigured():
440 file=os.path.join(self.filebase,"expanded_solution_rank4.nc")
441 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
442 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
443 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
444 d=Data(length(Solution(self.domain).getX())*self.arg4,Solution(self.domain))
445 self._diffDataObjects(d,file)
446 #===========================================================================
447 def test_DumpAndLoad_Expanded_ReducedSolution_Rank0(self):
448 if loadIsConfigured():
449 file=os.path.join(self.filebase,"expanded_reduced_solution_rank0.nc")
450 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
451 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
452 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
453 d=Data(length(ReducedSolution(self.domain).getX())*self.arg0,ReducedSolution(self.domain))
454 self._diffDataObjects(d,file)
455
456 def test_DumpAndLoad_Expanded_ReducedSolution_Rank1(self):
457 if loadIsConfigured():
458 file=os.path.join(self.filebase,"expanded_reduced_solution_rank1.nc")
459 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
460 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
461 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
462 d=Data(length(ReducedSolution(self.domain).getX())*self.arg1,ReducedSolution(self.domain))
463 self._diffDataObjects(d,file)
464
465 def test_DumpAndLoad_Expanded_ReducedSolution_Rank2(self):
466 if loadIsConfigured():
467 file=os.path.join(self.filebase,"expanded_reduced_solution_rank2.nc")
468 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
469 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
470 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
471 d=Data(length(ReducedSolution(self.domain).getX())*self.arg2,ReducedSolution(self.domain))
472 self._diffDataObjects(d,file)
473
474 def test_DumpAndLoad_Expanded_ReducedSolution_Rank3(self):
475 if loadIsConfigured():
476 file=os.path.join(self.filebase,"expanded_reduced_solution_rank3.nc")
477 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
478 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
479 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
480 d=Data(length(ReducedSolution(self.domain).getX())*self.arg3,ReducedSolution(self.domain))
481 self._diffDataObjects(d,file)
482
483 def test_DumpAndLoad_Expanded_ReducedSolution_Rank4(self):
484 if loadIsConfigured():
485 file=os.path.join(self.filebase,"expanded_reduced_solution_rank4.nc")
486 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
487 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
488 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
489 d=Data(length(ReducedSolution(self.domain).getX())*self.arg4,ReducedSolution(self.domain))
490 self._diffDataObjects(d,file)
491 #===========================================================================
492 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank0(self):
493 if loadIsConfigured():
494 file=os.path.join(self.filebase,"expanded_continuous_function_rank0.nc")
495 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
496 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
497 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
498 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg0,ContinuousFunction(self.domain))
499 self._diffDataObjects(d,file)
500
501 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank1(self):
502 if loadIsConfigured():
503 file=os.path.join(self.filebase,"expanded_continuous_function_rank1.nc")
504 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
505 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
506 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
507 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg1,ContinuousFunction(self.domain))
508 self._diffDataObjects(d,file)
509
510 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank2(self):
511 if loadIsConfigured():
512 file=os.path.join(self.filebase,"expanded_continuous_function_rank2.nc")
513 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
514 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
515 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
516 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg2,ContinuousFunction(self.domain))
517 self._diffDataObjects(d,file)
518
519 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank3(self):
520 if loadIsConfigured():
521 file=os.path.join(self.filebase,"expanded_continuous_function_rank3.nc")
522 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg3,ContinuousFunction(self.domain))
523 self._diffDataObjects(d,file)
524
525 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank4(self):
526 if loadIsConfigured():
527 file=os.path.join(self.filebase,"expanded_continuous_function_rank4.nc")
528 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
529 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
530 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
531 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg4,ContinuousFunction(self.domain))
532 self._diffDataObjects(d,file)
533
534 #===========================================================================
535 def test_DumpAndLoad_Expanded_Function_Rank0(self):
536 if loadIsConfigured():
537 file=os.path.join(self.filebase,"expanded_function_rank0.nc")
538 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
539 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
540 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
541 d=Data(length(Function(self.domain).getX())*self.arg0,Function(self.domain))
542 self._diffDataObjects(d,file)
543
544 def test_DumpAndLoad_Expanded_Function_Rank1(self):
545 if loadIsConfigured():
546 file=os.path.join(self.filebase,"expanded_function_rank1.nc")
547 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
548 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
549 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
550 d=Data(length(Function(self.domain).getX())*self.arg1,Function(self.domain))
551 self._diffDataObjects(d,file)
552
553 def test_DumpAndLoad_Expanded_Function_Rank2(self):
554 if loadIsConfigured():
555 file=os.path.join(self.filebase,"expanded_function_rank2.nc")
556 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
557 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
558 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
559 d=Data(length(Function(self.domain).getX())*self.arg2,Function(self.domain))
560 self._diffDataObjects(d,file)
561
562 def test_DumpAndLoad_Expanded_Function_Rank3(self):
563 if loadIsConfigured():
564 file=os.path.join(self.filebase,"expanded_function_rank3.nc")
565 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
566 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
567 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
568 d=Data(length(Function(self.domain).getX())*self.arg3,Function(self.domain))
569 self._diffDataObjects(d,file)
570
571 def test_DumpAndLoad_Expanded_Function_Rank4(self):
572 if loadIsConfigured():
573 file=os.path.join(self.filebase,"expanded_function_rank4.nc")
574 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
575 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
576 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
577 d=Data(length(Function(self.domain).getX())*self.arg4,Function(self.domain))
578 self._diffDataObjects(d,file)
579
580 #===========================================================================
581 def test_DumpAndLoad_Expanded_ReducedFunction_Rank0(self):
582 if loadIsConfigured():
583 file=os.path.join(self.filebase,"expanded_reduced_function_rank0.nc")
584 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
585 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
586 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
587 d=Data(length(ReducedFunction(self.domain).getX())*self.arg0,ReducedFunction(self.domain))
588 self._diffDataObjects(d,file)
589
590 def test_DumpAndLoad_Expanded_ReducedFunction_Rank1(self):
591 if loadIsConfigured():
592 file=os.path.join(self.filebase,"expanded_reduced_function_rank1.nc")
593 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
594 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
595 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
596 d=Data(length(ReducedFunction(self.domain).getX())*self.arg1,ReducedFunction(self.domain))
597 self._diffDataObjects(d,file)
598
599 def test_DumpAndLoad_Expanded_ReducedFunction_Rank2(self):
600 if loadIsConfigured():
601 file=os.path.join(self.filebase,"expanded_reduced_function_rank2.nc")
602 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
603 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
604 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
605 d=Data(length(ReducedFunction(self.domain).getX())*self.arg2,ReducedFunction(self.domain))
606 self._diffDataObjects(d,file)
607
608 def test_DumpAndLoad_Expanded_ReducedFunction_Rank3(self):
609 if loadIsConfigured():
610 file=os.path.join(self.filebase,"expanded_reduced_function_rank3.nc")
611 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
612 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
613 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
614 d=Data(length(ReducedFunction(self.domain).getX())*self.arg3,ReducedFunction(self.domain))
615 self._diffDataObjects(d,file)
616
617 def test_DumpAndLoad_Expanded_ReducedFunction_Rank4(self):
618 if loadIsConfigured():
619 file=os.path.join(self.filebase,"expanded_reduced_function_rank4.nc")
620 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
621 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
622 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
623 d=Data(length(ReducedFunction(self.domain).getX())*self.arg4,ReducedFunction(self.domain))
624 self._diffDataObjects(d,file)
625
626 #===========================================================================
627 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank0(self):
628 if loadIsConfigured():
629 file=os.path.join(self.filebase,"expanded_function_on_boundary_rank0.nc")
630 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
631 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
632 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
633 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg0,FunctionOnBoundary(self.domain))
634 self._diffDataObjects(d,file)
635
636 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank1(self):
637 if loadIsConfigured():
638 file=os.path.join(self.filebase,"expanded_function_on_boundary_rank1.nc")
639 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
640 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
641 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
642 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg1,FunctionOnBoundary(self.domain))
643 self._diffDataObjects(d,file)
644
645 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank2(self):
646 if loadIsConfigured():
647 file=os.path.join(self.filebase,"expanded_function_on_boundary_rank2.nc")
648 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
649 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
650 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
651 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg2,FunctionOnBoundary(self.domain))
652 self._diffDataObjects(d,file)
653
654 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank3(self):
655 if loadIsConfigured():
656 file=os.path.join(self.filebase,"expanded_function_on_boundary_rank3.nc")
657 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
658 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
659 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
660 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg3,FunctionOnBoundary(self.domain))
661 self._diffDataObjects(d,file)
662
663 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank4(self):
664 if loadIsConfigured():
665 file=os.path.join(self.filebase,"expanded_function_on_boundary_rank4.nc")
666 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
667 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
668 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
669 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg4,FunctionOnBoundary(self.domain))
670 self._diffDataObjects(d,file)
671
672 #===========================================================================
673 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank0(self):
674 if loadIsConfigured():
675 file=os.path.join(self.filebase,"expanded_reduced_function_on_boundary_rank0.nc")
676 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
677 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
678 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
679 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg0,ReducedFunctionOnBoundary(self.domain))
680 self._diffDataObjects(d,file)
681
682 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank1(self):
683 if loadIsConfigured():
684 file=os.path.join(self.filebase,"expanded_reduced_function_on_boundary_rank1.nc")
685 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
686 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
687 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
688 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg1,ReducedFunctionOnBoundary(self.domain))
689 self._diffDataObjects(d,file)
690
691 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank2(self):
692 if loadIsConfigured():
693 file=os.path.join(self.filebase,"expanded_reduced_function_on_boundary_rank2.nc")
694 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
695 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
696 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
697 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg2,ReducedFunctionOnBoundary(self.domain))
698 self._diffDataObjects(d,file)
699
700 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank3(self):
701 if loadIsConfigured():
702 file=os.path.join(self.filebase,"expanded_reduced_function_on_boundary_rank3.nc")
703 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
704 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
705 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
706 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg3,ReducedFunctionOnBoundary(self.domain))
707 self._diffDataObjects(d,file)
708
709 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank4(self):
710 if loadIsConfigured():
711 file=os.path.join(self.filebase,"expanded_reduced_function_on_boundary_rank4.nc")
712 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_samples)
713 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_number_of_data_points_per_sample)
714 self.failUnlessRaises(RuntimeError, load, file, self.domain_with_different_sample_ordering)
715 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg4,ReducedFunctionOnBoundary(self.domain))
716 self._diffDataObjects(d,file)
717
718 #===========================================================================
719 def test_DumpAndLoad_Tagged_Solution_Rank0(self):
720 if loadIsConfigured():
721 file=os.path.join(self.filebase,"tagged_solution_rank0.nc")
722 d=Data(self.arg0,Solution(self.domain))
723 d.setTaggedValue(1,self.arg0*2)
724 d.setTaggedValue(10,self.arg0*3)
725 d.setTaggedValue(100,self.arg0*4)
726 self._diffDataObjects(d,file)
727
728 def test_DumpAndLoad_Tagged_Solution_Rank1(self):
729 if loadIsConfigured():
730 file=os.path.join(self.filebase,"tagged_solution_rank1.nc")
731 d=Data(self.arg1,Solution(self.domain))
732 d.setTaggedValue(1,self.arg1*2)
733 d.setTaggedValue(10,self.arg1*3)
734 d.setTaggedValue(100,self.arg1*4)
735 self._diffDataObjects(d,file)
736
737 def test_DumpAndLoad_Tagged_Solution_Rank2(self):
738 if loadIsConfigured():
739 file=os.path.join(self.filebase,"tagged_solution_rank2.nc")
740 d=Data(self.arg2,Solution(self.domain))
741 d.setTaggedValue(1,self.arg2*2)
742 d.setTaggedValue(10,self.arg2*3)
743 d.setTaggedValue(100,self.arg2*4)
744 self._diffDataObjects(d,file)
745
746 def test_DumpAndLoad_Tagged_Solution_Rank3(self):
747 if loadIsConfigured():
748 file=os.path.join(self.filebase,"tagged_solution_rank3.nc")
749 d=Data(self.arg3,Solution(self.domain))
750 d.setTaggedValue(1,self.arg3*2)
751 d.setTaggedValue(10,self.arg3*3)
752 d.setTaggedValue(100,self.arg3*4)
753 self._diffDataObjects(d,file)
754
755 def test_DumpAndLoad_Tagged_Solution_Rank4(self):
756 if loadIsConfigured():
757 file=os.path.join(self.filebase,"tagged_solution_rank4.nc")
758 d=Data(self.arg4,Solution(self.domain))
759 d.setTaggedValue(1,self.arg4*2)
760 d.setTaggedValue(10,self.arg4*3)
761 d.setTaggedValue(100,self.arg4*4)
762 self._diffDataObjects(d,file)
763 #===========================================================================
764 def test_DumpAndLoad_Tagged_ReducedSolution_Rank0(self):
765 if loadIsConfigured():
766 file=os.path.join(self.filebase,"tagged_reduced_solution_rank0.nc")
767 d=Data(self.arg0,ReducedSolution(self.domain))
768 d.setTaggedValue(1,self.arg0*2)
769 d.setTaggedValue(10,self.arg0*3)
770 d.setTaggedValue(100,self.arg0*4)
771 self._diffDataObjects(d,file)
772
773 def test_DumpAndLoad_Tagged_ReducedSolution_Rank1(self):
774 if loadIsConfigured():
775 file=os.path.join(self.filebase,"tagged_reduced_solution_rank1.nc")
776 d=Data(self.arg1,ReducedSolution(self.domain))
777 d.setTaggedValue(1,self.arg1*2)
778 d.setTaggedValue(10,self.arg1*3)
779 d.setTaggedValue(100,self.arg1*4)
780 self._diffDataObjects(d,file)
781
782 def test_DumpAndLoad_Tagged_ReducedSolution_Rank2(self):
783 if loadIsConfigured():
784 file=os.path.join(self.filebase,"tagged_reduced_solution_rank2.nc")
785 d=Data(self.arg2,ReducedSolution(self.domain))
786 d.setTaggedValue(1,self.arg2*2)
787 d.setTaggedValue(10,self.arg2*3)
788 d.setTaggedValue(100,self.arg2*4)
789 self._diffDataObjects(d,file)
790
791 def test_DumpAndLoad_Tagged_ReducedSolution_Rank3(self):
792 if loadIsConfigured():
793 file=os.path.join(self.filebase,"tagged_reduced_solution_rank3.nc")
794 d=Data(self.arg3,ReducedSolution(self.domain))
795 d.setTaggedValue(1,self.arg3*2)
796 d.setTaggedValue(10,self.arg3*3)
797 d.setTaggedValue(100,self.arg3*4)
798 self._diffDataObjects(d,file)
799
800 def test_DumpAndLoad_Tagged_ReducedSolution_Rank4(self):
801 if loadIsConfigured():
802 file=os.path.join(self.filebase,"tagged_reduced_solution_rank4.nc")
803 d=Data(self.arg4,ReducedSolution(self.domain))
804 d.setTaggedValue(1,self.arg4*2)
805 d.setTaggedValue(10,self.arg4*3)
806 d.setTaggedValue(100,self.arg4*4)
807 self._diffDataObjects(d,file)
808 #===========================================================================
809 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank0(self):
810 if loadIsConfigured():
811 file=os.path.join(self.filebase,"tagged_continuous_function_rank0.nc")
812 d=Data(self.arg0,ContinuousFunction(self.domain))
813 d.setTaggedValue(1,self.arg0*2)
814 d.setTaggedValue(10,self.arg0*3)
815 d.setTaggedValue(100,self.arg0*4)
816 self._diffDataObjects(d,file)
817
818 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank1(self):
819 if loadIsConfigured():
820 file=os.path.join(self.filebase,"tagged_continuous_function_rank1.nc")
821 d=Data(self.arg1,ContinuousFunction(self.domain))
822 d.setTaggedValue(1,self.arg1*2)
823 d.setTaggedValue(10,self.arg1*3)
824 d.setTaggedValue(100,self.arg1*4)
825 self._diffDataObjects(d,file)
826
827 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank2(self):
828 if loadIsConfigured():
829 file=os.path.join(self.filebase,"tagged_continuous_function_rank2.nc")
830 d=Data(self.arg2,ContinuousFunction(self.domain))
831 d.setTaggedValue(1,self.arg2*2)
832 d.setTaggedValue(10,self.arg2*3)
833 d.setTaggedValue(100,self.arg2*4)
834 self._diffDataObjects(d,file)
835
836 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank3(self):
837 if loadIsConfigured():
838 file=os.path.join(self.filebase,"tagged_continuous_function_rank3.nc")
839 d=Data(self.arg3,ContinuousFunction(self.domain))
840 d.setTaggedValue(1,self.arg3*2)
841 d.setTaggedValue(10,self.arg3*3)
842 d.setTaggedValue(100,self.arg3*4)
843 self._diffDataObjects(d,file)
844
845 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank4(self):
846 if loadIsConfigured():
847 file=os.path.join(self.filebase,"tagged_continuous_function_rank4.nc")
848 d=Data(self.arg4,ContinuousFunction(self.domain))
849 d.setTaggedValue(1,self.arg4*2)
850 d.setTaggedValue(10,self.arg4*3)
851 d.setTaggedValue(100,self.arg4*4)
852 self._diffDataObjects(d,file)
853
854 #===========================================================================
855 def test_DumpAndLoad_Tagged_Function_Rank0(self):
856 if loadIsConfigured():
857 file=os.path.join(self.filebase,"tagged_function_rank0.nc")
858 d=Data(self.arg0,Function(self.domain))
859 d.setTaggedValue(1,self.arg0*2)
860 d.setTaggedValue(10,self.arg0*3)
861 d.setTaggedValue(100,self.arg0*4)
862 self._diffDataObjects(d,file)
863
864 def test_DumpAndLoad_Tagged_Function_Rank1(self):
865 if loadIsConfigured():
866 file=os.path.join(self.filebase,"tagged_function_rank1.nc")
867 d=Data(self.arg1,Function(self.domain))
868 d.setTaggedValue(1,self.arg1*2)
869 d.setTaggedValue(10,self.arg1*3)
870 d.setTaggedValue(100,self.arg1*4)
871 self._diffDataObjects(d,file)
872
873 def test_DumpAndLoad_Tagged_Function_Rank2(self):
874 if loadIsConfigured():
875 file=os.path.join(self.filebase,"tagged_function_rank2.nc")
876 d=Data(self.arg2,Function(self.domain))
877 d.setTaggedValue(1,self.arg2*2)
878 d.setTaggedValue(10,self.arg2*3)
879 d.setTaggedValue(100,self.arg2*4)
880 self._diffDataObjects(d,file)
881
882 def test_DumpAndLoad_Tagged_Function_Rank3(self):
883 if loadIsConfigured():
884 file=os.path.join(self.filebase,"tagged_function_rank3.nc")
885 d=Data(self.arg3,Function(self.domain))
886 d.setTaggedValue(1,self.arg3*2)
887 d.setTaggedValue(10,self.arg3*3)
888 d.setTaggedValue(100,self.arg3*4)
889 self._diffDataObjects(d,file)
890
891 def test_DumpAndLoad_Tagged_Function_Rank4(self):
892 if loadIsConfigured():
893 file=os.path.join(self.filebase,"tagged_function_rank4.nc")
894 d=Data(self.arg4,Function(self.domain))
895 d.setTaggedValue(1,self.arg4*2)
896 d.setTaggedValue(10,self.arg4*3)
897 d.setTaggedValue(100,self.arg4*4)
898 self._diffDataObjects(d,file)
899
900 #===========================================================================
901 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank0(self):
902 if loadIsConfigured():
903 file=os.path.join(self.filebase,"tagged_function_on_boundary_rank0.nc")
904 d=Data(self.arg0,FunctionOnBoundary(self.domain))
905 d.setTaggedValue(1,self.arg0*2)
906 d.setTaggedValue(10,self.arg0*3)
907 d.setTaggedValue(100,self.arg0*4)
908 self._diffDataObjects(d,file)
909
910 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank1(self):
911 if loadIsConfigured():
912 file=os.path.join(self.filebase,"tagged_function_on_boundary_rank1.nc")
913 d=Data(self.arg1,FunctionOnBoundary(self.domain))
914 d.setTaggedValue(1,self.arg1*2)
915 d.setTaggedValue(10,self.arg1*3)
916 d.setTaggedValue(100,self.arg1*4)
917 self._diffDataObjects(d,file)
918
919 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank2(self):
920 if loadIsConfigured():
921 file=os.path.join(self.filebase,"tagged_function_on_boundary_rank2.nc")
922 d=Data(self.arg2,FunctionOnBoundary(self.domain))
923 d.setTaggedValue(1,self.arg2*2)
924 d.setTaggedValue(10,self.arg2*3)
925 d.setTaggedValue(100,self.arg2*4)
926 self._diffDataObjects(d,file)
927
928 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank3(self):
929 if loadIsConfigured():
930 file=os.path.join(self.filebase,"tagged_function_on_boundary_rank3.nc")
931 d=Data(self.arg3,FunctionOnBoundary(self.domain))
932 d.setTaggedValue(1,self.arg3*2)
933 d.setTaggedValue(10,self.arg3*3)
934 d.setTaggedValue(100,self.arg3*4)
935 self._diffDataObjects(d,file)
936
937 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank4(self):
938 if loadIsConfigured():
939 file=os.path.join(self.filebase,"tagged_function_on_boundary_rank4.nc")
940 d=Data(self.arg4,FunctionOnBoundary(self.domain))
941 d.setTaggedValue(1,self.arg4*2)
942 d.setTaggedValue(10,self.arg4*3)
943 d.setTaggedValue(100,self.arg4*4)
944 self._diffDataObjects(d,file)
945 #===========================================================================
946 def test_DumpAndLoad_Tagged_ReducedFunction_Rank0(self):
947 if loadIsConfigured():
948 file=os.path.join(self.filebase,"tagged_reduced_function_rank0.nc")
949 d=Data(self.arg0,ReducedFunction(self.domain))
950 d.setTaggedValue(1,self.arg0*2)
951 d.setTaggedValue(10,self.arg0*3)
952 d.setTaggedValue(100,self.arg0*4)
953 self._diffDataObjects(d,file)
954
955 def test_DumpAndLoad_Tagged_ReducedFunction_Rank1(self):
956 if loadIsConfigured():
957 file=os.path.join(self.filebase,"tagged_reduced_function_rank1.nc")
958 d=Data(self.arg1,ReducedFunction(self.domain))
959 d.setTaggedValue(1,self.arg1*2)
960 d.setTaggedValue(10,self.arg1*3)
961 d.setTaggedValue(100,self.arg1*4)
962 self._diffDataObjects(d,file)
963
964 def test_DumpAndLoad_Tagged_ReducedFunction_Rank2(self):
965 if loadIsConfigured():
966 file=os.path.join(self.filebase,"tagged_reduced_function_rank2.nc")
967 d=Data(self.arg2,ReducedFunction(self.domain))
968 d.setTaggedValue(1,self.arg2*2)
969 d.setTaggedValue(10,self.arg2*3)
970 d.setTaggedValue(100,self.arg2*4)
971 self._diffDataObjects(d,file)
972
973 def test_DumpAndLoad_Tagged_ReducedFunction_Rank3(self):
974 if loadIsConfigured():
975 file=os.path.join(self.filebase,"tagged_reduced_function_rank3.nc")
976 d=Data(self.arg3,ReducedFunction(self.domain))
977 d.setTaggedValue(1,self.arg3*2)
978 d.setTaggedValue(10,self.arg3*3)
979 d.setTaggedValue(100,self.arg3*4)
980 self._diffDataObjects(d,file)
981
982 def test_DumpAndLoad_Tagged_ReducedFunction_Rank4(self):
983 if loadIsConfigured():
984 file=os.path.join(self.filebase,"tagged_reduced_function_rank4.nc")
985 d=Data(self.arg4,ReducedFunction(self.domain))
986 d.setTaggedValue(1,self.arg4*2)
987 d.setTaggedValue(10,self.arg4*3)
988 d.setTaggedValue(100,self.arg4*4)
989 self._diffDataObjects(d,file)
990
991 #===========================================================================
992 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank0(self):
993 if loadIsConfigured():
994 file=os.path.join(self.filebase,"tagged_reduced_function_on_boundary_rank0.nc")
995 d=Data(self.arg0,ReducedFunctionOnBoundary(self.domain))
996 d.setTaggedValue(1,self.arg0*2)
997 d.setTaggedValue(10,self.arg0*3)
998 d.setTaggedValue(100,self.arg0*4)
999 self._diffDataObjects(d,file)
1000
1001 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank1(self):
1002 if loadIsConfigured():
1003 file=os.path.join(self.filebase,"tagged_reduced_function_on_boundary_rank1.nc")
1004 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
1005 d.setTaggedValue(1,self.arg1*2)
1006 d.setTaggedValue(10,self.arg1*3)
1007 d.setTaggedValue(100,self.arg1*4)
1008 self._diffDataObjects(d,file)
1009
1010 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank2(self):
1011 if loadIsConfigured():
1012 file=os.path.join(self.filebase,"tagged_reduced_function_on_boundary_rank2.nc")
1013 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
1014 d.setTaggedValue(1,self.arg2*2)
1015 d.setTaggedValue(10,self.arg2*3)
1016 d.setTaggedValue(100,self.arg2*4)
1017 self._diffDataObjects(d,file)
1018
1019 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank3(self):
1020 if loadIsConfigured():
1021 file=os.path.join(self.filebase,"tagged_reduced_function_on_boundary_rank3.nc")
1022 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
1023 d.setTaggedValue(1,self.arg3*2)
1024 d.setTaggedValue(10,self.arg3*3)
1025 d.setTaggedValue(100,self.arg3*4)
1026 self._diffDataObjects(d,file)
1027
1028 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank4(self):
1029 if loadIsConfigured():
1030 file=os.path.join(self.filebase,"tagged_reduced_function_on_boundary_rank4.nc")
1031 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
1032 d.setTaggedValue(1,self.arg4*2)
1033 d.setTaggedValue(10,self.arg4*3)
1034 d.setTaggedValue(100,self.arg4*4)
1035 self._diffDataObjects(d,file)
1036 #===========================================================================
1037 def test_SetDataPointValue_Function_Rank0(self):
1038 d=Data(self.arg0,Function(self.domain))
1039 d.setValueOfDataPoint(0,self.arg0*2)
1040 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1041 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
1042 d_0=d.getValueOfDataPoint(0)
1043 d_1=d.getValueOfDataPoint(1)
1044 self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
1045 self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
1046 def test_SetDataPointValue_Function_Rank1(self):
1047 d=Data(self.arg1,Function(self.domain))
1048 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
1049 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
1050 d.setValueOfDataPoint(0,self.arg1*2)
1051 d_0=d.getValueOfDataPoint(0)
1052 d_1=d.getValueOfDataPoint(1)
1053 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
1054 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
1055 def test_SetDataPointValue_Function_Rank1_list(self):
1056 d=Data(self.arg1,Function(self.domain))
1057 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
1058 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
1059 d.setValueOfDataPoint(0,numarray.array2list(self.arg1*2))
1060 d_0=d.getValueOfDataPoint(0)
1061 d_1=d.getValueOfDataPoint(1)
1062 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
1063 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
1064 def test_SetDataPointValue_Function_Rank2(self):
1065 d=Data(self.arg2,Function(self.domain))
1066 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1067 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
1068 d.setValueOfDataPoint(0,self.arg2*2)
1069 d_0=d.getValueOfDataPoint(0)
1070 d_1=d.getValueOfDataPoint(1)
1071 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
1072 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
1073 def test_SetDataPointValue_Function_Rank2_list(self):
1074 d=Data(self.arg2,Function(self.domain))
1075 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1076 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
1077 d.setValueOfDataPoint(0,numarray.array2list(self.arg2*2))
1078 d_0=d.getValueOfDataPoint(0)
1079 d_1=d.getValueOfDataPoint(1)
1080 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
1081 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
1082 def test_SetDataPointValue_Function_Rank3(self):
1083 d=Data(self.arg3,Function(self.domain))
1084 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1085 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
1086 d.setValueOfDataPoint(0,self.arg3*2)
1087 d_0=d.getValueOfDataPoint(0)
1088 d_1=d.getValueOfDataPoint(1)
1089 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
1090 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
1091 def test_SetDataPointValue_Function_Rank3_list(self):
1092 d=Data(self.arg3,Function(self.domain))
1093 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1094 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
1095 d.setValueOfDataPoint(0,numarray.array2list(self.arg3*2))
1096 d_0=d.getValueOfDataPoint(0)
1097 d_1=d.getValueOfDataPoint(1)
1098 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
1099 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
1100 def test_SetDataPointValue_Function_Rank4(self):
1101 d=Data(self.arg4,Function(self.domain))
1102 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1103 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
1104 d.setValueOfDataPoint(0,self.arg4*2)
1105 d_0=d.getValueOfDataPoint(0)
1106 d_1=d.getValueOfDataPoint(1)
1107 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
1108 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
1109 def test_SetDataPointValue_Function_Rank4_list(self):
1110 d=Data(self.arg4,Function(self.domain))
1111 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1112 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
1113 d.setValueOfDataPoint(0,numarray.array2list(self.arg4*2))
1114 d_0=d.getValueOfDataPoint(0)
1115 d_1=d.getValueOfDataPoint(1)
1116 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
1117 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
1118 #===========================================================================
1119 def test_SetDataPointValue_ReducedFunction_Rank0(self):
1120 d=Data(self.arg0,ReducedFunction(self.domain))
1121 d.setValueOfDataPoint(0,self.arg0*2)
1122 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1123 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
1124 d_0=d.getValueOfDataPoint(0)
1125 d_1=d.getValueOfDataPoint(1)
1126 self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
1127 self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
1128 def test_SetDataPointValue_ReducedFunction_Rank1(self):
1129 d=Data(self.arg1,ReducedFunction(self.domain))
1130 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
1131 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
1132 d.setValueOfDataPoint(0,self.arg1*2)
1133 d_0=d.getValueOfDataPoint(0)
1134 d_1=d.getValueOfDataPoint(1)
1135 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
1136 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
1137 def test_SetDataPointValue_ReducedFunction_Rank1_list(self):
1138 d=Data(self.arg1,ReducedFunction(self.domain))
1139 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
1140 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
1141 d.setValueOfDataPoint(0,numarray.array2list(self.arg1*2))
1142 d_0=d.getValueOfDataPoint(0)
1143 d_1=d.getValueOfDataPoint(1)
1144 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
1145 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
1146 def test_SetDataPointValue_ReducedFunction_Rank2(self):
1147 d=Data(self.arg2,ReducedFunction(self.domain))
1148 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1149 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
1150 d.setValueOfDataPoint(0,self.arg2*2)
1151 d_0=d.getValueOfDataPoint(0)
1152 d_1=d.getValueOfDataPoint(1)
1153 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
1154 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
1155 def test_SetDataPointValue_ReducedFunction_Rank2_list(self):
1156 d=Data(self.arg2,ReducedFunction(self.domain))
1157 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1158 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
1159 d.setValueOfDataPoint(0,numarray.array2list(self.arg2*2))
1160 d_0=d.getValueOfDataPoint(0)
1161 d_1=d.getValueOfDataPoint(1)
1162 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
1163 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
1164 def test_SetDataPointValue_ReducedFunction_Rank3(self):
1165 d=Data(self.arg3,ReducedFunction(self.domain))
1166 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1167 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
1168 d.setValueOfDataPoint(0,self.arg3*2)
1169 d_0=d.getValueOfDataPoint(0)
1170 d_1=d.getValueOfDataPoint(1)
1171 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
1172 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
1173 def test_SetDataPointValue_ReducedFunction_Rank3_list(self):
1174 d=Data(self.arg3,ReducedFunction(self.domain))
1175 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1176 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
1177 d.setValueOfDataPoint(0,numarray.array2list(self.arg3*2))
1178 d_0=d.getValueOfDataPoint(0)
1179 d_1=d.getValueOfDataPoint(1)
1180 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
1181 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
1182 def test_SetDataPointValue_ReducedFunction_Rank4(self):
1183 d=Data(self.arg4,ReducedFunction(self.domain))
1184 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1185 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
1186 d.setValueOfDataPoint(0,self.arg4*2)
1187 d_0=d.getValueOfDataPoint(0)
1188 d_1=d.getValueOfDataPoint(1)
1189 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
1190 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
1191 def test_SetDataPointValue_ReducedFunction_Rank4_list(self):
1192 d=Data(self.arg4,ReducedFunction(self.domain))
1193 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
1194 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
1195 d.setValueOfDataPoint(0,numarray.array2list(self.arg4*2))
1196 d_0=d.getValueOfDataPoint(0)
1197 d_1=d.getValueOfDataPoint(1)
1198 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
1199 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")

  ViewVC Help
Powered by ViewVC 1.1.26