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

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

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

trunk/escript/py_src/test_util_binary_no_tagged_data.py revision 396 by gross, Wed Dec 21 05:08:25 2005 UTC trunk/escript/test/python/test_util_binary_no_tagged_data.py revision 785 by gross, Tue Jul 25 03:48:10 2006 UTC
# Line 4  test for unary operations without tagged Line 4  test for unary operations without tagged
4    
5  @remark: use see L{test_util}  @remark: use see L{test_util}
6  @var __author__: name of author  @var __author__: name of author
7  @var __licence__: licence agreement  @var __copyright__: copyrights
8    @var __license__: licence agreement
9  @var __url__: url entry point on documentation  @var __url__: url entry point on documentation
10  @var __version__: version  @var __version__: version
11  @var __date__: date of the version  @var __date__: date of the version
12  """  """
13    
14  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
15  __licence__="contact: esys@access.uq.edu.au"  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
16                        http://www.access.edu.au
17                    Primary Business: Queensland, Australia"""
18    __license__="""Licensed under the Open Software License version 3.0
19                 http://www.opensource.org/licenses/osl-3.0.php"""
20  __url__="http://www.iservo.edu.au/esys/escript"  __url__="http://www.iservo.edu.au/esys/escript"
21  __version__="$Revision:$"  __version__="$Revision:$"
22  __date__="$Date:$"  __date__="$Date:$"
# Line 19  __date__="$Date:$" Line 24  __date__="$Date:$"
24  import unittest  import unittest
25  import numarray  import numarray
26  from esys.escript import *  from esys.escript import *
27  from esys.escript.test_util_base import Test_util_base  from test_util_base import Test_util_base
28    
29  class Test_util_binary_no_tagged_data(Test_util_base):  class Test_util_binary_no_tagged_data(Test_util_base):
30     """     """
# Line 23031  class Test_util_binary_no_tagged_data(Te Line 23036  class Test_util_binary_no_tagged_data(Te
23036        arg1=0.400555937829        arg1=0.400555937829
23037        res=maximum(arg0,arg1)        res=maximum(arg0,arg1)
23038        ref=0.400555937829        ref=0.400555937829
23039        self.failUnless(isinstance(res,float),"wrong type of result.")        if isinstance(res,numarray.NumArray):
23040             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
23041          else:
23042             self.failUnless(isinstance(res,float),"wrong type of result.")
23043        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
23044     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23045     def test_maximum_float_rank0_array_rank0(self):     def test_maximum_float_rank0_array_rank0(self):
# Line 23241  class Test_util_binary_no_tagged_data(Te Line 23249  class Test_util_binary_no_tagged_data(Te
23249        arg1=-0.367677151081        arg1=-0.367677151081
23250        res=maximum(arg0,arg1)        res=maximum(arg0,arg1)
23251        ref=numarray.array(-0.367677151081)        ref=numarray.array(-0.367677151081)
23252        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if isinstance(res,numarray.NumArray):
23253        self.failUnlessEqual(res.shape,(),"wrong shape of result.")            self.failUnlessEqual(res.shape,(),"wrong shape of result.")
23254          else:
23255              self.failUnless(isinstance(res,float),"wrong type of result.")
23256        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
23257     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23258     def test_maximum_array_rank1_float_rank0(self):     def test_maximum_array_rank1_float_rank0(self):
# Line 23286  class Test_util_binary_no_tagged_data(Te Line 23296  class Test_util_binary_no_tagged_data(Te
23296        arg1=numarray.array(-0.259958577128)        arg1=numarray.array(-0.259958577128)
23297        res=maximum(arg0,arg1)        res=maximum(arg0,arg1)
23298        ref=numarray.array(-0.259958577128)        ref=numarray.array(-0.259958577128)
23299        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if isinstance(res,numarray.NumArray):
23300        self.failUnlessEqual(res.shape,(),"wrong shape of result.")            self.failUnlessEqual(res.shape,(),"wrong shape of result.")
23301          else:
23302              self.failUnless(isinstance(res,float),"wrong type of result.")
23303        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
23304     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23305     def test_maximum_array_rank1_array_rank0(self):     def test_maximum_array_rank1_array_rank0(self):
# Line 25711  class Test_util_binary_no_tagged_data(Te Line 25723  class Test_util_binary_no_tagged_data(Te
25723        arg1=numarray.array(-0.445379036457)        arg1=numarray.array(-0.445379036457)
25724        res=minimum(arg0,arg1)        res=minimum(arg0,arg1)
25725        ref=numarray.array(-0.445379036457)        ref=numarray.array(-0.445379036457)
25726        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if isinstance(res,numarray.NumArray):
25727        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnlessEqual(res.shape,(),"wrong shape of result.")
25728          else:
25729             self.failUnless(isinstance(res,float),"wrong type of result.")
25730        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
25731     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25732     def test_minimum_float_rank0_Symbol_rank0(self):     def test_minimum_float_rank0_Symbol_rank0(self):
# Line 25911  class Test_util_binary_no_tagged_data(Te Line 25925  class Test_util_binary_no_tagged_data(Te
25925        arg1=-0.931803549177        arg1=-0.931803549177
25926        res=minimum(arg0,arg1)        res=minimum(arg0,arg1)
25927        ref=numarray.array(-0.931803549177)        ref=numarray.array(-0.931803549177)
25928        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if isinstance(res,numarray.NumArray):
25929        self.failUnlessEqual(res.shape,(),"wrong shape of result.")            self.failUnlessEqual(res.shape,(),"wrong shape of result.")
25930          else:
25931              self.failUnless(isinstance(res,float),"wrong type of result.")
25932        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
25933     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25934     def test_minimum_array_rank1_float_rank0(self):     def test_minimum_array_rank1_float_rank0(self):
# Line 28367  class Test_util_binary_no_tagged_data(Te Line 28383  class Test_util_binary_no_tagged_data(Te
28383        self.failUnless(isinstance(res,Data),"wrong type of result.")        self.failUnless(isinstance(res,Data),"wrong type of result.")
28384        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
28385        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28386       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28387       def test_power_float_rank0_constData_rank0(self):
28388          arg0=4.35251522982
28389          arg1=Data(2.94566651719,self.functionspace)
28390          res=power(arg0,arg1)
28391          ref=Data(76.1230031099,self.functionspace)
28392          self.failUnless(isinstance(res,Data),"wrong type of result.")
28393          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
28394          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28395       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28396       def test_power_float_rank0_expandedData_rank0(self):
28397          arg0=3.41819405792
28398          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
28399          arg1=msk_arg1*(3.18794922769)+(1.-msk_arg1)*(0.35955973515)
28400          res=power(arg0,arg1)
28401          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
28402          ref=msk_ref*(50.3172415941)+(1.-msk_ref)*(1.55572132713)
28403          self.failUnless(isinstance(res,Data),"wrong type of result.")
28404          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
28405          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28406       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28407       def test_tensor_mult_array_rank2_array_rank1(self):
28408          arg0=numarray.array([[1.0, -1.0, 5.0], [-1.0, -6.0, 6.0]])
28409          arg1=numarray.array([4.0, 0.0, -7.0])
28410          res=tensor_mult(arg0,arg1)
28411          ref=numarray.array([-31.0, -46.0])
28412          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
28413          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
28414          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28415       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28416       def test_tensor_mult_array_rank2_array_rank2(self):
28417          arg0=numarray.array([[-1.0, 5.0, -3.0], [5.0, 7.0, 0.0]])
28418          arg1=numarray.array([[6.0, -6.0], [-5.0, -2.0], [0.0, 2.0]])
28419          res=tensor_mult(arg0,arg1)
28420          ref=numarray.array([[-31.0, -10.0], [-5.0, -44.0]])
28421          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
28422          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
28423          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28424       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28425       def test_tensor_mult_array_rank2_Symbol_rank1(self):
28426          arg0=numarray.array([[-6.0, -2.0, 6.0], [-7.0, -1.0, -5.0]])
28427          arg1=Symbol(shape=(3,))
28428          res=tensor_mult(arg0,arg1)
28429          s1=numarray.array([4.0, -1.0, -7.0])
28430          sub=res.substitute({arg1:s1})
28431          ref=numarray.array([-64.0, 8.0])
28432          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28433          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28434          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28435       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28436       def test_tensor_mult_array_rank2_Symbol_rank2(self):
28437          arg0=numarray.array([[6.0, 2.0, 4.0], [0.0, -1.0, 3.0]])
28438          arg1=Symbol(shape=(3, 2))
28439          res=tensor_mult(arg0,arg1)
28440          s1=numarray.array([[1.0, -3.0], [-3.0, -5.0], [1.0, 0.0]])
28441          sub=res.substitute({arg1:s1})
28442          ref=numarray.array([[4.0, -28.0], [6.0, 5.0]])
28443          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28444          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28445          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28446       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28447       def test_tensor_mult_array_rank2_constData_rank1(self):
28448          arg0=numarray.array([[2.0, -4.0, 3.0], [-3.0, 3.0, 7.0]])
28449          arg1=Data(numarray.array([-5.0, 4.0, -4.0]),self.functionspace)
28450          res=tensor_mult(arg0,arg1)
28451          ref=Data(numarray.array([-38.0, -1.0]),self.functionspace)
28452          self.failUnless(isinstance(res,Data),"wrong type of result.")
28453          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28454          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28455       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28456       def test_tensor_mult_array_rank2_constData_rank2(self):
28457          arg0=numarray.array([[-5.0, 0.0, -6.0], [-6.0, 2.0, 4.0]])
28458          arg1=Data(numarray.array([[1.0, 4.0], [5.0, -6.0], [7.0, -3.0]]),self.functionspace)
28459          res=tensor_mult(arg0,arg1)
28460          ref=Data(numarray.array([[-47.0, -2.0], [32.0, -48.0]]),self.functionspace)
28461          self.failUnless(isinstance(res,Data),"wrong type of result.")
28462          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28463          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28464       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28465       def test_tensor_mult_array_rank2_expandedData_rank1(self):
28466          arg0=numarray.array([[3.0, 5.0, -3.0], [4.0, -5.0, -2.0]])
28467          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28468          arg1=msk_arg1*numarray.array([3.0, -4.0, 5.0])+(1.-msk_arg1)*numarray.array([-7.0, -3.0, -5.0])
28469          res=tensor_mult(arg0,arg1)
28470          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28471          ref=msk_ref*numarray.array([-26.0, 22.0])+(1.-msk_ref)*numarray.array([-21.0, -3.0])
28472          self.failUnless(isinstance(res,Data),"wrong type of result.")
28473          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28474          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28475       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28476       def test_tensor_mult_array_rank2_expandedData_rank2(self):
28477          arg0=numarray.array([[6.0, 7.0, 4.0], [-1.0, -4.0, 4.0]])
28478          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28479          arg1=msk_arg1*numarray.array([[3.0, -2.0], [-2.0, -3.0], [-5.0, -5.0]])+(1.-msk_arg1)*numarray.array([[-2.0, 7.0], [-6.0, -6.0], [-4.0, 4.0]])
28480          res=tensor_mult(arg0,arg1)
28481          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28482          ref=msk_ref*numarray.array([[-16.0, -53.0], [-15.0, -6.0]])+(1.-msk_ref)*numarray.array([[-70.0, 16.0], [10.0, 33.0]])
28483          self.failUnless(isinstance(res,Data),"wrong type of result.")
28484          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28485          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28486       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28487       def test_tensor_mult_array_rank4_array_rank2(self):
28488          arg0=numarray.array([[[[-7.0, 4.0, 2.0], [7.0, -2.0, 7.0]], [[3.0, 5.0, 0.0], [7.0, 0.0, -4.0]], [[0.0, -2.0, -4.0], [-3.0, -7.0, 0.0]], [[-1.0, -2.0, 5.0], [-5.0, 5.0, 4.0]], [[-5.0, -2.0, -1.0], [-5.0, 0.0, -2.0]]], [[[7.0, 0.0, -1.0], [5.0, -1.0, 7.0]], [[5.0, -6.0, -7.0], [-6.0, -2.0, 0.0]], [[-5.0, 4.0, 7.0], [-5.0, -4.0, 3.0]], [[0.0, -5.0, 1.0], [1.0, -4.0, -3.0]], [[-3.0, 4.0, -6.0], [-4.0, -6.0, -2.0]]], [[[0.0, 5.0, 0.0], [7.0, -7.0, -2.0]], [[1.0, -6.0, 3.0], [0.0, -5.0, -5.0]], [[-6.0, -4.0, 4.0], [0.0, 0.0, 2.0]], [[-5.0, -3.0, -7.0], [-1.0, 3.0, -4.0]], [[5.0, -3.0, 3.0], [-6.0, -1.0, 0.0]]], [[[2.0, -7.0, 0.0], [-4.0, 5.0, 1.0]], [[-2.0, -4.0, -6.0], [6.0, 2.0, 4.0]], [[0.0, 1.0, -1.0], [4.0, -4.0, -7.0]], [[-5.0, 6.0, 6.0], [0.0, 2.0, 1.0]], [[-5.0, 2.0, -7.0], [-7.0, -4.0, -3.0]]]])
28489          arg1=numarray.array([[0.0, 2.0, -5.0], [-2.0, -5.0, 1.0]])
28490          res=tensor_mult(arg0,arg1)
28491          ref=numarray.array([[1.0, -8.0, 57.0, -40.0, 9.0], [7.0, 45.0, 6.0, 0.0, 74.0], [29.0, -7.0, -26.0, 12.0, -4.0], [-30.0, 4.0, 12.0, -27.0, 70.0]])
28492          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
28493          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
28494          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28495       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28496       def test_tensor_mult_array_rank4_array_rank3(self):
28497          arg0=numarray.array([[[[6.0, 6.0, 2.0], [0.0, 5.0, 0.0]], [[-6.0, -2.0, -4.0], [-2.0, 4.0, -3.0]], [[-5.0, -6.0, 0.0], [5.0, 0.0, 7.0]], [[1.0, -7.0, -7.0], [2.0, 7.0, 4.0]], [[-6.0, -5.0, 2.0], [5.0, 0.0, 7.0]]], [[[-5.0, 7.0, 7.0], [-6.0, 0.0, -2.0]], [[0.0, -4.0, -4.0], [-2.0, 6.0, 4.0]], [[-7.0, -4.0, 0.0], [3.0, 0.0, 3.0]], [[-1.0, 1.0, 4.0], [0.0, 0.0, -4.0]], [[0.0, 6.0, 3.0], [2.0, 6.0, -7.0]]], [[[-6.0, 7.0, -1.0], [7.0, -1.0, 7.0]], [[-6.0, 2.0, 2.0], [-7.0, -2.0, 7.0]], [[-1.0, -5.0, 1.0], [3.0, 0.0, 0.0]], [[-2.0, 0.0, -7.0], [-5.0, -3.0, -2.0]], [[2.0, 6.0, -5.0], [-2.0, -3.0, -7.0]]], [[[-4.0, 1.0, 0.0], [-4.0, 3.0, 2.0]], [[1.0, 0.0, 6.0], [-6.0, -5.0, -7.0]], [[-4.0, -6.0, 2.0], [-1.0, 6.0, 0.0]], [[7.0, 4.0, -7.0], [-2.0, 2.0, 1.0]], [[-7.0, -1.0, -2.0], [0.0, -7.0, 3.0]]]])
28498          arg1=numarray.array([[[3.0, -4.0], [-1.0, -1.0], [-6.0, -7.0]], [[-2.0, 1.0], [1.0, 2.0], [3.0, 1.0]]])
28499          res=tensor_mult(arg0,arg1)
28500          ref=numarray.array([[[5.0, -34.0], [7.0, 57.0], [2.0, 38.0], [67.0, 72.0], [-14.0, 27.0]], [[-58.0, -44.0], [50.0, 46.0], [-14.0, 38.0], [-40.0, -29.0], [-43.0, -20.0]], [[-13.0, 36.0], [1.0, 4.0], [-10.0, 5.0], [37.0, 44.0], [10.0, 6.0]], [[4.0, 19.0], [-47.0, -69.0], [-10.0, 19.0], [68.0, 20.0], [-6.0, 32.0]]])
28501          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
28502          self.failUnlessEqual(res.shape,(4, 5, 2),"wrong shape of result.")
28503          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28504       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28505       def test_tensor_mult_array_rank4_array_rank4(self):
28506          arg0=numarray.array([[[[-1.0, -6.0, -4.0], [-2.0, 3.0, 3.0]], [[3.0, -6.0, 2.0], [-2.0, -1.0, -3.0]], [[4.0, -4.0, -4.0], [3.0, 1.0, 1.0]], [[6.0, -6.0, -6.0], [-4.0, -5.0, 0.0]], [[-2.0, 1.0, 7.0], [2.0, -1.0, -6.0]]], [[[-4.0, 6.0, 0.0], [2.0, -6.0, 1.0]], [[0.0, -7.0, 1.0], [7.0, 6.0, 4.0]], [[3.0, 4.0, -3.0], [2.0, 1.0, 7.0]], [[1.0, -6.0, 0.0], [2.0, 4.0, 6.0]], [[-5.0, 6.0, 3.0], [-3.0, 0.0, 0.0]]], [[[-1.0, 5.0, -5.0], [0.0, -6.0, -5.0]], [[-5.0, -2.0, 6.0], [-5.0, 4.0, -6.0]], [[0.0, 4.0, -5.0], [6.0, 4.0, 0.0]], [[2.0, -2.0, -4.0], [7.0, -5.0, -4.0]], [[-7.0, 3.0, -7.0], [2.0, 0.0, -2.0]]], [[[6.0, -7.0, 1.0], [7.0, -6.0, -4.0]], [[6.0, 7.0, 4.0], [-6.0, 7.0, 0.0]], [[4.0, 0.0, -6.0], [0.0, 1.0, 7.0]], [[-5.0, 7.0, 1.0], [2.0, -1.0, -1.0]], [[-1.0, 0.0, 6.0], [7.0, -2.0, 4.0]]]])
28507          arg1=numarray.array([[[[-2.0, 2.0, -6.0, 0.0, 0.0], [-2.0, 1.0, -4.0, 4.0, -3.0], [0.0, -7.0, 2.0, 2.0, 0.0], [3.0, 5.0, -1.0, -1.0, 0.0]], [[-5.0, -3.0, -1.0, 2.0, -6.0], [-3.0, -7.0, 2.0, -5.0, 3.0], [2.0, 6.0, -3.0, -4.0, 0.0], [5.0, 5.0, -1.0, 2.0, 7.0]], [[-1.0, 2.0, -7.0, 5.0, 2.0], [2.0, 0.0, -2.0, 4.0, 1.0], [3.0, -6.0, -6.0, 5.0, 7.0], [0.0, -3.0, 0.0, -6.0, -2.0]]], [[[4.0, 5.0, -2.0, 3.0, 3.0], [2.0, -5.0, 4.0, 4.0, -6.0], [3.0, 0.0, 0.0, -2.0, 6.0], [-1.0, 0.0, 4.0, -7.0, 0.0]], [[0.0, -2.0, -1.0, 3.0, 0.0], [4.0, 3.0, -3.0, -1.0, -4.0], [2.0, 7.0, 6.0, -4.0, 0.0], [-2.0, 5.0, -4.0, -1.0, 6.0]], [[1.0, -1.0, 0.0, -4.0, 2.0], [-3.0, 7.0, -4.0, 7.0, -4.0], [-1.0, 4.0, 0.0, -7.0, -7.0], [-2.0, 6.0, -6.0, 1.0, -4.0]]]])
28508          res=tensor_mult(arg0,arg1)
28509          ref=numarray.array([[[[31.0, -11.0, 41.0, -41.0, 28.0], [11.0, 81.0, -29.0, 20.0, -31.0], [-27.0, 28.0, 58.0, -27.0, -61.0], [-43.0, 10.0, -31.0, 27.0, -28.0]], [[11.0, 23.0, -21.0, 1.0, 28.0], [17.0, 31.0, -21.0, 22.0, 3.0], [-11.0, -88.0, 6.0, 69.0, 23.0], [-11.0, -44.0, 17.0, -15.0, -40.0]], [[29.0, 24.0, 1.0, -20.0, 27.0], [3.0, 27.0, -11.0, 38.0, -54.0], [-10.0, -17.0, 50.0, -13.0, -17.0], [-15.0, 23.0, 2.0, -9.0, -18.0]], [[8.0, 8.0, 25.0, -69.0, 12.0], [-34.0, 53.0, -25.0, 19.0, 2.0], [-52.0, -77.0, 36.0, 34.0, -66.0], [2.0, -7.0, 4.0, 51.0, -60.0]], [[-6.0, 25.0, -41.0, 64.0, 2.0], [33.0, -64.0, 31.0, -18.0, 32.0], [33.0, -53.0, -55.0, 69.0, 103.0], [11.0, -67.0, 49.0, -57.0, 11.0]]], [[[-13.0, -5.0, 20.0, -4.0, -28.0], [-33.0, -67.0, 50.0, -25.0, 38.0], [5.0, 26.0, -62.0, -19.0, 5.0], [26.0, -14.0, 24.0, 9.0, 2.0]], [[66.0, 42.0, -20.0, 14.0, 73.0], [49.0, 60.0, -22.0, 89.0, -102.0], [18.0, 10.0, 51.0, -33.0, 21.0], [-62.0, 16.0, -13.0, -71.0, -31.0]], [[-8.0, -11.0, -6.0, -26.0, -10.0], [-37.0, 17.0, -21.0, 36.0, -44.0], [0.0, 56.0, 18.0, -82.0, -58.0], [11.0, 91.0, -45.0, 15.0, 12.0]], [[42.0, 16.0, -8.0, -18.0, 54.0], [18.0, 87.0, -44.0, 80.0, -73.0], [-4.0, 9.0, 44.0, -36.0, -30.0], [-49.0, 31.0, -39.0, -25.0, -42.0]], [[-35.0, -37.0, 9.0, 18.0, -39.0], [-8.0, -32.0, 14.0, -50.0, 54.0], [12.0, 53.0, -46.0, -13.0, 3.0], [18.0, -4.0, -13.0, 20.0, 36.0]]], [[[-23.0, -10.0, 42.0, -13.0, -50.0], [-32.0, -89.0, 62.0, -78.0, 57.0], [-12.0, 5.0, -23.0, 12.0, 0.0], [44.0, -25.0, 50.0, 42.0, 29.0]], [[-12.0, -19.0, -4.0, 47.0, -3.0], [52.0, 4.0, -4.0, -52.0, 53.0], [13.0, -9.0, -16.0, 64.0, 54.0], [-16.0, -69.0, 7.0, -10.0, 22.0]], [[9.0, 0.0, 15.0, 13.0, -16.0], [6.0, -46.0, 30.0, -20.0, -45.0], [19.0, 82.0, 42.0, -69.0, 1.0], [6.0, 55.0, 4.0, -8.0, 62.0]], [[34.0, 51.0, 9.0, -2.0, 17.0], [0.0, -62.0, 55.0, 7.0, -22.0], [-1.0, -53.0, 4.0, 26.0, 42.0], [7.0, -37.0, 72.0, -30.0, -20.0]], [[12.0, -25.0, 84.0, -15.0, -30.0], [1.0, -52.0, 64.0, -77.0, 19.0], [-7.0, 101.0, 19.0, -51.0, -23.0], [-4.0, -11.0, 24.0, 39.0, 43.0]]], [[[46.0, 86.0, -44.0, 10.0, 57.0], [13.0, -26.0, 22.0, 69.0, -40.0], [2.0, -148.0, -9.0, 83.0, 77.0], [-4.0, -62.0, 77.0, -73.0, -71.0]], [[-75.0, -45.0, -66.0, 37.0, -52.0], [-9.0, 8.0, -63.0, -26.0, 15.0], [22.0, 25.0, 9.0, -12.0, -8.0], [45.0, 88.0, -65.0, 19.0, 83.0]], [[5.0, -13.0, 17.0, -55.0, 2.0], [-37.0, 56.0, -35.0, 40.0, -50.0], [-23.0, 43.0, 50.0, -75.0, -91.0], [-4.0, 85.0, -50.0, 38.0, -10.0]], [[-19.0, -16.0, 13.0, 26.0, -36.0], [-6.0, -74.0, 47.0, -49.0, 33.0], [22.0, 60.0, -43.0, -26.0, 26.0], [22.0, -4.0, 16.0, -1.0, 45.0]], [[28.0, 45.0, -48.0, 29.0, 41.0], [8.0, -14.0, 10.0, 78.0, -41.0], [31.0, -27.0, -50.0, -6.0, 56.0], [-14.0, -9.0, 13.0, -78.0, -40.0]]]])
28510          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
28511          self.failUnlessEqual(res.shape,(4, 5, 4, 5),"wrong shape of result.")
28512          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28513       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28514       def test_tensor_mult_array_rank4_Symbol_rank2(self):
28515          arg0=numarray.array([[[[-1.0, -6.0, 7.0], [2.0, 2.0, 1.0]], [[-7.0, 0.0, -4.0], [-2.0, 6.0, -7.0]], [[0.0, -3.0, -7.0], [4.0, -3.0, 4.0]], [[-6.0, 0.0, 7.0], [-6.0, 0.0, -7.0]], [[2.0, -1.0, 0.0], [6.0, -4.0, -5.0]]], [[[6.0, -3.0, 2.0], [-4.0, -5.0, 0.0]], [[4.0, 4.0, 1.0], [-1.0, 7.0, 0.0]], [[3.0, -2.0, -3.0], [-7.0, 3.0, 0.0]], [[-7.0, 6.0, -2.0], [-2.0, 2.0, 0.0]], [[2.0, 1.0, 1.0], [-2.0, 7.0, -1.0]]], [[[-4.0, -2.0, 0.0], [7.0, -5.0, 1.0]], [[-2.0, 2.0, -3.0], [-7.0, 1.0, 3.0]], [[4.0, -1.0, 6.0], [1.0, -7.0, 1.0]], [[3.0, -6.0, 5.0], [2.0, -6.0, 7.0]], [[-6.0, -5.0, 7.0], [4.0, 7.0, -2.0]]], [[[4.0, 4.0, 7.0], [-2.0, 0.0, -6.0]], [[-3.0, 5.0, -3.0], [1.0, -1.0, 0.0]], [[1.0, 1.0, 1.0], [5.0, 6.0, 2.0]], [[4.0, -7.0, -1.0], [-7.0, 4.0, -2.0]], [[1.0, -7.0, 6.0], [-7.0, -1.0, -7.0]]]])
28516          arg1=Symbol(shape=(2, 3))
28517          res=tensor_mult(arg0,arg1)
28518          s1=numarray.array([[-7.0, 3.0, 7.0], [0.0, 0.0, -7.0]])
28519          sub=res.substitute({arg1:s1})
28520          ref=numarray.array([[31.0, 70.0, -86.0, 140.0, 18.0], [-37.0, -9.0, -48.0, 53.0, 3.0], [15.0, -22.0, 4.0, -53.0, 90.0], [75.0, 15.0, -11.0, -42.0, 63.0]])
28521          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28522          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28523          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28524       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28525       def test_tensor_mult_array_rank4_Symbol_rank3(self):
28526          arg0=numarray.array([[[[-7.0, -3.0, 6.0], [4.0, 5.0, -3.0]], [[-7.0, 3.0, -1.0], [0.0, 7.0, -1.0]], [[3.0, -1.0, 2.0], [6.0, -7.0, 4.0]], [[-4.0, 1.0, 0.0], [7.0, -2.0, -4.0]], [[6.0, -2.0, -5.0], [7.0, 5.0, 6.0]]], [[[-4.0, -4.0, -3.0], [-1.0, 0.0, 0.0]], [[4.0, -2.0, -1.0], [6.0, 3.0, -1.0]], [[1.0, -2.0, -6.0], [0.0, 7.0, 4.0]], [[-3.0, 6.0, -1.0], [-1.0, 1.0, 5.0]], [[-4.0, 2.0, 1.0], [0.0, 5.0, -2.0]]], [[[0.0, -7.0, -3.0], [-7.0, -2.0, -5.0]], [[7.0, -4.0, -6.0], [1.0, 0.0, -4.0]], [[-2.0, -1.0, -4.0], [-2.0, 7.0, 0.0]], [[-4.0, 4.0, -2.0], [-1.0, -3.0, -2.0]], [[-4.0, -4.0, 2.0], [-5.0, -7.0, -5.0]]], [[[6.0, 0.0, 1.0], [-5.0, 6.0, 7.0]], [[2.0, -1.0, 1.0], [0.0, -1.0, -3.0]], [[-1.0, 1.0, -4.0], [1.0, 6.0, 0.0]], [[7.0, 0.0, 1.0], [-5.0, 0.0, 6.0]], [[-3.0, -7.0, -2.0], [1.0, 0.0, 0.0]]]])
28527          arg1=Symbol(shape=(2, 3, 2))
28528          res=tensor_mult(arg0,arg1)
28529          s1=numarray.array([[[2.0, -4.0], [-4.0, 6.0], [-5.0, 7.0]], [[-4.0, 0.0], [-1.0, 6.0], [-4.0, 4.0]]])
28530          sub=res.substitute({arg1:s1})
28531          ref=numarray.array([[[-41.0, 70.0], [-24.0, 77.0], [-33.0, -30.0], [-22.0, -6.0], [-12.0, -17.0]], [[27.0, -29.0], [-2.0, -21.0], [17.0, 0.0], [-42.0, 67.0], [-18.0, 57.0]], [[93.0, -95.0], [72.0, -110.0], [21.0, 16.0], [1.0, 0.0], [45.0, -56.0]], [[-7.0, 47.0], [16.0, -25.0], [4.0, 18.0], [5.0, 3.0], [28.0, -44.0]]])
28532          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28533          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28534          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28535       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28536       def test_tensor_mult_array_rank4_Symbol_rank4(self):
28537          arg0=numarray.array([[[[0.0, 5.0, 4.0], [0.0, -4.0, -2.0]], [[7.0, 7.0, 1.0], [-2.0, 3.0, 7.0]], [[-1.0, -2.0, -5.0], [6.0, 0.0, 7.0]], [[6.0, -5.0, 0.0], [-1.0, 2.0, 0.0]], [[-5.0, -5.0, 7.0], [6.0, 5.0, 4.0]]], [[[4.0, -2.0, 2.0], [6.0, -7.0, 7.0]], [[-7.0, 5.0, 5.0], [-7.0, 3.0, -4.0]], [[7.0, -7.0, -5.0], [-3.0, -6.0, -7.0]], [[6.0, 4.0, -4.0], [-4.0, 1.0, 0.0]], [[-1.0, -4.0, 2.0], [5.0, 1.0, 6.0]]], [[[7.0, 5.0, 0.0], [3.0, -6.0, 7.0]], [[-6.0, -6.0, -1.0], [-6.0, 5.0, 4.0]], [[7.0, 4.0, 6.0], [7.0, -6.0, 2.0]], [[-4.0, -5.0, -1.0], [-1.0, 2.0, 4.0]], [[-2.0, -5.0, -3.0], [-1.0, -7.0, -4.0]]], [[[-4.0, 3.0, 0.0], [-6.0, -5.0, -7.0]], [[1.0, -4.0, -5.0], [3.0, 4.0, -2.0]], [[0.0, 6.0, -4.0], [-4.0, -5.0, -5.0]], [[-2.0, 3.0, -5.0], [3.0, -7.0, 1.0]], [[4.0, 7.0, -1.0], [-1.0, -2.0, 5.0]]]])
28538          arg1=Symbol(shape=(2, 3, 4, 5))
28539          res=tensor_mult(arg0,arg1)
28540          s1=numarray.array([[[[0.0, 0.0, 6.0, 5.0, 4.0], [-2.0, -4.0, -4.0, 2.0, 7.0], [-5.0, -1.0, 0.0, -7.0, -7.0], [-4.0, -3.0, 5.0, -5.0, 2.0]], [[-3.0, -5.0, 1.0, 2.0, 4.0], [4.0, 2.0, -4.0, -6.0, 0.0], [4.0, 2.0, 0.0, -7.0, 0.0], [0.0, 0.0, 7.0, 2.0, 6.0]], [[4.0, -3.0, -3.0, 5.0, 2.0], [-6.0, 1.0, -4.0, 2.0, 2.0], [-7.0, -3.0, -7.0, -5.0, 0.0], [-5.0, -4.0, -6.0, 0.0, -5.0]]], [[[-5.0, 7.0, 7.0, 0.0, 0.0], [3.0, 5.0, 1.0, 0.0, 7.0], [0.0, -7.0, -1.0, -1.0, -5.0], [6.0, -6.0, 5.0, 0.0, 3.0]], [[3.0, 5.0, 6.0, 1.0, -7.0], [-7.0, 6.0, -4.0, 2.0, -7.0], [-1.0, 6.0, 6.0, 4.0, 6.0], [7.0, -7.0, -6.0, -4.0, -7.0]], [[0.0, 6.0, 7.0, 3.0, 4.0], [-3.0, 3.0, 6.0, -7.0, -1.0], [-7.0, 5.0, -1.0, -7.0, 1.0], [-5.0, -4.0, 4.0, -1.0, -2.0]]]])
28541          sub=res.substitute({arg1:s1})
28542          ref=numarray.array([[[[-11.0, -69.0, -45.0, 20.0, 48.0], [30.0, -16.0, -32.0, -16.0, 38.0], [10.0, -36.0, -50.0, -57.0, -26.0], [-38.0, 20.0, 27.0, 28.0, 42.0]], [[2.0, 5.0, 99.0, 78.0, 65.0], [-40.0, 16.0, -32.0, -69.0, 9.0], [-66.0, 71.0, 6.0, -138.0, -14.0], [-59.0, -62.0, 78.0, -40.0, 10.0]], [[-44.0, 109.0, 98.0, -13.0, 6.0], [21.0, 46.0, 80.0, -49.0, 18.0], [-17.0, 5.0, 22.0, -9.0, -16.0], [30.0, -41.0, 69.0, -6.0, 15.0]], [[26.0, 28.0, 36.0, 22.0, -10.0], [-49.0, -27.0, -13.0, 46.0, 21.0], [-52.0, 3.0, 13.0, 2.0, -25.0], [-16.0, -26.0, -22.0, -48.0, -35.0]], [[28.0, 95.0, 44.0, 17.0, -45.0], [-81.0, 89.0, 22.0, 16.0, -18.0], [-77.0, -18.0, -29.0, 21.0, 39.0], [36.0, -100.0, -86.0, -9.0, -100.0]]], [[[-37.0, 53.0, 65.0, 40.0, 89.0], [18.0, -9.0, 60.0, -39.0, 116.0], [-84.0, -63.0, -69.0, -107.0, -93.0], [-74.0, -35.0, 94.0, -3.0, 39.0]], [[49.0, -98.0, -111.0, -9.0, -35.0], [-26.0, 14.0, -55.0, 0.0, -105.0], [45.0, 49.0, -6.0, 36.0, 98.0], [2.0, 38.0, -99.0, 37.0, -43.0]], [[-2.0, -43.0, -56.0, -31.0, 4.0], [42.0, -119.0, -1.0, 83.0, 67.0], [27.0, -56.0, 9.0, 53.0, -77.0], [-28.0, 87.0, 9.0, -18.0, 44.0]], [[-5.0, -31.0, 30.0, 19.0, 25.0], [9.0, -34.0, -32.0, -18.0, -1.0], [13.0, 48.0, 38.0, -42.0, -16.0], [-21.0, 15.0, 56.0, -26.0, 37.0]], [[-2.0, 90.0, 67.0, 16.0, 1.0], [-36.0, 47.0, 49.0, -14.0, 19.0], [-68.0, -12.0, -19.0, -18.0, -6.0], [1.0, -66.0, -2.0, -13.0, -40.0]]], [[[-48.0, 8.0, 81.0, 60.0, 118.0], [36.0, -18.0, 21.0, -77.0, 105.0], [-58.0, -19.0, -46.0, -160.0, -93.0], [-87.0, -25.0, 149.0, -8.0, 81.0]], [[59.0, 40.0, -23.0, -30.0, -69.0], [-71.0, 23.0, 50.0, 4.0, -125.0], [-20.0, 89.0, 39.0, 87.0, 106.0], [8.0, 7.0, -110.0, -6.0, -104.0]], [[-41.0, -7.0, 55.0, 73.0, 106.0], [23.0, -9.0, -25.0, -24.0, 150.0], [-69.0, -92.0, -87.0, -152.0, -118.0], [-68.0, -53.0, 106.0, -5.0, 67.0]], [[22.0, 55.0, 7.0, -21.0, -36.0], [-35.0, 24.0, 55.0, -4.0, -55.0], [-23.0, 36.0, 16.0, 49.0, 49.0], [9.0, -8.0, -50.0, -2.0, -58.0]], [[-13.0, -32.0, -85.0, -54.0, -1.0], [60.0, -64.0, 43.0, 34.0, 26.0], [46.0, -54.0, -16.0, 65.0, -27.0], [-12.0, 89.0, -6.0, 32.0, 35.0]]], [[[6.0, -124.0, -142.0, -40.0, 3.0], [58.0, -59.0, -24.0, 13.0, -28.0], [86.0, -13.0, -17.0, 42.0, 21.0], [-20.0, 111.0, -27.0, 53.0, 41.0]], [[-11.0, 64.0, 48.0, -30.0, -58.0], [-1.0, 16.0, 7.0, 38.0, -8.0], [24.0, -1.0, 58.0, 73.0, 0.0], [77.0, -21.0, -10.0, -27.0, -12.0]], [[-29.0, -101.0, -75.0, -28.0, 31.0], [86.0, -57.0, -22.0, -19.0, 4.0], [92.0, -3.0, 7.0, -3.0, -15.0], [-14.0, 95.0, 56.0, 37.0, 89.0]], [[-65.0, -8.0, -8.0, -33.0, 47.0], [101.0, -15.0, 53.0, -53.0, 45.0], [57.0, -35.0, -11.0, -20.0, -42.0], [-3.0, 53.0, 102.0, 43.0, 95.0]], [[-26.0, -19.0, 50.0, 42.0, 76.0], [22.0, -5.0, -3.0, -75.0, 28.0], [-18.0, 33.0, -9.0, -114.0, -30.0], [-56.0, -8.0, 102.0, -3.0, 56.0]]]])
28543          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28544          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28545          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28546       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28547       def test_tensor_mult_array_rank4_constData_rank2(self):
28548          arg0=numarray.array([[[[-1.0, -2.0, -5.0], [-5.0, 6.0, 0.0]], [[-6.0, 1.0, 7.0], [1.0, 3.0, 1.0]], [[-2.0, 3.0, 0.0], [6.0, -1.0, 1.0]], [[4.0, -2.0, 4.0], [7.0, 6.0, -5.0]], [[5.0, -2.0, 4.0], [-1.0, 3.0, 4.0]]], [[[-4.0, -5.0, -5.0], [0.0, 5.0, -5.0]], [[-3.0, 1.0, 0.0], [7.0, 6.0, -3.0]], [[3.0, 0.0, 6.0], [2.0, -5.0, -2.0]], [[-2.0, -6.0, -2.0], [3.0, -1.0, -1.0]], [[0.0, -5.0, 3.0], [-2.0, 2.0, 4.0]]], [[[0.0, -6.0, 7.0], [-5.0, 0.0, -7.0]], [[6.0, -5.0, -6.0], [-2.0, -6.0, -4.0]], [[4.0, 4.0, 0.0], [6.0, 0.0, -3.0]], [[0.0, -2.0, -5.0], [-7.0, -1.0, -6.0]], [[-2.0, 7.0, 3.0], [-2.0, -7.0, 0.0]]], [[[-7.0, -6.0, 2.0], [3.0, 4.0, 3.0]], [[5.0, 3.0, -2.0], [7.0, 4.0, 2.0]], [[5.0, 1.0, 1.0], [6.0, -6.0, -3.0]], [[-6.0, -6.0, 5.0], [7.0, 2.0, -2.0]], [[-5.0, 2.0, -1.0], [-6.0, 4.0, -1.0]]]])
28549          arg1=Data(numarray.array([[-1.0, 4.0, 5.0], [6.0, -5.0, 6.0]]),self.functionspace)
28550          res=tensor_mult(arg0,arg1)
28551          ref=Data(numarray.array([[-92.0, 42.0, 61.0, -10.0, 10.0], [-96.0, 1.0, 52.0, -15.0, -3.0], [-61.0, -62.0, 30.0, -106.0, 68.0], [9.0, 31.0, 52.0, 27.0, -54.0]]),self.functionspace)
28552          self.failUnless(isinstance(res,Data),"wrong type of result.")
28553          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28554          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28555       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28556       def test_tensor_mult_array_rank4_constData_rank3(self):
28557          arg0=numarray.array([[[[-3.0, -6.0, 5.0], [6.0, 2.0, -3.0]], [[2.0, 4.0, 3.0], [-5.0, -7.0, -3.0]], [[1.0, -7.0, 7.0], [0.0, 3.0, 5.0]], [[5.0, 3.0, -2.0], [-7.0, 0.0, 0.0]], [[7.0, -7.0, -4.0], [-5.0, -2.0, 5.0]]], [[[-6.0, 4.0, -2.0], [0.0, -5.0, -1.0]], [[5.0, -1.0, 4.0], [3.0, -1.0, 7.0]], [[-4.0, -1.0, -4.0], [7.0, 6.0, 7.0]], [[2.0, -4.0, 4.0], [3.0, 1.0, 1.0]], [[-5.0, 0.0, 5.0], [5.0, 6.0, 0.0]]], [[[0.0, 1.0, 1.0], [5.0, 2.0, 1.0]], [[0.0, 1.0, 6.0], [-6.0, 6.0, 4.0]], [[2.0, -4.0, -6.0], [6.0, 6.0, 5.0]], [[-4.0, -6.0, -4.0], [-2.0, 4.0, 7.0]], [[3.0, 5.0, 6.0], [-3.0, -1.0, 0.0]]], [[[-2.0, 2.0, -1.0], [0.0, 4.0, 3.0]], [[3.0, -5.0, -5.0], [7.0, 1.0, 7.0]], [[-1.0, 2.0, -6.0], [-6.0, 7.0, 5.0]], [[3.0, -4.0, 7.0], [0.0, -7.0, -3.0]], [[-4.0, 4.0, 4.0], [-2.0, 1.0, -1.0]]]])
28558          arg1=Data(numarray.array([[[7.0, 6.0], [7.0, -3.0], [-4.0, -3.0]], [[1.0, 7.0], [-4.0, 4.0], [-4.0, 5.0]]]),self.functionspace)
28559          res=tensor_mult(arg0,arg1)
28560          ref=Data(numarray.array([[[-73.0, 20.0], [65.0, -87.0], [-102.0, 43.0], [57.0, -22.0], [-1.0, 57.0]], [[18.0, -67.0], [-9.0, 73.0], [-64.0, 99.0], [-35.0, 42.0], [-74.0, 14.0]], [[-4.0, 42.0], [-63.0, -19.0], [-28.0, 133.0], [-100.0, 43.0], [33.0, -40.0]], [[-24.0, 16.0], [-19.0, 136.0], [-23.0, 17.0], [5.0, -34.0], [-18.0, -63.0]]]),self.functionspace)
28561          self.failUnless(isinstance(res,Data),"wrong type of result.")
28562          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28563          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28564       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28565       def test_tensor_mult_array_rank4_constData_rank4(self):
28566          arg0=numarray.array([[[[3.0, -7.0, -1.0], [2.0, 7.0, 0.0]], [[-3.0, 7.0, -6.0], [5.0, -5.0, 5.0]], [[5.0, 7.0, 3.0], [3.0, 0.0, -4.0]], [[4.0, 7.0, -5.0], [6.0, -3.0, 1.0]], [[-3.0, 3.0, 6.0], [-2.0, 4.0, -4.0]]], [[[3.0, 0.0, -1.0], [0.0, -4.0, 1.0]], [[-5.0, 6.0, -7.0], [-6.0, 1.0, -3.0]], [[3.0, 7.0, 1.0], [-6.0, -4.0, 7.0]], [[7.0, 3.0, 1.0], [-7.0, 6.0, -4.0]], [[-4.0, 6.0, 5.0], [1.0, 6.0, 5.0]]], [[[-4.0, -6.0, -4.0], [-5.0, 2.0, 1.0]], [[0.0, -7.0, 3.0], [4.0, 1.0, 3.0]], [[-7.0, -2.0, -1.0], [4.0, 7.0, 5.0]], [[-5.0, 6.0, 4.0], [-4.0, 3.0, -5.0]], [[6.0, -5.0, 5.0], [-5.0, 4.0, -1.0]]], [[[2.0, 6.0, -3.0], [-2.0, 3.0, -2.0]], [[-1.0, 0.0, -5.0], [-1.0, -6.0, -5.0]], [[-2.0, 5.0, 4.0], [-7.0, -5.0, -7.0]], [[2.0, 1.0, -5.0], [1.0, 0.0, 4.0]], [[-4.0, -1.0, -6.0], [0.0, 7.0, -2.0]]]])
28567          arg1=Data(numarray.array([[[[7.0, 7.0, -6.0, 0.0, 3.0], [2.0, 0.0, -2.0, -6.0, 1.0], [0.0, -3.0, -2.0, 1.0, -6.0], [0.0, -1.0, -3.0, 0.0, -1.0]], [[2.0, 3.0, 1.0, 7.0, -1.0], [6.0, 7.0, -3.0, -2.0, -4.0], [3.0, -1.0, -3.0, 6.0, 6.0], [4.0, 7.0, -6.0, -5.0, -6.0]], [[-7.0, 4.0, 4.0, -4.0, -7.0], [2.0, -2.0, 1.0, -1.0, 3.0], [-3.0, 4.0, 6.0, -5.0, -4.0], [3.0, -2.0, 5.0, 7.0, -6.0]]], [[[-6.0, -1.0, -3.0, 1.0, 3.0], [4.0, 0.0, 0.0, 0.0, 6.0], [6.0, 0.0, -4.0, -1.0, 6.0], [-2.0, -4.0, 0.0, -6.0, 3.0]], [[3.0, -1.0, 2.0, 7.0, 6.0], [5.0, -3.0, 5.0, -1.0, -7.0], [-5.0, -4.0, 1.0, -7.0, 1.0], [-5.0, 4.0, 1.0, -3.0, -2.0]], [[2.0, 2.0, 3.0, -2.0, -5.0], [5.0, 2.0, 4.0, 4.0, -5.0], [0.0, -1.0, -3.0, 0.0, 0.0], [0.0, 4.0, 4.0, 7.0, -1.0]]]]),self.functionspace)
28568          res=tensor_mult(arg0,arg1)
28569          ref=Data(numarray.array([[[[23.0, -13.0, -21.0, 6.0, 71.0], [5.0, -68.0, 49.0, -10.0, -9.0], [-41.0, -34.0, 8.0, -85.0, -37.0], [-70.0, -30.0, 35.0, -5.0, 37.0]], [[0.0, -14.0, -9.0, 33.0, -14.0], [44.0, 86.0, -26.0, 35.0, -9.0], [94.0, -7.0, -91.0, 99.0, 109.0], [25.0, 44.0, -48.0, -57.0, 17.0]], [[2.0, 57.0, -32.0, 48.0, 16.0], [50.0, 35.0, -44.0, -63.0, 24.0], [30.0, -6.0, -13.0, 29.0, 18.0], [31.0, 10.0, -58.0, -60.0, -52.0]], [[34.0, 28.0, -58.0, 52.0, 35.0], [54.0, 70.0, -45.0, -26.0, 13.0], [87.0, -28.0, -89.0, 86.0, 71.0], [16.0, 23.0, -78.0, -90.0, 7.0]], [[-41.0, 2.0, 47.0, 31.0, -16.0], [16.0, -11.0, 7.0, -14.0, -17.0], [-41.0, 18.0, 57.0, -41.0, 4.0], [14.0, 20.0, 9.0, -1.0, -61.0]]], [[[18.0, 23.0, -27.0, -26.0, -13.0], [-11.0, 16.0, -23.0, -9.0, 23.0], [23.0, 2.0, -19.0, 36.0, -18.0], [17.0, -13.0, -14.0, 12.0, 10.0]], [[59.0, -46.0, 19.0, 77.0, 31.0], [-22.0, 47.0, -22.0, 12.0, -78.0], [-2.0, -20.0, -16.0, 65.0, 59.0], [10.0, 77.0, -67.0, -67.0, -6.0]], [[66.0, 70.0, 24.0, -3.0, -82.0], [41.0, 73.0, -18.0, -1.0, -65.0], [2.0, -3.0, -22.0, 74.0, -20.0], [63.0, 80.0, -22.0, 69.0, -68.0]], [[100.0, 55.0, -14.0, 60.0, 46.0], [16.0, -7.0, -8.0, -71.0, -66.0], [-66.0, -40.0, 29.0, -15.0, -64.0], [-1.0, 48.0, -44.0, -12.0, -60.0]], [[-29.0, 13.0, 74.0, 55.0, -39.0], [97.0, 24.0, 45.0, 21.0, -74.0], [-21.0, -3.0, 7.0, -36.0, 52.0], [7.0, 76.0, 27.0, 16.0, -76.0]]], [[[26.0, -57.0, 24.0, -19.0, 14.0], [-57.0, -38.0, 36.0, 42.0, -41.0], [-46.0, -7.0, 21.0, -29.0, -24.0], [-36.0, 2.0, 34.0, 33.0, 44.0]], [[-50.0, -8.0, 4.0, -56.0, -11.0], [0.0, -52.0, 41.0, 22.0, 39.0], [-11.0, 12.0, 15.0, -68.0, -29.0], [-32.0, -55.0, 70.0, 50.0, 31.0]], [[-39.0, -60.0, 53.0, 33.0, 17.0], [48.0, -23.0, 74.0, 60.0, -52.0], [-14.0, -14.0, -10.0, -67.0, 65.0], [-54.0, 27.0, 55.0, -7.0, 18.0]], [[-28.0, -10.0, 55.0, 53.0, -18.0], [8.0, 15.0, -9.0, -9.0, -37.0], [-33.0, 18.0, 50.0, -6.0, 29.0], [29.0, 47.0, -18.0, -22.0, -68.0]], [[37.0, 46.0, -1.0, -30.0, 2.0], [-13.0, -59.0, 24.0, -39.0, -12.0], [-80.0, -8.0, 60.0, -72.0, -112.0], [-15.0, -19.0, 37.0, 71.0, -28.0]]], [[[64.0, 15.0, -12.0, 77.0, 43.0], [31.0, 35.0, -18.0, -32.0, -54.0], [0.0, -34.0, -23.0, 34.0, 27.0], [4.0, 58.0, -62.0, -62.0, -30.0]], [[6.0, -30.0, -38.0, -13.0, 18.0], [-71.0, 18.0, -53.0, -3.0, 45.0], [39.0, 12.0, -15.0, 67.0, 14.0], [17.0, -29.0, -48.0, -46.0, 45.0]], [[-19.0, 15.0, 23.0, -9.0, -55.0], [-54.0, 28.0, -60.0, -25.0, 18.0], [-14.0, 44.0, 57.0, 50.0, -21.0], [71.0, 9.0, -37.0, 11.0, -56.0]], [[53.0, 4.0, -22.0, 20.0, 23.0], [24.0, 25.0, 4.0, 7.0, -31.0], [24.0, -31.0, -53.0, 32.0, 20.0], [-13.0, 27.0, -21.0, -18.0, 21.0]], [[29.0, -66.0, 7.0, 70.0, 83.0], [-1.0, -20.0, 32.0, 17.0, -57.0], [-20.0, -37.0, -12.0, -29.0, 49.0], [-57.0, 29.0, -13.0, -72.0, 34.0]]]]),self.functionspace)
28570          self.failUnless(isinstance(res,Data),"wrong type of result.")
28571          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28572          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28573       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28574       def test_tensor_mult_array_rank4_expandedData_rank2(self):
28575          arg0=numarray.array([[[[6.0, -5.0, 2.0], [-7.0, -7.0, 6.0]], [[-4.0, 7.0, 0.0], [4.0, -4.0, 7.0]], [[-5.0, 0.0, 7.0], [2.0, -6.0, -1.0]], [[0.0, 5.0, 0.0], [5.0, 0.0, 5.0]], [[-5.0, 0.0, -2.0], [3.0, 3.0, 1.0]]], [[[7.0, 1.0, 2.0], [-6.0, -3.0, 0.0]], [[7.0, -7.0, 7.0], [-7.0, 6.0, -2.0]], [[0.0, -7.0, 7.0], [6.0, 1.0, 4.0]], [[5.0, 5.0, 0.0], [-2.0, 7.0, -6.0]], [[6.0, -5.0, 7.0], [0.0, -6.0, -1.0]]], [[[6.0, -4.0, 0.0], [-2.0, -1.0, -4.0]], [[0.0, 6.0, 6.0], [-4.0, -2.0, 4.0]], [[0.0, -6.0, 6.0], [5.0, -5.0, -6.0]], [[7.0, 2.0, 0.0], [0.0, 0.0, -2.0]], [[5.0, 3.0, 7.0], [-5.0, 4.0, 2.0]]], [[[0.0, 7.0, 1.0], [7.0, 2.0, 3.0]], [[6.0, -6.0, -7.0], [0.0, -7.0, 0.0]], [[-2.0, 4.0, 0.0], [-6.0, -3.0, -6.0]], [[-2.0, 0.0, 0.0], [-3.0, 5.0, -1.0]], [[-1.0, 0.0, -6.0], [5.0, 4.0, -1.0]]]])
28576          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28577          arg1=msk_arg1*numarray.array([[-2.0, -2.0, 1.0], [2.0, -5.0, 1.0]])+(1.-msk_arg1)*numarray.array([[-4.0, -5.0, 1.0], [2.0, -6.0, -3.0]])
28578          res=tensor_mult(arg0,arg1)
28579          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28580          ref=msk_ref*numarray.array([[27.0, 29.0, 50.0, 5.0, 0.0], [-11.0, -39.0, 32.0, -65.0, 34.0], [-7.0, 0.0, 47.0, -20.0, -37.0], [-6.0, 28.0, -7.0, -28.0, -15.0]])+(1.-msk_ref)*numarray.array([[13.0, -8.0, 70.0, -30.0, 3.0], [-25.0, -30.0, 36.0, -73.0, 47.0], [10.0, -32.0, 94.0, -32.0, -68.0], [-41.0, 41.0, 12.0, -25.0, -13.0]])
28581          self.failUnless(isinstance(res,Data),"wrong type of result.")
28582          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28583          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28584       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28585       def test_tensor_mult_array_rank4_expandedData_rank3(self):
28586          arg0=numarray.array([[[[-3.0, 1.0, -6.0], [-6.0, 7.0, -4.0]], [[5.0, 2.0, 5.0], [7.0, -3.0, -2.0]], [[-7.0, 6.0, 5.0], [0.0, 1.0, 7.0]], [[-6.0, 7.0, -1.0], [5.0, 4.0, -6.0]], [[-4.0, -4.0, 4.0], [-6.0, 7.0, -2.0]]], [[[5.0, 4.0, -1.0], [-4.0, 3.0, 0.0]], [[2.0, -2.0, 5.0], [-5.0, -3.0, 6.0]], [[-6.0, 0.0, -6.0], [-2.0, 0.0, 0.0]], [[-5.0, -3.0, -3.0], [4.0, -1.0, 2.0]], [[6.0, 6.0, -2.0], [-6.0, 2.0, 6.0]]], [[[-2.0, 5.0, 1.0], [5.0, 7.0, 5.0]], [[2.0, -1.0, 5.0], [0.0, -6.0, 3.0]], [[-3.0, -2.0, 6.0], [-7.0, -6.0, 1.0]], [[5.0, 3.0, -5.0], [0.0, 0.0, 4.0]], [[-4.0, -2.0, 2.0], [4.0, 0.0, -7.0]]], [[[7.0, 0.0, 6.0], [4.0, -5.0, 1.0]], [[-2.0, 2.0, -3.0], [3.0, 2.0, 3.0]], [[4.0, 3.0, -4.0], [4.0, -5.0, 3.0]], [[-5.0, -3.0, 1.0], [-3.0, 0.0, 6.0]], [[0.0, -4.0, 4.0], [-2.0, -1.0, 4.0]]]])
28587          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28588          arg1=msk_arg1*numarray.array([[[5.0, 6.0], [4.0, 3.0], [-5.0, -6.0]], [[-6.0, -3.0], [0.0, -7.0], [7.0, 6.0]]])+(1.-msk_arg1)*numarray.array([[[-6.0, -2.0], [3.0, -6.0], [-3.0, 7.0]], [[2.0, -5.0], [3.0, -3.0], [5.0, -1.0]]])
28589          res=tensor_mult(arg0,arg1)
28590          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28591          ref=msk_ref*numarray.array([[[27.0, -34.0], [-48.0, -6.0], [13.0, -19.0], [-69.0, -88.0], [-34.0, -103.0]], [[70.0, 39.0], [49.0, 48.0], [12.0, 6.0], [-32.0, -14.0], [142.0, 106.0]], [[10.0, -37.0], [2.0, 39.0], [-4.0, 9.0], [90.0, 93.0], [-111.0, -96.0]], [[-12.0, 35.0], [16.0, 7.0], [49.0, 98.0], [18.0, 0.0], [4.0, 1.0]]])+(1.-msk_ref)*numarray.array([[[28.0, -29.0], [-44.0, -11.0], [83.0, 3.0], [52.0, -68.0], [-1.0, 71.0]], [[-14.0, -30.0], [-22.0, 71.0], [50.0, -20.0], [45.0, -12.0], [12.0, -44.0]], [[80.0, -70.0], [-33.0, 52.0], [-33.0, 112.0], [14.0, -67.0], [-15.0, 21.0]], [[-62.0, 22.0], [54.0, -53.0], [5.0, -62.0], [42.0, 44.0], [-11.0, 61.0]]])
28592          self.failUnless(isinstance(res,Data),"wrong type of result.")
28593          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28594          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28595       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28596       def test_tensor_mult_array_rank4_expandedData_rank4(self):
28597          arg0=numarray.array([[[[-5.0, -7.0, 4.0], [-7.0, 3.0, -7.0]], [[3.0, -2.0, 7.0], [-6.0, 2.0, 6.0]], [[-1.0, 6.0, -4.0], [0.0, -1.0, 0.0]], [[7.0, -7.0, 0.0], [-1.0, -1.0, -5.0]], [[2.0, -1.0, 7.0], [7.0, -4.0, 0.0]]], [[[1.0, 2.0, -5.0], [1.0, 0.0, -4.0]], [[0.0, 6.0, 7.0], [0.0, 3.0, -6.0]], [[0.0, -2.0, -5.0], [-4.0, 0.0, -5.0]], [[4.0, 0.0, 7.0], [-6.0, -2.0, -6.0]], [[3.0, -3.0, 0.0], [-5.0, -1.0, -1.0]]], [[[5.0, -4.0, -7.0], [0.0, 7.0, -3.0]], [[6.0, 5.0, -4.0], [-2.0, -6.0, 2.0]], [[5.0, 0.0, 5.0], [3.0, 3.0, 0.0]], [[-1.0, -3.0, 7.0], [4.0, -3.0, -7.0]], [[-6.0, 1.0, -2.0], [-6.0, -1.0, -1.0]]], [[[-6.0, -1.0, 2.0], [6.0, 0.0, -5.0]], [[5.0, 7.0, 2.0], [2.0, 3.0, 1.0]], [[3.0, -6.0, 1.0], [2.0, -3.0, 0.0]], [[-1.0, 7.0, 7.0], [1.0, 0.0, -7.0]], [[-6.0, 0.0, -6.0], [3.0, 0.0, 6.0]]]])
28598          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28599          arg1=msk_arg1*numarray.array([[[[3.0, -5.0, -6.0, -7.0, 0.0], [7.0, 3.0, 6.0, 5.0, 3.0], [2.0, -1.0, -3.0, -5.0, -3.0], [5.0, 4.0, 0.0, 4.0, -7.0]], [[4.0, -7.0, 6.0, 0.0, -1.0], [4.0, 4.0, 1.0, -7.0, 7.0], [0.0, 7.0, -4.0, -5.0, -4.0], [4.0, 4.0, -7.0, 6.0, 2.0]], [[-2.0, -5.0, -2.0, -6.0, 2.0], [-5.0, 5.0, 1.0, 0.0, -2.0], [-5.0, 3.0, 4.0, -4.0, -2.0], [-7.0, 7.0, -7.0, -1.0, -6.0]]], [[[2.0, 5.0, 3.0, 6.0, -7.0], [-1.0, 5.0, 1.0, -5.0, -1.0], [-7.0, -3.0, 6.0, 0.0, -5.0], [-4.0, 0.0, 7.0, -2.0, 4.0]], [[-7.0, -6.0, 0.0, 1.0, 0.0], [-2.0, 7.0, 4.0, 5.0, 0.0], [0.0, -5.0, -4.0, 3.0, -3.0], [-6.0, 0.0, -3.0, 2.0, -1.0]], [[5.0, 3.0, 1.0, -1.0, 0.0], [-2.0, 5.0, -5.0, -2.0, 1.0], [0.0, 0.0, -5.0, 2.0, -4.0], [2.0, 0.0, -2.0, -3.0, 4.0]]]])+(1.-msk_arg1)*numarray.array([[[[-4.0, -1.0, -2.0, 3.0, 4.0], [-4.0, 0.0, 6.0, 7.0, -5.0], [-1.0, 1.0, -5.0, 0.0, 4.0], [-4.0, -5.0, 3.0, -1.0, 3.0]], [[7.0, 6.0, -3.0, 1.0, -1.0], [-7.0, -2.0, 0.0, 0.0, 6.0], [4.0, 5.0, -7.0, 5.0, 1.0], [-2.0, 0.0, -5.0, -5.0, -4.0]], [[2.0, 2.0, -2.0, 1.0, 3.0], [0.0, 0.0, 7.0, 6.0, -2.0], [1.0, -6.0, 2.0, -6.0, -4.0], [2.0, -2.0, -6.0, -7.0, -6.0]]], [[[4.0, 7.0, -5.0, -7.0, 0.0], [7.0, 0.0, -7.0, 6.0, 0.0], [3.0, 5.0, -6.0, -6.0, -6.0], [0.0, -6.0, -1.0, -2.0, 4.0]], [[0.0, 2.0, 0.0, 0.0, 7.0], [3.0, 2.0, -2.0, 2.0, 0.0], [-3.0, -3.0, -7.0, -5.0, 6.0], [-3.0, -2.0, -1.0, 1.0, 0.0]], [[-1.0, 7.0, 6.0, -1.0, 6.0], [2.0, -1.0, 5.0, 0.0, 5.0], [5.0, 0.0, -4.0, 0.0, -6.0], [0.0, 6.0, 6.0, 2.0, 3.0]]]])
28600          res=tensor_mult(arg0,arg1)
28601          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28602          ref=msk_ref*numarray.array([[[[-121.0, -20.0, -48.0, -21.0, 64.0], [-68.0, -72.0, 7.0, 88.0, -72.0], [19.0, -26.0, 40.0, 39.0, 89.0], [-85.0, -20.0, -23.0, -25.0, -62.0]], [[-9.0, -60.0, -56.0, -103.0, 58.0], [-32.0, 50.0, -5.0, 57.0, -7.0], [13.0, 12.0, -47.0, -15.0, -15.0], [-18.0, 53.0, -95.0, -9.0, -69.0]], [[36.0, -11.0, 50.0, 30.0, -14.0], [39.0, -6.0, -8.0, -52.0, 47.0], [18.0, 36.0, -33.0, -12.0, -10.0], [53.0, -8.0, -11.0, 34.0, 44.0]], [[-27.0, 0.0, -92.0, -51.0, 14.0], [34.0, -44.0, 55.0, 94.0, -32.0], [21.0, -48.0, 30.0, -13.0, 35.0], [7.0, 0.0, 55.0, 1.0, -86.0]], [[30.0, 21.0, -11.0, -18.0, -34.0], [-24.0, 44.0, 9.0, -38.0, -22.0], [-80.0, 11.0, 84.0, -45.0, -39.0], [-47.0, 53.0, 19.0, -27.0, -26.0]]], [[[3.0, -1.0, 15.0, 33.0, -19.0], [47.0, -29.0, 24.0, -6.0, 22.0], [20.0, -5.0, -5.0, -3.0, 10.0], [36.0, -23.0, 36.0, 31.0, 15.0]], [[-41.0, -113.0, 16.0, -33.0, 8.0], [-5.0, 50.0, 55.0, -15.0, 22.0], [-35.0, 48.0, 22.0, -61.0, -23.0], [-55.0, 73.0, -88.0, 53.0, -57.0]], [[-31.0, 4.0, -19.0, 11.0, 20.0], [31.0, -78.0, 14.0, 44.0, -5.0], [53.0, -17.0, -11.0, 20.0, 58.0], [33.0, -43.0, 31.0, 16.0, -10.0]], [[-30.0, -91.0, -62.0, -102.0, 56.0], [15.0, -27.0, 47.0, 52.0, -2.0], [15.0, 45.0, 18.0, -66.0, 34.0], [-5.0, 65.0, -73.0, 35.0, -116.0]], [[-11.0, -16.0, -52.0, -51.0, 38.0], [18.0, -40.0, 11.0, 58.0, -8.0], [41.0, -4.0, -18.0, -5.0, 35.0], [27.0, 0.0, -9.0, 5.0, -50.0]]], [[[-51.0, -13.0, -43.0, 17.0, -10.0], [46.0, -2.0, 62.0, 94.0, -2.0], [45.0, -89.0, -40.0, 38.0, 6.0], [10.0, -45.0, 62.0, 26.0, -20.0]], [[94.0, -13.0, -2.0, -38.0, 1.0], [92.0, -24.0, 1.0, -29.0, 65.0], [46.0, 53.0, -52.0, -53.0, -10.0], [126.0, 16.0, -7.0, 44.0, -2.0]], [[-10.0, -53.0, -31.0, -44.0, -11.0], [1.0, 76.0, 50.0, 25.0, 2.0], [-36.0, -14.0, 11.0, -36.0, -49.0], [-40.0, 55.0, -23.0, 15.0, -56.0]], [[-35.0, 8.0, -21.0, -7.0, -11.0], [-38.0, -16.0, 25.0, -5.0, -49.0], [-65.0, 4.0, 114.0, -31.0, 18.0], [-78.0, 33.0, 23.0, -22.0, -50.0]], [[-20.0, 6.0, 27.0, 18.0, 37.0], [-18.0, -66.0, -42.0, -10.0, -2.0], [40.0, 30.0, -21.0, 28.0, 55.0], [16.0, -34.0, -30.0, -3.0, 29.0]]], [[[-39.0, 42.0, 39.0, 71.0, -37.0], [-52.0, -7.0, -4.0, -43.0, -40.0], [-64.0, -13.0, 91.0, 17.0, 8.0], [-82.0, -14.0, 45.0, -29.0, 32.0]], [[27.0, -89.0, 15.0, -33.0, -17.0], [43.0, 89.0, 48.0, -21.0, 59.0], [-14.0, 29.0, -40.0, -57.0, -70.0], [15.0, 62.0, -60.0, 59.0, -24.0]], [[8.0, 50.0, -50.0, -18.0, -6.0], [-4.0, -21.0, 3.0, 32.0, -37.0], [-13.0, -33.0, 43.0, 2.0, 12.0], [-6.0, -5.0, 58.0, -35.0, -28.0]], [[-22.0, -95.0, 30.0, -22.0, 0.0], [-1.0, 30.0, 44.0, -45.0, 24.0], [-44.0, 68.0, 44.0, -72.0, -16.0], [-44.0, 73.0, -77.0, 50.0, -45.0]], [[30.0, 93.0, 63.0, 90.0, -33.0], [-27.0, -3.0, -69.0, -57.0, -3.0], [-3.0, -21.0, -18.0, 66.0, -9.0], [12.0, -66.0, 51.0, -42.0, 114.0]]]])+(1.-msk_ref)*numarray.array([[[[-42.0, -121.0, 16.0, 38.0, -22.0], [15.0, 27.0, 6.0, -47.0, -60.0], [-84.0, -108.0, 131.0, -32.0, 59.0], [33.0, 11.0, -42.0, 15.0, -60.0]], [[-42.0, 3.0, 52.0, 50.0, 85.0], [-22.0, 2.0, 135.0, 31.0, -11.0], [2.0, -85.0, 11.0, -26.0, -6.0], [0.0, 39.0, 17.0, -16.0, -31.0]], [[38.0, 27.0, -8.0, -1.0, -29.0], [-41.0, -14.0, -32.0, -33.0, 49.0], [24.0, 56.0, -38.0, 59.0, 12.0], [-13.0, 15.0, -8.0, -2.0, -3.0]], [[-76.0, -93.0, -18.0, 26.0, -2.0], [1.0, 17.0, 26.0, 41.0, -102.0], [-60.0, -30.0, 47.0, -24.0, 51.0], [-11.0, -57.0, 28.0, 19.0, 30.0]], [[27.0, 47.0, -50.0, -37.0, 2.0], [36.0, -6.0, 20.0, 90.0, -30.0], [34.0, 2.0, -3.0, -69.0, -87.0], [20.0, -58.0, -34.0, -64.0, -4.0]]], [[[8.0, -20.0, -27.0, -3.0, -37.0], [-19.0, 0.0, -56.0, -17.0, -3.0], [-15.0, 46.0, -19.0, 34.0, 44.0], [-18.0, -25.0, -2.0, 14.0, 17.0]], [[62.0, 14.0, -68.0, 19.0, 0.0], [-45.0, 0.0, 13.0, 48.0, -8.0], [-8.0, -21.0, -25.0, -27.0, 32.0], [-7.0, -56.0, -111.0, -88.0, -84.0]], [[-35.0, -85.0, 6.0, 26.0, -43.0], [-24.0, 9.0, -32.0, -54.0, -27.0], [-50.0, 0.0, 48.0, 44.0, 72.0], [-6.0, 4.0, 14.0, 43.0, 7.0]], [[-20.0, -78.0, -28.0, 67.0, -13.0], [-76.0, 2.0, 89.0, 30.0, -64.0], [-39.0, -62.0, 68.0, 4.0, 48.0], [4.0, -30.0, -58.0, -55.0, -72.0]], [[-52.0, -65.0, 22.0, 42.0, 2.0], [-31.0, 5.0, 50.0, -11.0, -38.0], [-32.0, -34.0, 47.0, 20.0, 39.0], [-3.0, 11.0, 24.0, 19.0, -2.0]]], [[[-59.0, -50.0, -2.0, 7.0, 34.0], [23.0, 25.0, -48.0, 7.0, -50.0], [-64.0, 6.0, -48.0, -13.0, 104.0], [-47.0, -43.0, 52.0, 65.0, 64.0]], [[-7.0, 4.0, 3.0, 31.0, -23.0], [-87.0, -24.0, 44.0, -6.0, 18.0], [32.0, 63.0, -27.0, 91.0, 9.0], [-24.0, 14.0, 37.0, -1.0, 20.0]], [[2.0, 32.0, -35.0, -1.0, 56.0], [10.0, 6.0, 38.0, 89.0, -35.0], [0.0, -19.0, -54.0, -63.0, 0.0], [-19.0, -59.0, -21.0, -43.0, -3.0]], [[20.0, -30.0, -65.0, -20.0, -43.0], [30.0, 7.0, -14.0, 53.0, -62.0], [-18.0, -29.0, 65.0, -66.0, -35.0], [33.0, -69.0, -73.0, -58.0, -38.0]], [[4.0, -43.0, 37.0, 24.0, -44.0], [-30.0, -3.0, -11.0, -92.0, 35.0], [-12.0, -16.0, 66.0, 58.0, 21.0], [21.0, 66.0, -10.0, 24.0, -37.0]]], [[[50.0, 11.0, -49.0, -54.0, -47.0], [63.0, 7.0, -89.0, 6.0, -5.0], [-3.0, 7.0, 25.0, -53.0, -39.0], [30.0, -40.0, -61.0, -25.0, -17.0]], [[40.0, 68.0, -39.0, 9.0, 46.0], [-44.0, -9.0, 29.0, 65.0, 18.0], [27.0, 29.0, -107.0, -4.0, 19.0], [-39.0, -41.0, -31.0, -53.0, -14.0]], [[-44.0, -29.0, 0.0, -10.0, 0.0], [35.0, 6.0, 17.0, 33.0, -53.0], [-11.0, -14.0, 38.0, -33.0, -28.0], [11.0, -23.0, 34.0, 13.0, 35.0]], [[78.0, 15.0, -80.0, 11.0, -32.0], [-52.0, -7.0, 1.0, 41.0, -2.0], [4.0, -3.0, -8.0, -13.0, 11.0], [4.0, -57.0, -123.0, -99.0, -90.0]], [[18.0, 57.0, 45.0, -51.0, -6.0], [57.0, -6.0, -69.0, -60.0, 72.0], [39.0, 45.0, -24.0, 18.0, -54.0], [12.0, 60.0, 51.0, 54.0, 48.0]]]])
28603          self.failUnless(isinstance(res,Data),"wrong type of result.")
28604          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28605          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28606       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28607       def test_tensor_mult_Symbol_rank2_array_rank1(self):
28608          arg0=Symbol(shape=(2, 3))
28609          arg1=numarray.array([-2.0, -1.0, -4.0])
28610          res=tensor_mult(arg0,arg1)
28611          s0=numarray.array([[-5.0, -2.0, 4.0], [-7.0, 6.0, 4.0]])
28612          sub=res.substitute({arg0:s0})
28613          ref=numarray.array([-4.0, -8.0])
28614          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28615          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28616          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28617       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28618       def test_tensor_mult_Symbol_rank2_array_rank2(self):
28619          arg0=Symbol(shape=(2, 3))
28620          arg1=numarray.array([[6.0, -5.0], [2.0, 0.0], [1.0, -6.0]])
28621          res=tensor_mult(arg0,arg1)
28622          s0=numarray.array([[-1.0, 0.0, 0.0], [1.0, -4.0, 0.0]])
28623          sub=res.substitute({arg0:s0})
28624          ref=numarray.array([[-6.0, 5.0], [-2.0, -5.0]])
28625          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28626          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28627          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28628       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28629       def test_tensor_mult_Symbol_rank2_Symbol_rank1(self):
28630          arg0=Symbol(shape=(2, 3))
28631          arg1=Symbol(shape=(3,))
28632          res=tensor_mult(arg0,arg1)
28633          s0=numarray.array([[-5.0, -5.0, 2.0], [2.0, -7.0, -2.0]])
28634          s1=numarray.array([4.0, 2.0, 5.0])
28635          sub=res.substitute({arg0:s0,arg1:s1})
28636          ref=numarray.array([-20.0, -16.0])
28637          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28638          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28639          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28640       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28641       def test_tensor_mult_Symbol_rank2_Symbol_rank2(self):
28642          arg0=Symbol(shape=(2, 3))
28643          arg1=Symbol(shape=(3, 2))
28644          res=tensor_mult(arg0,arg1)
28645          s0=numarray.array([[0.0, -5.0, 0.0], [-7.0, -5.0, -7.0]])
28646          s1=numarray.array([[-6.0, 6.0], [-3.0, -5.0], [1.0, -3.0]])
28647          sub=res.substitute({arg0:s0,arg1:s1})
28648          ref=numarray.array([[15.0, 25.0], [50.0, 4.0]])
28649          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28650          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28651          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28652       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28653       def test_tensor_mult_Symbol_rank2_constData_rank1(self):
28654          arg0=Symbol(shape=(2, 3))
28655          arg1=Data(numarray.array([-6.0, 6.0, -2.0]),self.functionspace)
28656          res=tensor_mult(arg0,arg1)
28657          s0=numarray.array([[0.0, -7.0, -1.0], [-4.0, 6.0, 2.0]])
28658          sub=res.substitute({arg0:s0})
28659          ref=Data(numarray.array([-40.0, 56.0]),self.functionspace)
28660          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28661          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28662          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28663       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28664       def test_tensor_mult_Symbol_rank2_constData_rank2(self):
28665          arg0=Symbol(shape=(2, 3))
28666          arg1=Data(numarray.array([[7.0, 0.0], [7.0, 4.0], [-4.0, -5.0]]),self.functionspace)
28667          res=tensor_mult(arg0,arg1)
28668          s0=numarray.array([[-3.0, 6.0, -7.0], [7.0, 6.0, -7.0]])
28669          sub=res.substitute({arg0:s0})
28670          ref=Data(numarray.array([[49.0, 59.0], [119.0, 59.0]]),self.functionspace)
28671          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28672          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28673          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28674       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28675       def test_tensor_mult_Symbol_rank2_expandedData_rank1(self):
28676          arg0=Symbol(shape=(2, 3))
28677          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28678          arg1=msk_arg1*numarray.array([3.0, -1.0, -1.0])+(1.-msk_arg1)*numarray.array([3.0, -1.0, -7.0])
28679          res=tensor_mult(arg0,arg1)
28680          s0=numarray.array([[7.0, 5.0, 6.0], [0.0, 6.0, 4.0]])
28681          sub=res.substitute({arg0:s0})
28682          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28683          ref=msk_ref*numarray.array([10.0, -10.0])+(1.-msk_ref)*numarray.array([-26.0, -34.0])
28684          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28685          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28686          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28687       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28688       def test_tensor_mult_Symbol_rank2_expandedData_rank2(self):
28689          arg0=Symbol(shape=(2, 3))
28690          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28691          arg1=msk_arg1*numarray.array([[6.0, 1.0], [6.0, 3.0], [3.0, -1.0]])+(1.-msk_arg1)*numarray.array([[0.0, -6.0], [6.0, -7.0], [0.0, 6.0]])
28692          res=tensor_mult(arg0,arg1)
28693          s0=numarray.array([[0.0, 2.0, -2.0], [-1.0, 5.0, 7.0]])
28694          sub=res.substitute({arg0:s0})
28695          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28696          ref=msk_ref*numarray.array([[6.0, 8.0], [45.0, 7.0]])+(1.-msk_ref)*numarray.array([[12.0, -26.0], [30.0, 13.0]])
28697          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28698          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28699          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28700       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28701       def test_tensor_mult_Symbol_rank4_array_rank2(self):
28702          arg0=Symbol(shape=(4, 5, 2, 3))
28703          arg1=numarray.array([[-6.0, -2.0, 0.0], [6.0, 0.0, -5.0]])
28704          res=tensor_mult(arg0,arg1)
28705          s0=numarray.array([[[[5.0, -6.0, 0.0], [-4.0, 0.0, -5.0]], [[-3.0, 0.0, -2.0], [7.0, 5.0, 2.0]], [[-6.0, 2.0, -7.0], [0.0, 3.0, 7.0]], [[-7.0, -4.0, -6.0], [1.0, 4.0, 5.0]], [[6.0, 5.0, 5.0], [-3.0, -6.0, -7.0]]], [[[-4.0, 6.0, -6.0], [1.0, 7.0, 7.0]], [[0.0, 5.0, 3.0], [-5.0, 2.0, -7.0]], [[-3.0, 0.0, -5.0], [5.0, -2.0, -5.0]], [[2.0, 0.0, -3.0], [-5.0, -2.0, 0.0]], [[5.0, 6.0, -2.0], [-6.0, 7.0, 3.0]]], [[[0.0, 6.0, 3.0], [-7.0, 0.0, 7.0]], [[-4.0, -7.0, -1.0], [-5.0, 2.0, -6.0]], [[4.0, 1.0, 0.0], [4.0, -6.0, 0.0]], [[-5.0, 0.0, 0.0], [-1.0, 4.0, 5.0]], [[1.0, -2.0, -2.0], [1.0, -2.0, 0.0]]], [[[-2.0, 7.0, -3.0], [-2.0, -4.0, -5.0]], [[-1.0, -3.0, 1.0], [-4.0, 5.0, 2.0]], [[-5.0, -1.0, 3.0], [4.0, 6.0, -1.0]], [[7.0, 1.0, 0.0], [-7.0, 7.0, 3.0]], [[1.0, -2.0, 1.0], [-6.0, -7.0, 0.0]]]])
28706          sub=res.substitute({arg0:s0})
28707          ref=numarray.array([[-17.0, 50.0, -3.0, 31.0, -29.0], [-17.0, -5.0, 73.0, -42.0, -93.0], [-89.0, 38.0, -2.0, -1.0, 4.0], [11.0, -22.0, 61.0, -101.0, -38.0]])
28708          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28709          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28710          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28711       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28712       def test_tensor_mult_Symbol_rank4_array_rank3(self):
28713          arg0=Symbol(shape=(4, 5, 2, 3))
28714          arg1=numarray.array([[[-6.0, 0.0], [5.0, -4.0], [-3.0, -2.0]], [[1.0, 3.0], [-2.0, -2.0], [-3.0, -4.0]]])
28715          res=tensor_mult(arg0,arg1)
28716          s0=numarray.array([[[[2.0, 1.0, 1.0], [6.0, -2.0, -5.0]], [[0.0, 1.0, 1.0], [5.0, -3.0, 0.0]], [[-4.0, 1.0, 1.0], [2.0, 6.0, -7.0]], [[-2.0, 0.0, -7.0], [-1.0, 0.0, 7.0]], [[-2.0, 0.0, 7.0], [-1.0, 4.0, 0.0]]], [[[2.0, 7.0, -2.0], [-4.0, -2.0, -3.0]], [[-3.0, 2.0, -2.0], [-3.0, 0.0, 7.0]], [[-2.0, 4.0, 7.0], [-2.0, 1.0, 0.0]], [[1.0, -3.0, 3.0], [-6.0, -5.0, -3.0]], [[0.0, 5.0, 7.0], [0.0, 2.0, -1.0]]], [[[-5.0, 1.0, 2.0], [-6.0, 6.0, -6.0]], [[0.0, 7.0, 7.0], [0.0, -7.0, 3.0]], [[0.0, 0.0, 0.0], [-3.0, -2.0, 4.0]], [[-4.0, -4.0, 0.0], [0.0, 0.0, -6.0]], [[-3.0, -5.0, -1.0], [-3.0, 4.0, -2.0]]], [[[-4.0, 0.0, -5.0], [2.0, -4.0, -2.0]], [[0.0, -2.0, 0.0], [4.0, 0.0, 7.0]], [[2.0, 3.0, 1.0], [-2.0, -2.0, -1.0]], [[3.0, 0.0, -4.0], [6.0, -2.0, 2.0]], [[-4.0, 2.0, -3.0], [6.0, 4.0, 1.0]]]])
28717          sub=res.substitute({arg0:s0})
28718          ref=numarray.array([[[15.0, 36.0], [13.0, 15.0], [37.0, 16.0], [11.0, -17.0], [-18.0, -25.0]], [[38.0, -20.0], [10.0, -41.0], [7.0, -38.0], [-17.0, 10.0], [3.0, -34.0]], [[29.0, -14.0], [19.0, -40.0], [-11.0, -21.0], [22.0, 40.0], [-9.0, 13.0]], [[55.0, 32.0], [-27.0, -8.0], [5.0, -12.0], [-2.0, 22.0], [38.0, 4.0]]])
28719          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28720          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28721          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28722       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28723       def test_tensor_mult_Symbol_rank4_array_rank4(self):
28724          arg0=Symbol(shape=(4, 5, 2, 3))
28725          arg1=numarray.array([[[[7.0, 6.0, 2.0, -2.0, 1.0], [4.0, 2.0, 5.0, -6.0, 3.0], [-4.0, -5.0, -1.0, -4.0, -3.0], [1.0, -7.0, -7.0, -7.0, 7.0]], [[1.0, -7.0, 0.0, -6.0, -5.0], [-3.0, 5.0, 2.0, -2.0, 4.0], [7.0, -7.0, -4.0, 2.0, 0.0], [-6.0, 2.0, -3.0, 2.0, 2.0]], [[-1.0, 1.0, 4.0, 6.0, 0.0], [-5.0, -2.0, -1.0, 0.0, 5.0], [6.0, -2.0, -3.0, 4.0, 5.0], [-5.0, -7.0, 2.0, -5.0, -7.0]]], [[[-1.0, 0.0, -2.0, 3.0, 3.0], [4.0, 0.0, 4.0, 0.0, 2.0], [-4.0, 0.0, 7.0, 1.0, -1.0], [5.0, -4.0, -7.0, -4.0, -5.0]], [[-6.0, 5.0, 0.0, 0.0, -5.0], [0.0, -4.0, 2.0, 0.0, 4.0], [7.0, 0.0, -1.0, 3.0, 0.0], [3.0, 3.0, -1.0, 4.0, -4.0]], [[-1.0, 6.0, 4.0, 1.0, -7.0], [-3.0, -6.0, 4.0, -6.0, -7.0], [-6.0, -2.0, -6.0, -3.0, -7.0], [-2.0, 6.0, 7.0, -3.0, 0.0]]]])
28726          res=tensor_mult(arg0,arg1)
28727          s0=numarray.array([[[[-6.0, -3.0, 2.0], [4.0, -6.0, -4.0]], [[7.0, -7.0, 0.0], [-7.0, -1.0, -6.0]], [[7.0, 6.0, 6.0], [5.0, 0.0, 6.0]], [[3.0, -4.0, 4.0], [-1.0, -7.0, -7.0]], [[-6.0, -7.0, 7.0], [6.0, -5.0, 0.0]]], [[[6.0, -6.0, -6.0], [3.0, 0.0, -5.0]], [[1.0, 1.0, 1.0], [6.0, 7.0, 5.0]], [[-1.0, -5.0, 4.0], [-3.0, -1.0, 0.0]], [[-2.0, 2.0, -5.0], [0.0, 0.0, -3.0]], [[-2.0, -2.0, 4.0], [-5.0, 4.0, 5.0]]], [[[-2.0, -4.0, -3.0], [-3.0, -7.0, 0.0]], [[1.0, 1.0, 3.0], [-6.0, 7.0, 0.0]], [[0.0, -3.0, 1.0], [1.0, 0.0, -5.0]], [[-6.0, 5.0, -4.0], [1.0, -3.0, -3.0]], [[-4.0, 7.0, 0.0], [0.0, 0.0, 7.0]]], [[[-6.0, -5.0, 0.0], [2.0, -1.0, -7.0]], [[2.0, 2.0, 3.0], [5.0, 4.0, -5.0]], [[-3.0, -4.0, -4.0], [2.0, -2.0, 4.0]], [[1.0, -2.0, -2.0], [0.0, 4.0, 7.0]], [[-3.0, 0.0, -5.0], [4.0, -1.0, 7.0]]]])
28728          sub=res.substitute({arg0:s0})
28729          ref=numarray.array([[[[-11.0, -67.0, -28.0, 50.0, 79.0], [3.0, 17.0, -50.0, 66.0, -8.0], [-19.0, 55.0, 70.0, 24.0, 52.0], [12.0, -36.0, 5.0, -2.0, -58.0]], [[61.0, 50.0, 4.0, 1.0, 68.0], [39.0, 19.0, -33.0, 8.0, 17.0], [-20.0, 26.0, 9.0, -34.0, 28.0], [23.0, -74.0, -20.0, -21.0, 74.0]], [[38.0, 42.0, 52.0, 7.0, -50.0], [-18.0, -4.0, 85.0, -90.0, 43.0], [-6.0, -101.0, -50.0, -5.0, -38.0], [-46.0, -63.0, -48.0, -105.0, -6.0]], [[63.0, -27.0, -4.0, 32.0, 104.0], [21.0, 48.0, -43.0, 32.0, 32.0], [-19.0, 19.0, 43.0, -5.0, 61.0], [-5.0, -116.0, -36.0, -52.0, 18.0]], [[-32.0, -5.0, 4.0, 114.0, 72.0], [-14.0, -41.0, -37.0, 50.0, -19.0], [-42.0, 65.0, 60.0, 29.0, 47.0], [16.0, -60.0, 40.0, -51.0, -115.0]]], [[[44.0, 42.0, -38.0, -8.0, 80.0], [99.0, 24.0, 16.0, 6.0, 5.0], [-84.0, 34.0, 87.0, -42.0, -16.0], [97.0, -54.0, -92.0, -21.0, 57.0]], [[-46.0, 65.0, 14.0, 21.0, -56.0], [5.0, -53.0, 64.0, -38.0, 17.0], [4.0, -24.0, -3.0, 14.0, -39.0], [31.0, 15.0, -22.0, -21.0, -56.0]], [[-7.0, 28.0, 20.0, 47.0, 20.0], [-21.0, -31.0, -33.0, 16.0, -13.0], [-2.0, 32.0, -11.0, 4.0, 26.0], [-9.0, -22.0, 52.0, -15.0, -26.0]], [[-4.0, -49.0, -36.0, -41.0, 9.0], [20.0, 34.0, -13.0, 26.0, -2.0], [10.0, 12.0, 27.0, 1.0, 2.0], [17.0, 35.0, -23.0, 52.0, 25.0]], [[-44.0, 56.0, 42.0, 30.0, -62.0], [-57.0, -68.0, -10.0, -14.0, -23.0], [36.0, 6.0, -71.0, 12.0, -4.0], [-33.0, 44.0, 94.0, 11.0, -37.0]]], [[[30.0, -22.0, -10.0, 1.0, 44.0], [7.0, 10.0, -41.0, 20.0, -71.0], [-75.0, 44.0, 13.0, -36.0, -6.0], [1.0, 18.0, 48.0, 5.0, 42.0]], [[-31.0, 37.0, 26.0, -8.0, -57.0], [-38.0, -27.0, -6.0, -8.0, 38.0], [94.0, -18.0, -63.0, 25.0, 18.0], [-29.0, 19.0, 31.0, 32.0, -10.0]], [[0.0, -8.0, -18.0, 22.0, 53.0], [23.0, 13.0, -23.0, 36.0, 30.0], [11.0, 29.0, 46.0, 14.0, 39.0], [28.0, -47.0, -31.0, 0.0, -18.0]], [[-13.0, -108.0, -42.0, -42.0, 8.0], [-6.0, 51.0, -30.0, 44.0, -7.0], [28.0, 9.0, 26.0, 19.0, 18.0], [-14.0, 49.0, -6.0, 65.0, 3.0]], [[-28.0, -31.0, 20.0, -27.0, -88.0], [-58.0, -15.0, 22.0, -32.0, -33.0], [23.0, -43.0, -66.0, 9.0, -37.0], [-60.0, 84.0, 56.0, 21.0, -14.0]]], [[[-36.0, -48.0, -44.0, 41.0, 79.0], [20.0, 9.0, -62.0, 88.0, 11.0], [16.0, 79.0, 83.0, 34.0, 65.0], [45.0, -21.0, -5.0, 41.0, -58.0]], [[-11.0, -9.0, -14.0, 12.0, 22.0], [22.0, 22.0, 19.0, 14.0, 90.0], [62.0, -20.0, 42.0, 40.0, 39.0], [22.0, -69.0, -88.0, -14.0, -44.0]], [[-15.0, 20.0, -10.0, 16.0, 5.0], [16.0, -34.0, 1.0, 2.0, -77.0], [-86.0, 43.0, 23.0, -28.0, -41.0], [37.0, 51.0, 41.0, 5.0, -3.0]], [[-24.0, 80.0, 22.0, 5.0, -58.0], [-1.0, -62.0, 39.0, -44.0, -48.0], [-44.0, -1.0, -33.0, -25.0, -62.0], [21.0, 57.0, 40.0, -6.0, 1.0]], [[-21.0, 14.0, -6.0, -5.0, -35.0], [8.0, -34.0, 32.0, -24.0, -79.0], [-83.0, 11.0, 5.0, -28.0, -69.0], [25.0, 79.0, 33.0, 5.0, -2.0]]]])
28730          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28731          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28732          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28733       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28734       def test_tensor_mult_Symbol_rank4_Symbol_rank2(self):
28735          arg0=Symbol(shape=(4, 5, 2, 3))
28736          arg1=Symbol(shape=(2, 3))
28737          res=tensor_mult(arg0,arg1)
28738          s0=numarray.array([[[[1.0, -3.0, 5.0], [6.0, 0.0, 2.0]], [[-5.0, -6.0, -1.0], [-7.0, 6.0, -2.0]], [[6.0, -3.0, 5.0], [7.0, -4.0, 2.0]], [[-6.0, 1.0, -2.0], [-5.0, -6.0, 4.0]], [[-3.0, 6.0, 4.0], [0.0, 2.0, 3.0]]], [[[2.0, -2.0, 1.0], [-7.0, -2.0, 7.0]], [[-3.0, -3.0, -7.0], [5.0, 0.0, 3.0]], [[-1.0, 5.0, 5.0], [3.0, -2.0, 4.0]], [[0.0, 2.0, -3.0], [6.0, 7.0, 2.0]], [[4.0, 4.0, -5.0], [1.0, -4.0, 5.0]]], [[[3.0, 4.0, -7.0], [-4.0, -2.0, 6.0]], [[7.0, -2.0, -2.0], [2.0, -4.0, 5.0]], [[-6.0, 0.0, -1.0], [6.0, 1.0, 7.0]], [[-7.0, -4.0, -6.0], [6.0, -6.0, 2.0]], [[-6.0, 0.0, 5.0], [7.0, 6.0, 1.0]]], [[[7.0, 3.0, 3.0], [7.0, -1.0, 0.0]], [[0.0, 2.0, 3.0], [0.0, -2.0, -3.0]], [[-6.0, 0.0, 0.0], [5.0, -5.0, 0.0]], [[-6.0, 7.0, 1.0], [-2.0, -4.0, 2.0]], [[3.0, 4.0, 6.0], [-7.0, 7.0, -5.0]]]])
28739          s1=numarray.array([[3.0, 6.0, -3.0], [-6.0, 3.0, 4.0]])
28740          sub=res.substitute({arg0:s0,arg1:s1})
28741          ref=numarray.array([[-58.0, 4.0, -61.0, 22.0, 33.0], [55.0, -24.0, 4.0, 14.0, 53.0], [96.0, 11.0, -20.0, -73.0, -53.0], [-15.0, -15.0, -63.0, 29.0, 58.0]])
28742          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28743          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28744          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28745       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28746       def test_tensor_mult_Symbol_rank4_Symbol_rank3(self):
28747          arg0=Symbol(shape=(4, 5, 2, 3))
28748          arg1=Symbol(shape=(2, 3, 2))
28749          res=tensor_mult(arg0,arg1)
28750          s0=numarray.array([[[[2.0, -6.0, 3.0], [0.0, 0.0, -6.0]], [[6.0, -2.0, -4.0], [4.0, 2.0, 2.0]], [[-4.0, 0.0, -3.0], [3.0, 6.0, 2.0]], [[3.0, -2.0, 1.0], [6.0, -2.0, 1.0]], [[3.0, -5.0, -2.0], [3.0, -5.0, 5.0]]], [[[3.0, -2.0, 7.0], [0.0, -7.0, 6.0]], [[0.0, -6.0, -6.0], [7.0, -7.0, 5.0]], [[-6.0, -1.0, 2.0], [-3.0, 2.0, 6.0]], [[-6.0, 7.0, 1.0], [-1.0, -5.0, 5.0]], [[2.0, 0.0, -7.0], [-4.0, -1.0, 6.0]]], [[[-2.0, 0.0, -3.0], [-5.0, 0.0, -6.0]], [[1.0, 1.0, -3.0], [0.0, -6.0, 6.0]], [[-6.0, -6.0, 6.0], [1.0, 0.0, -3.0]], [[-5.0, -1.0, 0.0], [7.0, 4.0, 1.0]], [[2.0, 4.0, 0.0], [-1.0, -4.0, 6.0]]], [[[-2.0, 0.0, -3.0], [1.0, 6.0, 5.0]], [[-5.0, -7.0, 5.0], [-4.0, 0.0, -1.0]], [[-7.0, 4.0, 0.0], [0.0, 7.0, -1.0]], [[4.0, -6.0, -6.0], [4.0, 0.0, -2.0]], [[-5.0, -5.0, 0.0], [-7.0, -5.0, -3.0]]]])
28751          s1=numarray.array([[[7.0, -3.0], [2.0, -6.0], [2.0, 3.0]], [[2.0, -4.0], [7.0, -1.0], [-7.0, -1.0]]])
28752          sub=res.substitute({arg0:s0,arg1:s1})
28753          ref=numarray.array([[[50.0, 45.0], [38.0, -38.0], [0.0, -17.0], [10.0, -17.0], [-57.0, 3.0]], [[-60.0, 25.0], [-94.0, -8.0], [-74.0, 34.0], [-98.0, -17.0], [-57.0, -16.0]], [[12.0, 23.0], [-81.0, -18.0], [-19.0, 71.0], [-2.0, -12.0], [-50.0, -28.0]], [[-11.0, -18.0], [-40.0, 89.0], [15.0, -9.0], [26.0, -8.0], [-73.0, 81.0]]])
28754          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28755          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28756          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28757       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28758       def test_tensor_mult_Symbol_rank4_Symbol_rank4(self):
28759          arg0=Symbol(shape=(4, 5, 2, 3))
28760          arg1=Symbol(shape=(2, 3, 4, 5))
28761          res=tensor_mult(arg0,arg1)
28762          s0=numarray.array([[[[-5.0, -4.0, 3.0], [7.0, -3.0, 2.0]], [[-6.0, -1.0, -6.0], [7.0, -4.0, 0.0]], [[4.0, 1.0, 4.0], [1.0, -2.0, 0.0]], [[-2.0, 6.0, 3.0], [-2.0, -7.0, -7.0]], [[3.0, 1.0, 6.0], [2.0, 1.0, -2.0]]], [[[0.0, -4.0, -1.0], [6.0, -5.0, -5.0]], [[5.0, 1.0, -2.0], [0.0, -4.0, -7.0]], [[-1.0, 1.0, 0.0], [0.0, 0.0, 6.0]], [[-6.0, -7.0, -5.0], [-1.0, -4.0, 2.0]], [[1.0, -2.0, 0.0], [4.0, 3.0, -4.0]]], [[[0.0, -2.0, 4.0], [1.0, 5.0, -1.0]], [[6.0, 0.0, 7.0], [7.0, -1.0, 3.0]], [[-6.0, 6.0, 2.0], [1.0, 1.0, -2.0]], [[-6.0, 1.0, 5.0], [0.0, -1.0, -4.0]], [[-3.0, 6.0, 6.0], [0.0, 3.0, -1.0]]], [[[-3.0, -5.0, 6.0], [3.0, 0.0, -7.0]], [[6.0, -4.0, 3.0], [0.0, 3.0, 6.0]], [[2.0, -3.0, 3.0], [-2.0, 0.0, -4.0]], [[0.0, -7.0, 0.0], [2.0, 5.0, 3.0]], [[-3.0, 0.0, -3.0], [-5.0, 1.0, 7.0]]]])
28763          s1=numarray.array([[[[0.0, 5.0, -5.0, -1.0, -2.0], [0.0, -3.0, 7.0, 4.0, -2.0], [3.0, 2.0, -2.0, -2.0, -6.0], [0.0, -2.0, -2.0, 7.0, -6.0]], [[5.0, 0.0, 4.0, -5.0, 0.0], [-4.0, -1.0, 6.0, 0.0, 4.0], [-3.0, 2.0, 0.0, -2.0, -3.0], [3.0, -4.0, -1.0, -7.0, 4.0]], [[6.0, -4.0, 7.0, -4.0, -4.0], [-7.0, 6.0, 7.0, 0.0, 7.0], [1.0, -5.0, 0.0, 6.0, 3.0], [1.0, 3.0, 1.0, 6.0, 1.0]]], [[[5.0, 2.0, -6.0, 5.0, -2.0], [-7.0, 3.0, 6.0, -7.0, -4.0], [5.0, 4.0, -1.0, -1.0, 7.0], [6.0, -7.0, 0.0, -7.0, 1.0]], [[1.0, 1.0, -7.0, -2.0, -7.0], [-5.0, 4.0, 0.0, 7.0, -4.0], [0.0, 3.0, 4.0, -6.0, -3.0], [5.0, 6.0, 7.0, 7.0, 0.0]], [[6.0, 1.0, 1.0, -1.0, 5.0], [-3.0, -7.0, 5.0, 0.0, 1.0], [2.0, -6.0, 0.0, 7.0, -2.0], [-3.0, 7.0, -5.0, 1.0, 3.0]]]])
28764          sub=res.substitute({arg0:s0,arg1:s1})
28765          ref=numarray.array([[[[42.0, -24.0, 11.0, 52.0, 15.0], [-45.0, 32.0, 14.0, -90.0, 1.0], [39.0, -26.0, -9.0, 61.0, 105.0], [12.0, -18.0, -14.0, -57.0, 30.0]], [[-10.0, 4.0, -30.0, 78.0, 50.0], [17.0, -12.0, -48.0, -101.0, -46.0], [14.0, 32.0, -11.0, -5.0, 82.0], [13.0, -75.0, -21.0, -148.0, 33.0]], [[32.0, 4.0, 20.0, -16.0, -12.0], [-29.0, 6.0, 68.0, -5.0, 28.0], [18.0, -12.0, -17.0, 25.0, -2.0], [3.0, -19.0, -19.0, 24.0, -15.0]], [[-11.0, -40.0, 109.0, -29.0, 10.0], [25.0, 33.0, -4.0, -43.0, 78.0], [-45.0, 6.0, -22.0, 5.0, 24.0], [-5.0, -88.0, -13.0, -80.0, 16.0]], [[40.0, -6.0, 10.0, -22.0, -51.0], [-59.0, 50.0, 71.0, 5.0, 26.0], [18.0, 1.0, -4.0, 6.0, 12.0], [32.0, -14.0, 16.0, 41.0, -12.0]]], [[[-31.0, 6.0, -29.0, 69.0, 2.0], [21.0, 31.0, -20.0, -77.0, -32.0], [31.0, 36.0, -26.0, -9.0, 76.0], [13.0, -94.0, -7.0, -60.0, -26.0]], [[-53.0, 22.0, -14.0, 13.0, -9.0], [51.0, 5.0, -8.0, -8.0, -11.0], [-4.0, 52.0, -26.0, -49.0, -13.0], [2.0, -93.0, -6.0, -19.0, -49.0]], [[41.0, 1.0, 15.0, -10.0, 32.0], [-22.0, -40.0, 29.0, -4.0, 12.0], [6.0, -36.0, 2.0, 42.0, -9.0], [-15.0, 40.0, -29.0, -8.0, 28.0]], [[-62.0, -14.0, 3.0, 62.0, 72.0], [84.0, -38.0, -115.0, -45.0, -29.0], [-3.0, -29.0, -3.0, 35.0, 43.0], [-58.0, 22.0, -24.0, -42.0, 8.0]], [[-11.0, 12.0, -62.0, 27.0, -51.0], [-23.0, 51.0, -1.0, -3.0, -42.0], [21.0, 47.0, 6.0, -48.0, 27.0], [45.0, -32.0, 41.0, 10.0, -22.0]]], [[[18.0, -10.0, -22.0, -10.0, -58.0], [-49.0, 56.0, 17.0, 28.0, -5.0], [13.0, 1.0, 19.0, -10.0, 12.0], [32.0, 36.0, 46.0, 65.0, -6.0]], [[94.0, 18.0, -13.0, 0.0, -32.0], [-102.0, 20.0, 148.0, -32.0, 16.0], [66.0, -16.0, -23.0, 50.0, 31.0], [35.0, -25.0, -27.0, 31.0, -13.0]], [[36.0, -37.0, 53.0, -27.0, -15.0], [-44.0, 45.0, 4.0, -24.0, 40.0], [-33.0, 9.0, 15.0, -9.0, 32.0], [37.0, -21.0, 25.0, -74.0, 57.0]], [[10.0, -55.0, 72.0, -13.0, -21.0], [-22.0, 71.0, -21.0, -31.0, 51.0], [-24.0, -14.0, 8.0, 18.0, 59.0], [15.0, -11.0, 29.0, -30.0, 33.0]], [[63.0, -37.0, 59.0, -56.0, -44.0], [-78.0, 58.0, 52.0, 9.0, 59.0], [-23.0, -9.0, 18.0, 5.0, 11.0], [42.0, 11.0, 32.0, -7.0, 45.0]]], [[[-16.0, -40.0, 12.0, 26.0, -59.0], [-22.0, 108.0, -26.0, -33.0, 9.0], [13.0, 8.0, 3.0, 0.0, 86.0], [30.0, -26.0, 52.0, 22.0, -14.0]], [[37.0, 27.0, -40.0, -10.0, -15.0], [-38.0, -26.0, 69.0, 45.0, -13.0], [45.0, -38.0, 0.0, 38.0, -36.0], [-12.0, 73.0, -14.0, 115.0, -31.0]], [[-31.0, -10.0, 7.0, -5.0, -32.0], [17.0, 37.0, -15.0, 22.0, 9.0], [0.0, -1.0, -2.0, -6.0, 0.0], [-6.0, 3.0, 22.0, 63.0, -35.0]], [[-2.0, 12.0, -72.0, 32.0, -24.0], [-20.0, 12.0, -15.0, 21.0, -53.0], [37.0, -9.0, 18.0, 3.0, 14.0], [7.0, 65.0, 27.0, 73.0, -17.0]], [[0.0, -5.0, 24.0, -19.0, 56.0], [30.0, -69.0, -37.0, 30.0, 8.0], [-23.0, -50.0, 15.0, 36.0, -43.0], [-49.0, 87.0, -25.0, 10.0, 31.0]]]])
28766          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28767          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28768          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28769       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28770       def test_tensor_mult_Symbol_rank4_constData_rank2(self):
28771          arg0=Symbol(shape=(4, 5, 2, 3))
28772          arg1=Data(numarray.array([[-2.0, 0.0, 5.0], [-5.0, -5.0, 3.0]]),self.functionspace)
28773          res=tensor_mult(arg0,arg1)
28774          s0=numarray.array([[[[6.0, -4.0, -3.0], [-3.0, -4.0, 0.0]], [[-6.0, 1.0, -6.0], [6.0, 7.0, 5.0]], [[2.0, -4.0, -4.0], [0.0, 3.0, -7.0]], [[3.0, 5.0, 4.0], [-5.0, 0.0, -5.0]], [[2.0, -4.0, -4.0], [1.0, -7.0, 3.0]]], [[[-4.0, -3.0, 2.0], [-2.0, 0.0, 4.0]], [[-1.0, -4.0, -6.0], [7.0, -5.0, -4.0]], [[7.0, -1.0, 0.0], [6.0, -3.0, 3.0]], [[-1.0, -3.0, 0.0], [2.0, 3.0, -4.0]], [[-6.0, 2.0, 7.0], [7.0, 4.0, -6.0]]], [[[4.0, -5.0, 5.0], [-6.0, -7.0, -6.0]], [[2.0, 5.0, -5.0], [-6.0, -1.0, -1.0]], [[2.0, 2.0, 4.0], [1.0, -3.0, 6.0]], [[6.0, 2.0, 1.0], [7.0, 7.0, -4.0]], [[-3.0, 0.0, 2.0], [-5.0, 2.0, 4.0]]], [[[-5.0, 0.0, -3.0], [-3.0, 1.0, -3.0]], [[2.0, -6.0, 0.0], [1.0, 5.0, 5.0]], [[0.0, -3.0, 4.0], [-7.0, 6.0, 2.0]], [[-6.0, -1.0, 7.0], [4.0, -4.0, 6.0]], [[-4.0, -2.0, -7.0], [7.0, 0.0, 2.0]]]])
28775          sub=res.substitute({arg0:s0})
28776          ref=Data(numarray.array([[8.0, -68.0, -60.0, 24.0, 15.0], [40.0, -50.0, -20.0, -35.0, -26.0], [64.0, 3.0, 44.0, -89.0, 43.0], [-4.0, -19.0, 31.0, 65.0, -56.0]]),self.functionspace)
28777          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28778          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28779          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28780       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28781       def test_tensor_mult_Symbol_rank4_constData_rank3(self):
28782          arg0=Symbol(shape=(4, 5, 2, 3))
28783          arg1=Data(numarray.array([[[-5.0, -3.0], [-1.0, -1.0], [6.0, 4.0]], [[5.0, -5.0], [0.0, -2.0], [-3.0, 1.0]]]),self.functionspace)
28784          res=tensor_mult(arg0,arg1)
28785          s0=numarray.array([[[[-3.0, -2.0, 1.0], [6.0, -6.0, 5.0]], [[0.0, -1.0, -3.0], [2.0, -2.0, 4.0]], [[-1.0, 0.0, -1.0], [-3.0, 4.0, -4.0]], [[2.0, 5.0, 2.0], [1.0, 6.0, -1.0]], [[6.0, 2.0, -6.0], [6.0, 0.0, 2.0]]], [[[5.0, 6.0, -6.0], [2.0, 2.0, 2.0]], [[0.0, -1.0, -1.0], [5.0, 2.0, 7.0]], [[-2.0, 4.0, -4.0], [1.0, -7.0, 3.0]], [[-4.0, 2.0, 6.0], [5.0, -7.0, 6.0]], [[-5.0, 0.0, 0.0], [-5.0, 1.0, -2.0]]], [[[-5.0, -4.0, 6.0], [7.0, 7.0, 0.0]], [[5.0, 4.0, 2.0], [-5.0, -2.0, -4.0]], [[-2.0, 4.0, 1.0], [-6.0, -7.0, 7.0]], [[-5.0, 6.0, 1.0], [-6.0, -1.0, 4.0]], [[4.0, -7.0, -7.0], [5.0, -7.0, 5.0]]], [[[0.0, -4.0, 4.0], [6.0, 0.0, 7.0]], [[-6.0, -1.0, 7.0], [6.0, 4.0, 3.0]], [[4.0, 0.0, 3.0], [6.0, 5.0, 5.0]], [[0.0, -2.0, 0.0], [-2.0, 1.0, 7.0]], [[6.0, 0.0, 4.0], [4.0, -6.0, -2.0]]]])
28786          sub=res.substitute({arg0:s0})
28787          ref=Data(numarray.array([[[38.0, 2.0], [-19.0, -13.0], [-4.0, 2.0], [5.0, -21.0], [-44.0, -72.0]], [[-63.0, -57.0], [-1.0, -25.0], [-22.0, -2.0], [61.0, 29.0], [6.0, 36.0]], [[100.0, -6.0], [-30.0, 14.0], [-39.0, 57.0], [-17.0, 49.0], [-45.0, -39.0]], [[37.0, -3.0], [94.0, 12.0], [13.0, -35.0], [-29.0, 17.0], [20.0, -12.0]]]),self.functionspace)
28788          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28789          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28790          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28791       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28792       def test_tensor_mult_Symbol_rank4_constData_rank4(self):
28793          arg0=Symbol(shape=(4, 5, 2, 3))
28794          arg1=Data(numarray.array([[[[6.0, -5.0, -7.0, 1.0, 1.0], [5.0, -3.0, 4.0, -5.0, -1.0], [0.0, 2.0, 0.0, 5.0, 4.0], [-5.0, 0.0, 6.0, -2.0, -7.0]], [[4.0, 1.0, 3.0, -7.0, 0.0], [4.0, -5.0, 1.0, -5.0, -1.0], [3.0, -4.0, 0.0, -4.0, 7.0], [4.0, 3.0, 6.0, -1.0, -3.0]], [[0.0, -2.0, 4.0, 3.0, 7.0], [2.0, -2.0, 3.0, -7.0, -4.0], [0.0, -5.0, -1.0, -5.0, -7.0], [0.0, -7.0, -7.0, 4.0, 0.0]]], [[[-1.0, -6.0, 0.0, -5.0, -4.0], [-2.0, 0.0, -1.0, -5.0, 4.0], [-1.0, 2.0, -6.0, 0.0, -2.0], [-6.0, 5.0, -3.0, 3.0, 0.0]], [[6.0, 5.0, 7.0, 5.0, -3.0], [-2.0, 6.0, 0.0, 2.0, 0.0], [-2.0, 6.0, -3.0, 0.0, 0.0], [4.0, -6.0, 6.0, -1.0, 7.0]], [[-1.0, 6.0, 2.0, 1.0, 1.0], [-5.0, -3.0, 6.0, 0.0, -5.0], [-6.0, 3.0, -5.0, 7.0, -5.0], [7.0, 7.0, -2.0, -3.0, -7.0]]]]),self.functionspace)
28795          res=tensor_mult(arg0,arg1)
28796          s0=numarray.array([[[[-7.0, 0.0, 7.0], [2.0, -7.0, 1.0]], [[1.0, -2.0, -5.0], [-6.0, -3.0, 3.0]], [[-3.0, 1.0, -7.0], [7.0, -4.0, 5.0]], [[-1.0, -7.0, 6.0], [-3.0, -5.0, 5.0]], [[2.0, 4.0, 6.0], [-4.0, 7.0, -7.0]]], [[[-2.0, -2.0, 7.0], [0.0, 1.0, -7.0]], [[-4.0, -4.0, 5.0], [-3.0, -2.0, 4.0]], [[-5.0, 2.0, -5.0], [-3.0, 5.0, -5.0]], [[4.0, 0.0, -7.0], [0.0, 4.0, 2.0]], [[-3.0, -5.0, 0.0], [2.0, -2.0, 6.0]]], [[[-2.0, 7.0, 5.0], [0.0, 4.0, 3.0]], [[7.0, -7.0, 5.0], [5.0, 3.0, 1.0]], [[6.0, 6.0, -6.0], [-2.0, 4.0, 4.0]], [[-2.0, 2.0, 7.0], [5.0, 4.0, 5.0]], [[-5.0, 1.0, -5.0], [-1.0, 4.0, 3.0]]], [[[5.0, 6.0, -5.0], [6.0, 5.0, 2.0]], [[3.0, -2.0, -3.0], [-7.0, -5.0, 3.0]], [[1.0, 2.0, 1.0], [-2.0, -3.0, -5.0]], [[5.0, -1.0, 3.0], [-2.0, 2.0, -7.0]], [[7.0, 2.0, -7.0], [-5.0, 3.0, 5.0]]]])
28797          sub=res.substitute({arg0:s0})
28798          ref=Data(numarray.array([[[[-87.0, -20.0, 30.0, -30.0, 56.0], [-16.0, -38.0, -3.0, -38.0, -18.0], [6.0, -84.0, -3.0, -63.0, -86.0], [2.0, 10.0, -141.0, 52.0, -7.0]], [[-17.0, 42.0, -48.0, 18.0, 2.0], [-10.0, -10.0, 11.0, 64.0, -18.0], [-12.0, 14.0, 35.0, 59.0, 22.0], [32.0, 38.0, 23.0, -44.0, -43.0]], [[-50.0, -2.0, -22.0, -81.0, -63.0], [-56.0, -21.0, -9.0, 16.0, 33.0], [-26.0, 30.0, -48.0, 51.0, 5.0], [-4.0, 146.0, -18.0, -13.0, -45.0]], [[-66.0, 9.0, -15.0, 61.0, 73.0], [-30.0, -19.0, 40.0, 3.0, -53.0], [-38.0, -25.0, 2.0, 28.0, -114.0], [10.0, -13.0, -121.0, 14.0, -42.0]], [[81.0, -1.0, 57.0, 40.0, 32.0], [67.0, 25.0, -8.0, -38.0, -11.0], [44.0, -29.0, 32.0, -85.0, 37.0], [9.0, -141.0, 62.0, 18.0, 72.0]]], [[[-7.0, -43.0, 29.0, 31.0, 37.0], [29.0, 29.0, -31.0, -27.0, 11.0], [34.0, -46.0, 25.0, -86.0, -36.0], [-43.0, -110.0, -53.0, 54.0, 76.0]], [[-53.0, 38.0, 30.0, 48.0, 53.0], [-36.0, -2.0, 22.0, 16.0, -44.0], [-29.0, -23.0, -1.0, -1.0, -93.0], [42.0, -22.0, -94.0, 13.0, -2.0]], [[16.0, 50.0, 46.0, 1.0, -48.0], [-6.0, 60.0, -60.0, 75.0, 36.0], [29.0, 16.0, 33.0, -43.0, 60.0], [36.0, -39.0, 66.0, -11.0, 99.0]], [[46.0, 26.0, -24.0, 5.0, -55.0], [-12.0, 20.0, 7.0, 37.0, 14.0], [-20.0, 73.0, -15.0, 69.0, 55.0], [10.0, 39.0, 93.0, -46.0, -14.0]], [[-58.0, 24.0, 4.0, 18.0, 1.0], [-65.0, 4.0, 17.0, 26.0, -14.0], [-49.0, 24.0, -36.0, 47.0, -81.0], [17.0, 49.0, -78.0, 1.0, -20.0]]], [[[37.0, 45.0, 89.0, -13.0, 24.0], [5.0, -24.0, 32.0, -52.0, -40.0], [-5.0, -24.0, -32.0, -42.0, -9.0], [75.0, -17.0, 13.0, 4.0, 0.0]], [[26.0, -61.0, -27.0, 62.0, 14.0], [-4.0, 19.0, 37.0, -54.0, -5.0], [-38.0, 48.0, -49.0, 45.0, -71.0], [-74.0, -42.0, -34.0, 22.0, -14.0]], [[82.0, 44.0, -12.0, -20.0, -36.0], [18.0, -24.0, 38.0, 0.0, -16.0], [-12.0, 50.0, -14.0, 64.0, 92.0], [50.0, 54.0, 136.0, -64.0, -60.0]], [[10.0, 18.0, 86.0, 5.0, 20.0], [-31.0, -9.0, 40.0, -66.0, -33.0], [-37.0, 2.0, -74.0, -18.0, -78.0], [39.0, -7.0, -50.0, 26.0, 1.0]], [[-4.0, 80.0, 52.0, 1.0, -45.0], [-52.0, 35.0, -15.0, 68.0, 5.0], [-22.0, 42.0, -16.0, 17.0, 9.0], [72.0, 30.0, 32.0, -27.0, 39.0]]], [[[76.0, -8.0, 2.0, -55.0, -67.0], [7.0, -11.0, 17.0, -40.0, 23.0], [-10.0, 59.0, -56.0, 40.0, 75.0], [-3.0, 67.0, 109.0, -29.0, -32.0]], [[-16.0, 24.0, -68.0, 21.0, 28.0], [10.0, -32.0, 26.0, 41.0, -32.0], [-7.0, -6.0, 45.0, 59.0, 18.0], [20.0, 31.0, 12.0, -41.0, -71.0]], [[3.0, -38.0, -28.0, -20.0, 20.0], [50.0, -18.0, -19.0, -18.0, 10.0], [44.0, -48.0, 45.0, -43.0, 40.0], [-32.0, -28.0, 9.0, 12.0, 1.0]], [[47.0, -52.0, -26.0, 34.0, 21.0], [62.0, 17.0, -12.0, -27.0, 11.0], [37.0, -14.0, 38.0, -35.0, 31.0], [-58.0, -95.0, 35.0, 16.0, 31.0]], [[68.0, 56.0, -40.0, 17.0, -26.0], [8.0, -14.0, 44.0, 35.0, -26.0], [-25.0, 64.0, 3.0, 97.0, 76.0], [50.0, 47.0, 126.0, -77.0, -69.0]]]]),self.functionspace)
28799          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28800          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28801          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28802       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28803       def test_tensor_mult_Symbol_rank4_expandedData_rank2(self):
28804          arg0=Symbol(shape=(4, 5, 2, 3))
28805          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28806          arg1=msk_arg1*numarray.array([[0.0, -6.0, -7.0], [0.0, 1.0, 5.0]])+(1.-msk_arg1)*numarray.array([[2.0, -5.0, 4.0], [0.0, -6.0, 1.0]])
28807          res=tensor_mult(arg0,arg1)
28808          s0=numarray.array([[[[-7.0, 6.0, 5.0], [-7.0, 6.0, 0.0]], [[3.0, 0.0, -2.0], [-7.0, 7.0, 1.0]], [[0.0, -5.0, 2.0], [3.0, -2.0, 4.0]], [[6.0, -1.0, -3.0], [-4.0, -3.0, -1.0]], [[0.0, -5.0, 2.0], [1.0, 3.0, -6.0]]], [[[-5.0, 7.0, -4.0], [6.0, -7.0, 7.0]], [[-6.0, 4.0, 4.0], [0.0, -1.0, -4.0]], [[-1.0, -5.0, 0.0], [-1.0, 3.0, 6.0]], [[-5.0, 2.0, 6.0], [5.0, -1.0, -7.0]], [[6.0, 5.0, 5.0], [-1.0, -4.0, -5.0]]], [[[3.0, 5.0, -1.0], [5.0, -6.0, -4.0]], [[7.0, -5.0, -3.0], [0.0, 0.0, -1.0]], [[6.0, 4.0, 6.0], [0.0, -6.0, -2.0]], [[5.0, 2.0, 3.0], [-4.0, 7.0, 5.0]], [[2.0, 3.0, 4.0], [-4.0, 0.0, 3.0]]], [[[-7.0, 5.0, -2.0], [-5.0, -3.0, 4.0]], [[2.0, -1.0, 0.0], [5.0, 0.0, -5.0]], [[6.0, 0.0, 0.0], [6.0, -4.0, -6.0]], [[-1.0, -4.0, 7.0], [5.0, 0.0, 1.0]], [[2.0, 0.0, 3.0], [-1.0, 0.0, 6.0]]]])
28809          sub=res.substitute({arg0:s0})
28810          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28811          ref=msk_ref*numarray.array([[-65.0, 26.0, 34.0, 19.0, -11.0], [14.0, -73.0, 63.0, -90.0, -94.0], [-49.0, 46.0, -82.0, -1.0, -31.0], [1.0, -19.0, -34.0, -20.0, 9.0]])+(1.-msk_ref)*numarray.array([[-60.0, -43.0, 49.0, 22.0, 9.0], [-12.0, -14.0, 11.0, 3.0, 26.0], [9.0, 26.0, 50.0, -25.0, 8.0], [-25.0, 4.0, 30.0, 47.0, 22.0]])
28812          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28813          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28814          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28815       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28816       def test_tensor_mult_Symbol_rank4_expandedData_rank3(self):
28817          arg0=Symbol(shape=(4, 5, 2, 3))
28818          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28819          arg1=msk_arg1*numarray.array([[[6.0, 0.0], [-7.0, -7.0], [7.0, 0.0]], [[-1.0, 6.0], [-2.0, 6.0], [-3.0, 4.0]]])+(1.-msk_arg1)*numarray.array([[[2.0, -3.0], [-7.0, 6.0], [5.0, -4.0]], [[0.0, 7.0], [3.0, 7.0], [-1.0, 4.0]]])
28820          res=tensor_mult(arg0,arg1)
28821          s0=numarray.array([[[[-3.0, 5.0, 6.0], [-1.0, 4.0, -1.0]], [[-7.0, 4.0, -6.0], [-7.0, -3.0, 6.0]], [[3.0, 4.0, 0.0], [-7.0, -2.0, 0.0]], [[-2.0, 5.0, -4.0], [-4.0, 2.0, 3.0]], [[0.0, 3.0, 2.0], [1.0, 1.0, 3.0]]], [[[5.0, 2.0, -4.0], [-5.0, 1.0, 4.0]], [[0.0, 6.0, -3.0], [-5.0, 2.0, -4.0]], [[0.0, 6.0, -3.0], [7.0, 7.0, 1.0]], [[-6.0, -3.0, 0.0], [7.0, 6.0, -4.0]], [[-6.0, 5.0, 0.0], [6.0, -4.0, 1.0]]], [[[-2.0, 2.0, -6.0], [0.0, -7.0, -1.0]], [[7.0, 0.0, -7.0], [-3.0, -4.0, 2.0]], [[-6.0, 0.0, 7.0], [2.0, -4.0, -1.0]], [[3.0, 0.0, 4.0], [-4.0, 1.0, 4.0]], [[-2.0, -7.0, -7.0], [-6.0, -5.0, -6.0]]], [[[7.0, 4.0, -4.0], [1.0, 3.0, 1.0]], [[7.0, -3.0, -4.0], [-7.0, -2.0, -2.0]], [[2.0, 5.0, 4.0], [-7.0, 6.0, -5.0]], [[-4.0, 6.0, 0.0], [4.0, -6.0, 1.0]], [[6.0, 7.0, -4.0], [-6.0, -2.0, 6.0]]]])
28822          sub=res.substitute({arg0:s0})
28823          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28824          ref=msk_ref*numarray.array([[[-15.0, -21.0], [-117.0, -64.0], [1.0, -82.0], [-84.0, -35.0], [-19.0, 3.0]], [[-21.0, -22.0], [-50.0, -76.0], [-87.0, 46.0], [-22.0, 83.0], [-72.0, -19.0]], [[-51.0, -60.0], [-2.0, -34.0], [22.0, -16.0], [36.0, -2.0], [22.0, -41.0]], [[-24.0, 0.0], [52.0, -41.0], [15.0, -61.0], [-61.0, -50.0], [-49.0, -73.0]]])+(1.-msk_ref)*numarray.array([[[2.0, 32.0], [-87.0, 23.0], [-28.0, -48.0], [-56.0, 50.0], [-11.0, 36.0]], [[-25.0, 1.0], [-47.0, 11.0], [-37.0, 150.0], [31.0, 75.0], [-60.0, 66.0]], [[-68.0, -11.0], [-35.0, -34.0], [12.0, -28.0], [25.0, -30.0], [1.0, -109.0]], [[-26.0, 51.0], [11.0, -94.0], [12.0, -19.0], [-69.0, 38.0], [-69.0, 8.0]]])
28825          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28826          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28827          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28828       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28829       def test_tensor_mult_Symbol_rank4_expandedData_rank4(self):
28830          arg0=Symbol(shape=(4, 5, 2, 3))
28831          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28832          arg1=msk_arg1*numarray.array([[[[-3.0, -3.0, 5.0, 1.0, 3.0], [-2.0, -3.0, 7.0, -2.0, -6.0], [0.0, 3.0, 0.0, -5.0, 4.0], [0.0, -5.0, -4.0, -6.0, 2.0]], [[3.0, -1.0, -7.0, -3.0, -3.0], [0.0, -4.0, 2.0, -2.0, -6.0], [0.0, -1.0, 6.0, 7.0, -3.0], [2.0, 7.0, -5.0, 6.0, 0.0]], [[4.0, 5.0, 0.0, 7.0, 1.0], [7.0, 0.0, 1.0, 6.0, -1.0], [-3.0, -5.0, 1.0, -1.0, 6.0], [0.0, -4.0, 2.0, 5.0, -7.0]]], [[[0.0, 0.0, 4.0, 2.0, -6.0], [-3.0, 0.0, 3.0, -3.0, 0.0], [-1.0, -6.0, -1.0, -5.0, 7.0], [0.0, 0.0, 4.0, -4.0, -3.0]], [[7.0, 3.0, -6.0, -5.0, 4.0], [6.0, -1.0, 7.0, 6.0, -6.0], [-6.0, 0.0, 5.0, -7.0, 3.0], [-3.0, -5.0, 3.0, 7.0, -5.0]], [[-5.0, -1.0, 4.0, -1.0, 2.0], [-1.0, 7.0, -5.0, -4.0, 0.0], [0.0, 5.0, -3.0, -6.0, -5.0], [0.0, -5.0, 5.0, 1.0, 2.0]]]])+(1.-msk_arg1)*numarray.array([[[[5.0, -4.0, -5.0, 7.0, 0.0], [-4.0, -7.0, -6.0, 6.0, 7.0], [6.0, 1.0, 1.0, 4.0, 1.0], [-7.0, 0.0, 1.0, 0.0, 6.0]], [[0.0, -1.0, 7.0, 4.0, -1.0], [2.0, 5.0, -7.0, -6.0, 1.0], [-2.0, 7.0, 2.0, -4.0, -5.0], [1.0, 7.0, 3.0, 6.0, -2.0]], [[-4.0, -6.0, -1.0, 0.0, 7.0], [3.0, 4.0, 4.0, -3.0, -4.0], [-5.0, -4.0, 3.0, 0.0, 1.0], [-3.0, -3.0, -2.0, 2.0, -1.0]]], [[[-6.0, -3.0, 3.0, -6.0, 2.0], [5.0, 0.0, -5.0, 4.0, -7.0], [-4.0, 6.0, 0.0, 2.0, 3.0], [0.0, 6.0, -3.0, -2.0, 7.0]], [[-5.0, 0.0, 1.0, 0.0, 1.0], [-4.0, -3.0, 2.0, 0.0, 2.0], [1.0, 0.0, 7.0, -4.0, -2.0], [-7.0, 7.0, -5.0, 3.0, 3.0]], [[7.0, -3.0, 4.0, 4.0, 0.0], [-4.0, -2.0, -3.0, -5.0, -5.0], [3.0, 5.0, 5.0, -7.0, -6.0], [-7.0, -6.0, 4.0, 2.0, -5.0]]]])
28833          res=tensor_mult(arg0,arg1)
28834          s0=numarray.array([[[[-3.0, -6.0, 6.0], [-3.0, -6.0, 1.0]], [[-7.0, -5.0, -4.0], [-1.0, 4.0, 3.0]], [[-5.0, 6.0, 5.0], [-7.0, 4.0, 2.0]], [[-7.0, 0.0, 0.0], [-2.0, 6.0, -1.0]], [[5.0, 0.0, -2.0], [1.0, 4.0, 5.0]]], [[[-5.0, 4.0, -4.0], [6.0, 0.0, 3.0]], [[-2.0, -3.0, 5.0], [-7.0, 1.0, -2.0]], [[-2.0, -2.0, 5.0], [-7.0, 3.0, -3.0]], [[-4.0, 7.0, 5.0], [0.0, -1.0, -6.0]], [[6.0, -5.0, -4.0], [3.0, 0.0, 0.0]]], [[[5.0, 7.0, -6.0], [-1.0, -3.0, -5.0]], [[1.0, -2.0, 3.0], [-5.0, 3.0, 6.0]], [[4.0, 0.0, -7.0], [6.0, -1.0, 7.0]], [[-4.0, 0.0, -1.0], [-6.0, -5.0, 4.0]], [[7.0, 6.0, 2.0], [1.0, -6.0, 0.0]]], [[[-3.0, 1.0, 0.0], [6.0, -2.0, 0.0]], [[0.0, -5.0, 1.0], [0.0, -7.0, -4.0]], [[7.0, -2.0, -1.0], [7.0, -5.0, -6.0]], [[7.0, 4.0, -6.0], [3.0, 3.0, 6.0]], [[-1.0, 0.0, -7.0], [-7.0, 5.0, -3.0]]]])
28835          sub=res.substitute({arg0:s0})
28836          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28837          ref=msk_ref*numarray.array([[[[-32.0, 26.0, 55.0, 80.0, 11.0], [20.0, 46.0, -83.0, 23.0, 84.0], [21.0, -10.0, -60.0, 18.0, -2.0], [6.0, -26.0, 29.0, -17.0, -7.0]], [[3.0, 15.0, -16.0, -45.0, 18.0], [10.0, 58.0, -53.0, 15.0, 52.0], [-11.0, 25.0, -22.0, -37.0, -47.0], [-22.0, -19.0, 68.0, 27.0, 3.0]], [[71.0, 44.0, -111.0, -24.0, 34.0], [88.0, 1.0, -21.0, 65.0, -35.0], [-32.0, 6.0, 62.0, 57.0, -55.0], [0.0, 17.0, -6.0, 149.0, -40.0]], [[68.0, 40.0, -83.0, -40.0, 13.0], [57.0, 8.0, -8.0, 60.0, 6.0], [-34.0, -14.0, 35.0, 9.0, -19.0], [-18.0, 10.0, 33.0, 91.0, -40.0]], [[-20.0, -18.0, 25.0, -32.0, 33.0], [-8.0, 16.0, 39.0, -21.0, -52.0], [-19.0, 44.0, 2.0, -86.0, 2.0], [-12.0, -62.0, 17.0, -11.0, 11.0]]], [[[-4.0, -12.0, -17.0, -36.0, -61.0], [-39.0, 20.0, -28.0, -52.0, 10.0], [6.0, -20.0, 5.0, 9.0, -29.0], [8.0, 54.0, 31.0, 13.0, 6.0]], [[34.0, 39.0, -31.0, 25.0, 50.0], [68.0, 3.0, -19.0, 75.0, 19.0], [-14.0, 4.0, 5.0, 24.0, -5.0], [-9.0, -26.0, -2.0, 52.0, -27.0]], [[56.0, 45.0, -54.0, 13.0, 53.0], [81.0, -10.0, 2.0, 89.0, 1.0], [-26.0, -2.0, 24.0, 23.0, 3.0], [-13.0, -24.0, -6.0, 71.0, -39.0]], [[76.0, 33.0, -87.0, 21.0, -44.0], [43.0, -57.0, 14.0, 42.0, -17.0], [-9.0, -74.0, 60.0, 107.0, 20.0], [17.0, 84.0, -42.0, 78.0, -50.0]], [[-49.0, -33.0, 77.0, -1.0, 11.0], [-49.0, 2.0, 37.0, -35.0, -2.0], [9.0, 25.0, -37.0, -76.0, 36.0], [-10.0, -49.0, 5.0, -98.0, 31.0]]], [[[-14.0, -56.0, -30.0, -40.0, -28.0], [-62.0, -75.0, 44.0, -55.0, -48.0], [37.0, 19.0, 37.0, 86.0, -28.0], [23.0, 88.0, -105.0, -40.0, 60.0]], [[-6.0, 17.0, 5.0, -3.0, 66.0], [46.0, 44.0, -18.0, 29.0, -15.0], [-22.0, 50.0, -7.0, -54.0, -28.0], [-13.0, -76.0, 31.0, 44.0, -7.0]], [[-82.0, -57.0, 78.0, -35.0, -21.0], [-88.0, 38.0, -3.0, -102.0, -11.0], [21.0, 46.0, -39.0, -78.0, -22.0], [3.0, -22.0, 26.0, -83.0, 58.0]], [[-47.0, -12.0, 2.0, -2.0, 11.0], [-15.0, 45.0, -102.0, -26.0, 55.0], [39.0, 49.0, -32.0, 62.0, -99.0], [15.0, 29.0, -5.0, 12.0, 50.0]], [[-37.0, -35.0, 33.0, 35.0, -25.0], [-39.0, -39.0, 24.0, -53.0, -44.0], [29.0, -1.0, 7.0, 42.0, 11.0], [30.0, 29.0, -68.0, -42.0, 27.0]]], [[[-2.0, 2.0, 14.0, 16.0, -56.0], [-24.0, 7.0, -15.0, -26.0, 24.0], [6.0, -46.0, -10.0, 6.0, 21.0], [8.0, 32.0, 25.0, -14.0, -14.0]], [[-40.0, -7.0, 61.0, 61.0, -20.0], [-31.0, -1.0, -38.0, -10.0, 71.0], [39.0, -20.0, -52.0, 37.0, 20.0], [11.0, 16.0, -14.0, -78.0, 20.0]], [[-36.0, -33.0, 83.0, 51.0, -48.0], [-66.0, -50.0, 60.0, -43.0, 1.0], [26.0, -44.0, -27.0, -12.0, 92.0], [11.0, 10.0, -37.0, -128.0, 13.0]], [[-42.0, -52.0, 25.0, -62.0, 9.0], [-53.0, 2.0, 51.0, -73.0, -78.0], [-3.0, 59.0, 12.0, -73.0, -20.0], [-1.0, -28.0, -9.0, -33.0, 44.0]], [[25.0, -14.0, -75.0, -86.0, 46.0], [7.0, -23.0, 15.0, 23.0, -17.0], [-2.0, 59.0, 34.0, 30.0, -65.0], [-15.0, 23.0, -38.0, 31.0, 37.0]]]])+(1.-msk_ref)*numarray.array([[[[16.0, -12.0, -44.0, -23.0, 36.0], [23.0, 31.0, 84.0, -17.0, -47.0], [-27.0, -82.0, -34.0, 23.0, 30.0], [32.0, -126.0, 10.0, -34.0, -56.0]], [[-12.0, 51.0, 17.0, -51.0, -21.0], [-27.0, -10.0, 65.0, -19.0, -38.0], [5.0, -17.0, 14.0, -47.0, -15.0], [7.0, -19.0, -19.0, -18.0, -38.0]], [[-9.0, -1.0, 53.0, 39.0, 19.0], [-12.0, 69.0, 45.0, -119.0, -2.0], [-29.0, -15.0, 60.0, -88.0, -71.0], [-16.0, 1.0, 12.0, 76.0, -94.0]], [[-60.0, 37.0, 31.0, -41.0, 2.0], [-2.0, 33.0, 67.0, -45.0, -18.0], [-31.0, -24.0, 30.0, -49.0, -19.0], [14.0, 36.0, -35.0, 20.0, -33.0]], [[42.0, -26.0, 4.0, 49.0, -8.0], [-57.0, -65.0, -50.0, 15.0, 19.0], [55.0, 44.0, 52.0, -29.0, -32.0], [-92.0, 10.0, 6.0, 16.0, 26.0]]], [[[-24.0, 13.0, 87.0, -43.0, -20.0], [34.0, 33.0, -53.0, -33.0, -72.0], [-33.0, 90.0, 6.0, -45.0, -29.0], [30.0, 58.0, 9.0, 10.0, -7.0]], [[-7.0, 8.0, -44.0, 8.0, 25.0], [-14.0, 20.0, 96.0, -27.0, 24.0], [-8.0, -95.0, 4.0, 0.0, 7.0], [3.0, -59.0, -13.0, 5.0, -47.0]], [[-24.0, 10.0, -39.0, 8.0, 26.0], [-16.0, 21.0, 96.0, -28.0, 34.0], [-11.0, -93.0, 15.0, -5.0, 4.0], [-3.0, -32.0, -24.0, 15.0, -38.0]], [[-77.0, -3.0, 39.0, -24.0, 27.0], [73.0, 98.0, 11.0, -51.0, -13.0], [-82.0, -5.0, -12.0, 2.0, 4.0], [69.0, 63.0, -12.0, 37.0, -16.0]], [[28.0, -4.0, -52.0, 4.0, -17.0], [-31.0, -83.0, -32.0, 90.0, 32.0], [54.0, 5.0, -16.0, 50.0, 36.0], [-35.0, -5.0, -10.0, -44.0, 71.0]]], [[[35.0, 27.0, 4.0, 49.0, -54.0], [3.0, -5.0, -89.0, 27.0, 92.0], [32.0, 47.0, -45.0, 37.0, -3.0], [46.0, 70.0, 36.0, 13.0, 31.0]], [[50.0, -23.0, -10.0, 53.0, 16.0], [-60.0, -26.0, 33.0, -41.0, 4.0], [36.0, -25.0, 57.0, -52.0, -43.0], [-81.0, -68.0, 13.0, 25.0, -49.0]], [[66.0, -13.0, 32.0, 20.0, -38.0], [-31.0, -67.0, -105.0, 34.0, -23.0], [55.0, 103.0, 11.0, -17.0, -25.0], [-49.0, 8.0, 33.0, -15.0, 35.0]], [[73.0, 28.0, 14.0, 24.0, -24.0], [-13.0, 31.0, 28.0, -65.0, -12.0], [12.0, -16.0, -22.0, -36.0, -37.0], [38.0, -92.0, 57.0, 3.0, -100.0]], [[51.0, -49.0, 2.0, 67.0, 4.0], [19.0, 7.0, -93.0, 4.0, 28.0], [10.0, 47.0, -17.0, 30.0, -6.0], [-7.0, 0.0, 48.0, 20.0, 17.0]]], [[[-41.0, -7.0, 38.0, -53.0, 9.0], [52.0, 32.0, -23.0, 0.0, -66.0], [-46.0, 40.0, -15.0, 4.0, 14.0], [36.0, 29.0, -8.0, -12.0, 16.0]], [[3.0, 11.0, -59.0, -36.0, 5.0], [37.0, 8.0, 37.0, 47.0, -3.0], [-14.0, -59.0, -76.0, 76.0, 64.0], [69.0, -63.0, 2.0, -57.0, 8.0]], [[-20.0, -23.0, -56.0, -25.0, 4.0], [44.0, -36.0, -59.0, 115.0, 22.0], [0.0, 9.0, -65.0, 112.0, 83.0], [29.0, 32.0, -17.0, -55.0, 111.0]], [[68.0, -23.0, 35.0, 71.0, -37.0], [-59.0, -74.0, -121.0, 18.0, 32.0], [73.0, 107.0, 48.0, -36.0, -52.0], [-90.0, 49.0, 31.0, 27.0, 40.0]], [[19.0, 76.0, -16.0, 23.0, -58.0], [-60.0, -30.0, 32.0, 2.0, 95.0], [53.0, -30.0, -2.0, -17.0, -21.0], [14.0, 32.0, -3.0, 9.0, -18.0]]]])
28838          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28839          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28840          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28841       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28842       def test_tensor_mult_constData_rank2_array_rank1(self):
28843          arg0=Data(numarray.array([[-7.0, 2.0, 3.0], [5.0, -1.0, -4.0]]),self.functionspace)
28844          arg1=numarray.array([-3.0, -4.0, -2.0])
28845          res=tensor_mult(arg0,arg1)
28846          ref=Data(numarray.array([7.0, -3.0]),self.functionspace)
28847          self.failUnless(isinstance(res,Data),"wrong type of result.")
28848          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28849          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28850       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28851       def test_tensor_mult_constData_rank2_array_rank2(self):
28852          arg0=Data(numarray.array([[0.0, 3.0, -2.0], [-7.0, -3.0, -7.0]]),self.functionspace)
28853          arg1=numarray.array([[2.0, 6.0], [-4.0, -1.0], [-2.0, 3.0]])
28854          res=tensor_mult(arg0,arg1)
28855          ref=Data(numarray.array([[-8.0, -9.0], [12.0, -60.0]]),self.functionspace)
28856          self.failUnless(isinstance(res,Data),"wrong type of result.")
28857          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28858          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28859       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28860       def test_tensor_mult_constData_rank2_Symbol_rank1(self):
28861          arg0=Data(numarray.array([[0.0, -1.0, -5.0], [1.0, -7.0, -2.0]]),self.functionspace)
28862          arg1=Symbol(shape=(3,))
28863          res=tensor_mult(arg0,arg1)
28864          s1=numarray.array([-2.0, -1.0, 4.0])
28865          sub=res.substitute({arg1:s1})
28866          ref=Data(numarray.array([-19.0, -3.0]),self.functionspace)
28867          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28868          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28869          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28870       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28871       def test_tensor_mult_constData_rank2_Symbol_rank2(self):
28872          arg0=Data(numarray.array([[-3.0, 0.0, -4.0], [1.0, -5.0, 0.0]]),self.functionspace)
28873          arg1=Symbol(shape=(3, 2))
28874          res=tensor_mult(arg0,arg1)
28875          s1=numarray.array([[4.0, 1.0], [5.0, 2.0], [4.0, 3.0]])
28876          sub=res.substitute({arg1:s1})
28877          ref=Data(numarray.array([[-28.0, -15.0], [-21.0, -9.0]]),self.functionspace)
28878          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28879          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28880          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28881       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28882       def test_tensor_mult_constData_rank2_constData_rank1(self):
28883          arg0=Data(numarray.array([[5.0, -6.0, 5.0], [-3.0, 7.0, -5.0]]),self.functionspace)
28884          arg1=Data(numarray.array([-1.0, 3.0, -6.0]),self.functionspace)
28885          res=tensor_mult(arg0,arg1)
28886          ref=Data(numarray.array([-53.0, 54.0]),self.functionspace)
28887          self.failUnless(isinstance(res,Data),"wrong type of result.")
28888          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28889          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28890       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28891       def test_tensor_mult_constData_rank2_constData_rank2(self):
28892          arg0=Data(numarray.array([[6.0, 3.0, -3.0], [-7.0, -7.0, -2.0]]),self.functionspace)
28893          arg1=Data(numarray.array([[5.0, -4.0], [3.0, 3.0], [3.0, -6.0]]),self.functionspace)
28894          res=tensor_mult(arg0,arg1)
28895          ref=Data(numarray.array([[30.0, 3.0], [-62.0, 19.0]]),self.functionspace)
28896          self.failUnless(isinstance(res,Data),"wrong type of result.")
28897          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28898          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28899       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28900       def test_tensor_mult_constData_rank2_expandedData_rank1(self):
28901          arg0=Data(numarray.array([[6.0, 6.0, -5.0], [5.0, -6.0, -6.0]]),self.functionspace)
28902          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28903          arg1=msk_arg1*numarray.array([4.0, -2.0, 0.0])+(1.-msk_arg1)*numarray.array([-1.0, -6.0, -7.0])
28904          res=tensor_mult(arg0,arg1)
28905          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28906          ref=msk_ref*numarray.array([12.0, 32.0])+(1.-msk_ref)*numarray.array([-7.0, 73.0])
28907          self.failUnless(isinstance(res,Data),"wrong type of result.")
28908          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28909          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28910       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28911       def test_tensor_mult_constData_rank2_expandedData_rank2(self):
28912          arg0=Data(numarray.array([[-3.0, 5.0, -2.0], [-1.0, -1.0, -5.0]]),self.functionspace)
28913          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
28914          arg1=msk_arg1*numarray.array([[-5.0, 4.0], [2.0, 6.0], [7.0, 1.0]])+(1.-msk_arg1)*numarray.array([[-4.0, 0.0], [-1.0, 4.0], [-3.0, 1.0]])
28915          res=tensor_mult(arg0,arg1)
28916          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
28917          ref=msk_ref*numarray.array([[11.0, 16.0], [-32.0, -15.0]])+(1.-msk_ref)*numarray.array([[13.0, 18.0], [20.0, -9.0]])
28918          self.failUnless(isinstance(res,Data),"wrong type of result.")
28919          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
28920          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28921       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28922       def test_tensor_mult_constData_rank4_array_rank2(self):
28923          arg0=Data(numarray.array([[[[7.0, -6.0, 1.0], [-7.0, -2.0, 2.0]], [[0.0, -7.0, -1.0], [2.0, 0.0, -5.0]], [[3.0, 4.0, 3.0], [-2.0, 5.0, 7.0]], [[0.0, 0.0, 4.0], [0.0, 6.0, -7.0]], [[2.0, 3.0, -2.0], [-1.0, -7.0, 0.0]]], [[[3.0, 2.0, 1.0], [3.0, 0.0, 3.0]], [[-4.0, 0.0, -2.0], [-5.0, 3.0, -5.0]], [[-7.0, -7.0, -2.0], [3.0, 0.0, 5.0]], [[-1.0, 7.0, -3.0], [-4.0, 0.0, 6.0]], [[-7.0, 6.0, -1.0], [-4.0, -7.0, 2.0]]], [[[-3.0, 5.0, 0.0], [-4.0, -2.0, -4.0]], [[-1.0, 7.0, -6.0], [3.0, 0.0, 3.0]], [[-1.0, -1.0, -7.0], [1.0, 3.0, 6.0]], [[-2.0, 7.0, -4.0], [-2.0, -2.0, -3.0]], [[-6.0, -7.0, 0.0], [6.0, 4.0, -6.0]]], [[[-7.0, -4.0, 4.0], [-2.0, -7.0, 5.0]], [[-3.0, 1.0, -4.0], [1.0, -6.0, 7.0]], [[4.0, 0.0, 7.0], [-2.0, 6.0, -3.0]], [[-5.0, 2.0, 7.0], [3.0, 4.0, -2.0]], [[-7.0, 5.0, 5.0], [-5.0, 1.0, 3.0]]]]),self.functionspace)
28924          arg1=numarray.array([[-3.0, -4.0, 1.0], [-2.0, 5.0, -3.0]])
28925          res=tensor_mult(arg0,arg1)
28926          ref=Data(numarray.array([[2.0, 38.0, -14.0, 55.0, -53.0], [-31.0, 50.0, 26.0, -38.0, -37.0], [-1.0, -46.0, -5.0, -23.0, 72.0], [-5.0, -52.0, 38.0, 34.0, 12.0]]),self.functionspace)
28927          self.failUnless(isinstance(res,Data),"wrong type of result.")
28928          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28929          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28930       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28931       def test_tensor_mult_constData_rank4_array_rank3(self):
28932          arg0=Data(numarray.array([[[[-5.0, -4.0, 7.0], [0.0, 5.0, -2.0]], [[1.0, 2.0, -7.0], [6.0, 0.0, 5.0]], [[-2.0, 5.0, 2.0], [6.0, 4.0, 5.0]], [[4.0, -4.0, 0.0], [2.0, 3.0, 0.0]], [[5.0, 4.0, -5.0], [-1.0, -5.0, 0.0]]], [[[5.0, 5.0, -7.0], [4.0, -7.0, -3.0]], [[2.0, 7.0, 5.0], [3.0, -3.0, -1.0]], [[3.0, -5.0, -1.0], [-3.0, 6.0, -5.0]], [[-5.0, -1.0, 2.0], [-7.0, 3.0, -2.0]], [[-4.0, 2.0, 6.0], [-6.0, 4.0, 2.0]]], [[[-5.0, 2.0, -4.0], [6.0, -1.0, -4.0]], [[-3.0, 0.0, 6.0], [-5.0, -3.0, -4.0]], [[4.0, 0.0, 7.0], [1.0, -1.0, 4.0]], [[7.0, 5.0, 6.0], [-4.0, 3.0, 1.0]], [[1.0, 0.0, -4.0], [0.0, -5.0, 5.0]]], [[[-3.0, 1.0, 4.0], [6.0, 6.0, 3.0]], [[-3.0, 5.0, 3.0], [-2.0, -6.0, 0.0]], [[3.0, 4.0, 7.0], [7.0, 5.0, -4.0]], [[-7.0, -6.0, -6.0], [-7.0, -6.0, 2.0]], [[6.0, 4.0, -3.0], [0.0, -7.0, -3.0]]]]),self.functionspace)
28933          arg1=numarray.array([[[3.0, 6.0], [0.0, 7.0], [3.0, -4.0]], [[-6.0, -3.0], [-3.0, -2.0], [-1.0, -5.0]]])
28934          res=tensor_mult(arg0,arg1)
28935          ref=Data(numarray.array([[[-7.0, -86.0], [-59.0, 5.0], [-53.0, -36.0], [-9.0, -16.0], [21.0, 91.0]], [[-6.0, 110.0], [13.0, 43.0], [11.0, 9.0], [26.0, -20.0], [28.0, -34.0]], [[-56.0, 4.0], [52.0, -1.0], [26.0, -25.0], [53.0, 54.0], [1.0, 7.0]], [[-54.0, -72.0], [30.0, 23.0], [-23.0, 7.0], [19.0, -37.0], [33.0, 105.0]]]),self.functionspace)
28936          self.failUnless(isinstance(res,Data),"wrong type of result.")
28937          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28938          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28939       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28940       def test_tensor_mult_constData_rank4_array_rank4(self):
28941          arg0=Data(numarray.array([[[[2.0, 6.0, -1.0], [-2.0, -2.0, -2.0]], [[-4.0, -6.0, 3.0], [1.0, 6.0, 0.0]], [[1.0, 2.0, -6.0], [-7.0, -5.0, -5.0]], [[5.0, 2.0, 6.0], [3.0, 0.0, -1.0]], [[-7.0, -1.0, 4.0], [1.0, -3.0, -5.0]]], [[[2.0, -6.0, -7.0], [-2.0, 5.0, 7.0]], [[6.0, -3.0, 6.0], [-2.0, -5.0, -4.0]], [[2.0, 7.0, -4.0], [-1.0, 6.0, -5.0]], [[0.0, -3.0, -7.0], [7.0, 0.0, -7.0]], [[-5.0, -5.0, -5.0], [0.0, -3.0, 6.0]]], [[[-6.0, -7.0, -3.0], [6.0, 3.0, 3.0]], [[-5.0, 6.0, -5.0], [3.0, -5.0, 6.0]], [[3.0, -3.0, -6.0], [-5.0, -6.0, -6.0]], [[-1.0, -3.0, 1.0], [-4.0, 1.0, 2.0]], [[6.0, -6.0, 1.0], [2.0, -6.0, 5.0]]], [[[6.0, 6.0, 5.0], [2.0, 6.0, 1.0]], [[6.0, -6.0, -1.0], [7.0, -4.0, 6.0]], [[-3.0, -2.0, 0.0], [5.0, 1.0, 0.0]], [[-3.0, 2.0, 4.0], [3.0, 4.0, -1.0]], [[-5.0, 0.0, 2.0], [1.0, 4.0, 0.0]]]]),self.functionspace)
28942          arg1=numarray.array([[[[6.0, 0.0, -1.0, 6.0, -4.0], [-2.0, -4.0, 1.0, 1.0, -2.0], [0.0, -7.0, -1.0, 2.0, 6.0], [3.0, -3.0, -3.0, 4.0, 0.0]], [[-1.0, 6.0, 0.0, 3.0, 2.0], [0.0, 4.0, 5.0, 7.0, -5.0], [-4.0, 0.0, 7.0, 4.0, 2.0], [-5.0, 1.0, -6.0, 1.0, -7.0]], [[4.0, 6.0, -7.0, -4.0, -1.0], [-7.0, 6.0, 1.0, 7.0, 0.0], [-3.0, -4.0, -7.0, 1.0, 0.0], [1.0, -4.0, -5.0, 2.0, 3.0]]], [[[-5.0, 3.0, 1.0, 5.0, -1.0], [-1.0, 0.0, 0.0, 7.0, 7.0], [4.0, 0.0, 4.0, -7.0, -7.0], [-7.0, 5.0, 6.0, -5.0, -2.0]], [[-4.0, 7.0, 4.0, -3.0, -4.0], [-5.0, -3.0, 4.0, 0.0, 6.0], [6.0, -1.0, 0.0, 3.0, -7.0], [0.0, -7.0, -4.0, 4.0, 4.0]], [[6.0, -6.0, -6.0, 6.0, 0.0], [0.0, 6.0, -2.0, -1.0, -3.0], [-7.0, 2.0, -3.0, 1.0, -4.0], [-5.0, 3.0, 0.0, -6.0, -3.0]]]])
28943          res=tensor_mult(arg0,arg1)
28944          ref=Data(numarray.array([[[[8.0, 22.0, 7.0, 18.0, 15.0], [15.0, 4.0, 27.0, 25.0, -54.0], [-27.0, -12.0, 45.0, 33.0, 60.0], [-1.0, 2.0, -41.0, 26.0, -43.0]], [[-35.0, 27.0, 8.0, -67.0, -24.0], [-44.0, -8.0, -7.0, -18.0, 81.0], [55.0, 10.0, -55.0, -18.0, -85.0], [14.0, -43.0, 15.0, 3.0, 73.0]], [[5.0, -50.0, 44.0, -14.0, 33.0], [72.0, -47.0, -5.0, -71.0, -76.0], [-13.0, 12.0, 42.0, 33.0, 114.0], [61.0, 8.0, -7.0, 39.0, -23.0]], [[31.0, 63.0, -38.0, 21.0, -25.0], [-55.0, 18.0, 23.0, 83.0, 4.0], [-7.0, -61.0, -18.0, 2.0, 17.0], [-5.0, -25.0, -39.0, 25.0, 1.0]], [[-48.0, 30.0, -2.0, -77.0, 33.0], [0.0, 27.0, -10.0, 26.0, 23.0], [13.0, 26.0, -9.0, -35.0, -10.0], [6.0, 15.0, 25.0, -8.0, 20.0]]], [[[22.0, -91.0, 23.0, 39.0, -31.0], [22.0, -47.0, -29.0, -110.0, 21.0], [18.0, 23.0, -24.0, 9.0, -49.0], [8.0, -8.0, 33.0, -24.0, 24.0]], [[69.0, 1.0, -46.0, -16.0, -14.0], [-27.0, -9.0, -15.0, 17.0, -29.0], [-16.0, -69.0, -65.0, 1.0, 95.0], [73.0, -32.0, -22.0, 47.0, 35.0]], [[-60.0, 87.0, 79.0, -4.0, -13.0], [-5.0, -52.0, 67.0, 21.0, 5.0], [51.0, -14.0, 86.0, 48.0, 11.0], [-1.0, -45.0, -58.0, 66.0, -20.0]], [[-102.0, 3.0, 98.0, 12.0, -6.0], [42.0, -96.0, -8.0, -14.0, 85.0], [110.0, 14.0, 77.0, -75.0, -27.0], [-6.0, 39.0, 95.0, -10.0, 7.0]], [[3.0, -117.0, -8.0, 20.0, 27.0], [60.0, 15.0, -59.0, -81.0, -1.0], [-25.0, 70.0, -13.0, -38.0, -43.0], [-25.0, 69.0, 82.0, -83.0, -10.0]]], [[[-65.0, -39.0, 27.0, -6.0, -5.0], [12.0, -13.0, -38.0, -37.0, 98.0], [58.0, 57.0, -7.0, -73.0, -125.0], [-43.0, 41.0, 99.0, -73.0, 31.0]], [[-15.0, -56.0, -13.0, 74.0, 54.0], [67.0, 65.0, -12.0, 17.0, -47.0], [-69.0, 72.0, 76.0, -21.0, -28.0], [-101.0, 109.0, 42.0, -95.0, -101.0]], [[10.0, -75.0, 46.0, -10.0, 17.0], [71.0, -78.0, -30.0, -89.0, -44.0], [16.0, -3.0, 16.0, -1.0, 113.0], [83.0, 11.0, 33.0, 34.0, 7.0]], [[29.0, -29.0, -18.0, -30.0, -3.0], [-6.0, 7.0, -15.0, -45.0, -11.0], [-15.0, 6.0, -49.0, 20.0, 1.0], [31.0, -25.0, -12.0, 7.0, 30.0]], [[90.0, -96.0, -65.0, 72.0, -15.0], [9.0, 6.0, -57.0, -20.0, -19.0], [-42.0, -30.0, -62.0, -38.0, 32.0], [10.0, 39.0, 49.0, -44.0, 2.0]]], [[[22.0, 108.0, -21.0, 32.0, -43.0], [-79.0, 18.0, 63.0, 96.0, 5.0], [-2.0, -66.0, 6.0, 46.0, -12.0], [-26.0, -61.0, -91.0, 48.0, -10.0]], [[55.0, -85.0, -44.0, 105.0, -26.0], [8.0, -6.0, -53.0, 0.0, 25.0], [-11.0, -22.0, -31.0, -68.0, -21.0], [-32.0, 61.0, 81.0, -71.0, -9.0]], [[-45.0, 10.0, 12.0, -2.0, -1.0], [-4.0, 1.0, -9.0, 18.0, 57.0], [34.0, 20.0, 9.0, -46.0, -64.0], [-34.0, 25.0, 47.0, -35.0, 8.0]], [[-41.0, 79.0, 0.0, -31.0, -7.0], [-45.0, 26.0, 29.0, 61.0, 44.0], [23.0, -1.0, 4.0, -4.0, -59.0], [-31.0, -21.0, -21.0, 5.0, 11.0]], [[-43.0, 43.0, 8.0, -45.0, 1.0], [-25.0, 20.0, 13.0, 16.0, 41.0], [22.0, 23.0, -5.0, -3.0, -65.0], [-20.0, -16.0, -5.0, -5.0, 20.0]]]]),self.functionspace)
28945          self.failUnless(isinstance(res,Data),"wrong type of result.")
28946          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28947          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28948       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28949       def test_tensor_mult_constData_rank4_Symbol_rank2(self):
28950          arg0=Data(numarray.array([[[[-5.0, 5.0, 7.0], [-3.0, -6.0, 0.0]], [[5.0, 0.0, 0.0], [3.0, -6.0, -3.0]], [[0.0, 4.0, 5.0], [3.0, 0.0, -3.0]], [[7.0, 3.0, -4.0], [3.0, 7.0, 5.0]], [[7.0, -5.0, -7.0], [0.0, 3.0, 0.0]]], [[[4.0, -6.0, 6.0], [-5.0, -4.0, -4.0]], [[4.0, 2.0, -3.0], [6.0, 1.0, 7.0]], [[0.0, -2.0, 4.0], [-1.0, 0.0, -1.0]], [[0.0, 5.0, 7.0], [-1.0, 1.0, -4.0]], [[3.0, -6.0, -6.0], [3.0, -3.0, 0.0]]], [[[7.0, 3.0, -6.0], [2.0, -2.0, 4.0]], [[-5.0, -3.0, 6.0], [1.0, 6.0, -7.0]], [[4.0, -5.0, 6.0], [-3.0, 2.0, -1.0]], [[-4.0, 1.0, 0.0], [-3.0, -5.0, 6.0]], [[4.0, 7.0, 0.0], [2.0, 2.0, -3.0]]], [[[-3.0, 7.0, -1.0], [-6.0, -1.0, -2.0]], [[0.0, -4.0, -5.0], [-6.0, -3.0, -5.0]], [[-7.0, -4.0, -7.0], [-7.0, -4.0, -1.0]], [[0.0, -3.0, -5.0], [2.0, 7.0, 2.0]], [[7.0, 7.0, -6.0], [0.0, 1.0, 6.0]]]]),self.functionspace)
28951          arg1=Symbol(shape=(2, 3))
28952          res=tensor_mult(arg0,arg1)
28953          s1=numarray.array([[3.0, -3.0, 2.0], [-1.0, 7.0, 0.0]])
28954          sub=res.substitute({arg1:s1})
28955          ref=Data(numarray.array([[-55.0, -30.0, -5.0, 50.0, 43.0], [19.0, 1.0, 15.0, 7.0, -9.0], [-16.0, 47.0, 56.0, -47.0, 3.0], [-33.0, -13.0, -44.0, 46.0, -5.0]]),self.functionspace)
28956          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28957          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28958          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28959       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28960       def test_tensor_mult_constData_rank4_Symbol_rank3(self):
28961          arg0=Data(numarray.array([[[[-4.0, 0.0, 0.0], [1.0, -3.0, 7.0]], [[5.0, 5.0, -4.0], [4.0, 6.0, 2.0]], [[0.0, 6.0, -1.0], [-1.0, 3.0, 1.0]], [[-7.0, 0.0, 1.0], [0.0, 5.0, -7.0]], [[-1.0, 5.0, 6.0], [-5.0, 4.0, -3.0]]], [[[1.0, -7.0, 1.0], [4.0, 0.0, 0.0]], [[-6.0, 7.0, -4.0], [0.0, 0.0, -5.0]], [[2.0, 0.0, -7.0], [-4.0, -5.0, -6.0]], [[4.0, -5.0, -3.0], [-7.0, -5.0, -6.0]], [[4.0, -6.0, -1.0], [5.0, 7.0, -3.0]]], [[[3.0, 0.0, -5.0], [0.0, 0.0, 1.0]], [[0.0, 0.0, -4.0], [0.0, -7.0, -3.0]], [[-3.0, 7.0, -3.0], [-5.0, 4.0, 1.0]], [[6.0, 1.0, 1.0], [-1.0, -6.0, -1.0]], [[6.0, -1.0, 4.0], [-5.0, -3.0, -2.0]]], [[[4.0, 6.0, 0.0], [3.0, 1.0, -1.0]], [[-6.0, 0.0, 5.0], [-6.0, 7.0, 7.0]], [[-3.0, 1.0, 7.0], [6.0, -6.0, 7.0]], [[-3.0, -7.0, -2.0], [7.0, -6.0, 3.0]], [[7.0, -5.0, 5.0], [-4.0, -4.0, 1.0]]]]),self.functionspace)
28962          arg1=Symbol(shape=(2, 3, 2))
28963          res=tensor_mult(arg0,arg1)
28964          s1=numarray.array([[[0.0, 4.0], [-5.0, 7.0], [-5.0, 7.0]], [[2.0, -6.0], [-4.0, -3.0], [4.0, -2.0]]])
28965          sub=res.substitute({arg1:s1})
28966          ref=Data(numarray.array([[[42.0, -27.0], [-13.0, -19.0], [-35.0, 30.0], [-53.0, -22.0], [-93.0, 97.0]], [[38.0, -62.0], [-35.0, 7.0], [23.0, 10.0], [22.0, 29.0], [5.0, -78.0]], [[29.0, -25.0], [36.0, -1.0], [-42.0, 32.0], [8.0, 64.0], [-21.0, 88.0]], [[-32.0, 39.0], [-37.0, 12.0], [24.0, 12.0], [95.0, -105.0], [12.0, 62.0]]]),self.functionspace)
28967          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28968          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28969          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28970       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28971       def test_tensor_mult_constData_rank4_Symbol_rank4(self):
28972          arg0=Data(numarray.array([[[[6.0, -5.0, 7.0], [-2.0, 2.0, 5.0]], [[-2.0, -4.0, 5.0], [0.0, 7.0, 5.0]], [[-2.0, 2.0, 6.0], [0.0, 1.0, 6.0]], [[-3.0, 4.0, -2.0], [0.0, 1.0, -7.0]], [[0.0, 1.0, 4.0], [1.0, -4.0, 3.0]]], [[[-6.0, 4.0, 3.0], [-5.0, 0.0, -7.0]], [[4.0, 3.0, -3.0], [-2.0, -7.0, -4.0]], [[5.0, 1.0, 7.0], [-7.0, -6.0, 2.0]], [[0.0, -5.0, -3.0], [-3.0, 4.0, 0.0]], [[5.0, 3.0, 6.0], [-2.0, 4.0, 0.0]]], [[[-2.0, 6.0, -6.0], [6.0, -2.0, 7.0]], [[-1.0, -4.0, -4.0], [-1.0, 5.0, 0.0]], [[-6.0, 1.0, 7.0], [1.0, 2.0, -4.0]], [[7.0, -5.0, 0.0], [-2.0, 1.0, -4.0]], [[-6.0, -4.0, 1.0], [-5.0, 3.0, 3.0]]], [[[-1.0, -2.0, -7.0], [3.0, 7.0, 1.0]], [[4.0, 7.0, 4.0], [6.0, 2.0, 7.0]], [[0.0, -6.0, 7.0], [0.0, 7.0, -1.0]], [[-6.0, 6.0, 5.0], [-7.0, -3.0, 5.0]], [[3.0, 2.0, -7.0], [-3.0, -3.0, 0.0]]]]),self.functionspace)
28973          arg1=Symbol(shape=(2, 3, 4, 5))
28974          res=tensor_mult(arg0,arg1)
28975          s1=numarray.array([[[[1.0, 2.0, 0.0, 2.0, 3.0], [1.0, -1.0, 2.0, -7.0, -4.0], [-6.0, 2.0, -7.0, -1.0, -5.0], [1.0, 3.0, -7.0, 0.0, -2.0]], [[-4.0, 1.0, 4.0, -3.0, 3.0], [2.0, -7.0, -6.0, 5.0, 7.0], [-2.0, 0.0, -4.0, -1.0, 4.0], [-7.0, -5.0, 4.0, 0.0, -1.0]], [[-5.0, 2.0, 4.0, -5.0, 1.0], [6.0, 4.0, 5.0, 2.0, 6.0], [3.0, -1.0, 2.0, 2.0, -5.0], [0.0, 6.0, -2.0, -5.0, 2.0]]], [[[0.0, -7.0, -1.0, -7.0, 6.0], [3.0, -4.0, 2.0, -3.0, -1.0], [3.0, 4.0, 3.0, 6.0, -2.0], [0.0, 2.0, 5.0, 0.0, -4.0]], [[0.0, 3.0, 7.0, -3.0, 5.0], [4.0, -4.0, -2.0, 0.0, 0.0], [7.0, -7.0, 5.0, 0.0, -5.0], [-1.0, 0.0, -3.0, 1.0, -1.0]], [[-4.0, 1.0, -5.0, 0.0, -3.0], [4.0, 7.0, -1.0, 7.0, 4.0], [0.0, -3.0, -4.0, 4.0, -1.0], [-7.0, -7.0, 6.0, 4.0, 0.0]]]])
28976          sub=res.substitute({arg1:s1})
28977          ref=Data(numarray.array([[[[-29.0, 46.0, -1.0, 0.0, -7.0], [60.0, 92.0, 64.0, -12.0, 5.0], [3.0, -32.0, -24.0, 21.0, -96.0], [4.0, 46.0, -62.0, -13.0, 13.0]], [[-31.0, 28.0, 28.0, -38.0, 7.0], [68.0, 57.0, 26.0, 39.0, 30.0], [84.0, -73.0, 55.0, 36.0, -71.0], [-16.0, 9.0, -3.0, 2.0, 11.0]], [[-64.0, 19.0, 9.0, -43.0, -7.0], [66.0, 50.0, 6.0, 78.0, 82.0], [33.0, -35.0, -1.0, 36.0, -23.0], [-59.0, -22.0, 43.0, -5.0, 13.0]], [[19.0, -10.0, 50.0, -11.0, 27.0], [-31.0, -86.0, -35.0, -12.0, 0.0], [11.0, 10.0, 34.0, -33.0, 43.0], [17.0, 8.0, -4.0, -17.0, -3.0]], [[-36.0, -7.0, -24.0, -18.0, -16.0], [25.0, 42.0, 21.0, 31.0, 42.0], [-15.0, 19.0, -25.0, 25.0, -1.0], [-24.0, 0.0, 31.0, -12.0, 7.0]]], [[[-9.0, 26.0, 68.0, -4.0, -12.0], [-23.0, -39.0, -24.0, 34.0, 47.0], [22.0, -14.0, 45.0, -50.0, 48.0], [15.0, 19.0, -15.0, -43.0, 34.0]], [[23.0, -6.0, -27.0, 49.0, -17.0], [-58.0, -29.0, -11.0, -41.0, -27.0], [-94.0, 64.0, -71.0, -41.0, 50.0], [18.0, 3.0, -23.0, -8.0, -2.0]], [[-42.0, 58.0, -13.0, 39.0, -53.0], [12.0, 82.0, 35.0, 19.0, 44.0], [-74.0, 11.0, -84.0, -26.0, -14.0], [-10.0, 24.0, -50.0, -33.0, 37.0]], [[35.0, 22.0, -1.0, 39.0, -16.0], [-21.0, 19.0, 1.0, -22.0, -50.0], [20.0, -37.0, 25.0, -19.0, -19.0], [31.0, 1.0, -41.0, 19.0, 7.0]], [[-37.0, 51.0, 66.0, -27.0, 38.0], [57.0, -10.0, 10.0, -2.0, 39.0], [4.0, -32.0, -21.0, -8.0, -59.0], [-20.0, 32.0, -57.0, -26.0, 3.0]]], [[[-24.0, -51.0, -55.0, -28.0, 11.0], [12.0, -31.0, -61.0, 63.0, 36.0], [-14.0, 19.0, -42.0, 48.0, 55.0], [-91.0, -109.0, 128.0, 56.0, -36.0]], [[35.0, 8.0, 4.0, 22.0, 0.0], [-16.0, -3.0, -10.0, -18.0, -47.0], [34.0, -37.0, 37.0, -9.0, -14.0], [22.0, -9.0, -21.0, 25.0, -3.0]], [[-29.0, -2.0, 65.0, -63.0, 20.0], [33.0, -13.0, 19.0, 30.0, 56.0], [72.0, -17.0, 81.0, 9.0, -9.0], [13.0, 49.0, 7.0, -49.0, 19.0]], [[43.0, 22.0, 9.0, 40.0, 11.0], [-21.0, 4.0, 42.0, -96.0, -77.0], [-31.0, 11.0, -14.0, -30.0, -52.0], [69.0, 70.0, -106.0, -15.0, -2.0]], [[-7.0, 33.0, -1.0, 21.0, -53.0], [1.0, 67.0, -2.0, 60.0, 19.0], [53.0, -63.0, 48.0, -6.0, 1.0], [-2.0, -23.0, 8.0, 10.0, 35.0]]], [[[38.0, -17.0, 5.0, -3.0, 34.0], [-6.0, -46.0, -34.0, -19.0, -51.0], [47.0, -35.0, 41.0, 11.0, -10.0], [-1.0, -36.0, 13.0, 46.0, -29.0]], [[-72.0, -6.0, 17.0, -81.0, 62.0], [96.0, -20.0, -13.0, 46.0, 79.0], [6.0, -7.0, -48.0, 61.0, -41.0], [-96.0, -36.0, 58.0, 10.0, -33.0]], [[-7.0, 28.0, 58.0, -38.0, 27.0], [54.0, 35.0, 58.0, -23.0, -4.0], [82.0, -53.0, 77.0, 16.0, -93.0], [42.0, 79.0, -65.0, -32.0, 13.0]], [[-75.0, 49.0, 5.0, 3.0, -67.0], [23.0, 59.0, -36.0, 138.0, 123.0], [-3.0, -39.0, -28.0, -12.0, 53.0], [-80.0, -67.0, 60.0, -8.0, 47.0]], [[30.0, 6.0, -38.0, 65.0, -25.0], [-56.0, -21.0, -41.0, -16.0, -37.0], [-73.0, 22.0, -67.0, -37.0, 49.0], [-8.0, -49.0, -5.0, 32.0, -7.0]]]]),self.functionspace)
28978          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
28979          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
28980          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28981       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28982       def test_tensor_mult_constData_rank4_constData_rank2(self):
28983          arg0=Data(numarray.array([[[[0.0, 6.0, -6.0], [0.0, 3.0, 7.0]], [[7.0, 0.0, 4.0], [-7.0, -6.0, -6.0]], [[5.0, -3.0, 2.0], [-5.0, -1.0, 4.0]], [[4.0, -3.0, 1.0], [0.0, -3.0, -2.0]], [[1.0, 5.0, -7.0], [4.0, 0.0, -1.0]]], [[[0.0, -2.0, 1.0], [-1.0, -3.0, 7.0]], [[0.0, 6.0, -3.0], [-7.0, 6.0, 3.0]], [[6.0, -1.0, 7.0], [-6.0, -5.0, 2.0]], [[6.0, 0.0, 0.0], [-7.0, -3.0, -4.0]], [[0.0, 1.0, 0.0], [-4.0, -5.0, -4.0]]], [[[3.0, 5.0, -2.0], [7.0, 3.0, -2.0]], [[-5.0, 0.0, 4.0], [-4.0, 5.0, 0.0]], [[3.0, -4.0, 5.0], [2.0, -1.0, 0.0]], [[-4.0, 0.0, 4.0], [5.0, 0.0, 4.0]], [[0.0, 6.0, -6.0], [-5.0, -7.0, -1.0]]], [[[1.0, -3.0, 0.0], [4.0, 4.0, 5.0]], [[-7.0, 1.0, -7.0], [3.0, 3.0, -3.0]], [[5.0, 5.0, -5.0], [0.0, 3.0, 0.0]], [[0.0, -6.0, -5.0], [-1.0, 6.0, 5.0]], [[-5.0, -4.0, -4.0], [4.0, 0.0, -6.0]]]]),self.functionspace)
28984          arg1=Data(numarray.array([[-1.0, -6.0, -6.0], [0.0, 6.0, -7.0]]),self.functionspace)
28985          res=tensor_mult(arg0,arg1)
28986          ref=Data(numarray.array([[-31.0, -25.0, -33.0, 4.0, 18.0], [-61.0, -3.0, -86.0, 4.0, -8.0], [11.0, 11.0, -15.0, -48.0, -35.0], [6.0, 82.0, 13.0, 67.0, 95.0]]),self.functionspace)
28987          self.failUnless(isinstance(res,Data),"wrong type of result.")
28988          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
28989          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28990       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28991       def test_tensor_mult_constData_rank4_constData_rank3(self):
28992          arg0=Data(numarray.array([[[[-1.0, 2.0, -7.0], [-6.0, 2.0, 6.0]], [[0.0, 3.0, 6.0], [-6.0, 5.0, -3.0]], [[5.0, 5.0, -2.0], [2.0, 0.0, -2.0]], [[-1.0, 1.0, 5.0], [3.0, 1.0, -7.0]], [[-6.0, 0.0, -7.0], [-2.0, -2.0, 7.0]]], [[[-7.0, 4.0, 1.0], [1.0, 2.0, -2.0]], [[6.0, -5.0, -3.0], [1.0, 0.0, 7.0]], [[-4.0, 4.0, 2.0], [7.0, 0.0, 3.0]], [[-5.0, -7.0, 4.0], [-4.0, -5.0, 3.0]], [[0.0, 6.0, 5.0], [-2.0, 7.0, 3.0]]], [[[-2.0, 1.0, 3.0], [0.0, -6.0, -7.0]], [[7.0, -7.0, -6.0], [-2.0, 6.0, 3.0]], [[4.0, 2.0, -1.0], [1.0, 4.0, -4.0]], [[1.0, 0.0, -6.0], [0.0, -7.0, 0.0]], [[-6.0, 0.0, 1.0], [1.0, -6.0, -6.0]]], [[[-6.0, -4.0, 1.0], [-5.0, 4.0, -4.0]], [[-7.0, 3.0, 7.0], [7.0, 7.0, 0.0]], [[3.0, 3.0, -2.0], [-4.0, 0.0, 0.0]], [[5.0, 3.0, -4.0], [-2.0, -4.0, -6.0]], [[5.0, 1.0, 7.0], [-1.0, 7.0, 2.0]]]]),self.functionspace)
28993          arg1=Data(numarray.array([[[0.0, -7.0], [4.0, 7.0], [5.0, 1.0]], [[-3.0, 1.0], [2.0, -6.0], [-3.0, 0.0]]]),self.functionspace)
28994          res=tensor_mult(arg0,arg1)
28995          ref=Data(numarray.array([[[-23.0, -4.0], [79.0, -9.0], [10.0, 0.0], [43.0, 16.0], [-54.0, 45.0]], [[28.0, 67.0], [-59.0, -79.0], [-4.0, 65.0], [-15.0, 16.0], [60.0, 3.0]], [[28.0, 60.0], [-49.0, -142.0], [20.0, -38.0], [-44.0, 29.0], [8.0, 80.0]], [[24.0, -14.0], [40.0, 42.0], [14.0, -6.0], [8.0, 4.0], [50.0, -64.0]]]),self.functionspace)
28996          self.failUnless(isinstance(res,Data),"wrong type of result.")
28997          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
28998          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
28999       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29000       def test_tensor_mult_constData_rank4_constData_rank4(self):
29001          arg0=Data(numarray.array([[[[0.0, 1.0, -6.0], [-6.0, 6.0, -2.0]], [[5.0, -2.0, 0.0], [-7.0, 0.0, 4.0]], [[-3.0, -4.0, -6.0], [-7.0, -6.0, 2.0]], [[-4.0, -2.0, -7.0], [0.0, 6.0, 3.0]], [[-3.0, 3.0, -4.0], [0.0, 5.0, 4.0]]], [[[-5.0, 1.0, -6.0], [-4.0, 5.0, 4.0]], [[2.0, 7.0, 6.0], [-7.0, 0.0, -3.0]], [[-6.0, -6.0, 7.0], [-2.0, 6.0, 6.0]], [[-5.0, 7.0, 6.0], [0.0, 3.0, -7.0]], [[7.0, 5.0, -2.0], [1.0, -1.0, -1.0]]], [[[-2.0, 0.0, 6.0], [0.0, -3.0, 0.0]], [[0.0, 7.0, -1.0], [-6.0, 3.0, 2.0]], [[-3.0, 0.0, -2.0], [4.0, -5.0, 0.0]], [[-6.0, 3.0, 3.0], [0.0, 3.0, 6.0]], [[-2.0, 4.0, -2.0], [-4.0, -5.0, -7.0]]], [[[-4.0, 1.0, 0.0], [0.0, 3.0, 5.0]], [[5.0, 1.0, -7.0], [6.0, 0.0, 0.0]], [[-7.0, 3.0, 6.0], [-6.0, -2.0, 2.0]], [[0.0, -6.0, 6.0], [5.0, 7.0, 0.0]], [[-5.0, -4.0, -5.0], [6.0, -2.0, -5.0]]]]),self.functionspace)
29002          arg1=Data(numarray.array([[[[-2.0, 7.0, 4.0, -6.0, 4.0], [3.0, 1.0, 7.0, 2.0, -5.0], [-6.0, -2.0, -2.0, 0.0, -1.0], [-3.0, -2.0, 1.0, -5.0, 6.0]], [[-1.0, 0.0, 6.0, 7.0, -1.0], [7.0, 0.0, -5.0, -6.0, 2.0], [-1.0, 2.0, -4.0, -2.0, 6.0], [7.0, -1.0, -4.0, 2.0, 4.0]], [[3.0, -6.0, 4.0, -3.0, -1.0], [0.0, 0.0, -3.0, -7.0, -6.0], [7.0, 3.0, 1.0, 2.0, -6.0], [-5.0, -2.0, 2.0, 0.0, 3.0]]], [[[1.0, -7.0, 0.0, -5.0, 6.0], [-5.0, -2.0, 4.0, -2.0, 4.0], [-5.0, -4.0, 2.0, 4.0, -7.0], [-5.0, 1.0, -3.0, -6.0, 6.0]], [[-3.0, 4.0, 2.0, -1.0, -1.0], [-3.0, -1.0, -3.0, 0.0, 5.0], [1.0, 7.0, -6.0, -5.0, 4.0], [5.0, -2.0, 4.0, 5.0, 2.0]], [[0.0, 7.0, 6.0, -4.0, 3.0], [6.0, -5.0, 0.0, 5.0, -2.0], [-4.0, -2.0, 3.0, -6.0, -1.0], [-4.0, 5.0, 0.0, -4.0, 4.0]]]]),self.functionspace)
29003          res=tensor_mult(arg0,arg1)
29004          ref=Data(numarray.array([[[[-43.0, 88.0, -18.0, 57.0, -43.0], [7.0, 16.0, -29.0, 38.0, 48.0], [1.0, 54.0, -64.0, -56.0, 110.0], [105.0, -17.0, 26.0, 76.0, -46.0]], [[-15.0, 112.0, 32.0, -25.0, -8.0], [60.0, -1.0, 17.0, 56.0, -65.0], [-9.0, 6.0, -4.0, -48.0, 28.0], [-10.0, 5.0, 34.0, -3.0, -4.0]], [[3.0, 54.0, -60.0, 41.0, -32.0], [28.0, 7.0, 7.0, 84.0, -19.0], [1.0, -38.0, 44.0, -14.0, 38.0], [8.0, 37.0, -2.0, 11.0, -98.0]], [[-29.0, 59.0, -26.0, 13.0, -4.0], [-26.0, -25.0, -15.0, 68.0, 82.0], [-29.0, 19.0, -18.0, -58.0, 55.0], [51.0, 27.0, 14.0, 34.0, -29.0]], [[-24.0, 51.0, 24.0, 30.0, -4.0], [21.0, -28.0, -39.0, 24.0, 62.0], [-24.0, 27.0, -28.0, -63.0, 61.0], [59.0, 21.0, -3.0, 30.0, 8.0]]], [[[-28.0, 77.0, -4.0, 54.0, -32.0], [21.0, -22.0, -53.0, 54.0, 64.0], [-4.0, 37.0, -26.0, -79.0, 91.0], [81.0, 27.0, 11.0, 60.0, -42.0]], [[0.0, 6.0, 56.0, 66.0, -56.0], [72.0, 31.0, -67.0, -81.0, -54.0], [70.0, 62.0, -49.0, -12.0, 56.0], [60.0, -45.0, 7.0, 58.0, 4.0]], [[19.0, -4.0, 16.0, -47.0, -25.0], [-32.0, -38.0, -59.0, 9.0, -14.0], [83.0, 59.0, 21.0, -48.0, -40.0], [-43.0, 20.0, 62.0, 36.0, -15.0]], [[12.0, -108.0, 10.0, 86.0, -57.0], [-17.0, 27.0, -97.0, -129.0, 32.0], [96.0, 77.0, -51.0, 25.0, 30.0], [77.0, -50.0, -9.0, 82.0, -6.0]], [[-21.0, 43.0, 42.0, -1.0, 29.0], [48.0, 11.0, 37.0, -9.0, -12.0], [-63.0, -19.0, -31.0, 1.0, 25.0], [18.0, -17.0, -24.0, -32.0, 56.0]]], [[[31.0, -62.0, 10.0, -3.0, -11.0], [3.0, 1.0, -23.0, -46.0, -41.0], [51.0, 1.0, 28.0, 27.0, -46.0], [-39.0, -2.0, -2.0, -5.0, 0.0]], [[-25.0, 74.0, 56.0, 71.0, -39.0], [82.0, -1.0, -65.0, -13.0, 7.0], [11.0, 52.0, -53.0, -67.0, 100.0], [91.0, -7.0, 0.0, 57.0, 3.0]], [[19.0, -57.0, -30.0, 9.0, 19.0], [-14.0, -6.0, 16.0, 0.0, 18.0], [-21.0, -51.0, 42.0, 37.0, -33.0], [-26.0, 24.0, -39.0, -34.0, -10.0]], [[9.0, -6.0, 48.0, 21.0, -15.0], [30.0, -39.0, -75.0, -21.0, 21.0], [33.0, 36.0, 3.0, -51.0, 12.0], [15.0, 27.0, 0.0, 27.0, 15.0]], [[5.0, -43.0, -44.0, 99.0, -50.0], [15.0, 46.0, -29.0, -41.0, 3.0], [37.0, 1.0, -13.0, 39.0, 53.0], [67.0, -25.0, -30.0, 45.0, -64.0]]], [[[-2.0, 19.0, 26.0, 8.0, -5.0], [16.0, -32.0, -42.0, 11.0, 27.0], [6.0, 21.0, 1.0, -47.0, 17.0], [14.0, 26.0, 4.0, 17.0, 6.0]], [[-26.0, 35.0, -2.0, -32.0, 62.0], [-8.0, -7.0, 75.0, 41.0, 43.0], [-110.0, -53.0, -9.0, 8.0, 1.0], [-3.0, 9.0, -31.0, -59.0, 49.0]], [[29.0, -37.0, 22.0, 69.0, -65.0], [48.0, -3.0, -100.0, -52.0, -33.0], [101.0, 44.0, 14.0, -20.0, 21.0], [24.0, 7.0, 3.0, 59.0, -44.0]], [[8.0, -43.0, 2.0, -92.0, 23.0], [-88.0, -17.0, 11.0, -16.0, 7.0], [30.0, 35.0, -2.0, 9.0, -79.0], [-62.0, -15.0, 49.0, -7.0, 38.0]], [[11.0, -90.0, -98.0, 9.0, 12.0], [-97.0, 10.0, 30.0, 12.0, 71.0], [-13.0, -41.0, 30.0, 62.0, -34.0], [-8.0, 9.0, -25.0, -9.0, -49.0]]]]),self.functionspace)
29005          self.failUnless(isinstance(res,Data),"wrong type of result.")
29006          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
29007          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29008       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29009       def test_tensor_mult_constData_rank4_expandedData_rank2(self):
29010          arg0=Data(numarray.array([[[[0.0, -5.0, -6.0], [3.0, 1.0, -4.0]], [[1.0, 7.0, -2.0], [0.0, 7.0, -4.0]], [[5.0, -6.0, -6.0], [-2.0, 1.0, 5.0]], [[1.0, 5.0, 6.0], [-4.0, -4.0, 0.0]], [[4.0, -7.0, 4.0], [-1.0, 3.0, 6.0]]], [[[2.0, 5.0, -1.0], [-6.0, 1.0, 2.0]], [[6.0, 2.0, 6.0], [5.0, 7.0, 4.0]], [[-7.0, 1.0, 6.0], [0.0, 6.0, 0.0]], [[-5.0, -3.0, 1.0], [7.0, 6.0, 2.0]], [[3.0, -3.0, -4.0], [-3.0, -7.0, -1.0]]], [[[-4.0, -4.0, 4.0], [0.0, -4.0, 0.0]], [[-2.0, 7.0, 4.0], [2.0, -7.0, -1.0]], [[2.0, 6.0, 1.0], [2.0, 0.0, 6.0]], [[-2.0, 0.0, -6.0], [1.0, 4.0, 3.0]], [[-6.0, 7.0, 6.0], [1.0, 3.0, -7.0]]], [[[-7.0, 0.0, 3.0], [-6.0, -5.0, -5.0]], [[-5.0, -5.0, 7.0], [-7.0, 6.0, -6.0]], [[-1.0, -3.0, 5.0], [-7.0, -6.0, -1.0]], [[7.0, 1.0, -2.0], [4.0, 0.0, 0.0]], [[-3.0, -4.0, 2.0], [-1.0, -3.0, 1.0]]]]),self.functionspace)
29011          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29012          arg1=msk_arg1*numarray.array([[-5.0, 1.0, -3.0], [5.0, 4.0, 4.0]])+(1.-msk_arg1)*numarray.array([[-1.0, 0.0, 7.0], [0.0, -5.0, -2.0]])
29013          res=tensor_mult(arg0,arg1)
29014          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29015          ref=msk_ref*numarray.array([[16.0, 20.0, 1.0, -54.0, -8.0], [-20.0, 23.0, 42.0, 86.0, -53.0], [-12.0, -17.0, 27.0, 61.0, 8.0], [-44.0, -36.0, -76.0, -8.0, -8.0]])+(1.-msk_ref)*numarray.array([[-39.0, -42.0, -62.0, 61.0, -3.0], [-18.0, -7.0, 19.0, -22.0, 6.0], [52.0, 67.0, -7.0, -66.0, 47.0], [63.0, 36.0, 68.0, -21.0, 30.0]])
29016          self.failUnless(isinstance(res,Data),"wrong type of result.")
29017          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29018          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29019       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29020       def test_tensor_mult_constData_rank4_expandedData_rank3(self):
29021          arg0=Data(numarray.array([[[[-2.0, 7.0, -3.0], [-5.0, -1.0, -4.0]], [[2.0, -2.0, 4.0], [-7.0, 2.0, -2.0]], [[-2.0, 0.0, 2.0], [-3.0, 5.0, 4.0]], [[0.0, 0.0, 2.0], [2.0, 0.0, -3.0]], [[6.0, 6.0, -6.0], [4.0, 6.0, -1.0]]], [[[-1.0, 0.0, 1.0], [-2.0, 7.0, 2.0]], [[-6.0, -3.0, 1.0], [0.0, 7.0, -5.0]], [[0.0, 2.0, -3.0], [0.0, -6.0, 3.0]], [[6.0, -3.0, 4.0], [2.0, -2.0, 3.0]], [[-6.0, -1.0, 1.0], [5.0, -3.0, -1.0]]], [[[5.0, -5.0, -1.0], [4.0, -5.0, -4.0]], [[-2.0, 4.0, 7.0], [-4.0, 0.0, 5.0]], [[5.0, 2.0, 1.0], [-7.0, -7.0, 2.0]], [[4.0, 6.0, 7.0], [-3.0, -1.0, -1.0]], [[2.0, 5.0, -4.0], [-7.0, 6.0, -6.0]]], [[[2.0, -4.0, -4.0], [-5.0, -7.0, 1.0]], [[-7.0, 3.0, 7.0], [-3.0, -6.0, 1.0]], [[-4.0, -7.0, -5.0], [-1.0, 1.0, 7.0]], [[-5.0, 4.0, 3.0], [-5.0, 1.0, 3.0]], [[6.0, -5.0, 0.0], [-1.0, -3.0, -6.0]]]]),self.functionspace)
29022          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29023          arg1=msk_arg1*numarray.array([[[-2.0, -2.0], [-7.0, -3.0], [-5.0, 3.0]], [[0.0, -7.0], [-1.0, -4.0], [5.0, 1.0]]])+(1.-msk_arg1)*numarray.array([[[0.0, -5.0], [0.0, -7.0], [-5.0, -1.0]], [[3.0, 3.0], [0.0, 3.0], [2.0, 2.0]]])
29024          res=tensor_mult(arg0,arg1)
29025          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29026          ref=msk_ref*numarray.array([[[-49.0, 9.0], [-22.0, 53.0], [9.0, 15.0], [-25.0, -11.0], [-35.0, -101.0]], [[0.0, -7.0], [-4.0, -9.0], [22.0, 12.0], [6.0, 6.0], [12.0, -6.0]], [[15.0, -10.0], [-34.0, 46.0], [-12.0, 66.0], [-89.0, 19.0], [-55.0, -12.0]], [[56.0, 60.0], [-31.0, 72.0], [116.0, 24.0], [-19.0, 41.0], [-4.0, 16.0]]])+(1.-msk_ref)*numarray.array([[[-8.0, -62.0], [-45.0, -19.0], [-11.0, 22.0], [-10.0, -2.0], [40.0, -38.0]], [[-7.0, 23.0], [-15.0, 61.0], [21.0, -23.0], [-8.0, -7.0], [8.0, 40.0]], [[9.0, 0.0], [-37.0, -27.0], [-22.0, -78.0], [-46.0, -83.0], [-13.0, -56.0]], [[7.0, -12.0], [-42.0, -18.0], [36.0, 88.0], [-24.0, -12.0], [-15.0, -19.0]]])
29027          self.failUnless(isinstance(res,Data),"wrong type of result.")
29028          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
29029          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29030       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29031       def test_tensor_mult_constData_rank4_expandedData_rank4(self):
29032          arg0=Data(numarray.array([[[[-2.0, 0.0, -7.0], [-6.0, 0.0, 3.0]], [[-7.0, 0.0, -4.0], [-6.0, 5.0, 3.0]], [[6.0, 5.0, -3.0], [-7.0, -3.0, -4.0]], [[7.0, 0.0, 3.0], [0.0, 4.0, 6.0]], [[-5.0, 0.0, -1.0], [0.0, 0.0, -6.0]]], [[[-5.0, 1.0, 7.0], [-1.0, 1.0, -6.0]], [[6.0, -6.0, 1.0], [6.0, -3.0, -6.0]], [[-7.0, 6.0, -6.0], [-3.0, 0.0, -6.0]], [[0.0, 0.0, 7.0], [2.0, 0.0, -3.0]], [[-4.0, -5.0, 4.0], [-7.0, 2.0, -4.0]]], [[[4.0, -1.0, 0.0], [-3.0, 2.0, -4.0]], [[3.0, -2.0, -7.0], [3.0, 2.0, 5.0]], [[-3.0, 7.0, 4.0], [5.0, 0.0, -1.0]], [[2.0, 6.0, 5.0], [0.0, -6.0, 1.0]], [[-4.0, 4.0, 2.0], [-1.0, -4.0, -3.0]]], [[[4.0, -5.0, 5.0], [-3.0, -7.0, -3.0]], [[-6.0, -7.0, 5.0], [-6.0, 7.0, 1.0]], [[-2.0, 1.0, -7.0], [0.0, 5.0, 0.0]], [[3.0, 2.0, 1.0], [0.0, -2.0, 1.0]], [[-1.0, -1.0, 5.0], [7.0, 1.0, 3.0]]]]),self.functionspace)
29033          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29034          arg1=msk_arg1*numarray.array([[[[-7.0, -4.0, -5.0, -6.0, -4.0], [0.0, 0.0, -5.0, 1.0, 6.0], [7.0, -1.0, -5.0, 4.0, 5.0], [-5.0, 5.0, 0.0, 1.0, -3.0]], [[3.0, 1.0, 3.0, 4.0, -5.0], [5.0, 7.0, -2.0, -1.0, 0.0], [-5.0, -3.0, -5.0, 6.0, 3.0], [6.0, -5.0, 0.0, -4.0, 0.0]], [[6.0, -1.0, -4.0, -6.0, 1.0], [-1.0, -3.0, 2.0, -7.0, -4.0], [0.0, -2.0, 7.0, 5.0, 1.0], [4.0, 0.0, 0.0, 6.0, 4.0]]], [[[6.0, -2.0, 7.0, 1.0, -1.0], [-7.0, -5.0, 3.0, 4.0, 0.0], [-7.0, 4.0, -4.0, 0.0, 0.0], [0.0, -6.0, -7.0, -2.0, 1.0]], [[0.0, 0.0, 2.0, 0.0, 2.0], [4.0, -5.0, 3.0, 2.0, 0.0], [1.0, -3.0, -4.0, -2.0, 2.0], [6.0, -3.0, 6.0, -7.0, 5.0]], [[-4.0, -2.0, -7.0, -4.0, -1.0], [-1.0, 5.0, 0.0, -2.0, -1.0], [4.0, 0.0, 4.0, 4.0, -5.0], [0.0, -1.0, 4.0, 1.0, 6.0]]]])+(1.-msk_arg1)*numarray.array([[[[-7.0, 7.0, 3.0, 3.0, -6.0], [2.0, 6.0, -4.0, 0.0, -4.0], [-7.0, 7.0, 2.0, 5.0, -3.0], [-6.0, 1.0, -3.0, -7.0, 5.0]], [[5.0, -5.0, 0.0, 5.0, -3.0], [-4.0, 5.0, 6.0, 4.0, -7.0], [-6.0, 3.0, 6.0, 5.0, 2.0], [-1.0, 3.0, -4.0, 5.0, 0.0]], [[0.0, 6.0, 0.0, -1.0, 6.0], [-6.0, -1.0, 2.0, -1.0, 6.0], [3.0, 1.0, 1.0, -1.0, 2.0], [-3.0, -2.0, -4.0, 1.0, 3.0]]], [[[4.0, -6.0, 2.0, 2.0, 7.0], [-4.0, -3.0, 7.0, -5.0, 1.0], [4.0, -7.0, 4.0, 5.0, -4.0], [3.0, 1.0, -5.0, -7.0, -6.0]], [[-7.0, -3.0, -6.0, -2.0, 1.0], [0.0, 0.0, 0.0, 2.0, -1.0], [5.0, 3.0, 7.0, 6.0, 1.0], [-6.0, 5.0, -5.0, -2.0, -2.0]], [[-2.0, -6.0, -5.0, -7.0, -5.0], [0.0, -2.0, -1.0, 6.0, 5.0], [6.0, -6.0, 0.0, 7.0, -2.0], [1.0, -5.0, 2.0, -5.0, -6.0]]]])
29035          res=tensor_mult(arg0,arg1)
29036          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29037          ref=msk_ref*numarray.array([[[[-76.0, 21.0, -25.0, 36.0, 4.0], [46.0, 66.0, -22.0, 17.0, 13.0], [40.0, -8.0, -3.0, -31.0, -32.0], [-18.0, 23.0, 54.0, -29.0, -10.0]], [[-23.0, 38.0, -2.0, 48.0, 37.0], [63.0, 32.0, 24.0, 1.0, -29.0], [10.0, -24.0, 23.0, -46.0, -44.0], [49.0, -17.0, 84.0, -51.0, 42.0]], [[-71.0, 6.0, -30.0, 11.0, -47.0], [69.0, 74.0, -76.0, -4.0, 52.0], [47.0, -34.0, -52.0, 29.0, 56.0], [-30.0, 60.0, 15.0, -1.0, -76.0]], [[-55.0, -43.0, -81.0, -84.0, -23.0], [7.0, 1.0, -17.0, -18.0, 24.0], [77.0, -25.0, -6.0, 59.0, 16.0], [1.0, 17.0, 48.0, 3.0, 47.0]], [[53.0, 33.0, 71.0, 60.0, 25.0], [7.0, -27.0, 23.0, 14.0, -20.0], [-59.0, 7.0, -6.0, -49.0, 4.0], [21.0, -19.0, -24.0, -17.0, -25.0]]], [[[98.0, 28.0, 37.0, 15.0, 31.0], [15.0, -44.0, 37.0, -45.0, -52.0], [-56.0, -19.0, 45.0, -5.0, 17.0], [65.0, -21.0, -11.0, 22.0, 11.0]], [[6.0, -31.0, 26.0, -36.0, 1.0], [-79.0, -90.0, -7.0, 35.0, 38.0], [3.0, 43.0, -29.0, -25.0, 37.0], [-80.0, 39.0, -84.0, 39.0, -59.0]], [[37.0, 58.0, 98.0, 123.0, 1.0], [63.0, 45.0, 2.0, 29.0, -12.0], [-82.0, -11.0, -49.0, -46.0, 7.0], [47.0, -41.0, -3.0, -67.0, -42.0]], [[66.0, -5.0, 7.0, -28.0, 8.0], [-18.0, -46.0, 20.0, -35.0, -25.0], [-26.0, -6.0, 29.0, 23.0, 22.0], [28.0, -9.0, -26.0, 35.0, 12.0]], [[11.0, 29.0, -28.0, -11.0, 60.0], [32.0, -42.0, 23.0, -43.0, -36.0], [32.0, -23.0, 77.0, -46.0, -7.0], [18.0, 45.0, 45.0, 36.0, 7.0]]], [[[-33.0, -3.0, -12.0, -15.0, 0.0], [28.0, -22.0, -21.0, 5.0, 28.0], [40.0, -19.0, -27.0, -10.0, 41.0], [-14.0, 41.0, 17.0, -4.0, -29.0]], [[-71.0, -23.0, -3.0, -1.0, -13.0], [-21.0, 7.0, -10.0, 60.0, 41.0], [32.0, 23.0, -54.0, -19.0, -19.0], [-43.0, -4.0, 11.0, -46.0, 6.0]], [[100.0, 7.0, 62.0, 31.0, -23.0], [-3.0, 7.0, 24.0, -16.0, -33.0], [-95.0, -6.0, -16.0, 46.0, 15.0], [73.0, -79.0, -39.0, -18.0, 24.0]], [[30.0, -9.0, -31.0, -22.0, -46.0], [0.0, 62.0, -30.0, -53.0, -9.0], [-18.0, -12.0, 23.0, 85.0, 16.0], [10.0, -3.0, -32.0, 51.0, -10.0]], [[58.0, 26.0, 30.0, 39.0, -6.0], [12.0, 32.0, 1.0, -28.0, -29.0], [-57.0, -4.0, 22.0, 14.0, 1.0], [28.0, -19.0, -29.0, 19.0, -19.0]]], [[[-19.0, -14.0, -69.0, -65.0, 6.0], [-34.0, -15.0, -30.0, -46.0, 7.0], [55.0, 10.0, 68.0, 13.0, 11.0], [-72.0, 87.0, -33.0, 106.0, -48.0]], [[11.0, 22.0, -46.0, -32.0, 83.0], [29.0, -64.0, 57.0, -46.0, -57.0], [46.0, -28.0, 100.0, -51.0, -37.0], [50.0, 19.0, 88.0, 16.0, 73.0]], [[-25.0, 16.0, 51.0, 58.0, 6.0], [32.0, 3.0, 9.0, 56.0, 16.0], [-14.0, -2.0, -64.0, -47.0, -4.0], [18.0, -30.0, 30.0, -83.0, 3.0]], [[-13.0, -13.0, -24.0, -20.0, -26.0], [0.0, 26.0, -23.0, -12.0, 13.0], [13.0, -5.0, -6.0, 37.0, 13.0], [-11.0, 10.0, -8.0, 16.0, -9.0]], [[64.0, -22.0, 12.0, -33.0, 6.0], [-58.0, -47.0, 41.0, -11.0, -29.0], [-38.0, 19.0, 25.0, 25.0, -16.0], [25.0, -48.0, -31.0, 15.0, 53.0]]]])+(1.-msk_ref)*numarray.array([[[[-16.0, -38.0, -33.0, -32.0, -87.0], [62.0, 7.0, -51.0, 55.0, -25.0], [-13.0, 3.0, -35.0, -12.0, 10.0], [18.0, -9.0, 70.0, 34.0, -13.0]], [[-16.0, -70.0, -78.0, -60.0, -34.0], [34.0, -26.0, -25.0, 62.0, 8.0], [56.0, -14.0, -7.0, -10.0, 36.0], [9.0, 5.0, 48.0, 62.0, -39.0]], [[-16.0, 74.0, 42.0, 66.0, -101.0], [38.0, 93.0, -45.0, 28.0, -101.0], [-148.0, 118.0, -10.0, -23.0, 19.0], [-39.0, 25.0, 16.0, 55.0, 93.0]], [[-89.0, 19.0, -33.0, -32.0, -50.0], [-4.0, 27.0, -28.0, 41.0, 16.0], [16.0, 28.0, 45.0, 98.0, -23.0], [-69.0, -9.0, -41.0, -84.0, 0.0]], [[47.0, -5.0, 15.0, 28.0, 54.0], [-4.0, -17.0, 24.0, -35.0, -16.0], [-4.0, 0.0, -11.0, -66.0, 25.0], [27.0, 27.0, 7.0, 64.0, 8.0]]], [[[41.0, 41.0, 7.0, 21.0, 93.0], [-52.0, -17.0, 39.0, -32.0, 23.0], [15.0, 21.0, 6.0, -68.0, 48.0], [-7.0, 18.0, -29.0, 82.0, 36.0]], [[-15.0, 87.0, 78.0, 47.0, 57.0], [6.0, -1.0, -10.0, -97.0, 3.0], [-30.0, 10.0, -20.0, -31.0, -43.0], [-3.0, 7.0, -25.0, -77.0, 39.0]], [[79.0, -61.0, 3.0, 51.0, -3.0], [10.0, 15.0, 37.0, 9.0, -83.0], [-53.0, 20.0, 4.0, -56.0, 45.0], [39.0, 50.0, 24.0, 124.0, 1.0]], [[14.0, 48.0, 19.0, 18.0, 71.0], [-50.0, -7.0, 31.0, -35.0, 29.0], [11.0, 11.0, 15.0, -18.0, 12.0], [-18.0, 3.0, -44.0, 8.0, 27.0]], [[-31.0, 81.0, -18.0, -31.0, 36.0], [16.0, -24.0, -51.0, -9.0, 46.0], [28.0, 40.0, -48.0, -100.0, 48.0], [-20.0, -4.0, 33.0, 72.0, 54.0]]], [[[-51.0, 69.0, 14.0, 25.0, -20.0], [24.0, 36.0, -39.0, -9.0, -34.0], [-48.0, 76.0, 4.0, -16.0, 8.0], [-48.0, 28.0, -11.0, 4.0, 58.0]], [[-43.0, -65.0, -22.0, -27.0, -56.0], [44.0, -4.0, -22.0, 18.0, -14.0], [22.0, -37.0, 13.0, 74.0, -47.0], [7.0, -1.0, 12.0, -88.0, -58.0]], [[78.0, -56.0, 6.0, 39.0, 61.0], [-78.0, 0.0, 98.0, -7.0, -13.0], [5.0, -25.0, 60.0, 34.0, 13.0], [13.0, 20.0, -62.0, 30.0, -27.0]], [[56.0, 26.0, 37.0, 36.0, -11.0], [-50.0, 35.0, 37.0, 13.0, -9.0], [-59.0, 13.0, 3.0, 6.0, 8.0], [4.0, -25.0, -18.0, 28.0, 31.0]], [[78.0, 0.0, 25.0, 33.0, 28.0], [-32.0, 3.0, 40.0, -7.0, -12.0], [-32.0, -1.0, -14.0, -52.0, 30.0], [32.0, -2.0, 7.0, 80.0, 18.0]]], [[[-10.0, 140.0, 63.0, 11.0, 8.0], [10.0, 9.0, -54.0, -42.0, 38.0], [-48.0, 36.0, -78.0, -88.0, -1.0], [-4.0, -44.0, 32.0, 2.0, 85.0]], [[-68.0, 32.0, -77.0, -91.0, 47.0], [10.0, -60.0, -51.0, 17.0, 95.0], [116.0, -1.0, -24.0, -51.0, 43.0], [-31.0, -13.0, 23.0, 35.0, 1.0]], [[-16.0, -76.0, -36.0, -4.0, -28.0], [34.0, 0.0, 0.0, 21.0, -46.0], [12.0, -3.0, 30.0, 32.0, -1.0], [2.0, 40.0, 5.0, 2.0, -41.0]], [[1.0, 17.0, 16.0, 15.0, -25.0], [-8.0, 25.0, 1.0, 9.0, -13.0], [-34.0, 16.0, 5.0, 19.0, -7.0], [-10.0, -8.0, -9.0, -11.0, 16.0]], [[17.0, -35.0, -10.0, -22.0, 74.0], [-56.0, -43.0, 54.0, -24.0, 62.0], [79.0, -69.0, 32.0, 47.0, -22.0], [10.0, -17.0, -47.0, -59.0, -52.0]]]])
29038          self.failUnless(isinstance(res,Data),"wrong type of result.")
29039          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
29040          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29041       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29042       def test_tensor_mult_expandedData_rank2_array_rank1(self):
29043          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29044          arg0=msk_arg0*numarray.array([[-4.0, 1.0, 0.0], [7.0, 7.0, -2.0]])+(1.-msk_arg0)*numarray.array([[-4.0, 3.0, -1.0], [0.0, -5.0, -2.0]])
29045          arg1=numarray.array([-1.0, 5.0, 0.0])
29046          res=tensor_mult(arg0,arg1)
29047          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29048          ref=msk_ref*numarray.array([9.0, 28.0])+(1.-msk_ref)*numarray.array([19.0, -25.0])
29049          self.failUnless(isinstance(res,Data),"wrong type of result.")
29050          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29051          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29052       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29053       def test_tensor_mult_expandedData_rank2_array_rank2(self):
29054          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29055          arg0=msk_arg0*numarray.array([[-6.0, -5.0, 5.0], [7.0, -2.0, 0.0]])+(1.-msk_arg0)*numarray.array([[1.0, -2.0, -1.0], [6.0, 2.0, 0.0]])
29056          arg1=numarray.array([[1.0, 6.0], [-5.0, 3.0], [0.0, 6.0]])
29057          res=tensor_mult(arg0,arg1)
29058          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29059          ref=msk_ref*numarray.array([[19.0, -21.0], [17.0, 36.0]])+(1.-msk_ref)*numarray.array([[11.0, -6.0], [-4.0, 42.0]])
29060          self.failUnless(isinstance(res,Data),"wrong type of result.")
29061          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
29062          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29063       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29064       def test_tensor_mult_expandedData_rank2_Symbol_rank1(self):
29065          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29066          arg0=msk_arg0*numarray.array([[6.0, 6.0, -2.0], [-1.0, -6.0, -1.0]])+(1.-msk_arg0)*numarray.array([[1.0, -7.0, -1.0], [7.0, 3.0, -7.0]])
29067          arg1=Symbol(shape=(3,))
29068          res=tensor_mult(arg0,arg1)
29069          s1=numarray.array([-3.0, 0.0, 5.0])
29070          sub=res.substitute({arg1:s1})
29071          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29072          ref=msk_ref*numarray.array([-28.0, -2.0])+(1.-msk_ref)*numarray.array([-8.0, -56.0])
29073          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29074          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29075          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29076       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29077       def test_tensor_mult_expandedData_rank2_Symbol_rank2(self):
29078          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29079          arg0=msk_arg0*numarray.array([[0.0, -2.0, -6.0], [-2.0, 0.0, 1.0]])+(1.-msk_arg0)*numarray.array([[-6.0, 7.0, 1.0], [-7.0, -2.0, -1.0]])
29080          arg1=Symbol(shape=(3, 2))
29081          res=tensor_mult(arg0,arg1)
29082          s1=numarray.array([[-1.0, 7.0], [-1.0, 0.0], [-5.0, 1.0]])
29083          sub=res.substitute({arg1:s1})
29084          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29085          ref=msk_ref*numarray.array([[32.0, -6.0], [-3.0, -13.0]])+(1.-msk_ref)*numarray.array([[-6.0, -41.0], [14.0, -50.0]])
29086          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29087          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
29088          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29089       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29090       def test_tensor_mult_expandedData_rank2_constData_rank1(self):
29091          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29092          arg0=msk_arg0*numarray.array([[2.0, -5.0, 5.0], [-4.0, -7.0, 6.0]])+(1.-msk_arg0)*numarray.array([[5.0, -2.0, -3.0], [5.0, -4.0, -6.0]])
29093          arg1=Data(numarray.array([2.0, 1.0, 6.0]),self.functionspace)
29094          res=tensor_mult(arg0,arg1)
29095          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29096          ref=msk_ref*numarray.array([29.0, 21.0])+(1.-msk_ref)*numarray.array([-10.0, -30.0])
29097          self.failUnless(isinstance(res,Data),"wrong type of result.")
29098          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29099          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29100       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29101       def test_tensor_mult_expandedData_rank2_constData_rank2(self):
29102          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29103          arg0=msk_arg0*numarray.array([[-4.0, 1.0, -7.0], [-1.0, -4.0, 3.0]])+(1.-msk_arg0)*numarray.array([[0.0, -2.0, -4.0], [5.0, -5.0, -3.0]])
29104          arg1=Data(numarray.array([[5.0, -6.0], [-7.0, 5.0], [0.0, 0.0]]),self.functionspace)
29105          res=tensor_mult(arg0,arg1)
29106          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29107          ref=msk_ref*numarray.array([[-27.0, 29.0], [23.0, -14.0]])+(1.-msk_ref)*numarray.array([[14.0, -10.0], [60.0, -55.0]])
29108          self.failUnless(isinstance(res,Data),"wrong type of result.")
29109          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
29110          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29111       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29112       def test_tensor_mult_expandedData_rank2_expandedData_rank1(self):
29113          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29114          arg0=msk_arg0*numarray.array([[4.0, 0.0, 2.0], [2.0, 2.0, 5.0]])+(1.-msk_arg0)*numarray.array([[5.0, 2.0, 3.0], [5.0, 5.0, 7.0]])
29115          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29116          arg1=msk_arg1*numarray.array([1.0, 0.0, 6.0])+(1.-msk_arg1)*numarray.array([-2.0, -2.0, 1.0])
29117          res=tensor_mult(arg0,arg1)
29118          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29119          ref=msk_ref*numarray.array([16.0, 32.0])+(1.-msk_ref)*numarray.array([-11.0, -13.0])
29120          self.failUnless(isinstance(res,Data),"wrong type of result.")
29121          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29122          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29123       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29124       def test_tensor_mult_expandedData_rank2_expandedData_rank2(self):
29125          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29126          arg0=msk_arg0*numarray.array([[4.0, -4.0, -6.0], [2.0, 0.0, -5.0]])+(1.-msk_arg0)*numarray.array([[-6.0, -6.0, -3.0], [-7.0, -2.0, -2.0]])
29127          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29128          arg1=msk_arg1*numarray.array([[2.0, 2.0], [0.0, 4.0], [3.0, -2.0]])+(1.-msk_arg1)*numarray.array([[2.0, 1.0], [-7.0, 1.0], [-7.0, 5.0]])
29129          res=tensor_mult(arg0,arg1)
29130          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29131          ref=msk_ref*numarray.array([[-10.0, 4.0], [-11.0, 14.0]])+(1.-msk_ref)*numarray.array([[51.0, -27.0], [14.0, -19.0]])
29132          self.failUnless(isinstance(res,Data),"wrong type of result.")
29133          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
29134          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29135       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29136       def test_tensor_mult_expandedData_rank4_array_rank2(self):
29137          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29138          arg0=msk_arg0*numarray.array([[[[-7.0, -7.0, 3.0], [7.0, -2.0, -6.0]], [[0.0, -1.0, -7.0], [4.0, 1.0, 7.0]], [[0.0, -7.0, 5.0], [-5.0, 0.0, 3.0]], [[-6.0, 4.0, -6.0], [4.0, -6.0, 0.0]], [[-2.0, 6.0, 0.0], [1.0, 0.0, -7.0]]], [[[1.0, -1.0, 1.0], [3.0, -2.0, 6.0]], [[-5.0, 1.0, -3.0], [0.0, -6.0, 5.0]], [[2.0, 4.0, -4.0], [-7.0, -5.0, 0.0]], [[6.0, 1.0, -5.0], [6.0, -4.0, 3.0]], [[-1.0, -7.0, 7.0], [-3.0, 1.0, 4.0]]], [[[-7.0, -6.0, 3.0], [-2.0, -4.0, 0.0]], [[4.0, -5.0, -6.0], [3.0, -2.0, 0.0]], [[2.0, 3.0, -7.0], [5.0, 0.0, 7.0]], [[-2.0, -6.0, 6.0], [-4.0, 6.0, -2.0]], [[7.0, 0.0, -5.0], [-4.0, 3.0, 1.0]]], [[[1.0, -3.0, -4.0], [2.0, 2.0, -1.0]], [[5.0, 5.0, 1.0], [7.0, 0.0, 7.0]], [[-2.0, 7.0, -7.0], [-7.0, 3.0, 3.0]], [[0.0, -3.0, 1.0], [3.0, 2.0, -2.0]], [[-1.0, 5.0, -3.0], [7.0, -4.0, 2.0]]]])+(1.-msk_arg0)*numarray.array([[[[-5.0, -7.0, -2.0], [0.0, -4.0, 4.0]], [[2.0, 6.0, -5.0], [0.0, 0.0, 2.0]], [[4.0, 0.0, 0.0], [0.0, 7.0, -1.0]], [[-1.0, 5.0, 5.0], [-6.0, -1.0, 4.0]], [[0.0, -7.0, -4.0], [2.0, -7.0, -6.0]]], [[[0.0, 5.0, 0.0], [-1.0, 6.0, 3.0]], [[4.0, -6.0, -4.0], [3.0, 2.0, 3.0]], [[2.0, 0.0, 2.0], [1.0, 2.0, 4.0]], [[4.0, -3.0, -3.0], [6.0, -6.0, -7.0]], [[2.0, -3.0, 1.0], [2.0, -6.0, 7.0]]], [[[6.0, 0.0, 6.0], [-2.0, 0.0, -3.0]], [[3.0, 5.0, -5.0], [6.0, 0.0, -4.0]], [[5.0, 1.0, 1.0], [-2.0, 5.0, -4.0]], [[-2.0, -5.0, 0.0], [5.0, -6.0, 7.0]], [[-1.0, 2.0, -5.0], [6.0, 4.0, 0.0]]], [[[4.0, 7.0, 6.0], [-3.0, 1.0, 7.0]], [[5.0, 0.0, 7.0], [-1.0, 5.0, 0.0]], [[-6.0, -1.0, 7.0], [-7.0, -4.0, 0.0]], [[2.0, 3.0, 2.0], [3.0, 3.0, -1.0]], [[7.0, 3.0, 7.0], [-7.0, 1.0, 0.0]]]])
29139          arg1=numarray.array([[1.0, -7.0, -1.0], [3.0, 1.0, -6.0]])
29140          res=tensor_mult(arg0,arg1)
29141          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29142          ref=msk_ref*numarray.array([[94.0, -15.0, 11.0, -22.0, 1.0], [-22.0, -45.0, -48.0, 0.0, 9.0], [22.0, 52.0, -39.0, 40.0, -3.0], [40.0, -52.0, -80.0, 43.0, -28.0]])+(1.-msk_ref)*numarray.array([[18.0, -47.0, 17.0, -84.0, 88.0], [-50.0, 43.0, -19.0, 82.0, -20.0], [12.0, 15.0, 20.0, 0.0, 12.0], [-101.0, 0.0, -31.0, -3.0, -41.0]])
29143          self.failUnless(isinstance(res,Data),"wrong type of result.")
29144          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29145          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29146       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29147       def test_tensor_mult_expandedData_rank4_array_rank3(self):
29148          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29149          arg0=msk_arg0*numarray.array([[[[3.0, 5.0, 6.0], [5.0, -2.0, 0.0]], [[-6.0, -5.0, 1.0], [4.0, -1.0, 3.0]], [[6.0, -3.0, -7.0], [7.0, 3.0, 7.0]], [[0.0, 0.0, 2.0], [-5.0, -4.0, 7.0]], [[-5.0, 3.0, -1.0], [1.0, 0.0, -5.0]]], [[[0.0, -6.0, 0.0], [-2.0, 4.0, -1.0]], [[4.0, -4.0, 3.0], [-1.0, 3.0, -6.0]], [[-1.0, 5.0, 3.0], [5.0, -4.0, -1.0]], [[7.0, -6.0, 2.0], [6.0, -1.0, 4.0]], [[0.0, -1.0, -2.0], [-4.0, -4.0, 0.0]]], [[[-2.0, 5.0, -2.0], [-1.0, 6.0, -7.0]], [[-7.0, 0.0, -1.0], [4.0, 3.0, -3.0]], [[-1.0, 2.0, 7.0], [6.0, -7.0, 3.0]], [[1.0, 7.0, -5.0], [5.0, 7.0, -1.0]], [[1.0, 3.0, -3.0], [-7.0, -2.0, 1.0]]], [[[6.0, 4.0, 0.0], [1.0, 5.0, 5.0]], [[-2.0, -1.0, -5.0], [-4.0, 5.0, 3.0]], [[7.0, 0.0, 0.0], [3.0, -6.0, -6.0]], [[4.0, 0.0, 4.0], [-4.0, -6.0, 0.0]], [[1.0, 0.0, -4.0], [-3.0, 5.0, -4.0]]]])+(1.-msk_arg0)*numarray.array([[[[0.0, -7.0, 5.0], [-4.0, 6.0, -3.0]], [[5.0, -5.0, -4.0], [6.0, -7.0, -3.0]], [[7.0, 2.0, 0.0], [0.0, -3.0, 2.0]], [[0.0, -1.0, 7.0], [4.0, 0.0, 3.0]], [[-4.0, -2.0, -6.0], [7.0, -1.0, -7.0]]], [[[-4.0, -4.0, 1.0], [-5.0, -3.0, -1.0]], [[-1.0, 6.0, -6.0], [5.0, 5.0, 1.0]], [[6.0, 4.0, -1.0], [-1.0, 3.0, 5.0]], [[-6.0, -6.0, -5.0], [0.0, 0.0, -3.0]], [[4.0, -4.0, -1.0], [0.0, -5.0, 0.0]]], [[[-5.0, 2.0, 6.0], [5.0, -4.0, 2.0]], [[6.0, -3.0, 2.0], [4.0, 1.0, 6.0]], [[-6.0, -4.0, 5.0], [-5.0, 7.0, 2.0]], [[2.0, 4.0, -7.0], [6.0, 1.0, 5.0]], [[-6.0, 5.0, -6.0], [3.0, 4.0, -6.0]]], [[[-3.0, -6.0, -6.0], [-3.0, -6.0, 0.0]], [[-2.0, -5.0, -6.0], [-4.0, -1.0, 5.0]], [[3.0, 5.0, 3.0], [-3.0, 3.0, 7.0]], [[6.0, 3.0, -6.0], [-4.0, 7.0, 3.0]], [[-6.0, 5.0, 5.0], [0.0, -5.0, 5.0]]]])
29150          arg1=numarray.array([[[7.0, -4.0], [5.0, 2.0], [-6.0, 7.0]], [[5.0, -2.0], [-3.0, 7.0], [-5.0, 0.0]]])
29151          res=tensor_mult(arg0,arg1)
29152          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29153          ref=msk_ref*numarray.array([[[41.0, 16.0], [-65.0, 6.0], [60.0, -72.0], [-60.0, -4.0], [16.0, 17.0]], [[-47.0, 20.0], [6.0, 20.0], [42.0, -3.0], [20.0, -45.0], [-1.0, -36.0]], [[35.0, 48.0], [-17.0, 34.0], [-3.0, -4.0], [81.0, 14.0], [6.0, -19.0]], [[27.0, 17.0], [-39.0, 14.0], [112.0, -76.0], [2.0, -22.0], [21.0, 9.0]]])+(1.-msk_ref)*numarray.array([[[-88.0, 71.0], [100.0, -119.0], [58.0, -45.0], [-42.0, 39.0], [71.0, -51.0]], [[-65.0, 4.0], [64.0, -1.0], [29.0, 0.0], [-27.0, -23.0], [29.0, -66.0]], [[-34.0, 28.0], [2.0, -17.0], [-148.0, 110.0], [78.0, -54.0], [52.0, 14.0]], [[-12.0, -78.0], [-45.0, -43.0], [-31.0, 46.0], [37.0, -3.0], [-57.0, 34.0]]])
29154          self.failUnless(isinstance(res,Data),"wrong type of result.")
29155          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
29156          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29157       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29158       def test_tensor_mult_expandedData_rank4_array_rank4(self):
29159          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29160          arg0=msk_arg0*numarray.array([[[[-3.0, -1.0, -5.0], [6.0, 0.0, -3.0]], [[4.0, -2.0, -2.0], [3.0, -1.0, -4.0]], [[5.0, 3.0, 7.0], [-4.0, 2.0, 1.0]], [[3.0, 4.0, 0.0], [7.0, -6.0, -6.0]], [[-4.0, -5.0, 7.0], [-5.0, -3.0, -3.0]]], [[[7.0, -4.0, 0.0], [-2.0, 2.0, 0.0]], [[1.0, -5.0, 0.0], [0.0, -4.0, -6.0]], [[-6.0, 3.0, 7.0], [3.0, -4.0, 5.0]], [[-1.0, 2.0, -1.0], [1.0, 0.0, -2.0]], [[1.0, -2.0, 6.0], [-2.0, 6.0, 7.0]]], [[[2.0, 6.0, 7.0], [-4.0, 3.0, -6.0]], [[-7.0, -3.0, 0.0], [-4.0, -5.0, -2.0]], [[1.0, 7.0, -7.0], [-2.0, -1.0, 7.0]], [[4.0, 2.0, 6.0], [-3.0, 1.0, 7.0]], [[7.0, 0.0, -3.0], [0.0, -5.0, -3.0]]], [[[3.0, -6.0, -3.0], [-6.0, 6.0, 0.0]], [[0.0, -2.0, -7.0], [-1.0, 0.0, 5.0]], [[-3.0, -2.0, -5.0], [7.0, 3.0, -7.0]], [[-2.0, -3.0, -2.0], [-3.0, 0.0, -2.0]], [[-1.0, -5.0, 2.0], [3.0, -3.0, 6.0]]]])+(1.-msk_arg0)*numarray.array([[[[0.0, 1.0, 0.0], [-7.0, -1.0, -1.0]], [[-2.0, 3.0, 0.0], [-4.0, 6.0, -4.0]], [[-5.0, 6.0, -5.0], [-4.0, 0.0, 0.0]], [[5.0, 1.0, -7.0], [7.0, -5.0, 3.0]], [[5.0, 2.0, 5.0], [-1.0, 4.0, 0.0]]], [[[-1.0, 4.0, -4.0], [-5.0, -1.0, 2.0]], [[0.0, 6.0, 4.0], [0.0, -6.0, -2.0]], [[-5.0, 5.0, -7.0], [-3.0, -4.0, -7.0]], [[-6.0, -6.0, 0.0], [0.0, 5.0, 4.0]], [[-6.0, 6.0, 0.0], [5.0, -4.0, -3.0]]], [[[0.0, 3.0, -3.0], [-3.0, -1.0, 1.0]], [[-3.0, -2.0, -7.0], [7.0, 4.0, -2.0]], [[0.0, 2.0, -1.0], [-6.0, 7.0, -6.0]], [[0.0, -3.0, -4.0], [-7.0, -6.0, -4.0]], [[-2.0, -2.0, 0.0], [0.0, -5.0, -7.0]]], [[[5.0, 6.0, -4.0], [4.0, 2.0, 5.0]], [[6.0, 3.0, 5.0], [-1.0, 7.0, -4.0]], [[4.0, -1.0, -5.0], [0.0, 7.0, 0.0]], [[-3.0, -1.0, -2.0], [6.0, -3.0, -2.0]], [[0.0, -2.0, 6.0], [-1.0, 5.0, 7.0]]]])
29161          arg1=numarray.array([[[[-3.0, -3.0, 7.0, 4.0, -1.0], [7.0, -1.0, -4.0, -7.0, -3.0], [3.0, -3.0, -1.0, -6.0, 2.0], [-4.0, -6.0, 3.0, 3.0, 7.0]], [[7.0, -4.0, 4.0, 6.0, 2.0], [0.0, -3.0, 0.0, -2.0, -1.0], [0.0, -6.0, 7.0, -7.0, 7.0], [-1.0, 6.0, -1.0, 4.0, 0.0]], [[-1.0, -7.0, 2.0, 2.0, -2.0], [6.0, -6.0, -4.0, -6.0, 4.0], [-6.0, -5.0, -2.0, 7.0, -1.0], [6.0, 0.0, 3.0, -4.0, -6.0]]], [[[1.0, 0.0, -2.0, 6.0, -7.0], [6.0, -4.0, -6.0, 4.0, -1.0], [-7.0, 0.0, -7.0, 6.0, 1.0], [1.0, -5.0, 2.0, 1.0, 0.0]], [[2.0, -6.0, -5.0, 0.0, -4.0], [0.0, 2.0, -6.0, -6.0, -7.0], [5.0, 6.0, 4.0, 7.0, -7.0], [1.0, 7.0, 1.0, 1.0, -7.0]], [[-4.0, -6.0, -5.0, -5.0, 3.0], [-6.0, 3.0, 4.0, 0.0, 7.0], [7.0, 4.0, 0.0, 6.0, 5.0], [0.0, -2.0, 0.0, 0.0, -7.0]]]])
29162          res=tensor_mult(arg0,arg1)
29163          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29164          ref=msk_ref*numarray.array([[[[25.0, 66.0, -32.0, 23.0, -40.0], [3.0, 3.0, -16.0, 77.0, -37.0], [-42.0, 28.0, -36.0, 8.0, -17.0], [-11.0, -12.0, -11.0, 13.0, 30.0]], [[-7.0, 40.0, 35.0, 38.0, -33.0], [58.0, -12.0, -36.0, 6.0, -42.0], [-30.0, -12.0, -39.0, -37.0, -14.0], [-24.0, -50.0, 13.0, 14.0, 75.0]], [[-5.0, -94.0, 54.0, 23.0, 10.0], [47.0, -33.0, -32.0, -111.0, 7.0], [18.0, -52.0, 38.0, -6.0, 11.0], [17.0, 20.0, 27.0, -3.0, -28.0]], [[38.0, 47.0, 83.0, 108.0, -38.0], [99.0, -73.0, -42.0, 35.0, -20.0], [-112.0, -93.0, -48.0, -82.0, 53.0], [-15.0, -59.0, 13.0, 26.0, 105.0]], [[-29.0, 19.0, 6.0, -47.0, 18.0], [2.0, -18.0, 24.0, -6.0, 50.0], [-55.0, -23.0, -22.0, 39.0, -49.0], [55.0, 4.0, 1.0, -68.0, -28.0]]], [[[-47.0, -17.0, 27.0, -8.0, -9.0], [37.0, 17.0, -28.0, -61.0, -29.0], [45.0, 15.0, -13.0, -12.0, -30.0], [-24.0, -42.0, 23.0, 5.0, 35.0]], [[-22.0, 77.0, 37.0, 4.0, -13.0], [43.0, -12.0, -4.0, 27.0, -12.0], [-59.0, -21.0, -52.0, -35.0, -35.0], [-3.0, -52.0, 4.0, -21.0, 77.0]], [[7.0, -49.0, -27.0, 1.0, 8.0], [-12.0, -50.0, 22.0, 30.0, 103.0], [-66.0, -39.0, -24.0, 84.0, 58.0], [62.0, 1.0, 2.0, -35.0, -91.0]], [[27.0, 14.0, 7.0, 22.0, -6.0], [5.0, -9.0, -6.0, 13.0, -18.0], [-18.0, -12.0, 10.0, -21.0, 4.0], [-3.0, 17.0, -6.0, 10.0, 13.0]], [[-41.0, -115.0, -50.0, -43.0, -6.0], [-11.0, 10.0, -24.0, -83.0, 32.0], [60.0, 43.0, 11.0, 122.0, -27.0], [38.0, 20.0, 25.0, -25.0, -120.0]]], [[[55.0, -61.0, 75.0, 64.0, -6.0], [68.0, -58.0, -54.0, -102.0, -43.0], [-35.0, -83.0, 66.0, -44.0, -16.0], [27.0, 77.0, 16.0, 1.0, -7.0]], [[-6.0, 75.0, -18.0, -60.0, 43.0], [-61.0, 16.0, 74.0, 69.0, 49.0], [-32.0, 1.0, -6.0, -8.0, -14.0], [22.0, 13.0, -31.0, -42.0, 0.0]], [[21.0, -18.0, -5.0, -15.0, 66.0], [-89.0, 47.0, 70.0, 19.0, 20.0], [103.0, 12.0, 72.0, -81.0, 98.0], [-56.0, 25.0, -30.0, 56.0, 7.0]], [[-33.0, -110.0, 14.0, -13.0, 26.0], [4.0, -11.0, 0.0, -86.0, 55.0], [51.0, -20.0, 23.0, 35.0, 41.0], [16.0, -4.0, 23.0, -6.0, -64.0]], [[-16.0, 48.0, 83.0, 37.0, 10.0], [49.0, -8.0, 2.0, -1.0, -19.0], [-7.0, -48.0, -21.0, -116.0, 37.0], [-51.0, -71.0, 7.0, 28.0, 123.0]]], [[[-42.0, 0.0, -27.0, -66.0, 9.0], [-33.0, 69.0, 0.0, -51.0, -51.0], [99.0, 78.0, 27.0, 9.0, -81.0], [-24.0, 18.0, 0.0, -3.0, -3.0]], [[-28.0, 27.0, -45.0, -57.0, 32.0], [-78.0, 67.0, 54.0, 42.0, 10.0], [84.0, 67.0, 7.0, -11.0, 17.0], [-41.0, -17.0, -21.0, 19.0, 7.0]], [[41.0, 76.0, -33.0, 43.0, -73.0], [33.0, -4.0, -56.0, 65.0, -86.0], [-62.0, 36.0, -38.0, 18.0, -64.0], [-6.0, 6.0, -5.0, 13.0, 37.0]], [[-8.0, 44.0, -14.0, -38.0, 15.0], [-32.0, 29.0, 26.0, 20.0, -10.0], [13.0, 26.0, 6.0, -11.0, -36.0], [-4.0, 13.0, -15.0, -13.0, 12.0]], [[-61.0, -9.0, -44.0, -42.0, -4.0], [-13.0, 4.0, 20.0, 35.0, 76.0], [-9.0, 29.0, -71.0, 88.0, 15.0], [21.0, -72.0, 11.0, -31.0, -40.0]]]])+(1.-msk_ref)*numarray.array([[[[2.0, 8.0, 28.0, -31.0, 52.0], [-36.0, 20.0, 44.0, -24.0, 6.0], [37.0, -16.0, 52.0, -62.0, 2.0], [-9.0, 36.0, -16.0, -4.0, 14.0]], [[51.0, -18.0, -4.0, 6.0, 0.0], [-14.0, 9.0, -20.0, -44.0, -63.0], [24.0, 8.0, 75.0, -15.0, -49.0], [7.0, 100.0, -11.0, 8.0, -28.0]], [[58.0, 26.0, -13.0, -18.0, 55.0], [-89.0, 33.0, 64.0, 37.0, -7.0], [43.0, 4.0, 85.0, -71.0, 33.0], [-20.0, 86.0, -44.0, 25.0, -5.0]], [[-16.0, 42.0, 21.0, 39.0, -9.0], [17.0, 5.0, 8.0, 63.0, 5.0], [4.0, -4.0, -53.0, -61.0, 81.0], [-61.0, -100.0, 2.0, 49.0, 91.0]], [[1.0, -82.0, 35.0, 36.0, -20.0], [59.0, -29.0, -58.0, -97.0, -24.0], [12.0, -28.0, 22.0, 13.0, -10.0], [11.0, 15.0, 30.0, 6.0, -23.0]]], [[[20.0, 9.0, 6.0, -28.0, 62.0], [-73.0, 37.0, 64.0, 9.0, 9.0], [65.0, 1.0, 68.0, -75.0, 42.0], [-30.0, 44.0, -30.0, 23.0, 10.0]], [[34.0, -4.0, 72.0, 54.0, 22.0], [36.0, -60.0, 12.0, 0.0, 38.0], [-68.0, -100.0, 10.0, -68.0, 70.0], [12.0, -2.0, 0.0, 2.0, 32.0]], [[74.0, 110.0, 32.0, 13.0, 45.0], [-53.0, 15.0, 62.0, 79.0, -36.0], [-21.0, -32.0, 59.0, -142.0, 22.0], [-34.0, 61.0, -51.0, 26.0, 84.0]], [[-30.0, -12.0, -111.0, -80.0, -14.0], [-66.0, 46.0, 10.0, 24.0, 17.0], [35.0, 100.0, -16.0, 137.0, -69.0], [35.0, 27.0, -7.0, -37.0, -105.0]], [[69.0, 36.0, 7.0, 57.0, -10.0], [6.0, -49.0, 6.0, 74.0, 14.0], [-94.0, -54.0, -3.0, -22.0, 48.0], [19.0, 25.0, -18.0, 7.0, 7.0]]], [[[15.0, 9.0, 12.0, -11.0, 40.0], [-42.0, 22.0, 40.0, 6.0, 2.0], [41.0, -5.0, 44.0, -61.0, 33.0], [-25.0, 24.0, -19.0, 20.0, 18.0]], [[25.0, 54.0, -67.0, 14.0, -58.0], [-9.0, 25.0, -34.0, 71.0, -66.0], [-10.0, 72.0, -30.0, 41.0, -44.0], [-17.0, 3.0, -10.0, 22.0, 7.0]], [[47.0, -7.0, 13.0, 4.0, 2.0], [-6.0, 20.0, -26.0, -64.0, -91.0], [41.0, 11.0, 86.0, -44.0, -70.0], [-7.0, 103.0, -10.0, 13.0, -1.0]], [[-20.0, 100.0, 44.0, -48.0, 63.0], [-42.0, 37.0, 78.0, 38.0, 8.0], [15.0, -14.0, 12.0, -115.0, -2.0], [-34.0, -17.0, -29.0, -9.0, 94.0]], [[10.0, 86.0, 38.0, 15.0, -3.0], [28.0, -23.0, 10.0, 48.0, -6.0], [-80.0, -40.0, -32.0, -51.0, -18.0], [5.0, -21.0, -9.0, -19.0, 70.0]]], [[[19.0, -53.0, 8.0, 47.0, -6.0], [5.0, 4.0, -20.0, -19.0, -20.0], [56.0, 1.0, 25.0, -32.0, 71.0], [-44.0, -10.0, 7.0, 61.0, 10.0]], [[27.0, -83.0, 51.0, 66.0, -43.0], [90.0, -39.0, -96.0, -124.0, -77.0], [2.0, -35.0, 40.0, -3.0, -42.0], [9.0, 44.0, 35.0, 16.0, -9.0]], [[0.0, -15.0, -21.0, 0.0, -24.0], [-2.0, 43.0, -38.0, -38.0, -80.0], [77.0, 61.0, 27.0, -3.0, -43.0], [-38.0, 19.0, 5.0, 35.0, 9.0]], [[12.0, 57.0, -16.0, 24.0, -31.0], [15.0, -18.0, -6.0, 77.0, 3.0], [-68.0, -1.0, -54.0, 14.0, 6.0], [4.0, -35.0, -5.0, -2.0, 26.0]], [[-39.0, -106.0, -54.0, -41.0, -8.0], [-12.0, 5.0, -20.0, -66.0, 41.0], [45.0, 40.0, 1.0, 127.0, -21.0], [42.0, 14.0, 23.0, -28.0, -120.0]]]])
29165          self.failUnless(isinstance(res,Data),"wrong type of result.")
29166          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
29167          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29168       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29169       def test_tensor_mult_expandedData_rank4_Symbol_rank2(self):
29170          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29171          arg0=msk_arg0*numarray.array([[[[-6.0, 3.0, -1.0], [-4.0, 5.0, -5.0]], [[-1.0, -2.0, 0.0], [2.0, -3.0, 4.0]], [[-6.0, 5.0, 0.0], [-4.0, -2.0, 1.0]], [[5.0, 3.0, -4.0], [0.0, 5.0, -2.0]], [[-5.0, 2.0, 6.0], [4.0, 7.0, -5.0]]], [[[0.0, -6.0, 3.0], [-4.0, 3.0, -4.0]], [[-6.0, -6.0, 2.0], [5.0, -1.0, 1.0]], [[0.0, 1.0, 7.0], [-4.0, 4.0, 2.0]], [[-3.0, 0.0, -5.0], [5.0, 6.0, 7.0]], [[5.0, -3.0, -3.0], [3.0, -1.0, -4.0]]], [[[-2.0, 1.0, 0.0], [1.0, 0.0, 4.0]], [[0.0, 2.0, 2.0], [2.0, -3.0, -3.0]], [[4.0, -4.0, -3.0], [-1.0, 7.0, -7.0]], [[5.0, 2.0, -3.0], [-4.0, -7.0, 0.0]], [[-5.0, 0.0, -3.0], [7.0, 5.0, -1.0]]], [[[0.0, -1.0, 7.0], [-6.0, 3.0, 5.0]], [[-6.0, 1.0, 6.0], [-6.0, -2.0, 0.0]], [[-2.0, 5.0, -6.0], [0.0, -1.0, -3.0]], [[7.0, 0.0, 5.0], [-4.0, 4.0, -7.0]], [[2.0, 1.0, -4.0], [2.0, 7.0, -2.0]]]])+(1.-msk_arg0)*numarray.array([[[[-4.0, -7.0, 2.0], [3.0, 0.0, 4.0]], [[7.0, -2.0, 0.0], [0.0, -3.0, -6.0]], [[-2.0, -2.0, 5.0], [5.0, -3.0, -7.0]], [[7.0, 0.0, 2.0], [-1.0, -4.0, -1.0]], [[4.0, 7.0, 0.0], [4.0, 2.0, -2.0]]], [[[-3.0, 3.0, 7.0], [-2.0, 0.0, 6.0]], [[-3.0, 2.0, -2.0], [-2.0, -1.0, -7.0]], [[4.0, 5.0, -2.0], [6.0, -2.0, -6.0]], [[-5.0, 6.0, 6.0], [7.0, 0.0, 5.0]], [[-1.0, -1.0, 4.0], [-5.0, 2.0, 0.0]]], [[[-4.0, 4.0, -7.0], [7.0, -1.0, 5.0]], [[4.0, -2.0, -4.0], [0.0, 3.0, 7.0]], [[6.0, 6.0, -3.0], [-1.0, 3.0, -3.0]], [[-7.0, 0.0, 2.0], [6.0, -2.0, -1.0]], [[2.0, -4.0, 4.0], [3.0, -7.0, 2.0]]], [[[7.0, -3.0, 6.0], [-4.0, 3.0, 5.0]], [[-7.0, 4.0, 0.0], [2.0, -7.0, -3.0]], [[5.0, -3.0, -6.0], [7.0, 0.0, 0.0]], [[1.0, 2.0, 3.0], [-7.0, 6.0, -4.0]], [[7.0, 6.0, 5.0], [-7.0, -7.0, 0.0]]]])
29172          arg1=Symbol(shape=(2, 3))
29173          res=tensor_mult(arg0,arg1)
29174          s1=numarray.array([[2.0, -1.0, 7.0], [-3.0, 1.0, 4.0]])
29175          sub=res.substitute({arg1:s1})
29176          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29177          ref=msk_ref*numarray.array([[-25.0, 7.0, -3.0, -24.0, 5.0], [26.0, -4.0, 72.0, -22.0, -34.0], [8.0, -9.0, -27.0, -8.0, -51.0], [91.0, 45.0, -64.0, 37.0, -32.0]])+(1.-msk_ref)*numarray.array([[20.0, -11.0, -13.0, 23.0, -17.0], [70.0, -45.0, -55.0, 25.0, 44.0], [-63.0, 13.0, -21.0, -24.0, 28.0], [94.0, -43.0, -50.0, 32.0, 57.0]])
29178          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29179          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29180          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29181       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29182       def test_tensor_mult_expandedData_rank4_Symbol_rank3(self):
29183          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29184          arg0=msk_arg0*numarray.array([[[[5.0, -7.0, 0.0], [3.0, 7.0, 5.0]], [[-2.0, 0.0, 2.0], [5.0, 6.0, 0.0]], [[-4.0, 4.0, -2.0], [-3.0, 0.0, -6.0]], [[-6.0, -4.0, -3.0], [0.0, -5.0, 3.0]], [[5.0, 7.0, 4.0], [0.0, 2.0, -6.0]]], [[[-7.0, -3.0, 3.0], [5.0, 1.0, -5.0]], [[4.0, -4.0, -4.0], [-3.0, 4.0, -3.0]], [[-3.0, -6.0, 6.0], [-2.0, -5.0, 7.0]], [[-4.0, 4.0, 4.0], [3.0, -2.0, -1.0]], [[5.0, 0.0, 6.0], [2.0, 2.0, 5.0]]], [[[5.0, -1.0, -3.0], [5.0, -7.0, 5.0]], [[4.0, -7.0, -7.0], [-5.0, -5.0, 2.0]], [[-1.0, -3.0, 0.0], [-6.0, -1.0, -7.0]], [[0.0, -4.0, -6.0], [-5.0, -6.0, -6.0]], [[5.0, 0.0, -7.0], [6.0, 0.0, 3.0]]], [[[-3.0, 7.0, 5.0], [-2.0, -3.0, 0.0]], [[2.0, -2.0, -5.0], [6.0, 1.0, -4.0]], [[3.0, 1.0, 0.0], [7.0, -5.0, 0.0]], [[-7.0, -2.0, 6.0], [-2.0, 6.0, -4.0]], [[2.0, -7.0, 2.0], [-4.0, -1.0, -2.0]]]])+(1.-msk_arg0)*numarray.array([[[[-7.0, 7.0, 0.0], [-2.0, -1.0, -1.0]], [[-4.0, -1.0, 5.0], [-6.0, -7.0, 0.0]], [[6.0, 1.0, -5.0], [-2.0, -7.0, -2.0]], [[3.0, 0.0, 1.0], [0.0, 2.0, 6.0]], [[4.0, -2.0, -3.0], [5.0, 4.0, -4.0]]], [[[1.0, 6.0, 0.0], [-1.0, -6.0, 0.0]], [[-7.0, 7.0, 4.0], [3.0, -3.0, 2.0]], [[1.0, -1.0, 0.0], [-1.0, 3.0, -1.0]], [[4.0, 3.0, -4.0], [1.0, -2.0, 7.0]], [[-4.0, 4.0, -6.0], [4.0, 1.0, 3.0]]], [[[2.0, 3.0, -1.0], [-1.0, -5.0, 0.0]], [[-5.0, -4.0, 6.0], [-1.0, 5.0, 0.0]], [[4.0, -1.0, -1.0], [6.0, 6.0, 1.0]], [[5.0, 1.0, 5.0], [3.0, 1.0, 6.0]], [[7.0, 7.0, 3.0], [2.0, -6.0, -1.0]]], [[[2.0, 0.0, 0.0], [0.0, 0.0, 1.0]], [[-5.0, 0.0, 2.0], [-4.0, -6.0, 0.0]], [[0.0, -4.0, 0.0], [-4.0, -1.0, -3.0]], [[-5.0, -3.0, -3.0], [-5.0, -4.0, 5.0]], [[2.0, 0.0, 7.0], [6.0, -6.0, -3.0]]]])
29185          arg1=Symbol(shape=(2, 3, 2))
29186          res=tensor_mult(arg0,arg1)
29187          s1=numarray.array([[[7.0, -4.0], [-6.0, 5.0], [1.0, 1.0]], [[1.0, 7.0], [2.0, 4.0], [-7.0, -4.0]]])
29188          sub=res.substitute({arg1:s1})
29189          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29190          ref=msk_ref*numarray.array([[[59.0, -26.0], [5.0, 69.0], [-15.0, 37.0], [-52.0, -31.0], [43.0, 51.0]], [[14.0, 75.0], [74.0, -33.0], [-40.0, -74.0], [-42.0, 57.0], [12.0, -12.0]], [[-6.0, -41.0], [34.0, -121.0], [52.0, -29.0], [43.0, -61.0], [13.0, 3.0]], [[-66.0, 26.0], [57.0, 39.0], [12.0, 22.0], [7.0, 50.0], [66.0, -65.0]]])+(1.-msk_ref)*numarray.array([[[-88.0, 49.0], [-37.0, -54.0], [29.0, -58.0], [-16.0, -27.0], [78.0, 38.0]], [[-42.0, -5.0], [-104.0, 68.0], [25.0, 0.0], [-46.0, -34.0], [-73.0, 50.0]], [[-16.0, -21.0], [4.0, 19.0], [44.0, 40.0], [-3.0, -9.0], [7.0, 4.0]], [[7.0, -12.0], [-49.0, -30.0], [39.0, -40.0], [-68.0, -69.0], [36.0, 29.0]]])
29191          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29192          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
29193          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29194       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29195       def test_tensor_mult_expandedData_rank4_Symbol_rank4(self):
29196          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29197          arg0=msk_arg0*numarray.array([[[[-2.0, 2.0, 6.0], [-7.0, 7.0, 2.0]], [[-3.0, 0.0, -6.0], [3.0, -6.0, -6.0]], [[0.0, 6.0, -1.0], [-6.0, 0.0, 0.0]], [[-5.0, 4.0, -6.0], [5.0, -7.0, 0.0]], [[2.0, -6.0, 3.0], [0.0, 7.0, 5.0]]], [[[-3.0, 0.0, -3.0], [-4.0, 4.0, 4.0]], [[3.0, 2.0, 5.0], [0.0, 6.0, 1.0]], [[-1.0, -3.0, 0.0], [-3.0, -6.0, -5.0]], [[2.0, -4.0, -1.0], [-1.0, 7.0, -5.0]], [[-4.0, 2.0, 0.0], [0.0, 3.0, -5.0]]], [[[-5.0, -6.0, -1.0], [-3.0, -2.0, 3.0]], [[1.0, 5.0, -5.0], [6.0, 3.0, 6.0]], [[0.0, 1.0, -2.0], [0.0, -5.0, 4.0]], [[-2.0, -4.0, -1.0], [4.0, 3.0, 1.0]], [[-6.0, -4.0, 1.0], [0.0, -7.0, -5.0]]], [[[-2.0, 4.0, -6.0], [0.0, 5.0, 0.0]], [[1.0, -7.0, 2.0], [3.0, -5.0, -7.0]], [[1.0, 5.0, -6.0], [0.0, 5.0, 1.0]], [[2.0, 1.0, -5.0], [3.0, 3.0, 6.0]], [[-4.0, 4.0, 7.0], [4.0, 6.0, -1.0]]]])+(1.-msk_arg0)*numarray.array([[[[0.0, -4.0, 1.0], [-7.0, -4.0, 6.0]], [[4.0, -6.0, 6.0], [7.0, 7.0, 3.0]], [[6.0, 6.0, 0.0], [-7.0, 3.0, -3.0]], [[5.0, 3.0, -5.0], [2.0, -5.0, 7.0]], [[-5.0, 0.0, -3.0], [-5.0, -2.0, -5.0]]], [[[5.0, 3.0, 1.0], [-5.0, 1.0, -5.0]], [[-4.0, 0.0, -3.0], [2.0, 7.0, 7.0]], [[5.0, -5.0, -2.0], [-4.0, 2.0, -6.0]], [[-1.0, 1.0, 2.0], [0.0, 5.0, -2.0]], [[-5.0, 6.0, -5.0], [-6.0, 6.0, -6.0]]], [[[-7.0, -1.0, 1.0], [-1.0, -4.0, 1.0]], [[5.0, -2.0, 3.0], [0.0, -3.0, -1.0]], [[1.0, 0.0, -2.0], [7.0, 0.0, 5.0]], [[0.0, -1.0, -4.0], [-6.0, -2.0, -2.0]], [[0.0, 4.0, -4.0], [1.0, 5.0, -2.0]]], [[[1.0, 4.0, 0.0], [0.0, 3.0, 5.0]], [[-4.0, -2.0, 3.0], [-7.0, 2.0, -1.0]], [[7.0, -3.0, -5.0], [0.0, -2.0, 2.0]], [[6.0, 2.0, 0.0], [-4.0, 3.0, -2.0]], [[6.0, -6.0, 0.0], [-7.0, 4.0, 3.0]]]])
29198          arg1=Symbol(shape=(2, 3, 4, 5))
29199          res=tensor_mult(arg0,arg1)
29200          s1=numarray.array([[[[3.0, -5.0, 0.0, 5.0, 3.0], [-2.0, -2.0, 0.0, 5.0, 0.0], [0.0, 0.0, -6.0, -7.0, -4.0], [4.0, -4.0, -4.0, 4.0, 5.0]], [[7.0, -6.0, 6.0, 2.0, 5.0], [7.0, 1.0, 0.0, 7.0, 7.0], [-3.0, 0.0, -2.0, -6.0, -7.0], [4.0, 0.0, -2.0, 7.0, -7.0]], [[1.0, -1.0, 0.0, 4.0, 2.0], [2.0, -7.0, -4.0, -4.0, 3.0], [3.0, -2.0, -2.0, 2.0, 5.0], [1.0, 7.0, -6.0, 0.0, -1.0]]], [[[-7.0, 2.0, -4.0, 0.0, 0.0], [-5.0, -5.0, -7.0, 7.0, 7.0], [5.0, 7.0, 0.0, -5.0, 5.0], [6.0, 0.0, -6.0, 3.0, 6.0]], [[5.0, 5.0, 0.0, 0.0, 1.0], [1.0, 3.0, 2.0, 0.0, -3.0], [-5.0, -1.0, -1.0, 0.0, 1.0], [5.0, -6.0, 0.0, 7.0, -4.0]], [[2.0, 2.0, 4.0, 2.0, -2.0], [3.0, 0.0, 4.0, 5.0, 0.0], [-4.0, -3.0, -6.0, 7.0, -4.0], [2.0, -3.0, -4.0, 1.0, 6.0]]]])
29201          sub=res.substitute({arg1:s1})
29202          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29203          ref=msk_ref*numarray.array([[[[102.0, 17.0, 48.0, 22.0, 19.0], [78.0, 20.0, 47.0, -59.0, -38.0], [-66.0, -74.0, -23.0, 63.0, -12.0], [3.0, 2.0, 2.0, 36.0, -88.0]], [[-78.0, -15.0, -36.0, -51.0, -15.0], [-45.0, 15.0, -33.0, 0.0, 21.0], [51.0, 57.0, 72.0, -48.0, 15.0], [-42.0, 24.0, 54.0, -51.0, -3.0]], [[83.0, -47.0, 60.0, 8.0, 28.0], [70.0, 43.0, 46.0, 4.0, -3.0], [-51.0, -40.0, -10.0, -8.0, -77.0], [-13.0, -7.0, 30.0, 24.0, -77.0]], [[-63.0, -18.0, 4.0, -41.0, -14.0], [-6.0, 10.0, -25.0, 62.0, 66.0], [30.0, 54.0, 41.0, -26.0, -20.0], [-15.0, 20.0, 18.0, -26.0, 11.0]], [[12.0, 68.0, -16.0, 20.0, -21.0], [-18.0, -10.0, 22.0, -19.0, -54.0], [-28.0, -28.0, -43.0, 63.0, 36.0], [32.0, -44.0, -34.0, 20.0, 51.0]]], [[[44.0, 38.0, 32.0, -19.0, -19.0], [36.0, 59.0, 64.0, -11.0, -49.0], [-65.0, -38.0, -4.0, 63.0, -35.0], [-11.0, -45.0, 38.0, 8.0, -28.0]], [[60.0, 0.0, 16.0, 41.0, 33.0], [27.0, -21.0, -4.0, 14.0, 11.0], [-25.0, -19.0, -44.0, -16.0, 1.0], [57.0, -16.0, -50.0, 69.0, -22.0]], [[-43.0, -23.0, -26.0, -21.0, -14.0], [-25.0, -4.0, -11.0, -72.0, -24.0], [44.0, 0.0, 48.0, 5.0, 24.0], [-74.0, 55.0, 48.0, -81.0, -8.0]], [[9.0, 38.0, -40.0, -12.0, 1.0], [-37.0, 25.0, 5.0, -46.0, -59.0], [-11.0, 3.0, 21.0, -22.0, 37.0], [10.0, -42.0, 32.0, 21.0, -25.0]], [[7.0, 13.0, -8.0, -26.0, 11.0], [10.0, 19.0, -14.0, -31.0, 5.0], [-1.0, 12.0, 47.0, -19.0, 25.0], [-3.0, 13.0, 32.0, 14.0, -76.0]]], [[[-41.0, 52.0, -12.0, -35.0, -55.0], [-12.0, 20.0, 33.0, -69.0, -60.0], [-2.0, -26.0, 28.0, 105.0, 28.0], [-67.0, 16.0, 44.0, -82.0, 26.0]], [[18.0, 9.0, 30.0, 7.0, 9.0], [14.0, 17.0, 8.0, 132.0, 53.0], [-39.0, 31.0, -45.0, -35.0, -55.0], [82.0, -75.0, -44.0, 84.0, 35.0]], [[-12.0, -21.0, 22.0, 2.0, -12.0], [10.0, 0.0, 14.0, 35.0, 16.0], [0.0, -3.0, -17.0, 18.0, -38.0], [-15.0, 4.0, -6.0, -24.0, 39.0]], [[-46.0, 60.0, -36.0, -20.0, -27.0], [-40.0, -4.0, -14.0, -1.0, -12.0], [10.0, 24.0, 13.0, 23.0, 50.0], [16.0, -20.0, -6.0, -2.0, 37.0]], [[-90.0, 8.0, -44.0, -44.0, -33.0], [-36.0, -20.0, -38.0, -87.0, -4.0], [70.0, 20.0, 79.0, 33.0, 70.0], [-84.0, 88.0, 46.0, -106.0, -5.0]]], [[[41.0, 17.0, 24.0, -26.0, 7.0], [25.0, 65.0, 34.0, 42.0, -5.0], [-55.0, 7.0, 11.0, -22.0, -45.0], [27.0, -64.0, 36.0, 55.0, -52.0]], [[-104.0, 2.0, -82.0, -15.0, -19.0], [-88.0, -53.0, -67.0, -66.0, -7.0], [95.0, 43.0, 51.0, -25.0, 93.0], [-43.0, 61.0, 8.0, -78.0, 48.0]], [[59.0, -2.0, 34.0, -7.0, 19.0], [29.0, 60.0, 38.0, 69.0, 2.0], [-62.0, 4.0, -15.0, -42.0, -68.0], [45.0, -79.0, 18.0, 75.0, -38.0]], [[14.0, 22.0, 18.0, 4.0, -8.0], [-1.0, 26.0, 29.0, 88.0, 4.0], [-42.0, 10.0, -43.0, -3.0, -46.0], [52.0, -79.0, -22.0, 51.0, 50.0]], [[23.0, 25.0, 4.0, 14.0, 30.0], [33.0, -39.0, -48.0, 3.0, 59.0], [3.0, 11.0, 2.0, -9.0, 53.0], [59.0, 32.0, -54.0, 65.0, -61.0]]]])+(1.-msk_ref)*numarray.array([[[[14.0, 1.0, 28.0, 8.0, -34.0], [23.0, 12.0, 61.0, -51.0, -62.0], [-24.0, -65.0, -26.0, 103.0, -30.0], [-65.0, 13.0, 20.0, -71.0, 37.0]], [[-32.0, 65.0, -52.0, 38.0, -5.0], [-57.0, -70.0, -47.0, 18.0, 4.0], [24.0, 21.0, -49.0, 6.0, 86.0], [81.0, -25.0, -94.0, 47.0, 88.0]], [[118.0, -71.0, 52.0, 36.0, 57.0], [59.0, 38.0, 43.0, 8.0, -16.0], [-56.0, -43.0, -33.0, -64.0, -86.0], [15.0, -33.0, 18.0, 63.0, -84.0]], [[6.0, -45.0, 38.0, 25.0, 1.0], [7.0, 3.0, 24.0, 115.0, 35.0], [-17.0, 8.0, -63.0, -24.0, -89.0], [28.0, -46.0, -36.0, 19.0, 83.0]], [[-3.0, -2.0, 0.0, -47.0, -13.0], [12.0, 50.0, 23.0, -73.0, -38.0], [-4.0, -12.0, 68.0, 19.0, -2.0], [-73.0, 26.0, 88.0, -54.0, -74.0]]], [[[67.0, -59.0, 18.0, 25.0, 43.0], [24.0, 14.0, 13.0, -18.0, -14.0], [-16.0, -23.0, -9.0, -61.0, -40.0], [-2.0, -4.0, 18.0, 28.0, -61.0]], [[20.0, 76.0, 20.0, -18.0, -25.0], [20.0, 40.0, 40.0, 41.0, -16.0], [-62.0, -8.0, -19.0, 61.0, -10.0], [42.0, -68.0, -6.0, 46.0, 9.0]], [[4.0, -3.0, -38.0, -5.0, 0.0], [-45.0, 25.0, 16.0, -60.0, -75.0], [3.0, -8.0, 18.0, -31.0, 11.0], [-28.0, -28.0, 50.0, -19.0, -6.0]], [[27.0, 18.0, -2.0, 1.0, 15.0], [12.0, 4.0, -6.0, -16.0, -2.0], [-14.0, -3.0, 7.0, -9.0, 20.0], [23.0, -6.0, -2.0, 36.0, -46.0]], [[82.0, 0.0, 36.0, -45.0, 23.0], [60.0, 99.0, 50.0, -35.0, -33.0], [-69.0, -20.0, 58.0, -23.0, -47.0], [-19.0, -33.0, 98.0, 40.0, -158.0]]], [[[-38.0, 20.0, 2.0, -31.0, -30.0], [13.0, -1.0, -1.0, -48.0, 1.0], [17.0, -8.0, 40.0, 69.0, 27.0], [-55.0, 56.0, 26.0, -65.0, -13.0]], [[-13.0, -33.0, -16.0, 31.0, 10.0], [-24.0, -42.0, -22.0, -6.0, 4.0], [34.0, 0.0, -23.0, -24.0, 10.0], [-2.0, 22.0, -30.0, -16.0, 42.0]], [[-38.0, 21.0, -8.0, 7.0, -11.0], [-26.0, -23.0, -21.0, 87.0, 43.0], [9.0, 38.0, -32.0, -11.0, 1.0], [54.0, -33.0, -54.0, 30.0, 79.0]], [[17.0, -16.0, 10.0, -22.0, -11.0], [7.0, 51.0, 46.0, -43.0, -55.0], [-21.0, -26.0, 24.0, 14.0, -37.0], [-58.0, -10.0, 70.0, -41.0, -29.0]], [[38.0, 3.0, 12.0, -12.0, 21.0], [14.0, 42.0, 11.0, 41.0, 8.0], [-36.0, 16.0, 7.0, -51.0, -30.0], [39.0, -52.0, 18.0, 64.0, -50.0]]], [[[56.0, -4.0, 44.0, 23.0, 16.0], [44.0, 11.0, 26.0, 58.0, 19.0], [-47.0, -18.0, -47.0, 4.0, -49.0], [45.0, -37.0, -32.0, 58.0, -5.0]], [[34.0, 23.0, 12.0, -14.0, -12.0], [34.0, 26.0, 37.0, -100.0, -60.0], [-26.0, -54.0, 26.0, 74.0, 16.0], [-55.0, 28.0, 48.0, -38.0, -65.0]], [[-11.0, -18.0, -10.0, 13.0, -10.0], [-41.0, 12.0, 24.0, 44.0, -30.0], [-4.0, 6.0, -36.0, -27.0, -42.0], [5.0, -57.0, 0.0, -5.0, 81.0]], [[71.0, -39.0, 20.0, 30.0, 35.0], [19.0, 19.0, 26.0, 6.0, -23.0], [-33.0, -25.0, -31.0, -48.0, -47.0], [19.0, -36.0, 4.0, 45.0, -32.0]], [[51.0, 18.0, 4.0, 24.0, -14.0], [-6.0, 29.0, 69.0, -46.0, -103.0], [-49.0, -62.0, -46.0, 50.0, -25.0], [-16.0, -57.0, 18.0, -8.0, 32.0]]]])
29204          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29205          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
29206          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29207       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29208       def test_tensor_mult_expandedData_rank4_constData_rank2(self):
29209          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29210          arg0=msk_arg0*numarray.array([[[[3.0, 2.0, 3.0], [4.0, 0.0, 6.0]], [[0.0, -6.0, 1.0], [7.0, 7.0, 5.0]], [[-2.0, -7.0, 4.0], [-2.0, -3.0, 2.0]], [[0.0, 0.0, 4.0], [-6.0, -5.0, 6.0]], [[-3.0, -5.0, 2.0], [7.0, 5.0, 1.0]]], [[[-6.0, -1.0, 1.0], [-7.0, 2.0, -1.0]], [[-6.0, -1.0, -7.0], [2.0, 5.0, -2.0]], [[-1.0, -6.0, -1.0], [3.0, -7.0, -6.0]], [[-5.0, -2.0, 6.0], [1.0, -5.0, -6.0]], [[0.0, 0.0, -2.0], [-7.0, -3.0, 6.0]]], [[[0.0, -7.0, 4.0], [-1.0, -5.0, -5.0]], [[-2.0, 1.0, 7.0], [2.0, 4.0, -3.0]], [[-5.0, -4.0, 7.0], [-7.0, 4.0, 2.0]], [[-6.0, 4.0, 1.0], [-2.0, 0.0, 0.0]], [[5.0, 0.0, -1.0], [0.0, -2.0, 3.0]]], [[[6.0, 2.0, -6.0], [-2.0, -7.0, 3.0]], [[-1.0, 4.0, 6.0], [0.0, 7.0, 7.0]], [[6.0, -1.0, 6.0], [0.0, -4.0, 2.0]], [[5.0, 2.0, 0.0], [0.0, -7.0, 5.0]], [[0.0, 4.0, 4.0], [-2.0, -2.0, 7.0]]]])+(1.-msk_arg0)*numarray.array([[[[-5.0, -7.0, 4.0], [-3.0, -2.0, -3.0]], [[-5.0, -2.0, 5.0], [-1.0, -5.0, -3.0]], [[0.0, -7.0, 5.0], [6.0, -3.0, -2.0]], [[2.0, -7.0, -4.0], [0.0, -2.0, 6.0]], [[1.0, -3.0, -6.0], [0.0, 5.0, -4.0]]], [[[-6.0, -1.0, -5.0], [1.0, -7.0, 2.0]], [[4.0, 0.0, 7.0], [2.0, 2.0, 3.0]], [[0.0, -7.0, 0.0], [3.0, 1.0, 3.0]], [[4.0, -1.0, 3.0], [-1.0, -7.0, -3.0]], [[6.0, 0.0, -7.0], [5.0, 3.0, 4.0]]], [[[6.0, -5.0, -1.0], [-3.0, 1.0, -6.0]], [[4.0, 4.0, 0.0], [-3.0, 2.0, 1.0]], [[3.0, 5.0, 0.0], [6.0, -7.0, 7.0]], [[-7.0, -3.0, -5.0], [-5.0, -4.0, 3.0]], [[-4.0, 0.0, 3.0], [6.0, -4.0, -1.0]]], [[[0.0, -3.0, 0.0], [0.0, 1.0, -7.0]], [[0.0, 3.0, -3.0], [2.0, -3.0, 1.0]], [[-4.0, -1.0, 2.0], [-4.0, 2.0, -5.0]], [[7.0, -2.0, 7.0], [-4.0, 1.0, -2.0]], [[-2.0, 0.0, -7.0], [5.0, 0.0, 7.0]]]])
29211          arg1=Data(numarray.array([[1.0, -3.0, 0.0], [1.0, -3.0, 1.0]]),self.functionspace)
29212          res=tensor_mult(arg0,arg1)
29213          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29214          ref=msk_ref*numarray.array([[7.0, 9.0, 28.0, 15.0, 5.0], [-17.0, -18.0, 35.0, 11.0, 8.0], [30.0, -18.0, -10.0, -20.0, 14.0], [22.0, -27.0, 23.0, 25.0, -1.0]])+(1.-msk_ref)*numarray.array([[16.0, 12.0, 34.0, 35.0, -9.0], [21.0, 3.0, 24.0, 24.0, 6.0], [9.0, -16.0, 22.0, 12.0, 13.0], [-1.0, 3.0, -16.0, 4.0, 10.0]])
29215          self.failUnless(isinstance(res,Data),"wrong type of result.")
29216          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29217          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29218       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29219       def test_tensor_mult_expandedData_rank4_constData_rank3(self):
29220          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29221          arg0=msk_arg0*numarray.array([[[[-1.0, -5.0, 1.0], [-3.0, -7.0, 3.0]], [[-4.0, -7.0, -3.0], [0.0, -2.0, -7.0]], [[3.0, -3.0, -2.0], [-7.0, 3.0, 0.0]], [[-4.0, -7.0, -2.0], [-2.0, -3.0, -4.0]], [[7.0, 4.0, 0.0], [3.0, 2.0, 0.0]]], [[[-3.0, 5.0, -6.0], [-1.0, 6.0, 4.0]], [[-7.0, -3.0, 1.0], [-1.0, -5.0, 1.0]], [[1.0, -7.0, -3.0], [-3.0, 4.0, -7.0]], [[-4.0, 2.0, -4.0], [-2.0, -5.0, 0.0]], [[7.0, -6.0, -7.0], [-5.0, -1.0, -3.0]]], [[[-1.0, -7.0, 5.0], [3.0, 0.0, -6.0]], [[4.0, 7.0, -2.0], [-4.0, 4.0, -3.0]], [[-4.0, 0.0, -5.0], [0.0, 6.0, 6.0]], [[2.0, 5.0, 2.0], [-5.0, -4.0, 0.0]], [[-1.0, -3.0, -2.0], [3.0, 4.0, 1.0]]], [[[-2.0, -1.0, 7.0], [-4.0, -4.0, 0.0]], [[-3.0, -6.0, 2.0], [2.0, -1.0, 3.0]], [[-7.0, -2.0, -7.0], [1.0, 1.0, 4.0]], [[-1.0, 0.0, 2.0], [-5.0, 7.0, 7.0]], [[-2.0, 1.0, 7.0], [6.0, 1.0, -4.0]]]])+(1.-msk_arg0)*numarray.array([[[[1.0, -7.0, 0.0], [0.0, 3.0, -7.0]], [[7.0, 5.0, -2.0], [0.0, 1.0, -2.0]], [[7.0, -7.0, -7.0], [-3.0, 3.0, -1.0]], [[-3.0, -1.0, 0.0], [0.0, 0.0, 5.0]], [[-5.0, -1.0, -5.0], [1.0, 7.0, 2.0]]], [[[-2.0, 5.0, -4.0], [-4.0, 2.0, 5.0]], [[0.0, 0.0, -3.0], [-5.0, 7.0, -4.0]], [[-4.0, -5.0, 5.0], [-2.0, 0.0, 7.0]], [[4.0, 6.0, 6.0], [0.0, 2.0, -1.0]], [[0.0, -5.0, -5.0], [-3.0, -2.0, -1.0]]], [[[-1.0, 0.0, 0.0], [-1.0, 2.0, 2.0]], [[-1.0, -5.0, -7.0], [7.0, -3.0, 0.0]], [[-4.0, 0.0, 6.0], [1.0, 3.0, -2.0]], [[7.0, -3.0, -3.0], [1.0, 2.0, 5.0]], [[-4.0, 5.0, 4.0], [-6.0, -3.0, -7.0]]], [[[-2.0, 0.0, 5.0], [-2.0, 0.0, 0.0]], [[-5.0, 0.0, -4.0], [-4.0, 2.0, 7.0]], [[1.0, -6.0, 6.0], [-4.0, 3.0, -7.0]], [[-4.0, -2.0, 4.0], [6.0, 1.0, -6.0]], [[-1.0, 2.0, -2.0], [7.0, 0.0, 0.0]]]])
29222          arg1=Data(numarray.array([[[7.0, -1.0], [-1.0, -4.0], [4.0, -4.0]], [[6.0, -5.0], [4.0, -2.0], [1.0, -6.0]]]),self.functionspace)
29223          res=tensor_mult(arg0,arg1)
29224          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29225          ref=msk_ref*numarray.array([[[-41.0, 28.0], [-48.0, 90.0], [-14.0, 46.0], [-57.0, 80.0], [71.0, -42.0]], [[-28.0, -24.0], [-67.0, 24.0], [-7.0, 88.0], [-78.0, 32.0], [-10.0, 90.0]], [[32.0, 30.0], [2.0, 6.0], [-18.0, -24.0], [-29.0, 3.0], [23.0, -8.0]], [[-25.0, 6.0], [4.0, -7.0], [-61.0, 12.0], [6.0, -38.0], [49.0, -38.0]]])+(1.-msk_ref)*numarray.array([[[19.0, 63.0], [38.0, -9.0], [21.0, 64.0], [-15.0, -23.0], [-18.0, -2.0]], [[-46.0, -16.0], [-18.0, 47.0], [-8.0, -28.0], [53.0, -50.0], [-42.0, 65.0]], [[-3.0, -10.0], [0.0, 20.0], [12.0, -19.0], [59.0, -22.0], [-72.0, 46.0]], [[-6.0, -8.0], [-60.0, -5.0], [18.0, 55.0], [24.0, 0.0], [25.0, -34.0]]])
29226          self.failUnless(isinstance(res,Data),"wrong type of result.")
29227          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
29228          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29229       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29230       def test_tensor_mult_expandedData_rank4_constData_rank4(self):
29231          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29232          arg0=msk_arg0*numarray.array([[[[2.0, -3.0, -2.0], [0.0, 5.0, 3.0]], [[3.0, 1.0, -5.0], [-6.0, -3.0, -3.0]], [[-2.0, 4.0, 4.0], [7.0, 7.0, 6.0]], [[-2.0, -5.0, -4.0], [-4.0, -4.0, 2.0]], [[-3.0, -4.0, -2.0], [-4.0, -5.0, 2.0]]], [[[-1.0, -1.0, 6.0], [-3.0, -5.0, 5.0]], [[1.0, 4.0, -2.0], [5.0, -3.0, 0.0]], [[2.0, 7.0, 0.0], [1.0, 5.0, -5.0]], [[-3.0, -4.0, 3.0], [-5.0, 3.0, 5.0]], [[7.0, 3.0, -5.0], [7.0, -4.0, -1.0]]], [[[-6.0, -3.0, -1.0], [1.0, -7.0, -7.0]], [[4.0, 2.0, -4.0], [-3.0, 7.0, -6.0]], [[5.0, 7.0, -3.0], [3.0, -6.0, -6.0]], [[0.0, -5.0, -7.0], [7.0, -1.0, -1.0]], [[3.0, -1.0, -5.0], [-3.0, -7.0, -1.0]]], [[[-5.0, 6.0, 1.0], [2.0, -6.0, 5.0]], [[-4.0, -7.0, 1.0], [6.0, 0.0, -6.0]], [[-2.0, 7.0, 2.0], [-1.0, 5.0, -4.0]], [[-4.0, 1.0, -7.0], [-1.0, 6.0, -3.0]], [[5.0, 0.0, 2.0], [-2.0, 0.0, 2.0]]]])+(1.-msk_arg0)*numarray.array([[[[0.0, -5.0, 5.0], [6.0, 5.0, -1.0]], [[-1.0, 0.0, -7.0], [-6.0, 0.0, 0.0]], [[-5.0, -1.0, -6.0], [0.0, -7.0, 7.0]], [[-6.0, 3.0, 3.0], [-2.0, -5.0, -3.0]], [[0.0, -4.0, 6.0], [-1.0, -5.0, 5.0]]], [[[-2.0, -4.0, 0.0], [-2.0, -1.0, 7.0]], [[-1.0, -4.0, 0.0], [-1.0, -3.0, 1.0]], [[3.0, 3.0, 7.0], [-4.0, -3.0, -3.0]], [[-2.0, 6.0, 4.0], [-5.0, -5.0, -5.0]], [[-3.0, -5.0, 5.0], [7.0, -2.0, 6.0]]], [[[6.0, 1.0, -5.0], [0.0, 0.0, -3.0]], [[1.0, 2.0, -4.0], [2.0, 4.0, 6.0]], [[0.0, -3.0, 4.0], [3.0, 0.0, 2.0]], [[-4.0, 0.0, 1.0], [-1.0, -3.0, 7.0]], [[-6.0, -6.0, -6.0], [6.0, 5.0, -6.0]]], [[[2.0, -3.0, -5.0], [3.0, 5.0, -3.0]], [[0.0, 3.0, 7.0], [3.0, -6.0, 2.0]], [[-1.0, 2.0, 7.0], [7.0, 4.0, -6.0]], [[-7.0, -5.0, -1.0], [-2.0, 7.0, 7.0]], [[-2.0, -3.0, 0.0], [0.0, -6.0, 7.0]]]])
29233          arg1=Data(numarray.array([[[[-6.0, 5.0, -2.0, -2.0, -1.0], [5.0, -4.0, 2.0, -5.0, -6.0], [-6.0, 0.0, 7.0, 3.0, 3.0], [-7.0, 5.0, 6.0, -4.0, 0.0]], [[-1.0, 5.0, -6.0, -6.0, 0.0], [-4.0, 5.0, 0.0, 3.0, -6.0], [7.0, 0.0, -1.0, -6.0, 4.0], [-3.0, 5.0, 6.0, -4.0, 4.0]], [[4.0, -3.0, 5.0, 5.0, -3.0], [2.0, 6.0, -2.0, 2.0, -2.0], [4.0, -6.0, -4.0, -2.0, -5.0], [3.0, 0.0, -3.0, -5.0, 0.0]]], [[[0.0, -5.0, -6.0, 0.0, 3.0], [5.0, 2.0, 0.0, 0.0, -1.0], [-4.0, -5.0, 0.0, 7.0, 0.0], [6.0, 5.0, 4.0, -7.0, 7.0]], [[-2.0, -3.0, 5.0, -6.0, -5.0], [-2.0, 5.0, -6.0, 2.0, -6.0], [-5.0, 4.0, 0.0, 4.0, -4.0], [4.0, 7.0, -6.0, -5.0, 6.0]], [[6.0, -6.0, 3.0, -7.0, 0.0], [-6.0, 0.0, -4.0, 5.0, 4.0], [0.0, -3.0, 6.0, 0.0, 6.0], [-4.0, 1.0, -5.0, -6.0, 3.0]]]]),self.functionspace)
29234          res=tensor_mult(arg0,arg1)
29235          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29236          ref=msk_ref*numarray.array([[[[-9.0, -32.0, 38.0, -47.0, -21.0], [-10.0, -10.0, -34.0, 2.0, -8.0], [-66.0, 23.0, 43.0, 48.0, 2.0], [-3.0, 33.0, -45.0, -29.0, 27.0]], [[-51.0, 92.0, -25.0, 2.0, 9.0], [-5.0, -64.0, 46.0, -43.0, -2.0], [8.0, 57.0, 22.0, -41.0, 32.0], [-75.0, -34.0, 48.0, 84.0, -65.0]], [[46.0, -94.0, 11.0, -84.0, -24.0], [-33.0, 101.0, -78.0, 74.0, -45.0], [-7.0, -49.0, 2.0, 39.0, -2.0], [60.0, 100.0, -44.0, -148.0, 125.0]], [[21.0, -3.0, 24.0, 24.0, 22.0], [-22.0, -69.0, 20.0, -11.0, 86.0], [-3.0, 22.0, 19.0, -12.0, 22.0], [-31.0, -81.0, -32.0, 84.0, -66.0]], [[36.0, -6.0, 25.0, 36.0, 22.0], [-25.0, -53.0, 20.0, -1.0, 88.0], [23.0, 6.0, 3.0, -29.0, 17.0], [-25.0, -88.0, -32.0, 79.0, -68.0]]], [[[71.0, -28.0, 46.0, 33.0, -1.0], [-24.0, 4.0, -4.0, 29.0, 53.0], [60.0, -56.0, 0.0, -50.0, 13.0], [-30.0, -55.0, -37.0, -6.0, -40.0]], [[-12.0, 15.0, -81.0, -18.0, 35.0], [16.0, -1.0, 24.0, -3.0, -13.0], [9.0, -25.0, 11.0, 6.0, 41.0], [-7.0, 29.0, 74.0, -30.0, 33.0]], [[-59.0, 55.0, -42.0, -41.0, -24.0], [7.0, 54.0, -6.0, -4.0, -105.0], [8.0, 30.0, -23.0, -9.0, -16.0], [11.0, 80.0, 53.0, -38.0, 50.0]], [[58.0, -58.0, 105.0, -8.0, -36.0], [-54.0, 15.0, -50.0, 40.0, 43.0], [7.0, 4.0, 1.0, -14.0, -22.0], [4.0, -34.0, -114.0, 3.0, -18.0]], [[-63.0, 48.0, -122.0, -26.0, 49.0], [62.0, -49.0, 52.0, -49.0, -37.0], [-49.0, -18.0, 60.0, 46.0, 68.0], [-43.0, 56.0, 132.0, -38.0, 34.0]]], [[[7.0, 16.0, -37.0, 116.0, 47.0], [41.0, -30.0, 60.0, -30.0, 69.0], [42.0, -6.0, -77.0, -19.0, -39.0], [54.0, -96.0, 30.0, 111.0, -68.0]], [[-92.0, 72.0, -5.0, -40.0, -36.0], [11.0, -1.0, -2.0, -38.0, -91.0], [-49.0, 85.0, 6.0, 15.0, -24.0], [-12.0, 58.0, 24.0, 18.0, 11.0]], [[-73.0, 108.0, -133.0, 11.0, 43.0], [54.0, -27.0, 76.0, -52.0, -57.0], [25.0, -3.0, 4.0, -24.0, 46.0], [-47.0, 27.0, 159.0, 12.0, -5.0]], [[-27.0, -30.0, -55.0, 8.0, 47.0], [49.0, -58.0, 24.0, -36.0, 39.0], [-86.0, 6.0, 27.0, 89.0, 13.0], [36.0, 2.0, 30.0, 17.0, 20.0]], [[-29.0, 67.0, -45.0, 24.0, 38.0], [14.0, -88.0, 62.0, -47.0, 39.0], [2.0, 20.0, 36.0, -24.0, 52.0], [-75.0, -55.0, 62.0, 79.0, -70.0]]], [[[70.0, -20.0, -48.0, -20.0, 38.0], [-55.0, 30.0, 4.0, 58.0, 46.0], [98.0, -55.0, -15.0, -63.0, 58.0], [-12.0, -22.0, 22.0, -23.0, 17.0]], [[-1.0, -52.0, 1.0, 97.0, 19.0], [76.0, -1.0, 14.0, -29.0, 34.0], [-45.0, -18.0, -61.0, 70.0, -81.0], [112.0, -31.0, -15.0, 33.0, -4.0]], [[-21.0, 33.0, -9.0, -30.0, -32.0], [-25.0, 78.0, -22.0, 25.0, -79.0], [48.0, 25.0, -53.0, -39.0, -32.0], [29.0, 51.0, 10.0, -24.0, 39.0]], [[-35.0, 11.0, -6.0, -48.0, -8.0], [-37.0, 7.0, -18.0, 6.0, -15.0], [-23.0, 80.0, -19.0, 13.0, -15.0], [34.0, 19.0, -22.0, 42.0, 24.0]], [[-10.0, 17.0, 18.0, -14.0, -17.0], [7.0, -12.0, -2.0, -11.0, -24.0], [-14.0, -8.0, 39.0, -3.0, 17.0], [-49.0, 17.0, 6.0, -28.0, -8.0]]]])+(1.-msk_ref)*numarray.array([[[[9.0, -79.0, 41.0, 32.0, -22.0], [56.0, 42.0, -36.0, 0.0, -20.0], [-64.0, -37.0, -21.0, 82.0, -71.0], [90.0, 39.0, -46.0, -66.0, 49.0]], [[-22.0, 46.0, 3.0, -33.0, 4.0], [-49.0, -50.0, 12.0, -9.0, 26.0], [2.0, 72.0, 21.0, -31.0, 32.0], [-50.0, -35.0, -9.0, 81.0, -42.0]], [[63.0, -33.0, -28.0, -21.0, 58.0], [-61.0, -56.0, 16.0, 31.0, 118.0], [34.0, -13.0, 32.0, -25.0, 81.0], [-36.0, -72.0, -11.0, 47.0, -25.0]], [[37.0, 19.0, -13.0, 60.0, 16.0], [-18.0, 28.0, 24.0, 20.0, 32.0], [102.0, -19.0, -75.0, -76.0, -19.0], [22.0, -63.0, 10.0, 54.0, -41.0]], [[68.0, -48.0, 50.0, 49.0, 4.0], [3.0, -11.0, -2.0, 15.0, 63.0], [25.0, -66.0, 10.0, -15.0, 4.0], [-16.0, -55.0, -41.0, -12.0, -38.0]]], [[[60.0, -59.0, 56.0, -15.0, 1.0], [-44.0, -21.0, -26.0, 31.0, 72.0], [-3.0, -15.0, 32.0, 0.0, 24.0], [-18.0, -40.0, -73.0, 1.0, -15.0]], [[22.0, -17.0, 20.0, 37.0, 13.0], [6.0, -33.0, 12.0, -8.0, 53.0], [-3.0, -10.0, 3.0, 2.0, -1.0], [-3.0, -50.0, -21.0, 36.0, -38.0]], [[-5.0, 56.0, 11.0, 50.0, -21.0], [21.0, 22.0, 22.0, -13.0, -40.0], [62.0, -25.0, -28.0, -63.0, -20.0], [-33.0, -14.0, 32.0, 2.0, -43.0]], [[2.0, 78.0, -22.0, 53.0, 0.0], [-11.0, 27.0, 38.0, 1.0, -17.0], [115.0, -4.0, -66.0, -105.0, -12.0], [-22.0, -45.0, 47.0, 54.0, -56.0]], [[83.0, -120.0, 27.0, 31.0, 19.0], [18.0, 21.0, -28.0, 36.0, 67.0], [-15.0, -91.0, 0.0, 52.0, -10.0], [61.0, -13.0, -53.0, -68.0, 35.0]]], [[[-75.0, 68.0, -52.0, -22.0, 9.0], [34.0, -49.0, 34.0, -52.0, -44.0], [-49.0, 39.0, 43.0, 22.0, 29.0], [-48.0, 32.0, 72.0, 15.0, -5.0]], [[4.0, -31.0, -8.0, -100.0, -3.0], [-45.0, 6.0, -38.0, 31.0, -12.0], [-36.0, 12.0, 57.0, 29.0, 51.0], [-21.0, 59.0, -16.0, -62.0, 64.0]], [[31.0, -54.0, 26.0, 24.0, -3.0], [23.0, 15.0, -16.0, 9.0, 15.0], [-17.0, -45.0, -1.0, 31.0, -20.0], [31.0, 2.0, -28.0, -41.0, 15.0]], [[76.0, -51.0, 25.0, -18.0, 13.0], [-59.0, 5.0, -20.0, 51.0, 69.0], [47.0, -34.0, 10.0, -33.0, 37.0], [-15.0, -39.0, -48.0, -9.0, -4.0]], [[-28.0, -51.0, -11.0, 30.0, 17.0], [38.0, -5.0, -6.0, -20.0, 24.0], [-79.0, 44.0, -48.0, 92.0, -68.0], [122.0, -1.0, -30.0, 47.0, 30.0]]], [[[-57.0, -2.0, -13.0, -20.0, -3.0], [35.0, -22.0, -4.0, -34.0, -29.0], [-90.0, 44.0, 19.0, 75.0, -19.0], [30.0, 42.0, 6.0, 1.0, 30.0]], [[49.0, -15.0, -25.0, 39.0, 18.0], [17.0, 33.0, 14.0, 21.0, 9.0], [67.0, -87.0, -19.0, -35.0, 13.0], [-2.0, -10.0, 35.0, -50.0, 3.0]], [[-12.0, -27.0, -15.0, 43.0, -19.0], [64.0, 90.0, -16.0, 3.0, -75.0], [0.0, -43.0, -73.0, 36.0, -82.0], [104.0, 62.0, 19.0, -72.0, 63.0]], [[71.0, -110.0, 107.0, -52.0, -31.0], [-83.0, 28.0, -82.0, 67.0, 62.0], [-24.0, 23.0, 2.0, 25.0, -22.0], [49.0, -14.0, -154.0, -10.0, 29.0]], [[69.0, -49.0, 13.0, 9.0, 32.0], [-28.0, -37.0, 4.0, 24.0, 94.0], [21.0, -45.0, 31.0, -12.0, 48.0], [-29.0, -60.0, -29.0, 8.0, -27.0]]]])
29237          self.failUnless(isinstance(res,Data),"wrong type of result.")
29238          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
29239          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29240       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29241       def test_tensor_mult_expandedData_rank4_expandedData_rank2(self):
29242          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29243          arg0=msk_arg0*numarray.array([[[[-6.0, -4.0, 1.0], [3.0, -4.0, -3.0]], [[-4.0, -1.0, 7.0], [-4.0, -2.0, -2.0]], [[-6.0, -5.0, -2.0], [-5.0, -3.0, 0.0]], [[2.0, 0.0, 3.0], [0.0, 2.0, -5.0]], [[-2.0, -2.0, 0.0], [-6.0, 0.0, 0.0]]], [[[7.0, 6.0, 2.0], [-4.0, 7.0, -6.0]], [[7.0, -7.0, -1.0], [0.0, 7.0, 1.0]], [[-6.0, -4.0, 7.0], [-6.0, -3.0, -1.0]], [[7.0, -4.0, 6.0], [2.0, -7.0, -3.0]], [[6.0, 5.0, -1.0], [-6.0, -1.0, 0.0]]], [[[-7.0, -7.0, 2.0], [7.0, 3.0, 2.0]], [[-3.0, -3.0, 2.0], [3.0, -1.0, 2.0]], [[-2.0, -1.0, -2.0], [5.0, -4.0, 7.0]], [[-5.0, -7.0, -6.0], [7.0, -3.0, -3.0]], [[0.0, -2.0, -5.0], [7.0, 0.0, -1.0]]], [[[-4.0, 6.0, -4.0], [-1.0, 0.0, 0.0]], [[6.0, -5.0, 5.0], [2.0, 2.0, -1.0]], [[0.0, 0.0, -1.0], [1.0, 1.0, -6.0]], [[-1.0, 3.0, -1.0], [-1.0, 6.0, 1.0]], [[0.0, -7.0, -1.0], [3.0, 2.0, 1.0]]]])+(1.-msk_arg0)*numarray.array([[[[-7.0, 7.0, -3.0], [-6.0, -7.0, 6.0]], [[5.0, -7.0, 1.0], [-7.0, 0.0, 1.0]], [[-2.0, -1.0, 6.0], [0.0, 0.0, 1.0]], [[-6.0, 5.0, -6.0], [-1.0, 3.0, 3.0]], [[5.0, -5.0, -2.0], [3.0, 7.0, 5.0]]], [[[-6.0, 0.0, 4.0], [3.0, -4.0, -5.0]], [[4.0, 4.0, 0.0], [4.0, 7.0, 3.0]], [[-7.0, 7.0, 3.0], [0.0, 0.0, 3.0]], [[-5.0, 6.0, 6.0], [5.0, -5.0, -3.0]], [[0.0, 4.0, -3.0], [-4.0, -2.0, -5.0]]], [[[0.0, -6.0, 4.0], [6.0, 0.0, 5.0]], [[-5.0, 7.0, 5.0], [4.0, 0.0, -2.0]], [[7.0, -4.0, 7.0], [7.0, 5.0, 2.0]], [[-3.0, -4.0, -5.0], [-7.0, 0.0, 6.0]], [[5.0, 6.0, 3.0], [-4.0, -7.0, 0.0]]], [[[-4.0, -1.0, 0.0], [0.0, 0.0, -6.0]], [[-6.0, 0.0, 5.0], [1.0, 0.0, 0.0]], [[5.0, 0.0, -6.0], [-3.0, 3.0, 0.0]], [[3.0, 0.0, -3.0], [0.0, 5.0, 2.0]], [[-4.0, 1.0, 2.0], [6.0, 2.0, -5.0]]]])
29244          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29245          arg1=msk_arg1*numarray.array([[3.0, 6.0, 6.0], [0.0, 4.0, 4.0]])+(1.-msk_arg1)*numarray.array([[1.0, -1.0, 7.0], [-4.0, 5.0, -6.0]])
29246          res=tensor_mult(arg0,arg1)
29247          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29248          ref=msk_ref*numarray.array([[-64.0, 8.0, -72.0, 12.0, -18.0], [73.0, 5.0, -16.0, -7.0, 38.0], [-31.0, -11.0, -12.0, -117.0, -46.0], [0.0, 22.0, -26.0, 37.0, -36.0]])+(1.-msk_ref)*numarray.array([[-82.0, 41.0, 35.0, -52.0, -11.0], [20.0, 1.0, -11.0, 4.0, 11.0], [-20.0, 19.0, 45.0, -42.0, 1.0], [33.0, 25.0, -10.0, -5.0, 25.0]])
29249          self.failUnless(isinstance(res,Data),"wrong type of result.")
29250          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29251          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29252       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29253       def test_tensor_mult_expandedData_rank4_expandedData_rank3(self):
29254          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29255          arg0=msk_arg0*numarray.array([[[[4.0, -4.0, -5.0], [5.0, 0.0, -6.0]], [[-5.0, -5.0, 6.0], [5.0, -5.0, 4.0]], [[-2.0, 1.0, 0.0], [6.0, 4.0, -1.0]], [[0.0, 0.0, 0.0], [-5.0, 2.0, 4.0]], [[-1.0, -1.0, 4.0], [-1.0, 1.0, 1.0]]], [[[-3.0, 1.0, 0.0], [0.0, -5.0, -6.0]], [[6.0, 6.0, 2.0], [-3.0, -6.0, 7.0]], [[-4.0, -3.0, 3.0], [-5.0, 3.0, -6.0]], [[0.0, -4.0, -5.0], [4.0, 3.0, -1.0]], [[-3.0, -1.0, 5.0], [2.0, -3.0, -2.0]]], [[[7.0, 0.0, 3.0], [-1.0, -2.0, 0.0]], [[1.0, 7.0, -6.0], [0.0, 0.0, -5.0]], [[4.0, -7.0, -3.0], [0.0, 4.0, 6.0]], [[1.0, 1.0, -6.0], [3.0, 5.0, 4.0]], [[0.0, 3.0, -6.0], [-7.0, -1.0, 7.0]]], [[[7.0, 0.0, -1.0], [-1.0, 4.0, 3.0]], [[-5.0, 0.0, 0.0], [1.0, -5.0, -3.0]], [[-6.0, 0.0, -6.0], [-5.0, -2.0, -2.0]], [[-4.0, 6.0, 7.0], [-7.0, -4.0, 0.0]], [[7.0, -6.0, 4.0], [-7.0, -7.0, 1.0]]]])+(1.-msk_arg0)*numarray.array([[[[7.0, 1.0, 7.0], [3.0, -2.0, -1.0]], [[-7.0, -3.0, 2.0], [7.0, -3.0, 7.0]], [[0.0, 3.0, 3.0], [0.0, 3.0, -6.0]], [[6.0, 6.0, 6.0], [-4.0, -2.0, -1.0]], [[-1.0, 1.0, -6.0], [6.0, 0.0, 6.0]]], [[[3.0, -5.0, -4.0], [2.0, 4.0, -6.0]], [[-5.0, 2.0, -6.0], [-2.0, -5.0, 7.0]], [[3.0, -7.0, -4.0], [7.0, -3.0, -4.0]], [[-3.0, -1.0, -1.0], [0.0, 2.0, 0.0]], [[-5.0, -3.0, -7.0], [-2.0, -3.0, 1.0]]], [[[3.0, 0.0, 2.0], [-2.0, 1.0, 0.0]], [[0.0, 6.0, -7.0], [-6.0, -1.0, -1.0]], [[0.0, -5.0, -4.0], [-3.0, 1.0, -3.0]], [[-6.0, -3.0, 0.0], [1.0, -2.0, -3.0]], [[-1.0, -2.0, 4.0], [5.0, 7.0, -1.0]]], [[[-4.0, 5.0, -3.0], [-2.0, -5.0, -7.0]], [[-1.0, 5.0, 7.0], [-5.0, 0.0, -3.0]], [[-3.0, 6.0, 6.0], [0.0, -1.0, 1.0]], [[4.0, 6.0, 4.0], [7.0, 7.0, -3.0]], [[7.0, -6.0, 3.0], [6.0, 0.0, 4.0]]]])
29256          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29257          arg1=msk_arg1*numarray.array([[[-5.0, 0.0], [-2.0, -6.0], [-3.0, 6.0]], [[1.0, 5.0], [3.0, 0.0], [5.0, 3.0]]])+(1.-msk_arg1)*numarray.array([[[-7.0, 5.0], [7.0, -2.0], [6.0, 2.0]], [[-7.0, 3.0], [6.0, 0.0], [-7.0, -7.0]]])
29258          res=tensor_mult(arg0,arg1)
29259          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29260          ref=msk_ref*numarray.array([[[-22.0, 1.0], [27.0, 103.0], [21.0, 21.0], [21.0, -13.0], [2.0, 28.0]], [[-32.0, -24.0], [-34.0, -18.0], [-9.0, -7.0], [31.0, 11.0], [-15.0, 40.0]], [[-51.0, 13.0], [-26.0, -93.0], [45.0, 42.0], [49.0, -15.0], [37.0, -68.0]], [[-6.0, -2.0], [-4.0, -4.0], [27.0, -67.0], [-32.0, -29.0], [-58.0, 28.0]]])+(1.-msk_ref)*numarray.array([[[-26.0, 63.0], [-76.0, -53.0], [99.0, 42.0], [59.0, 25.0], [-106.0, -43.0]], [[-28.0, 65.0], [-52.0, -96.0], [-133.0, 70.0], [20.0, -15.0], [-39.0, -46.0]], [[11.0, 13.0], [43.0, -37.0], [-11.0, 14.0], [23.0, 0.0], [31.0, 29.0]], [[78.0, 7.0], [140.0, 5.0], [86.0, -22.0], [52.0, 58.0], [-143.0, 43.0]]])
29261          self.failUnless(isinstance(res,Data),"wrong type of result.")
29262          self.failUnlessEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")
29263          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29264       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29265       def test_tensor_mult_expandedData_rank4_expandedData_rank4(self):
29266          msk_arg0=1-whereZero(self.functionspace.getX()[0],1.e-8)
29267          arg0=msk_arg0*numarray.array([[[[4.0, -3.0, -5.0], [0.0, 4.0, -6.0]], [[7.0, -1.0, 2.0], [-5.0, 2.0, -3.0]], [[7.0, -1.0, 0.0], [0.0, -2.0, 0.0]], [[0.0, 7.0, 2.0], [-1.0, 5.0, 2.0]], [[0.0, 6.0, -7.0], [-7.0, 7.0, -7.0]]], [[[2.0, -6.0, 2.0], [-7.0, -5.0, 3.0]], [[-4.0, -1.0, 1.0], [3.0, 1.0, -5.0]], [[5.0, 6.0, -6.0], [-2.0, -7.0, -5.0]], [[7.0, 6.0, 4.0], [-4.0, -3.0, 4.0]], [[-4.0, 6.0, -1.0], [-4.0, -7.0, 4.0]]], [[[7.0, 4.0, 0.0], [2.0, -5.0, 4.0]], [[2.0, 3.0, 0.0], [2.0, 6.0, 2.0]], [[-2.0, 6.0, -1.0], [0.0, 7.0, -7.0]], [[3.0, -5.0, -6.0], [-5.0, -2.0, 7.0]], [[7.0, -6.0, 2.0], [-5.0, 5.0, -7.0]]], [[[4.0, -4.0, -1.0], [-1.0, 0.0, 5.0]], [[0.0, 7.0, 0.0], [2.0, 6.0, -3.0]], [[0.0, 5.0, 6.0], [0.0, -6.0, 0.0]], [[0.0, -2.0, -3.0], [-7.0, 5.0, -5.0]], [[0.0, 5.0, 5.0], [-6.0, 3.0, 5.0]]]])+(1.-msk_arg0)*numarray.array([[[[6.0, -7.0, -2.0], [-1.0, 6.0, -3.0]], [[0.0, 3.0, 0.0], [-4.0, -5.0, 1.0]], [[-5.0, 7.0, 4.0], [3.0, -5.0, 2.0]], [[0.0, -1.0, -3.0], [3.0, 5.0, -4.0]], [[5.0, -6.0, 2.0], [4.0, 4.0, 3.0]]], [[[-4.0, 3.0, 7.0], [-6.0, -7.0, -6.0]], [[-1.0, 0.0, -5.0], [6.0, 2.0, 6.0]], [[2.0, 4.0, 6.0], [-2.0, -2.0, -7.0]], [[-4.0, 2.0, -4.0], [-5.0, 1.0, -7.0]], [[-7.0, -3.0, -5.0], [1.0, 2.0, 7.0]]], [[[-6.0, 6.0, -7.0], [-3.0, -1.0, 3.0]], [[4.0, 2.0, 4.0], [0.0, -2.0, -7.0]], [[4.0, -1.0, 1.0], [0.0, -4.0, 0.0]], [[-5.0, -6.0, 7.0], [0.0, 3.0, 3.0]], [[7.0, -5.0, 7.0], [4.0, -3.0, 4.0]]], [[[7.0, -2.0, 5.0], [5.0, 1.0, 5.0]], [[-5.0, -1.0, 1.0], [-2.0, -5.0, -5.0]], [[-6.0, 5.0, 0.0], [-2.0, 6.0, -5.0]], [[-4.0, 2.0, -6.0], [1.0, -2.0, 1.0]], [[0.0, 0.0, -2.0], [-3.0, -2.0, 5.0]]]])
29268          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29269          arg1=msk_arg1*numarray.array([[[[-1.0, -5.0, 2.0, -7.0, -3.0], [-5.0, 7.0, -1.0, -2.0, -6.0], [6.0, -1.0, -1.0, -3.0, -4.0], [6.0, -1.0, -5.0, 0.0, 6.0]], [[-5.0, -1.0, -5.0, -6.0, 5.0], [3.0, 0.0, -3.0, -1.0, 3.0], [7.0, -3.0, 5.0, -1.0, -1.0], [4.0, 6.0, 0.0, -5.0, 0.0]], [[-5.0, 0.0, 3.0, -1.0, 2.0], [-5.0, -6.0, 0.0, 0.0, 1.0], [-4.0, -6.0, 7.0, 4.0, 0.0], [-2.0, 4.0, 1.0, 0.0, -6.0]]], [[[4.0, -2.0, 0.0, -6.0, 5.0], [1.0, -7.0, 0.0, 5.0, -1.0], [-6.0, 0.0, -3.0, -3.0, 4.0], [2.0, -6.0, 0.0, -1.0, 2.0]], [[4.0, -3.0, 6.0, -3.0, 0.0], [-4.0, 2.0, -7.0, 1.0, 7.0], [7.0, 3.0, 1.0, 7.0, -1.0], [-2.0, -1.0, 6.0, -2.0, -1.0]], [[3.0, 7.0, 7.0, 1.0, -4.0], [-4.0, 2.0, -6.0, -7.0, -1.0], [0.0, -6.0, 0.0, -7.0, 4.0], [0.0, -3.0, -7.0, -2.0, 5.0]]]])+(1.-msk_arg1)*numarray.array([[[[6.0, -1.0, 3.0, -4.0, 4.0], [7.0, 4.0, 5.0, 6.0, -1.0], [-2.0, 3.0, -5.0, 7.0, -4.0], [-6.0, 1.0, -5.0, -5.0, 6.0]], [[-6.0, -4.0, -4.0, 3.0, 6.0], [-6.0, 0.0, 6.0, -2.0, 6.0], [-7.0, -3.0, 7.0, -4.0, 3.0], [3.0, -4.0, 1.0, 2.0, -4.0]], [[5.0, 3.0, -2.0, 2.0, -7.0], [1.0, 1.0, 1.0, 2.0, 2.0], [-7.0, 6.0, 2.0, 0.0, -4.0], [6.0, 6.0, 2.0, 5.0, -3.0]]], [[[7.0, -5.0, -4.0, -4.0, 3.0], [-6.0, -2.0, -2.0, 1.0, -6.0], [-5.0, 5.0, -5.0, 4.0, -4.0], [5.0, 1.0, -1.0, 0.0, 2.0]], [[-7.0, -1.0, -4.0, -5.0, 7.0], [7.0, -6.0, -4.0, -7.0, 3.0], [-6.0, -6.0, 7.0, -1.0, 2.0], [1.0, 0.0, 5.0, 1.0, -5.0]], [[-7.0, 0.0, 0.0, -4.0, -1.0], [-1.0, -1.0, 7.0, -2.0, 6.0], [2.0, 0.0, 0.0, 3.0, -7.0], [1.0, -6.0, 1.0, 6.0, 0.0]]]])
29270          res=tensor_mult(arg0,arg1)
29271          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29272          ref=msk_ref*numarray.array([[[[34.0, -71.0, -10.0, -23.0, -13.0], [4.0, 54.0, 13.0, 41.0, -4.0], [51.0, 83.0, -50.0, 41.0, -41.0], [14.0, -28.0, 41.0, 19.0, 20.0]], [[-33.0, -51.0, 16.0, -24.0, -35.0], [-49.0, 70.0, 0.0, -15.0, -21.0], [71.0, 8.0, 19.0, 38.0, -61.0], [20.0, 32.0, 0.0, 12.0, 3.0]], [[-10.0, -28.0, 7.0, -37.0, -26.0], [-30.0, 45.0, 10.0, -15.0, -59.0], [21.0, -10.0, -14.0, -34.0, -25.0], [42.0, -11.0, -47.0, 9.0, 44.0]], [[-23.0, -6.0, 15.0, -51.0, 26.0], [-18.0, 9.0, -68.0, -21.0, 57.0], [82.0, -30.0, 57.0, 25.0, -8.0], [12.0, 45.0, 18.0, -48.0, -9.0]], [[-16.0, -62.0, -58.0, -15.0, 9.0], [46.0, 91.0, -25.0, 15.0, 74.0], [161.0, 87.0, 9.0, 85.0, -69.0], [10.0, 64.0, 84.0, -23.0, -14.0]]], [[[-21.0, 46.0, 31.0, 80.0, -79.0], [-37.0, 47.0, 33.0, -59.0, -59.0], [-31.0, -29.0, -2.0, -27.0, -13.0], [-20.0, 8.0, -59.0, 41.0, 6.0]], [[5.0, -23.0, -29.0, 7.0, 44.0], [31.0, -63.0, 30.0, 60.0, 31.0], [-46.0, 34.0, -2.0, 50.0, 8.0], [-26.0, -2.0, 62.0, 10.0, -50.0]], [[-56.0, -41.0, -115.0, -37.0, 13.0], [69.0, 61.0, 56.0, 2.0, -60.0], [59.0, 22.0, -18.0, -53.0, -47.0], [76.0, 41.0, -38.0, -4.0, 44.0]], [[-73.0, 4.0, 6.0, -52.0, -19.0], [-45.0, 55.0, -28.0, -71.0, -41.0], [71.0, -82.0, 60.0, -48.0, -31.0], [56.0, 60.0, -77.0, -28.0, 33.0]], [[-53.0, 71.0, -55.0, 42.0, 4.0], [51.0, 0.0, 11.0, -53.0, -8.0], [-3.0, -53.0, 32.0, -63.0, 17.0], [8.0, 55.0, -51.0, -20.0, 1.0]]], [[[-27.0, 0.0, -8.0, -66.0, -7.0], [-17.0, 33.0, -8.0, -41.0, -71.0], [23.0, -58.0, 2.0, -94.0, -3.0], [72.0, -2.0, -93.0, -20.0, 71.0]], [[21.0, -21.0, 39.0, -60.0, 11.0], [-31.0, 16.0, -65.0, -5.0, 35.0], [63.0, -5.0, 13.0, 13.0, -1.0], [16.0, -8.0, 12.0, -33.0, 20.0]], [[-16.0, -66.0, -44.0, -49.0, 62.0], [33.0, -8.0, -23.0, 54.0, 85.0], [83.0, 53.0, 32.0, 94.0, -33.0], [0.0, 48.0, 100.0, -30.0, -48.0]], [[45.0, 55.0, 50.0, 58.0, -99.0], [-25.0, 102.0, -16.0, -77.0, -55.0], [23.0, 0.0, -57.0, -76.0, 3.0], [4.0, -46.0, -82.0, 20.0, 81.0]], [[-8.0, -83.0, 31.0, -7.0, -44.0], [-60.0, 68.0, 18.0, 21.0, -11.0], [57.0, 56.0, -3.0, 92.0, -75.0], [-6.0, 11.0, 46.0, 39.0, -20.0]]], [[[32.0, 21.0, 60.0, 8.0, -59.0], [-48.0, 51.0, -22.0, -44.0, -41.0], [6.0, -16.0, -28.0, -44.0, 4.0], [8.0, -41.0, -56.0, 11.0, 53.0]], [[-12.0, -50.0, -20.0, -75.0, 57.0], [11.0, -8.0, -45.0, 30.0, 64.0], [79.0, 15.0, 35.0, 50.0, -17.0], [20.0, 33.0, 57.0, -43.0, -17.0]], [[-79.0, 13.0, -43.0, -18.0, 37.0], [9.0, -48.0, 27.0, -11.0, -21.0], [-31.0, -69.0, 61.0, -23.0, 1.0], [20.0, 60.0, -30.0, -13.0, -30.0]], [[2.0, -34.0, -4.0, 37.0, -31.0], [2.0, 67.0, 1.0, 7.0, 38.0], [75.0, 69.0, -5.0, 81.0, -51.0], [-26.0, 28.0, 62.0, 17.0, -26.0]], [[-47.0, 33.0, 43.0, -3.0, -15.0], [-48.0, 28.0, -66.0, -67.0, 42.0], [72.0, -66.0, 81.0, 19.0, -12.0], [-8.0, 68.0, -12.0, -35.0, -20.0]]]])+(1.-msk_ref)*numarray.array([[[[40.0, 15.0, 30.0, -63.0, 38.0], [133.0, -9.0, -57.0, 9.0, -46.0], [14.0, -14.0, -36.0, 51.0, 0.0], [-71.0, 39.0, -13.0, -66.0, 38.0]], [[-18.0, 13.0, 24.0, 46.0, -30.0], [-30.0, 37.0, 53.0, 23.0, 33.0], [31.0, 1.0, 6.0, -20.0, 8.0], [-15.0, -22.0, -17.0, 7.0, 5.0]], [[-10.0, -21.0, -43.0, 54.0, -34.0], [-128.0, 6.0, 49.0, -2.0, 34.0], [-48.0, 33.0, 32.0, -40.0, -11.0], [87.0, -18.0, 14.0, 66.0, -39.0]], [[5.0, -25.0, -22.0, -30.0, 63.0], [24.0, -35.0, -63.0, -28.0, -39.0], [-25.0, -30.0, 7.0, -1.0, 35.0], [-5.0, 13.0, 11.0, -36.0, -6.0]], [[55.0, 1.0, 3.0, -82.0, 7.0], [74.0, -13.0, -12.0, 16.0, -31.0], [-20.0, 41.0, -55.0, 80.0, -75.0], [-9.0, 27.0, -8.0, -5.0, 36.0]]], [[[42.0, 50.0, 14.0, 122.0, -108.0], [-46.0, 51.0, 3.0, 39.0, 15.0], [-2.0, 33.0, 36.0, -75.0, 49.0], [32.0, 56.0, 2.0, 18.0, -34.0]], [[-45.0, -46.0, -25.0, -64.0, 57.0], [-40.0, -39.0, 12.0, -36.0, -3.0], [7.0, -15.0, -21.0, 33.0, -38.0], [14.0, -61.0, 5.0, 18.0, 11.0]], [[67.0, 12.0, -6.0, 62.0, -23.0], [1.0, 37.0, 3.0, 42.0, -2.0], [-66.0, 32.0, 26.0, -29.0, 33.0], [17.0, 62.0, -9.0, -16.0, -16.0]], [[-49.0, 8.0, 4.0, 57.0, 23.0], [0.0, -9.0, -55.0, -34.0, -1.0], [27.0, -73.0, 58.0, -78.0, 109.0], [-25.0, 1.0, 17.0, -37.0, -35.0]], [[-105.0, -3.0, -11.0, -33.0, -1.0], [-35.0, -54.0, -19.0, -73.0, 21.0], [67.0, -49.0, 13.0, -14.0, -10.0], [17.0, -66.0, 38.0, 48.0, -23.0]]], [[[-142.0, -23.0, -12.0, 33.0, 42.0], [-77.0, -22.0, 30.0, -64.0, 61.0], [46.0, -87.0, 66.0, -68.0, 59.0], [-1.0, -93.0, 23.0, 24.0, -40.0]], [[95.0, 2.0, 4.0, 36.0, -7.0], [13.0, 39.0, -5.0, 56.0, -32.0], [-52.0, 42.0, -12.0, 1.0, 19.0], [-3.0, 62.0, -27.0, -40.0, 14.0]], [[63.0, 7.0, 30.0, 3.0, -25.0], [7.0, 41.0, 31.0, 56.0, -20.0], [16.0, 45.0, -53.0, 36.0, -31.0], [-25.0, 14.0, -39.0, -21.0, 45.0]], [[-1.0, 47.0, -17.0, -11.0, -87.0], [26.0, -34.0, -45.0, -31.0, 10.0], [-9.0, 27.0, 18.0, -5.0, -41.0], [60.0, 43.0, 51.0, 69.0, -42.0]], [[128.0, 17.0, 23.0, -46.0, -64.0], [37.0, 41.0, 44.0, 83.0, -32.0], [-22.0, 116.0, -97.0, 100.0, -121.0], [6.0, 49.0, -41.0, 11.0, 64.0]]], [[[72.0, -10.0, -5.0, -69.0, -2.0], [38.0, 12.0, 49.0, 44.0, -6.0], [-56.0, 76.0, -57.0, 91.0, -107.0], [13.0, 20.0, -22.0, 17.0, 40.0]], [[37.0, 27.0, 15.0, 72.0, -69.0], [-46.0, 20.0, -41.0, 17.0, -32.0], [40.0, 14.0, -5.0, -49.0, 46.0], [13.0, 33.0, -2.0, -7.0, -8.0]], [[-87.0, -10.0, -54.0, 37.0, 47.0], [-13.0, -51.0, -55.0, -80.0, 36.0], [-59.0, -79.0, 117.0, -91.0, 94.0], [42.0, 2.0, 62.0, 16.0, -90.0]], [[-52.0, -25.0, -4.0, 12.0, 26.0], [-67.0, -13.0, -1.0, -27.0, -2.0], [45.0, -37.0, 3.0, -27.0, 31.0], [-2.0, -53.0, 0.0, -2.0, -2.0]], [[-52.0, 11.0, 24.0, -2.0, -14.0], [-3.0, 11.0, 47.0, -3.0, 38.0], [51.0, -15.0, -3.0, 5.0, -19.0], [-24.0, -45.0, -6.0, 18.0, 10.0]]]])
29273          self.failUnless(isinstance(res,Data),"wrong type of result.")
29274          self.failUnlessEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")
29275          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29276       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29277       def test_generalTensorProduct_float_rank0_float_rank0_offset0(self):
29278          arg0=7.0
29279          arg1=6.0
29280          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29281          ref=42.0
29282          self.failUnless(isinstance(res,float),"wrong type of result.")
29283          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29284       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29285       def test_generalTensorProduct_float_rank0_array_rank0_offset0(self):
29286          arg0=0.0
29287          arg1=numarray.array(-6.0)
29288          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29289          ref=numarray.array(-0.0)
29290          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29291          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29292          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29293       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29294       def test_generalTensorProduct_float_rank0_array_rank1_offset0(self):
29295          arg0=-2.0
29296          arg1=numarray.array([-7.0, -5.0])
29297          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29298          ref=numarray.array([14.0, 10.0])
29299          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29300          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
29301          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29302       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29303       def test_generalTensorProduct_float_rank0_array_rank2_offset0(self):
29304          arg0=-3.0
29305          arg1=numarray.array([[0.0, -4.0, 2.0, -7.0, -3.0], [-7.0, 4.0, -1.0, 3.0, 0.0], [3.0, 4.0, -3.0, 7.0, -4.0], [5.0, 4.0, 4.0, 0.0, 3.0]])
29306          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29307          ref=numarray.array([[-0.0, 12.0, -6.0, 21.0, 9.0], [21.0, -12.0, 3.0, -9.0, -0.0], [-9.0, -12.0, 9.0, -21.0, 12.0], [-15.0, -12.0, -12.0, -0.0, -9.0]])
29308          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29309          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
29310          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29311       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29312       def test_generalTensorProduct_float_rank0_array_rank3_offset0(self):
29313          arg0=-6.0
29314          arg1=numarray.array([[[-4.0, 7.0], [-1.0, -3.0]], [[3.0, -1.0], [-5.0, -6.0]], [[-6.0, 6.0], [5.0, -5.0]], [[0.0, 6.0], [7.0, 7.0]], [[-6.0, 7.0], [4.0, 5.0]], [[6.0, 1.0], [-5.0, 2.0]]])
29315          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29316          ref=numarray.array([[[24.0, -42.0], [6.0, 18.0]], [[-18.0, 6.0], [30.0, 36.0]], [[36.0, -36.0], [-30.0, 30.0]], [[-0.0, -36.0], [-42.0, -42.0]], [[36.0, -42.0], [-24.0, -30.0]], [[-36.0, -6.0], [30.0, -12.0]]])
29317          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29318          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
29319          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29320       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29321       def test_generalTensorProduct_float_rank0_array_rank4_offset0(self):
29322          arg0=7.0
29323          arg1=numarray.array([[[[0.0, -7.0, -6.0, 5.0], [-5.0, 2.0, 6.0, 0.0], [0.0, 1.0, -1.0, -1.0]], [[0.0, -2.0, -1.0, 3.0], [-4.0, 0.0, 2.0, -3.0], [-3.0, -6.0, -3.0, -2.0]]], [[[6.0, 7.0, 5.0, 5.0], [5.0, 1.0, 0.0, -3.0], [0.0, 0.0, -1.0, 0.0]], [[-6.0, 1.0, -7.0, -3.0], [7.0, 7.0, -5.0, 6.0], [-7.0, 1.0, 0.0, 0.0]]], [[[2.0, -2.0, 6.0, -6.0], [-7.0, 2.0, 0.0, -2.0], [3.0, -6.0, -3.0, 1.0]], [[-6.0, 1.0, 2.0, 3.0], [-2.0, 5.0, 4.0, 1.0], [4.0, 0.0, -2.0, -2.0]]]])
29324          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29325          ref=numarray.array([[[[0.0, -49.0, -42.0, 35.0], [-35.0, 14.0, 42.0, 0.0], [0.0, 7.0, -7.0, -7.0]], [[0.0, -14.0, -7.0, 21.0], [-28.0, 0.0, 14.0, -21.0], [-21.0, -42.0, -21.0, -14.0]]], [[[42.0, 49.0, 35.0, 35.0], [35.0, 7.0, 0.0, -21.0], [0.0, 0.0, -7.0, 0.0]], [[-42.0, 7.0, -49.0, -21.0], [49.0, 49.0, -35.0, 42.0], [-49.0, 7.0, 0.0, 0.0]]], [[[14.0, -14.0, 42.0, -42.0], [-49.0, 14.0, 0.0, -14.0], [21.0, -42.0, -21.0, 7.0]], [[-42.0, 7.0, 14.0, 21.0], [-14.0, 35.0, 28.0, 7.0], [28.0, 0.0, -14.0, -14.0]]]])
29326          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29327          self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
29328          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29329       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29330       def test_generalTensorProduct_float_rank0_Symbol_rank0_offset0(self):
29331          arg0=-4.0
29332          arg1=Symbol(shape=())
29333          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29334          s1=numarray.array(0.0)
29335          sub=res.substitute({arg1:s1})
29336          ref=numarray.array(-0.0)
29337          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29338          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29339          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29340       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29341       def test_generalTensorProduct_float_rank0_Symbol_rank1_offset0(self):
29342          arg0=-3.0
29343          arg1=Symbol(shape=(2,))
29344          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29345          s1=numarray.array([4.0, 4.0])
29346          sub=res.substitute({arg1:s1})
29347          ref=numarray.array([-12.0, -12.0])
29348          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29349          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29350          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29351       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29352       def test_generalTensorProduct_float_rank0_Symbol_rank2_offset0(self):
29353          arg0=-3.0
29354          arg1=Symbol(shape=(4, 5))
29355          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29356          s1=numarray.array([[0.0, 3.0, 4.0, 7.0, -6.0], [3.0, 1.0, 2.0, 1.0, 7.0], [7.0, -6.0, 6.0, 7.0, 7.0], [0.0, 4.0, 6.0, 0.0, 1.0]])
29357          sub=res.substitute({arg1:s1})
29358          ref=numarray.array([[-0.0, -9.0, -12.0, -21.0, 18.0], [-9.0, -3.0, -6.0, -3.0, -21.0], [-21.0, 18.0, -18.0, -21.0, -21.0], [-0.0, -12.0, -18.0, -0.0, -3.0]])
29359          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29360          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29361          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29362       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29363       def test_generalTensorProduct_float_rank0_Symbol_rank3_offset0(self):
29364          arg0=-3.0
29365          arg1=Symbol(shape=(6, 2, 2))
29366          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29367          s1=numarray.array([[[-2.0, 6.0], [3.0, 4.0]], [[-5.0, 7.0], [7.0, 1.0]], [[1.0, 0.0], [0.0, -7.0]], [[0.0, 5.0], [2.0, 7.0]], [[0.0, -1.0], [-6.0, 0.0]], [[4.0, -1.0], [5.0, -6.0]]])
29368          sub=res.substitute({arg1:s1})
29369          ref=numarray.array([[[6.0, -18.0], [-9.0, -12.0]], [[15.0, -21.0], [-21.0, -3.0]], [[-3.0, -0.0], [-0.0, 21.0]], [[-0.0, -15.0], [-6.0, -21.0]], [[-0.0, 3.0], [18.0, -0.0]], [[-12.0, 3.0], [-15.0, 18.0]]])
29370          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29371          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29372          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29373       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29374       def test_generalTensorProduct_float_rank0_Symbol_rank4_offset0(self):
29375          arg0=7.0
29376          arg1=Symbol(shape=(3, 2, 3, 4))
29377          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29378          s1=numarray.array([[[[3.0, -4.0, 1.0, 4.0], [-1.0, -1.0, -6.0, 0.0], [-6.0, -4.0, -1.0, -6.0]], [[-4.0, 2.0, 2.0, 7.0], [4.0, -7.0, 0.0, 3.0], [0.0, 3.0, 2.0, 5.0]]], [[[-5.0, -3.0, -2.0, -6.0], [0.0, -5.0, -5.0, 0.0], [-7.0, 1.0, -3.0, -5.0]], [[1.0, -4.0, 1.0, -7.0], [4.0, -3.0, 4.0, -6.0], [4.0, -2.0, 0.0, 3.0]]], [[[-7.0, 5.0, -3.0, -6.0], [-2.0, 5.0, -3.0, -2.0], [5.0, 7.0, -5.0, 5.0]], [[-2.0, -3.0, -6.0, -6.0], [1.0, 4.0, 3.0, 3.0], [-1.0, -4.0, 2.0, -4.0]]]])
29379          sub=res.substitute({arg1:s1})
29380          ref=numarray.array([[[[21.0, -28.0, 7.0, 28.0], [-7.0, -7.0, -42.0, 0.0], [-42.0, -28.0, -7.0, -42.0]], [[-28.0, 14.0, 14.0, 49.0], [28.0, -49.0, 0.0, 21.0], [0.0, 21.0, 14.0, 35.0]]], [[[-35.0, -21.0, -14.0, -42.0], [0.0, -35.0, -35.0, 0.0], [-49.0, 7.0, -21.0, -35.0]], [[7.0, -28.0, 7.0, -49.0], [28.0, -21.0, 28.0, -42.0], [28.0, -14.0, 0.0, 21.0]]], [[[-49.0, 35.0, -21.0, -42.0], [-14.0, 35.0, -21.0, -14.0], [35.0, 49.0, -35.0, 35.0]], [[-14.0, -21.0, -42.0, -42.0], [7.0, 28.0, 21.0, 21.0], [-7.0, -28.0, 14.0, -28.0]]]])
29381          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29382          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
29383          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29384       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29385       def test_generalTensorProduct_float_rank0_constData_rank0_offset0(self):
29386          arg0=7.0
29387          arg1=Data(-4.0,self.functionspace)
29388          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29389          ref=Data(-28.0,self.functionspace)
29390          self.failUnless(isinstance(res,Data),"wrong type of result.")
29391          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29392          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29393       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29394       def test_generalTensorProduct_float_rank0_constData_rank1_offset0(self):
29395          arg0=3.0
29396          arg1=Data(numarray.array([-1.0, -6.0]),self.functionspace)
29397          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29398          ref=Data(numarray.array([-3.0, -18.0]),self.functionspace)
29399          self.failUnless(isinstance(res,Data),"wrong type of result.")
29400          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29401          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29402       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29403       def test_generalTensorProduct_float_rank0_constData_rank2_offset0(self):
29404          arg0=-1.0
29405          arg1=Data(numarray.array([[-7.0, 0.0, -7.0, -1.0, -4.0], [0.0, -4.0, -1.0, 3.0, 0.0], [4.0, -5.0, 6.0, -3.0, 0.0], [0.0, -2.0, 3.0, -2.0, 4.0]]),self.functionspace)
29406          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29407          ref=Data(numarray.array([[7.0, -0.0, 7.0, 1.0, 4.0], [-0.0, 4.0, 1.0, -3.0, -0.0], [-4.0, 5.0, -6.0, 3.0, -0.0], [-0.0, 2.0, -3.0, 2.0, -4.0]]),self.functionspace)
29408          self.failUnless(isinstance(res,Data),"wrong type of result.")
29409          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29410          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29411       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29412       def test_generalTensorProduct_float_rank0_constData_rank3_offset0(self):
29413          arg0=-6.0
29414          arg1=Data(numarray.array([[[-6.0, 2.0], [4.0, 2.0]], [[-5.0, -2.0], [-4.0, -3.0]], [[-6.0, 2.0], [-1.0, -4.0]], [[0.0, 0.0], [0.0, 3.0]], [[5.0, 5.0], [-7.0, -6.0]], [[0.0, 5.0], [6.0, 3.0]]]),self.functionspace)
29415          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29416          ref=Data(numarray.array([[[36.0, -12.0], [-24.0, -12.0]], [[30.0, 12.0], [24.0, 18.0]], [[36.0, -12.0], [6.0, 24.0]], [[-0.0, -0.0], [-0.0, -18.0]], [[-30.0, -30.0], [42.0, 36.0]], [[-0.0, -30.0], [-36.0, -18.0]]]),self.functionspace)
29417          self.failUnless(isinstance(res,Data),"wrong type of result.")
29418          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29419          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29420       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29421       def test_generalTensorProduct_float_rank0_constData_rank4_offset0(self):
29422          arg0=-6.0
29423          arg1=Data(numarray.array([[[[7.0, 1.0, -7.0, 0.0], [-6.0, 0.0, -5.0, 4.0], [-6.0, 7.0, 0.0, -5.0]], [[2.0, 3.0, 5.0, -4.0], [7.0, -3.0, 0.0, -6.0], [2.0, -6.0, 7.0, 2.0]]], [[[3.0, 0.0, 1.0, -2.0], [-4.0, -1.0, 0.0, -5.0], [7.0, 3.0, 0.0, -6.0]], [[-7.0, -1.0, 1.0, -7.0], [7.0, 4.0, -1.0, -3.0], [5.0, -2.0, 2.0, 6.0]]], [[[-3.0, -1.0, 7.0, 0.0], [0.0, 6.0, 5.0, 0.0], [2.0, -7.0, 3.0, -4.0]], [[-5.0, 3.0, 5.0, 2.0], [-5.0, 1.0, 3.0, -2.0], [2.0, -3.0, 5.0, -5.0]]]]),self.functionspace)
29424          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29425          ref=Data(numarray.array([[[[-42.0, -6.0, 42.0, -0.0], [36.0, -0.0, 30.0, -24.0], [36.0, -42.0, -0.0, 30.0]], [[-12.0, -18.0, -30.0, 24.0], [-42.0, 18.0, -0.0, 36.0], [-12.0, 36.0, -42.0, -12.0]]], [[[-18.0, -0.0, -6.0, 12.0], [24.0, 6.0, -0.0, 30.0], [-42.0, -18.0, -0.0, 36.0]], [[42.0, 6.0, -6.0, 42.0], [-42.0, -24.0, 6.0, 18.0], [-30.0, 12.0, -12.0, -36.0]]], [[[18.0, 6.0, -42.0, -0.0], [-0.0, -36.0, -30.0, -0.0], [-12.0, 42.0, -18.0, 24.0]], [[30.0, -18.0, -30.0, -12.0], [30.0, -6.0, -18.0, 12.0], [-12.0, 18.0, -30.0, 30.0]]]]),self.functionspace)
29426          self.failUnless(isinstance(res,Data),"wrong type of result.")
29427          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
29428          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29429       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29430       def test_generalTensorProduct_float_rank0_expandedData_rank0_offset0(self):
29431          arg0=7.0
29432          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29433          arg1=msk_arg1*(-6.0)+(1-msk_arg1)*(-3.0)
29434          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29435          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29436          ref=msk_ref*numarray.array(-42.0)+(1.-msk_ref)*numarray.array(-21.0)
29437          self.failUnless(isinstance(res,Data),"wrong type of result.")
29438          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29439          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29440       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29441       def test_generalTensorProduct_float_rank0_expandedData_rank1_offset0(self):
29442          arg0=-6.0
29443          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29444          arg1=msk_arg1*numarray.array([7.0, 2.0])+(1.-msk_arg1)*numarray.array([0.0, -5.0])
29445          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29446          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29447          ref=msk_ref*numarray.array([-42.0, -12.0])+(1.-msk_ref)*numarray.array([-0.0, 30.0])
29448          self.failUnless(isinstance(res,Data),"wrong type of result.")
29449          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29450          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29451       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29452       def test_generalTensorProduct_float_rank0_expandedData_rank2_offset0(self):
29453          arg0=-1.0
29454          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29455          arg1=msk_arg1*numarray.array([[1.0, 6.0, 6.0, 7.0, 0.0], [7.0, -4.0, 4.0, -2.0, 7.0], [-1.0, -6.0, 5.0, -5.0, 7.0], [-2.0, 0.0, -4.0, 3.0, 3.0]])+(1.-msk_arg1)*numarray.array([[-5.0, 4.0, 5.0, -2.0, 7.0], [-6.0, 1.0, -3.0, 3.0, 0.0], [-4.0, 0.0, 5.0, -3.0, 0.0], [-2.0, 6.0, -7.0, 0.0, -1.0]])
29456          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29457          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29458          ref=msk_ref*numarray.array([[-1.0, -6.0, -6.0, -7.0, -0.0], [-7.0, 4.0, -4.0, 2.0, -7.0], [1.0, 6.0, -5.0, 5.0, -7.0], [2.0, -0.0, 4.0, -3.0, -3.0]])+(1.-msk_ref)*numarray.array([[5.0, -4.0, -5.0, 2.0, -7.0], [6.0, -1.0, 3.0, -3.0, -0.0], [4.0, -0.0, -5.0, 3.0, -0.0], [2.0, -6.0, 7.0, -0.0, 1.0]])
29459          self.failUnless(isinstance(res,Data),"wrong type of result.")
29460          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29461          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29462       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29463       def test_generalTensorProduct_float_rank0_expandedData_rank3_offset0(self):
29464          arg0=7.0
29465          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29466          arg1=msk_arg1*numarray.array([[[0.0, -5.0], [-6.0, 0.0]], [[3.0, -7.0], [4.0, -1.0]], [[1.0, -6.0], [-6.0, -6.0]], [[0.0, -4.0], [-6.0, 7.0]], [[-3.0, 7.0], [-6.0, 1.0]], [[-2.0, 3.0], [-6.0, 0.0]]])+(1.-msk_arg1)*numarray.array([[[-5.0, -4.0], [2.0, 1.0]], [[0.0, 0.0], [-7.0, -4.0]], [[-6.0, -1.0], [3.0, -3.0]], [[-4.0, -6.0], [5.0, 1.0]], [[-5.0, 7.0], [-4.0, 0.0]], [[7.0, -7.0], [2.0, -3.0]]])
29467          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29468          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29469          ref=msk_ref*numarray.array([[[0.0, -35.0], [-42.0, 0.0]], [[21.0, -49.0], [28.0, -7.0]], [[7.0, -42.0], [-42.0, -42.0]], [[0.0, -28.0], [-42.0, 49.0]], [[-21.0, 49.0], [-42.0, 7.0]], [[-14.0, 21.0], [-42.0, 0.0]]])+(1.-msk_ref)*numarray.array([[[-35.0, -28.0], [14.0, 7.0]], [[0.0, 0.0], [-49.0, -28.0]], [[-42.0, -7.0], [21.0, -21.0]], [[-28.0, -42.0], [35.0, 7.0]], [[-35.0, 49.0], [-28.0, 0.0]], [[49.0, -49.0], [14.0, -21.0]]])
29470          self.failUnless(isinstance(res,Data),"wrong type of result.")
29471          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29472          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29473       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29474       def test_generalTensorProduct_float_rank0_expandedData_rank4_offset0(self):
29475          arg0=3.0
29476          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29477          arg1=msk_arg1*numarray.array([[[[3.0, -4.0, -6.0, 7.0], [7.0, 3.0, 3.0, 6.0], [0.0, -7.0, 6.0, 1.0]], [[-7.0, 1.0, 4.0, 4.0], [5.0, 4.0, 1.0, -7.0], [7.0, 0.0, -6.0, 2.0]]], [[[0.0, -7.0, -3.0, 2.0], [1.0, -7.0, 2.0, -6.0], [0.0, 5.0, -1.0, -3.0]], [[-7.0, -1.0, 3.0, 0.0], [5.0, 0.0, 0.0, -6.0], [-5.0, -3.0, 0.0, -5.0]]], [[[-7.0, 0.0, 2.0, -3.0], [0.0, 6.0, -4.0, -1.0], [-4.0, -2.0, 4.0, 7.0]], [[-7.0, 6.0, -5.0, -1.0], [6.0, 2.0, 2.0, -3.0], [-5.0, -7.0, 2.0, 0.0]]]])+(1.-msk_arg1)*numarray.array([[[[0.0, -4.0, 6.0, -6.0], [7.0, 7.0, -3.0, -2.0], [3.0, -5.0, 0.0, 0.0]], [[3.0, 1.0, 0.0, -1.0], [-3.0, -3.0, 0.0, -3.0], [-3.0, -6.0, 6.0, -2.0]]], [[[-2.0, 3.0, 0.0, -2.0], [0.0, 5.0, -4.0, -3.0], [-5.0, -5.0, -7.0, -1.0]], [[-4.0, -5.0, 2.0, -1.0], [2.0, -1.0, 0.0, 1.0], [6.0, 6.0, 3.0, -4.0]]], [[[-7.0, -6.0, 3.0, -2.0], [-6.0, 7.0, 3.0, -3.0], [-1.0, 2.0, -3.0, 1.0]], [[3.0, -3.0, 0.0, -5.0], [2.0, -6.0, -7.0, 5.0], [-2.0, 0.0, 3.0, 1.0]]]])
29478          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29479          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29480          ref=msk_ref*numarray.array([[[[9.0, -12.0, -18.0, 21.0], [21.0, 9.0, 9.0, 18.0], [0.0, -21.0, 18.0, 3.0]], [[-21.0, 3.0, 12.0, 12.0], [15.0, 12.0, 3.0, -21.0], [21.0, 0.0, -18.0, 6.0]]], [[[0.0, -21.0, -9.0, 6.0], [3.0, -21.0, 6.0, -18.0], [0.0, 15.0, -3.0, -9.0]], [[-21.0, -3.0, 9.0, 0.0], [15.0, 0.0, 0.0, -18.0], [-15.0, -9.0, 0.0, -15.0]]], [[[-21.0, 0.0, 6.0, -9.0], [0.0, 18.0, -12.0, -3.0], [-12.0, -6.0, 12.0, 21.0]], [[-21.0, 18.0, -15.0, -3.0], [18.0, 6.0, 6.0, -9.0], [-15.0, -21.0, 6.0, 0.0]]]])+(1.-msk_ref)*numarray.array([[[[0.0, -12.0, 18.0, -18.0], [21.0, 21.0, -9.0, -6.0], [9.0, -15.0, 0.0, 0.0]], [[9.0, 3.0, 0.0, -3.0], [-9.0, -9.0, 0.0, -9.0], [-9.0, -18.0, 18.0, -6.0]]], [[[-6.0, 9.0, 0.0, -6.0], [0.0, 15.0, -12.0, -9.0], [-15.0, -15.0, -21.0, -3.0]], [[-12.0, -15.0, 6.0, -3.0], [6.0, -3.0, 0.0, 3.0], [18.0, 18.0, 9.0, -12.0]]], [[[-21.0, -18.0, 9.0, -6.0], [-18.0, 21.0, 9.0, -9.0], [-3.0, 6.0, -9.0, 3.0]], [[9.0, -9.0, 0.0, -15.0], [6.0, -18.0, -21.0, 15.0], [-6.0, 0.0, 9.0, 3.0]]]])
29481          self.failUnless(isinstance(res,Data),"wrong type of result.")
29482          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
29483          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29484       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29485       def test_generalTensorProduct_array_rank0_float_rank0_offset0(self):
29486          arg0=numarray.array(4.0)
29487          arg1=-5.0
29488          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29489          ref=numarray.array(-20.0)
29490          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29491          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29492          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29493       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29494       def test_generalTensorProduct_array_rank0_array_rank0_offset0(self):
29495          arg0=numarray.array(-3.0)
29496          arg1=numarray.array(-7.0)
29497          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29498          ref=numarray.array(21.0)
29499          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29500          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29501          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29502       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29503       def test_generalTensorProduct_array_rank1_array_rank1_offset1(self):
29504          arg0=numarray.array([-4.0, 0.0, -6.0])
29505          arg1=numarray.array([-4.0, 4.0, -5.0])
29506          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29507          ref=numarray.array(46.0)
29508          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29509          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29510          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29511       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29512       def test_generalTensorProduct_array_rank2_array_rank2_offset2(self):
29513          arg0=numarray.array([[-4.0, -6.0, 0.0], [5.0, 0.0, 0.0]])
29514          arg1=numarray.array([[1.0, 1.0, 4.0], [5.0, -3.0, 2.0]])
29515          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29516          ref=numarray.array(15.0)
29517          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29518          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29519          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29520       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29521       def test_generalTensorProduct_array_rank3_array_rank3_offset3(self):
29522          arg0=numarray.array([[[-4.0, 6.0, -7.0], [-1.0, 0.0, -3.0], [0.0, -7.0, 5.0], [4.0, -4.0, -3.0]], [[0.0, 6.0, 5.0], [-4.0, 0.0, -1.0], [0.0, 7.0, 6.0], [-2.0, -6.0, 6.0]]])
29523          arg1=numarray.array([[[-1.0, -6.0, -6.0], [-7.0, 3.0, 0.0], [5.0, 0.0, 1.0], [-6.0, 3.0, -7.0]], [[4.0, 1.0, -3.0], [-3.0, 7.0, -1.0], [5.0, 5.0, -6.0], [6.0, -1.0, 1.0]]])
29524          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29525          ref=numarray.array(10.0)
29526          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29527          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29528          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29529       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29530       def test_generalTensorProduct_array_rank4_array_rank4_offset4(self):
29531          arg0=numarray.array([[[[0.0, 5.0], [-6.0, -7.0], [-5.0, 1.0]], [[1.0, 3.0], [-6.0, 1.0], [-3.0, -1.0]]], [[[-4.0, 0.0], [5.0, 7.0], [-3.0, -2.0]], [[5.0, -3.0], [6.0, 0.0], [6.0, -2.0]]], [[[-4.0, -3.0], [3.0, -5.0], [4.0, 6.0]], [[-4.0, -3.0], [5.0, 6.0], [3.0, 2.0]]], [[[-6.0, -2.0], [-2.0, 5.0], [-4.0, 5.0]], [[2.0, -6.0], [-3.0, -2.0], [-1.0, 3.0]]]])
29532          arg1=numarray.array([[[[-5.0, -5.0], [-6.0, -1.0], [-4.0, -7.0]], [[-7.0, -4.0], [-2.0, -1.0], [-7.0, -2.0]]], [[[2.0, 1.0], [3.0, -6.0], [-7.0, 2.0]], [[7.0, 3.0], [3.0, 7.0], [-3.0, 7.0]]], [[[-5.0, 6.0], [6.0, -5.0], [-2.0, 7.0]], [[5.0, 4.0], [-3.0, -7.0], [-2.0, 4.0]]], [[[-1.0, 6.0], [0.0, 2.0], [1.0, 7.0]], [[-5.0, 1.0], [2.0, -2.0], [5.0, -5.0]]]])
29533          res=generalTensorProduct(arg0,arg1,axis_offset=4)
29534          ref=numarray.array(29.0)
29535          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29536          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
29537          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29538       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29539       def test_generalTensorProduct_array_rank0_array_rank1_offset0(self):
29540          arg0=numarray.array(-7.0)
29541          arg1=numarray.array([0.0, -6.0])
29542          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29543          ref=numarray.array([-0.0, 42.0])
29544          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29545          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
29546          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29547       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29548       def test_generalTensorProduct_array_rank1_array_rank2_offset1(self):
29549          arg0=numarray.array([-5.0, -6.0, -2.0])
29550          arg1=numarray.array([[6.0, 6.0], [0.0, 7.0], [-1.0, -6.0]])
29551          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29552          ref=numarray.array([-28.0, -60.0])
29553          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29554          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
29555          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29556       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29557       def test_generalTensorProduct_array_rank2_array_rank3_offset2(self):
29558          arg0=numarray.array([[4.0, 2.0, 5.0], [-5.0, 6.0, -6.0]])
29559          arg1=numarray.array([[[4.0, 3.0], [-2.0, -5.0], [-6.0, 6.0]], [[-7.0, 5.0], [-1.0, -6.0], [-6.0, 0.0]]])
29560          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29561          ref=numarray.array([47.0, -29.0])
29562          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29563          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
29564          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29565       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29566       def test_generalTensorProduct_array_rank3_array_rank4_offset3(self):
29567          arg0=numarray.array([[[-5.0, -4.0, 7.0], [-6.0, -3.0, 1.0], [4.0, -7.0, 1.0], [7.0, 5.0, 2.0]], [[2.0, 0.0, 0.0], [5.0, -2.0, -4.0], [-4.0, 0.0, -5.0], [1.0, -2.0, 1.0]]])
29568          arg1=numarray.array([[[[0.0, -2.0], [-1.0, 0.0], [3.0, -1.0]], [[-6.0, 5.0], [-4.0, -1.0], [-7.0, -4.0]], [[0.0, -2.0], [-4.0, 3.0], [2.0, -6.0]], [[3.0, -5.0], [6.0, 0.0], [-5.0, 0.0]]], [[[5.0, 3.0], [0.0, -2.0], [-6.0, -5.0]], [[-5.0, 0.0], [-1.0, 1.0], [-7.0, -3.0]], [[0.0, -4.0], [1.0, 2.0], [-6.0, -5.0]], [[-1.0, 3.0], [6.0, 0.0], [6.0, -3.0]]]])
29569          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29570          ref=numarray.array([175.0, -41.0])
29571          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29572          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
29573          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29574       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29575       def test_generalTensorProduct_array_rank0_array_rank2_offset0(self):
29576          arg0=numarray.array(1.0)
29577          arg1=numarray.array([[0.0, -7.0, 0.0, -2.0, -2.0], [7.0, 1.0, 2.0, -4.0, 3.0], [-7.0, 4.0, 4.0, 5.0, -6.0], [-3.0, 7.0, 4.0, 3.0, -4.0]])
29578          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29579          ref=numarray.array([[0.0, -7.0, 0.0, -2.0, -2.0], [7.0, 1.0, 2.0, -4.0, 3.0], [-7.0, 4.0, 4.0, 5.0, -6.0], [-3.0, 7.0, 4.0, 3.0, -4.0]])
29580          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29581          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
29582          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29583       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29584       def test_generalTensorProduct_array_rank1_array_rank3_offset1(self):
29585          arg0=numarray.array([0.0, 2.0, 4.0])
29586          arg1=numarray.array([[[7.0, -5.0, -6.0, 6.0, 0.0], [3.0, 3.0, -6.0, 4.0, 1.0], [-7.0, 3.0, 7.0, 3.0, 5.0], [5.0, -2.0, 6.0, -1.0, 4.0]], [[-7.0, 0.0, 5.0, 7.0, 5.0], [0.0, 0.0, 5.0, -7.0, 2.0], [1.0, -4.0, 5.0, 5.0, 3.0], [-2.0, 0.0, 7.0, -7.0, 0.0]], [[-2.0, 2.0, 2.0, 4.0, 3.0], [-3.0, 4.0, 0.0, 3.0, -7.0], [5.0, -4.0, -6.0, -6.0, -2.0], [-6.0, 1.0, -1.0, -1.0, 0.0]]])
29587          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29588          ref=numarray.array([[-22.0, 8.0, 18.0, 30.0, 22.0], [-12.0, 16.0, 10.0, -2.0, -24.0], [22.0, -24.0, -14.0, -14.0, -2.0], [-28.0, 4.0, 10.0, -18.0, 0.0]])
29589          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29590          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
29591          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29592       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29593       def test_generalTensorProduct_array_rank2_array_rank4_offset2(self):
29594          arg0=numarray.array([[2.0, -6.0, -3.0], [-5.0, -5.0, -7.0]])
29595          arg1=numarray.array([[[[-5.0, -2.0, 2.0, -2.0, 6.0], [1.0, -6.0, -7.0, -1.0, -5.0], [5.0, 0.0, 2.0, 5.0, 2.0], [-1.0, -5.0, 7.0, 0.0, 3.0]], [[7.0, 4.0, 6.0, -6.0, 0.0], [5.0, -5.0, 3.0, 4.0, -2.0], [7.0, -4.0, 4.0, 5.0, 7.0], [-7.0, 0.0, 7.0, 0.0, 4.0]], [[5.0, 6.0, 6.0, 4.0, 6.0], [5.0, -4.0, 0.0, -6.0, 2.0], [-5.0, -1.0, -2.0, -1.0, 1.0], [0.0, 6.0, -3.0, -1.0, 5.0]]], [[[3.0, -2.0, 6.0, -4.0, -4.0], [3.0, -2.0, 4.0, -6.0, -1.0], [-5.0, -6.0, 0.0, -6.0, -2.0], [-5.0, -4.0, 7.0, -6.0, -2.0]], [[-7.0, 1.0, 7.0, 4.0, 3.0], [1.0, -1.0, -5.0, 5.0, -7.0], [-2.0, 6.0, 0.0, -6.0, 6.0], [0.0, -2.0, -4.0, 3.0, 2.0]], [[-4.0, 7.0, 6.0, -6.0, 1.0], [0.0, 3.0, -3.0, 3.0, -4.0], [-2.0, 0.0, -3.0, -5.0, -7.0], [6.0, -7.0, 0.0, 7.0, -1.0]]]])
29596          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29597          ref=numarray.array([[-19.0, -90.0, -157.0, 62.0, -8.0], [-63.0, 24.0, -6.0, -24.0, 64.0], [32.0, 27.0, 7.0, 78.0, -12.0], [23.0, 51.0, -34.0, -31.0, -26.0]])
29598          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29599          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
29600          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29601       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29602       def test_generalTensorProduct_array_rank0_array_rank3_offset0(self):
29603          arg0=numarray.array(6.0)
29604          arg1=numarray.array([[[-2.0, 6.0], [-7.0, 5.0]], [[5.0, -4.0], [-5.0, 1.0]], [[-5.0, 4.0], [1.0, -1.0]], [[4.0, -1.0], [-4.0, 4.0]], [[2.0, 1.0], [6.0, -2.0]], [[3.0, 6.0], [3.0, -6.0]]])
29605          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29606          ref=numarray.array([[[-12.0, 36.0], [-42.0, 30.0]], [[30.0, -24.0], [-30.0, 6.0]], [[-30.0, 24.0], [6.0, -6.0]], [[24.0, -6.0], [-24.0, 24.0]], [[12.0, 6.0], [36.0, -12.0]], [[18.0, 36.0], [18.0, -36.0]]])
29607          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29608          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
29609          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29610       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29611       def test_generalTensorProduct_array_rank1_array_rank4_offset1(self):
29612          arg0=numarray.array([-3.0, 5.0, 0.0])
29613          arg1=numarray.array([[[[-7.0, 0.0], [-7.0, 2.0]], [[7.0, 4.0], [0.0, 6.0]], [[-7.0, 6.0], [-6.0, -4.0]], [[-4.0, 3.0], [-2.0, -1.0]], [[7.0, 0.0], [-4.0, 1.0]], [[6.0, -5.0], [-1.0, 4.0]]], [[[-6.0, 6.0], [-2.0, -2.0]], [[-1.0, 0.0], [5.0, 6.0]], [[2.0, 0.0], [-6.0, 0.0]], [[-5.0, 7.0], [0.0, 0.0]], [[3.0, 2.0], [3.0, 1.0]], [[6.0, 4.0], [-1.0, 0.0]]], [[[-6.0, 5.0], [2.0, 4.0]], [[-7.0, 7.0], [6.0, -7.0]], [[-7.0, -4.0], [-5.0, 3.0]], [[1.0, 2.0], [3.0, 0.0]], [[0.0, 6.0], [-7.0, 3.0]], [[-3.0, 6.0], [-5.0, 2.0]]]])
29614          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29615          ref=numarray.array([[[-9.0, 30.0], [11.0, -16.0]], [[-26.0, -12.0], [25.0, 12.0]], [[31.0, -18.0], [-12.0, 12.0]], [[-13.0, 26.0], [6.0, 3.0]], [[-6.0, 10.0], [27.0, 2.0]], [[12.0, 35.0], [-2.0, -12.0]]])
29616          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29617          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
29618          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29619       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29620       def test_generalTensorProduct_array_rank0_array_rank4_offset0(self):
29621          arg0=numarray.array(6.0)
29622          arg1=numarray.array([[[[-3.0, 5.0, 5.0, 0.0], [-3.0, -2.0, 4.0, 4.0], [-1.0, 1.0, 6.0, 3.0]], [[-6.0, -5.0, -5.0, -3.0], [5.0, 3.0, -2.0, 7.0], [0.0, 6.0, -5.0, -1.0]]], [[[2.0, -4.0, 7.0, 7.0], [3.0, -5.0, -7.0, -7.0], [0.0, 5.0, -1.0, 6.0]], [[4.0, 4.0, -3.0, 0.0], [0.0, -4.0, -4.0, -4.0], [-3.0, -4.0, 5.0, 1.0]]], [[[2.0, -3.0, -7.0, -5.0], [-7.0, 3.0, 5.0, 3.0], [-3.0, -2.0, 1.0, 7.0]], [[1.0, 2.0, -1.0, 0.0], [0.0, 5.0, 4.0, 3.0], [6.0, -3.0, -5.0, 4.0]]]])
29623          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29624          ref=numarray.array([[[[-18.0, 30.0, 30.0, 0.0], [-18.0, -12.0, 24.0, 24.0], [-6.0, 6.0, 36.0, 18.0]], [[-36.0, -30.0, -30.0, -18.0], [30.0, 18.0, -12.0, 42.0], [0.0, 36.0, -30.0, -6.0]]], [[[12.0, -24.0, 42.0, 42.0], [18.0, -30.0, -42.0, -42.0], [0.0, 30.0, -6.0, 36.0]], [[24.0, 24.0, -18.0, 0.0], [0.0, -24.0, -24.0, -24.0], [-18.0, -24.0, 30.0, 6.0]]], [[[12.0, -18.0, -42.0, -30.0], [-42.0, 18.0, 30.0, 18.0], [-18.0, -12.0, 6.0, 42.0]], [[6.0, 12.0, -6.0, 0.0], [0.0, 30.0, 24.0, 18.0], [36.0, -18.0, -30.0, 24.0]]]])
29625          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
29626          self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
29627          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29628       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29629       def test_generalTensorProduct_array_rank0_Symbol_rank0_offset0(self):
29630          arg0=numarray.array(-1.0)
29631          arg1=Symbol(shape=())
29632          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29633          s1=numarray.array(4.0)
29634          sub=res.substitute({arg1:s1})
29635          ref=numarray.array(-4.0)
29636          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29637          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29638          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29639       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29640       def test_generalTensorProduct_array_rank1_Symbol_rank1_offset1(self):
29641          arg0=numarray.array([-2.0, 1.0, 1.0])
29642          arg1=Symbol(shape=(3,))
29643          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29644          s1=numarray.array([-3.0, -2.0, -1.0])
29645          sub=res.substitute({arg1:s1})
29646          ref=numarray.array(3.0)
29647          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29648          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29649          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29650       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29651       def test_generalTensorProduct_array_rank2_Symbol_rank2_offset2(self):
29652          arg0=numarray.array([[5.0, -5.0, 0.0], [-3.0, 7.0, -3.0]])
29653          arg1=Symbol(shape=(2, 3))
29654          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29655          s1=numarray.array([[0.0, 2.0, 7.0], [7.0, 0.0, 0.0]])
29656          sub=res.substitute({arg1:s1})
29657          ref=numarray.array(-31.0)
29658          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29659          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29660          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29661       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29662       def test_generalTensorProduct_array_rank3_Symbol_rank3_offset3(self):
29663          arg0=numarray.array([[[6.0, -1.0, 5.0], [6.0, -7.0, -2.0], [-2.0, 7.0, -1.0], [0.0, -6.0, -5.0]], [[-7.0, 6.0, 3.0], [-7.0, 3.0, 1.0], [3.0, 0.0, 6.0], [0.0, 5.0, -6.0]]])
29664          arg1=Symbol(shape=(2, 4, 3))
29665          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29666          s1=numarray.array([[[-2.0, 0.0, 5.0], [-5.0, 0.0, 7.0], [3.0, 7.0, 2.0], [-7.0, 0.0, 5.0]], [[-7.0, 2.0, -2.0], [1.0, 3.0, 7.0], [3.0, -3.0, 2.0], [5.0, 0.0, -5.0]]])
29667          sub=res.substitute({arg1:s1})
29668          ref=numarray.array(100.0)
29669          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29670          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29671          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29672       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29673       def test_generalTensorProduct_array_rank4_Symbol_rank4_offset4(self):
29674          arg0=numarray.array([[[[7.0, -2.0], [3.0, 5.0], [1.0, 4.0]], [[0.0, 4.0], [-5.0, 4.0], [-6.0, 5.0]]], [[[5.0, -2.0], [-4.0, 3.0], [-7.0, 5.0]], [[-2.0, -4.0], [-4.0, 5.0], [-5.0, 4.0]]], [[[7.0, 0.0], [4.0, -2.0], [3.0, 6.0]], [[6.0, 0.0], [-5.0, 2.0], [7.0, -6.0]]], [[[-3.0, 7.0], [0.0, -5.0], [0.0, -3.0]], [[-2.0, -6.0], [7.0, -3.0], [-1.0, -5.0]]]])
29675          arg1=Symbol(shape=(4, 2, 3, 2))
29676          res=generalTensorProduct(arg0,arg1,axis_offset=4)
29677          s1=numarray.array([[[[3.0, 1.0], [-6.0, -5.0], [6.0, 3.0]], [[-4.0, -5.0], [-2.0, -7.0], [0.0, 4.0]]], [[[7.0, -1.0], [-4.0, -7.0], [-6.0, 0.0]], [[4.0, -7.0], [-3.0, 0.0], [3.0, 5.0]]], [[[-6.0, -2.0], [-3.0, 3.0], [4.0, 3.0]], [[-3.0, -5.0], [-1.0, 4.0], [4.0, 7.0]]], [[[-3.0, -2.0], [-7.0, 1.0], [0.0, -5.0]], [[-4.0, 3.0], [7.0, 3.0], [-2.0, 3.0]]]])
29678          sub=res.substitute({arg1:s1})
29679          ref=numarray.array(60.0)
29680          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29681          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29682          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29683       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29684       def test_generalTensorProduct_array_rank0_Symbol_rank1_offset0(self):
29685          arg0=numarray.array(-7.0)
29686          arg1=Symbol(shape=(2,))
29687          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29688          s1=numarray.array([1.0, -7.0])
29689          sub=res.substitute({arg1:s1})
29690          ref=numarray.array([-7.0, 49.0])
29691          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29692          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29693          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29694       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29695       def test_generalTensorProduct_array_rank1_Symbol_rank2_offset1(self):
29696          arg0=numarray.array([7.0, -7.0, 7.0])
29697          arg1=Symbol(shape=(3, 2))
29698          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29699          s1=numarray.array([[-6.0, 2.0], [6.0, -7.0], [-7.0, -2.0]])
29700          sub=res.substitute({arg1:s1})
29701          ref=numarray.array([-133.0, 49.0])
29702          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29703          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29704          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29705       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29706       def test_generalTensorProduct_array_rank2_Symbol_rank3_offset2(self):
29707          arg0=numarray.array([[-2.0, 0.0, 2.0], [7.0, 0.0, 0.0]])
29708          arg1=Symbol(shape=(2, 3, 2))
29709          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29710          s1=numarray.array([[[7.0, -1.0], [5.0, 2.0], [-1.0, -3.0]], [[1.0, 6.0], [-6.0, -1.0], [-7.0, 0.0]]])
29711          sub=res.substitute({arg1:s1})
29712          ref=numarray.array([-9.0, 38.0])
29713          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29714          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29715          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29716       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29717       def test_generalTensorProduct_array_rank3_Symbol_rank4_offset3(self):
29718          arg0=numarray.array([[[-6.0, -4.0, -3.0], [1.0, 5.0, 7.0], [3.0, 7.0, 3.0], [-4.0, -2.0, -3.0]], [[0.0, -3.0, 7.0], [7.0, -7.0, -4.0], [5.0, -6.0, -7.0], [7.0, 1.0, -2.0]]])
29719          arg1=Symbol(shape=(2, 4, 3, 2))
29720          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29721          s1=numarray.array([[[[-6.0, 0.0], [-2.0, 4.0], [2.0, 5.0]], [[-6.0, -1.0], [3.0, 0.0], [1.0, 4.0]], [[2.0, 6.0], [6.0, -5.0], [0.0, -4.0]], [[3.0, -7.0], [0.0, 0.0], [6.0, -2.0]]], [[[-4.0, 0.0], [-6.0, -1.0], [-6.0, -7.0]], [[-1.0, -6.0], [-3.0, 0.0], [-1.0, 6.0]], [[4.0, -2.0], [3.0, 4.0], [0.0, 7.0]], [[-5.0, -2.0], [-6.0, 0.0], [-2.0, 4.0]]]])
29722          sub=res.substitute({arg1:s1})
29723          ref=numarray.array([31.0, -216.0])
29724          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29725          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29726          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29727       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29728       def test_generalTensorProduct_array_rank0_Symbol_rank2_offset0(self):
29729          arg0=numarray.array(-6.0)
29730          arg1=Symbol(shape=(4, 5))
29731          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29732          s1=numarray.array([[0.0, 6.0, 4.0, 2.0, 4.0], [-7.0, -3.0, -2.0, 7.0, 5.0], [5.0, 5.0, 1.0, -7.0, 0.0], [4.0, -6.0, -1.0, 3.0, 7.0]])
29733          sub=res.substitute({arg1:s1})
29734          ref=numarray.array([[-0.0, -36.0, -24.0, -12.0, -24.0], [42.0, 18.0, 12.0, -42.0, -30.0], [-30.0, -30.0, -6.0, 42.0, -0.0], [-24.0, 36.0, 6.0, -18.0, -42.0]])
29735          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29736          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29737          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29738       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29739       def test_generalTensorProduct_array_rank1_Symbol_rank3_offset1(self):
29740          arg0=numarray.array([6.0, -6.0, -3.0])
29741          arg1=Symbol(shape=(3, 4, 5))
29742          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29743          s1=numarray.array([[[1.0, -3.0, -1.0, 7.0, -7.0], [6.0, -5.0, -6.0, -4.0, -7.0], [5.0, 3.0, -3.0, -6.0, 4.0], [-2.0, -6.0, -5.0, 0.0, 3.0]], [[0.0, -4.0, -1.0, 0.0, 4.0], [0.0, -7.0, -5.0, 7.0, 5.0], [6.0, 6.0, 0.0, -6.0, -1.0], [-2.0, 7.0, 0.0, -3.0, 4.0]], [[-2.0, 1.0, 4.0, -3.0, 2.0], [0.0, 3.0, 0.0, 1.0, 2.0], [7.0, 7.0, 4.0, -6.0, 0.0], [-6.0, -2.0, 7.0, -7.0, 7.0]]])
29744          sub=res.substitute({arg1:s1})
29745          ref=numarray.array([[12.0, 3.0, -12.0, 51.0, -72.0], [36.0, 3.0, -6.0, -69.0, -78.0], [-27.0, -39.0, -30.0, 18.0, 30.0], [18.0, -72.0, -51.0, 39.0, -27.0]])
29746          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29747          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29748          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29749       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29750       def test_generalTensorProduct_array_rank2_Symbol_rank4_offset2(self):
29751          arg0=numarray.array([[0.0, 4.0, -2.0], [3.0, 3.0, -1.0]])
29752          arg1=Symbol(shape=(2, 3, 4, 5))
29753          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29754          s1=numarray.array([[[[2.0, 0.0, -6.0, -5.0, -1.0], [1.0, 2.0, 1.0, -1.0, -2.0], [-5.0, -6.0, 6.0, 0.0, 4.0], [5.0, 0.0, -3.0, 7.0, 5.0]], [[-1.0, 0.0, -7.0, 5.0, 2.0], [-5.0, -3.0, 0.0, 0.0, -7.0], [5.0, 2.0, -5.0, 5.0, -7.0], [3.0, -6.0, 4.0, -6.0, 0.0]], [[6.0, 6.0, -3.0, -3.0, 1.0], [6.0, 0.0, -5.0, -2.0, -4.0], [-4.0, 5.0, -6.0, 2.0, -3.0], [3.0, -7.0, 5.0, 6.0, -7.0]]], [[[5.0, 3.0, -1.0, 4.0, 1.0], [-3.0, -1.0, -2.0, 5.0, 1.0], [2.0, 2.0, 3.0, 3.0, 2.0], [-3.0, 7.0, 0.0, 1.0, -1.0]], [[5.0, 4.0, -2.0, -2.0, 3.0], [-2.0, -5.0, 1.0, 5.0, 0.0], [0.0, 4.0, 1.0, -2.0, 7.0], [-3.0, -3.0, 0.0, 6.0, 2.0]], [[-5.0, -3.0, 1.0, 2.0, 2.0], [1.0, 0.0, -6.0, -4.0, -5.0], [2.0, 0.0, 0.0, 3.0, -3.0], [-1.0, 3.0, 3.0, -3.0, 6.0]]]])
29755          sub=res.substitute({arg1:s1})
29756          ref=numarray.array([[19.0, 12.0, -32.0, 30.0, 16.0], [-48.0, -30.0, 13.0, 38.0, -12.0], [32.0, 16.0, 4.0, 16.0, 8.0], [-11.0, -1.0, 3.0, -12.0, 11.0]])
29757          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29758          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29759          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29760       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29761       def test_generalTensorProduct_array_rank0_Symbol_rank3_offset0(self):
29762          arg0=numarray.array(7.0)
29763          arg1=Symbol(shape=(6, 2, 2))
29764          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29765          s1=numarray.array([[[5.0, 7.0], [0.0, 6.0]], [[-2.0, 1.0], [3.0, -3.0]], [[0.0, 7.0], [7.0, -1.0]], [[5.0, -2.0], [3.0, 0.0]], [[-5.0, 2.0], [5.0, -1.0]], [[1.0, -6.0], [7.0, 5.0]]])
29766          sub=res.substitute({arg1:s1})
29767          ref=numarray.array([[[35.0, 49.0], [0.0, 42.0]], [[-14.0, 7.0], [21.0, -21.0]], [[0.0, 49.0], [49.0, -7.0]], [[35.0, -14.0], [21.0, 0.0]], [[-35.0, 14.0], [35.0, -7.0]], [[7.0, -42.0], [49.0, 35.0]]])
29768          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29769          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29770          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29771       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29772       def test_generalTensorProduct_array_rank1_Symbol_rank4_offset1(self):
29773          arg0=numarray.array([-3.0, -6.0, 4.0])
29774          arg1=Symbol(shape=(3, 6, 2, 2))
29775          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29776          s1=numarray.array([[[[-4.0, -3.0], [1.0, 5.0]], [[4.0, 4.0], [-2.0, -6.0]], [[-1.0, 4.0], [5.0, 5.0]], [[-3.0, 7.0], [0.0, -5.0]], [[-1.0, 0.0], [4.0, 7.0]], [[-1.0, 0.0], [-1.0, 1.0]]], [[[0.0, 5.0], [7.0, 0.0]], [[-7.0, 0.0], [4.0, 0.0]], [[-3.0, -2.0], [5.0, 3.0]], [[3.0, -2.0], [1.0, -6.0]], [[6.0, 0.0], [-2.0, -2.0]], [[4.0, -3.0], [-6.0, 1.0]]], [[[-7.0, 0.0], [-7.0, 0.0]], [[3.0, -2.0], [3.0, 0.0]], [[-7.0, 4.0], [-4.0, 7.0]], [[-2.0, 4.0], [-5.0, 7.0]], [[-1.0, 1.0], [7.0, -7.0]], [[2.0, -5.0], [4.0, 4.0]]]])
29777          sub=res.substitute({arg1:s1})
29778          ref=numarray.array([[[-16.0, -21.0], [-73.0, -15.0]], [[42.0, -20.0], [-6.0, 18.0]], [[-7.0, 16.0], [-61.0, -5.0]], [[-17.0, 7.0], [-26.0, 79.0]], [[-37.0, 4.0], [28.0, -37.0]], [[-13.0, -2.0], [55.0, 7.0]]])
29779          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29780          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29781          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29782       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29783       def test_generalTensorProduct_array_rank0_Symbol_rank4_offset0(self):
29784          arg0=numarray.array(0.0)
29785          arg1=Symbol(shape=(3, 2, 3, 4))
29786          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29787          s1=numarray.array([[[[5.0, -5.0, 2.0, 1.0], [-6.0, 4.0, -3.0, -7.0], [-1.0, 0.0, -1.0, 4.0]], [[0.0, 1.0, -2.0, 6.0], [4.0, 4.0, -7.0, 3.0], [4.0, 0.0, 1.0, -3.0]]], [[[6.0, 7.0, 3.0, -1.0], [-3.0, 5.0, -4.0, 2.0], [6.0, -1.0, -3.0, -7.0]], [[7.0, 0.0, 2.0, 0.0], [-2.0, 1.0, -5.0, 5.0], [-3.0, -4.0, -1.0, -4.0]]], [[[-4.0, 6.0, 5.0, -1.0], [2.0, -2.0, 6.0, 0.0], [2.0, -1.0, 0.0, -6.0]], [[-4.0, -7.0, -6.0, -5.0], [1.0, -3.0, -7.0, 7.0], [-3.0, -5.0, 4.0, 6.0]]]])
29788          sub=res.substitute({arg1:s1})
29789          ref=numarray.array([[[[0.0, -0.0, 0.0, 0.0], [-0.0, 0.0, -0.0, -0.0], [-0.0, 0.0, -0.0, 0.0]], [[0.0, 0.0, -0.0, 0.0], [0.0, 0.0, -0.0, 0.0], [0.0, 0.0, 0.0, -0.0]]], [[[0.0, 0.0, 0.0, -0.0], [-0.0, 0.0, -0.0, 0.0], [0.0, -0.0, -0.0, -0.0]], [[0.0, 0.0, 0.0, 0.0], [-0.0, 0.0, -0.0, 0.0], [-0.0, -0.0, -0.0, -0.0]]], [[[-0.0, 0.0, 0.0, -0.0], [0.0, -0.0, 0.0, 0.0], [0.0, -0.0, 0.0, -0.0]], [[-0.0, -0.0, -0.0, -0.0], [0.0, -0.0, -0.0, 0.0], [-0.0, -0.0, 0.0, 0.0]]]])
29790          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
29791          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
29792          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29793       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29794       def test_generalTensorProduct_array_rank0_constData_rank0_offset0(self):
29795          arg0=numarray.array(3.0)
29796          arg1=Data(-6.0,self.functionspace)
29797          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29798          ref=Data(-18.0,self.functionspace)
29799          self.failUnless(isinstance(res,Data),"wrong type of result.")
29800          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29801          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29802       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29803       def test_generalTensorProduct_array_rank1_constData_rank1_offset1(self):
29804          arg0=numarray.array([-4.0, -7.0, -5.0])
29805          arg1=Data(numarray.array([-1.0, -3.0, 4.0]),self.functionspace)
29806          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29807          ref=Data(5.0,self.functionspace)
29808          self.failUnless(isinstance(res,Data),"wrong type of result.")
29809          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29810          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29811       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29812       def test_generalTensorProduct_array_rank2_constData_rank2_offset2(self):
29813          arg0=numarray.array([[2.0, 5.0, 3.0], [-3.0, -2.0, 0.0]])
29814          arg1=Data(numarray.array([[3.0, 5.0, -1.0], [3.0, 7.0, 3.0]]),self.functionspace)
29815          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29816          ref=Data(5.0,self.functionspace)
29817          self.failUnless(isinstance(res,Data),"wrong type of result.")
29818          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29819          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29820       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29821       def test_generalTensorProduct_array_rank3_constData_rank3_offset3(self):
29822          arg0=numarray.array([[[5.0, -7.0, 6.0], [4.0, -4.0, -2.0], [-2.0, 3.0, -7.0], [1.0, -7.0, 7.0]], [[6.0, -2.0, -6.0], [6.0, -4.0, -1.0], [5.0, 2.0, -6.0], [1.0, -2.0, 2.0]]])
29823          arg1=Data(numarray.array([[[5.0, -6.0, 4.0], [-4.0, -4.0, -7.0], [-3.0, -6.0, -6.0], [0.0, 4.0, 6.0]], [[-1.0, 1.0, 1.0], [3.0, 2.0, -7.0], [-1.0, -6.0, -2.0], [-4.0, -2.0, 1.0]]]),self.functionspace)
29824          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29825          ref=Data(149.0,self.functionspace)
29826          self.failUnless(isinstance(res,Data),"wrong type of result.")
29827          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29828          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29829       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29830       def test_generalTensorProduct_array_rank4_constData_rank4_offset4(self):
29831          arg0=numarray.array([[[[-7.0, 6.0], [4.0, -1.0], [-6.0, 3.0]], [[1.0, -7.0], [-1.0, 3.0], [-7.0, -1.0]]], [[[4.0, -6.0], [4.0, 6.0], [6.0, 1.0]], [[3.0, -4.0], [-3.0, 6.0], [0.0, -7.0]]], [[[0.0, 7.0], [1.0, -4.0], [-6.0, -6.0]], [[-6.0, -1.0], [6.0, 0.0], [-7.0, -6.0]]], [[[-7.0, -3.0], [-5.0, 0.0], [0.0, 3.0]], [[3.0, 0.0], [0.0, -1.0], [0.0, -4.0]]]])
29832          arg1=Data(numarray.array([[[[-4.0, 4.0], [-3.0, 3.0], [5.0, 1.0]], [[-3.0, 0.0], [0.0, 5.0], [-7.0, -7.0]]], [[[5.0, -6.0], [-6.0, 1.0], [-3.0, -7.0]], [[-6.0, 3.0], [5.0, -4.0], [-4.0, -3.0]]], [[[4.0, 5.0], [7.0, -5.0], [7.0, 5.0]], [[0.0, -2.0], [-1.0, 4.0], [-2.0, -5.0]]], [[[2.0, 3.0], [6.0, 0.0], [-7.0, 2.0]], [[0.0, -4.0], [5.0, 1.0], [-6.0, 7.0]]]]),self.functionspace)
29833          res=generalTensorProduct(arg0,arg1,axis_offset=4)
29834          ref=Data(-3.0,self.functionspace)
29835          self.failUnless(isinstance(res,Data),"wrong type of result.")
29836          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29837          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29838       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29839       def test_generalTensorProduct_array_rank0_constData_rank1_offset0(self):
29840          arg0=numarray.array(-5.0)
29841          arg1=Data(numarray.array([-2.0, 2.0]),self.functionspace)
29842          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29843          ref=Data(numarray.array([10.0, -10.0]),self.functionspace)
29844          self.failUnless(isinstance(res,Data),"wrong type of result.")
29845          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29846          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29847       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29848       def test_generalTensorProduct_array_rank1_constData_rank2_offset1(self):
29849          arg0=numarray.array([4.0, 3.0, 1.0])
29850          arg1=Data(numarray.array([[-1.0, 0.0], [-2.0, 1.0], [0.0, 1.0]]),self.functionspace)
29851          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29852          ref=Data(numarray.array([-10.0, 4.0]),self.functionspace)
29853          self.failUnless(isinstance(res,Data),"wrong type of result.")
29854          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29855          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29856       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29857       def test_generalTensorProduct_array_rank2_constData_rank3_offset2(self):
29858          arg0=numarray.array([[-3.0, 1.0, 3.0], [-3.0, 4.0, 7.0]])
29859          arg1=Data(numarray.array([[[1.0, 7.0], [-6.0, -3.0], [2.0, 2.0]], [[-4.0, -2.0], [0.0, 0.0], [-6.0, 5.0]]]),self.functionspace)
29860          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29861          ref=Data(numarray.array([-33.0, 23.0]),self.functionspace)
29862          self.failUnless(isinstance(res,Data),"wrong type of result.")
29863          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29864          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29865       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29866       def test_generalTensorProduct_array_rank3_constData_rank4_offset3(self):
29867          arg0=numarray.array([[[6.0, 5.0, 1.0], [-2.0, 5.0, 1.0], [0.0, -4.0, -6.0], [-6.0, 2.0, -1.0]], [[-7.0, -5.0, 0.0], [6.0, 6.0, -5.0], [-7.0, -2.0, 7.0], [-2.0, 7.0, 1.0]]])
29868          arg1=Data(numarray.array([[[[7.0, 5.0], [-2.0, 6.0], [6.0, -3.0]], [[0.0, 1.0], [-1.0, 0.0], [-2.0, -4.0]], [[-4.0, -4.0], [-5.0, -2.0], [-7.0, 0.0]], [[1.0, -7.0], [1.0, -6.0], [7.0, -3.0]]], [[[-3.0, -1.0], [-5.0, -1.0], [-5.0, -1.0]], [[-2.0, 0.0], [-7.0, 0.0], [5.0, -5.0]], [[-2.0, -7.0], [2.0, -6.0], [7.0, -4.0]], [[-1.0, -5.0], [3.0, -1.0], [-6.0, 7.0]]]]),self.functionspace)
29869          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29870          ref=Data(numarray.array([125.0, 172.0]),self.functionspace)
29871          self.failUnless(isinstance(res,Data),"wrong type of result.")
29872          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29873          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29874       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29875       def test_generalTensorProduct_array_rank0_constData_rank2_offset0(self):
29876          arg0=numarray.array(3.0)
29877          arg1=Data(numarray.array([[6.0, -3.0, -5.0, -3.0, 0.0], [1.0, 6.0, 6.0, 3.0, 0.0], [-6.0, 3.0, 7.0, -5.0, 1.0], [6.0, -1.0, 2.0, 0.0, -2.0]]),self.functionspace)
29878          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29879          ref=Data(numarray.array([[18.0, -9.0, -15.0, -9.0, 0.0], [3.0, 18.0, 18.0, 9.0, 0.0], [-18.0, 9.0, 21.0, -15.0, 3.0], [18.0, -3.0, 6.0, 0.0, -6.0]]),self.functionspace)
29880          self.failUnless(isinstance(res,Data),"wrong type of result.")
29881          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29882          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29883       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29884       def test_generalTensorProduct_array_rank1_constData_rank3_offset1(self):
29885          arg0=numarray.array([-6.0, 0.0, -1.0])
29886          arg1=Data(numarray.array([[[-7.0, 6.0, -2.0, -4.0, -7.0], [1.0, 1.0, -1.0, -7.0, 7.0], [5.0, -4.0, -4.0, 0.0, -3.0], [5.0, -2.0, -4.0, 0.0, -2.0]], [[2.0, -7.0, 0.0, 3.0, -1.0], [1.0, -7.0, -4.0, 6.0, -2.0], [-4.0, 7.0, 5.0, 1.0, 0.0], [7.0, -1.0, -5.0, 7.0, 6.0]], [[-3.0, -5.0, 4.0, -1.0, 6.0], [5.0, -3.0, -7.0, -1.0, -4.0], [7.0, 2.0, 7.0, 3.0, -5.0], [5.0, -6.0, 6.0, 5.0, -3.0]]]),self.functionspace)
29887          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29888          ref=Data(numarray.array([[45.0, -31.0, 8.0, 25.0, 36.0], [-11.0, -3.0, 13.0, 43.0, -38.0], [-37.0, 22.0, 17.0, -3.0, 23.0], [-35.0, 18.0, 18.0, -5.0, 15.0]]),self.functionspace)
29889          self.failUnless(isinstance(res,Data),"wrong type of result.")
29890          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29891          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29892       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29893       def test_generalTensorProduct_array_rank2_constData_rank4_offset2(self):
29894          arg0=numarray.array([[-2.0, 0.0, 0.0], [6.0, 3.0, 0.0]])
29895          arg1=Data(numarray.array([[[[1.0, -5.0, -1.0, -5.0, -4.0], [0.0, -4.0, -2.0, 7.0, 2.0], [4.0, 5.0, 0.0, 2.0, -4.0], [1.0, -2.0, 1.0, -5.0, 0.0]], [[-1.0, -1.0, 4.0, 6.0, -1.0], [-7.0, 4.0, 2.0, -4.0, 1.0], [-3.0, 1.0, -3.0, -1.0, -6.0], [1.0, -4.0, 4.0, 0.0, 0.0]], [[0.0, 1.0, 1.0, -7.0, 6.0], [-7.0, -1.0, 3.0, 3.0, 3.0], [3.0, -6.0, 0.0, 6.0, 6.0], [7.0, 0.0, 2.0, 7.0, 6.0]]], [[[-3.0, -2.0, -5.0, -7.0, 0.0], [0.0, -3.0, 1.0, -1.0, 0.0], [-3.0, -5.0, 2.0, 4.0, -1.0], [-7.0, 3.0, 5.0, -1.0, -5.0]], [[-2.0, 0.0, 4.0, -3.0, 0.0], [-3.0, -6.0, 0.0, -7.0, -3.0], [4.0, -6.0, 4.0, 4.0, 2.0], [-5.0, 4.0, -4.0, -1.0, -6.0]], [[0.0, 1.0, -5.0, -7.0, 4.0], [3.0, -3.0, -2.0, -4.0, 2.0], [-1.0, -3.0, 4.0, -3.0, 2.0], [2.0, 1.0, 3.0, 0.0, -2.0]]]]),self.functionspace)
29896          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29897          ref=Data(numarray.array([[-26.0, -2.0, -16.0, -41.0, 8.0], [-9.0, -28.0, 10.0, -41.0, -13.0], [-14.0, -58.0, 24.0, 32.0, 8.0], [-59.0, 34.0, 16.0, 1.0, -48.0]]),self.functionspace)
29898          self.failUnless(isinstance(res,Data),"wrong type of result.")
29899          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
29900          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29901       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29902       def test_generalTensorProduct_array_rank0_constData_rank3_offset0(self):
29903          arg0=numarray.array(0.0)
29904          arg1=Data(numarray.array([[[0.0, -1.0], [-3.0, -1.0]], [[5.0, 2.0], [-4.0, 6.0]], [[-5.0, 4.0], [0.0, 7.0]], [[-2.0, -2.0], [5.0, 6.0]], [[0.0, 5.0], [1.0, -6.0]], [[-1.0, -3.0], [4.0, 7.0]]]),self.functionspace)
29905          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29906          ref=Data(numarray.array([[[0.0, -0.0], [-0.0, -0.0]], [[0.0, 0.0], [-0.0, 0.0]], [[-0.0, 0.0], [0.0, 0.0]], [[-0.0, -0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, -0.0]], [[-0.0, -0.0], [0.0, 0.0]]]),self.functionspace)
29907          self.failUnless(isinstance(res,Data),"wrong type of result.")
29908          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29909          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29910       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29911       def test_generalTensorProduct_array_rank1_constData_rank4_offset1(self):
29912          arg0=numarray.array([-2.0, 0.0, 1.0])
29913          arg1=Data(numarray.array([[[[0.0, 6.0], [5.0, 2.0]], [[-2.0, 2.0], [3.0, 0.0]], [[-2.0, 1.0], [4.0, -6.0]], [[-5.0, 5.0], [-6.0, 4.0]], [[-2.0, -5.0], [5.0, 2.0]], [[-2.0, 2.0], [-7.0, 0.0]]], [[[-1.0, -4.0], [-4.0, -2.0]], [[3.0, -6.0], [-7.0, 4.0]], [[-6.0, -3.0], [-6.0, -3.0]], [[5.0, -2.0], [4.0, -5.0]], [[4.0, -6.0], [7.0, 6.0]], [[-7.0, -4.0], [-4.0, 5.0]]], [[[3.0, -2.0], [-3.0, 0.0]], [[4.0, 4.0], [-4.0, 1.0]], [[-4.0, -3.0], [0.0, 2.0]], [[6.0, -3.0], [0.0, -6.0]], [[-1.0, 2.0], [5.0, -3.0]], [[6.0, 7.0], [6.0, 4.0]]]]),self.functionspace)
29914          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29915          ref=Data(numarray.array([[[3.0, -14.0], [-13.0, -4.0]], [[8.0, 0.0], [-10.0, 1.0]], [[0.0, -5.0], [-8.0, 14.0]], [[16.0, -13.0], [12.0, -14.0]], [[3.0, 12.0], [-5.0, -7.0]], [[10.0, 3.0], [20.0, 4.0]]]),self.functionspace)
29916          self.failUnless(isinstance(res,Data),"wrong type of result.")
29917          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
29918          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29919       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29920       def test_generalTensorProduct_array_rank0_constData_rank4_offset0(self):
29921          arg0=numarray.array(5.0)
29922          arg1=Data(numarray.array([[[[0.0, -3.0, -4.0, -5.0], [7.0, 4.0, 4.0, -2.0], [-6.0, 1.0, 6.0, 3.0]], [[2.0, 0.0, 6.0, 7.0], [3.0, 7.0, -1.0, -2.0], [6.0, 5.0, 3.0, 5.0]]], [[[-2.0, 1.0, 4.0, 1.0], [6.0, -6.0, -1.0, -4.0], [1.0, 3.0, 7.0, 7.0]], [[7.0, -6.0, 0.0, 5.0], [-1.0, -7.0, 3.0, -3.0], [-1.0, 1.0, 2.0, -3.0]]], [[[3.0, -4.0, 6.0, -2.0], [4.0, -2.0, 5.0, 6.0], [4.0, -3.0, -2.0, 1.0]], [[1.0, 0.0, -2.0, -4.0], [0.0, -7.0, -6.0, 5.0], [7.0, 7.0, -2.0, 2.0]]]]),self.functionspace)
29923          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29924          ref=Data(numarray.array([[[[0.0, -15.0, -20.0, -25.0], [35.0, 20.0, 20.0, -10.0], [-30.0, 5.0, 30.0, 15.0]], [[10.0, 0.0, 30.0, 35.0], [15.0, 35.0, -5.0, -10.0], [30.0, 25.0, 15.0, 25.0]]], [[[-10.0, 5.0, 20.0, 5.0], [30.0, -30.0, -5.0, -20.0], [5.0, 15.0, 35.0, 35.0]], [[35.0, -30.0, 0.0, 25.0], [-5.0, -35.0, 15.0, -15.0], [-5.0, 5.0, 10.0, -15.0]]], [[[15.0, -20.0, 30.0, -10.0], [20.0, -10.0, 25.0, 30.0], [20.0, -15.0, -10.0, 5.0]], [[5.0, 0.0, -10.0, -20.0], [0.0, -35.0, -30.0, 25.0], [35.0, 35.0, -10.0, 10.0]]]]),self.functionspace)
29925          self.failUnless(isinstance(res,Data),"wrong type of result.")
29926          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
29927          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29928       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29929       def test_generalTensorProduct_array_rank0_expandedData_rank0_offset0(self):
29930          arg0=numarray.array(5.0)
29931          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29932          arg1=msk_arg1*(1.0)+(1-msk_arg1)*(6.0)
29933          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29934          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29935          ref=msk_ref*numarray.array(5.0)+(1.-msk_ref)*numarray.array(30.0)
29936          self.failUnless(isinstance(res,Data),"wrong type of result.")
29937          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29938          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29939       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29940       def test_generalTensorProduct_array_rank1_expandedData_rank1_offset1(self):
29941          arg0=numarray.array([1.0, -7.0, 5.0])
29942          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29943          arg1=msk_arg1*numarray.array([4.0, -2.0, -6.0])+(1.-msk_arg1)*numarray.array([-3.0, -1.0, -2.0])
29944          res=generalTensorProduct(arg0,arg1,axis_offset=1)
29945          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29946          ref=msk_ref*numarray.array(-12.0)+(1.-msk_ref)*numarray.array(-6.0)
29947          self.failUnless(isinstance(res,Data),"wrong type of result.")
29948          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29949          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29950       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29951       def test_generalTensorProduct_array_rank2_expandedData_rank2_offset2(self):
29952          arg0=numarray.array([[-6.0, 0.0, 0.0], [7.0, -3.0, 5.0]])
29953          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29954          arg1=msk_arg1*numarray.array([[-7.0, 2.0, 6.0], [7.0, 1.0, 2.0]])+(1.-msk_arg1)*numarray.array([[-6.0, 7.0, -6.0], [-7.0, -2.0, 0.0]])
29955          res=generalTensorProduct(arg0,arg1,axis_offset=2)
29956          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29957          ref=msk_ref*numarray.array(98.0)+(1.-msk_ref)*numarray.array(-7.0)
29958          self.failUnless(isinstance(res,Data),"wrong type of result.")
29959          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29960          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29961       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29962       def test_generalTensorProduct_array_rank3_expandedData_rank3_offset3(self):
29963          arg0=numarray.array([[[-5.0, 1.0, -7.0], [5.0, 1.0, -5.0], [7.0, -5.0, -4.0], [-7.0, 0.0, -7.0]], [[2.0, -1.0, 7.0], [2.0, -6.0, -2.0], [-3.0, -7.0, 4.0], [-6.0, 0.0, 6.0]]])
29964          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29965          arg1=msk_arg1*numarray.array([[[-6.0, 2.0, -2.0], [-5.0, 4.0, 7.0], [1.0, -1.0, 1.0], [2.0, 6.0, -6.0]], [[-7.0, -5.0, -4.0], [0.0, -6.0, 3.0], [-5.0, 3.0, -4.0], [7.0, 3.0, -6.0]]])+(1.-msk_arg1)*numarray.array([[[-2.0, 6.0, -1.0], [7.0, 1.0, -5.0], [7.0, -1.0, 3.0], [2.0, -6.0, -2.0]], [[5.0, -1.0, -3.0], [-5.0, -3.0, 1.0], [5.0, 4.0, 2.0], [-7.0, 1.0, -2.0]]])
29966          res=generalTensorProduct(arg0,arg1,axis_offset=3)
29967          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29968          ref=msk_ref*numarray.array(-81.0)+(1.-msk_ref)*numarray.array(117.0)
29969          self.failUnless(isinstance(res,Data),"wrong type of result.")
29970          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29971          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29972       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29973       def test_generalTensorProduct_array_rank4_expandedData_rank4_offset4(self):
29974          arg0=numarray.array([[[[7.0, -1.0], [-7.0, 3.0], [5.0, 4.0]], [[-4.0, 6.0], [-2.0, -4.0], [1.0, -1.0]]], [[[1.0, 0.0], [3.0, -3.0], [0.0, 6.0]], [[6.0, -7.0], [-1.0, 7.0], [7.0, 2.0]]], [[[0.0, 4.0], [-4.0, 5.0], [5.0, -3.0]], [[2.0, -3.0], [0.0, 5.0], [4.0, 4.0]]], [[[-7.0, 7.0], [-5.0, -1.0], [2.0, -6.0]], [[-3.0, -5.0], [-6.0, 3.0], [6.0, -5.0]]]])
29975          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29976          arg1=msk_arg1*numarray.array([[[[-3.0, 5.0], [-7.0, 0.0], [-5.0, 4.0]], [[6.0, 3.0], [6.0, 4.0], [-3.0, -6.0]]], [[[-4.0, 3.0], [1.0, 1.0], [-2.0, -5.0]], [[5.0, 2.0], [0.0, 6.0], [3.0, -1.0]]], [[[-4.0, -1.0], [7.0, -6.0], [7.0, -1.0]], [[-1.0, 0.0], [-6.0, -3.0], [-6.0, -4.0]]], [[[0.0, 0.0], [-5.0, 5.0], [-3.0, 7.0]], [[6.0, 1.0], [-6.0, -3.0], [-2.0, -2.0]]]])+(1.-msk_arg1)*numarray.array([[[[4.0, -3.0], [3.0, -1.0], [-4.0, -7.0]], [[7.0, -7.0], [2.0, 6.0], [-7.0, 6.0]]], [[[6.0, 0.0], [-1.0, -7.0], [-3.0, -7.0]], [[-7.0, 0.0], [4.0, -4.0], [-6.0, -1.0]]], [[[-6.0, 0.0], [-7.0, 7.0], [-7.0, -6.0]], [[5.0, -5.0], [-7.0, 1.0], [3.0, 0.0]]], [[[-2.0, -5.0], [0.0, 2.0], [7.0, 6.0]], [[4.0, 2.0], [1.0, 3.0], [7.0, -5.0]]]])
29977          res=generalTensorProduct(arg0,arg1,axis_offset=4)
29978          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29979          ref=msk_ref*numarray.array(-81.0)+(1.-msk_ref)*numarray.array(-197.0)
29980          self.failUnless(isinstance(res,Data),"wrong type of result.")
29981          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
29982          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29983       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29984       def test_generalTensorProduct_array_rank0_expandedData_rank1_offset0(self):
29985          arg0=numarray.array(-3.0)
29986          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29987          arg1=msk_arg1*numarray.array([-4.0, 7.0])+(1.-msk_arg1)*numarray.array([0.0, -2.0])
29988          res=generalTensorProduct(arg0,arg1,axis_offset=0)
29989          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
29990          ref=msk_ref*numarray.array([12.0, -21.0])+(1.-msk_ref)*numarray.array([-0.0, 6.0])
29991          self.failUnless(isinstance(res,Data),"wrong type of result.")
29992          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
29993          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29994       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29995       def test_generalTensorProduct_array_rank1_expandedData_rank2_offset1(self):
29996          arg0=numarray.array([-6.0, -6.0, -4.0])
29997          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
29998          arg1=msk_arg1*numarray.array([[-4.0, 5.0], [7.0, -4.0], [-1.0, 0.0]])+(1.-msk_arg1)*numarray.array([[1.0, 6.0], [6.0, -1.0], [1.0, 5.0]])
29999          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30000          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30001          ref=msk_ref*numarray.array([-14.0, -6.0])+(1.-msk_ref)*numarray.array([-46.0, -50.0])
30002          self.failUnless(isinstance(res,Data),"wrong type of result.")
30003          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30004          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30005       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30006       def test_generalTensorProduct_array_rank2_expandedData_rank3_offset2(self):
30007          arg0=numarray.array([[-1.0, -3.0, -5.0], [5.0, -7.0, 5.0]])
30008          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30009          arg1=msk_arg1*numarray.array([[[-3.0, 7.0], [3.0, 0.0], [-2.0, 3.0]], [[-7.0, 0.0], [6.0, -5.0], [3.0, 3.0]]])+(1.-msk_arg1)*numarray.array([[[6.0, -4.0], [0.0, 6.0], [-6.0, -3.0]], [[2.0, -7.0], [-4.0, 3.0], [-4.0, -5.0]]])
30010          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30011          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30012          ref=msk_ref*numarray.array([-58.0, 28.0])+(1.-msk_ref)*numarray.array([42.0, -80.0])
30013          self.failUnless(isinstance(res,Data),"wrong type of result.")
30014          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30015          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30016       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30017       def test_generalTensorProduct_array_rank3_expandedData_rank4_offset3(self):
30018          arg0=numarray.array([[[-5.0, 3.0, 6.0], [-2.0, 7.0, -4.0], [0.0, 4.0, 5.0], [0.0, -7.0, -5.0]], [[0.0, -6.0, 3.0], [-1.0, -3.0, 5.0], [-6.0, 0.0, -2.0], [-6.0, -7.0, 6.0]]])
30019          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30020          arg1=msk_arg1*numarray.array([[[[0.0, -4.0], [-5.0, 6.0], [2.0, 6.0]], [[-6.0, 0.0], [1.0, 6.0], [0.0, -5.0]], [[-2.0, -4.0], [-1.0, -4.0], [-7.0, -6.0]], [[2.0, 2.0], [-3.0, 5.0], [-7.0, -1.0]]], [[[6.0, 6.0], [-2.0, -6.0], [4.0, -5.0]], [[2.0, 5.0], [7.0, -5.0], [0.0, -3.0]], [[2.0, 1.0], [7.0, 4.0], [1.0, 4.0]], [[-2.0, -6.0], [3.0, -1.0], [4.0, 3.0]]]])+(1.-msk_arg1)*numarray.array([[[[5.0, 2.0], [-1.0, -5.0], [3.0, -3.0]], [[6.0, 5.0], [-6.0, 0.0], [6.0, 2.0]], [[3.0, -1.0], [6.0, 4.0], [4.0, 0.0]], [[-7.0, 4.0], [-2.0, -1.0], [-4.0, -2.0]]], [[[-3.0, -6.0], [-3.0, -6.0], [1.0, 4.0]], [[-3.0, -7.0], [-5.0, -5.0], [2.0, 4.0]], [[7.0, -4.0], [-6.0, -4.0], [-2.0, -7.0]], [[-4.0, 7.0], [-6.0, 2.0], [5.0, 1.0]]]])
30021          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30022          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30023          ref=msk_ref*numarray.array([35.0, 123.0])+(1.-msk_ref)*numarray.array([97.0, 50.0])
30024          self.failUnless(isinstance(res,Data),"wrong type of result.")
30025          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30026          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30027       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30028       def test_generalTensorProduct_array_rank0_expandedData_rank2_offset0(self):
30029          arg0=numarray.array(-6.0)
30030          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30031          arg1=msk_arg1*numarray.array([[3.0, -3.0, -5.0, 4.0, 3.0], [-3.0, -7.0, 1.0, 0.0, 4.0], [-1.0, 5.0, -3.0, 5.0, 3.0], [-1.0, -3.0, -1.0, 0.0, -7.0]])+(1.-msk_arg1)*numarray.array([[0.0, 4.0, 5.0, -5.0, -6.0], [4.0, 2.0, 0.0, 1.0, 0.0], [5.0, 1.0, 0.0, -6.0, 5.0], [1.0, 0.0, -3.0, -1.0, 3.0]])
30032          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30033          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30034          ref=msk_ref*numarray.array([[-18.0, 18.0, 30.0, -24.0, -18.0], [18.0, 42.0, -6.0, -0.0, -24.0], [6.0, -30.0, 18.0, -30.0, -18.0], [6.0, 18.0, 6.0, -0.0, 42.0]])+(1.-msk_ref)*numarray.array([[-0.0, -24.0, -30.0, 30.0, 36.0], [-24.0, -12.0, -0.0, -6.0, -0.0], [-30.0, -6.0, -0.0, 36.0, -30.0], [-6.0, -0.0, 18.0, 6.0, -18.0]])
30035          self.failUnless(isinstance(res,Data),"wrong type of result.")
30036          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
30037          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30038       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30039       def test_generalTensorProduct_array_rank1_expandedData_rank3_offset1(self):
30040          arg0=numarray.array([6.0, 7.0, 7.0])
30041          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30042          arg1=msk_arg1*numarray.array([[[6.0, -5.0, -7.0, -5.0, 5.0], [2.0, 2.0, 0.0, 0.0, -3.0], [-2.0, 4.0, -4.0, 4.0, -6.0], [-3.0, 0.0, -5.0, -6.0, 4.0]], [[-2.0, 7.0, 6.0, 5.0, 5.0], [-6.0, 0.0, -3.0, 2.0, 5.0], [1.0, 1.0, -2.0, 6.0, 7.0], [-1.0, -6.0, -4.0, 5.0, -2.0]], [[-5.0, -5.0, 5.0, -2.0, 4.0], [0.0, -4.0, -3.0, 0.0, 4.0], [0.0, -6.0, 5.0, 3.0, 4.0], [-5.0, -4.0, -4.0, 1.0, 2.0]]])+(1.-msk_arg1)*numarray.array([[[1.0, 7.0, 7.0, -3.0, 6.0], [3.0, 1.0, 5.0, -5.0, 0.0], [6.0, -5.0, -7.0, 1.0, 4.0], [-1.0, 0.0, 3.0, 5.0, 0.0]], [[3.0, 7.0, -7.0, 4.0, 7.0], [2.0, -5.0, 7.0, -7.0, 1.0], [-2.0, -3.0, 4.0, 1.0, 6.0], [1.0, 6.0, -4.0, 3.0, 5.0]], [[1.0, 0.0, -6.0, -5.0, 3.0], [-5.0, 2.0, 4.0, -1.0, 5.0], [-6.0, -5.0, 7.0, -6.0, -3.0], [-6.0, -1.0, 5.0, -2.0, 4.0]]])
30043          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30044          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30045          ref=msk_ref*numarray.array([[-13.0, -16.0, 35.0, -9.0, 93.0], [-30.0, -16.0, -42.0, 14.0, 45.0], [-5.0, -11.0, -3.0, 87.0, 41.0], [-60.0, -70.0, -86.0, 6.0, 24.0]])+(1.-msk_ref)*numarray.array([[34.0, 91.0, -49.0, -25.0, 106.0], [-3.0, -15.0, 107.0, -86.0, 42.0], [-20.0, -86.0, 35.0, -29.0, 45.0], [-41.0, 35.0, 25.0, 37.0, 63.0]])
30046          self.failUnless(isinstance(res,Data),"wrong type of result.")
30047          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
30048          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30049       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30050       def test_generalTensorProduct_array_rank2_expandedData_rank4_offset2(self):
30051          arg0=numarray.array([[-6.0, -2.0, 0.0], [-2.0, 0.0, 0.0]])
30052          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30053          arg1=msk_arg1*numarray.array([[[[7.0, 3.0, 7.0, -7.0, 3.0], [-2.0, -2.0, 0.0, -7.0, 2.0], [-2.0, -6.0, 4.0, 2.0, -2.0], [-4.0, 4.0, 3.0, 7.0, -3.0]], [[5.0, 1.0, 0.0, -1.0, 7.0], [5.0, 2.0, 0.0, 4.0, 0.0], [5.0, -7.0, 3.0, 5.0, -4.0], [3.0, -1.0, 7.0, 0.0, -2.0]], [[4.0, -7.0, 3.0, 0.0, 0.0], [3.0, 2.0, 4.0, 3.0, -2.0], [5.0, -2.0, -6.0, 5.0, -4.0], [-4.0, -6.0, 0.0, -7.0, -2.0]]], [[[5.0, 7.0, -2.0, 5.0, 3.0], [7.0, 0.0, 5.0, 1.0, -2.0], [0.0, 7.0, 1.0, 5.0, -4.0], [5.0, 7.0, 0.0, 2.0, 5.0]], [[6.0, 6.0, 4.0, -4.0, -6.0], [-3.0, 0.0, -4.0, 7.0, 4.0], [7.0, 3.0, 0.0, -6.0, -7.0], [6.0, 3.0, 0.0, -7.0, 4.0]], [[-2.0, 2.0, 0.0, 2.0, 0.0], [-4.0, 0.0, 0.0, 2.0, 3.0], [-7.0, -6.0, 1.0, -7.0, -4.0], [7.0, 4.0, 0.0, 0.0, -3.0]]]])+(1.-msk_arg1)*numarray.array([[[[7.0, 7.0, 2.0, -7.0, 0.0], [1.0, -7.0, 0.0, -4.0, 5.0], [-7.0, -3.0, 0.0, 3.0, -3.0], [5.0, -4.0, 7.0, -1.0, 3.0]], [[5.0, 4.0, 5.0, 4.0, 3.0], [2.0, 4.0, -7.0, 1.0, -5.0], [-1.0, -7.0, 5.0, 0.0, -3.0], [-2.0, 1.0, 1.0, 0.0, 6.0]], [[-3.0, 0.0, 7.0, -5.0, -5.0], [3.0, -4.0, 3.0, 5.0, -7.0], [-7.0, -2.0, 7.0, 7.0, -4.0], [0.0, -3.0, 0.0, -7.0, -4.0]]], [[[-3.0, -4.0, 0.0, -7.0, -1.0], [-7.0, 6.0, -7.0, 6.0, 6.0], [7.0, 0.0, 6.0, -3.0, 0.0], [0.0, 4.0, 1.0, 1.0, -2.0]], [[0.0, 0.0, 4.0, 4.0, 7.0], [0.0, -5.0, 2.0, -7.0, 4.0], [-3.0, -4.0, -3.0, 2.0, 7.0], [-1.0, -7.0, -7.0, 7.0, 0.0]], [[-7.0, 5.0, -3.0, 1.0, 3.0], [-6.0, -1.0, -6.0, -5.0, -6.0], [-2.0, 6.0, -3.0, 4.0, 0.0], [0.0, -1.0, -2.0, 6.0, -7.0]]]])
30054          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30055          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30056          ref=msk_ref*numarray.array([[-62.0, -34.0, -38.0, 34.0, -38.0], [-12.0, 8.0, -10.0, 32.0, -8.0], [2.0, 36.0, -32.0, -32.0, 28.0], [8.0, -36.0, -32.0, -46.0, 12.0]])+(1.-msk_ref)*numarray.array([[-46.0, -42.0, -22.0, 48.0, -4.0], [4.0, 22.0, 28.0, 10.0, -32.0], [30.0, 32.0, -22.0, -12.0, 24.0], [-26.0, 14.0, -46.0, 4.0, -26.0]])
30057          self.failUnless(isinstance(res,Data),"wrong type of result.")
30058          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
30059          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30060       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30061       def test_generalTensorProduct_array_rank0_expandedData_rank3_offset0(self):
30062          arg0=numarray.array(-5.0)
30063          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30064          arg1=msk_arg1*numarray.array([[[-5.0, 0.0], [2.0, -6.0]], [[-4.0, 0.0], [-1.0, -5.0]], [[-2.0, 6.0], [-2.0, -4.0]], [[-4.0, 4.0], [-2.0, -6.0]], [[0.0, 3.0], [2.0, -1.0]], [[6.0, 7.0], [-3.0, 7.0]]])+(1.-msk_arg1)*numarray.array([[[7.0, 4.0], [5.0, 5.0]], [[-5.0, -1.0], [-1.0, 2.0]], [[2.0, -2.0], [0.0, 6.0]], [[-5.0, 6.0], [-2.0, 0.0]], [[4.0, 4.0], [0.0, 5.0]], [[-5.0, -3.0], [4.0, 2.0]]])
30065          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30066          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30067          ref=msk_ref*numarray.array([[[25.0, -0.0], [-10.0, 30.0]], [[20.0, -0.0], [5.0, 25.0]], [[10.0, -30.0], [10.0, 20.0]], [[20.0, -20.0], [10.0, 30.0]], [[-0.0, -15.0], [-10.0, 5.0]], [[-30.0, -35.0], [15.0, -35.0]]])+(1.-msk_ref)*numarray.array([[[-35.0, -20.0], [-25.0, -25.0]], [[25.0, 5.0], [5.0, -10.0]], [[-10.0, 10.0], [-0.0, -30.0]], [[25.0, -30.0], [10.0, -0.0]], [[-20.0, -20.0], [-0.0, -25.0]], [[25.0, 15.0], [-20.0, -10.0]]])
30068          self.failUnless(isinstance(res,Data),"wrong type of result.")
30069          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
30070          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30071       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30072       def test_generalTensorProduct_array_rank1_expandedData_rank4_offset1(self):
30073          arg0=numarray.array([-5.0, -6.0, -3.0])
30074          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30075          arg1=msk_arg1*numarray.array([[[[6.0, 0.0], [-5.0, 0.0]], [[6.0, -3.0], [4.0, -4.0]], [[-3.0, 6.0], [0.0, 4.0]], [[-6.0, -4.0], [-7.0, 7.0]], [[7.0, -7.0], [-7.0, 1.0]], [[-4.0, 5.0], [0.0, 0.0]]], [[[0.0, 2.0], [0.0, 2.0]], [[-2.0, 0.0], [-5.0, -1.0]], [[5.0, 5.0], [-7.0, -3.0]], [[-7.0, 0.0], [7.0, -5.0]], [[1.0, -7.0], [5.0, 2.0]], [[-2.0, 4.0], [-3.0, -3.0]]], [[[-6.0, 7.0], [1.0, 6.0]], [[0.0, 5.0], [4.0, -1.0]], [[-6.0, -3.0], [5.0, -1.0]], [[0.0, 5.0], [2.0, -1.0]], [[-3.0, 5.0], [7.0, 2.0]], [[6.0, 0.0], [-5.0, 1.0]]]])+(1.-msk_arg1)*numarray.array([[[[1.0, -2.0], [-6.0, -2.0]], [[-3.0, 0.0], [4.0, 0.0]], [[-4.0, 1.0], [2.0, 3.0]], [[0.0, 2.0], [-4.0, -2.0]], [[2.0, 0.0], [3.0, 4.0]], [[0.0, 7.0], [2.0, -7.0]]], [[[2.0, 2.0], [7.0, 5.0]], [[-2.0, 7.0], [0.0, 3.0]], [[4.0, 7.0], [0.0, 1.0]], [[-3.0, 5.0], [6.0, 4.0]], [[-4.0, 0.0], [4.0, -5.0]], [[-2.0, 6.0], [3.0, -1.0]]], [[[7.0, -1.0], [4.0, 7.0]], [[-6.0, 0.0], [-3.0, 1.0]], [[-1.0, 1.0], [6.0, -3.0]], [[-4.0, 1.0], [0.0, -1.0]], [[1.0, 7.0], [4.0, 4.0]], [[-4.0, -3.0], [-2.0, 7.0]]]])
30076          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30077          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30078          ref=msk_ref*numarray.array([[[-12.0, -33.0], [22.0, -30.0]], [[-18.0, 0.0], [-2.0, 29.0]], [[3.0, -51.0], [27.0, 1.0]], [[72.0, 5.0], [-13.0, -2.0]], [[-32.0, 62.0], [-16.0, -23.0]], [[14.0, -49.0], [33.0, 15.0]]])+(1.-msk_ref)*numarray.array([[[-38.0, 1.0], [-24.0, -41.0]], [[45.0, -42.0], [-11.0, -21.0]], [[-1.0, -50.0], [-28.0, -12.0]], [[30.0, -43.0], [-16.0, -11.0]], [[11.0, -21.0], [-51.0, -2.0]], [[24.0, -62.0], [-22.0, 20.0]]])
30079          self.failUnless(isinstance(res,Data),"wrong type of result.")
30080          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
30081          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30082       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30083       def test_generalTensorProduct_array_rank0_expandedData_rank4_offset0(self):
30084          arg0=numarray.array(-1.0)
30085          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30086          arg1=msk_arg1*numarray.array([[[[-2.0, -3.0, 4.0, -1.0], [7.0, 1.0, -3.0, 1.0], [2.0, -3.0, 0.0, 5.0]], [[3.0, 4.0, 4.0, 1.0], [-7.0, 0.0, 6.0, -6.0], [4.0, -4.0, -2.0, 1.0]]], [[[-7.0, 5.0, 0.0, -5.0], [-5.0, 0.0, 5.0, -5.0], [-4.0, 1.0, -6.0, -1.0]], [[-7.0, -5.0, -3.0, 2.0], [-2.0, 0.0, -7.0, -7.0], [0.0, -6.0, -1.0, 5.0]]], [[[-2.0, 6.0, 5.0, -5.0], [2.0, 4.0, -6.0, -4.0], [-5.0, 4.0, -6.0, 7.0]], [[5.0, 4.0, 4.0, -2.0], [7.0, 3.0, -1.0, -2.0], [-1.0, 6.0, 6.0, 0.0]]]])+(1.-msk_arg1)*numarray.array([[[[-3.0, -7.0, 0.0, -5.0], [4.0, 5.0, -1.0, 5.0], [5.0, 2.0, 7.0, 1.0]], [[7.0, 0.0, -6.0, 6.0], [-5.0, 0.0, 0.0, 5.0], [-5.0, 7.0, -5.0, 1.0]]], [[[0.0, -1.0, 5.0, 5.0], [4.0, 1.0, 5.0, 2.0], [0.0, -2.0, 3.0, 5.0]], [[-5.0, 4.0, 2.0, -4.0], [0.0, 0.0, -2.0, -6.0], [7.0, 6.0, 0.0, 5.0]]], [[[-3.0, 5.0, 0.0, -6.0], [7.0, -2.0, -5.0, -4.0], [-2.0, 7.0, -4.0, -2.0]], [[-4.0, 1.0, 6.0, 0.0], [1.0, 3.0, 7.0, 0.0], [-3.0, -1.0, -2.0, -3.0]]]])
30087          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30088          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30089          ref=msk_ref*numarray.array([[[[2.0, 3.0, -4.0, 1.0], [-7.0, -1.0, 3.0, -1.0], [-2.0, 3.0, -0.0, -5.0]], [[-3.0, -4.0, -4.0, -1.0], [7.0, -0.0, -6.0, 6.0], [-4.0, 4.0, 2.0, -1.0]]], [[[7.0, -5.0, -0.0, 5.0], [5.0, -0.0, -5.0, 5.0], [4.0, -1.0, 6.0, 1.0]], [[7.0, 5.0, 3.0, -2.0], [2.0, -0.0, 7.0, 7.0], [-0.0, 6.0, 1.0, -5.0]]], [[[2.0, -6.0, -5.0, 5.0], [-2.0, -4.0, 6.0, 4.0], [5.0, -4.0, 6.0, -7.0]], [[-5.0, -4.0, -4.0, 2.0], [-7.0, -3.0, 1.0, 2.0], [1.0, -6.0, -6.0, -0.0]]]])+(1.-msk_ref)*numarray.array([[[[3.0, 7.0, -0.0, 5.0], [-4.0, -5.0, 1.0, -5.0], [-5.0, -2.0, -7.0, -1.0]], [[-7.0, -0.0, 6.0, -6.0], [5.0, -0.0, -0.0, -5.0], [5.0, -7.0, 5.0, -1.0]]], [[[-0.0, 1.0, -5.0, -5.0], [-4.0, -1.0, -5.0, -2.0], [-0.0, 2.0, -3.0, -5.0]], [[5.0, -4.0, -2.0, 4.0], [-0.0, -0.0, 2.0, 6.0], [-7.0, -6.0, -0.0, -5.0]]], [[[3.0, -5.0, -0.0, 6.0], [-7.0, 2.0, 5.0, 4.0], [2.0, -7.0, 4.0, 2.0]], [[4.0, -1.0, -6.0, -0.0], [-1.0, -3.0, -7.0, -0.0], [3.0, 1.0, 2.0, 3.0]]]])
30090          self.failUnless(isinstance(res,Data),"wrong type of result.")
30091          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
30092          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30093       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30094       def test_generalTensorProduct_array_rank1_float_rank0_offset0(self):
30095          arg0=numarray.array([4.0, -3.0])
30096          arg1=3.0
30097          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30098          ref=numarray.array([12.0, -9.0])
30099          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30100          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
30101          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30102       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30103       def test_generalTensorProduct_array_rank1_array_rank0_offset0(self):
30104          arg0=numarray.array([3.0, 5.0])
30105          arg1=numarray.array(4.0)
30106          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30107          ref=numarray.array([12.0, 20.0])
30108          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30109          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
30110          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30111       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30112       def test_generalTensorProduct_array_rank2_array_rank1_offset1(self):
30113          arg0=numarray.array([[0.0, 3.0, -3.0], [3.0, 5.0, 0.0]])
30114          arg1=numarray.array([3.0, 3.0, -1.0])
30115          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30116          ref=numarray.array([12.0, 24.0])
30117          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30118          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
30119          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30120       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30121       def test_generalTensorProduct_array_rank3_array_rank2_offset2(self):
30122          arg0=numarray.array([[[-3.0, -7.0, 5.0], [2.0, -2.0, 0.0]], [[-1.0, 0.0, 0.0], [-6.0, -5.0, -1.0]]])
30123          arg1=numarray.array([[-3.0, -4.0, 0.0], [-1.0, -7.0, -5.0]])
30124          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30125          ref=numarray.array([49.0, 49.0])
30126          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30127          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
30128          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30129       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30130       def test_generalTensorProduct_array_rank4_array_rank3_offset3(self):
30131          arg0=numarray.array([[[[4.0, -5.0, 6.0], [7.0, 5.0, 0.0], [0.0, -5.0, -3.0], [-3.0, -2.0, -2.0]], [[4.0, 1.0, -4.0], [-1.0, -1.0, 0.0], [1.0, 0.0, 6.0], [-5.0, 2.0, -6.0]]], [[[1.0, 2.0, 6.0], [2.0, 7.0, -6.0], [7.0, -6.0, 0.0], [-3.0, 0.0, -6.0]], [[2.0, 1.0, 3.0], [4.0, -4.0, 7.0], [5.0, 0.0, -4.0], [1.0, 0.0, 4.0]]]])
30132          arg1=numarray.array([[[-1.0, 7.0, 2.0], [-3.0, -4.0, -6.0], [7.0, -5.0, -5.0], [0.0, -1.0, -4.0]], [[6.0, -3.0, -5.0], [-2.0, 2.0, -1.0], [4.0, -1.0, -7.0], [-4.0, 5.0, -3.0]]])
30133          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30134          ref=numarray.array([33.0, 133.0])
30135          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30136          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
30137          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30138       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30139       def test_generalTensorProduct_array_rank1_array_rank1_offset0(self):
30140          arg0=numarray.array([-2.0, 0.0])
30141          arg1=numarray.array([-2.0, -1.0])
30142          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30143          ref=numarray.array([[4.0, 2.0], [0.0, 0.0]])
30144          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30145          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
30146          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30147       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30148       def test_generalTensorProduct_array_rank2_array_rank2_offset1(self):
30149          arg0=numarray.array([[-3.0, 4.0, 6.0], [-1.0, 2.0, -1.0]])
30150          arg1=numarray.array([[-4.0, -1.0], [-6.0, -7.0], [7.0, -7.0]])
30151          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30152          ref=numarray.array([[30.0, -67.0], [-15.0, -6.0]])
30153          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30154          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
30155          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30156       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30157       def test_generalTensorProduct_array_rank3_array_rank3_offset2(self):
30158          arg0=numarray.array([[[-4.0, 7.0, 7.0], [-7.0, -7.0, -5.0]], [[-6.0, 0.0, -3.0], [-3.0, 4.0, 4.0]]])
30159          arg1=numarray.array([[[-2.0, 7.0], [2.0, -6.0], [-1.0, 7.0]], [[3.0, 6.0], [7.0, 0.0], [5.0, 0.0]]])
30160          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30161          ref=numarray.array([[-80.0, -63.0], [54.0, -81.0]])
30162          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30163          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
30164          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30165       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30166       def test_generalTensorProduct_array_rank4_array_rank4_offset3(self):
30167          arg0=numarray.array([[[[-6.0, -2.0, -4.0], [1.0, -5.0, -2.0], [0.0, -3.0, -2.0], [0.0, -5.0, 5.0]], [[-3.0, 0.0, 7.0], [-4.0, 4.0, -7.0], [-1.0, 0.0, 5.0], [0.0, -1.0, 6.0]]], [[[-4.0, 4.0, 4.0], [-4.0, -7.0, 5.0], [3.0, 4.0, 5.0], [0.0, -3.0, 0.0]], [[-7.0, -6.0, -5.0], [-5.0, -6.0, 0.0], [-7.0, -6.0, -7.0], [-4.0, -6.0, -1.0]]]])
30168          arg1=numarray.array([[[[-7.0, 0.0], [3.0, -4.0], [7.0, 5.0]], [[7.0, -1.0], [7.0, -4.0], [-7.0, 4.0]], [[-6.0, 1.0], [1.0, 7.0], [1.0, -4.0]], [[-7.0, 3.0], [1.0, -7.0], [7.0, -1.0]]], [[[7.0, -4.0], [-1.0, 3.0], [-6.0, 6.0]], [[-7.0, -2.0], [-5.0, 0.0], [-4.0, 6.0]], [[4.0, 0.0], [-1.0, -1.0], [5.0, 0.0]], [[0.0, -4.0], [0.0, 3.0], [1.0, -6.0]]]])
30169          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30170          ref=numarray.array([[19.0, -3.0], [-62.0, 88.0]])
30171          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30172          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
30173          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30174       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30175       def test_generalTensorProduct_array_rank1_array_rank2_offset0(self):
30176          arg0=numarray.array([0.0, -5.0])
30177          arg1=numarray.array([[-4.0, 0.0, -6.0, -3.0, 0.0], [1.0, 5.0, -4.0, 6.0, 0.0], [7.0, -6.0, 0.0, -4.0, 5.0], [-6.0, 2.0, -6.0, 0.0, -6.0]])
30178          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30179          ref=numarray.array([[[0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]], [[20.0, 0.0, 30.0, 15.0, 0.0], [-5.0, -25.0, 20.0, -30.0, 0.0], [-35.0, 30.0, 0.0, 20.0, -25.0], [30.0, -10.0, 30.0, 0.0, 30.0]]])
30180          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30181          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
30182          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30183       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30184       def test_generalTensorProduct_array_rank2_array_rank3_offset1(self):
30185          arg0=numarray.array([[-6.0, 3.0, -1.0], [2.0, -2.0, -4.0]])
30186          arg1=numarray.array([[[7.0, 2.0, -5.0, -1.0, -4.0], [-5.0, 7.0, -1.0, -2.0, -7.0], [4.0, 3.0, -2.0, -6.0, -4.0], [0.0, 0.0, -4.0, -3.0, 7.0]], [[4.0, 0.0, 0.0, -2.0, 0.0], [6.0, 7.0, 7.0, 0.0, 7.0], [0.0, 0.0, 2.0, 5.0, 0.0], [-7.0, 0.0, 3.0, -3.0, 0.0]], [[-2.0, -7.0, -4.0, 4.0, -5.0], [-3.0, -5.0, -4.0, -5.0, -3.0], [4.0, -5.0, -1.0, 0.0, 7.0], [1.0, 4.0, -5.0, 6.0, -5.0]]])
30187          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30188          ref=numarray.array([[[-28.0, -5.0, 34.0, -4.0, 29.0], [51.0, -16.0, 31.0, 17.0, 66.0], [-28.0, -13.0, 19.0, 51.0, 17.0], [-22.0, -4.0, 38.0, 3.0, -37.0]], [[14.0, 32.0, 6.0, -14.0, 12.0], [-10.0, 20.0, 0.0, 16.0, -16.0], [-8.0, 26.0, -4.0, -22.0, -36.0], [10.0, -16.0, 6.0, -24.0, 34.0]]])
30189          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30190          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
30191          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30192       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30193       def test_generalTensorProduct_array_rank3_array_rank4_offset2(self):
30194          arg0=numarray.array([[[-3.0, 7.0, 0.0], [7.0, 0.0, -7.0]], [[7.0, 4.0, -2.0], [-1.0, 6.0, 1.0]]])
30195          arg1=numarray.array([[[[0.0, -6.0, 1.0, -1.0, -6.0], [1.0, 5.0, -2.0, -5.0, -7.0], [6.0, -4.0, 0.0, -7.0, -5.0], [0.0, 0.0, 4.0, -1.0, -6.0]], [[-4.0, 1.0, 1.0, 5.0, -4.0], [5.0, -4.0, 3.0, -3.0, 7.0], [-2.0, -7.0, -3.0, 7.0, -3.0], [7.0, -1.0, 0.0, -2.0, -6.0]], [[1.0, 3.0, 0.0, -7.0, 2.0], [0.0, 0.0, 5.0, -6.0, 0.0], [-2.0, -5.0, 1.0, -2.0, -4.0], [-7.0, 0.0, 6.0, 3.0, -7.0]]], [[[-6.0, 4.0, 1.0, 1.0, 0.0], [7.0, -4.0, -2.0, 0.0, 3.0], [-1.0, -3.0, -3.0, -4.0, 4.0], [-7.0, 5.0, -2.0, 0.0, 0.0]], [[-6.0, 0.0, -7.0, -7.0, -6.0], [-2.0, -1.0, 6.0, 0.0, 3.0], [-5.0, -3.0, 0.0, -5.0, -7.0], [5.0, -7.0, -5.0, -3.0, -2.0]], [[0.0, 3.0, -6.0, 5.0, 0.0], [2.0, -2.0, -4.0, 6.0, 4.0], [-1.0, -3.0, 6.0, 6.0, 2.0], [0.0, 3.0, 4.0, 1.0, -1.0]]]])
30196          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30197          ref=numarray.array([[[-70.0, 32.0, 53.0, 10.0, -10.0], [67.0, -57.0, 41.0, -48.0, 63.0], [-32.0, -37.0, -84.0, 0.0, 8.0], [0.0, 7.0, -54.0, -18.0, -17.0]], [[-48.0, -45.0, -38.0, -11.0, -98.0], [10.0, 15.0, 22.0, -29.0, -2.0], [8.0, -64.0, -5.0, -37.0, -83.0], [79.0, -48.0, -8.0, -38.0, -65.0]]])
30198          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30199          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
30200          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30201       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30202       def test_generalTensorProduct_array_rank1_array_rank3_offset0(self):
30203          arg0=numarray.array([1.0, 5.0])
30204          arg1=numarray.array([[[4.0, 3.0], [6.0, 0.0]], [[0.0, 0.0], [5.0, 4.0]], [[-5.0, 1.0], [-7.0, -2.0]], [[4.0, -7.0], [7.0, -2.0]], [[5.0, 2.0], [-3.0, 1.0]], [[0.0, 4.0], [-1.0, -5.0]]])
30205          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30206          ref=numarray.array([[[[4.0, 3.0], [6.0, 0.0]], [[0.0, 0.0], [5.0, 4.0]], [[-5.0, 1.0], [-7.0, -2.0]], [[4.0, -7.0], [7.0, -2.0]], [[5.0, 2.0], [-3.0, 1.0]], [[0.0, 4.0], [-1.0, -5.0]]], [[[20.0, 15.0], [30.0, 0.0]], [[0.0, 0.0], [25.0, 20.0]], [[-25.0, 5.0], [-35.0, -10.0]], [[20.0, -35.0], [35.0, -10.0]], [[25.0, 10.0], [-15.0, 5.0]], [[0.0, 20.0], [-5.0, -25.0]]]])
30207          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30208          self.failUnlessEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")
30209          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30210       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30211       def test_generalTensorProduct_array_rank2_array_rank4_offset1(self):
30212          arg0=numarray.array([[-7.0, 4.0, -6.0], [-2.0, -3.0, -7.0]])
30213          arg1=numarray.array([[[[3.0, 1.0], [-1.0, 2.0]], [[2.0, 2.0], [0.0, 1.0]], [[-5.0, 2.0], [-2.0, 1.0]], [[-1.0, 7.0], [7.0, 5.0]], [[1.0, 0.0], [-5.0, -6.0]], [[-3.0, -1.0], [-7.0, -7.0]]], [[[-7.0, 4.0], [-2.0, 5.0]], [[5.0, -1.0], [-2.0, 7.0]], [[5.0, -2.0], [0.0, 5.0]], [[7.0, -3.0], [0.0, 0.0]], [[1.0, 2.0], [4.0, 7.0]], [[3.0, 0.0], [5.0, 5.0]]], [[[-7.0, -6.0], [-7.0, 3.0]], [[1.0, -6.0], [4.0, -7.0]], [[1.0, -7.0], [-5.0, -1.0]], [[0.0, -1.0], [-3.0, -7.0]], [[5.0, 4.0], [-1.0, -5.0]], [[4.0, 6.0], [2.0, -7.0]]]])
30214          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30215          ref=numarray.array([[[[-7.0, 45.0], [41.0, -12.0]], [[0.0, 18.0], [-32.0, 63.0]], [[49.0, 20.0], [44.0, 19.0]], [[35.0, -55.0], [-31.0, 7.0]], [[-33.0, -16.0], [57.0, 100.0]], [[9.0, -29.0], [57.0, 111.0]]], [[[64.0, 28.0], [57.0, -40.0]], [[-26.0, 41.0], [-22.0, 26.0]], [[-12.0, 51.0], [39.0, -10.0]], [[-19.0, 2.0], [7.0, 39.0]], [[-40.0, -34.0], [5.0, 26.0]], [[-31.0, -40.0], [-15.0, 48.0]]]])
30216          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
30217          self.failUnlessEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")
30218          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30219       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30220       def test_generalTensorProduct_array_rank1_Symbol_rank0_offset0(self):
30221          arg0=numarray.array([-1.0, -3.0])
30222          arg1=Symbol(shape=())
30223          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30224          s1=numarray.array(6.0)
30225          sub=res.substitute({arg1:s1})
30226          ref=numarray.array([-6.0, -18.0])
30227          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30228          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30229          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30230       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30231       def test_generalTensorProduct_array_rank2_Symbol_rank1_offset1(self):
30232          arg0=numarray.array([[-4.0, 2.0, 2.0], [-4.0, -1.0, 4.0]])
30233          arg1=Symbol(shape=(3,))
30234          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30235          s1=numarray.array([3.0, -5.0, -3.0])
30236          sub=res.substitute({arg1:s1})
30237          ref=numarray.array([-28.0, -19.0])
30238          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30239          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30240          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30241       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30242       def test_generalTensorProduct_array_rank3_Symbol_rank2_offset2(self):
30243          arg0=numarray.array([[[-2.0, -2.0, -6.0], [7.0, 6.0, 2.0]], [[-5.0, -5.0, 1.0], [5.0, 1.0, -1.0]]])
30244          arg1=Symbol(shape=(2, 3))
30245          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30246          s1=numarray.array([[1.0, 6.0, -4.0], [-4.0, 1.0, -3.0]])
30247          sub=res.substitute({arg1:s1})
30248          ref=numarray.array([-18.0, -55.0])
30249          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30250          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30251          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30252       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30253       def test_generalTensorProduct_array_rank4_Symbol_rank3_offset3(self):
30254          arg0=numarray.array([[[[-1.0, -7.0, 2.0], [-2.0, 4.0, -7.0], [-7.0, -2.0, 3.0], [1.0, -7.0, -6.0]], [[-1.0, 6.0, -7.0], [-6.0, 5.0, -6.0], [-4.0, -6.0, 0.0], [2.0, -4.0, 5.0]]], [[[-7.0, 6.0, 4.0], [-1.0, 5.0, 0.0], [6.0, -6.0, 0.0], [2.0, 2.0, -7.0]], [[0.0, -2.0, -6.0], [0.0, 7.0, -5.0], [3.0, 5.0, -4.0], [0.0, -6.0, 0.0]]]])
30255          arg1=Symbol(shape=(2, 4, 3))
30256          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30257          s1=numarray.array([[[-4.0, 1.0, 0.0], [2.0, 3.0, 7.0], [-5.0, 0.0, -7.0], [3.0, 4.0, -6.0]], [[-5.0, 0.0, -1.0], [5.0, -3.0, 4.0], [-6.0, 5.0, 7.0], [4.0, -4.0, 1.0]]])
30258          sub=res.substitute({arg1:s1})
30259          ref=numarray.array([-53.0, 41.0])
30260          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30261          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30262          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30263       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30264       def test_generalTensorProduct_array_rank1_Symbol_rank1_offset0(self):
30265          arg0=numarray.array([-1.0, -6.0])
30266          arg1=Symbol(shape=(2,))
30267          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30268          s1=numarray.array([-4.0, 4.0])
30269          sub=res.substitute({arg1:s1})
30270          ref=numarray.array([[4.0, -4.0], [24.0, -24.0]])
30271          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30272          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30273          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30274       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30275       def test_generalTensorProduct_array_rank2_Symbol_rank2_offset1(self):
30276          arg0=numarray.array([[5.0, 4.0, -3.0], [2.0, -6.0, 6.0]])
30277          arg1=Symbol(shape=(3, 2))
30278          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30279          s1=numarray.array([[-1.0, 0.0], [-3.0, -5.0], [5.0, -6.0]])
30280          sub=res.substitute({arg1:s1})
30281          ref=numarray.array([[-32.0, -2.0], [46.0, -6.0]])
30282          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30283          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30284          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30285       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30286       def test_generalTensorProduct_array_rank3_Symbol_rank3_offset2(self):
30287          arg0=numarray.array([[[7.0, -5.0, -5.0], [-1.0, 0.0, 2.0]], [[-2.0, 1.0, 4.0], [7.0, 7.0, 0.0]]])
30288          arg1=Symbol(shape=(2, 3, 2))
30289          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30290          s1=numarray.array([[[6.0, -2.0], [5.0, 7.0], [5.0, -7.0]], [[4.0, -1.0], [5.0, 6.0], [0.0, -6.0]]])
30291          sub=res.substitute({arg1:s1})
30292          ref=numarray.array([[-12.0, -25.0], [76.0, 18.0]])
30293          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30294          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30295          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30296       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30297       def test_generalTensorProduct_array_rank4_Symbol_rank4_offset3(self):
30298          arg0=numarray.array([[[[2.0, 1.0, -3.0], [-7.0, 2.0, 6.0], [-4.0, -5.0, 6.0], [3.0, 0.0, -1.0]], [[7.0, -4.0, 6.0], [-1.0, -7.0, 6.0], [-6.0, -4.0, 1.0], [-1.0, -7.0, 0.0]]], [[[6.0, 4.0, -5.0], [-6.0, -3.0, 1.0], [3.0, -3.0, -7.0], [-6.0, 0.0, -2.0]], [[-6.0, 5.0, 5.0], [0.0, 4.0, 0.0], [3.0, -4.0, -2.0], [7.0, 3.0, 6.0]]]])
30299          arg1=Symbol(shape=(2, 4, 3, 2))
30300          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30301          s1=numarray.array([[[[-7.0, 4.0], [-5.0, -2.0], [0.0, -1.0]], [[-3.0, -5.0], [-6.0, -4.0], [-3.0, -5.0]], [[0.0, 7.0], [-1.0, -5.0], [0.0, 4.0]], [[-7.0, -7.0], [4.0, 4.0], [-5.0, 0.0]]], [[[4.0, -4.0], [-5.0, -4.0], [6.0, 3.0]], [[0.0, -5.0], [-5.0, -4.0], [3.0, -3.0]], [[1.0, -5.0], [-4.0, 7.0], [-3.0, 2.0]], [[-5.0, -1.0], [-5.0, -1.0], [6.0, -4.0]]]])
30302          sub=res.substitute({arg1:s1})
30303          ref=numarray.array([[145.0, 39.0], [-2.0, 30.0]])
30304          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30305          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30306          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30307       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30308       def test_generalTensorProduct_array_rank1_Symbol_rank2_offset0(self):
30309          arg0=numarray.array([4.0, 4.0])
30310          arg1=Symbol(shape=(4, 5))
30311          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30312          s1=numarray.array([[-4.0, 2.0, 6.0, 2.0, 4.0], [4.0, -2.0, 0.0, 6.0, 5.0], [4.0, -2.0, 3.0, 1.0, 6.0], [3.0, -4.0, 5.0, 6.0, -6.0]])
30313          sub=res.substitute({arg1:s1})
30314          ref=numarray.array([[[-16.0, 8.0, 24.0, 8.0, 16.0], [16.0, -8.0, 0.0, 24.0, 20.0], [16.0, -8.0, 12.0, 4.0, 24.0], [12.0, -16.0, 20.0, 24.0, -24.0]], [[-16.0, 8.0, 24.0, 8.0, 16.0], [16.0, -8.0, 0.0, 24.0, 20.0], [16.0, -8.0, 12.0, 4.0, 24.0], [12.0, -16.0, 20.0, 24.0, -24.0]]])
30315          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30316          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30317          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30318       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30319       def test_generalTensorProduct_array_rank2_Symbol_rank3_offset1(self):
30320          arg0=numarray.array([[3.0, 3.0, 6.0], [-6.0, 0.0, -2.0]])
30321          arg1=Symbol(shape=(3, 4, 5))
30322          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30323          s1=numarray.array([[[0.0, 6.0, -6.0, 0.0, -7.0], [-6.0, 4.0, -2.0, -4.0, 1.0], [-6.0, -5.0, -6.0, 6.0, -5.0], [0.0, -3.0, 6.0, -2.0, 6.0]], [[0.0, 4.0, 5.0, 5.0, -4.0], [-6.0, 5.0, -5.0, 3.0, -6.0], [-4.0, -7.0, -6.0, 5.0, 0.0], [-6.0, -6.0, 0.0, -1.0, 1.0]], [[0.0, 3.0, -2.0, 0.0, -5.0], [0.0, 3.0, 1.0, 0.0, 7.0], [-5.0, 5.0, -7.0, -5.0, -2.0], [-1.0, -3.0, -2.0, 6.0, -2.0]]])
30324          sub=res.substitute({arg1:s1})
30325          ref=numarray.array([[[0.0, 48.0, -15.0, 15.0, -63.0], [-36.0, 45.0, -15.0, -3.0, 27.0], [-60.0, -6.0, -78.0, 3.0, -27.0], [-24.0, -45.0, 6.0, 27.0, 9.0]], [[0.0, -42.0, 40.0, 0.0, 52.0], [36.0, -30.0, 10.0, 24.0, -20.0], [46.0, 20.0, 50.0, -26.0, 34.0], [2.0, 24.0, -32.0, 0.0, -32.0]]])
30326          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30327          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30328          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30329       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30330       def test_generalTensorProduct_array_rank3_Symbol_rank4_offset2(self):
30331          arg0=numarray.array([[[7.0, 1.0, 6.0], [-7.0, -6.0, 0.0]], [[0.0, -7.0, -4.0], [0.0, 5.0, -2.0]]])
30332          arg1=Symbol(shape=(2, 3, 4, 5))
30333          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30334          s1=numarray.array([[[[4.0, -3.0, -4.0, 7.0, 0.0], [-7.0, 2.0, 2.0, 5.0, -1.0], [2.0, 2.0, 2.0, -1.0, 3.0], [-3.0, -7.0, -4.0, -5.0, 2.0]], [[-5.0, -4.0, 7.0, -5.0, -6.0], [3.0, 5.0, -7.0, 4.0, 1.0], [5.0, 4.0, -6.0, -3.0, -4.0], [5.0, 6.0, -1.0, -2.0, 7.0]], [[0.0, -3.0, 0.0, -1.0, -4.0], [-7.0, -7.0, -4.0, 0.0, -7.0], [0.0, 2.0, -2.0, 5.0, 4.0], [-1.0, 6.0, 4.0, -7.0, 0.0]]], [[[0.0, 2.0, -6.0, 0.0, -4.0], [5.0, -7.0, -2.0, -5.0, -1.0], [0.0, 4.0, 0.0, 5.0, 2.0], [6.0, -7.0, -2.0, -1.0, -3.0]], [[0.0, -7.0, -6.0, 0.0, -4.0], [0.0, 5.0, 7.0, -1.0, 2.0], [1.0, 3.0, -7.0, 0.0, 3.0], [-2.0, 4.0, 4.0, -1.0, 0.0]], [[2.0, 2.0, -7.0, 6.0, -4.0], [-3.0, 6.0, -5.0, -2.0, 0.0], [-6.0, 5.0, -3.0, -3.0, 3.0], [0.0, 4.0, -1.0, 7.0, -6.0]]]])
30335          sub=res.substitute({arg1:s1})
30336          ref=numarray.array([[[23.0, -15.0, 57.0, 38.0, 22.0], [-123.0, -4.0, -45.0, 80.0, -53.0], [13.0, -16.0, 38.0, -15.0, 9.0], [-52.0, 18.0, -15.0, -66.0, 42.0]], [[31.0, 1.0, -65.0, 27.0, 46.0], [13.0, 6.0, 110.0, -29.0, 31.0], [-18.0, -31.0, 21.0, 7.0, 21.0], [-41.0, -54.0, 13.0, 23.0, -37.0]]])
30337          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30338          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30339          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30340       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30341       def test_generalTensorProduct_array_rank1_Symbol_rank3_offset0(self):
30342          arg0=numarray.array([-6.0, 0.0])
30343          arg1=Symbol(shape=(6, 2, 2))
30344          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30345          s1=numarray.array([[[1.0, 4.0], [-3.0, -5.0]], [[1.0, -1.0], [6.0, 2.0]], [[1.0, 0.0], [5.0, -3.0]], [[5.0, -6.0], [0.0, 5.0]], [[6.0, -7.0], [0.0, 7.0]], [[1.0, -2.0], [7.0, 4.0]]])
30346          sub=res.substitute({arg1:s1})
30347          ref=numarray.array([[[[-6.0, -24.0], [18.0, 30.0]], [[-6.0, 6.0], [-36.0, -12.0]], [[-6.0, 0.0], [-30.0, 18.0]], [[-30.0, 36.0], [0.0, -30.0]], [[-36.0, 42.0], [0.0, -42.0]], [[-6.0, 12.0], [-42.0, -24.0]]], [[[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]]])
30348          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30349          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
30350          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30351       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30352       def test_generalTensorProduct_array_rank2_Symbol_rank4_offset1(self):
30353          arg0=numarray.array([[6.0, 5.0, 1.0], [5.0, 2.0, -4.0]])
30354          arg1=Symbol(shape=(3, 6, 2, 2))
30355          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30356          s1=numarray.array([[[[6.0, -5.0], [-3.0, -1.0]], [[-2.0, -4.0], [-1.0, 0.0]], [[0.0, -4.0], [5.0, -7.0]], [[-5.0, -1.0], [0.0, 0.0]], [[4.0, -5.0], [2.0, 3.0]], [[-2.0, 6.0], [1.0, -1.0]]], [[[-5.0, -6.0], [-1.0, -2.0]], [[7.0, 6.0], [-1.0, 5.0]], [[-1.0, -6.0], [4.0, 3.0]], [[-2.0, 2.0], [5.0, -1.0]], [[-5.0, -1.0], [6.0, -1.0]], [[-4.0, 4.0], [5.0, 3.0]]], [[[-3.0, 1.0], [-6.0, -5.0]], [[-2.0, -2.0], [1.0, -3.0]], [[4.0, -2.0], [-7.0, -7.0]], [[5.0, 2.0], [-1.0, 6.0]], [[-4.0, 0.0], [-4.0, 6.0]], [[-5.0, 2.0], [6.0, 3.0]]]])
30357          sub=res.substitute({arg1:s1})
30358          ref=numarray.array([[[[8.0, -59.0], [-29.0, -21.0]], [[21.0, 4.0], [-10.0, 22.0]], [[-1.0, -56.0], [43.0, -34.0]], [[-35.0, 6.0], [24.0, 1.0]], [[-5.0, -35.0], [38.0, 19.0]], [[-37.0, 58.0], [37.0, 12.0]]], [[[32.0, -41.0], [7.0, 11.0]], [[12.0, 0.0], [-11.0, 22.0]], [[-18.0, -24.0], [61.0, -1.0]], [[-49.0, -9.0], [14.0, -26.0]], [[26.0, -27.0], [38.0, -11.0]], [[2.0, 30.0], [-9.0, -11.0]]]])
30359          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
30360          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
30361          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30362       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30363       def test_generalTensorProduct_array_rank1_constData_rank0_offset0(self):
30364          arg0=numarray.array([0.0, -5.0])
30365          arg1=Data(-7.0,self.functionspace)
30366          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30367          ref=Data(numarray.array([-0.0, 35.0]),self.functionspace)
30368          self.failUnless(isinstance(res,Data),"wrong type of result.")
30369          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30370          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30371       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30372       def test_generalTensorProduct_array_rank2_constData_rank1_offset1(self):
30373          arg0=numarray.array([[-4.0, 0.0, 7.0], [-1.0, -7.0, -4.0]])
30374          arg1=Data(numarray.array([-5.0, -6.0, -3.0]),self.functionspace)
30375          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30376          ref=Data(numarray.array([-1.0, 59.0]),self.functionspace)
30377          self.failUnless(isinstance(res,Data),"wrong type of result.")
30378          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30379          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30380       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30381       def test_generalTensorProduct_array_rank3_constData_rank2_offset2(self):
30382          arg0=numarray.array([[[-1.0, -6.0, 7.0], [-2.0, -7.0, 4.0]], [[-4.0, 1.0, -7.0], [-2.0, -4.0, 7.0]]])
30383          arg1=Data(numarray.array([[0.0, -5.0, -2.0], [-1.0, 7.0, 0.0]]),self.functionspace)
30384          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30385          ref=Data(numarray.array([-31.0, -17.0]),self.functionspace)
30386          self.failUnless(isinstance(res,Data),"wrong type of result.")
30387          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30388          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30389       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30390       def test_generalTensorProduct_array_rank4_constData_rank3_offset3(self):
30391          arg0=numarray.array([[[[-3.0, 3.0, 5.0], [-4.0, -2.0, 7.0], [-1.0, -1.0, -1.0], [-6.0, -3.0, 6.0]], [[-7.0, -7.0, 1.0], [-5.0, -1.0, -5.0], [4.0, 2.0, 0.0], [-7.0, 1.0, 1.0]]], [[[7.0, -7.0, 3.0], [1.0, -7.0, 0.0], [-4.0, -7.0, 4.0], [-6.0, 0.0, 1.0]], [[-3.0, -3.0, 5.0], [-1.0, 1.0, 2.0], [5.0, 0.0, -6.0], [-3.0, 5.0, -5.0]]]])
30392          arg1=Data(numarray.array([[[-2.0, -5.0, 0.0], [2.0, 7.0, -4.0], [-2.0, -3.0, 5.0], [-2.0, -3.0, -3.0]], [[3.0, 0.0, 2.0], [-5.0, 0.0, 3.0], [5.0, -6.0, -7.0], [3.0, 6.0, 0.0]]]),self.functionspace)
30393          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30394          ref=Data(numarray.array([-72.0, 132.0]),self.functionspace)
30395          self.failUnless(isinstance(res,Data),"wrong type of result.")
30396          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30397          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30398       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30399       def test_generalTensorProduct_array_rank1_constData_rank1_offset0(self):
30400          arg0=numarray.array([-7.0, 0.0])
30401          arg1=Data(numarray.array([-3.0, 4.0]),self.functionspace)
30402          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30403          ref=Data(numarray.array([[21.0, -28.0], [0.0, 0.0]]),self.functionspace)
30404          self.failUnless(isinstance(res,Data),"wrong type of result.")
30405          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30406          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30407       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30408       def test_generalTensorProduct_array_rank2_constData_rank2_offset1(self):
30409          arg0=numarray.array([[1.0, -2.0, -6.0], [3.0, -1.0, 2.0]])
30410          arg1=Data(numarray.array([[1.0, 3.0], [4.0, -1.0], [-1.0, 2.0]]),self.functionspace)
30411          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30412          ref=Data(numarray.array([[-1.0, -7.0], [-3.0, 14.0]]),self.functionspace)
30413          self.failUnless(isinstance(res,Data),"wrong type of result.")
30414          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30415          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30416       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30417       def test_generalTensorProduct_array_rank3_constData_rank3_offset2(self):
30418          arg0=numarray.array([[[-1.0, -6.0, 0.0], [-2.0, 0.0, 7.0]], [[-5.0, 5.0, 3.0], [-1.0, -4.0, -3.0]]])
30419          arg1=Data(numarray.array([[[1.0, 0.0], [-3.0, -4.0], [-2.0, -5.0]], [[6.0, 0.0], [3.0, -1.0], [3.0, -6.0]]]),self.functionspace)
30420          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30421          ref=Data(numarray.array([[26.0, -18.0], [-53.0, -13.0]]),self.functionspace)
30422          self.failUnless(isinstance(res,Data),"wrong type of result.")
30423          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30424          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30425       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30426       def test_generalTensorProduct_array_rank4_constData_rank4_offset3(self):
30427          arg0=numarray.array([[[[-5.0, -5.0, 6.0], [-7.0, -7.0, 5.0], [1.0, 6.0, -7.0], [0.0, 1.0, -4.0]], [[-6.0, -7.0, 3.0], [2.0, -3.0, -7.0], [-3.0, -2.0, -4.0], [4.0, -4.0, -4.0]]], [[[-3.0, 0.0, 6.0], [-2.0, 0.0, 7.0], [-4.0, -6.0, -3.0], [1.0, -5.0, -6.0]], [[5.0, 7.0, -5.0], [3.0, -2.0, 6.0], [-7.0, -1.0, -7.0], [-4.0, 6.0, 5.0]]]])
30428          arg1=Data(numarray.array([[[[7.0, -7.0], [5.0, 4.0], [4.0, -4.0]], [[4.0, 0.0], [6.0, -7.0], [-5.0, 6.0]], [[-4.0, -6.0], [-3.0, -5.0], [0.0, 1.0]], [[1.0, -5.0], [-7.0, -4.0], [0.0, -5.0]]], [[[4.0, 1.0], [-2.0, -4.0], [-7.0, 7.0]], [[1.0, 4.0], [-4.0, 0.0], [3.0, 2.0]], [[2.0, 4.0], [1.0, 5.0], [4.0, -2.0]], [[7.0, 3.0], [-3.0, 5.0], [-4.0, 2.0]]]]),self.functionspace)
30429          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30430          ref=Data(numarray.array([[-166.0, 50.0], [-9.0, 110.0]]),self.functionspace)
30431          self.failUnless(isinstance(res,Data),"wrong type of result.")
30432          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30433          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30434       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30435       def test_generalTensorProduct_array_rank1_constData_rank2_offset0(self):
30436          arg0=numarray.array([-4.0, -3.0])
30437          arg1=Data(numarray.array([[5.0, -4.0, 2.0, 7.0, 4.0], [3.0, -1.0, 7.0, -6.0, 2.0], [6.0, 0.0, 6.0, -4.0, 6.0], [-6.0, -5.0, -6.0, 3.0, -4.0]]),self.functionspace)
30438          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30439          ref=Data(numarray.array([[[-20.0, 16.0, -8.0, -28.0, -16.0], [-12.0, 4.0, -28.0, 24.0, -8.0], [-24.0, 0.0, -24.0, 16.0, -24.0], [24.0, 20.0, 24.0, -12.0, 16.0]], [[-15.0, 12.0, -6.0, -21.0, -12.0], [-9.0, 3.0, -21.0, 18.0, -6.0], [-18.0, 0.0, -18.0, 12.0, -18.0], [18.0, 15.0, 18.0, -9.0, 12.0]]]),self.functionspace)
30440          self.failUnless(isinstance(res,Data),"wrong type of result.")
30441          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30442          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30443       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30444       def test_generalTensorProduct_array_rank2_constData_rank3_offset1(self):
30445          arg0=numarray.array([[0.0, 6.0, 4.0], [-5.0, -3.0, -4.0]])
30446          arg1=Data(numarray.array([[[0.0, 7.0, -6.0, 2.0, -7.0], [6.0, -4.0, -2.0, -2.0, 6.0], [-7.0, -5.0, -6.0, 7.0, -5.0], [-1.0, 0.0, 3.0, -2.0, -7.0]], [[-7.0, -1.0, -4.0, 3.0, 0.0], [6.0, -6.0, 2.0, 4.0, 5.0], [0.0, -3.0, -6.0, 1.0, -1.0], [-7.0, -3.0, 0.0, 5.0, -5.0]], [[-6.0, -7.0, -3.0, 4.0, 1.0], [0.0, 3.0, -1.0, 3.0, 0.0], [-7.0, 6.0, -5.0, -4.0, -7.0], [6.0, 3.0, 3.0, 7.0, 5.0]]]),self.functionspace)
30447          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30448          ref=Data(numarray.array([[[-66.0, -34.0, -36.0, 34.0, 4.0], [36.0, -24.0, 8.0, 36.0, 30.0], [-28.0, 6.0, -56.0, -10.0, -34.0], [-18.0, -6.0, 12.0, 58.0, -10.0]], [[45.0, -4.0, 54.0, -35.0, 31.0], [-48.0, 26.0, 8.0, -14.0, -45.0], [63.0, 10.0, 68.0, -22.0, 56.0], [2.0, -3.0, -27.0, -33.0, 30.0]]]),self.functionspace)
30449          self.failUnless(isinstance(res,Data),"wrong type of result.")
30450          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30451          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30452       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30453       def test_generalTensorProduct_array_rank3_constData_rank4_offset2(self):
30454          arg0=numarray.array([[[2.0, 4.0, 4.0], [7.0, -3.0, 1.0]], [[4.0, 3.0, -4.0], [-3.0, -5.0, 0.0]]])
30455          arg1=Data(numarray.array([[[[-5.0, -4.0, 0.0, 2.0, 2.0], [-2.0, 0.0, 0.0, 7.0, 5.0], [-4.0, -1.0, 1.0, 4.0, -2.0], [0.0, 6.0, -4.0, 7.0, 0.0]], [[0.0, 5.0, 1.0, 0.0, 1.0], [3.0, 3.0, -6.0, 2.0, -4.0], [-6.0, 3.0, 2.0, -4.0, 1.0], [-7.0, -1.0, 5.0, 3.0, -3.0]], [[1.0, 4.0, 2.0, 7.0, 3.0], [5.0, -3.0, 3.0, 3.0, -7.0], [-3.0, 2.0, 7.0, -4.0, -6.0], [5.0, -7.0, 4.0, 3.0, 2.0]]], [[[2.0, 1.0, 0.0, -6.0, 0.0], [-7.0, 1.0, -4.0, 3.0, -6.0], [-1.0, 4.0, 2.0, 3.0, -1.0], [0.0, -2.0, 0.0, 6.0, 3.0]], [[0.0, -3.0, 5.0, -7.0, -2.0], [-1.0, 7.0, -2.0, -1.0, 1.0], [2.0, -7.0, 3.0, 7.0, 3.0], [-2.0, 5.0, 0.0, -4.0, 3.0]], [[7.0, -1.0, -2.0, 4.0, 6.0], [2.0, 1.0, 2.0, 0.0, 6.0], [2.0, 6.0, -1.0, -2.0, -2.0], [3.0, -4.0, 5.0, 5.0, -7.0]]]]),self.functionspace)
30456          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30457          ref=Data(numarray.array([[[15.0, 43.0, -5.0, 15.0, 32.0], [-16.0, -13.0, -32.0, 58.0, -73.0], [-55.0, 73.0, 42.0, -26.0, -42.0], [1.0, -53.0, 33.0, 97.0, 1.0]], [[-30.0, -5.0, -30.0, 33.0, 9.0], [7.0, -17.0, -8.0, 18.0, 49.0], [-29.0, 20.0, -39.0, -24.0, 7.0], [-31.0, 30.0, -17.0, 27.0, -41.0]]]),self.functionspace)
30458          self.failUnless(isinstance(res,Data),"wrong type of result.")
30459          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30460          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30461       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30462       def test_generalTensorProduct_array_rank1_constData_rank3_offset0(self):
30463          arg0=numarray.array([-4.0, -3.0])
30464          arg1=Data(numarray.array([[[3.0, 0.0], [7.0, -4.0]], [[-4.0, 3.0], [-4.0, -3.0]], [[4.0, -1.0], [1.0, 2.0]], [[4.0, 5.0], [-7.0, 1.0]], [[-5.0, 4.0], [4.0, 2.0]], [[0.0, -4.0], [-4.0, 2.0]]]),self.functionspace)
30465          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30466          ref=Data(numarray.array([[[[-12.0, 0.0], [-28.0, 16.0]], [[16.0, -12.0], [16.0, 12.0]], [[-16.0, 4.0], [-4.0, -8.0]], [[-16.0, -20.0], [28.0, -4.0]], [[20.0, -16.0], [-16.0, -8.0]], [[0.0, 16.0], [16.0, -8.0]]], [[[-9.0, 0.0], [-21.0, 12.0]], [[12.0, -9.0], [12.0, 9.0]], [[-12.0, 3.0], [-3.0, -6.0]], [[-12.0, -15.0], [21.0, -3.0]], [[15.0, -12.0], [-12.0, -6.0]], [[0.0, 12.0], [12.0, -6.0]]]]),self.functionspace)
30467          self.failUnless(isinstance(res,Data),"wrong type of result.")
30468          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
30469          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30470       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30471       def test_generalTensorProduct_array_rank2_constData_rank4_offset1(self):
30472          arg0=numarray.array([[1.0, -4.0, 7.0], [-3.0, 5.0, 1.0]])
30473          arg1=Data(numarray.array([[[[-1.0, 4.0], [0.0, -6.0]], [[4.0, 2.0], [7.0, -2.0]], [[-5.0, 3.0], [5.0, 2.0]], [[0.0, 1.0], [0.0, 3.0]], [[-3.0, 5.0], [-4.0, 2.0]], [[7.0, -6.0], [4.0, -3.0]]], [[[-3.0, 2.0], [1.0, -3.0]], [[2.0, -4.0], [5.0, -1.0]], [[5.0, -7.0], [-3.0, 4.0]], [[-5.0, -5.0], [3.0, -5.0]], [[0.0, -6.0], [0.0, -1.0]], [[3.0, -2.0], [2.0, 5.0]]], [[[-1.0, 1.0], [-5.0, -5.0]], [[-5.0, -6.0], [4.0, -4.0]], [[-2.0, 0.0], [3.0, -7.0]], [[1.0, 6.0], [1.0, 4.0]], [[2.0, 3.0], [2.0, 3.0]], [[-1.0, 0.0], [4.0, -2.0]]]]),self.functionspace)
30474          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30475          ref=Data(numarray.array([[[[4.0, 3.0], [-39.0, -29.0]], [[-39.0, -24.0], [15.0, -26.0]], [[-39.0, 31.0], [38.0, -63.0]], [[27.0, 63.0], [-5.0, 51.0]], [[11.0, 50.0], [10.0, 27.0]], [[-12.0, 2.0], [24.0, -37.0]]], [[[-13.0, -1.0], [0.0, -2.0]], [[-7.0, -32.0], [8.0, -3.0]], [[38.0, -44.0], [-27.0, 7.0]], [[-24.0, -22.0], [16.0, -30.0]], [[11.0, -42.0], [14.0, -8.0]], [[-7.0, 8.0], [2.0, 32.0]]]]),self.functionspace)
30476          self.failUnless(isinstance(res,Data),"wrong type of result.")
30477          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
30478          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30479       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30480       def test_generalTensorProduct_array_rank1_expandedData_rank0_offset0(self):
30481          arg0=numarray.array([-4.0, -2.0])
30482          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30483          arg1=msk_arg1*(-7.0)+(1-msk_arg1)*(4.0)
30484          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30485          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30486          ref=msk_ref*numarray.array([28.0, 14.0])+(1.-msk_ref)*numarray.array([-16.0, -8.0])
30487          self.failUnless(isinstance(res,Data),"wrong type of result.")
30488          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30489          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30490       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30491       def test_generalTensorProduct_array_rank2_expandedData_rank1_offset1(self):
30492          arg0=numarray.array([[4.0, -1.0, -3.0], [-5.0, 6.0, 7.0]])
30493          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30494          arg1=msk_arg1*numarray.array([5.0, -3.0, -1.0])+(1.-msk_arg1)*numarray.array([-5.0, -3.0, 1.0])
30495          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30496          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30497          ref=msk_ref*numarray.array([26.0, -50.0])+(1.-msk_ref)*numarray.array([-20.0, 14.0])
30498          self.failUnless(isinstance(res,Data),"wrong type of result.")
30499          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30500          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30501       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30502       def test_generalTensorProduct_array_rank3_expandedData_rank2_offset2(self):
30503          arg0=numarray.array([[[1.0, 1.0, 7.0], [-4.0, -3.0, -3.0]], [[-4.0, -1.0, 0.0], [4.0, -4.0, -4.0]]])
30504          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30505          arg1=msk_arg1*numarray.array([[-7.0, -2.0, -1.0], [-7.0, 6.0, -4.0]])+(1.-msk_arg1)*numarray.array([[0.0, 7.0, -6.0], [3.0, -6.0, 1.0]])
30506          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30507          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30508          ref=msk_ref*numarray.array([6.0, -6.0])+(1.-msk_ref)*numarray.array([-32.0, 25.0])
30509          self.failUnless(isinstance(res,Data),"wrong type of result.")
30510          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30511          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30512       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30513       def test_generalTensorProduct_array_rank4_expandedData_rank3_offset3(self):
30514          arg0=numarray.array([[[[0.0, 6.0, -1.0], [3.0, 3.0, -1.0], [-5.0, -4.0, -7.0], [-2.0, -6.0, 3.0]], [[1.0, 7.0, 3.0], [0.0, 5.0, 5.0], [-2.0, 7.0, 2.0], [5.0, 6.0, 1.0]]], [[[-2.0, 0.0, -1.0], [0.0, 7.0, -5.0], [-5.0, 1.0, -6.0], [4.0, -2.0, 1.0]], [[-3.0, -1.0, 1.0], [-4.0, 4.0, -1.0], [-5.0, 7.0, -5.0], [3.0, 0.0, -1.0]]]])
30515          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30516          arg1=msk_arg1*numarray.array([[[-5.0, 7.0, -2.0], [-5.0, -6.0, 2.0], [3.0, -6.0, -1.0], [3.0, 0.0, 0.0]], [[4.0, -7.0, 0.0], [-4.0, 5.0, -4.0], [4.0, -4.0, -5.0], [0.0, 4.0, 2.0]]])+(1.-msk_arg1)*numarray.array([[[-6.0, 2.0, 5.0], [-6.0, -2.0, 6.0], [0.0, -6.0, -2.0], [-4.0, 6.0, -3.0]], [[0.0, -2.0, 4.0], [5.0, 4.0, 6.0], [-2.0, 6.0, 7.0], [-5.0, -7.0, -3.0]]])
30517          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30518          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30519          ref=msk_ref*numarray.array([-41.0, -33.0])+(1.-msk_ref)*numarray.array([16.0, -61.0])
30520          self.failUnless(isinstance(res,Data),"wrong type of result.")
30521          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
30522          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30523       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30524       def test_generalTensorProduct_array_rank1_expandedData_rank1_offset0(self):
30525          arg0=numarray.array([-3.0, 3.0])
30526          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30527          arg1=msk_arg1*numarray.array([-1.0, -3.0])+(1.-msk_arg1)*numarray.array([-6.0, 4.0])
30528          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30529          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30530          ref=msk_ref*numarray.array([[3.0, 9.0], [-3.0, -9.0]])+(1.-msk_ref)*numarray.array([[18.0, -12.0], [-18.0, 12.0]])
30531          self.failUnless(isinstance(res,Data),"wrong type of result.")
30532          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30533          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30534       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30535       def test_generalTensorProduct_array_rank2_expandedData_rank2_offset1(self):
30536          arg0=numarray.array([[-7.0, 0.0, 1.0], [3.0, 0.0, -4.0]])
30537          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30538          arg1=msk_arg1*numarray.array([[0.0, 3.0], [5.0, -5.0], [0.0, -2.0]])+(1.-msk_arg1)*numarray.array([[0.0, 1.0], [3.0, -2.0], [-3.0, 6.0]])
30539          res=generalTensorProduct(arg0,arg1,axis_offset=1)
30540          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30541          ref=msk_ref*numarray.array([[0.0, -23.0], [0.0, 17.0]])+(1.-msk_ref)*numarray.array([[-3.0, -1.0], [12.0, -21.0]])
30542          self.failUnless(isinstance(res,Data),"wrong type of result.")
30543          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30544          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30545       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30546       def test_generalTensorProduct_array_rank3_expandedData_rank3_offset2(self):
30547          arg0=numarray.array([[[-7.0, 0.0, 2.0], [6.0, 4.0, 7.0]], [[3.0, 0.0, 2.0], [4.0, -7.0, -3.0]]])
30548          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30549          arg1=msk_arg1*numarray.array([[[-1.0, -7.0], [7.0, -7.0], [6.0, -1.0]], [[2.0, 7.0], [0.0, 1.0], [-4.0, -5.0]]])+(1.-msk_arg1)*numarray.array([[[-5.0, 0.0], [-2.0, 5.0], [1.0, -2.0]], [[4.0, 4.0], [2.0, -4.0], [-1.0, -7.0]]])
30550          res=generalTensorProduct(arg0,arg1,axis_offset=2)
30551          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30552          ref=msk_ref*numarray.array([[3.0, 58.0], [29.0, 13.0]])+(1.-msk_ref)*numarray.array([[62.0, -45.0], [-8.0, 61.0]])
30553          self.failUnless(isinstance(res,Data),"wrong type of result.")
30554          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30555          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30556       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30557       def test_generalTensorProduct_array_rank4_expandedData_rank4_offset3(self):
30558          arg0=numarray.array([[[[6.0, 0.0, 6.0], [0.0, 0.0, -2.0], [-4.0, -6.0, -7.0], [6.0, 7.0, 5.0]], [[3.0, 1.0, -1.0], [0.0, 5.0, 6.0], [7.0, 1.0, -6.0], [-5.0, -4.0, 2.0]]], [[[-1.0, 7.0, 7.0], [-4.0, -5.0, 6.0], [-4.0, 4.0, 3.0], [6.0, 6.0, -1.0]], [[-1.0, 2.0, -7.0], [7.0, -6.0, 0.0], [-5.0, -6.0, -3.0], [-2.0, 4.0, 6.0]]]])
30559          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30560          arg1=msk_arg1*numarray.array([[[[6.0, -3.0], [-7.0, -6.0], [-2.0, -6.0]], [[5.0, -6.0], [-6.0, 2.0], [-5.0, -2.0]], [[-6.0, -4.0], [0.0, -2.0], [0.0, -2.0]], [[-2.0, -7.0], [-7.0, -1.0], [-4.0, 1.0]]], [[[-7.0, -7.0], [-6.0, 0.0], [6.0, 1.0]], [[1.0, -2.0], [-1.0, 0.0], [0.0, -5.0]], [[0.0, -1.0], [0.0, -2.0], [5.0, 4.0]], [[1.0, -1.0], [-7.0, 0.0], [5.0, -7.0]]]])+(1.-msk_arg1)*numarray.array([[[[3.0, 0.0], [1.0, 4.0], [3.0, 5.0]], [[4.0, -3.0], [-2.0, -3.0], [6.0, -7.0]], [[-6.0, -7.0], [0.0, -6.0], [-6.0, 3.0]], [[2.0, -6.0], [7.0, -4.0], [-6.0, -7.0]]], [[[2.0, -1.0], [5.0, -6.0], [2.0, -2.0]], [[-1.0, -1.0], [7.0, -6.0], [4.0, 6.0]], [[-4.0, 7.0], [-1.0, 0.0], [5.0, 3.0]], [[1.0, 3.0], [6.0, 6.0], [-3.0, 1.0]]]])
30561          res=generalTensorProduct(arg0,arg1,axis_offset=3)
30562          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30563          ref=msk_ref*numarray.array([[-58.0, -146.0], [-164.0, -175.0]])+(1.-msk_ref)*numarray.array([[95.0, -19.0], [81.0, 20.0]])
30564          self.failUnless(isinstance(res,Data),"wrong type of result.")
30565          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
30566          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30567       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30568       def test_generalTensorProduct_array_rank1_expandedData_rank2_offset0(self):
30569          arg0=numarray.array([5.0, -5.0])
30570          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30571          arg1=msk_arg1*numarray.array([[3.0, 2.0, -5.0, 2.0, -6.0], [-4.0, 4.0, 3.0, -7.0, 3.0], [5.0, 3.0, 7.0, 5.0, 1.0], [1.0, 4.0, 3.0, -2.0, 4.0]])+(1.-msk_arg1)*numarray.array([[-6.0, 0.0, 1.0, 1.0, 2.0], [-5.0, 5.0, -6.0, -2.0, -6.0], [-5.0, 5.0, -7.0, 7.0, 3.0], [3.0, -7.0, 5.0, -3.0, -4.0]])
30572          res=generalTensorProduct(arg0,arg1,axis_offset=0)
30573          msk_ref=1-whereZero(self.functionspace.getX()[0],1.e-8)
30574          ref=msk_ref*numarray.array([[[15.0, 10.0, -25.0, 10.0, -30.0], [-20.0, 20.0, 15.0, -35.0, 15.0], [25.0, 15.0, 35.0, 25.0, 5.0], [5.0, 20.0, 15.0, -10.0, 20.0]], [[-15.0, -10.0, 25.0, -10.0, 30.0], [20.0, -20.0, -15.0, 35.0, -15.0], [-25.0, -15.0, -35.0, -25.0, -5.0], [-5.0, -20.0, -15.0, 10.0, -20.0]]])+(1.-msk_ref)*numarray.array([[[-30.0, 0.0, 5.0, 5.0, 10.0], [-25.0, 25.0, -30.0, -10.0, -30.0], [-25.0, 25.0, -35.0, 35.0, 15.0], [15.0, -35.0, 25.0, -15.0, -20.0]], [[30.0, 0.0, -5.0, -5.0, -10.0], [25.0, -25.0, 30.0, 10.0, 30.0], [25.0, -25.0, 35.0, -35.0, -15.0], [-15.0, 35.0, -25.0, 15.0, 20.0]]])
30575          self.failUnless(isinstance(res,Data),"wrong type of result.")
30576          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
30577          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
30578       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30579       def test_generalTensorProduct_array_rank2_expandedData_rank3_offset1(self):
30580          arg0=numarray.array([[3.0, 2.0, -4.0], [1.0, -2.0, 0.0]])
30581          msk_arg1=1-whereZero(self.functionspace.getX()[0],1.e-8)
30582          arg1=msk_arg1*numarray.array([[[-6.0, 0.0, 0.0, -3.0, -1.0], [6.0, 5.0, -7.0, 4.0, 3.0], [2.0, 0.0, -1.0, 5.0, 1.0], [-5.0, -7.0, -4.0, -3.0, 1.0]], [[-5.0, 4.0, 7.0, 5.0, -2.0], [0.0, -4.0, 7.0, -1.0, -4.0], [-4.0, -1.0, 7.0, 4.0, 0.0], [0.0, 3.0, -1.0, -5.0, -7.0]], [[-6.0, 6.0, 0.0, -5.0, -3.0], [0.0, 2.0, 6.0, -5.0, 4.0], [-2.0, 7.0, 1.0, 5.0,