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

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

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

revision 2649 by jfenwick, Fri Sep 4 00:13:00 2009 UTC revision 2650 by jfenwick, Mon Sep 7 03:38:50 2009 UTC
# Line 90  class Test_TableInterpolation(unittest.T Line 90  class Test_TableInterpolation(unittest.T
90      for fs in self.functionspaces:      for fs in self.functionspaces:
91          print fs          print fs
92          points=fs.getX()          points=fs.getX()
93          if not points.hasNoSamples():          for t in vs:
           for t in vs:  
94          v0, v1, v2, v3 =t          v0, v1, v2, v3 =t
95          x=points[0]          x=points[0]
96          y=points[1]          y=points[1]
# Line 109  class Test_TableInterpolation(unittest.T Line 108  class Test_TableInterpolation(unittest.T
108                    table.append(row)                    table.append(row)
109              res=y.interpolateTable(table,ymin,ywidth,x, xmin, xwidth,500)              res=y.interpolateTable(table,ymin,ywidth,x, xmin, xwidth,500)
110              ref=v0+v1*x+v2*y+v3*x*y              ref=v0+v1*x+v2*y+v3*x*y
111              self.failUnless(Lsup(res-ref)/Lsup(ref)<self.RES_TOL,"Failed for %s"%str(fs))          lsupref=Lsup(ref)
112            if lsupref!=0:      #This will happen in cases where there are no samples on this rank
113                    self.failUnless(Lsup(res-ref)/Lsup(ref)<self.RES_TOL,"Failed for %s"%str(fs))
114                    
115    
116      def test_FunctionSpace1D(self):      def test_FunctionSpace1D(self):
# Line 117  class Test_TableInterpolation(unittest.T Line 118  class Test_TableInterpolation(unittest.T
118      for fs in self.functionspaces:      for fs in self.functionspaces:
119          print fs          print fs
120          points=fs.getX()          points=fs.getX()
121          if not points.hasNoSamples():          for t in vs:
           for t in vs:  
122          v0, v1 =t          v0, v1 =t
123          x=points[0]          x=points[0]
124          xmax=sup(x)          xmax=sup(x)
# Line 128  class Test_TableInterpolation(unittest.T Line 128  class Test_TableInterpolation(unittest.T
128          for i in xrange(self.xn+1):          for i in xrange(self.xn+1):
129             table.append(v0+v1*xwidth*i)             table.append(v0+v1*xwidth*i)
130              res=x.interpolateTable(table, xmin, xwidth,500)              res=x.interpolateTable(table, xmin, xwidth,500)
131              ref=v0+v1*x              ref=v0+v1*x
132              self.failUnless(Lsup(res-ref)/Lsup(ref)<self.RES_TOL,"Failed for %s"%str(fs))          lsupref=Lsup(ref)
133                    if lsupref!=0:      #This will happen in cases where there are no samples on this rank
134                   self.failUnless(Lsup(res-ref)/lsupref<self.RES_TOL,"Failed for %s"%str(fs))
135    
136    
137  class Test_saveCSV(unittest.TestCase):  class Test_saveCSV(unittest.TestCase):

Legend:
Removed from v.2649  
changed lines
  Added in v.2650

  ViewVC Help
Powered by ViewVC 1.1.26