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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2713 - (hide annotations)
Wed Oct 7 00:35:06 2009 UTC (10 years ago) by jfenwick
File MIME type: text/x-python
File size: 83436 byte(s)
Fixes for windows.
Copied from Thomas Poulet

1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 jfenwick 2548 # Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1809 # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 ksteube 1312 #
8 ksteube 1809 # 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 ksteube 1312 #
12 ksteube 1809 ########################################################
13 ksteube 1312
14 jfenwick 2549 __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15 ksteube 1809 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 jfenwick 2344 __url__="https://launchpad.net/escript-finley"
21 ksteube 1809
22 gross 983 """
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 gross 1141 self.filename_base="."
36 gross 983
37     suite = unittest.TestSuite()
38     suite.addTest(unittest.makeSuite(Test_DumpOnFinley))
39     unittest.TextTestRunner(verbosity=2).run(suite)
40    
41 jfenwick 2625 :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 gross 983 """
48    
49     __author__="Lutz Gross, l.gross@uq.edu.au"
50    
51     import unittest
52     import os
53 jfenwick 2455 import numpy
54 gross 983 from esys.escript import *
55    
56 jfenwick 2644
57 jfenwick 2646 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 gross 2668 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 jfenwick 2673 #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 jfenwick 2646 # 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 jfenwick 2650 for t in vs:
99 jfenwick 2646 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 jfenwick 2673 for j in xrange(self.yn):
110 jfenwick 2646 row=[]
111 jfenwick 2673 for i in xrange(self.xn):
112 jfenwick 2646 row.append(v0+v1*xwidth*i+v2*ywidth*j+v3*i*j*xwidth*ywidth)
113     table.append(row)
114 jfenwick 2673 ref=v0+v1*(x-xmin)+v2*(y-ymin)+v3*(x-xmin)*(y-ymin)
115 jfenwick 2650 lsupref=Lsup(ref)
116 jfenwick 2673 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 jfenwick 2650 self.failUnless(Lsup(res-ref)/Lsup(ref)<self.RES_TOL,"Failed for %s"%str(fs))
119 jfenwick 2646
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 jfenwick 2650 for t in vs:
127 jfenwick 2646 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 jfenwick 2673 for i in xrange(self.xn):
134 jfenwick 2646 table.append(v0+v1*xwidth*i)
135 jfenwick 2673 ref=v0+v1*(x-xmin)
136 jfenwick 2650 lsupref=Lsup(ref)
137 jfenwick 2673 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 jfenwick 2646
141 jfenwick 2644 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 jfenwick 2713 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 jfenwick 2644 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 jfenwick 2713 saveDataCSV(fname, sep="|",csep="/", U=X, V=X0, mask=X0)
180 jfenwick 2644 f=open(fname,'r')
181     line=f.readline()
182 jfenwick 2713 self.failUnless(line=='U/0|U/1|V\n')
183 jfenwick 2644 line=f.readline()
184 jfenwick 2713 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 jfenwick 2644 linecount=1
188     while line!='':
189     linecount+=1
190     line=f.readline()
191     self.failUnless(linecount==self.linecount2)
192    
193    
194 gross 1044 class Test_Domain(unittest.TestCase):
195 gross 2425
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 gross 1044 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 jfenwick 2282 self.failUnlessRaises(RuntimeError,s.setTaggedValue,tag3,3.) #tag3 does not exist
225 gross 1044 self.failUnless(Lsup(s-r)<=0.)
226     # get tag:
227     names=getTagNames(self.domain)
228 ksteube 1312 self.failUnless(len(names) == 6)
229 gross 1044 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 gross 1063 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 gross 1044
250 gross 1063 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 gross 1044
264 gross 1063 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 gross 1141 #===========================================================================
333 jfenwick 2653
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 gross 1141 class Test_SetDataPointValue(unittest.TestCase):
354     arg0=9.81
355 jfenwick 2455 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 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
365     d_1=numpy.array(d.getTupleForDataPoint(1))
366 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
374     d_1=numpy.array(d.getTupleForDataPoint(1))
375 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg1*2).tolist())
382     d_0=numpy.array(d.getTupleForDataPoint(0))
383     d_1=numpy.array(d.getTupleForDataPoint(1))
384 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
392     d_1=numpy.array(d.getTupleForDataPoint(1))
393 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg2*2).tolist())
400     d_0=numpy.array(d.getTupleForDataPoint(0))
401     d_1=numpy.array(d.getTupleForDataPoint(1))
402 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
410     d_1=numpy.array(d.getTupleForDataPoint(1))
411 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg3*2).tolist())
418     d_0=numpy.array(d.getTupleForDataPoint(0))
419     d_1=numpy.array(d.getTupleForDataPoint(1))
420 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
428     d_1=numpy.array(d.getTupleForDataPoint(1))
429 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg4*2).tolist())
436     d_0=numpy.array(d.getTupleForDataPoint(0))
437     d_1=numpy.array(d.getTupleForDataPoint(1))
438 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
447     d_1=numpy.array(d.getTupleForDataPoint(1))
448 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
456     d_1=numpy.array(d.getTupleForDataPoint(1))
457 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg1*2).tolist())
464     d_0=numpy.array(d.getTupleForDataPoint(0))
465     d_1=numpy.array(d.getTupleForDataPoint(1))
466 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
474     d_1=numpy.array(d.getTupleForDataPoint(1))
475 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg2*2).tolist())
482     d_0=numpy.array(d.getTupleForDataPoint(0))
483     d_1=numpy.array(d.getTupleForDataPoint(1))
484 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
492     d_1=numpy.array(d.getTupleForDataPoint(1))
493 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg3*2).tolist())
500     d_0=numpy.array(d.getTupleForDataPoint(0))
501     d_1=numpy.array(d.getTupleForDataPoint(1))
502 gross 1141 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 jfenwick 2455 d_0=numpy.array(d.getTupleForDataPoint(0))
510     d_1=numpy.array(d.getTupleForDataPoint(1))
511 gross 1141 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 jfenwick 2455 d.setValueOfDataPoint(0,(self.arg4*2).tolist())
518     d_0=numpy.array(d.getTupleForDataPoint(0))
519     d_1=numpy.array(d.getTupleForDataPoint(1))
520 gross 1141 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 gross 1063
523 gross 983 class Test_Dump(unittest.TestCase):
524     arg0=9.81
525 jfenwick 2455 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 gross 983
530 gross 1856 def _diffDataObjects(self,d_ref,filemame, use_old_file=False):
531     if not use_old_file: d_ref.dump(filemame)
532 gross 1870 d=load(filemame, d_ref.getDomain())
533 gross 1141 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 gross 1870 self.failUnless(d_ref.getFunctionSpace() == d.getFunctionSpace(), "wrong function space in %s."%filemame)
537 gross 1141 self.failUnless(Lsup(d_ref-d)<=0., "different entries %s."%filemame)
538 gross 983
539     #===========================================================================
540     def test_DumpAndLoad_Constant_Solution_Rank0(self):
541 gross 1023 if loadIsConfigured():
542 gross 1141 filemame=os.path.join(self.filename_base,"constant_solution_rank0.nc")
543 gross 1023 d=Data(self.arg0,Solution(self.domain))
544 gross 1141 self._diffDataObjects(d,filemame)
545 gross 983
546     def test_DumpAndLoad_Constant_Solution_Rank1(self):
547 gross 1023 if loadIsConfigured():
548 gross 1141 filemame=os.path.join(self.filename_base,"constant_solution_rank1.nc")
549 gross 1023 d=Data(self.arg1,Solution(self.domain))
550 gross 1141 self._diffDataObjects(d,filemame)
551 gross 983
552     def test_DumpAndLoad_Constant_Solution_Rank2(self):
553 gross 1023 if loadIsConfigured():
554 gross 1141 filemame=os.path.join(self.filename_base,"constant_solution_rank2.nc")
555 gross 1023 d=Data(self.arg2,Solution(self.domain))
556 gross 1141 self._diffDataObjects(d,filemame)
557 gross 983
558     def test_DumpAndLoad_Constant_Solution_Rank3(self):
559 gross 1023 if loadIsConfigured():
560 gross 1141 filemame=os.path.join(self.filename_base,"constant_solution_rank3.nc")
561 gross 1023 d=Data(self.arg3,Solution(self.domain))
562 gross 1141 self._diffDataObjects(d,filemame)
563 gross 983
564     def test_DumpAndLoad_Constant_Solution_Rank4(self):
565 gross 1023 if loadIsConfigured():
566 gross 1141 filemame=os.path.join(self.filename_base,"constant_solution_rank4.nc")
567 gross 1023 d=Data(self.arg4,Solution(self.domain))
568 gross 1141 self._diffDataObjects(d,filemame)
569 gross 983 #===========================================================================
570     def test_DumpAndLoad_Constant_ReducedSolution_Rank0(self):
571 gross 1023 if loadIsConfigured():
572 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank0.nc")
573 gross 1023 d=Data(self.arg0,ReducedSolution(self.domain))
574 gross 1141 self._diffDataObjects(d,filemame)
575 gross 983
576     def test_DumpAndLoad_Constant_ReducedSolution_Rank1(self):
577 gross 1023 if loadIsConfigured():
578 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank1.nc")
579 gross 1023 d=Data(self.arg1,ReducedSolution(self.domain))
580 gross 1141 self._diffDataObjects(d,filemame)
581 gross 983
582     def test_DumpAndLoad_Constant_ReducedSolution_Rank2(self):
583 gross 1023 if loadIsConfigured():
584 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank2.nc")
585 gross 1023 d=Data(self.arg2,ReducedSolution(self.domain))
586 gross 1141 self._diffDataObjects(d,filemame)
587 gross 983
588     def test_DumpAndLoad_Constant_ReducedSolution_Rank3(self):
589 gross 1023 if loadIsConfigured():
590 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank3.nc")
591 gross 1023 d=Data(self.arg3,ReducedSolution(self.domain))
592 gross 1141 self._diffDataObjects(d,filemame)
593 gross 983
594     def test_DumpAndLoad_Constant_ReducedSolution_Rank4(self):
595 gross 1023 if loadIsConfigured():
596 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_solution_rank4.nc")
597 gross 1023 d=Data(self.arg4,ReducedSolution(self.domain))
598 gross 1141 self._diffDataObjects(d,filemame)
599 gross 983 #===========================================================================
600     def test_DumpAndLoad_Constant_ContinuousFunction_Rank0(self):
601 gross 1023 if loadIsConfigured():
602 gross 1141 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank0.nc")
603 gross 1023 d=Data(self.arg0,ContinuousFunction(self.domain))
604 gross 1141 self._diffDataObjects(d,filemame)
605 gross 983
606     def test_DumpAndLoad_Constant_ContinuousFunction_Rank1(self):
607 gross 1023 if loadIsConfigured():
608 gross 1141 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank1.nc")
609 gross 1023 d=Data(self.arg1,ContinuousFunction(self.domain))
610 gross 1141 self._diffDataObjects(d,filemame)
611 gross 983
612     def test_DumpAndLoad_Constant_ContinuousFunction_Rank2(self):
613 gross 1023 if loadIsConfigured():
614 gross 1141 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank2.nc")
615 gross 1023 d=Data(self.arg2,ContinuousFunction(self.domain))
616 gross 1141 self._diffDataObjects(d,filemame)
617 gross 983
618     def test_DumpAndLoad_Constant_ContinuousFunction_Rank3(self):
619 gross 1023 if loadIsConfigured():
620 gross 1141 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank3.nc")
621 gross 1023 d=Data(self.arg3,ContinuousFunction(self.domain))
622 gross 1141 self._diffDataObjects(d,filemame)
623 gross 983
624     def test_DumpAndLoad_Constant_ContinuousFunction_Rank4(self):
625 gross 1023 if loadIsConfigured():
626 gross 1141 filemame=os.path.join(self.filename_base,"constant_continuous_function_rank4.nc")
627 gross 1023 d=Data(self.arg4,ContinuousFunction(self.domain))
628 gross 1141 self._diffDataObjects(d,filemame)
629 gross 983
630     #===========================================================================
631     def test_DumpAndLoad_Constant_Function_Rank0(self):
632 gross 1023 if loadIsConfigured():
633 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_rank0.nc")
634 gross 1023 d=Data(self.arg0,Function(self.domain))
635 gross 1141 self._diffDataObjects(d,filemame)
636 gross 983
637     def test_DumpAndLoad_Constant_Function_Rank1(self):
638 gross 1023 if loadIsConfigured():
639 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_rank1.nc")
640 gross 1023 d=Data(self.arg1,Function(self.domain))
641 gross 1141 self._diffDataObjects(d,filemame)
642 gross 983
643     def test_DumpAndLoad_Constant_Function_Rank2(self):
644 gross 1023 if loadIsConfigured():
645 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_rank2.nc")
646 gross 1023 d=Data(self.arg2,Function(self.domain))
647 gross 1141 self._diffDataObjects(d,filemame)
648 gross 983
649     def test_DumpAndLoad_Constant_Function_Rank3(self):
650 gross 1023 if loadIsConfigured():
651 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_rank3.nc")
652 gross 1023 d=Data(self.arg3,Function(self.domain))
653 gross 1141 self._diffDataObjects(d,filemame)
654 gross 983
655 gross 1063 #===========================================================================
656     def test_DumpAndLoad_Constant_ReducedFunction_Rank0(self):
657 gross 1023 if loadIsConfigured():
658 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank0.nc")
659 gross 1063 d=Data(self.arg0,ReducedFunction(self.domain))
660 gross 1141 self._diffDataObjects(d,filemame)
661 gross 983
662 gross 1063 def test_DumpAndLoad_Constant_ReducedFunction_Rank1(self):
663     if loadIsConfigured():
664 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank1.nc")
665 gross 1063 d=Data(self.arg1,ReducedFunction(self.domain))
666 gross 1141 self._diffDataObjects(d,filemame)
667 gross 1063
668     def test_DumpAndLoad_Constant_ReducedFunction_Rank2(self):
669     if loadIsConfigured():
670 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank2.nc")
671 gross 1063 d=Data(self.arg2,ReducedFunction(self.domain))
672 gross 1141 self._diffDataObjects(d,filemame)
673 gross 1063
674     def test_DumpAndLoad_Constant_ReducedFunction_Rank3(self):
675     if loadIsConfigured():
676 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank3.nc")
677 gross 1063 d=Data(self.arg3,ReducedFunction(self.domain))
678 gross 1141 self._diffDataObjects(d,filemame)
679 gross 1063 def test_DumpAndLoad_Constant_ReducedFunction_Rank4(self):
680     if loadIsConfigured():
681 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_rank4.nc")
682 gross 1063 d=Data(self.arg4,ReducedFunction(self.domain))
683 gross 1141 self._diffDataObjects(d,filemame)
684 gross 1063
685 gross 983 #===========================================================================
686     def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank0(self):
687 gross 1023 if loadIsConfigured():
688 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank0.nc")
689 gross 1023 d=Data(self.arg0,FunctionOnBoundary(self.domain))
690 gross 1141 self._diffDataObjects(d,filemame)
691 gross 983
692     def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank1(self):
693 gross 1023 if loadIsConfigured():
694 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank1.nc")
695 gross 1023 d=Data(self.arg1,FunctionOnBoundary(self.domain))
696 gross 1141 self._diffDataObjects(d,filemame)
697 gross 983
698     def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank2(self):
699 gross 1023 if loadIsConfigured():
700 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank2.nc")
701 gross 1023 d=Data(self.arg2,FunctionOnBoundary(self.domain))
702 gross 1141 self._diffDataObjects(d,filemame)
703 gross 983
704     def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank3(self):
705 gross 1023 if loadIsConfigured():
706 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank3.nc")
707 gross 1023 d=Data(self.arg3,FunctionOnBoundary(self.domain))
708 gross 1141 self._diffDataObjects(d,filemame)
709 gross 983
710     def test_DumpAndLoad_Constant_FunctionOnBoundary_Rank4(self):
711 gross 1023 if loadIsConfigured():
712 gross 1141 filemame=os.path.join(self.filename_base,"constant_function_on_boundary_rank4.nc")
713 gross 1023 d=Data(self.arg4,FunctionOnBoundary(self.domain))
714 gross 1141 self._diffDataObjects(d,filemame)
715 gross 983
716     #===========================================================================
717 gross 1063 def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank0(self):
718     if loadIsConfigured():
719 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank0.nc")
720 gross 1063 d=Data(self.arg0,FunctionOnBoundary(self.domain))
721 gross 1141 self._diffDataObjects(d,filemame)
722 gross 1063
723     def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank1(self):
724     if loadIsConfigured():
725 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank1.nc")
726 gross 1063 d=Data(self.arg1,ReducedFunctionOnBoundary(self.domain))
727 gross 1141 self._diffDataObjects(d,filemame)
728 gross 1063
729     def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank2(self):
730     if loadIsConfigured():
731 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank2.nc")
732 gross 1063 d=Data(self.arg2,ReducedFunctionOnBoundary(self.domain))
733 gross 1141 self._diffDataObjects(d,filemame)
734 gross 1063
735     def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank3(self):
736     if loadIsConfigured():
737 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank3.nc")
738 gross 1063 d=Data(self.arg3,ReducedFunctionOnBoundary(self.domain))
739 gross 1141 self._diffDataObjects(d,filemame)
740 gross 1063
741     def test_DumpAndLoad_Constant_ReducedFunctionOnBoundary_Rank4(self):
742     if loadIsConfigured():
743 gross 1141 filemame=os.path.join(self.filename_base,"constant_reduced_function_on_boundary_rank4.nc")
744 gross 1063 d=Data(self.arg4,ReducedFunctionOnBoundary(self.domain))
745 gross 1141 self._diffDataObjects(d,filemame)
746 gross 1063
747     #===========================================================================
748 gross 983 def test_DumpAndLoad_Expanded_Solution_Rank0(self):
749 gross 1023 if loadIsConfigured():
750 gross 1141 filemame=os.path.join(self.filename_base,"expanded_solution_rank0.nc")
751 gross 1856 d=Data(length(Solution(self.domain).getX())*self.arg0,Solution(self.domain))
752 gross 1870 self._diffDataObjects(d,filemame)
753 gross 1141 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 gross 1856 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 gross 983
759     def test_DumpAndLoad_Expanded_Solution_Rank1(self):
760 gross 1023 if loadIsConfigured():
761 gross 1141 filemame=os.path.join(self.filename_base,"expanded_solution_rank1.nc")
762 gross 1856 d=Data(length(Solution(self.domain).getX())*self.arg1,Solution(self.domain))
763     self._diffDataObjects(d,filemame)
764 gross 1141 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 gross 1856 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 gross 983
770     def test_DumpAndLoad_Expanded_Solution_Rank2(self):
771 gross 1023 if loadIsConfigured():
772 gross 1141 filemame=os.path.join(self.filename_base,"expanded_solution_rank2.nc")
773 gross 1856 d=Data(length(Solution(self.domain).getX())*self.arg2,Solution(self.domain))
774     self._diffDataObjects(d,filemame)
775 gross 1141 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 gross 1856 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 gross 983
781     def test_DumpAndLoad_Expanded_Solution_Rank3(self):
782 gross 1023 if loadIsConfigured():
783 gross 1141 filemame=os.path.join(self.filename_base,"expanded_solution_rank3.nc")
784 gross 1856 d=Data(length(Solution(self.domain).getX())*self.arg3,Solution(self.domain))
785     self._diffDataObjects(d,filemame)
786 gross 1141 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 gross 1856 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 gross 983
792     def test_DumpAndLoad_Expanded_Solution_Rank4(self):
793 gross 1023 if loadIsConfigured():
794 gross 1141 filemame=os.path.join(self.filename_base,"expanded_solution_rank4.nc")
795 gross 1856 d=Data(length(Solution(self.domain).getX())*self.arg4,Solution(self.domain))
796     self._diffDataObjects(d,filemame)
797 gross 1141 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 gross 1856 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 gross 983 #===========================================================================
803     def test_DumpAndLoad_Expanded_ReducedSolution_Rank0(self):
804 gross 1023 if loadIsConfigured():
805 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank0.nc")
806 gross 1856 d=Data(length(ReducedSolution(self.domain).getX())*self.arg0,ReducedSolution(self.domain))
807     self._diffDataObjects(d,filemame)
808 gross 1141 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 gross 1856 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 gross 983
814     def test_DumpAndLoad_Expanded_ReducedSolution_Rank1(self):
815 gross 1023 if loadIsConfigured():
816 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank1.nc")
817 gross 1856 d=Data(length(ReducedSolution(self.domain).getX())*self.arg1,ReducedSolution(self.domain))
818     self._diffDataObjects(d,filemame)
819 gross 1141 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 gross 1856 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 gross 983
825     def test_DumpAndLoad_Expanded_ReducedSolution_Rank2(self):
826 gross 1023 if loadIsConfigured():
827 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank2.nc")
828 gross 1856 d=Data(length(ReducedSolution(self.domain).getX())*self.arg2,ReducedSolution(self.domain))
829     self._diffDataObjects(d,filemame)
830 gross 1141 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 gross 1856 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 gross 983
836     def test_DumpAndLoad_Expanded_ReducedSolution_Rank3(self):
837 gross 1023 if loadIsConfigured():
838 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank3.nc")
839 gross 1856 d=Data(length(ReducedSolution(self.domain).getX())*self.arg3,ReducedSolution(self.domain))
840     self._diffDataObjects(d,filemame)
841 gross 1141 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 gross 1856 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 gross 983
847     def test_DumpAndLoad_Expanded_ReducedSolution_Rank4(self):
848 gross 1023 if loadIsConfigured():
849 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_solution_rank4.nc")
850 gross 1856 d=Data(length(ReducedSolution(self.domain).getX())*self.arg4,ReducedSolution(self.domain))
851     self._diffDataObjects(d,filemame)
852 gross 1141 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 gross 1856 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 gross 983 #===========================================================================
858     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank0(self):
859 gross 1023 if loadIsConfigured():
860 gross 1141 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank0.nc")
861 gross 1856 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg0,ContinuousFunction(self.domain))
862     self._diffDataObjects(d,filemame)
863 gross 1141 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 gross 1856 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 gross 983
869     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank1(self):
870 gross 1023 if loadIsConfigured():
871 gross 1141 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 gross 1023 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg1,ContinuousFunction(self.domain))
874 gross 1141 self._diffDataObjects(d,filemame)
875 gross 1856 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 gross 983
880     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank2(self):
881 gross 1023 if loadIsConfigured():
882 gross 1141 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank2.nc")
883 gross 1856 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg2,ContinuousFunction(self.domain))
884     self._diffDataObjects(d,filemame)
885 gross 1141 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 gross 1856 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 gross 983
891     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank3(self):
892 gross 1023 if loadIsConfigured():
893 gross 1141 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank3.nc")
894 gross 1023 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg3,ContinuousFunction(self.domain))
895 gross 1141 self._diffDataObjects(d,filemame)
896 gross 1856 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 gross 983
902     def test_DumpAndLoad_Expanded_ContinuousFunction_Rank4(self):
903 gross 1023 if loadIsConfigured():
904 gross 1141 filemame=os.path.join(self.filename_base,"expanded_continuous_function_rank4.nc")
905 gross 1856 d=Data(length(ContinuousFunction(self.domain).getX())*self.arg4,ContinuousFunction(self.domain))
906     self._diffDataObjects(d,filemame)
907 gross 1141 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 gross 1856 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 gross 983
913     #===========================================================================
914     def test_DumpAndLoad_Expanded_Function_Rank0(self):
915 gross 1023 if loadIsConfigured():
916 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_rank0.nc")
917 gross 1856 d=Data(length(Function(self.domain).getX())*self.arg0,Function(self.domain))
918     self._diffDataObjects(d,filemame)
919 gross 1141 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 gross 1856 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 gross 983
925     def test_DumpAndLoad_Expanded_Function_Rank1(self):
926 gross 1023 if loadIsConfigured():
927 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_rank1.nc")
928 gross 1856 d=Data(length(Function(self.domain).getX())*self.arg1,Function(self.domain))
929     self._diffDataObjects(d,filemame)
930 gross 1141 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 gross 1856 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 gross 983
936     def test_DumpAndLoad_Expanded_Function_Rank2(self):
937 gross 1023 if loadIsConfigured():
938 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_rank2.nc")
939 gross 1856 d=Data(length(Function(self.domain).getX())*self.arg2,Function(self.domain))
940     self._diffDataObjects(d,filemame)
941 gross 1141 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 gross 1856 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 gross 983
947     def test_DumpAndLoad_Expanded_Function_Rank3(self):
948 gross 1023 if loadIsConfigured():
949 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_rank3.nc")
950 gross 1856 d=Data(length(Function(self.domain).getX())*self.arg3,Function(self.domain))
951     self._diffDataObjects(d,filemame)
952 gross 1141 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 gross 1856 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 gross 983
958     def test_DumpAndLoad_Expanded_Function_Rank4(self):
959 gross 1023 if loadIsConfigured():
960 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_rank4.nc")
961 gross 1856 d=Data(length(Function(self.domain).getX())*self.arg4,Function(self.domain))
962     self._diffDataObjects(d,filemame)
963 gross 1141 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 gross 1856 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 gross 983
969     #===========================================================================
970 gross 1063 def test_DumpAndLoad_Expanded_ReducedFunction_Rank0(self):
971     if loadIsConfigured():
972 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank0.nc")
973 gross 1856 d=Data(length(ReducedFunction(self.domain).getX())*self.arg0,ReducedFunction(self.domain))
974     self._diffDataObjects(d,filemame)
975 gross 1141 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 gross 1856 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 gross 1063
981     def test_DumpAndLoad_Expanded_ReducedFunction_Rank1(self):
982     if loadIsConfigured():
983 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank1.nc")
984 gross 1856 d=Data(length(ReducedFunction(self.domain).getX())*self.arg1,ReducedFunction(self.domain))
985     self._diffDataObjects(d,filemame)
986 gross 1141 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 gross 1856 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 gross 1063
992     def test_DumpAndLoad_Expanded_ReducedFunction_Rank2(self):
993     if loadIsConfigured():
994 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank2.nc")
995 gross 1856 d=Data(length(ReducedFunction(self.domain).getX())*self.arg2,ReducedFunction(self.domain))
996     self._diffDataObjects(d,filemame)
997 gross 1141 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 gross 1856 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 gross 1063
1003     def test_DumpAndLoad_Expanded_ReducedFunction_Rank3(self):
1004     if loadIsConfigured():
1005 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank3.nc")
1006 gross 1856 d=Data(length(ReducedFunction(self.domain).getX())*self.arg3,ReducedFunction(self.domain))
1007     self._diffDataObjects(d,filemame)
1008 gross 1141 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 gross 1856 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 gross 1063
1014     def test_DumpAndLoad_Expanded_ReducedFunction_Rank4(self):
1015     if loadIsConfigured():
1016 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_rank4.nc")
1017 gross 1856 d=Data(length(ReducedFunction(self.domain).getX())*self.arg4,ReducedFunction(self.domain))
1018     self._diffDataObjects(d,filemame)
1019 gross 1141 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 gross 1856 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 gross 1063
1025     #===========================================================================
1026 gross 983 def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank0(self):
1027 gross 1023 if loadIsConfigured():
1028 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank0.nc")
1029 gross 1856 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg0,FunctionOnBoundary(self.domain))
1030     self._diffDataObjects(d,filemame)
1031 gross 1141 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 gross 1856 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 gross 983
1037     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank1(self):
1038 gross 1023 if loadIsConfigured():
1039 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank1.nc")
1040 gross 1856 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg1,FunctionOnBoundary(self.domain))
1041     self._diffDataObjects(d,filemame)
1042 gross 1141 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 gross 1856 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 gross 983
1048     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank2(self):
1049 gross 1023 if loadIsConfigured():
1050 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank2.nc")
1051 gross 1856 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg2,FunctionOnBoundary(self.domain))
1052     self._diffDataObjects(d,filemame)
1053 gross 1141 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 gross 1856 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 gross 983
1059     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank3(self):
1060 gross 1023 if loadIsConfigured():
1061 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank3.nc")
1062 gross 1856 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg3,FunctionOnBoundary(self.domain))
1063     self._diffDataObjects(d,filemame)
1064 gross 1141 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 gross 1856 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 gross 983
1070     def test_DumpAndLoad_Expanded_FunctionOnBoundary_Rank4(self):
1071 gross 1023 if loadIsConfigured():
1072 gross 1141 filemame=os.path.join(self.filename_base,"expanded_function_on_boundary_rank4.nc")
1073 gross 1856 d=Data(length(FunctionOnBoundary(self.domain).getX())*self.arg4,FunctionOnBoundary(self.domain))
1074     self._diffDataObjects(d,filemame)
1075 gross 1141 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 gross 1856 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 gross 983
1081     #===========================================================================
1082 gross 1063 def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank0(self):
1083     if loadIsConfigured():
1084 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank0.nc")
1085 gross 1856 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg0,ReducedFunctionOnBoundary(self.domain))
1086     self._diffDataObjects(d,filemame)
1087 gross 1141 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 gross 1856 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 gross 1063
1093     def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank1(self):
1094     if loadIsConfigured():
1095 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank1.nc")
1096 gross 1856 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg1,ReducedFunctionOnBoundary(self.domain))
1097     self._diffDataObjects(d,filemame)
1098 gross 1141 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 gross 1856 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 gross 1063
1104     def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank2(self):
1105     if loadIsConfigured():
1106 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank2.nc")
1107 gross 1856 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg2,ReducedFunctionOnBoundary(self.domain))
1108     self._diffDataObjects(d,filemame)
1109 gross 1141 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 gross 1856 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 gross 1063
1115     def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank3(self):
1116     if loadIsConfigured():
1117 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank3.nc")
1118 gross 1856 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg3,ReducedFunctionOnBoundary(self.domain))
1119     self._diffDataObjects(d,filemame)
1120 gross 1141 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 gross 1856 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 gross 1063
1126     def test_DumpAndLoad_Expanded_ReducedFunctionOnBoundary_Rank4(self):
1127     if loadIsConfigured():
1128 gross 1141 filemame=os.path.join(self.filename_base,"expanded_reduced_function_on_boundary_rank4.nc")
1129 gross 1856 d=Data(length(ReducedFunctionOnBoundary(self.domain).getX())*self.arg4,ReducedFunctionOnBoundary(self.domain))
1130     self._diffDataObjects(d,filemame)
1131 gross 1141 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 gross 1856 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 gross 1063
1137     #===========================================================================
1138 jfenwick 1802 ## 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 gross 983
1150 jfenwick 1802 #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 gross 983
1159 jfenwick 1802 #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 gross 983
1168 jfenwick 1802 #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 gross 983
1177 jfenwick 1802 #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 gross 983
1198 jfenwick 1802 #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 gross 983
1207 jfenwick 1802 #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 gross 983
1216 jfenwick 1802 #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 gross 983
1225 jfenwick 1802 #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 gross 983 def test_DumpAndLoad_Tagged_ContinuousFunction_Rank0(self):
1235 gross 1023 if loadIsConfigured():
1236 gross 1141 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank0.nc")
1237 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1242 gross 983
1243     def test_DumpAndLoad_Tagged_ContinuousFunction_Rank1(self):
1244 gross 1023 if loadIsConfigured():
1245 gross 1141 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank1.nc")
1246 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1251 gross 983
1252     def test_DumpAndLoad_Tagged_ContinuousFunction_Rank2(self):
1253 gross 1023 if loadIsConfigured():
1254 gross 1141 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank2.nc")
1255 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1260 gross 983
1261     def test_DumpAndLoad_Tagged_ContinuousFunction_Rank3(self):
1262 gross 1023 if loadIsConfigured():
1263 gross 1141 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank3.nc")
1264 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1269 gross 983
1270     def test_DumpAndLoad_Tagged_ContinuousFunction_Rank4(self):
1271 gross 1023 if loadIsConfigured():
1272 gross 1141 filemame=os.path.join(self.filename_base,"tagged_continuous_function_rank4.nc")
1273 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1278 gross 983
1279     #===========================================================================
1280     def test_DumpAndLoad_Tagged_Function_Rank0(self):
1281 gross 1023 if loadIsConfigured():
1282 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_rank0.nc")
1283 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1288 gross 983
1289     def test_DumpAndLoad_Tagged_Function_Rank1(self):
1290 gross 1023 if loadIsConfigured():
1291 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_rank1.nc")
1292 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1297 gross 983
1298     def test_DumpAndLoad_Tagged_Function_Rank2(self):
1299 gross 1023 if loadIsConfigured():
1300 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_rank2.nc")
1301 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1306 gross 983
1307     def test_DumpAndLoad_Tagged_Function_Rank3(self):
1308 gross 1023 if loadIsConfigured():
1309 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_rank3.nc")
1310 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1315 gross 983
1316     def test_DumpAndLoad_Tagged_Function_Rank4(self):
1317 gross 1023 if loadIsConfigured():
1318 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_rank4.nc")
1319 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1324 gross 983
1325     #===========================================================================
1326     def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank0(self):
1327 gross 1023 if loadIsConfigured():
1328 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank0.nc")
1329 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1334 gross 983
1335     def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank1(self):
1336 gross 1023 if loadIsConfigured():
1337 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank1.nc")
1338 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1343 gross 983
1344     def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank2(self):
1345 gross 1023 if loadIsConfigured():
1346 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank2.nc")
1347 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1352 gross 983
1353     def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank3(self):
1354 gross 1023 if loadIsConfigured():
1355 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank3.nc")
1356 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1361 gross 983
1362     def test_DumpAndLoad_Tagged_FunctionOnBoundary_Rank4(self):
1363 gross 1023 if loadIsConfigured():
1364 gross 1141 filemame=os.path.join(self.filename_base,"tagged_function_on_boundary_rank4.nc")
1365 gross 1023 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 gross 1141 self._diffDataObjects(d,filemame)
1370 gross 1034 #===========================================================================
1371 gross 1063 def test_DumpAndLoad_Tagged_ReducedFunction_Rank0(self):
1372     if loadIsConfigured():
1373 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank0.nc")
1374 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1379 gross 1063
1380     def test_DumpAndLoad_Tagged_ReducedFunction_Rank1(self):
1381     if loadIsConfigured():
1382 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank1.nc")
1383 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1388 gross 1063
1389     def test_DumpAndLoad_Tagged_ReducedFunction_Rank2(self):
1390     if loadIsConfigured():
1391 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank2.nc")
1392 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1397 gross 1063
1398     def test_DumpAndLoad_Tagged_ReducedFunction_Rank3(self):
1399     if loadIsConfigured():
1400 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank3.nc")
1401 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1406 gross 1063
1407     def test_DumpAndLoad_Tagged_ReducedFunction_Rank4(self):
1408     if loadIsConfigured():
1409 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_rank4.nc")
1410 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1415 gross 1063
1416     #===========================================================================
1417     def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank0(self):
1418     if loadIsConfigured():
1419 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank0.nc")
1420 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1425 gross 1063
1426     def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank1(self):
1427     if loadIsConfigured():
1428 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank1.nc")
1429 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1434 gross 1063
1435     def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank2(self):
1436     if loadIsConfigured():
1437 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank2.nc")
1438 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1443 gross 1063
1444     def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank3(self):
1445     if loadIsConfigured():
1446 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank3.nc")
1447 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1452 gross 1063
1453     def test_DumpAndLoad_Tagged_ReducedFunctionOnBoundary_Rank4(self):
1454     if loadIsConfigured():
1455 gross 1141 filemame=os.path.join(self.filename_base,"tagged_reduced_function_on_boundary_rank4.nc")
1456 gross 1063 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 gross 1141 self._diffDataObjects(d,filemame)
1461    
1462 jfenwick 1802 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)

  ViewVC Help
Powered by ViewVC 1.1.26