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

Diff of /trunk/escript/test/python/test_pdetools.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/escript/py_src/test_pdetools.py revision 609 by elspeth, Tue Mar 21 09:46:39 2006 UTC trunk/escript/test/python/test_pdetools.py revision 855 by gross, Fri Sep 22 09:30:06 2006 UTC
# Line 7  The tests must be linked with a Domain c Line 7  The tests must be linked with a Domain c
7    
8     from esys.finley import Rectangle     from esys.finley import Rectangle
9     class Test_LinearPDEOnFinley(Test_LinearPDE):     class Test_LinearPDEOnFinley(Test_LinearPDE):
10           RES_TOL=1-8
11         def setUp(self):         def setUp(self):
12             self.domain = Rectangle(10,10,2)             self.domain = Rectangle(10,10,2)
13           def tearDown(self):
14               del self.domain
15     suite = unittest.TestSuite()     suite = unittest.TestSuite()
16     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))
17     unittest.TextTestRunner(verbosity=2).run(suite)     unittest.TextTestRunner(verbosity=2).run(suite)
18    
19    @var __author__: name of author
20    @var __copyright__: copyrights
21    @var __license__: licence agreement
22    @var __url__: url entry point on documentation
23    @var __version__: version
24    @var __date__: date of the version
25  """  """
26    
27  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
28  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
29                      http://www.access.edu.au                      http://www.access.edu.au
30                  Primary Business: Queensland, Australia"""                  Primary Business: Queensland, Australia"""
31  __licence__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
32               http://www.opensource.org/licences/osl-3.0.php"""               http://www.opensource.org/licenses/osl-3.0.php"""
33  __url__="http://www.iservo.edu.au/esys/escript"  __url__="http://www.iservo.edu.au/esys/escript"
34  __version__="$Revision$"  __version__="$Revision$"
35  __date__="$Date$"  __date__="$Date$"
# Line 29  import unittest Line 38  import unittest
38  from esys.escript import *  from esys.escript import *
39  from esys.escript.pdetools import Locator,Projector,TimeIntegrationManager,NoPDE  from esys.escript.pdetools import Locator,Projector,TimeIntegrationManager,NoPDE
40    
41  class Test_pdetools(unittest.TestCase):  class Test_pdetools_noLumping(unittest.TestCase):
     TOL=1.e-6  
