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

  ViewVC Help
Powered by ViewVC 1.1.26