/[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 1149 - (show annotations)
Thu May 17 00:30:15 2007 UTC (13 years, 4 months ago) by gross
File MIME type: text/x-python
File size: 70191 byte(s)
some fixes from the windows version
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.filename_base="."
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_SetDataPointValue(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 def test_SetDataPointValue_Function_Rank0(self):
183 d=Data(self.arg0,Function(self.domain))
184 d.setValueOfDataPoint(0,self.arg0*2)
185 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
186 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
187 d_0=d.getValueOfDataPoint(0)
188 d_1=d.getValueOfDataPoint(1)
189 self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
190 self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
191 def test_SetDataPointValue_Function_Rank1(self):
192 d=Data(self.arg1,Function(self.domain))
193 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
194 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
195 d.setValueOfDataPoint(0,self.arg1*2)
196 d_0=d.getValueOfDataPoint(0)
197 d_1=d.getValueOfDataPoint(1)
198 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
199 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
200 def test_SetDataPointValue_Function_Rank1_list(self):
201 d=Data(self.arg1,Function(self.domain))
202 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
203 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
204 d.setValueOfDataPoint(0,numarray.array2list(self.arg1*2))
205 d_0=d.getValueOfDataPoint(0)
206 d_1=d.getValueOfDataPoint(1)
207 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
208 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
209 def test_SetDataPointValue_Function_Rank2(self):
210 d=Data(self.arg2,Function(self.domain))
211 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
212 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
213 d.setValueOfDataPoint(0,self.arg2*2)
214 d_0=d.getValueOfDataPoint(0)
215 d_1=d.getValueOfDataPoint(1)
216 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
217 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
218 def test_SetDataPointValue_Function_Rank2_list(self):
219 d=Data(self.arg2,Function(self.domain))
220 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
221 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
222 d.setValueOfDataPoint(0,numarray.array2list(self.arg2*2))
223 d_0=d.getValueOfDataPoint(0)
224 d_1=d.getValueOfDataPoint(1)
225 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
226 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
227 def test_SetDataPointValue_Function_Rank3(self):
228 d=Data(self.arg3,Function(self.domain))
229 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
230 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
231 d.setValueOfDataPoint(0,self.arg3*2)
232 d_0=d.getValueOfDataPoint(0)
233 d_1=d.getValueOfDataPoint(1)
234 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
235 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
236 def test_SetDataPointValue_Function_Rank3_list(self):
237 d=Data(self.arg3,Function(self.domain))
238 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
239 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
240 d.setValueOfDataPoint(0,numarray.array2list(self.arg3*2))
241 d_0=d.getValueOfDataPoint(0)
242 d_1=d.getValueOfDataPoint(1)
243 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
244 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
245 def test_SetDataPointValue_Function_Rank4(self):
246 d=Data(self.arg4,Function(self.domain))
247 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
248 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
249 d.setValueOfDataPoint(0,self.arg4*2)
250 d_0=d.getValueOfDataPoint(0)
251 d_1=d.getValueOfDataPoint(1)
252 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
253 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
254 def test_SetDataPointValue_Function_Rank4_list(self):
255 d=Data(self.arg4,Function(self.domain))
256 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
257 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
258 d.setValueOfDataPoint(0,numarray.array2list(self.arg4*2))
259 d_0=d.getValueOfDataPoint(0)
260 d_1=d.getValueOfDataPoint(1)
261 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
262 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
263 #===========================================================================
264 def test_SetDataPointValue_ReducedFunction_Rank0(self):
265 d=Data(self.arg0,ReducedFunction(self.domain))
266 d.setValueOfDataPoint(0,self.arg0*2)
267 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
268 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
269 d_0=d.getValueOfDataPoint(0)
270 d_1=d.getValueOfDataPoint(1)
271 self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
272 self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
273 def test_SetDataPointValue_ReducedFunction_Rank1(self):
274 d=Data(self.arg1,ReducedFunction(self.domain))
275 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
276 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
277 d.setValueOfDataPoint(0,self.arg1*2)
278 d_0=d.getValueOfDataPoint(0)
279 d_1=d.getValueOfDataPoint(1)
280 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
281 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
282 def test_SetDataPointValue_ReducedFunction_Rank1_list(self):
283 d=Data(self.arg1,ReducedFunction(self.domain))
284 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
285 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
286 d.setValueOfDataPoint(0,numarray.array2list(self.arg1*2))
287 d_0=d.getValueOfDataPoint(0)
288 d_1=d.getValueOfDataPoint(1)
289 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
290 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
291 def test_SetDataPointValue_ReducedFunction_Rank2(self):
292 d=Data(self.arg2,ReducedFunction(self.domain))
293 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
294 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
295 d.setValueOfDataPoint(0,self.arg2*2)
296 d_0=d.getValueOfDataPoint(0)
297 d_1=d.getValueOfDataPoint(1)
298 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
299 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
300 def test_SetDataPointValue_ReducedFunction_Rank2_list(self):
301 d=Data(self.arg2,ReducedFunction(self.domain))
302 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
303 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
304 d.setValueOfDataPoint(0,numarray.array2list(self.arg2*2))
305 d_0=d.getValueOfDataPoint(0)
306 d_1=d.getValueOfDataPoint(1)
307 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
308 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
309 def test_SetDataPointValue_ReducedFunction_Rank3(self):
310 d=Data(self.arg3,ReducedFunction(self.domain))
311 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
312 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
313 d.setValueOfDataPoint(0,self.arg3*2)
314 d_0=d.getValueOfDataPoint(0)
315 d_1=d.getValueOfDataPoint(1)
316 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
317 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
318 def test_SetDataPointValue_ReducedFunction_Rank3_list(self):
319 d=Data(self.arg3,ReducedFunction(self.domain))
320 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
321 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
322 d.setValueOfDataPoint(0,numarray.array2list(self.arg3*2))
323 d_0=d.getValueOfDataPoint(0)
324 d_1=d.getValueOfDataPoint(1)
325 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
326 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
327 def test_SetDataPointValue_ReducedFunction_Rank4(self):
328 d=Data(self.arg4,ReducedFunction(self.domain))
329 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
330 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
331 d.setValueOfDataPoint(0,self.arg4*2)
332 d_0=d.getValueOfDataPoint(0)
333 d_1=d.getValueOfDataPoint(1)
334 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
335 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
336 def test_SetDataPointValue_ReducedFunction_Rank4_list(self):
337 d=Data(self.arg4,ReducedFunction(self.domain))
338 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
339 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
340 d.setValueOfDataPoint(0,numarray.array2list(self.arg4*2))
341 d_0=d.getValueOfDataPoint(0)
342 d_1=d.getValueOfDataPoint(1)
343 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
344 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
345
346 class Test_Dump(unittest.TestCase):
347 arg0=9.81
348 arg1=numarray.array([3.098, -3.111])
349 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]])
350 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]]])
351 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]]]])
352
353 def _diffDataObjects(self,d_ref,filemame):
354 d_ref.dump(filemame)
355 d=load(filemame, self.domain)
356 self.failUnless(not d.isEmpty(),"data in %s are empty."%filemame)
357 self.failUnless(d_ref.getFunctionSpace() == d.getFunctionSpace(), "wrong function space in %s."%filemame)
358 self.failUnless(d_ref.getRank() == d.getRank(), "different rank in %s. "%filemame)
359 self.failUnless(d_ref.getShape() == d.getShape(), "different shape %s. "%filemame)
360 self.failUnless(Lsup(d_ref-d)<=0., "different entries %s."%filemame)
361
362 #===========================================================================
363 def test_DumpAndLoad_Constant_Solution_Rank0(self):
364 if loadIsConfigured():
365 filemame=os.path.join(self.filename_base,"constant_solution_rank0.nc")
366 d=Data(self.arg0,Solution(self.domain))
367 self._diffDataObjects(d,filemame)
368
369 def test_DumpAndLoad_Constant_Solution_Rank1(self):
370 if loadIsConfigured():
371 filemame=os.path.join(self.filename_base,"constant_solution_rank1.nc")
372 d=Data(self.arg1,Solution(self.domain))
373 self._diffDataObjects(d,filemame)
374
375 def test_DumpAndLoad_Constant_Solution_Rank2(self):
376 if loadIsConfigured():
377 filemame=os.path.join(self.filename_base,"constant_solution_rank2.nc")
378 d=Data(self.arg2,Solution(self.domain))
379 self._diffDataObjects(d,filemame)
380
381 def test_DumpAndLoad_Constant_Solution_Rank3(self):
382 if loadIsConfigured():
383 filemame=os.path.join(self.filename_base,"constant_solution_rank3.nc")
384 d=Data(self.arg3,Solution(self.domain))
385 self._diffDataObjects(d,filemame)
386
387 def test_DumpAndLoad_Constant_Solution_Rank4(self):
388 if loadIsConfigured():
389 filemame=os.path.join(self.filename_base,"constant_solution_rank4.nc")
390 d=Data(self.arg4,Solution(self.domain))
391 self._diffDataObjects(d,filemame)
392 #===========================================================================
393 def test_DumpAndLoad_Constant_ReducedSolution_Rank0(self):
394 if loadIsConfigured():
395 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank0.nc")
396 d=Data(self.arg0,ReducedSolution(self.domain))
397 self._diffDataObjects(d,filemame)
398
399 def test_DumpAndLoad_Constant_ReducedSolution_Rank1(self):
400 if loadIsConfigured():
401 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank1.nc")
402 d=Data(self.arg1,ReducedSolution(self.domain))
403 self._diffDataObjects(d,filemame)
404
405 def test_DumpAndLoad_Constant_ReducedSolution_Rank2(self):
406 if loadIsConfigured():
407 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank2.nc")
408 d=Data(self.arg2,ReducedSolution(self.domain))
409 self._diffDataObjects(d,filemame)
410
411 def test_DumpAndLoad_Constant_ReducedSolution_Rank3(self):
412 if loadIsConfigured():
413 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank3.nc")
414 d=Data(self.arg3,ReducedSolution(self.domain))
415 self._diffDataObjects(d,filemame)
416
417 def test_DumpAndLoad_Constant_ReducedSolution_Rank4(self):
418 if loadIsConfigured():
419 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank4.nc")
420 d=Data(self.arg4,ReducedSolution(self.domain))
421 self._diffDataObjects(d,filemame)
422 #===========================================================================
423 def test_DumpAndLoad_Constant_ContinuousFunction_Rank0(self):
424 if loadIsConfigured():
425 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank0.nc")
426 d=Data(self.arg0,ContinuousFunction(self.domain))
427 self._diffDataObjects(d,filemame)
428
429 def test_DumpAndLoad_Constant_ContinuousFunction_Rank1(self):
430 if loadIsConfigured():
431 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank1.nc")
432 d=Data(self.arg1,ContinuousFunction(self.domain))
433 self._diffDataObjects(d,filemame)
434
435 def test_DumpAndLoad_Constant_ContinuousFunction_Rank2(self):
436 if loadIsConfigured():
437 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank2.nc")
438 d=Data(self.arg2,ContinuousFunction(self.domain))
439 self._diffDataObjects(d,filemame)
440
441 def test_DumpAndLoad_Constant_ContinuousFunction_Rank3(self):
442 if loadIsConfigured():
443 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank3.nc")
444 d=Data(self.arg3,ContinuousFunction(self.domain))
445 self._diffDataObjects(d,filemame)
446
447 def test_DumpAndLoad_Constant_ContinuousFunction_Rank4(self):
448 if loadIsConfigured():
449 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank4.nc")
450 d=Data(self.arg4,ContinuousFunction(self.domain))
451 self._diffDataObjects(d,filemame)
452
453 #===========================================================================
454 def test_DumpAndLoad_Constant_Function_Rank0(self):
455 if loadIsConfigured():
456 filemame=os.path.join(self.filename_base,"constant_function_rank0.nc")
457 d=Data(self.arg0,Function(self.domain))
458 self._diffDataObjects(d,filemame)
459
460 def test_DumpAndLoad_Constant_Function_Rank1(self):
461 if loadIsConfigured():
462 filemame=os.path.join(self.filename_base,"constant_function_rank1.nc")
463 d=Data(self.arg1,Function(self.domain))
464 self._diffDataObjects(d,filemame)
465
466 def test_DumpAndLoad_Constant_Function_Rank2(self):
467 if loadIsConfigured():
468 filemame=os.path.join(self.filename_base,"constant_function_rank2.nc")
469 d=Data(self.arg2,Function(self.domain))
470 self._diffDataObjects(d,filemame)
471
472 def test_DumpAndLoad_Constant_Function_Rank3(self):
473 if loadIsConfigured():
474 filemame=os.path.join(self.filename_base,"constant_function_rank3.nc")
475 d=Data(self.arg3,Function(self.domain))
476 self._diffDataObjects(d,filemame)
477
478 #===========================================================================
479 def test_DumpAndLoad_Constant_ReducedFunction_Rank0(self):
480 if loadIsConfigured():
481 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank0.nc")
482 d=Data(self.arg0,ReducedFunction(self.domain))
483 self._diffDataObjects(d,filemame)
484
485 def test_DumpAndLoad_Constant_ReducedFunction_Rank1(self):
486 if loadIsConfigured():
487 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank1.nc")
488 d=Data(self.arg1,ReducedFunction(self.domain))
489 self._diffDataObjects(d,filemame)
490
491 def test_DumpAndLoad_Constant_ReducedFunction_Rank2(self):
492 if loadIsConfigured():
493 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank2.nc")
494 d=Data(self.arg2,ReducedFunction(self.domain))
495 self._diffDataObjects(d,filemame)
496
497 def test_DumpAndLoad_Constant_ReducedFunction_Rank3(self):
498 if loadIsConfigured():
499 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank3.nc")
500 d=Data(self.arg3,ReducedFunction(self.domain))
501 self._diffDataObjects(d,filemame)
502 def test_DumpAndLoad_Constant_ReducedFunction_Rank4(self):
503 if loadIsConfigured():
504 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank4.nc")
505 d=Data(self.arg4,ReducedFunction(self.domain))
506 self._diffDataObjects(d,filemame)
507
508 #===========================================================================
509 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank0(self):
510 if loadIsConfigured():
511 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank0.nc")
512 d=Data(self.arg0,FunctionOnBoundary(self.domain))
513 self._diffDataObjects(d,filemame)
514
515 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank1(self):
516 if loadIsConfigured():
517 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank1.nc")
518 d=Data(self.arg1,FunctionOnBoundary(self.domain))
519 self._diffDataObjects(d,filemame)
520
521 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank2(self):
522 if loadIsConfigured():
523 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank2.nc")
524 d=Data(self.arg2,FunctionOnBoundary(self.domain))
525 self._diffDataObjects(d,filemame)
526
527 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank3(self):
528 if loadIsConfigured():
529 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank3.nc")
530 d=Data(self.arg3,FunctionOnBoundary(self.domain))
531 self._diffDataObjects(d,filemame)
532
533 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank4(self):
534 if loadIsConfigured():
535 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank4.nc")
536 d=Data(self.arg4,FunctionOnBoundary(self.domain))
537 self._diffDataObjects(d,filemame)
538
539 #===========================================================================
540 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank0(self):
541 if loadIsConfigured():
542 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank0.nc")
543 d=Data(self.arg0,FunctionOnBoundary(self.domain))
544 self._diffDataObjects(d,filemame)
545
546 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank1(self):
547 if loadIsConfigured():
548 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank1.nc")
549 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
550 self._diffDataObjects(d,filemame)
551
552 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank2(self):
553 if loadIsConfigured():
554 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank2.nc")
555 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
556 self._diffDataObjects(d,filemame)
557
558 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank3(self):
559 if loadIsConfigured():
560 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank3.nc")
561 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
562 self._diffDataObjects(d,filemame)
563
564 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank4(self):
565 if loadIsConfigured():
566 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank4.nc")
567 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
568 self._diffDataObjects(d,filemame)
569
570 #===========================================================================
571 def test_DumpAndLoad_Expanded_Solution_Rank0(self):
572 if loadIsConfigured():
573 filemame=os.path.join(self.filename_base,"expanded_solution_rank0.nc")
574 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
575 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
576 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
577 d=Data(length(Solution(self.domain).getX())*self.arg0,Solution(self.domain))
578 self._diffDataObjects(d,filemame)
579
580 def test_DumpAndLoad_Expanded_Solution_Rank1(self):
581 if loadIsConfigured():
582 filemame=os.path.join(self.filename_base,"expanded_solution_rank1.nc")
583 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
584 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
585 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
586 d=Data(length(Solution(self.domain).getX())*self.arg1,Solution(self.domain))
587 self._diffDataObjects(d,filemame)
588
589 def test_DumpAndLoad_Expanded_Solution_Rank2(self):
590 if loadIsConfigured():
591 filemame=os.path.join(self.filename_base,"expanded_solution_rank2.nc")
592 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
593 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
594 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
595 d=Data(length(Solution(self.domain).getX())*self.arg2,Solution(self.domain))
596 self._diffDataObjects(d,filemame)
597
598 def test_DumpAndLoad_Expanded_Solution_Rank3(self):
599 if loadIsConfigured():
600 filemame=os.path.join(self.filename_base,"expanded_solution_rank3.nc")
601 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
602 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
603 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
604 d=Data(length(Solution(self.domain).getX())*self.arg3,Solution(self.domain))
605 self._diffDataObjects(d,filemame)
606
607 def test_DumpAndLoad_Expanded_Solution_Rank4(self):
608 if loadIsConfigured():
609 filemame=os.path.join(self.filename_base,"expanded_solution_rank4.nc")
610 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
611 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
612 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
613 d=Data(length(Solution(self.domain).getX())*self.arg4,Solution(self.domain))
614 self._diffDataObjects(d,filemame)
615 #===========================================================================
616 def test_DumpAndLoad_Expanded_ReducedSolution_Rank0(self):
617 if loadIsConfigured():
618 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank0.nc")
619 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
620 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
621 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
622 d=Data(length(ReducedSolution(self.domain).getX())*self.arg0,ReducedSolution(self.domain))
623 self._diffDataObjects(d,filemame)
624
625 def test_DumpAndLoad_Expanded_ReducedSolution_Rank1(self):
626 if loadIsConfigured():
627 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank1.nc")
628 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
629 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
630 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
631 d=Data(length(ReducedSolution(self.domain).getX())*self.arg1,ReducedSolution(self.domain))
632 self._diffDataObjects(d,filemame)
633
634 def test_DumpAndLoad_Expanded_ReducedSolution_Rank2(self):
635 if loadIsConfigured():
636 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank2.nc")
637 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
638 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
639 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
640 d=Data(length(ReducedSolution(self.domain).getX())*self.arg2,ReducedSolution(self.domain))
641 self._diffDataObjects(d,filemame)
642
643 def test_DumpAndLoad_Expanded_ReducedSolution_Rank3(self):
644 if loadIsConfigured():
645 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank3.nc")
646 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
647 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
648 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
649 d=Data(length(ReducedSolution(self.domain).getX())*self.arg3,ReducedSolution(self.domain))
650 self._diffDataObjects(d,filemame)
651
652 def test_DumpAndLoad_Expanded_ReducedSolution_Rank4(self):
653 if loadIsConfigured():
654 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank4.nc")
655 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
656 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
657 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
658 d=Data(length(ReducedSolution(self.domain).getX())*self.arg4,ReducedSolution(self.domain))
659 self._diffDataObjects(d,filemame)
660 #===========================================================================
661 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank0(self):
662 if loadIsConfigured():
663 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank0.nc")
664 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
665 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
666 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
667 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg0,ContinuousFunction(self.domain))
668 self._diffDataObjects(d,filemame)
669
670 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank1(self):
671 if loadIsConfigured():
672 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank1.nc")
673 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
674 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
675 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
676 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg1,ContinuousFunction(self.domain))
677 self._diffDataObjects(d,filemame)
678
679 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank2(self):
680 if loadIsConfigured():
681 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank2.nc")
682 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
683 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
684 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
685 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg2,ContinuousFunction(self.domain))
686 self._diffDataObjects(d,filemame)
687
688 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank3(self):
689 if loadIsConfigured():
690 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank3.nc")
691 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg3,ContinuousFunction(self.domain))
692 self._diffDataObjects(d,filemame)
693
694 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank4(self):
695 if loadIsConfigured():
696 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank4.nc")
697 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
698 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
699 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
700 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg4,ContinuousFunction(self.domain))
701 self._diffDataObjects(d,filemame)
702
703 #===========================================================================
704 def test_DumpAndLoad_Expanded_Function_Rank0(self):
705 if loadIsConfigured():
706 filemame=os.path.join(self.filename_base,"expanded_function_rank0.nc")
707 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
708 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
709 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
710 d=Data(length(Function(self.domain).getX())*self.arg0,Function(self.domain))
711 self._diffDataObjects(d,filemame)
712
713 def test_DumpAndLoad_Expanded_Function_Rank1(self):
714 if loadIsConfigured():
715 filemame=os.path.join(self.filename_base,"expanded_function_rank1.nc")
716 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
717 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
718 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
719 d=Data(length(Function(self.domain).getX())*self.arg1,Function(self.domain))
720 self._diffDataObjects(d,filemame)
721
722 def test_DumpAndLoad_Expanded_Function_Rank2(self):
723 if loadIsConfigured():
724 filemame=os.path.join(self.filename_base,"expanded_function_rank2.nc")
725 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
726 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
727 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
728 d=Data(length(Function(self.domain).getX())*self.arg2,Function(self.domain))
729 self._diffDataObjects(d,filemame)
730
731 def test_DumpAndLoad_Expanded_Function_Rank3(self):
732 if loadIsConfigured():
733 filemame=os.path.join(self.filename_base,"expanded_function_rank3.nc")
734 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
735 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
736 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
737 d=Data(length(Function(self.domain).getX())*self.arg3,Function(self.domain))
738 self._diffDataObjects(d,filemame)
739
740 def test_DumpAndLoad_Expanded_Function_Rank4(self):
741 if loadIsConfigured():
742 filemame=os.path.join(self.filename_base,"expanded_function_rank4.nc")
743 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
744 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
745 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
746 d=Data(length(Function(self.domain).getX())*self.arg4,Function(self.domain))
747 self._diffDataObjects(d,filemame)
748
749 #===========================================================================
750 def test_DumpAndLoad_Expanded_ReducedFunction_Rank0(self):
751 if loadIsConfigured():
752 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank0.nc")
753 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
754 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
755 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
756 d=Data(length(ReducedFunction(self.domain).getX())*self.arg0,ReducedFunction(self.domain))
757 self._diffDataObjects(d,filemame)
758
759 def test_DumpAndLoad_Expanded_ReducedFunction_Rank1(self):
760 if loadIsConfigured():
761 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank1.nc")
762 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
763 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
764 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
765 d=Data(length(ReducedFunction(self.domain).getX())*self.arg1,ReducedFunction(self.domain))
766 self._diffDataObjects(d,filemame)
767
768 def test_DumpAndLoad_Expanded_ReducedFunction_Rank2(self):
769 if loadIsConfigured():
770 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank2.nc")
771 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
772 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
773 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
774 d=Data(length(ReducedFunction(self.domain).getX())*self.arg2,ReducedFunction(self.domain))
775 self._diffDataObjects(d,filemame)
776
777 def test_DumpAndLoad_Expanded_ReducedFunction_Rank3(self):
778 if loadIsConfigured():
779 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank3.nc")
780 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
781 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
782 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
783 d=Data(length(ReducedFunction(self.domain).getX())*self.arg3,ReducedFunction(self.domain))
784 self._diffDataObjects(d,filemame)
785
786 def test_DumpAndLoad_Expanded_ReducedFunction_Rank4(self):
787 if loadIsConfigured():
788 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank4.nc")
789 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
790 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
791 # elements are not in different order: self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
792 d=Data(length(ReducedFunction(self.domain).getX())*self.arg4,ReducedFunction(self.domain))
793 self._diffDataObjects(d,filemame)
794
795 #===========================================================================
796 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank0(self):
797 if loadIsConfigured():
798 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank0.nc")
799 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
800 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
801 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
802 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg0,FunctionOnBoundary(self.domain))
803 self._diffDataObjects(d,filemame)
804
805 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank1(self):
806 if loadIsConfigured():
807 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank1.nc")
808 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
809 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
810 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
811 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg1,FunctionOnBoundary(self.domain))
812 self._diffDataObjects(d,filemame)
813
814 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank2(self):
815 if loadIsConfigured():
816 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank2.nc")
817 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
818 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
819 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
820 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg2,FunctionOnBoundary(self.domain))
821 self._diffDataObjects(d,filemame)
822
823 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank3(self):
824 if loadIsConfigured():
825 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank3.nc")
826 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
827 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
828 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
829 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg3,FunctionOnBoundary(self.domain))
830 self._diffDataObjects(d,filemame)
831
832 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank4(self):
833 if loadIsConfigured():
834 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank4.nc")
835 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
836 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
837 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
838 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg4,FunctionOnBoundary(self.domain))
839 self._diffDataObjects(d,filemame)
840
841 #===========================================================================
842 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank0(self):
843 if loadIsConfigured():
844 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank0.nc")
845 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
846 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
847 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
848 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg0,ReducedFunctionOnBoundary(self.domain))
849 self._diffDataObjects(d,filemame)
850
851 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank1(self):
852 if loadIsConfigured():
853 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank1.nc")
854 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
855 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
856 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
857 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg1,ReducedFunctionOnBoundary(self.domain))
858 self._diffDataObjects(d,filemame)
859
860 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank2(self):
861 if loadIsConfigured():
862 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank2.nc")
863 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
864 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
865 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
866 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg2,ReducedFunctionOnBoundary(self.domain))
867 self._diffDataObjects(d,filemame)
868
869 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank3(self):
870 if loadIsConfigured():
871 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank3.nc")
872 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
873 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
874 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
875 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg3,ReducedFunctionOnBoundary(self.domain))
876 self._diffDataObjects(d,filemame)
877
878 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank4(self):
879 if loadIsConfigured():
880 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank4.nc")
881 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
882 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
883 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_sample_ordering)
884 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg4,ReducedFunctionOnBoundary(self.domain))
885 self._diffDataObjects(d,filemame)
886
887 #===========================================================================
888 def test_DumpAndLoad_Tagged_Solution_Rank0(self):
889 if loadIsConfigured():
890 filemame=os.path.join(self.filename_base,"tagged_solution_rank0.nc")
891 d=Data(self.arg0,Solution(self.domain))
892 d.setTaggedValue(1,self.arg0*2)
893 d.setTaggedValue(10,self.arg0*3)
894 d.setTaggedValue(100,self.arg0*4)
895 self._diffDataObjects(d,filemame)
896
897 def test_DumpAndLoad_Tagged_Solution_Rank1(self):
898 if loadIsConfigured():
899 filemame=os.path.join(self.filename_base,"tagged_solution_rank1.nc")
900 d=Data(self.arg1,Solution(self.domain))
901 d.setTaggedValue(1,self.arg1*2)
902 d.setTaggedValue(10,self.arg1*3)
903 d.setTaggedValue(100,self.arg1*4)
904 self._diffDataObjects(d,filemame)
905
906 def test_DumpAndLoad_Tagged_Solution_Rank2(self):
907 if loadIsConfigured():
908 filemame=os.path.join(self.filename_base,"tagged_solution_rank2.nc")
909 d=Data(self.arg2,Solution(self.domain))
910 d.setTaggedValue(1,self.arg2*2)
911 d.setTaggedValue(10,self.arg2*3)
912 d.setTaggedValue(100,self.arg2*4)
913 self._diffDataObjects(d,filemame)
914
915 def test_DumpAndLoad_Tagged_Solution_Rank3(self):
916 if loadIsConfigured():
917 filemame=os.path.join(self.filename_base,"tagged_solution_rank3.nc")
918 d=Data(self.arg3,Solution(self.domain))
919 d.setTaggedValue(1,self.arg3*2)
920 d.setTaggedValue(10,self.arg3*3)
921 d.setTaggedValue(100,self.arg3*4)
922 self._diffDataObjects(d,filemame)
923
924 def test_DumpAndLoad_Tagged_Solution_Rank4(self):
925 if loadIsConfigured():
926 filemame=os.path.join(self.filename_base,"tagged_solution_rank4.nc")
927 d=Data(self.arg4,Solution(self.domain))
928 d.setTaggedValue(1,self.arg4*2)
929 d.setTaggedValue(10,self.arg4*3)
930 d.setTaggedValue(100,self.arg4*4)
931 self._diffDataObjects(d,filemame)
932 #===========================================================================
933 def test_DumpAndLoad_Tagged_ReducedSolution_Rank0(self):
934 if loadIsConfigured():
935 filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank0.nc")
936 d=Data(self.arg0,ReducedSolution(self.domain))
937 d.setTaggedValue(1,self.arg0*2)
938 d.setTaggedValue(10,self.arg0*3)
939 d.setTaggedValue(100,self.arg0*4)
940 self._diffDataObjects(d,filemame)
941
942 def test_DumpAndLoad_Tagged_ReducedSolution_Rank1(self):
943 if loadIsConfigured():
944 filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank1.nc")
945 d=Data(self.arg1,ReducedSolution(self.domain))
946 d.setTaggedValue(1,self.arg1*2)
947 d.setTaggedValue(10,self.arg1*3)
948 d.setTaggedValue(100,self.arg1*4)
949 self._diffDataObjects(d,filemame)
950
951 def test_DumpAndLoad_Tagged_ReducedSolution_Rank2(self):
952 if loadIsConfigured():
953 filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank2.nc")
954 d=Data(self.arg2,ReducedSolution(self.domain))
955 d.setTaggedValue(1,self.arg2*2)
956 d.setTaggedValue(10,self.arg2*3)
957 d.setTaggedValue(100,self.arg2*4)
958 self._diffDataObjects(d,filemame)
959
960 def test_DumpAndLoad_Tagged_ReducedSolution_Rank3(self):
961 if loadIsConfigured():
962 filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank3.nc")
963 d=Data(self.arg3,ReducedSolution(self.domain))
964 d.setTaggedValue(1,self.arg3*2)
965 d.setTaggedValue(10,self.arg3*3)
966 d.setTaggedValue(100,self.arg3*4)
967 self._diffDataObjects(d,filemame)
968
969 def test_DumpAndLoad_Tagged_ReducedSolution_Rank4(self):
970 if loadIsConfigured():
971 filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank4.nc")
972 d=Data(self.arg4,ReducedSolution(self.domain))
973 d.setTaggedValue(1,self.arg4*2)
974 d.setTaggedValue(10,self.arg4*3)
975 d.setTaggedValue(100,self.arg4*4)
976 self._diffDataObjects(d,filemame)
977 #===========================================================================
978 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank0(self):
979 if loadIsConfigured():
980 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank0.nc")
981 d=Data(self.arg0,ContinuousFunction(self.domain))
982 d.setTaggedValue(1,self.arg0*2)
983 d.setTaggedValue(10,self.arg0*3)
984 d.setTaggedValue(100,self.arg0*4)
985 self._diffDataObjects(d,filemame)
986
987 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank1(self):
988 if loadIsConfigured():
989 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank1.nc")
990 d=Data(self.arg1,ContinuousFunction(self.domain))
991 d.setTaggedValue(1,self.arg1*2)
992 d.setTaggedValue(10,self.arg1*3)
993 d.setTaggedValue(100,self.arg1*4)
994 self._diffDataObjects(d,filemame)
995
996 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank2(self):
997 if loadIsConfigured():
998 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank2.nc")
999 d=Data(self.arg2,ContinuousFunction(self.domain))
1000 d.setTaggedValue(1,self.arg2*2)
1001 d.setTaggedValue(10,self.arg2*3)
1002 d.setTaggedValue(100,self.arg2*4)
1003 self._diffDataObjects(d,filemame)
1004
1005 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank3(self):
1006 if loadIsConfigured():
1007 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank3.nc")
1008 d=Data(self.arg3,ContinuousFunction(self.domain))
1009 d.setTaggedValue(1,self.arg3*2)
1010 d.setTaggedValue(10,self.arg3*3)
1011 d.setTaggedValue(100,self.arg3*4)
1012 self._diffDataObjects(d,filemame)
1013
1014 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank4(self):
1015 if loadIsConfigured():
1016 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank4.nc")
1017 d=Data(self.arg4,ContinuousFunction(self.domain))
1018 d.setTaggedValue(1,self.arg4*2)
1019 d.setTaggedValue(10,self.arg4*3)
1020 d.setTaggedValue(100,self.arg4*4)
1021 self._diffDataObjects(d,filemame)
1022
1023 #===========================================================================
1024 def test_DumpAndLoad_Tagged_Function_Rank0(self):
1025 if loadIsConfigured():
1026 filemame=os.path.join(self.filename_base,"tagged_function_rank0.nc")
1027 d=Data(self.arg0,Function(self.domain))
1028 d.setTaggedValue(1,self.arg0*2)
1029 d.setTaggedValue(10,self.arg0*3)
1030 d.setTaggedValue(100,self.arg0*4)
1031 self._diffDataObjects(d,filemame)
1032
1033 def test_DumpAndLoad_Tagged_Function_Rank1(self):
1034 if loadIsConfigured():
1035 filemame=os.path.join(self.filename_base,"tagged_function_rank1.nc")
1036 d=Data(self.arg1,Function(self.domain))
1037 d.setTaggedValue(1,self.arg1*2)
1038 d.setTaggedValue(10,self.arg1*3)
1039 d.setTaggedValue(100,self.arg1*4)
1040 self._diffDataObjects(d,filemame)
1041
1042 def test_DumpAndLoad_Tagged_Function_Rank2(self):
1043 if loadIsConfigured():
1044 filemame=os.path.join(self.filename_base,"tagged_function_rank2.nc")
1045 d=Data(self.arg2,Function(self.domain))
1046 d.setTaggedValue(1,self.arg2*2)
1047 d.setTaggedValue(10,self.arg2*3)
1048 d.setTaggedValue(100,self.arg2*4)
1049 self._diffDataObjects(d,filemame)
1050
1051 def test_DumpAndLoad_Tagged_Function_Rank3(self):
1052 if loadIsConfigured():
1053 filemame=os.path.join(self.filename_base,"tagged_function_rank3.nc")
1054 d=Data(self.arg3,Function(self.domain))
1055 d.setTaggedValue(1,self.arg3*2)
1056 d.setTaggedValue(10,self.arg3*3)
1057 d.setTaggedValue(100,self.arg3*4)
1058 self._diffDataObjects(d,filemame)
1059
1060 def test_DumpAndLoad_Tagged_Function_Rank4(self):
1061 if loadIsConfigured():
1062 filemame=os.path.join(self.filename_base,"tagged_function_rank4.nc")
1063 d=Data(self.arg4,Function(self.domain))
1064 d.setTaggedValue(1,self.arg4*2)
1065 d.setTaggedValue(10,self.arg4*3)
1066 d.setTaggedValue(100,self.arg4*4)
1067 self._diffDataObjects(d,filemame)
1068
1069 #===========================================================================
1070 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank0(self):
1071 if loadIsConfigured():
1072 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank0.nc")
1073 d=Data(self.arg0,FunctionOnBoundary(self.domain))
1074 d.setTaggedValue(1,self.arg0*2)
1075 d.setTaggedValue(10,self.arg0*3)
1076 d.setTaggedValue(100,self.arg0*4)
1077 self._diffDataObjects(d,filemame)
1078
1079 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank1(self):
1080 if loadIsConfigured():
1081 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank1.nc")
1082 d=Data(self.arg1,FunctionOnBoundary(self.domain))
1083 d.setTaggedValue(1,self.arg1*2)
1084 d.setTaggedValue(10,self.arg1*3)
1085 d.setTaggedValue(100,self.arg1*4)
1086 self._diffDataObjects(d,filemame)
1087
1088 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank2(self):
1089 if loadIsConfigured():
1090 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank2.nc")
1091 d=Data(self.arg2,FunctionOnBoundary(self.domain))
1092 d.setTaggedValue(1,self.arg2*2)
1093 d.setTaggedValue(10,self.arg2*3)
1094 d.setTaggedValue(100,self.arg2*4)
1095 self._diffDataObjects(d,filemame)
1096
1097 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank3(self):
1098 if loadIsConfigured():
1099 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank3.nc")
1100 d=Data(self.arg3,FunctionOnBoundary(self.domain))
1101 d.setTaggedValue(1,self.arg3*2)
1102 d.setTaggedValue(10,self.arg3*3)
1103 d.setTaggedValue(100,self.arg3*4)
1104 self._diffDataObjects(d,filemame)
1105
1106 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank4(self):
1107 if loadIsConfigured():
1108 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank4.nc")
1109 d=Data(self.arg4,FunctionOnBoundary(self.domain))
1110 d.setTaggedValue(1,self.arg4*2)
1111 d.setTaggedValue(10,self.arg4*3)
1112 d.setTaggedValue(100,self.arg4*4)
1113 self._diffDataObjects(d,filemame)
1114 #===========================================================================
1115 def test_DumpAndLoad_Tagged_ReducedFunction_Rank0(self):
1116 if loadIsConfigured():
1117 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank0.nc")
1118 d=Data(self.arg0,ReducedFunction(self.domain))
1119 d.setTaggedValue(1,self.arg0*2)
1120 d.setTaggedValue(10,self.arg0*3)
1121 d.setTaggedValue(100,self.arg0*4)
1122 self._diffDataObjects(d,filemame)
1123
1124 def test_DumpAndLoad_Tagged_ReducedFunction_Rank1(self):
1125 if loadIsConfigured():
1126 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank1.nc")
1127 d=Data(self.arg1,ReducedFunction(self.domain))
1128 d.setTaggedValue(1,self.arg1*2)
1129 d.setTaggedValue(10,self.arg1*3)
1130 d.setTaggedValue(100,self.arg1*4)
1131 self._diffDataObjects(d,filemame)
1132
1133 def test_DumpAndLoad_Tagged_ReducedFunction_Rank2(self):
1134 if loadIsConfigured():
1135 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank2.nc")
1136 d=Data(self.arg2,ReducedFunction(self.domain))
1137 d.setTaggedValue(1,self.arg2*2)
1138 d.setTaggedValue(10,self.arg2*3)
1139 d.setTaggedValue(100,self.arg2*4)
1140 self._diffDataObjects(d,filemame)
1141
1142 def test_DumpAndLoad_Tagged_ReducedFunction_Rank3(self):
1143 if loadIsConfigured():
1144 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank3.nc")
1145 d=Data(self.arg3,ReducedFunction(self.domain))
1146 d.setTaggedValue(1,self.arg3*2)
1147 d.setTaggedValue(10,self.arg3*3)
1148 d.setTaggedValue(100,self.arg3*4)
1149 self._diffDataObjects(d,filemame)
1150
1151 def test_DumpAndLoad_Tagged_ReducedFunction_Rank4(self):
1152 if loadIsConfigured():
1153 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank4.nc")
1154 d=Data(self.arg4,ReducedFunction(self.domain))
1155 d.setTaggedValue(1,self.arg4*2)
1156 d.setTaggedValue(10,self.arg4*3)
1157 d.setTaggedValue(100,self.arg4*4)
1158 self._diffDataObjects(d,filemame)
1159
1160 #===========================================================================
1161 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank0(self):
1162 if loadIsConfigured():
1163 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank0.nc")
1164 d=Data(self.arg0,ReducedFunctionOnBoundary(self.domain))
1165 d.setTaggedValue(1,self.arg0*2)
1166 d.setTaggedValue(10,self.arg0*3)
1167 d.setTaggedValue(100,self.arg0*4)
1168 self._diffDataObjects(d,filemame)
1169
1170 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank1(self):
1171 if loadIsConfigured():
1172 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank1.nc")
1173 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
1174 d.setTaggedValue(1,self.arg1*2)
1175 d.setTaggedValue(10,self.arg1*3)
1176 d.setTaggedValue(100,self.arg1*4)
1177 self._diffDataObjects(d,filemame)
1178
1179 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank2(self):
1180 if loadIsConfigured():
1181 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank2.nc")
1182 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
1183 d.setTaggedValue(1,self.arg2*2)
1184 d.setTaggedValue(10,self.arg2*3)
1185 d.setTaggedValue(100,self.arg2*4)
1186 self._diffDataObjects(d,filemame)
1187
1188 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank3(self):
1189 if loadIsConfigured():
1190 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank3.nc")
1191 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
1192 d.setTaggedValue(1,self.arg3*2)
1193 d.setTaggedValue(10,self.arg3*3)
1194 d.setTaggedValue(100,self.arg3*4)
1195 self._diffDataObjects(d,filemame)
1196
1197 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank4(self):
1198 if loadIsConfigured():
1199 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank4.nc")
1200 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
1201 d.setTaggedValue(1,self.arg4*2)
1202 d.setTaggedValue(10,self.arg4*3)
1203 d.setTaggedValue(100,self.arg4*4)
1204 self._diffDataObjects(d,filemame)
1205

  ViewVC Help
Powered by ViewVC 1.1.26