42      DEBUG=False      DEBUG=False
43      VERBOSE=False      VERBOSE=False
44      def test_TimeIntegrationManager_scalar(self):      def test_TimeIntegrationManager_scalar(self):
# Line 41  class Test_pdetools(unittest.TestCase): Line 49  class Test_pdetools(unittest.TestCase):
49             t+=dt             t+=dt
50             tm.checkin(dt,t)             tm.checkin(dt,t)
51          v_guess=tm.extrapolate(dt)          v_guess=tm.extrapolate(dt)
52          self.failUnless(abs(v_guess-(tm.getTime()+dt))<self.TOL,"extrapolation is wrong")          self.failUnless(abs(v_guess-(tm.getTime()+dt))<self.RES_TOL,"extrapolation is wrong")
53    
54      def test_TimeIntegrationManager_vector(self):      def test_TimeIntegrationManager_vector(self):
55          t=0.          t=0.
# Line 52  class Test_pdetools(unittest.TestCase): Line 60  class Test_pdetools(unittest.TestCase):
60             tm.checkin(dt,t,3*t)             tm.checkin(dt,t,3*t)
61          v_guess=tm.extrapolate(dt)          v_guess=tm.extrapolate(dt)
62          e=max(abs(v_guess[0]-(tm.getTime()+dt)),abs(v_guess[1]-(tm.getTime()+dt)*3.))          e=max(abs(v_guess[0]-(tm.getTime()+dt)),abs(v_guess[1]-(tm.getTime()+dt)*3.))
63          self.failUnless(e<self.TOL,"extrapolation is wrong")          self.failUnless(e<self.RES_TOL,"extrapolation is wrong")
64    
65      def test_Locator(self):      def test_Locator(self):
66          x=self.domain.getX()          x=self.domain.getX()
# Line 64  class Test_pdetools(unittest.TestCase): Line 72  class Test_pdetools(unittest.TestCase):
72    
73          xx=l.getX()          xx=l.getX()
74          self.failUnless(isinstance(xx,numarray.NumArray),"wrong vector type")          self.failUnless(isinstance(xx,numarray.NumArray),"wrong vector type")
75          self.failUnless(Lsup(xx-numarray.ones((self.domain.getDim(),)))<self.TOL,"location wrong")          self.failUnless(Lsup(xx-numarray.ones((self.domain.getDim(),)))<self.RES_TOL,"location wrong")
76          xx=l(x)          xx=l(x)
77          self.failUnless(isinstance(xx,numarray.NumArray),"wrong vector type")          self.failUnless(isinstance(xx,numarray.NumArray),"wrong vector type")
78          self.failUnless(Lsup(xx-numarray.ones((self.domain.getDim(),)))<self.TOL,"value wrong vector")          self.failUnless(Lsup(xx-numarray.ones((self.domain.getDim(),)))<self.RES_TOL,"value wrong vector")
79          xx=l(x[0]+x[1])          xx=l(x[0]+x[1])
80          self.failUnless(isinstance(xx,float),"wrong scalar type")          self.failUnless(isinstance(xx,float),"wrong scalar type")
81          self.failUnless(abs(xx-2.)<self.TOL,"value wrong scalar")          self.failUnless(abs(xx-2.)<self.RES_TOL,"value wrong scalar")
82                
83      def testProjector_rank0(self):      def testProjector_rank0(self):
84        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
85        p=Projector(self.domain,reduce=False,fast=False)        p=Projector(self.domain,reduce=False,fast=False)
86        td_ref=x[0]        td_ref=x[0]
87        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
88        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
89    
90      def testProjector_rank1(self):      def testProjector_rank1(self):
91        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
92        p=Projector(self.domain,reduce=False,fast=False)        p=Projector(self.domain,reduce=False,fast=False)
93        td_ref=x        td_ref=x
94        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
95        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
96    
97      def testProjector_rank2(self):      def testProjector_rank2(self):
98        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
99        p=Projector(self.domain,reduce=False,fast=False)        p=Projector(self.domain,reduce=False,fast=False)
100        td_ref=[[11.,12.],[21,22.]]*(x[0]+x[1])        td_ref=[[11.,12.],[21,22.]]*(x[0]+x[1])
101        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
102        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
103    
104      def testProjector_rank3(self):      def testProjector_rank3(self):
105        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
106        p=Projector(self.domain,reduce=False,fast=False)        p=Projector(self.domain,reduce=False,fast=False)
107        td_ref=[[[111.,112.],[121,122.]],[[211.,212.],[221,222.]]]*(x[0]+x[1])        td_ref=[[[111.,112.],[121,122.]],[[211.,212.],[221,222.]]]*(x[0]+x[1])
108        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
109        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
110    
111      def testProjector_rank4(self):      def testProjector_rank4(self):
112        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
113        p=Projector(self.domain,reduce=False,fast=False)        p=Projector(self.domain,reduce=False,fast=False)
114        td_ref=[[[[1111.,1112.],[1121,1122.]],[[1211.,1212.],[1221,1222.]]],[[[2111.,2112.],[2121,2122.]],[[2211.,2212.],[2221,2222.]]]]*(x[0]+x[1])        td_ref=[[[[1111.,1112.],[1121,1122.]],[[1211.,1212.],[1221,1222.]]],[[[2111.,2112.],[2121,2122.]],[[2211.,2212.],[2221,2222.]]]]*(x[0]+x[1])
115        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
116        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
117    
     def testProjector_rank0_fast(self):  
       x=ContinuousFunction(self.domain).getX()  
       h=Lsup(self.domain.getSize())  
       p=Projector(self.domain,reduce=False,fast=True)  
       td_ref=x[0]  
       td=p(td_ref.interpolate(Function(self.domain)))  
       self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")  
   
     def testProjector_rank1_fast(self):  
       x=ContinuousFunction(self.domain).getX()  
       h=Lsup(self.domain.getSize())  
       p=Projector(self.domain,reduce=False,fast=True)  
       td_ref=x  
       td=p(td_ref.interpolate(Function(self.domain)))  
       self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")  
   
     def testProjector_rank2_fast(self):  
       x=ContinuousFunction(self.domain).getX()  
       h=Lsup(self.domain.getSize())  
       p=Projector(self.domain,reduce=False,fast=True)  
       td_ref=[[11.,12.],[21,22.]]*(x[0]+x[1])  
       td=p(td_ref.interpolate(Function(self.domain)))  
       self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")  
   
     def testProjector_rank3_fast(self):  
       x=ContinuousFunction(self.domain).getX()  
       h=Lsup(self.domain.getSize())  
       p=Projector(self.domain,reduce=False,fast=True)  
       td_ref=[[[111.,112.],[121,122.]],[[211.,212.],[221,222.]]]*(x[0]+x[1])  
       td=p(td_ref.interpolate(Function(self.domain)))  
       self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")  
   
     def testProjector_rank4_fast(self):  
       x=ContinuousFunction(self.domain).getX()  
       h=Lsup(self.domain.getSize())  
       p=Projector(self.domain,reduce=False,fast=True)  
       td_ref=[[[[1111.,1112.],[1121,1122.]],[[1211.,1212.],[1221,1222.]]],[[[2111.,2112.],[2121,2122.]],[[2211.,2212.],[2221,2222.]]]]*(x[0]+x[1])  
       td=p(td_ref.interpolate(Function(self.domain)))  
       self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")  
