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.RES_TOL,"value wrong scalar") |
self.failUnless(abs(xx-2.)<self.RES_TOL,"value wrong scalar") |
82 |
|
|
83 |
|
def test_Locator_withList(self): |
84 |
|
x=self.domain.getX() |
85 |
|
arg=[numarray.ones((self.domain.getDim(),)), numarray.zeros((self.domain.getDim(),))] |
86 |
|
l=Locator(self.domain,arg) |
87 |
|
self.failUnless(ContinuousFunction(self.domain)==l.getFunctionSpace(),"wrong function space from domain") |
88 |
|
|
89 |
|
l=Locator(ContinuousFunction(self.domain),arg) |
90 |
|
self.failUnless(ContinuousFunction(self.domain)==l.getFunctionSpace(),"wrong function space") |
91 |
|
|
92 |
|
xx=l.getX() |
93 |
|
self.failUnless(isinstance(xx,list),"list expected") |
94 |
|
for i in range(len(xx)): |
95 |
|
self.failUnless(isinstance(xx[i],numarray.NumArray),"vector expected for %s item"%i) |
96 |
|
self.failUnless(Lsup(xx[i]-arg[i])<self.RES_TOL,"%s-th location is wrong"%i) |
97 |
|
xx=l(x) |
98 |
|
self.failUnless(isinstance(xx,list),"list expected (2)") |
99 |
|
for i in range(len(xx)): |
100 |
|
self.failUnless(isinstance(xx[i],numarray.NumArray),"vector expected for %s item (2)"%i) |
101 |
|
self.failUnless(Lsup(xx[i]-arg[i])<self.RES_TOL,"%s-th location is wrong (2)"%i) |
102 |
|
xx=l(x[0]+x[1]) |
103 |
|
self.failUnless(isinstance(xx,list),"list expected (3)") |
104 |
|
for i in range(len(xx)): |
105 |
|
self.failUnless(isinstance(xx[i],float),"wrong scalar type") |
106 |
|
self.failUnless(abs(xx[i]-(arg[i][0]+arg[i][1]))<self.RES_TOL,"value wrong scalar") |
107 |
|
|
108 |
def testProjector_rank0(self): |
def testProjector_rank0(self): |
109 |
x=ContinuousFunction(self.domain).getX() |
x=ContinuousFunction(self.domain).getX() |