/[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 2799 - (show annotations)
Thu Dec 3 01:35:08 2009 UTC (11 years, 6 months ago) by jfenwick
File MIME type: text/x-python
File size: 84439 byte(s)
resolveGroup function added to python.
Unit tests for resolveGroup, resolve and delay.
1
2 ########################################################
3 #
4 # Copyright (c) 2003-2009 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au/esscc
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="https://launchpad.net/escript-finley"
21
22 """
23 Test suite for data objects. at the moment for dump and load only.
24
25 The tests must be linked with some function space class object in the setUp method:
26 to run the use:
27
28 from esys.finley import Brick
29 class Test_DumpOnFinley(Test_Dump):
30 def setUp(self):
31 self.domain =Rectangle(NE,NE+1,2)
32 self.domain_with_different_number_of_samples =Rectangle(2*NE,NE+1,2)
33 self.domain_with_different_number_of_data_points_per_sample =Rectangle(2*NE,NE+1,2,integrationOrder=2)
34 self.domain_with_different_sample_ordering =Rectangle(1,(NE+1)*NE,2)
35 self.filename_base="."
36
37 suite = unittest.TestSuite()
38 suite.addTest(unittest.makeSuite(Test_DumpOnFinley))
39 unittest.TextTestRunner(verbosity=2).run(suite)
40
41 :var __author__: name of author
42 :var __copyright__: copyrights
43 :var __license__: licence agreement
44 :var __url__: url entry point on documentation
45 :var __version__: version
46 :var __date__: date of the version
47 """
48
49 __author__="Lutz Gross, l.gross@uq.edu.au"
50
51 import unittest
52 import os
53 import numpy
54 from esys.escript import *
55
56
57 class Test_TableInterpolation(unittest.TestCase):
58 RES_TOL=1.e-7 # RES_TOLerance to compare results
59
60
61 def test_NullFunctionSpace(self):
62 arL=[[0, -1, -2, -3, -4], [1, 1, -2, -3, -4], [2, 2, 2, -3, -4], [3, 3, 3, 3, -4], [4, 4, 4, 4, 4]]
63 arn=numpy.array(arL)
64 ars=[arL,arn]
65 d0=Data(0)
66 d1=Data(1)
67 d2=Data(2)
68 d35=Data(3.5)
69 d4=Data(4)
70 dm05=Data(-0.5)
71 d175=Data(1.75)
72 d225=Data(2.25)
73 for arr in ars:
74 self.failUnless(Lsup(d1.interpolateTable(arL,0, 1, d2, 0, 1, 100)+2)<self.RES_TOL)
75 self.failUnless(Lsup(d1.interpolateTable(arL,0, 1, d35, 0, 1, 100)+3.5)<self.RES_TOL)
76 self.failUnless(Lsup(d35.interpolateTable(arL,0,1, d2, 0, 1, 100)-3.5)<self.RES_TOL)
77 self.failUnless(Lsup(d175.interpolateTable(arL,0,1,d225,0,1, 100)-0)<self.RES_TOL)
78 # Point out of bounds
79 self.failUnlessRaises(RuntimeError, d1.interpolateTable,arL,0, 1, d4, 0, 0.5, 100, check_boundaries=True )
80 self.failUnlessRaises(RuntimeError, d4.interpolateTable, arL,0, 0.5, d1, 0, 1, 100, check_boundaries=True )
81 self.failUnlessRaises(RuntimeError, dm05.interpolateTable, arL,0,1, d1 , 0,1, 100, check_boundaries=True )
82 self.failUnlessRaises(RuntimeError, d1.interpolateTable, arL,0,1, dm05 , 0,1, 100,check_boundaries=True )
83 #Test to ensure not check_boundaries does not throw in the above cases
84 d1.interpolateTable(arL,0, 1, d4, 0, 0.5, 100, check_boundaries=False)
85 d4.interpolateTable( arL,0, 0.5, d1, 0, 1, 100, check_boundaries=False )
86 dm05.interpolateTable( arL,0,1, d1 , 0,1, 100, check_boundaries=False )
87 d1.interpolateTable( arL,0,1, dm05 , 0,1, 100,check_boundaries=False )
88
89 # interpolated value too large
90 self.failUnlessRaises(RuntimeError, d2.interpolateTable, arL, 0, 1, d2, 0, 1, 1 )
91
92
93 def test_FunctionSpace2D(self):
94 vs=[(1,3,5,7), (-1,1,-1,1), (0.5, 17, 0.25, 42)] #There is no particular significance to these numbers
95 for fs in self.functionspaces:
96 print fs
97 points=fs.getX()
98 for t in vs:
99 v0, v1, v2, v3 =t
100 x=points[0]
101 y=points[1]
102 xmax=sup(x)
103 xmin=inf(x)
104 ymax=sup(y)
105 ymin=inf(y)
106 xwidth=(xmax-xmin)/(self.xn-1)
107 ywidth=(ymax-ymin)/(self.yn-1)
108 table=[]
109 for j in xrange(self.yn):
110 row=[]
111 for i in xrange(self.xn):
112 row.append(v0+v1*xwidth*i+v2*ywidth*j+v3*i*j*xwidth*ywidth)
113 table.append(row)
114 ref=v0+v1*(x-xmin)+v2*(y-ymin)+v3*(x-xmin)*(y-ymin)
115 lsupref=Lsup(ref)
116 if lsupref!=0 and xwidth>0: #This will happen in cases where there are no samples on this rank
117 res=y.interpolateTable(table,ymin,ywidth,x, xmin, xwidth,500)
118 self.failUnless(Lsup(res-ref)/Lsup(ref)<self.RES_TOL,"Failed for %s"%str(fs))
119
120
121 def test_FunctionSpace1D(self):
122 vs=[(1,3), (-1,1), (0.5, 17)] #There is no particular significance to these numbers
123 for fs in self.functionspaces:
124 print fs
125 points=fs.getX()
126 for t in vs:
127 v0, v1 =t
128 x=points[0]
129 xmax=sup(x)
130 xmin=inf(x)
131 xwidth=(xmax-xmin)/(self.xn-1)
132 table=[]
133 for i in xrange(self.xn):
134 table.append(v0+v1*xwidth*i)
135 ref=v0+v1*(x-xmin)
136 lsupref=Lsup(ref)
137 if lsupref!=0 and xwidth>0: #This will happen in cases where there are no samples on this rank
138 res=x.interpolateTable(table, xmin, xwidth,500)
139 self.failUnless(Lsup(res-ref)/lsupref<self.RES_TOL,"Failed for %s"%str(fs))
140
141 class Test_saveCSV(unittest.TestCase):
142
143 def test_save1(self):
144 X=self.domain.getX()
145 X0=X[0]
146 fname="test_save1.csv"
147 saveDataCSV(fname,C=X, D=X0)
148 saveDataCSV(fname,append=True, J=X0, H=X)
149 self.failUnless(os.path.exists(fname), "test file not created")
150 f=open(fname,'r')
151 line=f.readline()
152 self.failUnless(line=="C_0, C_1, D\n") #This tests both separator strings
153 #Now we find out how many rows it has
154 linecount=0
155 while line != '':
156 linecount+=1
157 line=f.readline()
158 self.failUnless(linecount!=self.linecount1*2)
159 f.close()
160 #Now to other output
161 T2=Tensor(7,X.getFunctionSpace())
162 T3=Tensor3(8,X.getFunctionSpace())
163 T4=Tensor4(9,X.getFunctionSpace())
164 saveDataCSV(fname,A=T2,B=T3,C=T4)
165 f=open(fname,'r')
166 line=f.readline()
167 self.failUnless(line=='A_0_0, A_1_0, A_0_1, A_1_1, B_0_0_0, B_0_0_1, B_1_0_0, B_1_0_1, B_0_1_0, B_0_1_1, B_1_1_0, B_1_1_1, C_0_0_0_0, C_0_0_0_1, C_0_0_1_0, C_0_0_1_1, C_1_0_0_0, C_1_0_0_1, C_1_0_1_0, C_1_0_1_1, C_0_1_0_0, C_0_1_0_1, C_0_1_1_0, C_0_1_1_1, C_1_1_0_0, C_1_1_0_1, C_1_1_1_0, C_1_1_1_1\n')
168 line=f.readline()
169 line_expected=[7.]*4+[8.]*8+[9.]*16
170 line_got=[float(elt) for elt in line.split(',')]
171 self.failUnless(line_got==line_expected)
172 linecount=1
173 while line != '':
174 linecount+=1
175 line=f.readline()
176 self.failUnless(linecount!=self.linecount1)
177 f.close()
178 #Now to test separators and mask
179 saveDataCSV(fname, sep="|",csep="/", U=X, V=X0, mask=X0)
180 f=open(fname,'r')
181 line=f.readline()
182 self.failUnless(line=='U/0|U/1|V\n')
183 line=f.readline()
184 line_expected=[0.125, 0., 0.125]
185 line_got=[float(elt) for elt in line.split('|')]
186 self.failUnless(line_expected==line_got)
187 linecount=1
188 while line!='':
189 linecount+=1
190 line=f.readline()
191 self.failUnless(linecount==self.linecount2)
192
193
194 class Test_Domain(unittest.TestCase):
195
196 def test_getListOfTags(self): # requires self.boundary_tag_list
197 tags=FunctionOnBoundary(self.domain).getListOfTags()
198 self.failUnless(len(self.boundary_tag_list) == len(tags), "tag list length does not match")
199 for i in self.boundary_tag_list:
200 self.failUnless(i in tags, "tag %s is missing."%i)
201
202 def test_addTags(self):
203 tag1="A"
204 tag2="B"
205 tag3="C"
206 self.domain.setTagMap(tag1,1)
207 self.failUnless(self.domain.isValidTagName(tag1))
208 self.failUnless(not self.domain.isValidTagName(tag2))
209 self.domain.setTagMap(tag2,2)
210 self.failUnless(self.domain.isValidTagName(tag1))
211 self.failUnless(self.domain.isValidTagName(tag2))
212 self.failUnless(not self.domain.isValidTagName(tag3))
213 self.failUnless(self.domain.getTag(tag1)==1)
214 self.failUnless(self.domain.getTag(tag2)==2)
215 self.failUnlessRaises(RuntimeError,self.domain.getTag,tag3)
216
217 # set tag:
218 s=Scalar(0,Function(self.domain))
219 r=Scalar(0,Function(self.domain))
220 s.setTaggedValue(tag1,1.)
221 r.setTaggedValue(1,1.)
222 s.setTaggedValue(tag2,2.)
223 r.setTaggedValue(2,2.)
224 self.failUnlessRaises(RuntimeError,s.setTaggedValue,tag3,3.) #tag3 does not exist
225 self.failUnless(Lsup(s-r)<=0.)
226 # get tag:
227 names=getTagNames(self.domain)
228 self.failUnless(len(names) == 6)
229 self.failUnless( tag1 in names )
230 self.failUnless( tag2 in names )
231 self.failUnless(self.domain.isValidTagName(tag1))
232 self.failUnless(self.domain.isValidTagName(tag2))
233 # insert tag shortcut:
234 s2=insertTaggedValues(Scalar(0,Function(self.domain)),**{ tag1 : 1., tag2 : 2.})
235 self.failUnless(Lsup(s2-r)<=0.)
236 def test_functionspace_ContinuousFunction(self):
237 fs=ContinuousFunction(self.domain)
238 self.failUnless(fs.getDomain()==self.domain)
239 self.failUnless(self.domain.getDim() == fs.getDim())
240 x=fs.getX()
241 self.failUnless(x.getFunctionSpace() == fs)
242 self.failUnless(x.getShape() == (fs.getDim(),))
243 self.failUnless(inf(x[0])>=0.)
244 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
245 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
246 self.failUnless(sup(x[0])<=1.)
247 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
248 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
249
250 def test_functionspace_Solution(self):
251 fs=Solution(self.domain)
252 self.failUnless(fs.getDomain()==self.domain)
253 self.failUnless(self.domain.getDim() == fs.getDim())
254 x=fs.getX()
255 self.failUnless(x.getFunctionSpace() == fs)
256 self.failUnless(x.getShape() == (fs.getDim(),))
257 self.failUnless(inf(x[0])>=0.)
258 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
259 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
260 self.failUnless(sup(x[0])<=1.)
261 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
262 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
263
264 def test_functionspace_ReducedSolution(self):
265 fs=ReducedSolution(self.domain)
266 self.failUnless(fs.getDomain()==self.domain)
267 self.failUnless(self.domain.getDim() == fs.getDim())
268 x=fs.getX()
269 self.failUnless(x.getFunctionSpace() == fs)
270 self.failUnless(x.getShape() == (fs.getDim(),))
271 self.failUnless(inf(x[0])>=0.)
272 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
273 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
274 self.failUnless(sup(x[0])<=1.)
275 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
276 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
277
278 def test_functionspace_Function(self):
279 fs=Function(self.domain)
280 self.failUnless(fs.getDomain()==self.domain)
281 self.failUnless(self.domain.getDim() == fs.getDim())
282 x=fs.getX()
283 self.failUnless(x.getFunctionSpace() == fs)
284 self.failUnless(x.getShape() == (fs.getDim(),))
285 self.failUnless(inf(x[0])>=0.)
286 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
287 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
288 self.failUnless(sup(x[0])<=1.)
289 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
290 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
291
292 def test_functionspace_ReducedFunction(self):
293 fs=ReducedFunction(self.domain)
294 self.failUnless(fs.getDomain()==self.domain)
295 self.failUnless(self.domain.getDim() == fs.getDim())
296 x=fs.getX()
297 self.failUnless(x.getFunctionSpace() == fs)
298 self.failUnless(x.getShape() == (fs.getDim(),))
299 self.failUnless(inf(x[0])>=0.)
300 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
301 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
302 self.failUnless(sup(x[0])<=1.)
303 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
304 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
305 def test_functionspace_FunctionOnBoundary(self):
306 fs=FunctionOnBoundary(self.domain)
307 self.failUnless(fs.getDomain()==self.domain)
308 self.failUnless(self.domain.getDim() == fs.getDim())
309 x=fs.getX()
310 self.failUnless(x.getFunctionSpace() == fs)
311 self.failUnless(x.getShape() == (fs.getDim(),))
312 self.failUnless(inf(x[0])>=0.)
313 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
314 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
315 self.failUnless(sup(x[0])<=1.)
316 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
317 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
318
319 def test_functionspace_ReducedFunctionOnBoundary(self):
320 fs=ReducedFunctionOnBoundary(self.domain)
321 self.failUnless(fs.getDomain()==self.domain)
322 self.failUnless(self.domain.getDim() == fs.getDim())
323 x=fs.getX()
324 self.failUnless(x.getFunctionSpace() == fs)
325 self.failUnless(x.getShape() == (fs.getDim(),))
326 self.failUnless(inf(x[0])>=0.)
327 if self.domain.getDim()>1: self.failUnless(inf(x[1])>=0.)
328 if self.domain.getDim()>2: self.failUnless(inf(x[2])>=0.)
329 self.failUnless(sup(x[0])<=1.)
330 if self.domain.getDim()>1: self.failUnless(sup(x[1])<=1.)
331 if self.domain.getDim()>2: self.failUnless(sup(x[2])<=1.)
332 #===========================================================================
333
334 class Test_GlobalMinMax(unittest.TestCase):
335 def test_GlobalMinMax(self):
336 myrank=getMPIRankWorld()
337 d=Data(myrank,Function(self.domain))
338 minproc=inf(d)
339 maxproc=sup(d) #This tells us where to expect values to be
340 if d.getNumberOfDataPoints()>0:
341 d.setValueOfDataPoint(0,myrank-0.001);
342 p,n=d.minGlobalDataPoint()
343 self.failUnless(p==minproc,"Incorrect process indentified as holding min")
344 self.failUnless(n==0,"Incorrect position for min")
345 if d.getNumberOfDataPoints()>0:
346 d.setValueOfDataPoint(0,myrank+0.001)
347 p,n=d.maxGlobalDataPoint()
348 self.failUnless(p==maxproc,"Incorrect process indentified as holding min")
349 self.failUnless(n==0,"Incorrect position for min")
350
351
352
353 class Test_SetDataPointValue(unittest.TestCase):
354 arg0=9.81
355 arg1=numpy.array([3.098, -3.111])
356 arg2=numpy.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]])
357 arg3=numpy.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]]])
358 arg4=numpy.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]]]])
359 def test_SetDataPointValue_Function_Rank0(self):
360 d=Data(self.arg0,Function(self.domain))
361 d.setValueOfDataPoint(0,self.arg0*2)
362 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
363 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
364 d_0=numpy.array(d.getTupleForDataPoint(0))
365 d_1=numpy.array(d.getTupleForDataPoint(1))
366 self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
367 self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
368 def test_SetDataPointValue_Function_Rank1(self):
369 d=Data(self.arg1,Function(self.domain))
370 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
371 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
372 d.setValueOfDataPoint(0,self.arg1*2)
373 d_0=numpy.array(d.getTupleForDataPoint(0))
374 d_1=numpy.array(d.getTupleForDataPoint(1))
375 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
376 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
377 def test_SetDataPointValue_Function_Rank1_list(self):
378 d=Data(self.arg1,Function(self.domain))
379 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
380 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
381 d.setValueOfDataPoint(0,(self.arg1*2).tolist())
382 d_0=numpy.array(d.getTupleForDataPoint(0))
383 d_1=numpy.array(d.getTupleForDataPoint(1))
384 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
385 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
386 def test_SetDataPointValue_Function_Rank2(self):
387 d=Data(self.arg2,Function(self.domain))
388 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
389 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
390 d.setValueOfDataPoint(0,self.arg2*2)
391 d_0=numpy.array(d.getTupleForDataPoint(0))
392 d_1=numpy.array(d.getTupleForDataPoint(1))
393 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
394 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
395 def test_SetDataPointValue_Function_Rank2_list(self):
396 d=Data(self.arg2,Function(self.domain))
397 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
398 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
399 d.setValueOfDataPoint(0,(self.arg2*2).tolist())
400 d_0=numpy.array(d.getTupleForDataPoint(0))
401 d_1=numpy.array(d.getTupleForDataPoint(1))
402 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
403 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
404 def test_SetDataPointValue_Function_Rank3(self):
405 d=Data(self.arg3,Function(self.domain))
406 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
407 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
408 d.setValueOfDataPoint(0,self.arg3*2)
409 d_0=numpy.array(d.getTupleForDataPoint(0))
410 d_1=numpy.array(d.getTupleForDataPoint(1))
411 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
412 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
413 def test_SetDataPointValue_Function_Rank3_list(self):
414 d=Data(self.arg3,Function(self.domain))
415 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
416 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
417 d.setValueOfDataPoint(0,(self.arg3*2).tolist())
418 d_0=numpy.array(d.getTupleForDataPoint(0))
419 d_1=numpy.array(d.getTupleForDataPoint(1))
420 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
421 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
422 def test_SetDataPointValue_Function_Rank4(self):
423 d=Data(self.arg4,Function(self.domain))
424 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
425 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
426 d.setValueOfDataPoint(0,self.arg4*2)
427 d_0=numpy.array(d.getTupleForDataPoint(0))
428 d_1=numpy.array(d.getTupleForDataPoint(1))
429 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
430 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
431 def test_SetDataPointValue_Function_Rank4_list(self):
432 d=Data(self.arg4,Function(self.domain))
433 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
434 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
435 d.setValueOfDataPoint(0,(self.arg4*2).tolist())
436 d_0=numpy.array(d.getTupleForDataPoint(0))
437 d_1=numpy.array(d.getTupleForDataPoint(1))
438 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
439 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
440 #===========================================================================
441 def test_SetDataPointValue_ReducedFunction_Rank0(self):
442 d=Data(self.arg0,ReducedFunction(self.domain))
443 d.setValueOfDataPoint(0,self.arg0*2)
444 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
445 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
446 d_0=numpy.array(d.getTupleForDataPoint(0))
447 d_1=numpy.array(d.getTupleForDataPoint(1))
448 self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
449 self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
450 def test_SetDataPointValue_ReducedFunction_Rank1(self):
451 d=Data(self.arg1,ReducedFunction(self.domain))
452 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
453 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
454 d.setValueOfDataPoint(0,self.arg1*2)
455 d_0=numpy.array(d.getTupleForDataPoint(0))
456 d_1=numpy.array(d.getTupleForDataPoint(1))
457 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
458 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
459 def test_SetDataPointValue_ReducedFunction_Rank1_list(self):
460 d=Data(self.arg1,ReducedFunction(self.domain))
461 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
462 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
463 d.setValueOfDataPoint(0,(self.arg1*2).tolist())
464 d_0=numpy.array(d.getTupleForDataPoint(0))
465 d_1=numpy.array(d.getTupleForDataPoint(1))
466 self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
467 self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
468 def test_SetDataPointValue_ReducedFunction_Rank2(self):
469 d=Data(self.arg2,ReducedFunction(self.domain))
470 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
471 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
472 d.setValueOfDataPoint(0,self.arg2*2)
473 d_0=numpy.array(d.getTupleForDataPoint(0))
474 d_1=numpy.array(d.getTupleForDataPoint(1))
475 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
476 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
477 def test_SetDataPointValue_ReducedFunction_Rank2_list(self):
478 d=Data(self.arg2,ReducedFunction(self.domain))
479 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
480 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
481 d.setValueOfDataPoint(0,(self.arg2*2).tolist())
482 d_0=numpy.array(d.getTupleForDataPoint(0))
483 d_1=numpy.array(d.getTupleForDataPoint(1))
484 self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
485 self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
486 def test_SetDataPointValue_ReducedFunction_Rank3(self):
487 d=Data(self.arg3,ReducedFunction(self.domain))
488 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
489 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
490 d.setValueOfDataPoint(0,self.arg3*2)
491 d_0=numpy.array(d.getTupleForDataPoint(0))
492 d_1=numpy.array(d.getTupleForDataPoint(1))
493 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
494 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
495 def test_SetDataPointValue_ReducedFunction_Rank3_list(self):
496 d=Data(self.arg3,ReducedFunction(self.domain))
497 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
498 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
499 d.setValueOfDataPoint(0,(self.arg3*2).tolist())
500 d_0=numpy.array(d.getTupleForDataPoint(0))
501 d_1=numpy.array(d.getTupleForDataPoint(1))
502 self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
503 self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
504 def test_SetDataPointValue_ReducedFunction_Rank4(self):
505 d=Data(self.arg4,ReducedFunction(self.domain))
506 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
507 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
508 d.setValueOfDataPoint(0,self.arg4*2)
509 d_0=numpy.array(d.getTupleForDataPoint(0))
510 d_1=numpy.array(d.getTupleForDataPoint(1))
511 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
512 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
513 def test_SetDataPointValue_ReducedFunction_Rank4_list(self):
514 d=Data(self.arg4,ReducedFunction(self.domain))
515 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
516 self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
517 d.setValueOfDataPoint(0,(self.arg4*2).tolist())
518 d_0=numpy.array(d.getTupleForDataPoint(0))
519 d_1=numpy.array(d.getTupleForDataPoint(1))
520 self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
521 self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
522
523 class Test_Dump(unittest.TestCase):
524 arg0=9.81
525 arg1=numpy.array([3.098, -3.111])
526 arg2=numpy.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]])
527 arg3=numpy.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]]])
528 arg4=numpy.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]]]])
529
530 def _diffDataObjects(self,d_ref,filemame, use_old_file=False):
531 if not use_old_file: d_ref.dump(filemame)
532 d=load(filemame, d_ref.getDomain())
533 self.failUnless(not d.isEmpty(),"data in %s are empty."%filemame)
534 self.failUnless(d_ref.getRank() == d.getRank(), "different rank in %s. "%filemame)
535 self.failUnless(d_ref.getShape() == d.getShape(), "different shape %s. "%filemame)
536 self.failUnless(d_ref.getFunctionSpace() == d.getFunctionSpace(), "wrong function space in %s."%filemame)
537 self.failUnless(Lsup(d_ref-d)<=0., "different entries %s."%filemame)
538
539 #===========================================================================
540 def test_DumpAndLoad_Constant_Solution_Rank0(self):
541 if loadIsConfigured():
542 filemame=os.path.join(self.filename_base,"constant_solution_rank0.nc")
543 d=Data(self.arg0,Solution(self.domain))
544 self._diffDataObjects(d,filemame)
545
546 def test_DumpAndLoad_Constant_Solution_Rank1(self):
547 if loadIsConfigured():
548 filemame=os.path.join(self.filename_base,"constant_solution_rank1.nc")
549 d=Data(self.arg1,Solution(self.domain))
550 self._diffDataObjects(d,filemame)
551
552 def test_DumpAndLoad_Constant_Solution_Rank2(self):
553 if loadIsConfigured():
554 filemame=os.path.join(self.filename_base,"constant_solution_rank2.nc")
555 d=Data(self.arg2,Solution(self.domain))
556 self._diffDataObjects(d,filemame)
557
558 def test_DumpAndLoad_Constant_Solution_Rank3(self):
559 if loadIsConfigured():
560 filemame=os.path.join(self.filename_base,"constant_solution_rank3.nc")
561 d=Data(self.arg3,Solution(self.domain))
562 self._diffDataObjects(d,filemame)
563
564 def test_DumpAndLoad_Constant_Solution_Rank4(self):
565 if loadIsConfigured():
566 filemame=os.path.join(self.filename_base,"constant_solution_rank4.nc")
567 d=Data(self.arg4,Solution(self.domain))
568 self._diffDataObjects(d,filemame)
569 #===========================================================================
570 def test_DumpAndLoad_Constant_ReducedSolution_Rank0(self):
571 if loadIsConfigured():
572 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank0.nc")
573 d=Data(self.arg0,ReducedSolution(self.domain))
574 self._diffDataObjects(d,filemame)
575
576 def test_DumpAndLoad_Constant_ReducedSolution_Rank1(self):
577 if loadIsConfigured():
578 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank1.nc")
579 d=Data(self.arg1,ReducedSolution(self.domain))
580 self._diffDataObjects(d,filemame)
581
582 def test_DumpAndLoad_Constant_ReducedSolution_Rank2(self):
583 if loadIsConfigured():
584 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank2.nc")
585 d=Data(self.arg2,ReducedSolution(self.domain))
586 self._diffDataObjects(d,filemame)
587
588 def test_DumpAndLoad_Constant_ReducedSolution_Rank3(self):
589 if loadIsConfigured():
590 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank3.nc")
591 d=Data(self.arg3,ReducedSolution(self.domain))
592 self._diffDataObjects(d,filemame)
593
594 def test_DumpAndLoad_Constant_ReducedSolution_Rank4(self):
595 if loadIsConfigured():
596 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank4.nc")
597 d=Data(self.arg4,ReducedSolution(self.domain))
598 self._diffDataObjects(d,filemame)
599 #===========================================================================
600 def test_DumpAndLoad_Constant_ContinuousFunction_Rank0(self):
601 if loadIsConfigured():
602 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank0.nc")
603 d=Data(self.arg0,ContinuousFunction(self.domain))
604 self._diffDataObjects(d,filemame)
605
606 def test_DumpAndLoad_Constant_ContinuousFunction_Rank1(self):
607 if loadIsConfigured():
608 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank1.nc")
609 d=Data(self.arg1,ContinuousFunction(self.domain))
610 self._diffDataObjects(d,filemame)
611
612 def test_DumpAndLoad_Constant_ContinuousFunction_Rank2(self):
613 if loadIsConfigured():
614 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank2.nc")
615 d=Data(self.arg2,ContinuousFunction(self.domain))
616 self._diffDataObjects(d,filemame)
617
618 def test_DumpAndLoad_Constant_ContinuousFunction_Rank3(self):
619 if loadIsConfigured():
620 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank3.nc")
621 d=Data(self.arg3,ContinuousFunction(self.domain))
622 self._diffDataObjects(d,filemame)
623
624 def test_DumpAndLoad_Constant_ContinuousFunction_Rank4(self):
625 if loadIsConfigured():
626 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank4.nc")
627 d=Data(self.arg4,ContinuousFunction(self.domain))
628 self._diffDataObjects(d,filemame)
629
630 #===========================================================================
631 def test_DumpAndLoad_Constant_Function_Rank0(self):
632 if loadIsConfigured():
633 filemame=os.path.join(self.filename_base,"constant_function_rank0.nc")
634 d=Data(self.arg0,Function(self.domain))
635 self._diffDataObjects(d,filemame)
636
637 def test_DumpAndLoad_Constant_Function_Rank1(self):
638 if loadIsConfigured():
639 filemame=os.path.join(self.filename_base,"constant_function_rank1.nc")
640 d=Data(self.arg1,Function(self.domain))
641 self._diffDataObjects(d,filemame)
642
643 def test_DumpAndLoad_Constant_Function_Rank2(self):
644 if loadIsConfigured():
645 filemame=os.path.join(self.filename_base,"constant_function_rank2.nc")
646 d=Data(self.arg2,Function(self.domain))
647 self._diffDataObjects(d,filemame)
648
649 def test_DumpAndLoad_Constant_Function_Rank3(self):
650 if loadIsConfigured():
651 filemame=os.path.join(self.filename_base,"constant_function_rank3.nc")
652 d=Data(self.arg3,Function(self.domain))
653 self._diffDataObjects(d,filemame)
654
655 #===========================================================================
656 def test_DumpAndLoad_Constant_ReducedFunction_Rank0(self):
657 if loadIsConfigured():
658 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank0.nc")
659 d=Data(self.arg0,ReducedFunction(self.domain))
660 self._diffDataObjects(d,filemame)
661
662 def test_DumpAndLoad_Constant_ReducedFunction_Rank1(self):
663 if loadIsConfigured():
664 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank1.nc")
665 d=Data(self.arg1,ReducedFunction(self.domain))
666 self._diffDataObjects(d,filemame)
667
668 def test_DumpAndLoad_Constant_ReducedFunction_Rank2(self):
669 if loadIsConfigured():
670 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank2.nc")
671 d=Data(self.arg2,ReducedFunction(self.domain))
672 self._diffDataObjects(d,filemame)
673
674 def test_DumpAndLoad_Constant_ReducedFunction_Rank3(self):
675 if loadIsConfigured():
676 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank3.nc")
677 d=Data(self.arg3,ReducedFunction(self.domain))
678 self._diffDataObjects(d,filemame)
679 def test_DumpAndLoad_Constant_ReducedFunction_Rank4(self):
680 if loadIsConfigured():
681 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank4.nc")
682 d=Data(self.arg4,ReducedFunction(self.domain))
683 self._diffDataObjects(d,filemame)
684
685 #===========================================================================
686 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank0(self):
687 if loadIsConfigured():
688 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank0.nc")
689 d=Data(self.arg0,FunctionOnBoundary(self.domain))
690 self._diffDataObjects(d,filemame)
691
692 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank1(self):
693 if loadIsConfigured():
694 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank1.nc")
695 d=Data(self.arg1,FunctionOnBoundary(self.domain))
696 self._diffDataObjects(d,filemame)
697
698 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank2(self):
699 if loadIsConfigured():
700 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank2.nc")
701 d=Data(self.arg2,FunctionOnBoundary(self.domain))
702 self._diffDataObjects(d,filemame)
703
704 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank3(self):
705 if loadIsConfigured():
706 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank3.nc")
707 d=Data(self.arg3,FunctionOnBoundary(self.domain))
708 self._diffDataObjects(d,filemame)
709
710 def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank4(self):
711 if loadIsConfigured():
712 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank4.nc")
713 d=Data(self.arg4,FunctionOnBoundary(self.domain))
714 self._diffDataObjects(d,filemame)
715
716 #===========================================================================
717 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank0(self):
718 if loadIsConfigured():
719 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank0.nc")
720 d=Data(self.arg0,FunctionOnBoundary(self.domain))
721 self._diffDataObjects(d,filemame)
722
723 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank1(self):
724 if loadIsConfigured():
725 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank1.nc")
726 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
727 self._diffDataObjects(d,filemame)
728
729 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank2(self):
730 if loadIsConfigured():
731 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank2.nc")
732 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
733 self._diffDataObjects(d,filemame)
734
735 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank3(self):
736 if loadIsConfigured():
737 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank3.nc")
738 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
739 self._diffDataObjects(d,filemame)
740
741 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank4(self):
742 if loadIsConfigured():
743 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank4.nc")
744 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
745 self._diffDataObjects(d,filemame)
746
747 #===========================================================================
748 def test_DumpAndLoad_Expanded_Solution_Rank0(self):
749 if loadIsConfigured():
750 filemame=os.path.join(self.filename_base,"expanded_solution_rank0.nc")
751 d=Data(length(Solution(self.domain).getX())*self.arg0,Solution(self.domain))
752 self._diffDataObjects(d,filemame)
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 if getMPISizeWorld() ==1:
756 d=Data(length(Solution(self.domain_with_different_sample_ordering).getX())*self.arg0,Solution(self.domain_with_different_sample_ordering))
757 self._diffDataObjects(d,filemame, use_old_file=True)
758
759 def test_DumpAndLoad_Expanded_Solution_Rank1(self):
760 if loadIsConfigured():
761 filemame=os.path.join(self.filename_base,"expanded_solution_rank1.nc")
762 d=Data(length(Solution(self.domain).getX())*self.arg1,Solution(self.domain))
763 self._diffDataObjects(d,filemame)
764 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
765 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
766 if getMPISizeWorld() ==1:
767 d=Data(length(Solution(self.domain_with_different_sample_ordering).getX())*self.arg1,Solution(self.domain_with_different_sample_ordering))
768 self._diffDataObjects(d,filemame, use_old_file=True)
769
770 def test_DumpAndLoad_Expanded_Solution_Rank2(self):
771 if loadIsConfigured():
772 filemame=os.path.join(self.filename_base,"expanded_solution_rank2.nc")
773 d=Data(length(Solution(self.domain).getX())*self.arg2,Solution(self.domain))
774 self._diffDataObjects(d,filemame)
775 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
776 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
777 if getMPISizeWorld() ==1:
778 d=Data(length(Solution(self.domain_with_different_sample_ordering).getX())*self.arg2,Solution(self.domain_with_different_sample_ordering))
779 self._diffDataObjects(d,filemame, use_old_file=True)
780
781 def test_DumpAndLoad_Expanded_Solution_Rank3(self):
782 if loadIsConfigured():
783 filemame=os.path.join(self.filename_base,"expanded_solution_rank3.nc")
784 d=Data(length(Solution(self.domain).getX())*self.arg3,Solution(self.domain))
785 self._diffDataObjects(d,filemame)
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 if getMPISizeWorld() ==1:
789 d=Data(length(Solution(self.domain_with_different_sample_ordering).getX())*self.arg3,Solution(self.domain_with_different_sample_ordering))
790 self._diffDataObjects(d,filemame, use_old_file=True)
791
792 def test_DumpAndLoad_Expanded_Solution_Rank4(self):
793 if loadIsConfigured():
794 filemame=os.path.join(self.filename_base,"expanded_solution_rank4.nc")
795 d=Data(length(Solution(self.domain).getX())*self.arg4,Solution(self.domain))
796 self._diffDataObjects(d,filemame)
797 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
798 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
799 if getMPISizeWorld() ==1:
800 d=Data(length(Solution(self.domain_with_different_sample_ordering).getX())*self.arg4,Solution(self.domain_with_different_sample_ordering))
801 self._diffDataObjects(d,filemame, use_old_file=True)
802 #===========================================================================
803 def test_DumpAndLoad_Expanded_ReducedSolution_Rank0(self):
804 if loadIsConfigured():
805 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank0.nc")
806 d=Data(length(ReducedSolution(self.domain).getX())*self.arg0,ReducedSolution(self.domain))
807 self._diffDataObjects(d,filemame)
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 if getMPISizeWorld() ==1:
811 d=Data(length(ReducedSolution(self.domain_with_different_sample_ordering).getX())*self.arg0,ReducedSolution(self.domain_with_different_sample_ordering))
812 self._diffDataObjects(d,filemame, use_old_file=True)
813
814 def test_DumpAndLoad_Expanded_ReducedSolution_Rank1(self):
815 if loadIsConfigured():
816 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank1.nc")
817 d=Data(length(ReducedSolution(self.domain).getX())*self.arg1,ReducedSolution(self.domain))
818 self._diffDataObjects(d,filemame)
819 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
820 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
821 if getMPISizeWorld() ==1:
822 d=Data(length(ReducedSolution(self.domain_with_different_sample_ordering).getX())*self.arg1,ReducedSolution(self.domain_with_different_sample_ordering))
823 self._diffDataObjects(d,filemame, use_old_file=True)
824
825 def test_DumpAndLoad_Expanded_ReducedSolution_Rank2(self):
826 if loadIsConfigured():
827 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank2.nc")
828 d=Data(length(ReducedSolution(self.domain).getX())*self.arg2,ReducedSolution(self.domain))
829 self._diffDataObjects(d,filemame)
830 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
831 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
832 if getMPISizeWorld() ==1:
833 d=Data(length(ReducedSolution(self.domain_with_different_sample_ordering).getX())*self.arg2,ReducedSolution(self.domain_with_different_sample_ordering))
834 self._diffDataObjects(d,filemame, use_old_file=True)
835
836 def test_DumpAndLoad_Expanded_ReducedSolution_Rank3(self):
837 if loadIsConfigured():
838 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank3.nc")
839 d=Data(length(ReducedSolution(self.domain).getX())*self.arg3,ReducedSolution(self.domain))
840 self._diffDataObjects(d,filemame)
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 if getMPISizeWorld() ==1:
844 d=Data(length(ReducedSolution(self.domain_with_different_sample_ordering).getX())*self.arg3,ReducedSolution(self.domain_with_different_sample_ordering))
845 self._diffDataObjects(d,filemame, use_old_file=True)
846
847 def test_DumpAndLoad_Expanded_ReducedSolution_Rank4(self):
848 if loadIsConfigured():
849 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank4.nc")
850 d=Data(length(ReducedSolution(self.domain).getX())*self.arg4,ReducedSolution(self.domain))
851 self._diffDataObjects(d,filemame)
852 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
853 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
854 if getMPISizeWorld() ==1:
855 d=Data(length(ReducedSolution(self.domain_with_different_sample_ordering).getX())*self.arg4,ReducedSolution(self.domain_with_different_sample_ordering))
856 self._diffDataObjects(d,filemame, use_old_file=True)
857 #===========================================================================
858 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank0(self):
859 if loadIsConfigured():
860 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank0.nc")
861 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg0,ContinuousFunction(self.domain))
862 self._diffDataObjects(d,filemame)
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 if getMPISizeWorld() ==1:
866 d=Data(length(ContinuousFunction(self.domain_with_different_sample_ordering).getX())*self.arg0,ContinuousFunction(self.domain_with_different_sample_ordering))
867 self._diffDataObjects(d,filemame, use_old_file=True)
868
869 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank1(self):
870 if loadIsConfigured():
871 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank1.nc")
872 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
873 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg1,ContinuousFunction(self.domain))
874 self._diffDataObjects(d,filemame)
875 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
876 if getMPISizeWorld() ==1:
877 d=Data(length(ContinuousFunction(self.domain_with_different_sample_ordering).getX())*self.arg1,ContinuousFunction(self.domain_with_different_sample_ordering))
878 self._diffDataObjects(d,filemame, use_old_file=True)
879
880 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank2(self):
881 if loadIsConfigured():
882 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank2.nc")
883 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg2,ContinuousFunction(self.domain))
884 self._diffDataObjects(d,filemame)
885 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
886 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
887 if getMPISizeWorld() ==1:
888 d=Data(length(ContinuousFunction(self.domain_with_different_sample_ordering).getX())*self.arg2,ContinuousFunction(self.domain_with_different_sample_ordering))
889 self._diffDataObjects(d,filemame, use_old_file=True)
890
891 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank3(self):
892 if loadIsConfigured():
893 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank3.nc")
894 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg3,ContinuousFunction(self.domain))
895 self._diffDataObjects(d,filemame)
896 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
897 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
898 if getMPISizeWorld() ==1:
899 d=Data(length(ContinuousFunction(self.domain_with_different_sample_ordering).getX())*self.arg3,ContinuousFunction(self.domain_with_different_sample_ordering))
900 self._diffDataObjects(d,filemame, use_old_file=True)
901
902 def test_DumpAndLoad_Expanded_ContinuousFunction_Rank4(self):
903 if loadIsConfigured():
904 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank4.nc")
905 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg4,ContinuousFunction(self.domain))
906 self._diffDataObjects(d,filemame)
907 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
908 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
909 if getMPISizeWorld() ==1:
910 d=Data(length(ContinuousFunction(self.domain_with_different_sample_ordering).getX())*self.arg4,ContinuousFunction(self.domain_with_different_sample_ordering))
911 self._diffDataObjects(d,filemame, use_old_file=True)
912
913 #===========================================================================
914 def test_DumpAndLoad_Expanded_Function_Rank0(self):
915 if loadIsConfigured():
916 filemame=os.path.join(self.filename_base,"expanded_function_rank0.nc")
917 d=Data(length(Function(self.domain).getX())*self.arg0,Function(self.domain))
918 self._diffDataObjects(d,filemame)
919 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
920 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
921 if getMPISizeWorld() ==1:
922 d=Data(length(Function(self.domain_with_different_sample_ordering).getX())*self.arg0,Function(self.domain_with_different_sample_ordering))
923 self._diffDataObjects(d,filemame, use_old_file=True)
924
925 def test_DumpAndLoad_Expanded_Function_Rank1(self):
926 if loadIsConfigured():
927 filemame=os.path.join(self.filename_base,"expanded_function_rank1.nc")
928 d=Data(length(Function(self.domain).getX())*self.arg1,Function(self.domain))
929 self._diffDataObjects(d,filemame)
930 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
931 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
932 if getMPISizeWorld() ==1:
933 d=Data(length(Function(self.domain_with_different_sample_ordering).getX())*self.arg1,Function(self.domain_with_different_sample_ordering))
934 self._diffDataObjects(d,filemame, use_old_file=True)
935
936 def test_DumpAndLoad_Expanded_Function_Rank2(self):
937 if loadIsConfigured():
938 filemame=os.path.join(self.filename_base,"expanded_function_rank2.nc")
939 d=Data(length(Function(self.domain).getX())*self.arg2,Function(self.domain))
940 self._diffDataObjects(d,filemame)
941 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
942 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
943 if getMPISizeWorld() ==1:
944 d=Data(length(Function(self.domain_with_different_sample_ordering).getX())*self.arg2,Function(self.domain_with_different_sample_ordering))
945 self._diffDataObjects(d,filemame, use_old_file=True)
946
947 def test_DumpAndLoad_Expanded_Function_Rank3(self):
948 if loadIsConfigured():
949 filemame=os.path.join(self.filename_base,"expanded_function_rank3.nc")
950 d=Data(length(Function(self.domain).getX())*self.arg3,Function(self.domain))
951 self._diffDataObjects(d,filemame)
952 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
953 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
954 if getMPISizeWorld() ==1:
955 d=Data(length(Function(self.domain_with_different_sample_ordering).getX())*self.arg3,Function(self.domain_with_different_sample_ordering))
956 self._diffDataObjects(d,filemame, use_old_file=True)
957
958 def test_DumpAndLoad_Expanded_Function_Rank4(self):
959 if loadIsConfigured():
960 filemame=os.path.join(self.filename_base,"expanded_function_rank4.nc")
961 d=Data(length(Function(self.domain).getX())*self.arg4,Function(self.domain))
962 self._diffDataObjects(d,filemame)
963 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
964 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
965 if getMPISizeWorld() ==1:
966 d=Data(length(Function(self.domain_with_different_sample_ordering).getX())*self.arg4,Function(self.domain_with_different_sample_ordering))
967 self._diffDataObjects(d,filemame, use_old_file=True)
968
969 #===========================================================================
970 def test_DumpAndLoad_Expanded_ReducedFunction_Rank0(self):
971 if loadIsConfigured():
972 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank0.nc")
973 d=Data(length(ReducedFunction(self.domain).getX())*self.arg0,ReducedFunction(self.domain))
974 self._diffDataObjects(d,filemame)
975 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
976 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
977 if getMPISizeWorld() ==1:
978 d=Data(length(ReducedFunction(self.domain_with_different_sample_ordering).getX())*self.arg0,ReducedFunction(self.domain_with_different_sample_ordering))
979 self._diffDataObjects(d,filemame, use_old_file=True)
980
981 def test_DumpAndLoad_Expanded_ReducedFunction_Rank1(self):
982 if loadIsConfigured():
983 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank1.nc")
984 d=Data(length(ReducedFunction(self.domain).getX())*self.arg1,ReducedFunction(self.domain))
985 self._diffDataObjects(d,filemame)
986 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
987 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
988 if getMPISizeWorld() ==1:
989 d=Data(length(ReducedFunction(self.domain_with_different_sample_ordering).getX())*self.arg1,ReducedFunction(self.domain_with_different_sample_ordering))
990 self._diffDataObjects(d,filemame, use_old_file=True)
991
992 def test_DumpAndLoad_Expanded_ReducedFunction_Rank2(self):
993 if loadIsConfigured():
994 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank2.nc")
995 d=Data(length(ReducedFunction(self.domain).getX())*self.arg2,ReducedFunction(self.domain))
996 self._diffDataObjects(d,filemame)
997 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
998 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
999 if getMPISizeWorld() ==1:
1000 d=Data(length(ReducedFunction(self.domain_with_different_sample_ordering).getX())*self.arg2,ReducedFunction(self.domain_with_different_sample_ordering))
1001 self._diffDataObjects(d,filemame, use_old_file=True)
1002
1003 def test_DumpAndLoad_Expanded_ReducedFunction_Rank3(self):
1004 if loadIsConfigured():
1005 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank3.nc")
1006 d=Data(length(ReducedFunction(self.domain).getX())*self.arg3,ReducedFunction(self.domain))
1007 self._diffDataObjects(d,filemame)
1008 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1009 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1010 if getMPISizeWorld() ==1:
1011 d=Data(length(ReducedFunction(self.domain_with_different_sample_ordering).getX())*self.arg3,ReducedFunction(self.domain_with_different_sample_ordering))
1012 self._diffDataObjects(d,filemame, use_old_file=True)
1013
1014 def test_DumpAndLoad_Expanded_ReducedFunction_Rank4(self):
1015 if loadIsConfigured():
1016 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank4.nc")
1017 d=Data(length(ReducedFunction(self.domain).getX())*self.arg4,ReducedFunction(self.domain))
1018 self._diffDataObjects(d,filemame)
1019 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1020 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1021 if getMPISizeWorld() ==1:
1022 d=Data(length(ReducedFunction(self.domain_with_different_sample_ordering).getX())*self.arg4,ReducedFunction(self.domain_with_different_sample_ordering))
1023 self._diffDataObjects(d,filemame, use_old_file=True)
1024
1025 #===========================================================================
1026 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank0(self):
1027 if loadIsConfigured():
1028 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank0.nc")
1029 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg0,FunctionOnBoundary(self.domain))
1030 self._diffDataObjects(d,filemame)
1031 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1032 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1033 if getMPISizeWorld() ==1:
1034 d=Data(length(FunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg0,FunctionOnBoundary(self.domain_with_different_sample_ordering))
1035 self._diffDataObjects(d,filemame, use_old_file=True)
1036
1037 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank1(self):
1038 if loadIsConfigured():
1039 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank1.nc")
1040 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg1,FunctionOnBoundary(self.domain))
1041 self._diffDataObjects(d,filemame)
1042 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1043 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1044 if getMPISizeWorld() ==1:
1045 d=Data(length(FunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg1,FunctionOnBoundary(self.domain_with_different_sample_ordering))
1046 self._diffDataObjects(d,filemame, use_old_file=True)
1047
1048 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank2(self):
1049 if loadIsConfigured():
1050 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank2.nc")
1051 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg2,FunctionOnBoundary(self.domain))
1052 self._diffDataObjects(d,filemame)
1053 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1054 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1055 if getMPISizeWorld() ==1:
1056 d=Data(length(FunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg2,FunctionOnBoundary(self.domain_with_different_sample_ordering))
1057 self._diffDataObjects(d,filemame, use_old_file=True)
1058
1059 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank3(self):
1060 if loadIsConfigured():
1061 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank3.nc")
1062 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg3,FunctionOnBoundary(self.domain))
1063 self._diffDataObjects(d,filemame)
1064 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1065 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1066 if getMPISizeWorld() ==1:
1067 d=Data(length(FunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg3,FunctionOnBoundary(self.domain_with_different_sample_ordering))
1068 self._diffDataObjects(d,filemame, use_old_file=True)
1069
1070 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank4(self):
1071 if loadIsConfigured():
1072 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank4.nc")
1073 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg4,FunctionOnBoundary(self.domain))
1074 self._diffDataObjects(d,filemame)
1075 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1076 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1077 if getMPISizeWorld() ==1:
1078 d=Data(length(FunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg4,FunctionOnBoundary(self.domain_with_different_sample_ordering))
1079 self._diffDataObjects(d,filemame, use_old_file=True)
1080
1081 #===========================================================================
1082 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank0(self):
1083 if loadIsConfigured():
1084 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank0.nc")
1085 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg0,ReducedFunctionOnBoundary(self.domain))
1086 self._diffDataObjects(d,filemame)
1087 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1088 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1089 if getMPISizeWorld() ==1:
1090 d=Data(length(ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg0,ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering))
1091 self._diffDataObjects(d,filemame, use_old_file=True)
1092
1093 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank1(self):
1094 if loadIsConfigured():
1095 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank1.nc")
1096 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg1,ReducedFunctionOnBoundary(self.domain))
1097 self._diffDataObjects(d,filemame)
1098 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1099 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1100 if getMPISizeWorld() ==1:
1101 d=Data(length(ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg1,ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering))
1102 self._diffDataObjects(d,filemame, use_old_file=True)
1103
1104 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank2(self):
1105 if loadIsConfigured():
1106 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank2.nc")
1107 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg2,ReducedFunctionOnBoundary(self.domain))
1108 self._diffDataObjects(d,filemame)
1109 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1110 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1111 if getMPISizeWorld() ==1:
1112 d=Data(length(ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg2,ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering))
1113 self._diffDataObjects(d,filemame, use_old_file=True)
1114
1115 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank3(self):
1116 if loadIsConfigured():
1117 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank3.nc")
1118 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg3,ReducedFunctionOnBoundary(self.domain))
1119 self._diffDataObjects(d,filemame)
1120 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1121 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1122 if getMPISizeWorld() ==1:
1123 d=Data(length(ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg3,ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering))
1124 self._diffDataObjects(d,filemame, use_old_file=True)
1125
1126 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank4(self):
1127 if loadIsConfigured():
1128 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank4.nc")
1129 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg4,ReducedFunctionOnBoundary(self.domain))
1130 self._diffDataObjects(d,filemame)
1131 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
1132 self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
1133 if getMPISizeWorld() ==1:
1134 d=Data(length(ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering).getX())*self.arg4,ReducedFunctionOnBoundary(self.domain_with_different_sample_ordering))
1135 self._diffDataObjects(d,filemame, use_old_file=True)
1136
1137 #===========================================================================
1138 ## This functionspace does not currently support tags.
1139 ## Instead, we test that the canTag() function throws in test_canTag_Failures.
1140
1141 #def test_DumpAndLoad_Tagged_Solution_Rank0(self):
1142 #if loadIsConfigured():
1143 #filemame=os.path.join(self.filename_base,"tagged_solution_rank0.nc")
1144 #d=Data(self.arg0,Solution(self.domain))
1145 #d.setTaggedValue(1,self.arg0*2)
1146 #d.setTaggedValue(10,self.arg0*3)
1147 #d.setTaggedValue(100,self.arg0*4)
1148 #self._diffDataObjects(d,filemame)
1149
1150 #def test_DumpAndLoad_Tagged_Solution_Rank1(self):
1151 #if loadIsConfigured():
1152 #filemame=os.path.join(self.filename_base,"tagged_solution_rank1.nc")
1153 #d=Data(self.arg1,Solution(self.domain))
1154 #d.setTaggedValue(1,self.arg1*2)
1155 #d.setTaggedValue(10,self.arg1*3)
1156 #d.setTaggedValue(100,self.arg1*4)
1157 #self._diffDataObjects(d,filemame)
1158
1159 #def test_DumpAndLoad_Tagged_Solution_Rank2(self):
1160 #if loadIsConfigured():
1161 #filemame=os.path.join(self.filename_base,"tagged_solution_rank2.nc")
1162 #d=Data(self.arg2,Solution(self.domain))
1163 #d.setTaggedValue(1,self.arg2*2)
1164 #d.setTaggedValue(10,self.arg2*3)
1165 #d.setTaggedValue(100,self.arg2*4)
1166 #self._diffDataObjects(d,filemame)
1167
1168 #def test_DumpAndLoad_Tagged_Solution_Rank3(self):
1169 #if loadIsConfigured():
1170 #filemame=os.path.join(self.filename_base,"tagged_solution_rank3.nc")
1171 #d=Data(self.arg3,Solution(self.domain))
1172 #d.setTaggedValue(1,self.arg3*2)
1173 #d.setTaggedValue(10,self.arg3*3)
1174 #d.setTaggedValue(100,self.arg3*4)
1175 #self._diffDataObjects(d,filemame)
1176
1177 #def test_DumpAndLoad_Tagged_Solution_Rank4(self):
1178 #if loadIsConfigured():
1179 #filemame=os.path.join(self.filename_base,"tagged_solution_rank4.nc")
1180 #d=Data(self.arg4,Solution(self.domain))
1181 #d.setTaggedValue(1,self.arg4*2)
1182 #d.setTaggedValue(10,self.arg4*3)
1183 #d.setTaggedValue(100,self.arg4*4)
1184 #self._diffDataObjects(d,filemame)
1185 ##===========================================================================
1186 ## This functionspace does not currently support tags.
1187 ## Instead, we test that the canTag() function throws in test_canTag_Failures.
1188
1189 #def test_DumpAndLoad_Tagged_ReducedSolution_Rank0(self):
1190 #if loadIsConfigured():
1191 #filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank0.nc")
1192 #d=Data(self.arg0,ReducedSolution(self.domain))
1193 #d.setTaggedValue(1,self.arg0*2)
1194 #d.setTaggedValue(10,self.arg0*3)
1195 #d.setTaggedValue(100,self.arg0*4)
1196 #self._diffDataObjects(d,filemame)
1197
1198 #def test_DumpAndLoad_Tagged_ReducedSolution_Rank1(self):
1199 #if loadIsConfigured():
1200 #filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank1.nc")
1201 #d=Data(self.arg1,ReducedSolution(self.domain))
1202 #d.setTaggedValue(1,self.arg1*2)
1203 #d.setTaggedValue(10,self.arg1*3)
1204 #d.setTaggedValue(100,self.arg1*4)
1205 #self._diffDataObjects(d,filemame)
1206
1207 #def test_DumpAndLoad_Tagged_ReducedSolution_Rank2(self):
1208 #if loadIsConfigured():
1209 #filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank2.nc")
1210 #d=Data(self.arg2,ReducedSolution(self.domain))
1211 #d.setTaggedValue(1,self.arg2*2)
1212 #d.setTaggedValue(10,self.arg2*3)
1213 #d.setTaggedValue(100,self.arg2*4)
1214 #self._diffDataObjects(d,filemame)
1215
1216 #def test_DumpAndLoad_Tagged_ReducedSolution_Rank3(self):
1217 #if loadIsConfigured():
1218 #filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank3.nc")
1219 #d=Data(self.arg3,ReducedSolution(self.domain))
1220 #d.setTaggedValue(1,self.arg3*2)
1221 #d.setTaggedValue(10,self.arg3*3)
1222 #d.setTaggedValue(100,self.arg3*4)
1223 #self._diffDataObjects(d,filemame)
1224
1225 #def test_DumpAndLoad_Tagged_ReducedSolution_Rank4(self):
1226 #if loadIsConfigured():
1227 #filemame=os.path.join(self.filename_base,"tagged_reduced_solution_rank4.nc")
1228 #d=Data(self.arg4,ReducedSolution(self.domain))
1229 #d.setTaggedValue(1,self.arg4*2)
1230 #d.setTaggedValue(10,self.arg4*3)
1231 #d.setTaggedValue(100,self.arg4*4)
1232 #self._diffDataObjects(d,filemame)
1233 ##===========================================================================
1234 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank0(self):
1235 if loadIsConfigured():
1236 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank0.nc")
1237 d=Data(self.arg0,ContinuousFunction(self.domain))
1238 d.setTaggedValue(1,self.arg0*2)
1239 d.setTaggedValue(10,self.arg0*3)
1240 d.setTaggedValue(100,self.arg0*4)
1241 self._diffDataObjects(d,filemame)
1242
1243 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank1(self):
1244 if loadIsConfigured():
1245 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank1.nc")
1246 d=Data(self.arg1,ContinuousFunction(self.domain))
1247 d.setTaggedValue(1,self.arg1*2)
1248 d.setTaggedValue(10,self.arg1*3)
1249 d.setTaggedValue(100,self.arg1*4)
1250 self._diffDataObjects(d,filemame)
1251
1252 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank2(self):
1253 if loadIsConfigured():
1254 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank2.nc")
1255 d=Data(self.arg2,ContinuousFunction(self.domain))
1256 d.setTaggedValue(1,self.arg2*2)
1257 d.setTaggedValue(10,self.arg2*3)
1258 d.setTaggedValue(100,self.arg2*4)
1259 self._diffDataObjects(d,filemame)
1260
1261 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank3(self):
1262 if loadIsConfigured():
1263 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank3.nc")
1264 d=Data(self.arg3,ContinuousFunction(self.domain))
1265 d.setTaggedValue(1,self.arg3*2)
1266 d.setTaggedValue(10,self.arg3*3)
1267 d.setTaggedValue(100,self.arg3*4)
1268 self._diffDataObjects(d,filemame)
1269
1270 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank4(self):
1271 if loadIsConfigured():
1272 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank4.nc")
1273 d=Data(self.arg4,ContinuousFunction(self.domain))
1274 d.setTaggedValue(1,self.arg4*2)
1275 d.setTaggedValue(10,self.arg4*3)
1276 d.setTaggedValue(100,self.arg4*4)
1277 self._diffDataObjects(d,filemame)
1278
1279 #===========================================================================
1280 def test_DumpAndLoad_Tagged_Function_Rank0(self):
1281 if loadIsConfigured():
1282 filemame=os.path.join(self.filename_base,"tagged_function_rank0.nc")
1283 d=Data(self.arg0,Function(self.domain))
1284 d.setTaggedValue(1,self.arg0*2)
1285 d.setTaggedValue(10,self.arg0*3)
1286 d.setTaggedValue(100,self.arg0*4)
1287 self._diffDataObjects(d,filemame)
1288
1289 def test_DumpAndLoad_Tagged_Function_Rank1(self):
1290 if loadIsConfigured():
1291 filemame=os.path.join(self.filename_base,"tagged_function_rank1.nc")
1292 d=Data(self.arg1,Function(self.domain))
1293 d.setTaggedValue(1,self.arg1*2)
1294 d.setTaggedValue(10,self.arg1*3)
1295 d.setTaggedValue(100,self.arg1*4)
1296 self._diffDataObjects(d,filemame)
1297
1298 def test_DumpAndLoad_Tagged_Function_Rank2(self):
1299 if loadIsConfigured():
1300 filemame=os.path.join(self.filename_base,"tagged_function_rank2.nc")
1301 d=Data(self.arg2,Function(self.domain))
1302 d.setTaggedValue(1,self.arg2*2)
1303 d.setTaggedValue(10,self.arg2*3)
1304 d.setTaggedValue(100,self.arg2*4)
1305 self._diffDataObjects(d,filemame)
1306
1307 def test_DumpAndLoad_Tagged_Function_Rank3(self):
1308 if loadIsConfigured():
1309 filemame=os.path.join(self.filename_base,"tagged_function_rank3.nc")
1310 d=Data(self.arg3,Function(self.domain))
1311 d.setTaggedValue(1,self.arg3*2)
1312 d.setTaggedValue(10,self.arg3*3)
1313 d.setTaggedValue(100,self.arg3*4)
1314 self._diffDataObjects(d,filemame)
1315
1316 def test_DumpAndLoad_Tagged_Function_Rank4(self):
1317 if loadIsConfigured():
1318 filemame=os.path.join(self.filename_base,"tagged_function_rank4.nc")
1319 d=Data(self.arg4,Function(self.domain))
1320 d.setTaggedValue(1,self.arg4*2)
1321 d.setTaggedValue(10,self.arg4*3)
1322 d.setTaggedValue(100,self.arg4*4)
1323 self._diffDataObjects(d,filemame)
1324
1325 #===========================================================================
1326 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank0(self):
1327 if loadIsConfigured():
1328 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank0.nc")
1329 d=Data(self.arg0,FunctionOnBoundary(self.domain))
1330 d.setTaggedValue(1,self.arg0*2)
1331 d.setTaggedValue(10,self.arg0*3)
1332 d.setTaggedValue(100,self.arg0*4)
1333 self._diffDataObjects(d,filemame)
1334
1335 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank1(self):
1336 if loadIsConfigured():
1337 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank1.nc")
1338 d=Data(self.arg1,FunctionOnBoundary(self.domain))
1339 d.setTaggedValue(1,self.arg1*2)
1340 d.setTaggedValue(10,self.arg1*3)
1341 d.setTaggedValue(100,self.arg1*4)
1342 self._diffDataObjects(d,filemame)
1343
1344 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank2(self):
1345 if loadIsConfigured():
1346 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank2.nc")
1347 d=Data(self.arg2,FunctionOnBoundary(self.domain))
1348 d.setTaggedValue(1,self.arg2*2)
1349 d.setTaggedValue(10,self.arg2*3)
1350 d.setTaggedValue(100,self.arg2*4)
1351 self._diffDataObjects(d,filemame)
1352
1353 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank3(self):
1354 if loadIsConfigured():
1355 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank3.nc")
1356 d=Data(self.arg3,FunctionOnBoundary(self.domain))
1357 d.setTaggedValue(1,self.arg3*2)
1358 d.setTaggedValue(10,self.arg3*3)
1359 d.setTaggedValue(100,self.arg3*4)
1360 self._diffDataObjects(d,filemame)
1361
1362 def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank4(self):
1363 if loadIsConfigured():
1364 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank4.nc")
1365 d=Data(self.arg4,FunctionOnBoundary(self.domain))
1366 d.setTaggedValue(1,self.arg4*2)
1367 d.setTaggedValue(10,self.arg4*3)
1368 d.setTaggedValue(100,self.arg4*4)
1369 self._diffDataObjects(d,filemame)
1370 #===========================================================================
1371 def test_DumpAndLoad_Tagged_ReducedFunction_Rank0(self):
1372 if loadIsConfigured():
1373 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank0.nc")
1374 d=Data(self.arg0,ReducedFunction(self.domain))
1375 d.setTaggedValue(1,self.arg0*2)
1376 d.setTaggedValue(10,self.arg0*3)
1377 d.setTaggedValue(100,self.arg0*4)
1378 self._diffDataObjects(d,filemame)
1379
1380 def test_DumpAndLoad_Tagged_ReducedFunction_Rank1(self):
1381 if loadIsConfigured():
1382 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank1.nc")
1383 d=Data(self.arg1,ReducedFunction(self.domain))
1384 d.setTaggedValue(1,self.arg1*2)
1385 d.setTaggedValue(10,self.arg1*3)
1386 d.setTaggedValue(100,self.arg1*4)
1387 self._diffDataObjects(d,filemame)
1388
1389 def test_DumpAndLoad_Tagged_ReducedFunction_Rank2(self):
1390 if loadIsConfigured():
1391 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank2.nc")
1392 d=Data(self.arg2,ReducedFunction(self.domain))
1393 d.setTaggedValue(1,self.arg2*2)
1394 d.setTaggedValue(10,self.arg2*3)
1395 d.setTaggedValue(100,self.arg2*4)
1396 self._diffDataObjects(d,filemame)
1397
1398 def test_DumpAndLoad_Tagged_ReducedFunction_Rank3(self):
1399 if loadIsConfigured():
1400 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank3.nc")
1401 d=Data(self.arg3,ReducedFunction(self.domain))
1402 d.setTaggedValue(1,self.arg3*2)
1403 d.setTaggedValue(10,self.arg3*3)
1404 d.setTaggedValue(100,self.arg3*4)
1405 self._diffDataObjects(d,filemame)
1406
1407 def test_DumpAndLoad_Tagged_ReducedFunction_Rank4(self):
1408 if loadIsConfigured():
1409 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank4.nc")
1410 d=Data(self.arg4,ReducedFunction(self.domain))
1411 d.setTaggedValue(1,self.arg4*2)
1412 d.setTaggedValue(10,self.arg4*3)
1413 d.setTaggedValue(100,self.arg4*4)
1414 self._diffDataObjects(d,filemame)
1415
1416 #===========================================================================
1417 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank0(self):
1418 if loadIsConfigured():
1419 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank0.nc")
1420 d=Data(self.arg0,ReducedFunctionOnBoundary(self.domain))
1421 d.setTaggedValue(1,self.arg0*2)
1422 d.setTaggedValue(10,self.arg0*3)
1423 d.setTaggedValue(100,self.arg0*4)
1424 self._diffDataObjects(d,filemame)
1425
1426 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank1(self):
1427 if loadIsConfigured():
1428 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank1.nc")
1429 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
1430 d.setTaggedValue(1,self.arg1*2)
1431 d.setTaggedValue(10,self.arg1*3)
1432 d.setTaggedValue(100,self.arg1*4)
1433 self._diffDataObjects(d,filemame)
1434
1435 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank2(self):
1436 if loadIsConfigured():
1437 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank2.nc")
1438 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
1439 d.setTaggedValue(1,self.arg2*2)
1440 d.setTaggedValue(10,self.arg2*3)
1441 d.setTaggedValue(100,self.arg2*4)
1442 self._diffDataObjects(d,filemame)
1443
1444 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank3(self):
1445 if loadIsConfigured():
1446 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank3.nc")
1447 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
1448 d.setTaggedValue(1,self.arg3*2)
1449 d.setTaggedValue(10,self.arg3*3)
1450 d.setTaggedValue(100,self.arg3*4)
1451 self._diffDataObjects(d,filemame)
1452
1453 def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank4(self):
1454 if loadIsConfigured():
1455 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank4.nc")
1456 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
1457 d.setTaggedValue(1,self.arg4*2)
1458 d.setTaggedValue(10,self.arg4*3)
1459 d.setTaggedValue(100,self.arg4*4)
1460 self._diffDataObjects(d,filemame)
1461
1462 def test_canTag_Failures(self):
1463 d=Data(self.arg0,Solution(self.domain))
1464 self.failUnlessRaises(RuntimeError,d.setTaggedValue,1,self.arg0*2)
1465 d=Data(self.arg0,ReducedSolution(self.domain))
1466 self.failUnlessRaises(RuntimeError,d.setTaggedValue,1,self.arg0*2)
1467
1468 class Test_Lazy(unittest.TestCase):
1469 def makeLazyObj(self):
1470 d=delay(Data(1,self.mainfs,True))
1471 e=delay(Data(2,self.mainfs,True))
1472 p=(d+e*d)/e
1473 q=p/(3*d)
1474 r1=q*q
1475 r2=q+q
1476 r3=q/4
1477 f=delay(Data(4,self.otherfs,True))
1478 t=Data(4,self.mainfs)
1479 t.tag()
1480 t=delay(t)
1481 t=t*2
1482 return r1,r2,r3,f,t
1483
1484 def test_GroupRes(self):
1485 rr1,rr2,rr3,rf,rt=self.makeLazyObj()
1486 rr1=resolve(rr1)
1487 rr2=resolve(rr2)
1488 rr3=resolve(rr3)
1489 rf=resolve(rf)
1490 rt=resolve(rt)
1491 r1,r2,r3,f,t=self.makeLazyObj()
1492 resolveGroup((r1,r2,r3))
1493 err=Lsup(rr1-r1)+Lsup(rr2-r2)+Lsup(rr3-r3)
1494 self.failUnless(err<0.001, "Same functionspace group resolve")
1495 r1,r2,r3,f,t=self.makeLazyObj()
1496 resolveGroup((r1,r2,r3,rt))
1497 err=Lsup(rr1-r1)+Lsup(rr2-r2)+Lsup(rr3-r3)+Lsup(rt-t)
1498 self.failUnless(err<0.001, "Same functionspace group resolve with early collapse")
1499 r1,r2,r3,f,t=self.makeLazyObj()
1500 err=Lsup(rr1-r1)+Lsup(rr2-r2)+Lsup(rr3-r3)+Lsup(rt-t)+Lsup(rf-f)
1501 self.failUnless(err<0.001, "Same functionspace group resolve with mixed functionspaces")
1502
1503

  ViewVC Help
Powered by ViewVC 1.1.26