118    
119      def testProjector_rank0_reduced(self):      def testProjector_rank0_reduced(self):
120        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
121        p=Projector(self.domain,reduce=True,fast=False)        p=Projector(self.domain,reduce=True,fast=False)
122        td_ref=x[0]        td_ref=x[0]
123        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
124        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
125    
126      def testProjector_rank1_reduced(self):      def testProjector_rank1_reduced(self):
127        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
128        p=Projector(self.domain,reduce=True,fast=False)        p=Projector(self.domain,reduce=True,fast=False)
129        td_ref=x        td_ref=x
130        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
131        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
132    
133      def testProjector_rank2_reduced(self):      def testProjector_rank2_reduced(self):
134        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
135        p=Projector(self.domain,reduce=True,fast=False)        p=Projector(self.domain,reduce=True,fast=False)
136        td_ref=[[11.,12.],[21,22.]]*(x[0]+x[1])        td_ref=[[11.,12.],[21,22.]]*(x[0]+x[1])
137        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
138        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
139    
140      def testProjector_rank3_reduced(self):      def testProjector_rank3_reduced(self):
141        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
142        p=Projector(self.domain,reduce=True,fast=False)        p=Projector(self.domain,reduce=True,fast=False)
143        td_ref=[[[111.,112.],[121,122.]],[[211.,212.],[221,222.]]]*(x[0]+x[1])        td_ref=[[[111.,112.],[121,122.]],[[211.,212.],[221,222.]]]*(x[0]+x[1])
144        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
145        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
146    
147      def testProjector_rank4_reduced(self):      def testProjector_rank4_reduced(self):
148        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
149        p=Projector(self.domain,reduce=True,fast=False)        p=Projector(self.domain,reduce=True,fast=False)
150        td_ref=[[[[1111.,1112.],[1121,1122.]],[[1211.,1212.],[1221,1222.]]],[[[2111.,2112.],[2121,2122.]],[[2211.,2212.],[2221,2222.]]]]*(x[0]+x[1])        td_ref=[[[[1111.,1112.],[1121,1122.]],[[1211.,1212.],[1221,1222.]]],[[[2111.,2112.],[2121,2122.]],[[2211.,2212.],[2221,2222.]]]]*(x[0]+x[1])
151        td=p(td_ref.interpolate(Function(self.domain)))        td=p(td_ref.interpolate(Function(self.domain)))
152        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.TOL,"value wrong")        self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*self.RES_TOL,"value wrong")
153    
154      def testProjector_rank0_fast_reduced(self):      def testProjector_rank0_fast_reduced(self):
155        x=ContinuousFunction(self.domain).getX()        x=ContinuousFunction(self.domain).getX()
# Line 229  class Test_pdetools(unittest.TestCase): Line 198  class Test_pdetools(unittest.TestCase):
198        p.setValue(D=1.,Y=1.,q=msk)        p.setValue(D=1.,Y=1.,q=msk)
199        u=p.getSolution()        u=p.getSolution()
200        u_ex=(1.-msk)        u_ex=(1.-msk)
201        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
202    
203      def test_NoPDE_scalar_missing_Y(self):      def test_NoPDE_scalar_missing_Y(self):
204        p=NoPDE(self.domain)        p=NoPDE(self.domain)
# Line 238  class Test_pdetools(unittest.TestCase): Line 207  class Test_pdetools(unittest.TestCase):
207        p.setValue(D=1.,q=msk,r=2.)        p.setValue(D=1.,q=msk,r=2.)
208        u=p.getSolution()        u=p.getSolution()
209        u_ex=msk*2.        u_ex=msk*2.
210        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
211    
212      def test_NoPDE_scalar_constant(self):      def test_NoPDE_scalar_constant(self):
213        p=NoPDE(self.domain)        p=NoPDE(self.domain)
# Line 247  class Test_pdetools(unittest.TestCase): Line 216  class Test_pdetools(unittest.TestCase):
216        p.setValue(D=1.,Y=1.,q=msk,r=2.)        p.setValue(D=1.,Y=1.,q=msk,r=2.)
217        u=p.getSolution()        u=p.getSolution()
218        u_ex=(1.-msk)+msk*2.        u_ex=(1.-msk)+msk*2.
219        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
220    
221      def test_NoPDE_scalar_variable(self):      def test_NoPDE_scalar_variable(self):
222        p=NoPDE(self.domain)        p=NoPDE(self.domain)
# Line 256  class Test_pdetools(unittest.TestCase): Line 225  class Test_pdetools(unittest.TestCase):
225        p.setValue(D=x[0],Y=2*x[0],q=msk,r=2.)        p.setValue(D=x[0],Y=2*x[0],q=msk,r=2.)
226        u=p.getSolution()        u=p.getSolution()
227        u_ex=2.        u_ex=2.
228        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
229    
230      def test_NoPDE_vector_missing_Y(self):      def test_NoPDE_vector_missing_Y(self):
231        p=NoPDE(self.domain)        p=NoPDE(self.domain)
232        x=self.domain.getX()        x=self.domain.getX()
233        msk=whereZero(x[0])*[1.,0.]        msk=whereZero(x[0])*[1.,0.]
234        p.setValue(D=1.,q=msk,r=2.)        p.setValue(D=numarray.ones([2]),q=msk,r=2.)
235        u=p.getSolution()        u=p.getSolution()
236        u_ex=msk*2.        u_ex=msk*2.
237        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
238    
239      def test_NoPDE_vector_missing_r(self):      def test_NoPDE_vector_missing_r(self):
240        p=NoPDE(self.domain)        p=NoPDE(self.domain)
241        x=self.domain.getX()        x=self.domain.getX()
242        msk=whereZero(x[0])*[1.,0.]        msk=whereZero(x[0])*[1.,0.]
243        p.setValue(D=1.,Y=1.,q=msk)        p.setValue(D=numarray.ones([2]),Y=numarray.ones([2]),q=msk)
244        u=p.getSolution()        u=p.getSolution()
245        u_ex=(1.-msk)        u_ex=(1.-msk)
246        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
247    
248      def test_NoPDE_vector_constant(self):      def test_NoPDE_vector_constant(self):
249        p=NoPDE(self.domain)        p=NoPDE(self.domain)
250        x=self.domain.getX()        x=self.domain.getX()
251        msk=whereZero(x[0])*[1.,0.]        msk=whereZero(x[0])*[1.,0.]
252        p.setValue(D=1.,Y=1.,q=msk,r=2.)        p.setValue(D=numarray.ones([2]),Y=numarray.ones([2]),q=msk,r=2.)
253        u=p.getSolution()        u=p.getSolution()
254        u_ex=(1.-msk)+msk*2.        u_ex=(1.-msk)+msk*2.
255        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
256    
257      def test_NoPDE_vector_variable(self):      def test_NoPDE_vector_variable(self):
258        p=NoPDE(self.domain)        p=NoPDE(self.domain)
# Line 292  class Test_pdetools(unittest.TestCase): Line 261  class Test_pdetools(unittest.TestCase):
261        p.setValue(D=x[:2],Y=2*x[:2],q=msk,r=2.)        p.setValue(D=x[:2],Y=2*x[:2],q=msk,r=2.)
262        u=p.getSolution()        u=p.getSolution()
263        u_ex=2.        u_ex=2.
264        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.TOL,"value wrong")        self.failUnless(Lsup(u_ex-u)<Lsup(u_ex)*self.RES_TOL,"value wrong")
265    
266    
267    class Test_pdetools(Test_pdetools_noLumping):
268        def testProjector_rank0_fast(self):
269          x=ContinuousFunction(self.domain).getX()
270          h=Lsup(self.domain.getSize())
271          p=Projector(self.domain,reduce=False,fast=True)
272          td_ref=x[0]
273          td=p(td_ref.interpolate(Function(self.domain)))
274          self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")
275    
276        def testProjector_rank1_fast(self):
277          x=ContinuousFunction(self.domain).getX()
278          h=Lsup(self.domain.getSize())
279          p=Projector(self.domain,reduce=False,fast=True)
280          td_ref=x
281          td=p(td_ref.interpolate(Function(self.domain)))
282          self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")
283    
284        def testProjector_rank2_fast(self):
285          x=ContinuousFunction(self.domain).getX()
286          h=Lsup(self.domain.getSize())
287          p=Projector(self.domain,reduce=False,fast=True)
288          td_ref=[[11.,12.],[21,22.]]*(x[0]+x[1])
289          td=p(td_ref.interpolate(Function(self.domain)))
290          self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")
291    
292        def testProjector_rank3_fast(self):
293          x=ContinuousFunction(self.domain).getX()
294          h=Lsup(self.domain.getSize())
295          p=Projector(self.domain,reduce=False,fast=True)
296          td_ref=[[[111.,112.],[121,122.]],[[211.,212.],[221,222.]]]*(x[0]+x[1])
297          td=p(td_ref.interpolate(Function(self.domain)))
298          self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")
299    
300        def testProjector_rank4_fast(self):
301          x=ContinuousFunction(self.domain).getX()
302          h=Lsup(self.domain.getSize())
303          p=Projector(self.domain,reduce=False,fast=True)
304          td_ref=[[[[1111.,1112.],[1121,1122.]],[[1211.,1212.],[1221,1222.]]],[[[2111.,2112.],[2121,2122.]],[[2211.,2212.],[2221,2222.]]]]*(x[0]+x[1])
305          td=p(td_ref.interpolate(Function(self.domain)))
306          self.failUnless(Lsup(td-td_ref)<Lsup(td_ref)*h,"value wrong")

Legend:
Removed from v.609  
changed lines
  Added in v.855

  ViewVC Help
Powered by ViewVC 1.1.26