/[escript]/branches/symbolic_from_3470/escript/test/python/test_util_overloaded_binary_no_tagged_data.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/test/python/test_util_overloaded_binary_no_tagged_data.py

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

revision 3492 by caltinay, Tue Mar 15 04:23:54 2011 UTC revision 3493 by caltinay, Mon Apr 4 04:37:02 2011 UTC
# Line 962  class Test_util_overloaded_binary_no_tag Line 962  class Test_util_overloaded_binary_no_tag
962        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
963        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
964     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_add_overloaded_Symbol_rank0_float_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=1.27222150092  
       res=arg0+arg1  
       s0=numpy.array(2.31487984925)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(3.58710135016)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_array_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array(-4.16542047506)  
       res=arg0+arg1  
       s0=numpy.array(2.51125698981)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(-1.65416348525)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_array_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([1.7967590625305663, 3.0989753040732335])  
       res=arg0+arg1  
       s0=numpy.array(0.431420498011)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([2.2281795605415713, 3.5303958020842385])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_array_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[2.0598881185204609, -3.0703279066301792, 1.093653431782835, 2.6755047560492864, -3.9315934442978726], [3.6716432744741549, 4.6889274577758844, 3.9323933408499805, 2.3938287986765703, -0.58084130911170373], [-2.9789615787066746, -3.5991309289412876, 3.7095369472536213, -1.7677840602276995, 0.91042165733056901], [-1.6398419931526642, -3.500009815993963, 2.1048968450557375, 4.3162274607145665, 2.5422921044609588]])  
       res=arg0+arg1  
       s0=numpy.array(-1.38413150887)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[0.67575660965486728, -4.4544594154957728, -0.29047807708275863, 1.2913732471836927, -5.3157249531634658], [2.2875117656085613, 3.3047959489102907, 2.5482618319843868, 1.0096972898109766, -1.9649728179772974], [-4.3630930875722687, -4.9832624378068813, 2.3254054383880276, -3.1519155690932932, -0.47370985153502465], [-3.0239735020182579, -4.8841413248595567, 0.72076533619014382, 2.9320959518489729, 1.1581605955953651]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_array_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[-1.0101025318221888, -0.43846274488001491], [1.4788434472973808, 4.1878884378536476]], [[0.16838365070085093, 3.0987710425877388], [2.9001791584755088, -0.19382346834329667]], [[4.1333863046262458, 1.13408523814301], [-3.7137005620805699, 3.5370277850878757]], [[3.5844673775586973, 4.4202617638718689], [-1.356432905790439, 4.2637895327983362]], [[3.6206944961955347, -4.5208632049060888], [-4.1984942947815949, -2.3308331434570717]], [[-2.3313181282076778, -4.4956335463327868], [-4.5890502547926548, 3.8073203455267119]]])  
       res=arg0+arg1  
       s0=numpy.array(4.2201896994)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[3.2100871675799665, 3.7817269545221404], [5.6990331466995361, 8.4080781372558029]], [[4.3885733501030062, 7.3189607419898941], [7.120368857877664, 4.0263662310588586]], [[8.3535760040284011, 5.3542749375451653], [0.5064891373215854, 7.757217484490031]], [[7.8046570769608525, 8.6404514632740241], [2.8637567936117163, 8.4839792322004914]], [[7.84088419559769, -0.30067350550393357], [0.02169540462056041, 1.8893565559450836]], [[1.8888715711944775, -0.27544384693063151], [-0.36886055539049956, 8.0275100449288672]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_array_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[[2.254858407675008, 2.9556634871468956, -4.2194906435881965, 0.33617678464860568], [-1.3705029403262783, -1.1047128172805873, 4.0113533012786657, -3.5332286577196315], [3.2822499245131791, -2.4201445901673457, 2.4893572215494366, 3.4468822679483431]], [[4.7517461792067479, -1.659809211094271, -2.430217315564688, 3.7424592226253086], [4.061746721479075, 4.6769829212789773, -1.3802605998193238, 0.26573281957776018], [-1.2631501207535321, 0.16630007062643148, 2.7335859022843199, -4.6493493873577911]]], [[[-3.8025792766392663, -2.5970407357571421, -1.6418116501848736, 2.9471031718095553], [0.35972161926070179, -4.2280634041751073, -2.9875161847903877, 0.67212749180654541], [3.9782484909076725, 4.3391842549212285, -2.8072608608862248, 3.4762234184882317]], [[0.8387482624459528, 2.8125137876761839, 1.3346149587986336, 4.7280853433503278], [-0.56929857271486206, 0.1658323974841478, 4.2486135312044198, 4.7149733370593001], [3.9796656505240211, 3.4007855761547496, -0.45648986302473027, 4.0724405389793752]]], [[[-3.7534362723396497, -1.5215394798036677, -1.4113668835170543, -2.5672658286591945], [3.5868222007245993, -1.0439306946120075, -1.0688500260611091, 2.4615003259579886], [4.4498876772586744, 0.42045775564078447, 1.1616727447616899, 1.760047390785676]], [[1.8452825353755671, 1.3105616250365939, 4.9902836696931185, -4.8482082001327793], [-4.7626765006020788, 4.0555523570990974, -3.927941515671125, -2.1247966272861527], [0.81132139430017602, -4.9463489487191836, 2.0518544107587964, 3.0404236983093433]]]])  
       res=arg0+arg1  
       s0=numpy.array(4.95293818298)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[7.2077965906518697, 7.9086016701237574, 0.73344753938866525, 5.2891149676254674], [3.5824352426505834, 3.8482253656962744, 8.9642914842555275, 1.4197095252572303], [8.2351881074900408, 2.532793592809516, 7.4422954045262983, 8.3998204509252048]], [[9.7046843621836096, 3.2931289718825907, 2.5227208674121737, 8.6953974056021703], [9.0146849044559367, 9.629921104255839, 3.5726775831575379, 5.2186710025546219], [3.6897880622233297, 5.1192382536032932, 7.6865240852611816, 0.30358879561907059]]], [[[1.1503589063375954, 2.3558974472197196, 3.3111265327919881, 7.900041354786417], [5.3126598022375635, 0.72487477880175444, 1.965421998186474, 5.6250656747834071], [8.9311866738845342, 9.2921224378980902, 2.1456773220906369, 8.4291616014650934]], [[5.7916864454228145, 7.7654519706530456, 6.2875531417754953, 9.6810235263271895], [4.3836396102619997, 5.1187705804610095, 9.2015517141812815, 9.6679115200361618], [8.9326038335008828, 8.3537237591316114, 4.4964483199521315, 9.0253787219562369]]], [[[1.199501910637212, 3.4313987031731941, 3.5415712994598074, 2.3856723543176672], [8.5397603837014611, 3.9090074883648542, 3.8840881569157526, 7.4144385089348503], [9.4028258602355361, 5.3733959386176462, 6.1146109277385516, 6.7129855737625377]], [[6.7982207183524288, 6.2634998080134556, 9.9432218526699803, 0.10472998284408241], [0.19026168237478291, 9.0084905400759592, 1.0249966673057367, 2.828141555690709], [5.7642595772770377, 0.0065892342576781004, 7.0047925937356581, 7.9933618812862051]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_constData_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Data(3.27037618474,self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array(-0.89089981667)  
       sub=res.substitute({arg0:s0})  
       ref=Data(2.37947636807,self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_constData_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([1.2194556855632088, 2.353999722837127]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array(1.4460377531)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([2.665493438662657, 3.8000374759365751]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_constData_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[-4.1929966173405884, -2.4216172100236122, 2.8030782998236585, -1.8008208315387653, -2.1861068871670231], [3.1940143041091442, -1.5157969675783489, 4.6801565544771364, -4.4643398363634876, 1.0860147616841669], [4.013245591980489, -1.634511584870987, 0.21363996659258788, -0.76350902817344135, 2.6466011032163621], [2.62410310386751, -1.3952054856344964, 0.26459187026488351, -1.5184720479845404, 1.3743185172378922]]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array(-4.71363284012)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[-8.9066294574600988, -7.1352500501431226, -1.9105545402958519, -6.5144536716582753, -6.8997397272865335], [-1.5196185360103662, -6.2294298076978594, -0.033476285642374037, -9.1779726764829981, -3.6276180784353436], [-0.70038724813902142, -6.3481444249904975, -4.4999928735269226, -5.4771418682929518, -2.0670317369031483], [-2.0895297362520004, -6.1088383257540073, -4.4490409698546269, -6.2321048881040504, -3.3393143228816182]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_constData_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[-0.90836674370751425, -2.8787922891264364], [2.1247426722531992, 1.1392229758239134]], [[3.6336870791990652, 3.939372695509002], [1.1155836708266476, -3.4720834120086019]], [[-0.79338200084260535, 3.3406884480470431], [2.7261214097259021, -3.4648114580993896]], [[-3.2896319514459762, -0.50907122553204864], [-1.8646472243418346, -1.674423164908668]], [[-2.4605577495102526, 3.9434210160877523], [1.787898193643807, -0.079006674699559021]], [[0.24478514192165157, 2.6801905856714434], [3.1612407526291957, 0.33879308294887256]]]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array(0.0203621354272)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-0.8880046082803208, -2.8584301536992429], [2.1451048076803927, 1.1595851112511069]], [[3.6540492146262586, 3.9597348309361955], [1.135945806253841, -3.4517212765814085]], [[-0.7730198654154119, 3.3610505834742366], [2.7464835451530956, -3.4444493226721962]], [[-3.2692698160187827, -0.48870909010485519], [-1.8442850889146412, -1.6540610294814746]], [[-2.4401956140830592, 3.9637831515149458], [1.8082603290710004, -0.05864453927236557]], [[0.26514727734884502, 2.7005527210986369], [3.1816028880563891, 0.35915521837606601]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_constData_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[[3.9833586112989963, 4.1703777441626713, 2.3048138983493622, 0.20986752016974997], [4.0117763147816596, -1.013218944815204, 0.74841109387999971, 1.993114017880357], [-1.546457712578897, -3.7753611323262595, -4.1795025070783263, 1.5495358178318961]], [[2.7185326180397542, 1.0081525414950656, -3.3470914918608385, 2.9676033167790736], [3.1050360341367451, -2.8022358282907689, -2.1933166855498176, -2.6454257091297642], [3.7010807381625117, 1.5066861871979604, 0.34369895600355704, 1.1942436893147121]]], [[[3.0904893218777865, -4.1551617447370344, -3.7317047054778785, -3.3353390469337549], [-3.878994211766511, -1.094866021548262, -0.78764145958990195, -3.3586600781174933], [3.3672843054690311, -0.4767040203026145, -2.1723358471853036, -1.6830816876354349]], [[-1.4608633128830837, 2.2924296405661915, 2.8663136540477874, -0.40399403808789458], [3.4886125220968527, 2.0480057550249082, 1.2057705263379956, -4.6585673398088456], [0.26124445773253147, 4.4971698862345182, 2.7395629227278926, -2.9289539398124087]]], [[[-1.2597386124987109, -2.9486603463928507, -4.7219891185789926, -2.5183268505753], [-1.3903508799956477, 4.8842767843996011, 0.27953111451039625, 3.8091265237256344], [0.50577663189151334, 2.8970175806056364, 0.10935387589562051, 3.6569760371253466]], [[2.1869971533486607, 4.5247966516142224, 4.9908753671091688, -1.7496053582318947], [-0.6408061191925718, 1.2088129105156984, -0.17108541054076731, 4.1837262439594234], [3.9661191384802805, 1.5287611031771782, -3.196789604812885, 0.99536997234297431]]]]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array(4.90559447952)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[8.888953090820694, 9.075972223684369, 7.2104083778710599, 5.1154619996914477], [8.9173707943033573, 3.8923755347064937, 5.6540055734016974, 6.8987084974020547], [3.3591367669428007, 1.1302333471954382, 0.72609197244337143, 6.4551302973535938]], [[7.6241270975614519, 5.9137470210167633, 1.5585029876608592, 7.8731977963007713], [8.0106305136584428, 2.1033586512309288, 2.7122777939718801, 2.2601687703919335], [8.6066752176842094, 6.4122806667196581, 5.2492934355252547, 6.0998381688364098]]], [[[7.9960838013994842, 0.75043273478466332, 1.1738897740438192, 1.5702554325879428], [1.0266002677551866, 3.8107284579734357, 4.1179530199317957, 1.5469344014042044], [8.2728787849907288, 4.4288904592190832, 2.7332586323363941, 3.2225127918862628]], [[3.444731166638614, 7.1980241200878892, 7.7719081335694851, 4.5016004414338031], [8.3942070016185504, 6.9536002345466059, 6.1113650058596933, 0.24702713971285206], [5.1668389372542292, 9.4027643657562159, 7.6451574022495903, 1.976640539709289]]], [[[3.6458558670229868, 1.956934133128847, 0.18360536094270508, 2.3872676289463977], [3.51524359952605, 9.7898712639212988, 5.1851255940320939, 8.7147210032473321], [5.411371111413211, 7.8026120601273341, 5.0149483554173182, 8.5625705166470443]], [[7.0925916328703584, 9.4303911311359201, 9.8964698466308665, 3.155989121289803], [4.2647883603291259, 6.1144073900373961, 4.7345090689809304, 9.0893207234811211], [8.8717136180019782, 6.4343555826988759, 1.7088048747088127, 5.900964451864672]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_expandedData_rank0(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(0.679895637591)+(1.-msk_arg1)*(1.66372680115)  
       res=arg0+arg1  
       s0=numpy.array(-1.68607380599)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(-1.0061781684)+(1.-msk_ref)*(-0.0223470048413)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_expandedData_rank1(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([1.3169386183605578, 4.2187722464294026])+(1.-msk_arg1)*numpy.array([1.9419206635404231, 1.0638435572808094])  
       res=arg0+arg1  
       s0=numpy.array(-1.66647509334)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-0.34953647498097595, 2.5522971530878689])+(1.-msk_ref)*numpy.array([0.27544557019888938, -0.60263153606072439])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_expandedData_rank2(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[4.2203962279630964, -1.6187205377888114, 1.3225561894484175, -1.9970858887200094, -4.4713695326972447], [-1.5204266679127421, -3.103849105438603, 3.2196807828038416, 2.3773178822902041, 1.5822003725061915], [-4.6289880038003357, 4.2533956009169778, -4.852780676006887, -4.1336971496329351, 4.5180216982602879], [-4.8246596332260303, -0.19505211130668343, 2.994471249625966, -2.7250460718596847, 3.4274972510128414]])+(1.-msk_arg1)*numpy.array([[-2.4010339048903715, 0.27228103921092384, 2.7406187955115602, 4.6031124182895695, 1.5147335531048158], [4.3443493372226616, -4.9132958884314872, 2.4016525411659995, -2.0926793951033327, -4.3327365533646027], [0.59683345078675565, 3.9144459289549118, -1.993085936032303, -4.5018261447525232, -3.9458868405251257], [4.6773394488418383, -2.1292350412612127, -3.1258901337878431, 3.8691380036832115, -3.8847350420796403]])  
       res=arg0+arg1  
       s0=numpy.array(1.718542789)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[5.9389390169652083, 0.099822251213300461, 3.0410989784505293, -0.27854309971789748, -2.7528267436951328], [0.19811612108936982, -1.3853063164364912, 4.9382235718059535, 4.095860671292316, 3.3007431615083034], [-2.9104452147982238, 5.9719383899190897, -3.1342378870047751, -2.4151543606308232, 6.2365644872623998], [-3.1061168442239184, 1.5234906776954285, 4.7130140386280779, -1.0065032828575728, 5.1460400400149533]])+(1.-msk_ref)*numpy.array([[-0.68249111588825961, 1.9908238282130357, 4.4591615845136721, 6.3216552072916814, 3.2332763421069277], [6.0628921262247735, -3.1947530994293754, 4.1201953301681113, -0.37413660610122079, -2.6141937643624908], [2.3153762397888675, 5.6329887179570237, -0.27454314703019111, -2.7832833557504113, -2.2273440515230138], [6.3958822378439502, -0.41069225225910078, -1.4073473447857312, 5.5876807926853234, -2.1661922530775284]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_expandedData_rank3(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-4.1700686610343389, -4.768763393561958], [-4.0890693569366139, 4.8977528044246998]], [[0.75848037493735632, 1.4779093486068575], [-0.078192231971236481, -4.6957307449921029]], [[-1.926872490996534, -2.0108608447840415], [2.1106728620316693, 0.68065132804688311]], [[0.2084155832455723, -4.900760552921918], [0.3791931451759698, 2.8877974724713154]], [[0.5956625666414439, -0.75150101478757758], [2.8825102726367735, -2.7798075939984948]], [[-3.6773476429805365, -3.3673471792397782], [3.2973376243531245, -1.0798735457590425]]])+(1.-msk_arg1)*numpy.array([[[0.32947682531130429, 0.18408603516588151], [-4.8533747393418682, 0.23687634046174821]], [[-2.494023771960264, 0.5953388089559839], [0.93504619804336642, 4.4260443562648728]], [[-1.2507134040371093, -1.5701203155050534], [-1.0017902667916445, -1.2456453051509886]], [[-1.4957338462920267, -4.9429190060627635], [-0.88975352759444348, -3.6693722523395786]], [[-3.4101688354287987, 3.8678092629042773], [3.2156228079258202, 0.16036974409911231]], [[-1.2844195463189587, 4.8301471027408631], [-3.3308664424969581, -4.5137441548371049]]])  
       res=arg0+arg1  
       s0=numpy.array(2.52027181345)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-1.6497968475842093, -2.2484915801118284], [-1.5687975434864843, 7.4180246178748295]], [[3.2787521883874859, 3.9981811620569871], [2.4420795814788931, -2.1754589315419732]], [[0.59339932245359561, 0.50941096866608815], [4.6309446754817989, 3.2009231414970127]], [[2.7286873966957019, -2.3804887394717884], [2.8994649586260994, 5.408069285921445]], [[3.1159343800915735, 1.768770798662552], [5.4027820860869031, -0.25953578054836512]], [[-1.1570758295304069, -0.84707536578964859], [5.8176094378032541, 1.4403982676910871]]])+(1.-msk_ref)*numpy.array([[[2.8497486387614339, 2.7043578486160111], [-2.3331029258917386, 2.7571481539118778]], [[0.026248041489865592, 3.1156106224061135], [3.455318011493496, 6.9463161697150024]], [[1.2695584094130203, 0.95015149794507625], [1.5184815466584851, 1.274626508299141]], [[1.024537967158103, -2.4226471926126338], [1.6305182858556861, -1.149100438889449]], [[-0.88989702197866904, 6.3880810763544069], [5.7358946213759499, 2.6806415575492419]], [[1.2358522671311709, 7.3504189161909927], [-0.81059462904682844, -1.9934723413869753]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_expandedData_rank4(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-3.1915970131450786, 3.7560616394931241, 4.3521109605173045, 0.33533734574473595], [2.6280204793074766, 3.3122425328295826, 3.7920502514952616, 3.7984447084895532], [4.891021857756213, -3.4706233541040743, -2.2030788076498773, -0.63675315223973517]], [[0.32546761577079764, -3.334881728214433, 0.75764361998308249, -2.6613693573396526], [4.4604202868194616, -1.328173755409674, -4.7710892174786697, 4.3153441543978932], [-1.9331708101808198, -2.3341172905124461, 0.82725947128323618, 0.3173388645614974]]], [[[-0.27753340796041304, 0.64837299346945709, -4.0002521573716221, 0.73752997720520685], [-0.54199023731853124, 0.98163285935127487, -3.6816291179229745, -2.4891776364402118], [1.279976956187566, -3.6802580692538536, 2.8616422955837404, -0.85358731875445315]], [[2.7366067316352414, 1.5373131115510592, -1.2555857963559367, -3.4967146242210125], [-4.5737548486649535, -4.4190843926513299, -1.7128718133509633, 1.9874864443711813], [4.1485144108694154, -4.9346727462912163, -4.9275490579301495, -3.9501639626329488]]], [[[-0.033437406860519658, 1.0102779167012086, 1.8667928758088861, 2.917296307296863], [-1.5166509484807298, -2.52944518054673, -1.9871332244623474, -3.1487720540513831], [3.6685399191719466, 2.0471874034401418, -4.4079264682669805, 4.8540366367815242]], [[3.0864532104840148, 1.2754232333845463, 3.3373992143673306, -4.184146844539721], [-4.7967241129724458, -0.37853284414919486, -0.0023523153303699473, 2.2035953831621891], [-1.2554308787023838, -2.9888748380838615, 4.3622772211546668, 4.116690919224828]]]])+(1.-msk_arg1)*numpy.array([[[[-3.4449069777728134, -1.7952199724437379, 0.85130311880725973, -4.4670910626109048], [-0.28346805941143671, -4.0555701161229232, 3.0674756612607794, 4.7838743900660834], [-1.3411780039917254, -3.2336295409882232, 2.1350114037738699, 0.31589686834447317]], [[-0.17363798974566613, 3.1681050604014285, -0.98632165944795425, 1.0582861716133589], [0.49335449086670558, -2.9245681798371681, -4.2677894912640379, 4.8514146663699513], [-0.36543417413243517, -4.4219503486679157, -3.8344624075519693, 2.19797881950565]]], [[[-3.5096796406008046, -2.4487176525910659, -4.7344070967116281, 2.7583301073365218], [-3.0142268242416668, 4.1716812018451002, 0.019219790257531955, -2.2978947047046705], [3.0617263377954789, -4.8429029213628159, -3.3039977525681641, 4.5720081070694096]], [[1.5962215309351588, -2.8694588528686138, -1.877650871174501, -4.6002796823422543], [4.4376918817061668, -3.2288643197644062, -4.8170765864961442, -4.9749267253204081], [-2.4891274335726168, 0.29948974400594253, 0.39806697559889592, -1.082888286184216]]], [[[4.7953529741662972, 1.2475568932407075, -4.568039091723727, -0.45395719563915904], [3.796209735845526, 4.2086112815250853, 1.6622080279213556, -1.1941449660006387], [2.0961876303254634, -0.42160151454309158, -0.88522995377606151, -2.353286038376706]], [[-2.6429948554802873, -2.7768555472568579, 3.8512066994202563, -4.5371789795076847], [-4.7607733120237476, 1.5724099873262043, -1.2833648320912081, 3.035781559250168], [-4.3233483366161121, 2.0421453024046299, 3.1082054019674903, 2.5359699758932006]]]])  
       res=arg0+arg1  
       s0=numpy.array(1.29049911208)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-1.9010979010622178, 5.0465607515759849, 5.6426100726001653, 1.6258364578275968], [3.9185195913903375, 4.6027416449124434, 5.0825493635781225, 5.088943820572414], [6.1815209698390738, -2.1801242420212135, -0.91257969556701646, 0.65374595984312567]], [[1.6159667278536585, -2.0443826161315721, 2.0481427320659433, -1.3708702452567918], [5.7509193989023224, -0.03767464332681314, -3.4805901053958088, 5.605843266480754], [-0.64267169809795899, -1.0436181784295853, 2.117758583366097, 1.6078379766443582]]], [[[1.0129657041224478, 1.9388721055523179, -2.7097530452887613, 2.0280290892880677], [0.74850887476432959, 2.2721319714341357, -2.3911300058401137, -1.198678524357351], [2.5704760682704269, -2.3897589571709927, 4.1521414076666012, 0.43691179332840768]], [[4.0271058437181022, 2.82781222363392, 0.034913315726924132, -2.2062155121381517], [-3.2832557365820927, -3.1285852805684691, -0.42237270126810245, 3.2779855564540421], [5.4390135229522762, -3.6441736342083555, -3.6370499458472887, -2.6596648505500879]]], [[[1.2570617052223412, 2.3007770287840694, 3.1572919878917469, 4.2077954193797238], [-0.22615183639786895, -1.2389460684638691, -0.69663411237948658, -1.8582729419685222], [4.9590390312548074, 3.3376865155230027, -3.1174273561841197, 6.144535748864385]], [[4.3769523225668756, 2.5659223454674072, 4.6278983264501914, -2.8936477324568601], [-3.506225000889585, 0.91196626793366597, 1.2881467967524909, 3.4940944952450499], [0.035068233380477043, -1.6983757260010006, 5.6527763332375276, 5.4071900313076888]]]])+(1.-msk_ref)*numpy.array([[[[-2.1544078656899526, -0.50472086036087704, 2.1418022308901206, -3.176591950528044], [1.0070310526714241, -2.7650710040400623, 4.3579747733436403, 6.0743735021489442], [-0.050678891908864543, -1.9431304289053624, 3.4255105158567307, 1.606395980427334]], [[1.1168611223371947, 4.4586041724842893, 0.30417745263490659, 2.3487852836962198], [1.7838536029495664, -1.6340690677543073, -2.9772903791811771, 6.1419137784528122], [0.92506493795042566, -3.1314512365850549, -2.5439632954691085, 3.4884779315885108]]], [[[-2.2191805285179438, -1.1582185405082051, -3.4439079846287672, 4.0488292194193827], [-1.7237277121588059, 5.462180313927961, 1.3097189023403928, -1.0073955926218097], [4.3522254498783397, -3.552403809279955, -2.0134986404853032, 5.8625072191522705]], [[2.8867206430180197, -1.578959740785753, -0.58715175909164019, -3.3097805702593934], [5.7281909937890276, -1.9383652076815454, -3.5265774744132834, -3.6844276132375473], [-1.198628321489756, 1.5899888560888034, 1.6885660876817568, 0.20761082589864488]]], [[[6.0858520862491581, 2.5380560053235683, -3.2775399796408662, 0.83654191644370179], [5.0867088479283868, 5.4991103936079462, 2.9527071400042164, 0.096354146082222147], [3.3866867424083242, 0.86889759753976925, 0.40526915830679933, -1.0627869262938452]], [[-1.3524957433974265, -1.4863564351739971, 5.1417058115031171, -3.2466798674248238], [-3.4702741999408868, 2.8629090994090651, 0.0071342799916527255, 4.3262806713330288], [-3.0328492245332512, 3.3326444144874907, 4.3987045140503511, 3.8264690879760614]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_Symbol_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=())  
       res=arg0+arg1  
       s0=numpy.array(-2.57100038443)  
       s1=numpy.array(-0.480189602055)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array(-3.05118998649)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_Symbol_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(2,))  
       res=arg0+arg1  
       s0=numpy.array(0.278385724477)  
       s1=numpy.array([-3.7466554162944798, 2.1658556373894431])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([-3.4682696918178908, 2.4442413618660321])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_Symbol_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(4, 5))  
       res=arg0+arg1  
       s0=numpy.array(-2.96718112957)  
       s1=numpy.array([[-3.1023030597927761, 3.7282095962973685, 3.4488799919215065, -3.9917430192892409, 2.9308205705801136], [4.6318210261842552, 0.90324629467850848, -1.1881172917095406, 1.6479202195198139, 1.5357646133746403], [0.91119713174140671, -3.1979600322378818, 1.6092709498362625, -4.8440829162131287, 4.3546344867667717], [0.41061672151611006, 3.9829363303152263, -3.2204358667151278, -3.9304580536562672, 2.0526471690996466]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-6.0694841893620932, 0.76102846672805136, 0.48169886235218939, -6.958924148858558, -0.03636055898920354], [1.6646398966149381, -2.0639348348908086, -4.1552984212788573, -1.3192609100495032, -1.4314165161946768], [-2.0559839978279104, -6.165141161807199, -1.3579101797330546, -7.8112640457824458, 1.3874533571974546], [-2.5565644080532071, 1.0157552007459092, -6.1876169962844454, -6.8976391832255839, -0.9145339604696705]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_Symbol_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0+arg1  
       s0=numpy.array(0.0933465555537)  
       s1=numpy.array([[[1.5400616853783227, 3.721573856553789], [-4.2353346019490008, 0.66154987207563831]], [[2.3903004740214016, -0.98495079195910407], [-0.35476232670113106, -3.2403766049606664]], [[0.33651221963901179, -0.087816377671204648], [-0.3147618590914032, -1.3064841560664031]], [[2.8437356482984484, -2.097291007465488], [-1.9800260534308745, -3.1139545130940096]], [[1.63806619651589, 3.1659521565754343], [-1.6573168218991507, -1.817903365775285]], [[-4.845127980992161, 3.0864056626738527], [3.4826756514447794, -0.63976848591026947]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[1.6334082409320274, 3.8149204121074938], [-4.1419880463952961, 0.75489642762934306]], [[2.4836470295751063, -0.89160423640539932], [-0.26141577114742631, -3.1470300494069616]], [[0.42985877519271654, 0.005530177882500098], [-0.22141530353769845, -1.2131376005126984]], [[2.9370822038521531, -2.0039444519117833], [-1.8866794978771697, -3.0206079575403049]], [[1.7314127520695948, 3.259298712129139], [-1.563970266345446, -1.7245568102215802]], [[-4.7517814254384563, 3.1797522182275575], [3.5760222069984842, -0.54642193035656472]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank0_Symbol_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0+arg1  
       s0=numpy.array(1.00579371067)  
       s1=numpy.array([[[[-0.25139338894727548, -0.25681958582164466, 1.1105945711073009, -2.781796330342158], [0.4425361716557159, -2.9190051765172234, -3.7906045314406835, -2.7849519889616223], [2.7851637742038964, -0.12589104108405191, 1.4114617222050541, -2.4052831253109375]], [[-1.7551253270302256, 2.9657461231235906, 1.5776088976719915, 0.20897217973970239], [4.111519113071024, -4.9356897511059152, 0.056960791605349392, -4.2349257864327807], [-0.74134872613539393, -1.0957068235457221, 2.3808400631765378, -4.2767509706546782]]], [[[4.595553677632477, 1.312392085532526, -4.5372031546283331, -4.6999319337417935], [0.55560473289035262, -4.6550909503373061, 1.1193660219361892, -4.0169298795659678], [-3.6400665341248253, 2.5964169425236916, 0.91711693778880754, 4.6348048249301712]], [[1.7670754054502869, 2.9102634828233374, -2.3151191053995355, -2.0836247972173916], [2.4660784709282932, -4.3216168742641283, -4.4819891460757226, 4.6127979098419267], [-1.7566838764464188, -4.3043031129361831, -3.0345759170225484, 2.2305074871997892]]], [[[2.6829894607599947, -3.2414416058069371, 4.8011746899005932, -3.6927967394923176], [2.2009433085328558, 4.0710052903074399, 2.5919842524827761, -0.49954981092741324], [4.0259935829285993, 2.6026205784111909, 2.8066690604499218, 3.204972743412922]], [[-3.8888246371621427, 3.8436395967218484, 0.64749435197025207, -3.4906853723114164], [3.9304785013845915, 0.94330215792261729, -3.6110536856355955, -1.2904407247442853], [1.6400008392038901, -0.098304523784785047, 3.5460190380670813, -0.0039216003519495501]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[0.75440032171834215, 0.74897412484397297, 2.1163882817729185, -1.7760026196765404], [1.4483298823213335, -1.9132114658516057, -2.7848108207750659, -1.7791582782960047], [3.790957484869514, 0.87990266958156571, 2.4172554328706717, -1.3994894146453198]], [[-0.74933161636460799, 3.9715398337892083, 2.5834026083376092, 1.21476589040532], [5.1173128237366416, -3.9298960404402976, 1.062754502270967, -3.2291320757671631], [0.26444498453022369, -0.089913112880104507, 3.3866337738421555, -3.2709572599890606]]], [[[5.6013473882980946, 2.3181857961981436, -3.5314094439627155, -3.6941382230761759], [1.5613984435559702, -3.6492972396716885, 2.1251597326018068, -3.0111361689003502], [-2.6342728234592077, 3.6022106531893092, 1.9229106484544252, 5.6405985355957888]], [[2.7728691161159045, 3.916057193488955, -1.3093253947339178, -1.077831086551774], [3.4718721815939109, -3.3158231635985107, -3.476195435410105, 5.6185916205075443], [-0.75089016578080114, -3.2985094022705654, -2.0287822063569307, 3.2363011978654068]]], [[[3.6887831714256123, -2.2356478951413195, 5.8069684005662108, -2.6870030288266999], [3.2067370191984734, 5.0767990009730575, 3.5977779631483937, 0.50624389973820438], [5.0317872935942169, 3.6084142890768085, 3.8124627711155394, 4.2107664540785397]], [[-2.883030926496525, 4.849433307387466, 1.6532880626358697, -2.4848916616457988], [4.9362722120502092, 1.9490958685882349, -2.6052599749699779, -0.28464701407866766], [2.6457945498695077, 0.90748918688083258, 4.5518127487326989, 1.0018721103136681]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_float_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=2.20394717463  
       res=arg0+arg1  
       s0=numpy.array([1.1553792775045446, 3.3100258263193645])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([3.3593264521323656, 5.5139730009471855])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_array_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array(2.9831162964)  
       res=arg0+arg1  
       s0=numpy.array([0.18390139655612892, -3.9799817333464715])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([3.1670176929568985, -0.99686543694570195])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_array_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array([-2.0799468889109383, -4.2023720789838421])  
       res=arg0+arg1  
       s0=numpy.array([-2.3925844119412689, 3.1364964781237283])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([-4.4725313008522072, -1.0658756008601138])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_constData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(-2.91297428406,self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([-4.4797862842417189, 4.1434428771091074])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-7.3927605683052597, 1.2304685930455665]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_constData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(numpy.array([-2.8459101912130604, -4.0001565029776431]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([-1.7738613958676241, 1.7169746584554311])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-4.6197715870806846, -2.2831818445222121]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_expandedData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.11559995426)+(1.-msk_arg1)*(2.42267791492)  
       res=arg0+arg1  
       s0=numpy.array([2.055531793887396, 2.8518220367803622])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([5.1711317481441315, 5.9674219910370976])+(1.-msk_ref)*numpy.array([4.4782097088093034, 5.2744999517022695])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_expandedData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([2.1916699657723342, 4.5674759878747633])+(1.-msk_arg1)*numpy.array([-4.2005893725553554, 0.81299869291879823])  
       res=arg0+arg1  
       s0=numpy.array([1.9194346721378981, 0.72894194090721065])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([4.1111046379102323, 5.2964179287819739])+(1.-msk_ref)*numpy.array([-2.2811547004174573, 1.5419406338260089])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_Symbol_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=())  
       res=arg0+arg1  
       s0=numpy.array([0.72498461311657625, 0.27803071836857995])  
       s1=numpy.array(2.771273149)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([3.4962577621134949, 3.0493038673654986])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank1_Symbol_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=(2,))  
       res=arg0+arg1  
       s0=numpy.array([0.68972395016845311, -0.25953322513846011])  
       s1=numpy.array([-0.4776211491249116, -3.150909893896495])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([0.21210280104354151, -3.4104431190349551])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_float_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=-1.15233382163  
       res=arg0+arg1  
       s0=numpy.array([[-2.862750755861633, -0.54566791832317207, 0.40098759247037119, -1.6005498891360794, 0.75198545657652627], [-0.48415447771519737, -4.1423892024917377, -3.0803937309939267, -0.63908138926619174, -3.7845604905892993], [-1.5199033879902357, -4.2031673086766617, 3.0506682128055438, 4.107603195231686, 0.95827719814549894], [4.1191747701577928, 2.5181684309795127, -3.2109763634591504, 4.1619469982791042, 1.6531003967311229]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-4.0150845774904802, -1.6980017399520193, -0.75134622915847604, -2.7528837107649267, -0.40034836505232096], [-1.6364882993440446, -5.2947230241205849, -4.2327275526227739, -1.791415210895039, -4.936894312218147], [-2.672237209619083, -5.3555011303055089, 1.8983343911766966, 2.9552693736028388, -0.19405662348334829], [2.9668409485289455, 1.3658346093506655, -4.3633101850879976, 3.009613176650257, 0.50076657510227562]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_array_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array(-0.649930844344)  
       res=arg0+arg1  
       s0=numpy.array([[4.2850532576590545, 1.2907652978057751, 1.5705862508781623, -3.3195536326245656, 0.22526442993719442], [-3.8131919195592112, -4.8965744969454814, 2.7077373721887561, 0.018528233915619197, 4.9636808383543976], [-0.15905051357488986, -0.11202403911813175, 1.3326838980342579, -3.8266228548225345, -0.80558388829932426], [-1.3412187211308666, 1.080600261922589, 1.2441264991154144, -4.41090807377293, -2.1545994640102881]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[3.6351224133151518, 0.6408344534618724, 0.92065540653425959, -3.9694844769684683, -0.42466641440670827], [-4.4631227639031135, -5.5465053412893841, 2.0578065278448534, -0.6314026104282835, 4.3137499940104949], [-0.80898135791879255, -0.76195488346203444, 0.68275305369035522, -4.4765536991664376, -1.4555147326432269], [-1.9911495654747693, 0.43066941757868626, 0.59419565477151171, -5.0608389181168327, -2.8045303083541908]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_array_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array([[-2.4864022448422762, 0.098640120441895185, -1.7094913219233066, -3.3390734105960584, -2.7656983078693376], [0.17243918296498872, 0.45657294414417571, -4.909484446718313, -3.3259541599436195, -3.4449787421354627], [3.7729195863610823, 0.35233027639668713, -2.6379156033661766, 4.6156656112775298, -4.5904700242454251], [1.3892424606192479, 4.0538237280429605, 4.3978500183539957, -4.0808770687130993, 1.78940542257802]])  
       res=arg0+arg1  
       s0=numpy.array([[-4.0770887341956561, -4.0459676577047352, 4.8802589723014869, 4.6844441929732934, 2.8605046873225977], [0.3244700075918896, 1.0800445454491108, -2.194614248090164, 3.176104456255807, -4.2167170362728807], [-1.5175856680949362, -0.64214468833420568, -3.1788372009195474, -0.31714232440014278, -4.6178528491119444], [-2.4736860749025205, 2.5564860562095433, -0.91842634699792836, 3.5300518465662236, 1.7297369452588356]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-6.5634909790379323, -3.94732753726284, 3.1707676503781803, 1.345370782377235, 0.094806379453260092], [0.49690919055687832, 1.5366174895932865, -7.104098694808477, -0.14984970368781259, -7.6616957784083439], [2.255333918266146, -0.28981441193751856, -5.8167528042857235, 4.2985232868773871, -9.2083228733573694], [-1.0844436142832725, 6.6103097842525038, 3.4794236713560673, -0.55082522214687568, 3.5191423678368556]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_constData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(-0.267861373597,self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([[4.5824569210335593, -2.4387189400304421, 4.670503955822829, -1.3146657817142469, 3.8502851911151126], [-2.2012685738362658, 1.2859405523044636, 3.4215247711550809, -1.9609263900857954, -4.4850893687134308], [-0.26493650821538672, -4.8553705059172234, 3.6678814388916798, -3.6367497838127938, -1.5687271040775963], [-0.33255355123688801, -3.8527520029213482, -3.1608489648812266, 1.724984049121443, 1.2339369766262713]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[4.3145955474368121, -2.7065803136271893, 4.4026425822260817, -1.5825271553109941, 3.5824238175183654], [-2.4691299474330131, 1.0180791787077164, 3.1536633975583337, -2.2287877636825426, -4.752950742310178], [-0.53279788181213394, -5.1232318795139706, 3.4000200652949326, -3.904611157409541, -1.8365884776743435], [-0.60041492483363523, -4.1206133765180954, -3.4287103384779738, 1.4571226755246958, 0.96607560302952411]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_constData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(numpy.array([[-4.0155829592833472, -1.5512583989938857, -0.93742843216506255, -0.75789199334156532, -2.5191327338191085], [-1.3884954240150926, -1.1427027187113969, -1.8579367262405744, -1.0514834239319351, -2.4318040185987444], [0.053918841816176233, -1.9878620064983457, 3.3244767602219376, 0.92463012891174934, -2.2104501119219377], [-2.857921358197979, -4.6659356794532858, -0.8295431235880617, 1.7028033259208186, 4.2986585939082023]]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([[0.17737314874741816, -0.18600257673233145, 1.6117282877542465, -1.1323164285792195, -0.9525297198433833], [0.19435420677523485, -3.8218427099709782, 4.8309112140480206, 1.900625502628114, 2.7927457723265281], [-2.2686613406763225, 3.3453759993843342, -4.3866225661245597, -3.5420095083663683, 3.993268304666465], [-2.4682121423337398, 3.5650025765192712, -4.8427558415150322, -1.6273798101690593, -1.1281629234513257]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[-3.838209810535929, -1.7372609757262172, 0.67429985558918393, -1.8902084219207849, -3.4716624536624918], [-1.1941412172398578, -4.9645454286823751, 2.9729744878074462, 0.84914207869617897, 0.3609417537277837], [-2.2147424988601463, 1.3575139928859885, -1.0621458059026221, -2.617379379454619, 1.7828181927445272], [-5.3261335005317187, -1.1009331029340146, -5.6722989651030939, 0.075423515751759318, 3.1704956704568765]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_expandedData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-0.265619857453)+(1.-msk_arg1)*(0.106786038424)  
       res=arg0+arg1  
       s0=numpy.array([[1.520194473109564, 1.0880978006617141, 2.9617964956176266, -0.21629757097795821, -4.7359102437682585], [4.5498683542741922, 4.0913216702941302, 1.3291400995982814, -4.8159390414843584, -0.11469097896660507], [-0.28917282030486913, -2.4542939560700594, 0.87362942777772901, 3.6512423972069978, 1.2726398959071084], [-1.6026826549836737, -3.9966669161277846, -0.37004885965844281, -2.1569640570869697, 2.5539910539254933]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[1.2545746156562165, 0.82247794320836665, 2.6961766381642791, -0.48191742843130569, -5.001530101221606], [4.2842484968208447, 3.8257018128407827, 1.0635202421449339, -5.0815588989377058, -0.38031083641995256], [-0.55479267775821661, -2.7199138135234069, 0.60800957032438152, 3.3856225397536504, 1.0070200384537609], [-1.8683025124370212, -4.2622867735811321, -0.63566871711179029, -2.4225839145403172, 2.2883711964721458]])+(1.-msk_ref)*numpy.array([[1.6269805115339775, 1.1948838390861276, 3.0685825340420401, -0.10951153255354473, -4.6291242053438451], [4.6566543926986057, 4.1981077087185437, 1.4359261380226949, -4.7091530030599449, -0.0079049405421915964], [-0.18238678188045565, -2.3475079176456459, 0.98041546620214248, 3.7580284356314113, 1.3794259343315218], [-1.4958966165592602, -3.8898808777033711, -0.26326282123402933, -2.0501780186625562, 2.6607770923499068]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_expandedData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[-3.9500181455213959, 1.0504326158252706, -4.6962924369852663, 0.096318021376793794, -4.1517551100594776], [1.1184487093238822, 2.5023258696143236, 2.1717995231236795, -1.5175180254692124, -4.9427503798307102], [1.2201999340186518, 4.8034056742204783, 1.7575137817828113, 0.72535639800069696, -0.50874195609701545], [3.7580339980447377, -3.8537487636195689, -3.5441755870644287, -4.9309236856078043, -0.12210363904751187]])+(1.-msk_arg1)*numpy.array([[0.76408499388016882, 4.4708590635480689, -3.0422150199712936, -0.70464044277722326, -4.3471803329467038], [-2.0794076083732693, 2.4043556275063658, -1.067473900110417, 0.79267946618563823, -1.8630496917191364], [-2.6366050444214171, -3.4995497621950489, 0.41712901366478849, -4.3162857238409922, 2.1761437114894742], [-3.0632760708900864, -0.79960474481986843, 3.4640472776369808, -3.8444658390604172, -0.1638276860301433]])  
       res=arg0+arg1  
       s0=numpy.array([[3.6176166462003572, 3.9882838485233982, 1.299473209266421, -4.7790920827384253, 2.2368695842529451], [3.8085929916655381, -3.3538715473100424, 0.33502225626981641, 3.1666172476310255, -0.96655295811751074], [-4.6738467785073192, -3.5579017192672246, 0.28401902379034638, 2.6706522944973843, -0.59219976890598147], [-3.9385854260435007, -0.24362522034660117, -4.8649051949956004, 3.325040431169155, 4.4640593635179187]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-0.33240149932103868, 5.0387164643486688, -3.3968192277188454, -4.6827740613616315, -1.9148855258065325], [4.9270417009894203, -0.85154567769571887, 2.5068217793934959, 1.649099222161813, -5.9093033379482209], [-3.4536468444886674, 1.2455039549532536, 2.0415328055731576, 3.3960086924980812, -1.1009417250029969], [-0.180551427998763, -4.09737398396617, -8.4090807820600286, -1.6058832544386492, 4.3419557244704068]])+(1.-msk_ref)*numpy.array([[4.381701640080526, 8.4591429120714672, -1.7427418107048727, -5.4837325255156486, -2.1103107486937587], [1.7291853832922688, -0.94951591980367667, -0.73245164384060057, 3.9592967138166637, -2.8296026498366471], [-7.3104518229287363, -7.0574514814622731, 0.70114803745513488, -1.6456334293436079, 1.5839439425834927], [-7.0018614969335875, -1.0432299651664696, -1.4008579173586195, -0.51942540789126213, 4.3002316774877754]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_Symbol_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=())  
       res=arg0+arg1  
       s0=numpy.array([[-3.6836016821938786, -3.6512665417332544, -0.17607423723026905, -3.2428614508784315, 2.0856426657424265], [4.2054195378846604, -3.3321813747120252, 4.3581902148706426, 4.2214890412334345, -3.8701803578105687], [-3.3252774127827509, 2.6586829068742031, 3.0534234713146695, 2.1970761605941505, 2.7537778156168464], [4.1083846441777823, 1.9316018268994481, -0.97938777771108398, -4.1388958839629257, -2.767624125482766]])  
       s1=numpy.array(-0.143731269456)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-3.8273329516498462, -3.794997811189222, -0.31980550668623664, -3.3865927203343991, 1.9419113962864589], [4.0616882684286928, -3.4759126441679928, 4.214458945414675, 4.0777577717774669, -4.0139116272665358], [-3.4690086822387185, 2.5149516374182355, 2.9096922018587019, 2.0533448911381829, 2.6100465461608788], [3.9646533747218147, 1.7878705574434806, -1.1231190471670516, -4.2826271534188933, -2.9113553949387336]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank2_Symbol_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=(4, 5))  
       res=arg0+arg1  
       s0=numpy.array([[0.72850688380114637, -1.2224457140256382, 2.8869111390100279, -0.5022082355860551, -0.20401036769377612], [0.35402167456527955, -0.49541907776846372, -2.3709303972336393, 0.085565512712719283, -0.72074349051077657], [-1.1315503159303208, -3.4457456119951289, -4.1989726081537597, 0.84313307016714933, 1.7070785883162642], [0.30435862672146374, -4.1590296051847577, -3.1169384304573997, 0.25953649104379295, 2.2651725247944468]])  
       s1=numpy.array([[-0.73853267557292401, 0.2145067480141325, -1.7692454452302266, -4.8831179301927241, 3.5617857696499211], [1.0347003475509418, 4.5726379014858107, -0.10617031606035798, 1.2115255048299458, -0.91031677703944069], [0.20809633900057278, -3.9023162860881353, 3.6109909054558411, 2.9546581844787898, 0.21788865065584861], [0.98608463889054399, 1.4887448583495209, 4.6616246398720413, 2.2291787223671271, -2.8118021334016441]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-0.010025791771777648, -1.0079389660115057, 1.1176656937798013, -5.3853261657787792, 3.357775401956145], [1.3887220221162213, 4.077218823717347, -2.4771007132939973, 1.2970910175426651, -1.6310602675502173], [-0.92345397692974807, -7.3480618980832642, -0.58798170269791861, 3.7977912546459391, 1.9249672389721129], [1.2904432656120077, -2.6702847468352369, 1.5446862094146416, 2.4887152134109201, -0.54662960860719734]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_float_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=1.16704935543  
       res=arg0+arg1  
       s0=numpy.array([[[-4.5060970257750217, -1.3453625807412761], [-3.4451605121569004, 2.3396981500996761]], [[4.0405120664600265, -4.9767235246125381], [3.8518003467490853, -3.8072767820147826]], [[2.7542554250729232, 4.7123847068130917], [-1.0221756841093557, 1.3430306431742034]], [[-0.45915459002933545, -3.5172455332821064], [-0.45111006198058501, 3.8499856065775599]], [[-2.072562468264032, -0.0080887969494654044], [-4.0335483504594194, 2.511157523965176]], [[-3.845074840087829, -0.2263503951340784], [-1.0894361428084376, 4.9085266166323116]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-3.3390476703429544, -0.17831322530920879], [-2.2781111567248331, 3.5067475055317434]], [[5.2075614218920938, -3.8096741691804707], [5.0188497021811527, -2.6402274265827153]], [[3.9213047805049905, 5.8794340622451591], [0.14487367132271167, 2.5100799986062707]], [[0.70789476540273188, -2.3501961778500391], [0.71593929345148233, 5.0170349620096273]], [[-0.90551311283196467, 1.1589605584826019], [-2.8664989950273521, 3.6782068793972433]], [[-2.6780254846557616, 0.94069896029798894], [0.077613212623629746, 6.0755759720643789]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_array_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array(-4.50867020837)  
       res=arg0+arg1  
       s0=numpy.array([[[3.8311235987762071, -4.6737047446604016], [-3.5073580942277172, 1.8479930041752848]], [[4.860241363145942, 0.97138762118647115], [1.5851889593907673, 1.4059126655541228]], [[0.87192653915698948, 2.5003397681002104], [-2.3913248353040628, 2.6564967725170252]], [[-1.3316301792823957, 3.3473829672814013], [-1.1737183090496051, -3.3703413768394528]], [[0.46048213258986781, 3.1133161498664688], [-1.9867556787645868, 4.753525448344929]], [[-1.2000881486176529, -1.4685593084519031], [-3.7011316773717438, 4.253449644622048]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-0.67754660959316837, -9.1823749530297771], [-8.0160283025970926, -2.6606772041940907]], [[0.35157115477656653, -3.5372825871829043], [-2.9234812489786082, -3.1027575428152527]], [[-3.636743669212386, -2.0083304402691651], [-6.8999950436734387, -1.8521734358523503]], [[-5.8403003876517712, -1.1612872410879742], [-5.6823885174189801, -7.8790115852088283]], [[-4.0481880757795077, -1.3953540585029067], [-6.4954258871339619, 0.24485523997555347]], [[-5.7087583569870279, -5.9772295168212786], [-8.2098018857411184, -0.25522056374732749]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_array_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array([[[2.5446139589405643, 4.5280530879867005], [3.4747859895082023, 0.55786559311702]], [[-4.3563168419917462, 4.2891005626393071], [1.7689587958629556, 1.7302687943471362]], [[2.1480659686474297, 4.6958871298600311], [-4.7574809356977665, 3.9032022742619414]], [[4.1737917812404497, -2.0067447667303662], [1.3305850600374738, -2.9555144867441605]], [[1.503301165310571, 3.3292347681650618], [-0.26065099592548435, 1.3956259483041737]], [[-2.6969677563950589, -0.81059924215148449], [-3.0539439919844535, -4.3493440852356571]]])  
       res=arg0+arg1  
       s0=numpy.array([[[4.4126606261185621, -4.7907303446596554], [2.5959258399896754, 3.4325337123389055]], [[1.593406945472843, 2.3934757835743365], [2.2081819226029209, -2.4404154180213098]], [[-0.48967805928598551, 3.4694031044475366], [-0.2199085035825199, 2.8706869194195512]], [[2.8357153940541666, -3.0102108335215494], [3.0200074689449892, 0.63782193832848222]], [[4.2350179384243809, -1.8788240415933566], [2.3839450884815614, 2.75090873488403]], [[1.1814907841898146, -1.0477939750726861], [2.5266066789546091, -4.1204610718077532]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[6.9572745850591264, -0.26267725667295494], [6.0707118294978777, 3.9903993054559255]], [[-2.7629098965189032, 6.6825763462136436], [3.9771407184658765, -0.71014662367417358]], [[1.6583879093614442, 8.1652902343075677], [-4.9773894392802864, 6.7738891936814927]], [[7.0095071752946163, -5.0169556002519151], [4.350592528982463, -2.3176925484156783]], [[5.7383191037349519, 1.4504107265717052], [2.123294092556077, 4.1465346831882037]], [[-1.5154769722052444, -1.8583932172241706], [-0.52733731302984443, -8.4698051570434103]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_constData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(0.789570292594,self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([[[-3.4282095506637367, 1.1828454117581622], [4.8134926718070865, 1.9522543928812333]], [[-4.2913177170323529, -1.5849279103176537], [-2.1078475630194395, -2.1505592388691297]], [[4.5621654071762059, -4.7699941699228727], [4.1146401206969987, -3.5131793673021994]], [[-4.6779883549569679, 0.065940073745198724], [3.6273429788734326, -2.4794665641015401]], [[2.0661649472492547, 1.3445687775658151], [-2.0867337191893629, 2.2926280855358661]], [[0.73998098556068825, -0.61911889193525838], [-4.450419664264464, -3.1939348599668573]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-2.6386392580696185, 1.9724157043522803], [5.6030629644012047, 2.7418246854753514]], [[-3.5017474244382347, -0.79535761772353553], [-1.3182772704253214, -1.3609889462750115]], [[5.351735699770324, -3.9804238773287546], [4.9042104132911168, -2.7236090747080812]], [[-3.8884180623628497, 0.85551036633931687], [4.4169132714675508, -1.6898962715074219]], [[2.8557352398433729, 2.1341390701599332], [-1.2971634265952448, 3.0821983781299842]], [[1.5295512781548064, 0.17045140065885978], [-3.6608493716703459, -2.4043645673727392]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_constData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(numpy.array([[[0.73152118047134351, 3.4242800509034552], [-3.2741145232693478, 4.7127161702212934]], [[1.0798489010881793, 3.7077976473928729], [-4.387325361485285, 1.933753272149568]], [[-0.26198741350216537, 2.6694657864176907], [3.2201303655203208, -4.7219890271271385]], [[-2.0537527900607144, 2.9566313257783872], [3.4712501540774134, -4.3877329790515205]], [[-1.1470271966956593, -1.213215159037806], [2.6589257538192044, -0.67205698242767298]], [[-2.5407648917397241, -4.6338101523206623], [4.0912783377821924, -0.21126749045848925]]]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([[[4.9066775528222326, -3.7861242219395908], [1.7850255536953172, -4.0737889554835318]], [[4.3031865013842303, -0.03588190246537426], [-4.4896956833501855, 4.5021355771353715]], [[-2.163011363957994, 3.7250158861583405], [0.74574449908322826, -2.3064816819302383]], [[-2.6636190311773533, -0.3696354205863317], [-3.6042806159187482, -4.4054022686765029]], [[1.3968886366476614, 2.9338395407894238], [1.9807387917866475, 3.1124422984413354]], [[-0.2264065115189231, -4.6711090373094821], [1.4265991498431898, -0.081087273042815156]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[5.6381987332935761, -0.36184417103613553], [-1.4890889695740306, 0.6389272147377616]], [[5.3830354024724096, 3.6719157449274986], [-8.8770210448354696, 6.4358888492849395]], [[-2.4249987774601593, 6.3944816725760312], [3.9658748646035491, -7.0284707090573768]], [[-4.7173718212380678, 2.5869959051920555], [-0.13303046184133471, -8.7931352477280242]], [[0.24986143995200205, 1.7206243817516178], [4.6396645456058518, 2.4403853160136624]], [[-2.7671714032586472, -9.3049191896301444], [5.5178774876253822, -0.2923547635013044]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_expandedData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.59110654818)+(1.-msk_arg1)*(3.44454995875)  
       res=arg0+arg1  
       s0=numpy.array([[[-1.5204940596448182, -3.4762940386351504], [-2.318531761535958, 2.0589984420201084]], [[1.756893645475845, 1.3893630174442517], [-2.2745876563480829, -1.0616219150364148]], [[-0.43328711326401859, 4.8512128819205138], [0.045565383925696423, -0.50353821429282064]], [[-0.86389614222575162, 0.20882079736009018], [-2.7422426597902305, -1.296095386446571]], [[-1.8249608536360173, 3.5567292277563674], [0.52354379982971366, -0.73604414821833419]], [[-1.344469186870322, 0.59983232848279222], [-3.6883458654133703, -4.9970174115866683]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[2.0706124885375381, 0.1148125095472059], [1.2725747866463983, 5.6501049902024647]], [[5.3480001936582013, 4.980469565626608], [1.3165188918342734, 2.5294846331459415]], [[3.1578194349183377, 8.4423194301028701], [3.6366719321080527, 3.0875683338895357]], [[2.7272104059566047, 3.7999273455424465], [0.84886388839212579, 2.2950111617357853]], [[1.766145694546339, 7.1478357759387237], [4.11465034801207, 2.8550623999640221]], [[2.2466373613120343, 4.1909388766651485], [-0.097239317231013978, -1.405910863404312]]])+(1.-msk_ref)*numpy.array([[[1.9240558991080494, -0.031744079882282783], [1.1260181972169097, 5.503548400772976]], [[5.2014436042287127, 4.8339129761971193], [1.1699623024047847, 2.3829280437164528]], [[3.011262845488849, 8.2957628406733814], [3.490115342678564, 2.941011744460047]], [[2.580653816527116, 3.6533707561129578], [0.70230729896263711, 2.1484545723062967]], [[1.6195891051168503, 7.001279186509235], [3.9680937585825813, 2.7085058105345334]], [[2.1000807718825456, 4.0443822872356598], [-0.24379590666050266, -1.5524674528338007]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_expandedData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[2.5151454323204376, 4.2114262477479496], [0.12184130892488376, -3.8158827269339577]], [[-1.9864326079669778, -0.64530229832712394], [-4.0359604425453819, -3.3369880446183]], [[-1.1637316072881143, 4.4612192246079978], [3.6593038168032113, -3.3592823571657524]], [[1.661417075396642, 1.8460912728490895], [2.9607817431381269, 1.3605253284149077]], [[3.1413832976294813, 2.6729515182074302], [4.3334685685410719, -1.0178116646545088]], [[2.9053927059558013, 0.38413230561118716], [3.6767647717634091, -1.8394836792486178]]])+(1.-msk_arg1)*numpy.array([[[3.3082029086409452, 2.2791285449450482], [4.0771850494340924, -2.3413561079801637]], [[3.492653040698702, -3.9182904768397098], [-3.6492482334464107, -0.024053748936876396]], [[-3.9623998992423246, -1.646191521634901], [0.77973947168481939, 4.3553575320378464]], [[1.3601110050872052, 0.15298829634172861], [1.5873734457247393, -1.3127922521551261]], [[-2.3261376282621207, -0.84692773956644007], [-3.1258394073093818, -2.3478913598063835]], [[-2.1496358557808612, -1.4088587802122454], [3.8454186490437241, -0.42176715385766617]]])  
       res=arg0+arg1  
       s0=numpy.array([[[2.8112817286369074, -0.52878543935636735], [-4.1056460372872126, 4.0592356629691935]], [[-4.3610792202667481, 3.1206481226752096], [-4.1013408134148062, -4.86264600463773]], [[2.7801928254630939, -3.477111337180169], [3.3771103385622467, 0.67346368459785744]], [[-2.790724979320828, -4.2513821013152491], [-3.0357394456720699, 3.9246849936404189]], [[3.0569300058590603, -0.37590474106681704], [-4.2854059935462727, 4.0091284958784303]], [[2.2532228587660965, -2.9922967601657993], [-0.75489506840652432, 0.18977874218049706]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[5.326427160957345, 3.6826408083915823], [-3.9838047283623288, 0.24335293603523578]], [[-6.347511828233726, 2.4753458243480857], [-8.1373012559601889, -8.19963404925603]], [[1.6164612181749796, 0.98410788742782884], [7.036414155365458, -2.685818672567895]], [[-1.129307903924186, -2.4052908284661596], [-0.07495770253394296, 5.2852103220553266]], [[6.1983133034885416, 2.2970467771406131], [0.048062574994799157, 2.9913168312239216]], [[5.1586155647218979, -2.6081644545546121], [2.9218697033568848, -1.6497049370681207]]])+(1.-msk_ref)*numpy.array([[[6.1194846372778526, 1.7503431055886809], [-0.028460987853120123, 1.7178795549890298]], [[-0.86842617956804613, -0.79764235416450013], [-7.7505890468612169, -4.8866997535746064]], [[-1.1822070737792307, -5.1233028588150695], [4.1568498102470661, 5.0288212166357038]], [[-1.4306139742336228, -4.0983938049735205], [-1.4483659999473306, 2.6118927414852928]], [[0.7307923775969396, -1.2228324806332571], [-7.4112454008556545, 1.6612371360720468]], [[0.10358700298523527, -4.4011555403780447], [3.0905235806371998, -0.2319884116771691]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_Symbol_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=())  
       res=arg0+arg1  
       s0=numpy.array([[[-2.5101987851745045, 4.0827909179825053], [-2.4125545924882621, 0.578986466602192]], [[-0.015958822080708757, -3.6486082177504531], [3.4838835667921568, 1.7248133137032475]], [[0.56574546275827409, 0.93858168774631956], [0.10946273510308302, 2.6405656121284569]], [[4.3262642102623055, 2.0859613107317738], [0.53842343103469581, -0.10885163195237357]], [[-4.0602907938611867, 2.5856295675515204], [2.5190679195844368, -2.879687630499296]], [[-0.22524807992669871, -1.1419562849601128], [-2.3506459944668432, 1.1896325368301017]]])  
       s1=numpy.array(0.189334122339)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[-2.3208646628356857, 4.272125040321324], [-2.2232204701494434, 0.76832058894101074]], [[0.17337530025810999, -3.4592740954116343], [3.6732176891309756, 1.9141474360420663]], [[0.75507958509709283, 1.1279158100851383], [0.29879685744190176, 2.8298997344672756]], [[4.5155983326011242, 2.2752954330705926], [0.72775755337351455, 0.080482490386445171]], [[-3.870956671522368, 2.7749636898903391], [2.7084020419232555, -2.6903535081604772]], [[-0.035913957587879963, -0.95262216262129407], [-2.1613118721280244, 1.3789666591689205]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank3_Symbol_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0+arg1  
       s0=numpy.array([[[4.161829084410785, 0.3039897733189818], [-3.539043529715876, 2.9369043144650355]], [[3.9485255679715152, 1.9868709437121659], [-3.1404342355299395, 3.1525347359060252]], [[-3.3295821125417078, -2.9954029957137864], [0.93283965676034875, 4.1909932364342772]], [[-1.3584707646527217, -4.8099453900985907], [-3.018527421454996, -1.2174718943574261]], [[-2.7018975336562914, 3.2260362142280137], [-3.3290017384400561, 4.7976140997464984]], [[-2.4684709390756323, -2.2020631456804738], [-0.2172818341027325, 3.6904537196867047]]])  
       s1=numpy.array([[[-3.287112508093899, -4.1241625729358331], [-0.8853373462686136, 1.2144814942624338]], [[3.720567355619206, -3.7290073758034046], [-4.8122252990768359, -2.1176359654268295]], [[-2.6444523768000594, 3.7489080580429839], [4.1627021971110558, -1.6232599831772521]], [[-0.96918265660664638, 0.70217283132415265], [-3.277926347727862, 2.2523375686202538]], [[0.33019919889294957, -0.045414592188651959], [-2.4699832209557915, 2.9370727167490065]], [[2.2152145254480526, -4.4439749354823554], [0.98332964601128037, -1.3993374095155708]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[0.87471657631688604, -3.8201727996168513], [-4.4243808759844896, 4.1513858087274693]], [[7.6690929235907213, -1.7421364320912387], [-7.9526595346067754, 1.0348987704791957]], [[-5.9740344893417667, 0.75350506232919745], [5.0955418538714046, 2.5677332532570252]], [[-2.327653421259368, -4.107772558774438], [-6.2964537691828575, 1.0348656742628277]], [[-2.3716983347633418, 3.1806216220393617], [-5.7989849593958471, 7.7346868164955049]], [[-0.25325641362757967, -6.6460380811628292], [0.76604781190854787, 2.2911163101711338]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_float_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=1.35788185857  
       res=arg0+arg1  
       s0=numpy.array([[[[-1.3089683435053043, 3.0683792576640982, 4.3018847507394025, 4.3461280293983329], [3.3463971806617039, -4.7198250306705649, 3.5328271583441406, -0.88858628609703594], [-1.2557984282429713, -1.2850847448498284, -0.76604899264949999, -0.30305129556879606]], [[-4.9008267827123495, 0.80461678085649346, 4.0594562444211633, 2.9420212139676352], [-2.8304724578155449, 2.4541617194514673, -4.4765607724875656, -3.5402857225989059], [-2.9567863909038228, 0.67007768463797568, 2.2473954119758552, -4.1513698288516903]]], [[[-4.9456028631701301, -0.77549539725234418, -2.5019745874973087, -0.27811724722661069], [0.20000114412359693, -4.9669760639798541, 3.1119436891898005, 0.87211309596103348], [2.2071973468197541, 3.6256363130794291, -1.7537065168157207, 3.8879996883660244]], [[-0.65705426770820985, -2.652591828269768, -1.6453293000266225, 4.3239959951618019], [1.9308205148438651, 0.42936733861315446, -1.8949411475704148, -3.9052445445547823], [-1.9653074764310619, 1.3065145695532641, 2.022779920398051, 1.9578519544974649]]], [[[-4.9009252812083561, -1.673983949875999, -4.0002915969497996, 3.6720544384496776], [1.8132271718993875, 4.1906200461835645, 0.98186310004784172, -3.4940104551797582], [-0.77692666581590508, -0.38635260751760736, -0.13204789151814111, -3.7158396488736081]], [[3.2310824984607507, 3.6059458045056214, -2.1700913389598098, 2.9428999691177635], [1.8508993669224747, 0.64594650719020485, -2.8491048907577921, -4.9004934269826599], [-2.6915284980895002, -2.4758365900454802, -4.9475040560575509, 2.8470958621967792]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[0.048913515062112722, 4.4262611162315153, 5.6597666093068195, 5.7040098879657499], [4.7042790392291209, -3.3619431721031479, 4.8907090169115577, 0.46929557247038112], [0.10208343032444578, 0.07279711371758868, 0.59183286591791706, 1.054830562998621]], [[-3.5429449241449325, 2.1624986394239105, 5.4173381029885803, 4.2999030725350522], [-1.4725905992481279, 3.8120435780188844, -3.1186789139201485, -2.1824038640314889], [-1.5989045323364057, 2.0279595432053927, 3.6052772705432723, -2.7934879702842732]]], [[[-3.587721004602713, 0.58238646131507288, -1.1440927289298917, 1.0797646113408064], [1.557883002691014, -3.6090942054124371, 4.4698255477572175, 2.2299949545284505], [3.5650792053871712, 4.9835181716468462, -0.3958246582483036, 5.2458815469334414]], [[0.70082759085920721, -1.294709969702351, -0.28744744145920542, 5.6818778537292189], [3.2887023734112821, 1.7872491971805715, -0.53705928900299771, -2.5473626859873653], [-0.6074256178636448, 2.6643964281206811, 3.380661778965468, 3.3157338130648819]]], [[[-3.5430434226409391, -0.31610209130858191, -2.6424097383823826, 5.0299362970170947], [3.1711090304668046, 5.5485019047509816, 2.3397449586152588, -2.1361285966123411], [0.58095519275151197, 0.97152925104980969, 1.2258339670492759, -2.357957790306191]], [[4.5889643570281677, 4.9638276630730385, -0.81220948039239271, 4.3007818276851806], [3.2087812254898918, 2.0038283657576219, -1.491223032190375, -3.5426115684152428], [-1.3336466395220832, -1.1179547314780631, -3.5896221974901339, 4.2049777207641963]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_array_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array(0.615726660654)  
       res=arg0+arg1  
       s0=numpy.array([[[[-4.8126007803244608, -2.9348842058905333, -0.92542967602483817, 2.8418983754186424], [-2.2983729945787088, -1.8340536501199733, 3.3972080136011282, 0.73123971568977453], [-2.259713457182615, -4.9611825671247516, -4.1426324654590889, -0.22111627658599442]], [[-1.5656296879466138, -1.4583728451648179, 2.5423985731687697, 0.27424665522002201], [4.6219760046013096, -3.1853442358914394, -0.17941301920654684, 4.0609476039609067], [2.7745376492492868, -0.63079975878362049, -2.1917721552624281, 3.7526624922729148]]], [[[-1.1069741207335815, -2.1221802539271515, -2.1855765958140894, 4.4583877362007147], [4.7287929823047232, -2.8273539475709955, 1.041346804328434, 1.2145987547323074], [3.2474480897100761, -0.5595113492019399, -1.184273401748126, 1.5344050594613989]], [[-1.4578797658543108, 4.3514594148726449, -2.2263472932402681, 0.45375626102804389], [-0.59269235807383414, 0.32403469328417778, 1.6163451810945944, 1.4474315127672384], [-1.359787867566026, -3.7955419903023824, -0.6324592623013503, -2.9737468975138457]]], [[[3.5775115512871896, -2.0053110821796971, 1.3257545919220357, -3.2386134951920731], [-2.2691685642939188, -0.29800559776811486, 4.3408329032218358, -2.4995518853574494], [-4.6423437418828399, 0.25032728847657459, 4.8625445566526775, 1.8201436382993874]], [[-0.3460164177419669, 1.6857166890102739, 2.7574162350033067, 4.093588972288412], [0.35431080398633163, -3.2305542278629584, 0.83231834608159172, -4.8978131800926867], [0.84463065251980574, -4.1880077712769541, 2.5841244733046675, 1.7771043691166168]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-4.1968741196708272, -2.3191575452368998, -0.30970301537120459, 3.457625036072276], [-1.6826463339250752, -1.2183269894663398, 4.0129346742547618, 1.3469663763434081], [-1.6439867965289814, -4.345455906471118, -3.5269058048054553, 0.39461038406763915]], [[-0.94990302729298026, -0.84264618451118434, 3.1581252338224033, 0.88997331587365558], [5.2377026652549432, -2.5696175752378059, 0.43631364144708673, 4.6766742646145403], [3.3902643099029204, -0.015073098129986917, -1.5760454946087945, 4.3683891529265484]]], [[[-0.49124746007994791, -1.5064535932735179, -1.5698499351604558, 5.0741143968543483], [5.3445196429583568, -2.2116272869173619, 1.6570734649820675, 1.830325415385941], [3.8631747503637097, 0.056215311451693672, -0.56854674109449244, 2.1501317201150325]], [[-0.84215310520067721, 4.9671860755262784, -1.6106206325866346, 1.0694829216816775], [0.023034302579799437, 0.93976135393781135, 2.2320718417482279, 2.0631581734208719], [-0.74406120691239241, -3.1798153296487488, -0.016732601647716727, -2.3580202368602121]]], [[[4.1932382119408231, -1.3895844215260635, 1.9414812525756693, -2.6228868345384395], [-1.6534419036402852, 0.31772106288551871, 4.9565595638754694, -1.8838252247038159], [-4.0266170812292064, 0.86605394913020817, 5.4782712173063111, 2.435870298953021]], [[0.26971024291166668, 2.3014433496639075, 3.3731428956569403, 4.7093156329420456], [0.97003746463996521, -2.6148275672093249, 1.4480450067352253, -4.2820865194390532], [1.4603573131734393, -3.5722811106233205, 3.1998511339583011, 2.3928310297702504]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_array_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array([[[[3.3192654441033635, 2.2557215551546825, 1.6536287324097199, 3.7199057675632208], [1.5974953789654123, -3.1737877686498184, -1.0439229165843642, -3.4489112252457002], [2.276928621364263, 1.3843236447709275, 4.9560519020458997, 1.6262358194223783]], [[1.2744705020290112, -0.9495821744494144, 0.21201550807542358, 4.219061716159656], [-3.0371291794390434, 3.1900612030054063, 4.3599666684363694, 2.3315811611213029], [3.8133179956133425, -1.0707464480874451, -3.1964094942363284, 3.944511174054778]]], [[[-4.3684927281813994, 4.51109645840687, 2.8643103970320496, -0.18541033924523731], [-3.7851111013647332, -0.37950822841607668, -4.8963373829108416, 2.3383217545922852], [1.9663798480304795, -1.0213516987242599, 0.97306443076562132, -0.64029148294051019]], [[1.4768880463297043, 2.1804629112012544, -2.2464543239434533, 2.6067948271220427], [-0.020013878654335571, -1.9915463980416681, -4.7890791066518652, 2.1567300018235223], [2.7667117966382353, -0.98892981394876855, 3.7922800058444093, -4.7168282857597577]]], [[[0.32754549984365866, 3.5820422050540905, -3.1444530939916704, -1.8575135201598081], [4.1078596993586096, 4.805036372504162, -3.5877951265809949, -2.5614149382378661], [2.5139946881838995, -3.6490353072994797, -3.5362694242867376, 4.2190200405625795]], [[2.3279971855652279, 3.2488318086616896, 4.2103464254995497, -0.87556707332939876], [4.2175206732266819, 2.5515785264599886, -1.7077740466009228, -4.6244048684685524], [-3.5318590945822761, 1.0267849870908048, -4.5556568295185613, 2.3796610223095982]]]])  
       res=arg0+arg1  
       s0=numpy.array([[[[-1.0335787715342737, 2.6800541905454525, -0.77744008358891481, 4.5841213645835328], [-1.3091476055814311, -4.4078401913797416, -2.4147659683822753, 1.3777349045839413], [-3.8462774343417347, 4.3623789971557354, -2.6263216926669273, 4.0069980543332964]], [[4.9739761832930771, -4.8835510471110402, 0.48245415459486729, 2.0252407592213544], [0.77594725558728861, -3.6083845493555189, 1.0675752809586747, -2.5277524450707203], [0.66774429186688433, 2.1743216726489765, 2.739229976276131, -1.050202089609471]]], [[[4.0140234491217779, 2.5759989592127841, -2.1066914344516743, -0.035507828531205377], [-3.6522356559644464, 4.5463245371345415, 3.9387659469186165, 2.0068476564906188], [1.8458210458627766, 0.99033883741729412, 2.8483179615082932, -0.11053871138163807]], [[-4.8610196367129976, 0.45427505197196272, 3.536678687249319, 1.66539224103321], [-3.1938390995156754, 0.76325932276705277, 2.3164028084842272, -4.7319245882280114], [-4.6221132334975703, 3.4607500397812601, 1.7566287774348126, -3.8988792964838459]]], [[[0.22555748848336776, 2.6930012218741615, 2.4496699866442668, 1.6885381696227766], [-2.2659142924364772, 4.4297184815385311, 3.6036022613458858, -3.0446428677516311], [-0.32666960542220025, 4.6345148810384273, 3.4985187741565937, -1.9673854653112901]], [[0.23335627943826687, -1.7719377100967613, 4.1961696772103263, 3.5769096987776603], [-2.6521895170276699, 1.4815006299716993, -3.5862464398083937, 0.82583605681273653], [3.6470067953494496, 1.7515640063596614, 2.4610971347305179, -3.8643235998489667]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[2.2856866725690899, 4.935775745700135, 0.87618864882080505, 8.3040271321467536], [0.28834777338398121, -7.58162796002956, -3.4586888849666395, -2.0711763206617588], [-1.5693488129774718, 5.7467026419266629, 2.3297302093789725, 5.6332338737556746]], [[6.2484466853220884, -5.8331332215604546, 0.69446966267029087, 6.2443024753810104], [-2.2611819238517548, -0.41832334635011259, 5.4275419493950441, -0.19617128394941741], [4.4810622874802268, 1.1035752245615313, -0.4571795179601974, 2.894309084445307]]], [[[-0.35446927905962156, 7.0870954176196541, 0.75761896258037531, -0.22091816777644269], [-7.4373467573291796, 4.1668163087184649, -0.95757143599222516, 4.345169411082904], [3.8122008938932561, -0.031012861306965789, 3.8213823922739145, -0.75083019432214826]], [[-3.3841315903832934, 2.6347379631732171, 1.2902243633058657, 4.2721870681552527], [-3.2138529781700109, -1.2282870752746153, -2.472676298167638, -2.5751945864044892], [-1.855401436859335, 2.4718202258324915, 5.5489087832792219, -8.6157075822436031]]], [[[0.55310298832702642, 6.275043426928252, -0.69478310734740356, -0.1689753505370315], [1.8419454069221324, 9.2347548540426931, 0.015807134764890929, -5.6060578059894972], [2.1873250827616992, 0.98547957373894768, -0.037750650130143892, 2.2516345752512894]], [[2.5613534650034948, 1.4768940985649284, 8.406516102709876, 2.7013426254482615], [1.565331156199012, 4.0330791564316879, -5.2940204864093161, -3.7985688116558158], [0.11514770076717351, 2.7783489934504662, -2.0945596947880434, -1.4846625775393685]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_constData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(4.60654016537,self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([[[[-4.7832649025831326, -1.0051166868151373, -0.88833812252909183, -0.45058703288617696], [2.4832296654341555, -0.064506445058267303, -3.6967657010132617, 2.1342553140256264], [-4.5560600803182174, 4.0999993401985826, 2.6219477921402277, -3.2499638129374206]], [[-0.54654243693883497, -2.9705104246696501, -0.69313874112801344, 3.4807612135207258], [-4.9120659554686865, 4.6379965215299759, -0.34833036451937716, -0.62973120885612222], [-2.6571981534883249, 0.41743015940598571, -2.0773411581710874, -2.4213136432930815]]], [[[2.1473704415345116, 1.274731626946207, 2.5385060319194412, 3.2041391192517832], [4.6913376130607158, 0.41755012174724193, 1.7343625278234365, -4.1112790973001303], [-1.8232423412863819, 3.7874477039509085, -0.1600396126581769, -0.018175235382960508]], [[0.67385087114837372, 3.0116577192220095, -3.1897382698284082, 0.80752638726746895], [-2.8190796501636384, 1.6435536488006299, -3.2369670596212554, -0.082169302679377942], [4.295993082213478, 3.1267090495429155, 1.4340314723928751, 1.9145890551701195]]], [[[-3.357357387003137, 4.3809175994747598, 0.071952364210837949, 3.4373771270997171], [-2.3496392957661225, -2.4205029871927399, 4.7893944270392783, 1.0089609577053471], [-2.375681155118039, 4.0334525412936717, 2.3610131157529066, -0.49269586039389957]], [[4.9246613434461199, 2.6278196228187598, -2.4084137135617958, -3.6872217621615002], [-4.466652155837501, 4.3205338299964779, -4.7894891028755717, 4.7684437054671154], [3.994565498502725, -0.97486271432193128, -4.4985879927324293, -1.4558579414706116]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-0.17672473720993942, 3.6014234785580559, 3.7182020428441014, 4.1559531324870163], [7.0897698308073487, 4.5420337203149259, 0.90977446435993148, 6.7407954793988196], [0.05048008505497581, 8.7065395055717758, 7.2284879575134209, 1.3565763524357726]], [[4.0599977284343582, 1.6360297407035431, 3.9134014242451798, 8.087301378893919], [-0.3055257900954933, 9.2445366869031691, 4.2582098008538161, 3.976808956517071], [1.9493420118848683, 5.0239703247791789, 2.5291990072021058, 2.1852265220801117]]], [[[6.7539106069077048, 5.8812717923194002, 7.1450461972926345, 7.8106792846249764], [9.2978777784339091, 5.0240902871204351, 6.3409026931966297, 0.49526106807306292], [2.7832978240868114, 8.3939878693241017, 4.4465005527150163, 4.5883649299902327]], [[5.2803910365215669, 7.6181978845952028, 1.416801895544785, 5.4140665526406622], [1.7874605152095548, 6.2500938141738231, 1.3695731057519378, 4.5243708626938153], [8.9025332475866712, 7.7332492149161087, 6.0405716377660683, 6.5211292205433127]]], [[[1.2491827783700562, 8.987457764847953, 4.6784925295840312, 8.0439172924729103], [2.2569008696070707, 2.1860371781804533, 9.3959345924124715, 5.6155011230785403], [2.2308590102551542, 8.6399927066668649, 6.9675532811260998, 4.1138443049792937]], [[9.5312015088193132, 7.234359788191953, 2.1981264518113974, 0.919318403211693], [0.13988800953569225, 8.9270739953696712, -0.18294893750237851, 9.3749838708403086], [8.6011056638759182, 3.6316774510512619, 0.10795217264076395, 3.1506822239025816]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_constData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(numpy.array([[[[3.0276890993318055, -4.0289307058932806, 0.37751058277964678, -2.4130481758299904], [-3.5986908589236699, 4.2573785532393256, 2.849994872569642, -4.4412165779669976], [2.2287999678220141, 1.0183949127036325, 2.1860720382772634, -3.3965479046633629]], [[-4.8330988466444156, -2.8301424015378696, 0.62239138949711315, 1.3341468617071763], [1.1349876725006247, 2.1720529230295726, -4.8321351429916906, -2.4121278777986244], [-4.8208023391170416, -1.5238362494308233, 0.31299962740445775, -4.3233734715680692]]], [[[1.016819491976455, -4.1821745489341042, 4.0337170857897213, 2.5210301241631026], [-4.4822139917461676, 2.8910982883014409, 3.7588219186894865, 0.75439045998426746], [1.0081510987966125, -2.9151249627566767, 0.1669461792176774, -2.5468666154006456]], [[0.46589776420794404, 1.8226506576873502, -4.2807125405352009, -3.0184369151228752], [0.72918875948350603, 3.9963215934653267, 1.3378220113520474, -0.33711198992638547], [-2.4053811055493677, -3.485709462196982, -0.26360829568298527, -2.8524770041926271]]], [[[-2.7867190692962041, 3.4677408485750476, 3.6897607961788701, 1.1478044763877211], [-3.6984543041779938, -2.2365315919825726, 1.4973203416733183, 0.73126622324352208], [0.93685994218025481, -3.6746722093385467, 1.9972559082400023, 3.2980216152227584]], [[0.11343969921176367, 0.8915984830202115, -4.1198830130361586, -3.5145449124733883], [-4.2536275616585542, -4.5316778832993823, -3.6681871741922381, 4.7084522285564301], [-2.2800093560768886, -1.4234323250495349, 1.0437945603684193, 0.55552990046613715]]]]),self.functionspace)  
       res=arg0+arg1  
       s0=numpy.array([[[[1.1332705014785391, -4.4801896725083328, -1.5624626187109691, -0.73799640733102478], [3.7789876618079461, -3.1459504845756658, -0.75616637845942769, -1.9668589808538064], [-0.75710800287357305, 0.36826792393736429, 0.92265791598753388, -2.7466847711445985]], [[-2.8828198612019831, -0.40554631597577995, 4.4574209012215888, -0.63773275633824955], [-2.8249748839596087, 2.4432190676325796, 2.983416134388758, 2.9400606182547282], [-4.4028402286328188, 1.7495278427182823, -4.9343223510471192, -3.5407414072060464]]], [[[-2.4131832622162772, 2.5637787989355605, -3.5679863968478784, 1.7753536354448975], [0.19962718174264538, 3.6111218151302342, 1.0358829070403042, -0.39962467232709287], [2.5921951771402476, 0.46840934421116387, -1.1027103494484636, 1.9437436274120925]], [[-3.9808918117810501, -4.2978172999473543, 0.33473431332314707, 0.73710075596821856], [-2.8664111199651607, -0.0046439327608815972, -2.4859776083679783, -3.8188440102129517], [3.3380471156742466, -2.5477030338439866, 2.2212671852424268, -0.73928108715717844]]], [[[4.2027485462951049, 2.8359260719530157, -4.8152919155055702, 3.2208253994991534], [2.1472449020590627, 0.41025017851904089, 0.076370567548705637, 2.5359461868381619], [2.7458019201982973, -0.081378423989436399, -1.4069732069142562, -0.70154386054503703]], [[1.9967953814284636, 3.0099239348666949, 4.4062374101097195, 2.5976315690157668], [1.1374894329012939, -3.1743448364901261, 1.6226949029325493, -3.3744785081702879], [2.2285441988579047, 1.370222140381415, 3.5669822253407979, 1.8988092120490352]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[4.1609596008103447, -8.5091203784016134, -1.1849520359313224, -3.1510445831610152], [0.18029680288427619, 1.1114280686636597, 2.0938284941102143, -6.408075558820804], [1.471691964948441, 1.3866628366409968, 3.1087299542647973, -6.1432326758079618]], [[-7.7159187078463987, -3.2356887175136495, 5.079812290718702, 0.69641410536892678], [-1.689987211458984, 4.6152719906621522, -1.8487190086029326, 0.52793274045610383], [-9.2236425677498595, 0.22569159328745902, -4.6213227236426615, -7.8641148787741155]]], [[[-1.3963637702398222, -1.6183957499985437, 0.46573068894184289, 4.2963837596080001], [-4.2825868100035223, 6.5022201034316751, 4.7947048257297906, 0.35476578765717459], [3.6003462759368601, -2.4467156185455128, -0.93576417023078617, -0.60312298798855313]], [[-3.5149940475731061, -2.475166642260004, -3.9459782272120538, -2.2813361591546566], [-2.1372223604816547, 3.9916776607044451, -1.148155597015931, -4.1559560001393372], [0.93266601012487893, -6.0334124960409685, 1.9576588895594416, -3.5917580913498055]]], [[[1.4160294769989008, 6.3036669205280633, -1.1255311193267001, 4.3686298758868745], [-1.5512094021189311, -1.8262814134635317, 1.5736909092220239, 3.2672124100816839], [3.6826618623785521, -3.7560506333279831, 0.59028270132574612, 2.5964777546777214]], [[2.1102350806402272, 3.9015224178869063, 0.28635439707356092, -0.91691334345762154], [-3.1161381287572603, -7.7060227197895088, -2.0454922712596888, 1.3339737203861421], [-0.051465157218983926, -0.053210184668119886, 4.6107767857092172, 2.4543391125151723]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_expandedData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-2.23423123409)+(1.-msk_arg1)*(-0.730514223866)  
       res=arg0+arg1  
       s0=numpy.array([[[[4.4777751797081518, 4.9945263970167613, 3.1492991659280705, 0.95371295363007746], [-3.2257449044959752, 0.95276808177609507, 1.2816620936622254, 0.88387337390145237], [3.0068252595219302, -0.58037978046552041, -1.0301072934890798, 3.5755713936384055]], [[-2.2870099310177716, -3.1073344623567967, 4.8915881427344896, 4.731248898269925], [-4.4125258703492651, 0.25450628882682302, -2.887414401044337, 0.44453607560979158], [2.0710834295236911, -0.8253584292698557, 4.9593838063319726, 1.5010147704217154]]], [[[-4.8665013891967259, -2.7081818841553726, -4.9860178288018089, 2.9354089451116225], [-2.3253925754010596, 1.5411613235981259, -2.1939011336830916, 1.6056385831949305], [0.42131373794667581, -1.6031275913650225, -3.15697778937303, 0.16973511395614427]], [[2.3194148724676253, -2.4380381335238379, 1.2616686414206457, -4.2765878995807185], [4.6714795200390178, -4.2306896525687057, 0.31836021924240931, 2.3327012777971827], [-0.51581127714613118, 4.5059730940148448, 0.68491081387923369, -1.9245398364613497]]], [[[2.2247026107752275, 0.31611648852926333, -0.4632631502400919, 0.63318978704669604], [1.2143912654459079, 4.3374905906683168, 3.1298343116414422, 2.8362846188228179], [0.26105525146082087, -3.3123352620188165, -3.6421458240666404, -1.8114525908064771]], [[4.5144769841056824, 2.927176277536935, 1.2844165018326281, -4.6253655560184779], [3.972315177727312, 2.9344921242396786, 1.9999726033879961, -1.2377996893129328], [4.0397935121486395, 4.3244878555666162, -4.8045328817923671, -2.6331651433804093]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[2.243543945621735, 2.7602951629303445, 0.91506793184165369, -1.2805182804563393], [-5.4599761385823919, -1.2814631523103217, -0.95256914042419139, -1.3503578601849644], [0.77259402543551348, -2.8146110145519372, -3.2643385275754966, 1.3413401595519887]], [[-4.5212411651041879, -5.3415656964432134, 2.6573569086480728, 2.4970176641835082], [-6.6467571044356824, -1.9797249452595937, -5.1216456351307542, -1.7896951584766252], [-0.16314780456272571, -3.0595896633562725, 2.7251525722455558, -0.73321646366470139]]], [[[-7.1007326232831431, -4.9424131182417899, -7.2202490628882252, 0.70117771102520576], [-4.5596238094874764, -0.69306991048829092, -4.4281323677695088, -0.6285926508914863], [-1.812917496139741, -3.8373588254514392, -5.3912090234594467, -2.0644961201302725]], [[0.085183638381208571, -4.6722693676102551, -0.97256259266577105, -6.5108191336671357], [2.437248285952601, -6.464920886655122, -1.9158710148440075, 0.098470043710765953], [-2.7500425112325479, 2.271741859928428, -1.5493204202071831, -4.1587710705477665]]], [[[-0.0095286233111893104, -1.9181147455571534, -2.6974943843265087, -1.6010414470397207], [-1.0198399686405089, 2.1032593565819, 0.89560307755502544, 0.60205338473640113], [-1.9731759826255959, -5.5465664961052337, -5.8763770581530572, -4.0456838248928939]], [[2.2802457500192657, 0.69294504345051822, -0.94981473225378865, -6.8595967901048951], [1.7380839436408952, 0.70026089015326187, -0.23425863069842068, -3.4720309233993496], [1.8055622780622227, 2.0902566214801994, -7.0387641158787844, -4.8673963774668261]]]])+(1.-msk_ref)*numpy.array([[[[3.7472609558421226, 4.2640121731507321, 2.4187849420620413, 0.22319872976404831], [-3.9562591283620043, 0.22225385791006591, 0.55114786979619623, 0.15335915003542322], [2.2763110356559011, -1.3108940043315496, -1.760621517355109, 2.8450571697723763]], [[-3.0175241548838008, -3.8378486862228258, 4.1610739188684605, 4.0007346744038959], [-5.1430400942152943, -0.47600793503920613, -3.6179286249103662, -0.28597814825623757], [1.3405692056576619, -1.5558726531358849, 4.2288695824659435, 0.77050054655568623]]], [[[-5.5970156130627551, -3.4386961080214018, -5.716532052667838, 2.2048947212455934], [-3.0559067992670887, 0.8106470997320967, -2.9244153575491207, 0.87512435932890131], [-0.30920048591935334, -2.3336418152310516, -3.8874920132390591, -0.56077910990988489]], [[1.5889006486015962, -3.1685523573898671, 0.53115441755461656, -5.0071021234467477], [3.9409652961729886, -4.9612038764347348, -0.41215400462361984, 1.6021870539311536], [-1.2463255010121603, 3.7754588701488156, -0.045603409986795462, -2.6550540603273789]]], [[[1.4941883869091983, -0.41439773533676583, -1.1937773741061211, -0.097324436819333116], [0.48387704157987876, 3.6069763668022876, 2.3993200877754131, 2.1057703949567887], [-0.46945897240520829, -4.0428494858848456, -4.3726600479326692, -2.5419668146725063]], [[3.7839627602396533, 2.1966620536709058, 0.55390227796659897, -5.355879779884507], [3.2418009538612829, 2.2039779003736495, 1.2694583795219669, -1.968313913178962], [3.3092792882826103, 3.593973631700587, -5.5350471056583963, -3.3636793672464385]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_expandedData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[3.0505941343413294, 2.2245596021330822, 0.99842273895235145, -3.601459340240325], [1.2042934362079869, 2.4289855243844318, 1.0920731367312602, -2.5789880170019543], [1.4082503883786321, -0.19024198986856433, -3.3985940893960001, 2.2953743799574742]], [[1.392609367831831, -1.7538170423994814, 1.3041982302240704, 3.7959995515535425], [3.1925155862255785, -1.1409171498872297, -0.18921509618064114, -3.5569343492254557], [1.5760580738819403, -3.8635867328959437, -4.1894095750020908, 1.7403206046701234]]], [[[2.7224613670569875, -4.0140540403979861, 4.1165753114212578, 0.44556647044804887], [2.8501453321678039, 1.8824124011276613, 0.56779148184813355, 2.3692960044663387], [-1.4235763001902004, 1.2556443008072895, 4.2960131891121129, -0.20758363141812541]], [[-3.6404744311889168, 0.78514815504276925, 0.55935851544178661, -0.32495585994851606], [-2.3196336112694507, -2.6761704402832533, -2.7458758858025787, 0.54602049195450952], [0.77507448509764298, -1.6241609403273172, -1.470533715227341, 1.9052130245286847]]], [[[-4.3145803111752699, -0.34714075441026804, -4.0056283767533021, 2.3264435503636172], [2.0500300405329845, 0.14522290398086923, -2.5137994802829033, 3.467684916297971], [-2.4015116138900949, -4.8698405030069427, -0.39550753951988238, -3.6515819789381796]], [[2.3961323074070684, 1.894782611565172, 4.8745853071872052, -1.1712864418746403], [0.37487866620152488, 3.9802864161515075, 3.6597890330481491, -1.2282358867012166], [-4.9916679793043901, 1.2026939059342698, 0.49067863771026055, -2.0350435589058478]]]])+(1.-msk_arg1)*numpy.array([[[[-2.2428299162720355, 4.7966690839274655, 1.8504070850034493, -2.7989471778202155], [1.1582363778402129, -1.9152919071633692, -1.0741689502983398, -2.625242988754164], [0.58220548653756143, 1.0724164974952677, 1.4366663994929931, 0.27393683528283841]], [[2.3385118965961693, 4.9758600548198668, -2.7926916323047521, -3.2572230812951886], [-2.6687006212496502, 1.0467714615121047, -1.132817137746879, -1.2926047786599182], [-0.56704134509404369, -1.2402872003787104, -2.2338029711164333, 1.4040087682835054]]], [[[-3.1453771265197563, 3.2663354698226676, 4.8864878263687679, 4.1016937829863096], [-1.7130962721913656, -3.5143782196368112, 0.0037187034176007217, -4.5781472721151673], [0.79631519765010772, -0.66283850051615101, 1.8230396044445785, 1.6168452352538543]], [[0.44399766981681932, -1.2137806040530319, 0.53217062031792128, -3.3207434798823665], [3.3589689824880189, 4.8402267877427292, 4.8620014097924305, 1.9860458917145953], [-0.68326459860214772, -4.3177193184855431, 3.4580661011282405, 3.4718791491616017]]], [[[4.9273412715032414, 3.4024716661259937, 3.1770574376204355, 1.8761231733552268], [-0.30435056089577639, 4.6581047689319632, 3.6613566624807241, -1.2600377416637318], [-2.1935915205047216, 2.5344742369103628, 3.5081785253257181, 4.2322191219721272]], [[-1.1471313578317774, -4.9060041038448468, 2.1365079555363415, -3.1530665111970526], [2.9534994569903112, 1.460467113402113, 4.5275404277763123, 0.96937150524087556], [-3.454965682154004, 0.035072642713447344, 4.6623086696213569, -1.6342710480697042]]]])  
       res=arg0+arg1  
       s0=numpy.array([[[[4.3845389267067674, 4.9001178614932783, -2.6558999176541107, 3.2103116651114956], [-1.1493426889429283, 0.96878107366162514, -3.983430971047921, -4.5279067140168632], [-1.325265195352797, -0.64909089860851221, 2.4758598568921162, 0.11118648089424976]], [[0.57763640769812774, 4.4272673775902476, -1.9408079631450113, -1.1087411169229533], [4.7604648578669799, 0.96293172667600757, 1.1206937613262618, 4.6672733542592599], [-4.8476935089503854, -0.28759110856377212, 1.2561470565198896, -0.69662678033230918]]], [[[2.6140586732212689, 1.7390964028694711, 2.7452023010018802, -2.0643626144974627], [2.6044491178724574, 2.755367279306089, -0.40674178278253414, 0.8199301181627261], [4.6383912041875526, 1.4628483915214021, 1.3613291325230144, 1.8066125789932723]], [[-2.461415921309503, -0.6229188085894668, 2.4130661115304033, 2.1585966049586682], [2.325469442720002, -0.81198295800812126, 3.8997099464025826, -0.42922732811229558], [-2.2083711708221951, -0.069741967011855976, 3.1130593755831555, -2.3361102661885935]]], [[[-3.5723389710115661, -0.22222713274362871, 4.9328217054503458, -4.351377179387816], [1.8350985229214754, -2.2179974395186628, -3.867073810076934, -1.6978603676026047], [-1.0310425604087516, -3.1823494393898311, -3.2146052974324633, 2.6890409639742296]], [[-0.8646373963085523, -3.1848115372485442, -4.8311924361409817, -2.1990781626888243], [2.0896905336715008, 1.6311768727685791, -3.8928844113899528, 1.9639917187852509], [-0.26311697353810004, -0.94590247438067454, 1.8179287475150785, -3.774562724473701]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[7.4351330610480968, 7.1246774636263606, -1.6574771787017593, -0.39114767512882942], [0.054950747265058553, 3.397766598046057, -2.8913578343166608, -7.1068947310188175], [0.08298519302583518, -0.83933288847707654, -0.92273423250388387, 2.4065608608517239]], [[1.9702457755299587, 2.6734503351907661, -0.63660973292094081, 2.6872584346305892], [7.9529804440925584, -0.17798542321122213, 0.93147866514562061, 1.1103390050338042], [-3.2716354350684451, -4.1511778414597158, -2.9332625184822012, 1.0436938243378142]]], [[[5.3365200402782564, -2.274957637528515, 6.861777612423138, -1.6187961440494139], [5.4545944500402612, 4.6377796804337503, 0.16104969906559941, 3.1892261226290648], [3.2148149039973521, 2.7184926923286916, 5.6573423216351273, 1.5990289475751469]], [[-6.1018903524984198, 0.16222934645330245, 2.9724246269721899, 1.8336407450101522], [0.005835831450551332, -3.4881533982913746, 1.1538340606000039, 0.11679316384221394], [-1.4332966857245522, -1.6939029073391731, 1.6425256603558145, -0.43089724165990884]]], [[[-7.8869192821868364, -0.56936788715389675, 0.92719332869704374, -2.0249336290241988], [3.8851285634544599, -2.0727745355377936, -6.3808732903598369, 1.7698245486953663], [-3.4325541742988466, -8.0521899423967742, -3.6101128369523456, -0.96254101496394995]], [[1.5314949110985161, -1.2900289256833721, 0.043392871046223469, -3.3703646045634645], [2.4645691998730257, 5.6114632889200866, -0.23309537834180372, 0.73575583208403428], [-5.2547849528424901, 0.2567914315535953, 2.308607385225339, -5.8096062833795488]]]])+(1.-msk_ref)*numpy.array([[[[2.1417090104347318, 9.6967869454207438, -0.80549283265066141, 0.41136448729128006], [0.0088936888972845907, -0.94651083350174403, -5.0575999213462612, -7.1531497027710271], [-0.74305970881523553, 0.42332559888675547, 3.9125262563851093, 0.38512331617708817]], [[2.9161483042942971, 9.4031274324101144, -4.7334995954497634, -4.3659641982181423], [2.0917642366173297, 2.0097031881881122, -0.012123376420617227, 3.3746685755993417], [-5.4147348540444291, -1.5278783089424826, -0.97765591459654377, 0.70738198795119622]]], [[[-0.53131845329848737, 5.0054318726921387, 7.6316901273706481, 2.0373311684888469], [0.89135284568109174, -0.75901094033072214, -0.40302307936493342, -3.7582171539524412], [5.4347064018376603, 0.80000989100525111, 3.1843687369675928, 3.4234578142471266]], [[-2.0174182514926837, -1.8366994126424987, 2.9452367318483246, -1.1621468749236983], [5.6844384252080209, 4.0282438297346079, 8.7617113561950131, 1.5568185636022998], [-2.8916357694243429, -4.3874612854973991, 6.571125476711396, 1.1357688829730082]]], [[[1.3550023004916754, 3.180244533382365, 8.1098791430707813, -2.4752540060325892], [1.530747962025699, 2.4401073294133004, -0.20571714759620985, -2.9578981092663366], [-3.2246340809134733, -0.64787520247946828, 0.2935732278932548, 6.9212600859463569]], [[-2.0117687541403297, -8.0908156410933909, -2.6946844806046402, -5.3521446738858769], [5.0431899906618121, 3.0916439861706921, 0.63465601638635949, 2.9333632240261265], [-3.7180826556921041, -0.9108298316672272, 6.4802374171364354, -5.4088337725434048]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_Symbol_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=())  
       res=arg0+arg1  
       s0=numpy.array([[[[-3.2716552565599564, -3.5102993711083719, 1.7116282787938566, -1.0403240581554174], [2.9516399800924473, 0.43426401327611241, 0.25731520992048562, 3.7241268090912243], [-0.69153873604097438, 2.8199673019746534, -0.63536814056161095, 2.4658952784973085]], [[-2.3004520683616003, 1.1268663338511686, -2.0555486474954519, -4.6531683372501877], [-2.830291619495009, -2.575044817002766, -4.8097373849079261, -1.2373277153183873], [-1.1534801281425167, -3.2841555164681715, 4.7371221495542688, -4.6310306501314678]]], [[[-2.0206648466128496, -4.4954168974071926, -4.6616247782961784, -0.6037934691531035], [4.4696173236475421, 4.0688037246552309, 1.80893485747381, 4.6390272723171861], [2.3304873417635594, -2.1150875075189091, 3.7812790086916142, -4.8524319455837421]], [[0.25863913104904324, 2.0652726468231188, 1.4276914723195056, -1.9738241710952806], [-2.66126177367914, -3.3139337176967354, -4.3702723540958601, -0.023897587903921824], [4.4601598312124118, -4.2591584265922453, -1.6923608128798104, 1.7704587046644935]]], [[[0.62060650673467688, 0.62814180533328923, -1.7306135909846301, -1.4894628881598448], [-0.17887041275250226, 4.5301214920945156, -4.6699453885008015, -1.1565980278422829], [1.4127741575749653, 1.7664574023547637, 4.1052341526412377, -2.5573043451787658]], [[0.54107905211328688, -2.4268726795687567, 3.4426762192989777, 3.8586227157701884], [4.4955459782727907, -0.2909894731791498, -0.48492322164034452, -4.5456041367103346], [-0.63209305275614192, 0.92687342697256625, 1.0193711358982869, -3.9237065489035849]]]])  
       s1=numpy.array(2.29966074182)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-0.97199451473693887, -1.2106386292853544, 4.0112890206168741, 1.2593366836676001], [5.2513007219154648, 2.7339247550991299, 2.5569759517435031, 6.0237875509142418], [1.6081220057820431, 5.1196280437976709, 1.6642926012614065, 4.765556020320326]], [[-0.00079132653858282609, 3.4265270756741861, 0.24411209432756564, -2.3535075954271703], [-0.53063087767199146, -0.2753840751797485, -2.5100766430849086, 1.0623330265046302], [1.1461806136805008, -0.984494774645154, 7.0367828913772863, -2.3313699083084503]]], [[[0.27899589521016788, -2.1957561555841751, -2.3619640364731609, 1.695867272669914], [6.7692780654705595, 6.3684644664782484, 4.1085955992968275, 6.9386880141402036], [4.6301480835865769, 0.18457323430410844, 6.0809397505146316, -2.5527712037607246]], [[2.5582998728720607, 4.3649333886461363, 3.727352214142523, 0.32583657072773686], [-0.36160103185612247, -1.0142729758737179, -2.0706116122728426, 2.2757631539190957], [6.7598205730354293, -1.9594976847692278, 0.60729992894320706, 4.070119446487511]]], [[[2.9202672485576944, 2.9278025471563067, 0.56904715083838742, 0.81019785366317265], [2.1207903290705152, 6.8297822339175331, -2.370284646677784, 1.1430627139807346], [3.7124348993979828, 4.0661181441777812, 6.4048948944642552, -0.25764360335574832]], [[2.8407397939363044, -0.12721193774573925, 5.7423369611219952, 6.1582834575932059], [6.7952067200958082, 2.0086712686438677, 1.814737520182673, -2.2459433948873171], [1.6675676890668756, 3.2265341687955837, 3.3190318777213044, -1.6240458070805674]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_overloaded_Symbol_rank4_Symbol_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0+arg1  
       s0=numpy.array([[[[-4.4335925702372228, -4.5284526367263851, -2.4619887830414511, -0.1310394278319631], [-0.26969677607900255, 4.3485052103492841, 1.7956664332877628, 3.6499797697159551], [2.1181148817889017, -4.3161233286172971, 3.0242974023555789, 0.73077347132615422]], [[-2.3940238551311865, -2.0471320401109692, -4.8955612770989561, 3.5313128152795095], [-3.2559752826375954, -1.4206425041137694, -1.6905605171386586, -2.9363559101475478], [-4.5841961137948042, 4.7241246381118636, -2.8834736261489127, 4.7833432643169917]]], [[[1.2603033333459601, 4.599863742482901, -3.9107599352759248, -2.2317808046407359], [4.5919823301556448, 2.7957458519939058, -1.8995657643104549, 1.612700004992095], [-3.7820099172597277, -1.4750968577056769, 4.9847543804964918, -1.4443468332141607]], [[-0.46385333093475811, -3.7760225411540338, 2.9354750365768059, -2.2798431262170347], [3.2423043579230164, 3.5003189339870779, 0.76506717827583692, 1.621964084047546], [3.2641815856974414, 1.9385341775692853, -2.8155267886247093, 1.2995955537813497]]], [[[-2.802111310476918, -3.6140616721474461, -4.3684312351880807, 4.9347772822894154], [3.1204772652442418, -3.2992497455563408, -4.348262630851508, 0.20869763728013169], [-1.3752311087638058, 1.3136120062499828, 3.7712675286730679, -0.99838654363843915]], [[-0.59924658619742477, -3.0882109455615914, 0.91622937768305945, 2.7935910938223696], [-3.5451838946364811, 3.4487046227058098, -4.6063585349409095, 1.1972272512808599], [-2.1161486620126349, -4.0808665957595824, 3.9495937893459594, -4.3870558672378088]]]])  
       s1=numpy.array([[[[4.1206089345315426, -3.8818433499378036, -1.0272928761740054, 2.1717302266542626], [4.720432588957431, -1.5496356970786329, -2.0764007285423713, -2.6677595957343669], [-1.9897984704794203, 3.1891727773186815, -4.3795148361531675, -2.3426974136782364]], [[-4.0919207845268399, 0.013453712188312927, 1.8580772712719771, 4.6522939747523147], [4.9456094954268401, 0.040859812386992544, 3.6968197747312814, -4.4578384801327076], [-1.9724913673571551, 3.2669723581893244, -3.8077783910662557, 2.2527201664662027]]], [[[-4.2978798347075386, -1.9940665684913608, 1.9023489045843274, -2.0066179363231971], [-2.7623708487391196, 1.0492945859478873, -2.3133602096177572, -1.1673937119948219], [1.032483616004475, -3.5010242328448751, 4.9030987105293793, 4.878413368891902]], [[-3.808875729879091, 1.2945781054838434, -4.6138792560582109, -1.4468036300616016], [3.6197015111762383, -1.9854927654751311, -4.7788350084896623, 4.7751471783861206], [0.51474202179868644, 4.0625168198322914, -4.5021377290889655, 1.3695019544131135]]], [[[3.1920667713167035, 4.7124749801725532, -0.07813242532813458, 2.1666261823486099], [1.1961339277593446, 0.08283741356871932, 2.7434310546613734, 4.2440553795787377], [4.7882770717302368, -2.9531307678127918, -0.70397045796401247, 2.0303813956091341]], [[3.6818839091623285, -1.0829026481569057, -0.78703989637376992, -2.672970101212834], [4.6373737201615413, -1.2619301107783598, -0.86806713692204696, -0.72989575263374462], [1.7068769125091796, 3.8073072828165522, 2.0006887837022989, 3.4738854610029097]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-0.31298363570568011, -8.4102959866641882, -3.4892816592154565, 2.0406907988222995], [4.4507358128784285, 2.7988695132706511, -0.28073429525460858, 0.98222017398158812], [0.12831641130948146, -1.1269505512986155, -1.3552174337975886, -1.6119239423520821]], [[-6.485944639658026, -2.0336783279226562, -3.037484005826979, 8.1836067900318241], [1.6896342127892447, -1.3797826917267768, 2.0062592575926228, -7.3941943902802549], [-6.5566874811519593, 7.991096996301188, -6.6912520172151684, 7.0360634307831944]]], [[[-3.0375765013615785, 2.6057971739915402, -2.0084110306915974, -4.238398740963933], [1.8296114814165252, 3.8450404379417931, -4.2129259739282121, 0.44530629299727309], [-2.7495263012552527, -4.976121090550552, 9.8878530910258711, 3.4340665356777413]], [[-4.2727290608138491, -2.4814444356701904, -1.6784042194814051, -3.7266467562786363], [6.8620058690992547, 1.5148261685119468, -4.0137678302138253, 6.3971112624336666], [3.7789236074961279, 6.0010509974015767, -7.3176645177136752, 2.6690975081944632]]], [[[0.38995546083978549, 1.0984133080251071, -4.4465636605162153, 7.1014034646380253], [4.3166111930035864, -3.2164123319876214, -1.6048315761901346, 4.4527530168588694], [3.4130459629664309, -1.6395187615628091, 3.0672970707090554, 1.031994851970695]], [[3.0826373229649038, -4.1711135937184967, 0.12918948130928953, 0.12062099260953563], [1.0921898255250602, 2.18677451192745, -5.4744256718629565, 0.46733149864711532], [-0.40927174950345524, -0.27355931294303026, 5.9502825730482583, -0.91317040623489909]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
965     def test_sub_overloaded_float_rank0_constData_rank0(self):     def test_sub_overloaded_float_rank0_constData_rank0(self):
966        arg0=2.90218798914        arg0=2.90218798914
967        arg1=Data(1.45689271181,self.functionspace)        arg1=Data(1.45689271181,self.functionspace)
# Line 1728  class Test_util_overloaded_binary_no_tag Line 1062  class Test_util_overloaded_binary_no_tag
1062        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1063        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1064     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_sub_overloaded_float_rank0_Symbol_rank0(self):  
       arg0=-1.5893955767  
       arg1=Symbol(shape=())  
       res=arg0-arg1  
       s1=numpy.array(-2.81858784555)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array(1.22919226886)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_float_rank0_Symbol_rank1(self):  
       arg0=4.06919898037  
       arg1=Symbol(shape=(2,))  
       res=arg0-arg1  
       s1=numpy.array([1.1295678493802139, 3.540162663893403])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([2.9396311309861023, 0.52903631647291327])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_float_rank0_Symbol_rank2(self):  
       arg0=-3.66209318891  
       arg1=Symbol(shape=(4, 5))  
       res=arg0-arg1  
       s1=numpy.array([[4.1431261374590367, -1.9889986605407683, -1.4072714033091094, 3.4466389678830822, -4.9034526887646601], [-4.1121088281579921, -0.97348988022853256, -0.52711515843610535, -4.9083450599761704, 4.7327764652937905], [-2.7485771223451128, -0.5751318318819596, -4.5764336159654118, 2.0765382673510855, -2.2788264081064211], [-1.9348967454894161, 0.51273876900863335, -4.0440823895521678, -4.9331368450175823, -4.1140754709382357]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[-7.805219326365382, -1.6730945283655774, -2.2548217855972363, -7.1087321567894275, 1.2413594998583144], [0.45001563925164634, -2.6886033086778132, -3.1349780304702404, 1.2462518710698247, -8.3948696542001358], [-0.91351606656123296, -3.0869613570243861, 0.91434042705906604, -5.7386314562574317, -1.3832667807999246], [-1.7271964434169296, -4.1748319579149786, 0.38198920064582209, 1.2710436561112366, 0.45198228203188995]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_float_rank0_Symbol_rank3(self):  
       arg0=2.16330917853  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0-arg1  
       s1=numpy.array([[[1.2714880369365646, -3.4635944112979997], [-1.4825148313791403, 2.2208516288167859]], [[1.0565746999278218, 1.0173284212429801], [3.2273543570774663, 1.5037695453202922]], [[1.6910222381937148, 3.4347426794808857], [2.1891584404627675, 4.1957479115864658]], [[-3.5889839086675068, -3.9977559085109671], [-4.5182214217130889, -1.1449519926984451]], [[1.1135096046285167, -4.6477429511304287], [3.5195335892945607, -1.0359106296991962]], [[-1.0005487624552831, -1.2674230767665207], [0.96365581882861573, 2.3919436630626709]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[0.89182114159745485, 5.6269035898320192], [3.6458240099131598, -0.057542450282766389]], [[1.1067344786061977, 1.1459807572910394], [-1.0640451785434468, 0.65953963321372733]], [[0.47228694034030472, -1.2714335009468662], [-0.025849261928748035, -2.0324387330524463]], [[5.7522930872015259, 6.161065087044987], [6.6815306002471084, 3.3082611712324645]], [[1.0497995739055028, 6.8110521296644482], [-1.3562244107605412, 3.1992198082332157]], [[3.1638579409893026, 3.4307322553005402], [1.1996533597054038, -0.22863448452865143]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_float_rank0_Symbol_rank4(self):  
       arg0=2.91255534815  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0-arg1  
       s1=numpy.array([[[[4.5231747000441942, -3.3458041624889612, 3.3971378055566532, 4.2241195734747787], [-4.8903188307167724, -3.8550887801433853, -1.0531150928094002, -0.38381751969359179], [2.1983896238125915, -4.7744004045045338, 3.9897441588065323, 0.59403291183395268]], [[-0.41348400594173196, 2.0480635598121797, 3.3395694799068991, -0.52018028150765616], [-4.0107062955356279, 1.5415356534449431, -3.8728975600206619, -1.3227084132489253], [-2.7307431884593028, 4.4356449942981584, -1.924875067587478, -4.9199964083332981]]], [[[2.2154550964429252, 3.4144423540319053, 3.5472921001807602, 2.8568687972972846], [-4.5543020406697243, 4.9100313653985346, 1.1866210543912032, 1.387771228562384], [0.66514193822759182, -2.9716907833556769, -1.2195488224662601, 1.0843515670971149]], [[2.3392352087661097, 0.46846532304778332, -2.5634196359658312, -0.77504108276579053], [-4.6687448304641235, 3.1798196092627968, -4.3025419405516976, 4.6043047076997876], [1.7967741370566594, 3.6148031378035039, 4.6412327645707059, 2.8005462435014774]]], [[[-2.100306340356827, 4.2869078680122268, -4.1798549897445989, 3.8451369929571033], [-2.464191216575744, 4.0513066074653654, 4.6924030380563515, -4.9628060079510226], [-1.0751292629650875, -3.6260572232153776, -2.4963740277878612, -4.2025884804963596]], [[1.8483046185232244, -3.1283428552289139, 2.9260194636433878, 0.60960513887129952], [1.0253959266817976, 3.5870329328667889, 3.104325486136899, 3.7508398019224032], [0.41887938629299093, 4.1829548222992692, 4.9615800696424444, -4.2253983466409739]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-1.6106193518963492, 6.2583595106368062, -0.48458245740880823, -1.3115642253269337], [7.8028741788646174, 6.7676441282912307, 3.9656704409572452, 3.2963728678414368], [0.71416572433525349, 7.6869557526523788, -1.0771888106586873, 2.3185224363138923]], [[3.326039354089577, 0.86449178833566531, -0.42701413175905412, 3.4327356296555012], [6.9232616436834729, 1.3710196947029019, 6.7854529081685069, 4.2352637613967703], [5.6432985366071478, -1.5230896461503134, 4.837430415735323, 7.8325517564811431]]], [[[0.69710025170491985, -0.50188700588406032, -0.63473675203291524, 0.055686550850560401], [7.4668573888175693, -1.9974760172506896, 1.7259342937566418, 1.524784119585461], [2.2474134099202532, 5.8842461315035219, 4.1321041706141051, 1.8282037810507301]], [[0.57332013938173532, 2.4440900251000617, 5.4759749841136767, 3.6875964309136355], [7.5813001786119685, -0.26726426111495183, 7.2150972886995426, -1.6917493595519426], [1.1157812110911856, -0.70224778965565893, -1.7286774164228609, 0.1120091046463676]]], [[[5.012861688504672, -1.3743525198643818, 7.0924103378924439, -0.93258164480925831], [5.3767465647235895, -1.1387512593175204, -1.7798476899085065, 7.8753613560988676], [3.9876846111129325, 6.5386125713632222, 5.4089293759357062, 7.1151438286442046]], [[1.0642507296246206, 6.0408982033767593, -0.013464115495542828, 2.3029502092765455], [1.8871594214660474, -0.67447758471894392, -0.19177013798905396, -0.83828445377455818], [2.4936759618548541, -1.2703994741514242, -2.0490247214945994, 7.1379536947888189]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1065     def test_sub_overloaded_constData_rank0_float_rank0(self):     def test_sub_overloaded_constData_rank0_float_rank0(self):
1066        arg0=Data(-1.71503107185,self.functionspace)        arg0=Data(-1.71503107185,self.functionspace)
1067        arg1=1.12087823217        arg1=1.12087823217
# Line 2702  class Test_util_overloaded_binary_no_tag Line 1981  class Test_util_overloaded_binary_no_tag
1981        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1982        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1983     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_sub_overloaded_Symbol_rank0_float_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=4.96922171066  
       res=arg0-arg1  
       s0=numpy.array(2.76984089894)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(-2.19938081171)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_array_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array(3.15072614596)  
       res=arg0-arg1  
       s0=numpy.array(-4.77789386155)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(-7.92862000751)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_array_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([-3.4440198117774368, -3.875248635726801])  
       res=arg0-arg1  
       s0=numpy.array(2.01750127854)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([5.4615210903131537, 5.8927499142625175])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_array_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[0.38917088357415963, 2.7015838970063051, 4.7768720903316346, -3.1144179674864549, -3.9162272501791828], [-3.2969124717681586, 1.9926718479067942, 4.0421445252584824, 4.021134075780509, 2.4592699017088426], [1.3047539940768269, -4.4996171127478295, 3.8232121399394607, 0.79521436184034577, -0.71491470441091742], [-0.013910365064681685, -2.6073353262608023, -3.6134333515168127, -1.902127206040507, 1.6760543540383743]])  
       res=arg0-arg1  
       s0=numpy.array(4.46927209099)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[4.0801012074156162, 1.7676881939834708, -0.30759999934185878, 7.5836900584762308, 8.3854993411689591], [7.7661845627579345, 2.4766002430829817, 0.4271275657312934, 0.44813801520926688, 2.0100021892809332], [3.1645180969129489, 8.9688892037376053, 0.64605995105031511, 3.6740577291494301, 5.1841867954006933], [4.4831824560544575, 7.0766074172505782, 8.0827054425065885, 6.3713992970302833, 2.7932177369514015]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_array_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[-0.19808428501921149, 4.4764904414745281], [-3.9160161454578746, -2.6352509074444175]], [[4.3446269071601566, 4.6339515234496513], [4.1865606993109132, -1.8983923595790406]], [[-3.0610260498712396, 3.7929399629624569], [-3.3470482550511038, 3.2780576124685865]], [[-1.5462249079768453, -3.7683845811416647], [-1.7573354639280314, 3.6004298923237172]], [[-0.81334747531078389, -1.0856966237388721], [-0.81435209295367716, 4.7779652805450663]], [[0.075318369081889713, -3.5913883396369561], [-4.9611096957330938, 0.69414336131533361]]])  
       res=arg0-arg1  
       s0=numpy.array(-1.41186635286)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-1.2137820678377995, -5.8883567943315391], [2.5041497926008636, 1.2233845545874065]], [[-5.7564932600171677, -6.0458178763066623], [-5.5984270521679242, 0.48652600672202961]], [[1.6491596970142286, -5.204806315819468], [1.9351819021940928, -4.6899239653255975]], [[0.1343585551198343, 2.3565182282846537], [0.34546911107102041, -5.0122962451807282]], [[-0.59851887754622712, -0.32616972911813891], [-0.59751425990333384, -6.1898316334020773]], [[-1.4871847219389007, 2.1795219867799451], [3.5492433428760828, -2.1060097141723446]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_array_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[[2.9043828252117585, 0.30351341408932342, 3.5951640905917124, 3.0655482590577545], [0.79899795987048172, -1.547966149997567, -3.8436501778066026, -4.129950792971421], [3.4149578472657645, -3.0771486435588171, -3.4717713870982059, 1.3893894492405243]], [[-4.8230915799302085, -0.92897880054013005, 1.4205210252792542, -0.096943761883459878], [-2.9456381436862444, 3.6405068972926546, 0.37989963505897961, 0.20035471522445825], [0.27791668280172388, -1.4715103229998872, 3.8591171821375561, 1.2152538208793757]]], [[[-0.033469455771395928, 3.3498699929014961, 3.0877801743609741, -2.3647173369805472], [-3.4000914922014092, -2.1901080484840096, 1.8770182686131118, -3.2701704364704645], [3.3370797162947703, 0.40444653789754348, 4.796842332720102, -3.1474467144032605]], [[1.8472412539192913, 1.7394692683766921, -4.2164402105401191, 4.5830808216207082], [4.8005713662558556, -4.1206363923106357, -0.2670428542594081, -3.4961137240733531], [3.5080416972217883, 0.17655761650256974, -3.5775038842775029, 2.4349619052666673]]], [[[1.6343345651723782, 0.58534212480266667, -2.7466871986056751, -3.470100840474688], [2.5731007729243993, -0.99477209729518012, -3.456969601890294, -4.1758866038586433], [-2.25343818800539, 3.9464809249125761, 1.8491544703762184, -3.2003062595333001]], [[-4.3577463746326375, -4.6633791882416054, -1.742790229562984, 1.4137338487534814], [0.97665161586148308, 1.019042927332948, 3.3990650067589669, 0.92855623941111443], [-0.91875912076485822, -0.49889211169239633, 3.8140482053836848, 2.7155519332185083]]]])  
       res=arg0-arg1  
       s0=numpy.array(-0.355097904366)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-3.2594807295773629, -0.65861131845492782, -3.9502619949573168, -3.4206461634233589], [-1.1540958642360861, 1.1928682456319626, 3.4885522734409982, 3.7748528886058166], [-3.7700557516313689, 2.7220507391932127, 3.1166734827326015, -1.7444873536061287]], [[4.4679936755646041, 0.57388089617452565, -1.7756189296448586, -0.25815414248214452], [2.59054023932064, -3.995604801658259, -0.73499753942458401, -0.55545261959006265], [-0.63301458716732828, 1.1164124186342828, -4.2142150865031605, -1.5703517252449801]]], [[[-0.32162844859420847, -3.7049678972671005, -3.4428780787265785, 2.0096194326149428], [3.0449935878358048, 1.8350101441184052, -2.2321161729787162, 2.9150725321048601], [-3.6921776206603747, -0.75954444226314788, -5.1519402370857064, 2.7923488100376561]], [[-2.2023391582848957, -2.0945671727422965, 3.8613423061745147, -4.9381787259863126], [-5.15566927062146, 3.7655384879450313, -0.088055050106196298, 3.1410158197077487], [-3.8631396015873927, -0.53165552086817414, 3.2224059799118985, -2.7900598096322717]]], [[[-1.9894324695379826, -0.94044002916827107, 2.3915892942400707, 3.1150029361090836], [-2.9281986772900037, 0.63967419292957572, 3.1018716975246896, 3.8207886994930389], [1.8983402836397856, -4.3015788292781805, -2.2042523747418228, 2.8452083551676957]], [[4.0026484702670331, 4.308281283876001, 1.3876923251973796, -1.7688317531190858], [-1.3317495202270875, -1.3741408316985524, -3.7541629111245713, -1.2836541437767188], [0.56366121639925382, 0.14379420732679193, -4.1691461097492892, -3.0706498375841127]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_constData_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Data(4.12376899557,self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array(-3.58404412815)  
       sub=res.substitute({arg0:s0})  
       ref=Data(-7.70781312372,self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_constData_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([-2.3586526291201846, -0.41422099282191738]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array(2.60388440414)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([4.9625370332649332, 3.018105396966666]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_constData_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[-4.9091938895867262, -4.422709535110199, 1.3797186054972901, -0.85365597147041061, -0.40487367019187204], [4.0187702083809995, 1.842757311837719, -1.8011614644696206, 0.65648423783548626, -4.502047459232779], [4.3419427909640458, 3.5131515933507611, -2.6459279720897575, -4.8168270145609728, 1.4875471726475293], [0.7797284878483719, 3.0718099461556623, -1.0735981444129159, -4.0467959478481035, 2.1277466130922473]]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array(-1.7820926575)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[3.1271012320884974, 2.6406168776119703, -3.1618112629955188, -0.92843668602781815, -1.3772189873063567], [-5.8008628658792283, -3.6248499693359477, 0.019068806971391794, -2.438576895333715, 2.7199548017345503], [-6.1240354484622745, -5.2952442508489899, 0.86383531459152874, 3.0347343570627441, -3.2696398301457581], [-2.5618211453466007, -4.853902603653891, -0.70849451308531286, 2.2647032903498747, -3.9098392705904761]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_constData_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[-0.14358914096226361, 0.41090450764298758], [3.3910396292815399, 0.28544635449765909]], [[1.8657812899197239, -0.1697268926483817], [-0.6494399225283134, 4.6002066449841195]], [[0.39277244293292135, -0.35044897204435976], [4.8554971418808694, 2.8180058357871918]], [[-2.5163006793187757, 3.349970025614283], [-4.9539595946662658, 2.2275216941738565]], [[3.7572890750773436, -2.9846942652981765], [1.9186910003500559, -3.7877453617131609]], [[-2.3387065280733466, 0.23916607920932531], [3.8900349547059534, -0.80574312382296487]]]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array(-1.03847768654)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-0.89488854558005571, -1.4493821941853069], [-4.4295173158238592, -1.3239240410399784]], [[-2.9042589764620432, -0.86875079389393761], [-0.38903776401400592, -5.6386843315264388]], [[-1.4312501294752407, -0.68802871449795955], [-5.8939748284231888, -3.8564835223295111]], [[1.4778229927764563, -4.3884477121566023], [3.9154819081239465, -3.2659993807161758]], [[-4.7957667616196629, 1.9462165787558572], [-2.9571686868923752, 2.7492676751708416]], [[1.3002288415310272, -1.2776437657516446], [-4.9285126412482727, -0.23273456271935444]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_constData_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[[4.513060492989748, 0.44878194643349278, -0.90487087340989181, 3.5935007621389055], [-1.7191500659801253, -2.2789509624948909, 4.7478050027046574, 2.9427558445263555], [0.77687277687049772, -3.2174388023577571, 1.0465152688087018, -1.2257336154381484]], [[2.2839820503842558, -1.0762743253814575, -3.9169113398626045, -4.970450548071784], [-4.6984272994192278, -0.235130772661857, -3.8587827079079915, -2.3553521802226198], [2.5733978775140818, 1.4805600408276494, 4.2898419844277029, 1.7323973735516383]]], [[[1.2169016321434301, -3.881526873905611, -4.6829550697908715, -1.3184211355533062], [1.6621395498560707, -0.77198397169456712, 4.1253608313922712, -4.5523822511941257], [-4.7001838406684557, -1.9201495702792934, 1.3006292694924415, -2.4439794243277446]], [[0.6550451012229086, -3.4553492533854859, 2.7704392367080075, 4.5158204397536732], [-4.9976590513589878, -4.7857679934903743, 1.4936033783623337, 1.3048248980038331], [3.4312932706763135, 0.35739177257751287, -4.8570356187672807, 1.7232881728574245]]], [[[1.9270902916811208, -2.959508126603041, 3.5813479005716058, -4.645592843429708], [1.6927366293096782, 2.0033873619526732, -4.3408753548056058, -1.0060532407033937], [4.6701087205366232, 1.5048325485047274, -0.55114576030470097, 3.9132848262399484]], [[-2.8459968519853418, -4.6982728722247122, 3.3349581160924799, -0.22447326711578164], [-2.0876926381400129, 0.95173891265598343, 4.7265478228677757, 1.2631472957977792], [-1.0899709593911631, 2.6485983716360337, 2.9600168494022885, -1.6993031490270818]]]]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array(-2.69482973046)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-7.207890223452277, -3.1436116768960218, -1.7899588570526372, -6.2883304926014345], [-0.97567966448240373, -0.41587876796763812, -7.4426347331671865, -5.6375855749888846], [-3.4717025073330268, 0.52260907189522809, -3.7413449992712309, -1.4690961150243806]], [[-4.9788117808467849, -1.6185554050810715, 1.2220816094000755, 2.2756208176092549], [2.0035975689566987, -2.459698957800672, 1.1639529774454624, -0.33947755023990922], [-5.2682276079766108, -4.1753897712901784, -6.984671714890232, -4.4272271040141673]]], [[[-3.9117313626059591, 1.186697143443082, 1.9881253393283425, -1.3764085949092228], [-4.3569692803185998, -1.9228457587679619, -6.8201905618548002, 1.8575525207315966], [2.0053541102059267, -0.7746801601832356, -3.9954589999549706, -0.25085030613478443]], [[-3.3498748316854376, 0.76051952292295688, -5.4652689671705366, -7.2106501702162022], [2.3028293208964588, 2.0909382630278452, -4.1884331088248627, -3.9996546284663621], [-6.1261230011388426, -3.0522215030400419, 2.1622058883047517, -4.4181179033199536]]], [[[-4.6219200221436498, 0.26467839614051192, -6.2761776310341348, 1.950763112967179], [-4.3875663597722072, -4.6982170924152022, 1.6460456243430768, -1.6887764897591353], [-7.3649384509991522, -4.1996622789672564, -2.1436839701578281, -6.6081145567024775]], [[0.15116712152281275, 2.0034431417621832, -6.029787846555009, -2.4703564633467474], [-0.60713709232251611, -3.6465686431185125, -7.4213775533303048, -3.9579770262603082], [-1.604858771071366, -5.3434281020985628, -5.6548465798648175, -0.99552658143544726]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_expandedData_rank0(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.89782139505)+(1.-msk_arg1)*(-0.632549224225)  
       res=arg0-arg1  
       s0=numpy.array(-0.0355548725409)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(-3.93337626759)+(1.-msk_ref)*(0.596994351684)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_expandedData_rank1(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([4.8537705649006799, 0.51881629002890328])+(1.-msk_arg1)*numpy.array([-1.4978117526856694, -1.1853368037272394])  
       res=arg0-arg1  
       s0=numpy.array(-1.07094935604)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-5.9247199209390136, -1.5897656460672365])+(1.-msk_ref)*numpy.array([0.42686239664733616, 0.11438744768890619])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_expandedData_rank2(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[0.76202861227672791, 1.5935585678804376, 0.067166893445543607, -3.5483901120891401, 2.2083844368712455], [0.54619756366146532, 4.2129575514047062, -2.3213909113956976, -3.1978661855801951, -0.99409912849982796], [0.0093901836133074568, -2.0387242246011796, -4.2820141563813738, 2.6779236634836039, 0.45173669719655685], [-4.3783825768041336, 2.4150014650996816, -0.17009767057901648, -2.3590974231079995, 0.79442015527080212]])+(1.-msk_arg1)*numpy.array([[-3.1069585011789593, 2.2512579315874772, -3.4560639703528775, -3.7225801805654593, -3.9067361433065395], [-2.4742592466902567, 0.67813827770774804, -3.3697168783857254, -3.1921769492123286, -0.2243066185497975], [4.6404492209047525, -0.66361954653440769, -4.1010885759497331, -0.87207749629283349, -3.3792674571593051], [2.2475683057309981, -0.69951769476962333, -0.98115202571460181, -3.0791315176680989, -3.3845365571036834]])  
       res=arg0-arg1  
       s0=numpy.array(-2.69486855757)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-3.4568971698486668, -4.288427125452376, -2.7620354510174825, 0.85352155451720124, -4.903252994443184], [-3.2410661212334042, -6.9078261089766446, -0.37347764617624124, 0.5029976280082562, -1.7007694290721109], [-2.7042587411852463, -0.65614433297075925, 1.587145598809435, -5.3727922210555423, -3.1466052547684957], [1.6835140192321947, -5.10987002267162, -2.5247708869929224, -0.33577113446393936, -3.489288712842741]])+(1.-msk_ref)*numpy.array([[0.41208994360702045, -4.9461264891594166, 0.76119541278093861, 1.0277116229935204, 1.2118675857346006], [-0.22060931088168223, -3.3730068352796869, 0.67484832081378654, 0.49730839164038976, -2.4705619390221414], [-7.335317778476691, -2.0312490110375312, 1.4062200183777942, -1.8227910612791054, 0.68439889958736622], [-4.9424368633029374, -1.9953508628023156, -1.7137165318573371, 0.38426296009616001, 0.68966799953174451]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_expandedData_rank3(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-0.49338101579445937, 4.7756558719354079], [4.5349485441410078, 4.019491819515423]], [[1.083757893569345, -3.4275184802616385], [1.3869293538216478, 0.74555070188654859]], [[-1.8323326240633522, 0.82201023670805995], [-2.8319137879330847, -0.11748405777050586]], [[-1.0437079861233469, -0.13868637274401507], [3.6896042861770599, -3.0804143115173011]], [[2.5221474109650055, -0.91187665803296536], [-2.9428027555008605, -1.0282202137240635]], [[-1.2704876308835611, 3.7996058875736551], [-0.51337461796475914, -4.8221172024001779]]])+(1.-msk_arg1)*numpy.array([[[-4.5721648855205013, 1.4380847354042237], [2.4477890375601232, 1.7248520318179219]], [[1.7143746191091545, 3.6440719594579178], [-2.9119229127180124, -3.1723844686561344]], [[1.2975773372572785, -2.6395445269360893], [4.9865320696978159, 2.5177807530627874]], [[-4.0778964839976863, -0.38275976164858339], [3.8538267231655343, -1.471247926438112]], [[2.4481347986004529, 2.1132592362609355], [-3.1143275187027877, 3.9295753302491541]], [[1.5715199172597529, 3.3296682732382941], [-1.2760474603677041, 2.3833532707045624]]])  
       res=arg0-arg1  
       s0=numpy.array(-0.414078597697)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[0.079302418096976801, -5.1897344696328904], [-4.9490271418384904, -4.4335704172129056]], [[-1.4978364912668276, 3.013439882564156], [-1.8010079515191304, -1.1596292995840312]], [[1.4182540263658696, -1.2360888344055425], [2.4178351902356021, -0.29659453992697671]], [[0.62962938842586436, -0.27539222495346749], [-4.1036828838745425, 2.6663357138198185]], [[-2.9362260086624881, 0.49779806033548279], [2.5287241578033779, 0.61414161602658091]], [[0.85640903318607853, -4.2136844852711377], [0.099296020267276575, 4.4080386047026954]]])+(1.-msk_ref)*numpy.array([[[4.1580862878230187, -1.8521633331017062], [-2.8618676352576058, -2.1389306295154045]], [[-2.128453216806637, -4.0581505571554004], [2.4978443150205298, 2.7583058709586519]], [[-1.7116559349547611, 2.2254659292386068], [-5.4006106673952985, -2.9318593507602699]], [[3.6638178863002038, -0.031318836048899179], [-4.2679053208630169, 1.0571693287406294]], [[-2.8622133962979355, -2.527337833958418], [2.7002489210053051, -4.3436539279466366]], [[-1.9855985149572355, -3.7437468709357766], [0.86196886267022155, -2.7974318684020449]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_expandedData_rank4(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[4.7292861092360265, 3.4480004136366684, -2.8868997988477196, -0.48195054102665758], [4.4844702501923788, -2.5685499854227443, -3.949996065779632, -2.7431363917046392], [-4.904736550938372, 3.1341330872689852, 2.5069814784793749, -0.66902209741126395]], [[-4.3715358001450335, 0.56142077977831484, 3.2645591798081082, 0.6933251112544605], [2.5174351613604102, 1.278196912812561, -0.23103132899462064, -2.6999683348237946], [0.56219273604849285, 2.8747613290691962, 1.9046926816286458, -0.38348211838101065]]], [[[-3.2949747496164203, -4.5212394131132791, 0.46653414132240112, 0.025454406521879136], [0.2912796848863195, 4.8741901632740987, -3.9227761718391809, 3.613892415727797], [-4.7252793102228452, -1.1671956224440483, 0.58416073336049656, 4.5263254708290255]], [[-2.0906021571478126, -0.96497383910392109, -4.2196029737977057, -3.3949439910298276], [-4.6930930839930358, -1.3160338788567714, -2.1248580780950355, 4.4439522531061542], [4.3636886800302932, -3.7730003725256864, 2.4686993133638344, 0.7394521138166219]]], [[[0.10487744719019432, -4.3410812384612374, 3.7681054396550984, 4.8476040108435434], [-1.3303883041999329, 3.0807340353156558, -4.1672676744711357, -0.43870255771732847], [-0.86235492848879236, 0.59094888662464307, 1.9939037999710241, -0.086589678771980871]], [[-4.8736655574293062, -3.5797842399838151, -0.35586569746069863, -0.73385986632437206], [-1.352934756834153, -2.4284765313648151, -4.5996027695407822, -4.5251356936410803], [-4.2514413015761487, -1.0047845643174269, 0.63663878036147104, 0.14710214162477619]]]])+(1.-msk_arg1)*numpy.array([[[[3.542858861630414, -3.4632228632920894, 4.0853647344485022, 3.8551391805002773], [1.3947088677337094, 1.6868513898463604, -2.2926284042805269, 1.5496601745958127], [2.6798747846048956, 1.8235273929030953, -1.5303923242827744, -2.2699225224354169]], [[-3.6347162990443413, -2.1222953939419842, -3.3042862264505999, 4.3910562964126072], [-3.4090077812582509, -1.7522870256724343, 4.7484887803045499, 1.0283752629810792], [-2.0329078310219506, 1.0009581209888658, -2.621160811565344, -0.70663194364473902]]], [[[1.5564177263768553, -4.4561509052626471, 4.3806137766023969, -0.64172396143972943], [4.4225264595433771, -3.4416048696842081, -3.5017448924154273, -2.2624413661558962], [-4.574759979742435, -2.3364598832553227, -3.0438427631400842, 1.8400550720070417]], [[4.7489663821269001, -1.0122998527476321, -2.7872963771860979, 1.1787392629914653], [-3.4417197846550684, 2.3822239464576098, -2.615237792741163, -0.88561933567876228], [2.6529739197576134, -2.5797952427273749, -3.8594220585485584, 3.2135196405335922]]], [[[-3.2882315492272776, 0.17579976395187469, -0.14218793919413475, -3.1262994810196321], [-3.2516074709358369, -1.8991538171806899, -3.4133914713396662, 3.5132240697357169], [0.62102949841652411, -2.7982854690557968, -2.387718091483765, 0.67605315362749163]], [[0.64160386583975182, 1.6298570793031111, -1.9857974817890645, -0.27194626174286896], [2.604715176880755, -3.3126557989459258, 0.98471390648068358, 3.1128179703192007], [2.9228620648260515, 4.283428210706532, -0.43578348683796708, -1.0961118195814521]]]])  
       res=arg0-arg1  
       s0=numpy.array(0.933296359793)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-3.7959897494432999, -2.5147040538439418, 3.8201961586404463, 1.4152469008193842], [-3.5511738903996521, 3.5018463452154709, 4.8832924255723587, 3.6764327514973658], [5.8380329107310986, -2.2008367274762586, -1.5736851186866483, 1.6023184572039906]], [[5.3048321599377601, 0.37187558001441179, -2.3312628200153815, 0.23997124853826612], [-1.5841388015676836, -0.34490055301983435, 1.1643276887873473, 3.6332646946165212], [0.37110362374423378, -1.9414649692764696, -0.97139632183591917, 1.3167784781737373]]], [[[4.228271109409147, 5.4545357729060058, 0.46676221847032551, 0.90784195327084749], [0.64201667490640713, -3.9408938034813721, 4.8560725316319076, -2.6805960559350703], [5.6585756700155718, 2.1004919822367749, 0.34913562643223006, -3.5930291110362989]], [[3.0238985169405392, 1.8982701988966477, 5.1528993335904323, 4.3282403508225542], [5.6263894437857624, 2.249330238649498, 3.0581544378877621, -3.5106558933134275], [-3.4303923202375666, 4.7062967323184131, -1.5354029535711078, 0.19384424597610472]]], [[[0.82841891260253231, 5.274377598253964, -2.8348090798623717, -3.9143076510508168], [2.2636846639926596, -2.1474376755229292, 5.1005640342638623, 1.3719989175100551], [1.795651288281519, 0.34234747316808356, -1.0606074401782974, 1.0198860385647075]], [[5.8069619172220328, 4.5130805997765417, 1.2891620572534253, 1.6671562261170987], [2.2862311166268796, 3.3617728911575417, 5.5328991293335088, 5.4584320534338069], [5.1847376613688754, 1.9380809241101535, 0.29665757943125559, 0.78619421816795043]]]])+(1.-msk_ref)*numpy.array([[[[-2.6095625018376873, 4.396519223084816, -3.1520683746557756, -2.9218428207075506], [-0.46141250794098276, -0.75355503005363378, 3.2259247640732536, -0.61636381480308611], [-1.746578424812169, -0.89023103311036866, 2.463688684075501, 3.2032188822281435]], [[4.568012658837068, 3.0555917537347108, 4.2375825862433265, -3.4577599366198806], [4.3423041410509775, 2.685583385465161, -3.8151924205118233, -0.095078903188352548], [2.9662041908146772, -0.067661761196139203, 3.5544571713580706, 1.6399283034374657]]], [[[-0.62312136658412864, 5.3894472650553737, -3.4473174168096703, 1.5750203212324561], [-3.4892300997506505, 4.3749012294769347, 4.4350412522081539, 3.1957377259486228], [5.5080563395351616, 3.2697562430480493, 3.9771391229328108, -0.90675871221431503]], [[-3.8156700223341735, 1.9455962125403587, 3.7205927369788245, -0.24544290319873863], [4.3750161444477946, -1.4489275866648832, 3.5485341525338896, 1.8189156954714889], [-1.7196775599648868, 3.5130916025201016, 4.792718418341285, -2.2802232807408656]]], [[[4.2215279090200042, 0.75749659584085194, 1.0754842989868614, 4.0595958408123582], [4.1849038307285635, 2.8324501769734165, 4.3466878311323924, -2.5799277099429903], [0.31226686137620252, 3.7315818288485234, 3.3210144512764916, 0.25724320616523499]], [[0.29169249395297481, -0.69656071951038445, 2.9190938415817911, 1.2052426215355956], [-1.6714188170880284, 4.2459521587386524, -0.05141754668795695, -2.1795216105264741], [-1.9895657050333249, -3.3501318509138054, 1.3690798466306937, 2.0294081793741787]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_Symbol_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=())  
       res=arg0-arg1  
       s0=numpy.array(-0.0264653587574)  
       s1=numpy.array(-0.901187655841)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array(0.874722297083)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_Symbol_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(2,))  
       res=arg0-arg1  
       s0=numpy.array(0.361325320894)  
       s1=numpy.array([3.6822993977454637, 0.77205019690118259])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([-3.320974076851126, -0.41072487600684493])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_Symbol_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(4, 5))  
       res=arg0-arg1  
       s0=numpy.array(-3.87225499533)  
       s1=numpy.array([[3.3899375898213098, 3.1052548592416436, 0.25245591920718091, -2.2958028868527935, 0.6469135146512448], [0.62396621839430111, -0.68708686907185701, -1.1698063882959153, 4.8424054843122981, 1.6688675369837656], [-2.0011210174608052, 3.5424329559554941, -4.0966324401813115, 3.4820791585506807, -1.3774126121546804], [2.2297365851233799, 2.501081033078453, -4.2201008492967365, -1.9433763015879082, 2.1853411396613946]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-7.2621925851544251, -6.9775098545747589, -4.1247109145402963, -1.5764521084803218, -4.5191685099843601], [-4.4962212137274165, -3.1851681262612583, -2.7024486070372, -8.7146604796454135, -5.5411225323168809], [-1.8711339778723102, -7.4146879512886095, 0.22437744484819611, -7.3543341538837961, -2.494842383178435], [-6.1019915804564953, -6.3733360284115683, 0.34784585396362111, -1.9288786937452072, -6.05759613499451]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_Symbol_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0-arg1  
       s0=numpy.array(4.85078442847)  
       s1=numpy.array([[[-1.5905096745667393, 3.6879945078384839], [-0.29606187168663389, 4.7006871759278663]], [[0.26704606141625931, 1.0247666918800373], [-2.8134960769685433, -4.5736998086539939]], [[-2.4036722225204032, 3.8785501434168008], [-0.74247113843851498, 1.4728567526560745]], [[-2.1051524316102199, -1.1543367618920444], [1.6261939421625291, 2.9362883055952054]], [[2.0181672977610621, 1.6963208518580153], [-4.4958196688236454, -4.5648084541410636]], [[-0.97867539328497877, -3.4415311036247664], [4.1507889624434586, -1.5964596320386848]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[6.4412941030342523, 1.1627899206290291], [5.1468463001541469, 0.15009725253964668]], [[4.5837383670512537, 3.8260177365874757], [7.6642805054360563, 9.4244842371215078]], [[7.2544566509879163, 0.97223428505071219], [5.593255566906028, 3.3779276758114385]], [[6.9559368600777329, 6.0051211903595574], [3.2245904863049839, 1.9144961228723076]], [[2.8326171307064509, 3.1544635766094977], [9.3466040972911593, 9.4155928826085766]], [[5.8294598217524918, 8.2923155320922799], [0.69999546602405438, 6.4472440605061978]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank0_Symbol_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0-arg1  
       s0=numpy.array(4.31862146392)  
       s1=numpy.array([[[[-0.88759665773172536, -0.48181252635139504, 1.1603032973048872, -0.066110446930882638], [-4.217414942477502, 3.7972698053093978, -0.65886161267235188, 0.72210202105041787], [-2.2477392238578222, -1.729037963745391, -2.3031186194447164, -0.85091530052018705]], [[-4.1782180541892364, -4.1591153974559623, -3.1425644408536204, 2.5296686884694228], [4.9176714447532497, -0.68814243851792511, 3.7414968691657826, -1.7410188505750925], [3.2582639525585417, -3.3063090530620642, -0.18670323335757377, 4.3943644310750809]]], [[[1.2692814756570137, -1.9847554419307647, 4.5731554819716607, -1.5014819501395413], [-3.3324074105764625, 2.3893383653525246, 0.74698337439123641, -1.2904019306851531], [-1.8932254694947348, -0.43613877977591109, -3.6876998814818562, -1.0206317028986147]], [[-1.661400537309893, 1.0360601881389613, -4.1027030184072313, -0.29065054896418907], [-4.254757516269013, 1.6121872628201821, -0.4212392717993918, 3.9617766736753772], [1.5094189884059066, -0.39758923575416283, -2.6024696930992377, -1.6002175505578178]]], [[[3.2027827143003869, -4.7506525699798097, -2.2588522714309867, 0.27705889203668033], [4.347758233877169, -0.1866616482758765, -0.031166637938094155, 4.1533644695908336], [-3.8091164464330376, 2.0629771724304717, -1.225299413279842, -4.5434669073638636]], [[1.6403668143797843, 1.6227808552583696, -2.2116706999536517, -3.2823824463723197], [-3.9354518666760532, -1.0909089876832345, -1.3240288692105828, 3.4712670890282169], [-4.8536937451112117, -0.9909854587942597, 3.2106551815872422, 3.1608940701450479]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[5.2062181216494157, 4.8004339902690853, 3.1583181666128031, 4.3847319108485729], [8.5360364063951923, 0.52135165860829247, 4.9774830765900422, 3.5965194428672724], [6.5663606877755125, 6.0476594276630813, 6.6217400833624067, 5.1695367644378774]], [[8.4968395181069276, 8.4777368613736535, 7.4611859047713107, 1.7889527754482675], [-0.59904998083555938, 5.0067639024356154, 0.57712459475190769, 6.0596403144927828], [1.0603575113591486, 7.6249305169797541, 4.5053246972752641, -0.075742967157390595]]], [[[3.0493399882606766, 6.303376905848455, -0.25453401805397036, 5.8201034140572316], [7.6510288744941528, 1.9292830985651657, 3.5716380895264539, 5.6090233946028434], [6.2118469334124251, 4.7547602436936014, 8.006321345399547, 5.339253166816305]], [[5.9800220012275833, 3.282561275778729, 8.4213244823249216, 4.6092720128818794], [8.5733789801867033, 2.7064342010975082, 4.7398607357170821, 0.35684479024231308], [2.8092024755117837, 4.7162106996718531, 6.921091157016928, 5.9188390144755081]]], [[[1.1158387496173034, 9.0692740338975, 6.5774737353486774, 4.04156257188101], [-0.02913676995947867, 4.5052831121935668, 4.3497881018557845, 0.1652569943268567], [8.1277379103507279, 2.2556442914872186, 5.5439208771975323, 8.8620883712815548]], [[2.678254649537906, 2.6958406086593207, 6.5302921638713425, 7.60100391029001], [8.2540733305937444, 5.4095304516009248, 5.6426503331282731, 0.84735437488947341], [9.172315209028902, 5.30960692271195, 1.1079662823304481, 1.1577273937726424]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_float_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=0.18625894426  
       res=arg0-arg1  
       s0=numpy.array([4.2460720224686703, -0.19804303572100856])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([4.0598130782083661, -0.38430197998131277])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_array_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array(-2.24950054954)  
       res=arg0-arg1  
       s0=numpy.array([-2.2788834256912938, 1.6690101852835877])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([-0.029382876154657733, 3.9185107348202237])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_array_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array([-4.2174863851543254, -3.5244055308498368])  
       res=arg0-arg1  
       s0=numpy.array([3.0028991326445595, 4.0412753067067531])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([7.2203855177988849, 7.5656808375565898])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_constData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(3.80988368049,self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([2.2884359964050969, 4.6003963017676526])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-1.5214476840817621, 0.79051262128079358]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_constData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(numpy.array([-4.3323876694312435, -3.4323505046684097]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([-3.8856819158436262, 3.7208424383505978])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([0.44670575358761733, 7.1531929430190075]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_expandedData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-4.82109641518)+(1.-msk_arg1)*(2.45272047715)  
       res=arg0-arg1  
       s0=numpy.array([3.9967932398735666, 4.1772582681492256])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([8.8178896550547847, 8.9983546833304437])+(1.-msk_ref)*numpy.array([1.5440727627226529, 1.7245377909983119])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_expandedData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([4.401196115388359, 2.7482695889746349])+(1.-msk_arg1)*numpy.array([-3.6893857935034036, -2.0201763435220457])  
       res=arg0-arg1  
       s0=numpy.array([-4.2140777192749574, -0.8254992936230634])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-8.6152738346633164, -3.5737688825976983])+(1.-msk_ref)*numpy.array([-0.52469192577155388, 1.1946770498989823])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_Symbol_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=())  
       res=arg0-arg1  
       s0=numpy.array([-0.74370631974133161, 0.89531396259412155])  
       s1=numpy.array(2.19402251595)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([-2.9377288356933384, -1.2987085533578853])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank1_Symbol_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=(2,))  
       res=arg0-arg1  
       s0=numpy.array([-4.68146123348924, -1.7022626497386595])  
       s1=numpy.array([-2.7415602776458172, -0.75823822290485232])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([-1.9399009558434228, -0.94402442683380716])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_float_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=0.113894011136  
       res=arg0-arg1  
       s0=numpy.array([[-4.7695485701316915, 1.1991110895379853, 0.6176023558768593, 4.6976739850768467, -1.6829880454648736], [2.2896662588738756, -0.082054366263219158, 2.1846542035177121, -1.4414919560178308, 4.1906929795524235], [2.1366487821200986, 3.0930851260323529, 3.5564849352179913, 1.0408048757945565, 4.2000775132035013], [-2.7647151138092374, 3.7409351799242092, 0.36715069104063414, 0.95731364851947376, -2.8532690131964378]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-4.8834425812676594, 1.0852170784020174, 0.50370834474089143, 4.5837799739408789, -1.7968820566008414], [2.1757722477379078, -0.19594837739918702, 2.0707601923817442, -1.5553859671537986, 4.0767989684164556], [2.0227547709841307, 2.979191114896385, 3.4425909240820234, 0.92691086465858863, 4.0861835020675334], [-2.8786091249452053, 3.6270411687882413, 0.25325667990466627, 0.84341963738350589, -2.9671630243324056]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_array_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array(3.64216642414)  
       res=arg0-arg1  
       s0=numpy.array([[-2.1585750091945002, -0.78339132885498319, -2.948373578972141, 3.3671000083080678, 1.1194035599259911], [-0.38118067850872173, -1.9573712212258023, 4.128641037921355, -3.2270320037318436, -2.4207993338283051], [1.1187636565207315, 3.8018893185649656, -4.9954250486994294, 2.0158403804656446, 1.5981453306054405], [-2.1203168901813774, -4.836810878129957, -2.3200783160720126, -3.5633890312185135, 4.0927927688023438]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-5.8007414333371194, -4.4255577529976025, -6.5905400031147607, -0.27506641583455149, -2.5227628642166282], [-4.023347102651341, -5.5995376453684216, 0.48647461377873569, -6.8691984278744629, -6.0629657579709244], [-2.5234027676218878, 0.15972289442234633, -8.6375914728420486, -1.6263260436769746, -2.0440210935371788], [-5.7624833143239966, -8.4789773022725754, -5.9622447402146319, -7.2055554553611323, 0.45062634465972451]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_array_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array([[3.1474460044365511, 3.7088939617196655, 1.8519301814662326, -0.75830715839597662, 0.60935921741348853], [-3.2489252864640052, 3.1808145266365742, 2.5218489745714932, 0.85206185944484059, -1.6251997985633979], [4.5422251039839701, 2.0863901574671537, 3.1410230208972205, -3.4789749034980089, -3.5018367063766922], [-2.1848428590280622, -0.69659826316508244, 0.47948158209356073, -3.9998300015266497, 0.39061452941743902]])  
       res=arg0-arg1  
       s0=numpy.array([[2.1918126631915111, 1.8791024904338913, 3.7573037567021057, 1.7087439391445027, 4.8865039926827549], [-2.4349108395032273, 4.0505651350763845, 1.4654332810306956, -0.57772915662775226, -2.7544132601377544], [-2.8895263551487238, -0.80146770317106686, 0.9895360471427983, -0.61818014896162232, 3.4982658812836416], [-4.4738658507200837, -3.4985451044074667, 1.9076169110864258, 3.8834249521800874, -4.0980986763465266]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-0.95563334124503996, -1.8297914712857741, 1.9053735752358731, 2.4670510975404794, 4.2771447752692664], [0.81401444696077796, 0.86975060843981034, -1.0564156935407976, -1.4297910160725928, -1.1292134615743565], [-7.4317514591326939, -2.8878578606382206, -2.1514869737544222, 2.8607947545363865, 7.0001025876603338], [-2.2890229916920215, -2.8019468412423842, 1.4281353289928651, 7.8832549537067376, -4.4887132057639656]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_constData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(0.172715570698,self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([[2.6067441096427268, 3.0240701475342213, 4.9251195815664772, -3.0534765495141389, -1.3197861097906136], [2.1998619287722008, 2.6070583921875556, 0.50653405266909868, -4.5303043219744303, -2.3171417598443824], [1.1344285972252592, 2.9142857215872766, 3.7074411472538547, -2.1275556808666698, 0.37071848110404204], [-0.22172463981596646, -0.37647266563171744, -4.4392799111489731, 2.9729779285312405, 4.5127786039031719]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[2.434028538944828, 2.8513545768363224, 4.7524040108685783, -3.2261921202120378, -1.4925016804885125], [2.0271463580743019, 2.4343428214896567, 0.33381848197119979, -4.7030198926723292, -2.4898573305422813], [0.96171302652736035, 2.7415701508893777, 3.5347255765559558, -2.3002712515645687, 0.19800291040614315], [-0.39444021051386535, -0.54918823632961633, -4.611995481846872, 2.8002623578333417, 4.340063033205273]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_constData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(numpy.array([[-0.60974491625157423, 1.2937454956809979, -2.4882811285446382, 1.4457982381959136, -0.59952279732918257], [3.3264971174563378, -2.574645417167968, -3.6024324081169667, 1.6242751253553696, 3.8586459154506922], [4.504941628888373, 3.7601625987588356, -3.4236148276419298, 4.6611100019427187, -1.5722080680125949], [-1.0592187405163402, -3.1168374164219239, -2.0872706937104901, 4.2005697295553102, -1.1145478215670934]]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([[1.049074280084108, -3.8042022165489953, 4.8630319382560909, -2.6812317341874934, 4.1103756174634505], [-3.146878050215558, -4.3052225401106927, -1.0875846488531371, 2.0247505320168635, -4.9756606179138609], [-3.800787331554345, 2.8838037784078931, -4.7825075986296675, -3.2750865715783952, 2.9385810971207746], [2.113849094706679, -0.73774852278445913, -1.8018937483482835, 2.2170238297673937, -4.2553300198228383]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[1.6588191963356822, -5.0979477122299937, 7.3513130668007296, -4.127029972383407, 4.709898414792633], [-6.4733751676718958, -1.7305771229427247, 2.5148477592638296, 0.40047540666149395, -8.8343065333645541], [-8.3057289604427176, -0.87635882035094248, -1.3588927709877376, -7.936196573521114, 4.5107891651333691], [3.1730678352230193, 2.3790888936374648, 0.28537694536220659, -1.9835458997879165, -3.1407821982557449]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_expandedData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-4.7481730362)+(1.-msk_arg1)*(3.79234537509)  
       res=arg0-arg1  
       s0=numpy.array([[4.0891975886754786, 0.16706315640504421, 3.1618809312643155, 0.99591732655755294, 3.1305004715144378], [-0.71898265200927725, 1.500406434519399, -3.8831879911615506, 4.7466323944785973, 0.234796898835822], [-1.7767375837174946, 0.55234541430390394, -1.335260690543886, -1.1080972339452053, 0.16590937085390678], [-4.9174935098153805, 2.5608673230633876, 2.8339236001963508, 1.7768592206259326, -4.1883945634933353]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[8.8373706248707062, 4.9152361926002719, 7.9100539674595431, 5.7440903627527806, 7.8786735077096655], [4.0291903841859504, 6.2485794707146267, 0.86498504503367712, 9.494805430673825, 4.9829699350310497], [2.9714354524777331, 5.3005184504991316, 3.4129123456513417, 3.6400758022500224, 4.9140824070491345], [-0.16932047362015279, 7.3090403592586153, 7.5820966363915785, 6.5250322568211603, 0.5597784727018924]])+(1.-msk_ref)*numpy.array([[0.29685221358720248, -3.6252822186832319, -0.63046444382396061, -2.7964280485307231, -0.66184490357383829], [-4.5113280270975533, -2.291938940568877, -7.6755333662498266, 0.95428701939032123, -3.5575484762524541], [-5.5690829588057706, -3.2399999607843721, -5.127606065632162, -4.9004426090334814, -3.6264360042343693], [-8.7098388849036574, -1.2314780520248885, -0.95842177489192526, -2.0154861544623435, -7.9807399385816113]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_expandedData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[2.9387027357428899, 3.4377845641914888, -2.6965035798989967, 4.4275320959324951, -3.3263583410355633], [-0.40219798706399423, 2.0106752196573554, -1.1091725802344143, 3.1840967579779704, -2.0080575397133216], [-2.6431581751317768, 4.3540217997302904, -0.16551342166265037, 0.136408877208261, -2.019051357862133], [3.1936566242540803, -2.5113905646958958, 3.227020896235878, 0.8504093499678369, -0.41185427113619966]])+(1.-msk_arg1)*numpy.array([[0.91703021127159001, 0.36410384278083185, 3.8304482517487752, -3.1429393350233417, 0.59195419858213505], [3.5163811657931969, 0.047627623521345086, -3.0823906341241569, -4.2498401676584727, 4.200708058530271], [4.3780759257733433, 3.1497825680814202, 3.6725002292068076, -0.6110395607223742, -1.3486863524566175], [2.8451706381995434, 1.1402490742214768, 4.661435592042718, 2.0955760691193559, -4.4893440161702216]])  
       res=arg0-arg1  
       s0=numpy.array([[-4.8667512344481771, -2.3313097871983226, -0.94313734407162642, 2.3851040851904726, -4.7445812768196571], [1.2378891646146259, 4.821754000894579, -1.2803609107910696, 2.3160963442586997, 2.312173389707679], [2.8420017412374818, 3.3451617268790557, 2.0621849490715167, 1.1360709529214041, -2.3716494537492592], [2.7458921383884025, -1.5972589743932453, -2.5477710150506292, -0.2397659707929698, -2.9762872598753165]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-7.805453970191067, -5.7690943513898114, 1.7533662358273703, -2.0424280107420225, -1.4182229357840939], [1.6400871516786202, 2.8110787812372235, -0.17118833055665528, -0.86800041371927072, 4.3202309294210011], [5.485159916369259, -1.0088600728512347, 2.2276983707341671, 0.99966207571314314, -0.35259809588712621], [-0.44776448586567774, 0.91413159030265057, -5.7747919112865072, -1.0901753207608067, -2.5644329887391168]])+(1.-msk_ref)*numpy.array([[-5.7837814457197672, -2.6954136299791545, -4.7735855958204017, 5.5280434202138142, -5.3365354754017922], [-2.278492001178571, 4.7741263773732339, 1.8020297233330873, 6.5659365119171724, -1.8885346688225919], [-1.5360741845358614, 0.19537915879763545, -1.6103152801352909, 1.7471105136437783, -1.0229631012926417], [-0.099278499811140897, -2.7375080486147221, -7.2092066070933472, -2.3353420399123257, 1.5130567562949051]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_Symbol_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=())  
       res=arg0-arg1  
       s0=numpy.array([[-2.2693687281877226, 3.1501721749890343, -3.6511935533801765, -3.5941062448461283, 0.29612017005513636], [-2.9900183498516766, -2.9317617440090049, -4.0674972888461314, -0.094693133109659655, 4.2736705348305151], [-4.8299456670425398, 1.7060707050136816, 3.6056315499093756, -3.9511000342404246, 0.89815248749838794], [-4.8073892182624451, 0.9700706809289823, 0.47833511968759712, -1.4881480431722593, -1.2233687205683683]])  
       s1=numpy.array(-4.72476921909)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[2.4554004908994722, 7.8749413940762292, 1.0735756657070183, 1.1306629742410665, 5.0208893891423312], [1.7347508692355182, 1.7930074750781899, 0.65727193024106345, 4.6300760859775352, 8.9984397539177099], [-0.10517644795534498, 6.4308399241008765, 8.3304007689965704, 0.77366918484677027, 5.6229217065855828], [-0.082619999175250314, 5.6948399000161771, 5.2031043387747919, 3.2366211759149355, 3.5014004985188265]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank2_Symbol_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=(4, 5))  
       res=arg0-arg1  
       s0=numpy.array([[-1.9089598455236203, 2.7770299608830484, -4.0743589418484838, -3.7991327217830664, -4.0804057466155728], [-2.4926553836974099, 0.023302336589797967, -2.4577545341063045, 1.5995112972842298, -0.62276099431426513], [-2.408883217475124, -0.2473482992143774, 2.185420578087375, -4.0060698433280075, 2.7917323200974229], [-0.087369360615451086, -3.9830215972907324, 3.6135634261217113, 2.8867830847360612, -4.0222473687926543]])  
       s1=numpy.array([[1.9638174517521261, 3.0424739561258445, -0.29581434636449089, -4.7188877816998911, 3.7338600709712608], [2.8654961224228348, 4.6865032291016533, -0.13502405373872506, 0.40853896307884519, 1.5413702513832916], [1.682945433363586, -3.3008711522507062, 4.1029508231776859, -2.2999792762972291, 2.2233247363644359], [-1.5115119893033446, -1.6103664194112053, 0.61812352324272624, -2.2828487891276983, -1.0801940962440373]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-3.8727772972757464, -0.26544399524279605, -3.7785445954839929, 0.91975505991682471, -7.8142658175868336], [-5.3581515061202447, -4.6632008925118553, -2.3227304803675795, 1.1909723342053846, -2.1641312456975568], [-4.0918286508387105, 3.0535228530363288, -1.9175302450903109, -1.7060905670307784, 0.56840758373298694], [1.4241426286878935, -2.3726551778795271, 2.9954399028789851, 5.169631873863759, -2.942053272548617]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_float_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=4.92025345551  
       res=arg0-arg1  
       s0=numpy.array([[[0.29753432187545226, -0.34592404785590336], [-0.22671553376685338, 0.51013309401272355]], [[-2.2688917517213669, 0.99889056911384344], [-3.4709910703310509, 4.9814755882053348]], [[0.61930675936517154, 1.9900012431431282], [3.2451491591728363, 0.10485036437892692]], [[-4.2772726237380976, 3.9690372507374363], [-0.6323077764133096, -1.2945204560326031]], [[-1.6981245070089002, -1.8270876644744458], [-2.5022605174872137, -4.8128589165587243]], [[4.1204906138381645, -3.3631247369906028], [3.822145500120925, 0.3540826566254669]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-4.6227191336310254, -5.266177503362381], [-5.146968989273331, -4.4101203614937541]], [[-7.1891452072278446, -3.9213628863926342], [-8.3912445258375286, 0.061222132698857124]], [[-4.3009466961413061, -2.9302522123633494], [-1.6751042963336413, -4.8154030911275507]], [[-9.1975260792445752, -0.95121620476904134], [-5.5525612319197872, -6.2147739115390808]], [[-6.6183779625153782, -6.7473411199809235], [-7.4225139729936913, -9.733112372065202]], [[-0.79976284166831313, -8.2833781924970804], [-1.0981079553855526, -4.5661707988810107]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_array_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array(0.05721326725)  
       res=arg0-arg1  
       s0=numpy.array([[[3.1673564487927059, -4.2604521556521648], [-0.78803466872450123, 2.1278202364702903]], [[-1.8034302419952941, -0.36261267398779662], [-2.497682902193116, -3.0137004187657066]], [[-4.4775434544274919, 2.4885878239094623], [1.2216868187249821, 4.040690420665749]], [[1.7662922186139385, 2.8948627204145714], [-0.61029920913510249, 3.3646818769566433]], [[-0.4192149983025093, -2.1843682871281125], [2.3007258197350478, -1.7546442832695721]], [[4.7308913781980806, -0.62920378469045968], [-1.9480290716652093, 3.0635588063584951]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[3.1101431815427212, -4.3176654229021496], [-0.845247935974486, 2.0706069692203055]], [[-1.8606435092452789, -0.41982594123778139], [-2.5548961694431007, -3.0709136860156914]], [[-4.5347567216774767, 2.4313745566594775], [1.1644735514749973, 3.9834771534157642]], [[1.7090789513639537, 2.8376494531645866], [-0.66751247638508726, 3.3074686097066586]], [[-0.47642826555249407, -2.2415815543780973], [2.243512552485063, -1.8118575505195569]], [[4.6736781109480958, -0.68641705194044444], [-2.0052423389151941, 3.0063455391085103]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_array_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array([[[-0.65891337860831545, 0.63253604874592639], [-0.44194718015940548, -0.0024219811530485913]], [[-4.2008541310544434, 3.226776940914144], [-4.302148182849054, 2.2828082722543108]], [[0.63358218312143588, -4.3030054675301184], [-2.7639811946239714, -0.022164519972184493]], [[0.47333604549339103, -4.9672924941222076], [-3.624985989012306, 0.73315425144163804]], [[-1.653639663873566, 4.6830620541410202], [-3.5569223855430341, -0.62497180968249744]], [[-1.7917957393413051, -4.4478794203849237], [-1.5152014733499541, 0.55617277205879301]]])  
       res=arg0-arg1  
       s0=numpy.array([[[1.591825664652573, 2.7515289480999812], [1.3053425515870458, 1.3261424309380416]], [[-1.1921347426068962, 3.7455840561545237], [3.291457083859564, -2.3974636999181067]], [[0.35057513155970632, -2.7896416810422298], [-4.6267567399506735, -0.31943335546418616]], [[1.3066300223104212, 0.47317632449331803], [-1.5743459312928421, -1.1267320254263433]], [[0.58203092755285546, 2.906180509525039], [3.3047817541277134, 3.8922559331945088]], [[-2.1545369949392814, 1.1353742093440378], [-2.8531346119480414, 0.099735855542054885]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[2.2507390432608885, 2.1189928993540548], [1.7472897317464513, 1.3285644120910902]], [[3.0087193884475472, 0.5188071152403797], [7.593605266708618, -4.6802719721724175]], [[-0.28300705156172956, 1.5133637864878886], [-1.8627755453267021, -0.29726883549200167]], [[0.83329397681703021, 5.4404688186155257], [2.0506400577194639, -1.8598862768679814]], [[2.2356705914264214, -1.7768815446159811], [6.8617041396707474, 4.5172277428770062]], [[-0.36274125559797632, 5.5832536297289614], [-1.3379331385980873, -0.45643691651673812]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_constData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(0.415169096944,self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([[[-1.4050436588563784, -1.8401905897329995], [-0.93110351173501638, -7.2666831511192242e-05]], [[4.4627029940557357, 1.8593222322750167], [-1.3567435553522165, 3.4163394234216309]], [[-1.0202363496363875, -1.6654014401486164], [0.7911710264126528, -0.78992067186715964]], [[-4.1095868261030324, -1.2611438739450431], [-2.5116946599265919, -4.4958718390763295]], [[-2.198792297809752, -4.6112409396218803], [-0.092909172902951198, -4.928682755873341]], [[2.4492521329455572, 3.3066371788011217], [-2.3101918604093608, -4.4486666478373476]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-1.8202127558005845, -2.2553596866772057], [-1.3462726086792225, -0.41524176377571731]], [[4.0475338971115296, 1.4441531353308106], [-1.7719126522964226, 3.0011703264774248]], [[-1.4354054465805937, -2.0805705370928225], [0.37600192946844668, -1.2050897688113658]], [[-4.5247559230472385, -1.6763129708892492], [-2.926863756870798, -4.9110409360205356]], [[-2.6139613947539582, -5.0264100365660864], [-0.50807826984715732, -5.3438518528175472]], [[2.0340830360013511, 2.8914680818569156], [-2.7253609573535669, -4.8638357447815537]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_constData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(numpy.array([[[-2.3388484948158341, 2.4896246152441384], [-0.82440735977648494, -0.55583560049396752]], [[-0.68219522878592809, 2.0497282849690999], [-1.1810879605894611, 4.7628828872906226]], [[-1.1845105051416152, 4.6115834013519557], [-0.98883106065764537, 1.1824553717798043]], [[2.7664754154131641, -0.12965769323935206], [1.2325442912200133, -1.1932546394377805]], [[4.0295765153771228, -0.92798748432711076], [-2.0839998080818258, 2.1901908385128808]], [[-4.3795947919027824, 1.3082234118677061], [2.8573009807855545, 2.6888565332736967]]]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([[[0.8995914157331395, -0.70755338008584623], [3.0783861235281194, -4.9162183742237389]], [[-0.7782941112305144, 4.6172751932001006], [3.3051853595413387, 3.032315926823026]], [[4.8236225646601127, 4.7186943306736318], [-2.877629927315517, -1.0275661048238249]], [[-3.9891735116445215, -4.1117151506050744], [3.233042963728451, 3.12706919525702]], [[1.7903799065812169, -3.9574538727131161], [-0.88592173242363614, -4.3927074123168541]], [[0.67671876376222251, -1.4038614814759054], [1.8811371942639212, -0.46567566042857589]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[3.2384399105489736, -3.1971779953299846], [3.9027934833046043, -4.3603827737297713]], [[-0.096098882444586309, 2.5675469082310007], [4.4862733201307998, -1.7305669604675966]], [[6.0081330698017279, 0.1071109293216761], [-1.8887988666578717, -2.2100214766036292]], [[-6.7556489270576856, -3.9820574573657224], [2.0004986725084377, 4.3203238346948005]], [[-2.2391966087959059, -3.0294663883860053], [1.1980780756581897, -6.5828982508297349]], [[5.056313555665005, -2.7120848933436115], [-0.97616378652163327, -3.1545321937022726]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_expandedData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(2.39009692858)+(1.-msk_arg1)*(-4.57584452851)  
       res=arg0-arg1  
       s0=numpy.array([[[-0.73640389526364114, -1.9453069306903381], [4.6709525404147527, 2.6953550830664499]], [[-0.62808913093320129, -2.6144273412968544], [-1.1837576709619482, 4.2042330304641489]], [[1.0682728726406419, -3.9950321835042599], [4.7796272590471176, -1.2788084937180755]], [[-1.3243384961843585, 4.9919170756881197], [0.12682784153580595, -4.0598721864465457]], [[4.8761918053898974, 2.8799524997464125], [0.11793243398155084, 3.0864777073037413]], [[-1.0686409506281436, -1.3469617414354329], [1.0460631050995346, -0.7827570316377237]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-3.1265008238449692, -4.3354038592716666], [2.2808556118334247, 0.30525815448512184]], [[-3.0181860595145293, -5.004524269878182], [-3.5738545995432762, 1.8141361018828208]], [[-1.3218240559406862, -6.385129112085588], [2.3895303304657896, -3.6689054222994035]], [[-3.7144354247656866, 2.6018201471067917], [-2.2632690870455221, -6.4499691150278737]], [[2.4860948768085693, 0.48985557116508449], [-2.2721644945997772, 0.69638077872241322]], [[-3.4587378792094716, -3.737058670016761], [-1.3440338234817935, -3.1728539602190517]]])+(1.-msk_ref)*numpy.array([[[3.8394406332496906, 2.6305375978229937], [9.2467970689280854, 7.2711996115797817]], [[3.9477553975801305, 1.9614171872164774], [3.3920868575513836, 8.7800775589774815]], [[5.6441174011539736, 0.58081234500907186], [9.3554717875604503, 3.2970360347952563]], [[3.2515060323289733, 9.5677616042014506], [4.7026723700491377, 0.5159723420667861]], [[9.4520363339032301, 7.4557970282597443], [4.6937769624948826, 7.6623222358170731]], [[3.5072035778851882, 3.2288827870778989], [5.6219076336128664, 3.7930874968756081]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_expandedData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[3.9328790337435002, -0.69317382478140388], [4.3407685662629412, -2.3562205033055363]], [[-1.1993686313628285, 4.4206467582639402], [1.0662244444401665, 3.9623001143757381]], [[4.2431625761039573, -3.2307661465326385], [4.3324800950942439, -4.0686857352094723]], [[-1.9161775591852761, -2.5415861856151278], [4.5004358689070898, -4.6896872965576533]], [[-2.4161473571248813, 2.3457316501352734], [2.3388641303763693, -3.8494049982960323]], [[2.384940576069674, 4.5482660811952869], [1.0547875132022222, -4.3425252190581851]]])+(1.-msk_arg1)*numpy.array([[[2.8046944258938966, 2.9759065993997034], [3.5741344453164974, -0.65063045542990849]], [[4.5250588449793518, 0.28851018267110717], [2.6107162729490589, -2.4071837799199827]], [[-4.3220052961992419, -2.6819455120889444], [-3.5161283961927592, 0.71487544812849446]], [[-0.75983635071441924, 0.06033001587877429], [-1.9702360721978374, 0.092934776909679329]], [[-2.7822556046504832, 1.7067796704884568], [-0.57068790024286553, 4.2567901809278101]], [[4.4652420086314617, -2.4656385002351868], [-3.6871449338842233, 2.9645760821629459]]])  
       res=arg0-arg1  
       s0=numpy.array([[[1.8904619516814432, -4.1257937096079331], [2.0685021949269125, -0.6109860574242596]], [[-1.1649518661378266, -2.4910607837714425], [-1.6390353799997781, -3.1104356556368264]], [[-2.5032699311305127, 2.8773345713524083], [-0.4280219815296018, -4.4600188943902994]], [[-4.2135620954852646, 3.3864932304771198], [-3.861724010726586, -1.0583645562850954]], [[2.5363607767816196, -2.0583406769018464], [0.59665440971194617, 3.8677373284879302]], [[2.2243831569229942, -4.5170565849313942], [-0.32963755537796047, -1.920062292031969]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-2.0424170820620571, -3.4326198848265292], [-2.2722663713360287, 1.7452344458812767]], [[0.034416765225001811, -6.9117075420353826], [-2.7052598244399446, -7.0727357700125646]], [[-6.74643250723447, 6.1081007178850468], [-4.7605020766238457, -0.39133315918082712]], [[-2.2973845362999885, 5.9280794160922472], [-8.3621598796336762, 3.6313227402725579]], [[4.9525081339065009, -4.4040723270371203], [-1.7422097206644231, 7.7171423267839625]], [[-0.16055741914667987, -9.065322666126681], [-1.3844250685801827, 2.4224629270262161]]])+(1.-msk_ref)*numpy.array([[[-0.91423247421245346, -7.1017003090076365], [-1.5056322503895849, 0.039644398005648895]], [[-5.6900107111171785, -2.7795709664425496], [-4.2497516529488371, -0.70325187571684378]], [[1.8187353650687292, 5.5592800834413527], [3.0881064146631574, -5.1748943425187939]], [[-3.4537257447708454, 3.3261632145983455], [-1.8914879385287486, -1.1512993331947747]], [[5.3186163814321024, -3.7651203473903032], [1.1673423099548117, -0.38905285243987997]], [[-2.2408588517084675, -2.0514180846962073], [3.3575073785062628, -4.8846383741949149]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_Symbol_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=())  
       res=arg0-arg1  
       s0=numpy.array([[[-4.3501209050288345, -0.38385595509171555], [2.4853525402369527, -3.1276974280242911]], [[-3.1083763081007545, -3.6899414336765437], [4.6998681590094655, 1.0987768882946582]], [[-0.76398072073697421, 3.1043645621319786], [2.9785099060682878, -0.90529979844455788]], [[4.0592436185739, 0.10490832242330139], [3.3901983144818324, 2.6897771904262902]], [[-2.756089043467318, -2.6833874533627911], [-4.5027718395487604, -1.2703514732437893]], [[-1.737549054129246, 4.2421625496504642], [2.5256545626504954, 3.6302224377116783]]])  
       s1=numpy.array(3.10591403761)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[-7.456034942636915, -3.489769992699796], [-0.62056149737112776, -6.2336114656323716]], [[-6.214290345708835, -6.7958554712846242], [1.593954121401385, -2.0071371493134222]], [[-3.8698947583450547, -0.001549475476101847], [-0.12740413153979269, -4.0112138360526384]], [[0.95332958096581955, -3.0010057151847791], [0.28428427687375191, -0.41613684718179034]], [[-5.8620030810753985, -5.7893014909708711], [-7.6086858771568409, -4.3762655108518693]], [[-4.8434630917373269, 1.1362485120423838], [-0.58025947495758512, 0.5243084001035978]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank3_Symbol_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0-arg1  
       s0=numpy.array([[[4.2246139252136032, 4.1700252349768299], [-2.1507705748981731, -1.6426814282322209]], [[-2.1400743435290579, -1.2708429661002696], [-2.2660506725734866, -0.49075038987699671]], [[-1.3378379515558048, 1.9222846903631652], [-4.476356687851788, 0.038486358235224394]], [[-0.86239356714828297, 1.7568697002365807], [4.2816002683456471, 0.98419429407479875]], [[2.6149637587379351, 3.0812132156904557], [1.8697590728206528, -0.44365557461066185]], [[3.0085771857793517, -3.7742112083920953], [-1.4181533447458983, 1.1083594166062163]]])  
       s1=numpy.array([[[-0.32162564501796798, 1.9635627063438719], [-2.1182558059551937, 4.0517521341257385]], [[1.8996457175602472, 0.040583755082804984], [2.0700555781621759, 1.3642383650987018]], [[4.4291079459799292, 2.2341937836551393], [-1.8754645867528295, 3.3529664555832497]], [[-0.037251844596513983, -3.631239396717568], [3.5972870130057455, 2.5316598377086219]], [[3.7562241145862085, -4.0127763041272324], [-4.379313239134869, 4.3295964307565136]], [[-3.8039428885904982, -2.2709756633204261], [-2.4848300203781379, -0.2620746961601208]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[4.5462395702315712, 2.206462528632958], [-0.032514768942979444, -5.6944335623579594]], [[-4.0397200610893051, -1.3114267211830746], [-4.3361062507356625, -1.8549887549756985]], [[-5.7669458975357344, -0.31190909329197414], [-2.6008921010989585, -3.3144800973480253]], [[-0.82514172255176899, 5.3881090969541487], [0.68431325533990162, -1.5474655436338232]], [[-1.1412603558482735, 7.0939895198176881], [6.2490723119555218, -4.7732520053671754]], [[6.81252007436985, -1.5032355450716692], [1.0666766756322397, 1.3704341127663371]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_float_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=-4.20361855268  
       res=arg0-arg1  
       s0=numpy.array([[[[-4.3513940943191285, 4.1054266997860296, 3.2500316892628796, -3.8384797590059572], [3.3788825006567986, -4.7563329963771306, -3.4083225621327538, 0.56764701766574976], [-3.1441786969087113, 4.1808557934049606, -1.1600126239639641, -3.7180598379123362]], [[-2.4654737423994568, -3.3090421135823722, -1.6483039153871859, 0.36241821864580448], [-3.8636259780478621, 1.3257386271503266, 3.9838113589897901, -2.0673537921943219], [-0.37683960408500194, 4.856559513922651, -4.1867567227796689, 0.84753736586005779]]], [[[2.0905883317207703, -3.0885823072697294, 3.2852364933155638, -2.0989118392093911], [3.8223669638624713, -4.5268753481942525, 4.0043701154227005, 4.8243065189950158], [-2.5668378547374271, 3.6267815705248978, -2.7407019538861954, 3.4918260465734683]], [[0.45677093741409269, 2.3103503949310591, 2.0498472423458844, -4.0643918630389742], [3.4035299733428452, -1.6854837765642983, 3.4267229912401511, 3.2402131354934554], [-1.4052989425820392, 1.4265678847995957, 1.093486379467512, -1.1135788854729469]]], [[[4.2515626911958506, 3.7605467066125424, 0.90777476643884558, -2.287323808580759], [-3.6343211810528295, -2.9854539504283482, -3.3161745462202621, -2.9143445873167839], [2.2037865409243906, 3.7004859411924045, -1.4018938900264653, -1.452165488011572]], [[1.3274993019272143, 1.9476021997533692, 2.3105309398205431, 2.3159755975972249], [-3.7017249652976436, 3.1724975715942403, 4.9355672551169789, -1.588624641338614], [-3.5999715532094823, -1.4444872999072533, -1.6448766650241806, -2.8820467229430999]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-0.1477755416385893, 8.3090452524665679, 7.4536502419434187, 0.36513879367458202], [7.5825010533373378, -0.5527144436965914, 0.79529599054778544, 4.771265570346289], [1.0594398557718279, 8.3844743460855007, 3.0436059287165751, 0.485558714768203]], [[1.7381448102810824, 0.89457643909816698, 2.5553146372933533, 4.5660367713263437], [0.33999257463267707, 5.5293571798308658, 8.1874299116703284, 2.1362647604862173], [3.8267789485955372, 9.0601780666031893, 0.016861829900870262, 5.051155918540597]]], [[[6.2942068844013095, 1.1150362454108098, 7.488855045996103, 2.1047067134711481], [8.0259855165430096, -0.32325679551371334, 8.2079886681032406, 9.0279250716755541], [1.6367806979431121, 7.830400123205437, 1.4629165987943438, 7.6954445992540075]], [[4.6603894900946319, 6.5139689476115983, 6.2534657950264236, 0.13922668964156504], [7.6071485260233844, 2.5181347761162409, 7.6303415439206903, 7.4438316881739945], [2.7983196100984999, 5.6301864374801349, 5.2971049321480512, 3.0900396672075923]]], [[[8.4551812438763889, 7.9641652592930816, 5.1113933191193848, 1.9162947440997802], [0.56929737162770966, 1.218164602252191, 0.8874440064602771, 1.2892739653637553], [6.4074050936049298, 7.9041044938729437, 2.8017246626540739, 2.7514530646689672]], [[5.5311178546077535, 6.1512207524339084, 6.5141494925010823, 6.5195941502777641], [0.50189358738289558, 7.3761161242747795, 9.1391858077975172, 2.6149939113419252], [0.60364699947105693, 2.7591312527732859, 2.5587418876563586, 1.3215718297374393]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_array_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array(-4.53626154573)  
       res=arg0-arg1  
       s0=numpy.array([[[[-1.7848783073237584, 0.78111367854191904, 0.53353018548742348, -3.1002341605382822], [3.3478779777264247, 3.0715469381471507, 3.2177526040151854, -2.8051071848690299], [-1.7006536600210129, 1.3785310416113994, 1.2303139098734608, 3.0498112332031884]], [[-0.94615041081184881, 2.8245892366205876, -2.5800652232930199, 3.3619873515394332], [-1.7768722149857807, 2.8071880722504723, -4.686596187430939, -4.297126957531229], [-4.366001323517632, 0.36805805757088894, 4.7868064426519616, -3.5420711154459217]]], [[[2.0771599599438844, -3.6052397892136669, -2.3457666208888925, 4.9026006984387678], [1.196857184611595, -4.5416661004261671, -4.6701664250687038, -2.3412388008840801], [1.0648861406702252, -0.21100387674055376, -2.1184848833036307, -1.8493237682955832]], [[-1.3265839966043491, 1.0669290645811618, 1.8625730373716118, 3.0115195153302778], [-0.075004474227643669, -1.8237563398962986, -2.7696508200453107, -0.033053261522479893], [-3.9346084666935779, -2.3951544357275791, 2.5701233821349936, -1.4703257013822402]]], [[[1.8281795230602178, -2.0423772007841947, -2.9551038507278182, 1.51140138691229], [-3.4325452452690355, 0.49897327247299028, -2.1660833222852727, 2.7159024114055716], [-1.6714466733516442, -1.8415898679068587, 1.6745816564033786, -2.2507308703000097]], [[0.83370914527236728, 3.0720981623165358, 1.5964313031686839, 4.0408390869712498], [-3.7768161244363352, -1.2180676867026374, -2.9001697977211238, 0.51770740274757809], [-4.616875809494692, 1.759122668284709, 0.95953655482031586, 2.2465141414848251]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[2.7513832384108028, 5.3173752242764802, 5.0697917312219847, 1.436027385196279], [7.8841395234609859, 7.6078084838817119, 7.7540141497497466, 1.7311543608655313], [2.8356078857135483, 5.9147925873459606, 5.766575455608022, 7.5860727789377496]], [[3.5901111349227124, 7.3608507823551488, 1.9561963224415413, 7.8982488972739944], [2.7593893307487805, 7.3434496179850335, -0.15033464169637778, 0.23913458820333222], [0.17026022221692916, 4.9043196033054501, 9.3230679883865228, 0.99419043028863952]]], [[[6.6134215056784456, 0.93102175652089425, 2.1904949248456687, 9.438862244173329], [5.7331187303461562, -0.005404554691605945, -0.13390487933414263, 2.1950227448504811], [5.6011476864047864, 4.3252576689940074, 2.4177766624309305, 2.686937777438978]], [[3.2096775491302121, 5.603190610315723, 6.398834583106173, 7.547781061064839], [4.4612570715069175, 2.7125052058382626, 1.7666107256892505, 4.5032082842120813], [0.60165307904098331, 2.1411071100069821, 7.1063849278695548, 3.065935844352321]]], [[[6.364441068794779, 2.4938843449503665, 1.581157695006743, 6.0476629326468512], [1.1037163004655257, 5.0352348182075515, 2.3701782234492885, 7.2521639571401328], [2.864814872382917, 2.6946716778277024, 6.2108432021379398, 2.2855306754345515]], [[5.3699706910069285, 7.608359708051097, 6.1326928489032451, 8.577100632705811], [0.75944542129822601, 3.3181938590319238, 1.6360917480134374, 5.0539689484821393], [-0.080614263760130811, 6.2953842140192702, 5.4957981005548771, 6.7827756872193863]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_array_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array([[[[1.9786396880620307, 4.0675048869996786, -1.5013290738864491, -3.7628153992214108], [-2.224033431137352, -0.3610805770918244, -4.0672903991877352, -2.5406617516459629], [-4.6447043287993006, -0.79093577871759813, -1.4009108897929243, -2.3763890102848095]], [[0.64602375620385999, -1.3796413592358956, 4.9243139056276028, 0.1698776969816933], [4.3794885910525085, -3.1237218961620208, 3.7706341701938602, -4.2699974136282624], [4.8505998314475729, -4.5523551682632952, 1.0814846187797134, -0.35087485600035073]]], [[[2.7943868768044826, 3.1988456094760611, 4.6438539011168736, -0.47669389856097766], [3.7800717893588605, -0.60252167660101463, -3.4175159558183585, 0.39617526162229844], [2.0924185905809249, 3.970053149293415, 0.86320087923456335, 1.8115519206250754]], [[-0.74696615281061529, -2.5646957880424068, 4.4599106524098264, 3.6582883469471188], [2.1276661455586812, -2.0947974489756058, -0.53389793069289571, -0.95087633555898243], [0.28733982373734168, -2.3276840835580535, -1.9503641652527492, 3.6884670133434874]]], [[[4.3561362471445371, -1.2725447916294397, -3.0659492051555883, 3.9976270345855625], [0.87232433641059259, -2.8842636749406947, -1.5903575914516455, 2.0854810405201754], [-1.8256406109870027, -1.7009121105818279, -3.0036676347517997, -2.1123851488011089]], [[4.1316502006333327, -0.18407134040545525, -1.8033244485034041, -3.7704127540394259], [3.514234961039616, 0.63001535493001981, 3.3829345681761058, -3.0629880559325038], [4.1517461025171158, 0.85918289765849476, 2.1431109137602009, -2.9476813771954524]]]])  
       res=arg0-arg1  
       s0=numpy.array([[[[-0.99301059297945926, -2.4019820722617413, -4.0436648877556163, 0.13189816707552104], [0.78205249380478215, 4.2697812669581285, 0.52023619122394216, -1.6862793892097647], [2.0597944558892225, 3.3973548191067593, -0.98384806132671088, 2.6736095413511922]], [[-4.588031056266523, -4.0802555508288698, -0.42444513873252898, 4.7271004911129673], [-0.37847923640396175, -2.0894680655027456, 4.2909893813500553, -4.7565338543083611], [1.387670954605662, 2.3564700359396298, -2.2165066021374669, -0.94099293121871419]]], [[[-1.6327790949894783, -0.87719980945685272, -3.4532000496797224, -0.30725613872354618], [-4.3932709086194066, 0.10710068301934861, 3.8835301832138693, -0.12224599404039793], [0.38237520417705984, 1.6164693797304537, 4.6024449061650579, -0.7479257394246428]], [[2.0035678812232867, 3.0565055487777908, 2.8290059864535921, 1.6532579431474357], [-3.074909176069498, -3.9383321790509971, 1.4110143866965288, -1.5012241137416926], [-2.1551193527335832, -2.212167122158796, -0.96224118137214099, 1.0835545948632159]]], [[[-3.4990858658636026, 2.9399730472935337, 0.74807841962704558, -0.55751333544758719], [-4.3948095354068686, -4.8118983608211767, 0.012942933524184852, 4.7364918094158757], [-0.099523109913462804, 0.1503760258363176, -3.2404923933835295, 1.255662067052274]], [[2.8426348006878754, -2.1085091519591206, -0.9660810892730094, -3.7063958364736758], [-0.84314159327248728, 3.8702721977175116, 1.9935035094611333, 2.5326467502276797], [4.599131403482037, 1.5533442037796119, -3.873913685963374, 2.4917435853610534]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-2.97165028104149, -6.4694869592614204, -2.5423358138691672, 3.8947135662969319], [3.0060859249421341, 4.6308618440499529, 4.5875265904116773, 0.85438236243619814], [6.7044987846885231, 4.1882905978243574, 0.41706282846621345, 5.0499985516360013]], [[-5.234054812470383, -2.7006141915929742, -5.3487590443601318, 4.557222794131274], [-4.7579678274564703, 1.0342538306592752, 0.5203552111561951, -0.48653644068009871], [-3.4629288768419109, 6.908825204202925, -3.2979912209171802, -0.59011807521836346]]], [[[-4.4271659717939613, -4.0760454189329138, -8.097053950796596, 0.16943775983743148], [-8.1733426979782671, 0.70962235962036324, 7.3010461390322279, -0.51842125566269637], [-1.7100433864038651, -2.3535837695629613, 3.7392440269304945, -2.5594776600497182]], [[2.750534034033902, 5.6212013368201976, -1.6309046659562343, -2.0050304037996831], [-5.2025753216281796, -1.8435347300753913, 1.9449123173894245, -0.55034777818271019], [-2.4424591764709249, 0.11551696139925749, 0.98812298388060826, -2.6049124184802714]]], [[[-7.8552221130081392, 4.2125178389229738, 3.8140276247826339, -4.5551403700331496], [-5.2671338718174612, -1.927634685880482, 1.6033005249758303, 2.6510107688957003], [1.7261175010735399, 1.8512881364181455, -0.2368247586317298, 3.368047215853383]], [[-1.2890153999454572, -1.9244378115536653, 0.83724335923039472, 0.06401691756575012], [-4.3573765543121032, 3.2402568427874918, -1.3894310587149725, 5.5956348061601835], [0.44738530096492113, 0.69416130612111715, -6.017024599723575, 5.4394249625565063]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_constData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(3.82715029174,self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([[[[-3.9594722919475336, -4.1667564803347288, 3.1041461571320959, 1.9107418995885421], [3.599589804134439, -1.1891298655804725, 2.1533075866878848, 2.8738268304711445], [2.9607358234117633, 0.37159740137938879, 3.2345502540034481, 3.661202540915653]], [[-1.9472909300658534, -1.935931728234829, 4.3777294594204612, -4.9474338228118402], [-2.7380984428930546, 1.0209476686986205, -0.16484805037404549, -4.3902771451318969], [1.1475194808417468, 2.6505040523904269, 4.0720833844789937, -2.1772406505143325]]], [[[-1.3553460032720679, -2.3320113624896175, -0.50342390478241761, -0.35535708051283343], [-2.8322061430206888, 2.1379021089393042, -0.7907531702929802, 0.46016224698407093], [0.79774173915607172, -0.2387023812879292, -3.6037356972271151, 2.6986963337274839]], [[0.048802869140905258, 1.2460860902903113, -4.7926590754832219, -2.1973467627237397], [-1.1072033731533937, 3.041093701157763, -4.1253384338443748, 4.0837171178136273], [3.7047561910240496, -0.87210927261000037, 1.3256168454609085, -0.8867578492516035]]], [[[-2.1393296988210242, 3.9984165353348828, 1.6086885472679864, 4.3440614316228761], [-1.604756972532102, 1.3245791300146781, -1.3084662213845997, -1.7306274625080889], [-2.7431952567494067, -3.4362693353069118, 2.1433576673312738, 4.1318203891940044]], [[3.4224216040821283, 1.3583213127848079, 2.8288260275583177, 0.45649743051739389], [-4.0527367292096264, -0.90489690724588989, -0.97059751858904608, 4.3717777656459784], [-2.928319096341514, 0.98029274321420257, -2.3847690547998135, -0.89096959339299087]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-7.7866225836865821, -7.9939067720737773, -0.72300413460695268, -1.9164083921505064], [-0.22756048760460956, -5.016280157319521, -1.6738427050511637, -0.95332346126790402], [-0.86641446832728519, -3.4555528903596597, -0.59260003773560044, -0.16594775082339552]], [[-5.7744412218049019, -5.7630820199738775, 0.55057916768141268, -8.7745841145508887], [-6.5652487346321031, -2.806202623040428, -3.991998342113094, -8.2174274368709455], [-2.6796308108973017, -1.1766462393486217, 0.24493309273994512, -6.004390942253381]]], [[[-5.1824962950111164, -6.159161654228666, -4.3305741965214661, -4.182507372251882], [-6.6593564347597374, -1.6892481827997443, -4.6179034620320287, -3.3669880447549776], [-3.0294085525829768, -4.0658526730269777, -7.430885988966164, -1.1284539580115647]], [[-3.7783474225981433, -2.5810642014487373, -8.6198093672222704, -6.0244970544627883], [-4.9343536648924422, -0.78605659058128552, -7.9524887255834233, 0.25656682607457881], [-0.1223941007149989, -4.6992595643490489, -2.50153344627814, -4.713908140990652]]], [[[-5.9664799905600727, 0.17126624359583431, -2.2184617444710621, 0.51691113988382753], [-5.4319072642711506, -2.5025711617243704, -5.1356165131236482, -5.5577777542471374], [-6.5703455484884552, -7.2634196270459608, -1.6837926244077748, 0.30467009745495588]], [[-0.40472868765692027, -2.4688289789542406, -0.99832426418073084, -3.3706528612216546], [-7.8798870209486749, -4.7320471989849384, -4.7977478103280946, 0.54462747390692989], [-6.755469388080563, -2.846857548524846, -6.2119193465388616, -4.7181198851320394]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_constData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(numpy.array([[[[2.0714626927575264, -3.6785250637269282, -3.2003326079418635, 4.1867532891338914], [-2.992626179465284, -0.0019540897877003971, -3.59625164568281, 3.6674947961472153], [1.8109920724569859, -4.9830404584840213, 1.5297436313502697, -2.2660552071690079]], [[-2.5024835068070992, -3.1797098667699664, 0.61873438658918278, 3.9556718332440646], [0.06827313781544575, -4.4029409322765014, 2.8413900282957396, -4.406395374697146], [1.602480749211038, 3.8419786184142364, 1.2408448574132311, 4.2411944966319304]]], [[[1.4228188062229492, 2.4466884304356871, 3.5857994997860807, -3.9449295019713002], [-1.9840929151798647, -0.97780997116183954, 4.6450678585854419, -1.3391532119702831], [-2.1771704791099387, 0.74612757833161236, 4.1536460108758728, 3.1179564422633863]], [[2.8599288433215753, 1.5617193986810438, -3.4100968013012443, 3.3442266685755211], [1.1557534857217089, -4.3347373265048228, 2.2120149781417311, 2.9953267501800074], [2.0986332408144648, -1.2755025318789404, 2.5549508430650274, -1.2131443257295094]]], [[[-0.72316810966084866, 3.4880314640748171, 2.736134960646595, -4.125981892216374], [3.5213855786614499, 0.2221851972171347, -2.597574752926203, 2.405326350856221], [0.47212533207489571, 4.0365299207878031, -3.4902844602098391, -3.6299371211009235]], [[-0.86179472064710794, 2.0196579600019762, 3.2182919575211493, -0.82961978697867877], [2.2453089715098171, 3.0371868184645656, 0.68103719663223572, -2.2049331159739358], [-4.6698491695805728, -0.48721759524161889, -4.9047762619249298, -4.575610937997765]]]]),self.functionspace)  
       res=arg0-arg1  
       s0=numpy.array([[[[-2.0650891600964161, -2.0893236401877457, 0.079060395359402236, -2.4719873304521336], [1.6047163797041986, -3.8031925673541886, -3.432532495621313, -3.0041072033426817], [-1.9192094464382805, -4.3873663143020503, -4.1715450142165125, 4.2234334102405242]], [[-2.1464978353402566, -4.9694441974682597, -3.0373626322248182, 3.9635645551817174], [0.052666570474321439, -1.9701195676873318, -1.2874421325960581, -4.4986145214875508], [1.0690922798438161, -1.6294593721165631, -2.1094426733674174, 2.5249857419897639]]], [[[-4.6501547563711343, -3.0815546935487537, 3.6274261992869743, 2.3298274985767673], [-1.81142830904892, 2.046606282596457, -3.6731853321440133, -0.38893741260941717], [2.4492892217129327, -2.0729926397545153, 1.8104021939404777, 4.7753805374787905]], [[1.6022445366459195, -1.8008693901848893, 0.27704203604702293, -3.203295104932641], [-1.8398097316667594, 4.7826166131976517, -1.0309371735995567, 0.67303198783479701], [3.0904884149829694, -3.7136726252369421, -2.1724809072898612, -2.1775755389940166]]], [[[4.4364230168655077, -2.0918724434834948, 3.1703525154226124, -0.19255541758168793], [-3.0015309129636183, -0.35809396711662167, 3.0089662848166157, -4.6831050278892352], [0.14329752244544114, 3.2589402180224152, -2.0349102466821245, 2.8367027299197565]], [[2.2903902351774068, -1.6101793948492373, 1.8261609143734505, 3.0034255485230403], [-3.503121712833531, 1.9669342790027278, 4.1854174852414125, 3.9587633464551732], [-3.1043699743784492, -3.1889813605403439, 1.5699875259653071, 2.4697898916628924]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-4.1365518528539429, 1.5892014235391825, 3.2793930033012657, -6.658740619586025], [4.5973425591694825, -3.8012384775664882, 0.16371915006149695, -6.671601999489897], [-3.7302015188952664, 0.59567414418197107, -5.7012886455667822, 6.4894886174095321]], [[0.35598567146684257, -1.7897343306982934, -3.656097018814001, 0.0078927219376527802], [-0.015606567341124311, 2.4328213645891696, -4.1288321608917977, -0.092219146790404771], [-0.53338846936722195, -5.4714379905307995, -3.3502875307806486, -1.7162087546421665]]], [[[-6.0729735625940835, -5.5282431239844403, 0.041626699500893594, 6.2747570005480675], [0.1726646061309447, 3.0244162537582966, -8.3182531907294557, 0.95021579936086598], [4.6264597008228714, -2.8191202180861277, -2.3432438169353951, 1.6574240952154042]], [[-1.2576843066756558, -3.3625887888659332, 3.6871388373482672, -6.5475217735081621], [-2.9955632173884683, 9.1173539397024754, -3.2429521517412878, -2.3222947623452104], [0.99185517416850466, -2.4381700933580017, -4.7274317503548886, -0.9644312132645072]]], [[[5.1595911265263563, -5.5799039075583119, 0.43421755477601742, 3.9334264746346861], [-6.5229164916250681, -0.58027916433375637, 5.6065410377428186, -7.0884313787454563], [-0.32882780962945457, -0.77758970276538797, 1.4553742135277146, 6.4666398510206804]], [[3.1521849558245147, -3.6298373548512135, -1.3921310431476988, 3.8330453355017191], [-5.7484306843433481, -1.0702525394618378, 3.5043802886091768, 6.1636964624291091], [1.5654791952021236, -2.701763765298725, 6.4747637878902369, 7.0454008296606574]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_expandedData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(4.10650154728)+(1.-msk_arg1)*(-4.65730588074)  
       res=arg0-arg1  
       s0=numpy.array([[[[1.2246571908385366, 4.9302767861952894, 4.9986409006541237, -1.4710878082232415], [4.0737764935540017, 1.990359968368713, 1.6963609243443534, 1.8946200745483726], [0.97749801648068768, -3.7027018965384917, -3.8261645809601594, -1.9169839224999752]], [[-0.40476397285783072, -2.0124497250282047, -4.5060379787906149, 1.7179899810833064], [0.27853235293965017, 4.1637464008173648, 4.6403144749480365, -1.7713065488008715], [-2.1408995561469113, -4.5825382429283756, 2.6620219060295263, 0.028538559913988237]]], [[[3.7637248258540374, -3.3377343693347994, -1.789102806155618, 0.92773734844798206], [-4.0575281489483137, -3.4843728390029192, -4.0458893329271204, 4.3934635669775535], [-2.249717221109917, -2.2386424855192621, 1.7658960176639233, -0.73580712261409076]], [[2.2089013499910823, 1.8494158439085995, -3.0582910613985392, -0.1574057716387145], [-2.9662424146294275, 1.9161295632942386, -4.5942724824758585, 0.17365874415927962], [-0.98786974312139897, 3.7632144970938164, 2.3773846053829581, 4.5394060337402493]]], [[[-4.5206942145973228, -0.93743170959009081, -0.18849906311207931, 0.64831103534375512], [-4.7862222204959295, 0.44918956416062805, -4.0640801814845871, -1.8065905724549025], [-2.0499442275967086, -0.49096023100787711, -2.992328154882312, -0.11032753342345192]], [[0.40061194484281604, 1.4672892711614711, -0.79524941729985255, -3.3451673463966101], [-2.9293809283608265, 2.6194157972053791, 4.3599372628153805, 3.5183972735076257], [1.0178509904761368, 4.2282047016003617, 2.1199506605631786, 0.68879491630108003]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-2.8818443564374796, 0.82377523891927318, 0.89213935337810746, -5.5775893554992582], [-0.032725053722014508, -2.1161415789073033, -2.4101406229316629, -2.2118814727276437], [-3.1290035307953286, -7.8092034438145079, -7.9326661282361757, -6.0234854697759914]], [[-4.511265520133847, -6.118951272304221, -8.6125395260666302, -2.3885115661927099], [-3.8279691943363661, 0.057244853541348562, 0.53381292767202027, -5.8778080960768877], [-6.2474011034229271, -8.6890397902043919, -1.44447964124649, -4.077962987362028]]], [[[-0.34277672142197879, -7.4442359166108156, -5.8956043534316347, -3.1787641988280342], [-8.1640296962243291, -7.5908743862789354, -8.1523908802031357, 0.28696201970153723], [-6.3562187683859328, -6.3451440327952788, -2.3406055296120929, -4.842308669890107]], [[-1.8976001972849339, -2.2570857033674168, -7.1647926086745555, -4.2639073189147307], [-7.0727439619054433, -2.1903719839817777, -8.7007740297518747, -3.9328428031167366], [-5.0943712903974152, -0.34328705018219985, -1.7291169418930581, 0.43290448646423307]]], [[[-8.6271957618733381, -5.0439332568661071, -4.2950006103880956, -3.4581905119322611], [-8.8927237677719457, -3.6573119831153882, -8.1705817287606024, -5.9130921197309192], [-6.1564457748727248, -4.5974617782838934, -7.0988297021583282, -4.2168290806994682]], [[-3.7058896024332002, -2.6392122761145451, -4.9017509645758688, -7.4516688936726263], [-7.0358824756368428, -1.4870857500706371, 0.25343571553936428, -0.58810427376839058], [-3.0886505567998794, 0.12170315432434542, -1.9865508867128376, -3.4177066309749362]]]])+(1.-msk_ref)*numpy.array([[[[5.8819630715804267, 9.5875826669371804, 9.6559467813960147, 3.1862180725186486], [8.731082374295891, 6.6476658491106031, 6.3536668050862435, 6.5519259552902627], [5.6348038972225778, 0.95460398420339843, 0.83114129978173068, 2.7403219582419149]], [[4.2525419078840594, 2.6448561557136854, 0.15126790195127526, 6.3752958618251965], [4.9358382336815403, 8.821052281559254, 9.2976203556899257, 2.8859993319410187], [2.5164063245949788, 0.074767637813514476, 7.3193277867714164, 4.6858444406558784]]], [[[8.4210307065959285, 1.3195715114070907, 2.8682030745862721, 5.5850432291898722], [0.59977773179357641, 1.1729330417389709, 0.61141654781476973, 9.0507694477194427], [2.4075886596319731, 2.418663395222628, 6.4232018984058135, 3.9214987581277994]], [[6.8662072307329725, 6.5067217246504896, 1.5990148193433509, 4.4999001091031756], [1.6910634661124626, 6.5734354440361287, 0.063033398266031604, 4.8309646249011697], [3.6694361376204911, 8.4205203778357074, 7.0346904861248483, 9.1967119144821403]]], [[[0.13661166614456732, 3.7198741711517993, 4.4688068176298108, 5.3056169160856452], [-0.12891633975403938, 5.1064954449025182, 0.59322569925730306, 2.8507153082869876], [2.6073616531451815, 4.166345649734013, 1.6649777258595782, 4.5469783473184382]], [[5.0579178255847062, 6.1245951519033612, 3.8620564634420376, 1.31213853434528], [1.7279249523810636, 7.2767216779472692, 9.0172431435572697, 8.1757031542495149], [5.6751568712180269, 8.8855105823422527, 6.7772565413050687, 5.3461007970429701]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_expandedData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-2.4785835291149261, 1.5353307469137203, -2.2071057425292508, 4.0514094781541115], [-4.9798083616956905, -1.5586505246870477, 3.4852378414806697, -4.1390471427202877], [2.9241021161887542, 0.70711113580061191, -3.1719986716810444, -4.6028184801269116]], [[4.783255537923786, 0.53476976321645431, -2.7798925134770771, 2.5476818543384816], [-3.4794258182751383, -3.9380747798902838, 2.6350557999868744, 2.1228736530542713], [3.3201648183441161, -0.28961330082542869, 0.2329944760091589, 4.4449909832262033]]], [[[-0.12471916129798188, -1.8932292884672055, -0.71265533637599709, 2.7448568816893006], [4.0836336897844756, 0.011018649954621651, 4.4876318903307073, 3.4683440655416806], [-0.85549205275831497, -2.8622611466381875, 3.7554537831952857, 2.8193672503988871]], [[-3.5428243542638316, -4.4680637088072315, 2.1650498604749258, -4.6054784510413462], [-1.5719863327973496, -2.3233359468817549, -3.2645277743358725, 2.1605294058494016], [-1.1535133127337627, -3.3959007468638935, -2.5140791144883567, -3.4461194322889876]]], [[[0.22445893958201957, 2.1843359715421258, 4.2694973863279166, 4.0999279015113217], [2.1462801809389811, -2.913523190516444, 4.3311534130791909, 3.157824361392537], [1.7762688507486759, 3.7935850815040943, -3.7218002298250119, -0.60543530246834809]], [[4.5184626956510812, 3.2043743818037917, -3.857747227708892, 3.6484899412109506], [0.28354573923864113, -0.78654730065324951, 0.93938602073847299, -1.9021048852998037], [-4.4162481558594555, 1.9983058170169183, -2.5856120040416064, -2.6227191521704674]]]])+(1.-msk_arg1)*numpy.array([[[[4.8037297334256817, -2.9294286245070991, 0.73428837303862959, 2.1292839196499465], [-2.4384550557862594, 3.3435589184089043, 4.8925529555431897, 1.6982781770080564], [3.3865722815887676, -2.5200312094736574, -3.8359439790140337, -4.0711457633984978]], [[-0.46573176781292336, -2.7694410605174893, 3.9139428320077574, -4.0116843282485188], [1.923795625175825, -1.2723065478117999, 1.2083495737328747, -4.6601580453442413], [4.1557086448940499, 3.0108610820075654, 1.3027656290925584, 2.5545287070927705]]], [[[-2.9605572843189867, -4.6108687578961707, -1.1717902013675721, 2.5647105183878729], [3.2786307649319451, -0.19601105406331509, -0.63304306744154193, -1.1541533569407516], [4.5648030269374615, 4.6289920961251205, 0.33248631928000449, -4.2722999199964367]], [[-0.36739293383284455, 4.1580994332989683, 0.92642763917482718, 3.3504698130835937], [-0.89103132495912529, 4.0940719963983661, 4.3299763249478413, -1.50669684432994], [1.7033588556467709, -2.5591422766187111, -2.3644266129282308, 3.0174133128244307]]], [[[-3.7876286952685465, 1.9341902891111378, -3.9133088106137359, -4.565837822040784], [-3.6544968288479796, -0.46647442160903552, -4.805948983143419, 1.7405435134333214], [-1.7069200380461744, -0.98204275967350707, -2.6026435996535335, -3.8696719482354149]], [[-2.3012507342444257, -4.5537446419851282, -0.30957197814557968, -3.1514084346285012], [-0.37258303473624288, 4.0974841307754399, 4.2920748771642057, 1.9428077923605827], [-0.84024575218954567, -1.6074388566165942, 1.6178758468908239, 3.1771702646746398]]]])  
       res=arg0-arg1  
       s0=numpy.array([[[[2.7370842473512971, 4.8617598335099039, 1.2314108858756478, -1.2293067080949793], [-0.68111696417300216, 4.6724464392461567, 4.453283252313156, 4.5899836340752262], [-0.61733760017803441, 0.83009381358495737, 2.7077982064896213, 0.18177772909965206]], [[1.6337642623077642, 3.9153744588472108, 1.0340956821078908, 4.8322464833642478], [-4.5048166614969007, -1.9362325578599302, -4.4520432366379392, 1.6269372627571386], [-0.16949887338363467, 0.84673288177893991, -1.0378380244307861, 3.0191616188508466]]], [[[3.6726207448895298, -0.53483679328965916, 0.62227101912824967, 2.861586597346065], [0.733418575667657, 0.14438740048821064, 2.270227972898951, -1.8598039915576789], [4.7667691797460296, 0.032300462573202182, -0.55026767625705553, 2.1504990222380425]], [[-3.1459290901276349, -3.4221966185871509, -4.5517707133649177, -4.7399680782991815], [1.531698689747353, -4.3819518537643916, -3.830718516520053, -1.7466636970002103], [-3.5895883451883295, 1.3720002823579591, -3.9623423722655557, 4.6281874668364935]]], [[[4.8501258432505594, 2.1780290766946786, 1.0332618327312337, -0.42123766103431493], [-1.1230091211096371, -4.1941638875982985, -3.6305835095810588, -0.90355170545447372], [-0.17004205825064389, -2.1141459881089251, -2.4192051047904926, -0.42989386173596156]], [[2.2536448185408195, -2.7709249429224347, 1.6702466464675272, 0.90044207186466796], [2.7012697461102553, 3.7230499919496332, 1.7794340769830566, 0.11570481679317268], [0.6768714136701508, -2.6772085244764754, 3.0504328988941065, 1.6829645110005487]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[5.2156677764662227, 3.3264290865961836, 3.4385166284048987, -5.2807161862490908], [4.2986913975226884, 6.2310969639332043, 0.9680454108324863, 8.7290307767955149], [-3.5414397163667886, 0.12298267778434546, 5.8797968781706658, 4.7845962092265637]], [[-3.1494912756160218, 3.3806046956307565, 3.8139881955849679, 2.2845646290257662], [-1.0253908432217624, 2.0018422220303536, -7.0870990366248137, -0.49593639029713277], [-3.4896636917277508, 1.1363461826043686, -1.270832500439945, -1.4258293643753568]]], [[[3.7973399061875117, 1.3583924951775463, 1.3349263555042468, 0.11672971565676438], [-3.3502151141168186, 0.13336875053358899, -2.2174039174317564, -5.3281480570993596], [5.6222612325043446, 2.8945616092113897, -4.3057214594523412, -0.66886822816084468]], [[0.39689526413619669, 1.0458670902200806, -6.7168205738398434, -0.13448962725783531], [3.1036850225447026, -2.0586159068826366, -0.56619074218418053, -3.9071931028496119], [-2.4360750324545668, 4.7679010292218527, -1.448263257777199, 8.0743068991254816]]], [[[4.6256669036685398, -0.0063068948474471753, -3.2362355535966829, -4.5211655625456366], [-3.2692893020486182, -1.2806406970818545, -7.9617369226602497, -4.0613760668470107], [-1.9463109089993198, -5.9077310696130194, 1.3025951250345194, 0.17554144073238653]], [[-2.2648178771102616, -5.975299324726226, 5.5279938741764187, -2.7480478693462826], [2.4177240068716142, 4.5095972926028827, 0.84004805624458356, 2.0178097020929764], [5.0931195695296063, -4.6755143414933933, 5.6360449029357129, 4.305683663171016]]]])+(1.-msk_ref)*numpy.array([[[[-2.0666454860743846, 7.791188458017003, 0.49712251283701825, -3.3585906277449258], [1.7573380916132573, 1.3288875208372524, -0.43926970323003367, 2.8917054570671699], [-4.003909881766802, 3.3501250230586148, 6.5437421855036551, 4.2529234924981498]], [[2.0994960301206875, 6.6848155193647001, -2.8798471498998666, 8.8439308116127666], [-6.4286122866727258, -0.66392601004813034, -5.6603928103708139, 6.2870953081013798], [-4.3252075182776846, -2.1641282002286255, -2.3406036535233445, 0.46463291175807608]]], [[[6.6331780292085165, 4.0760319646065115, 1.7940612204958217, 0.29687607895819212], [-2.545212189264288, 0.34039845455152573, 2.9032710403404929, -0.70565063461692734], [0.20196615280856811, -4.5966916335519183, -0.88275399553706002, 6.4227989422344791]], [[-2.7785361562947903, -7.5802960518861191, -5.4781983525397449, -8.0904378913827752], [2.4227300147064783, -8.4760238501627576, -8.1606948414678939, -0.23996685267027029], [-5.2929472008351004, 3.9311425589766702, -1.597915759337325, 1.6107741540120628]]], [[[8.6377545385191059, 0.24383878758354083, 4.9465706433449697, 4.1446001610064691], [2.5314877077383424, -3.727689465989263, 1.1753654735623602, -2.6440952188877951], [1.5368779797955305, -1.132103228435418, 0.18343849486304098, 3.4397780864994534]], [[4.5548955527852453, 1.7828196990626934, 1.9798186246131069, 4.0518505064931691], [3.0738527808464982, -0.37443413882580678, -2.5126408001811491, -1.82710297556741], [1.5171171658596965, -1.0697696678598811, 1.4325570520032826, -1.4942057536740911]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_Symbol_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=())  
       res=arg0-arg1  
       s0=numpy.array([[[[-4.2094446889669443, 0.41516066288807441, -3.9613302067318115, 1.4268742866264095], [3.738099113462928, 3.9796240404013474, 1.3151583502499253, -1.7270583365072123], [2.0593600047588456, 0.34621940153232167, 3.7918785693016659, -4.2989493548433586]], [[2.0725206115951202, 2.7009601049837944, 0.36387757724165404, -4.5397172382262427], [-2.2810262363416345, 2.9626469454839652, -0.1804468261203489, -2.9038186992608885], [-1.7868528972076456, -0.6067606998394437, -0.52535158052193243, 0.61340129340486627]]], [[[4.3933203802734404, -0.89827991818067154, 1.0557888120467567, 0.5785002713614471], [-3.760786019714736, 1.805478798720098, 2.7257778336575402, 0.068441250680695731], [0.041678146053024889, -4.1102721409024596, 2.9328767583794857, -3.7183871914241462]], [[1.0789862278680218, -4.1478861376529181, 3.7261719791248922, -1.0687899599505646], [-2.2749543131323415, 3.0884760713113693, 0.91386857752052464, 3.7183495238425586], [0.91525047921246383, 2.7016473387703606, -3.8514469864485457, -2.0786806884836917]]], [[[-4.9055845749360403, 0.073381955896968165, 1.0155278307510596, -0.060038336227231426], [2.1091306655888218, -4.4225533295270338, -4.2024130453255975, -4.6810263250640327], [2.6727794742313815, 0.53978441096705243, 1.5079675693702379, -2.5044101013972808]], [[2.888443188583258, 0.35230544125170304, 2.5131451580315307, -2.522851304279353], [0.40638281994528569, -3.4348564674989444, -3.7935692000215351, 2.9903265400327053], [-0.41178086923360446, 2.7535310668196997, 0.74263047233165302, 2.7705115939334757]]]])  
       s1=numpy.array(4.34240228359)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-8.5518469725552961, -3.9272416207002765, -8.3037324903201615, -2.9155279969619414], [-0.60430317012542289, -0.36277824318700347, -3.0272439333384256, -6.0694606200955636], [-2.2830422788295053, -3.9961828820560292, -0.55052371428668501, -8.6413516384317095]], [[-2.2698816719932307, -1.6414421786045565, -3.9785247063466969, -8.8821195218145945], [-6.6234285199299858, -1.3797553381043857, -4.5228491097086998, -7.2462209828492394], [-6.1292551807959965, -4.9491629834277946, -4.8677538641102833, -3.7290009901834846]]], [[[0.050918096685089509, -5.2406822017690224, -3.2866134715415942, -3.7639020122269038], [-8.1031883033030869, -2.5369234848682529, -1.6166244499308107, -4.2739610329076552], [-4.300724137535326, -8.4526744244908105, -1.4095255252088652, -8.0607894750124967]], [[-3.2634160557203291, -8.490288421241269, -0.61623030446345872, -5.411192243538915], [-6.6173565967206924, -1.2539262122769816, -3.4285337060678263, -0.62405275974579233], [-3.4271518043758871, -1.6407549448179903, -8.1938492700368961, -6.4210829720720426]]], [[[-9.2479868585243921, -4.2690203276913827, -3.3268744528372913, -4.4024406198155823], [-2.2332716179995291, -8.7649556131153847, -8.5448153289139483, -9.0234286086523845], [-1.6696228093569694, -3.8026178726212985, -2.834434714218113, -6.8468123849856317]], [[-1.4539590950050929, -3.9900968423366479, -1.8292571255568202, -6.8652535878677039], [-3.9360194636430652, -7.7772587510872953, -8.135971483609886, -1.3520757435556456], [-4.7541831528219554, -1.5888712167686512, -3.5997718112566979, -1.5718906896548752]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sub_overloaded_Symbol_rank4_Symbol_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0-arg1  
       s0=numpy.array([[[[-1.5506479146787044, -3.9856917226598645, -0.72456523833199959, 2.2303748731536412], [0.83724449474878071, 2.430775531159945, -4.3263474233732406, 4.4531270480920302], [-1.1443729003138934, -4.707796946532409, -4.1175256451096995, 0.93751110127512227]], [[1.0219466556877244, -4.0675370006872624, 1.5388017373874394, -1.3188834425708174], [-1.7757933661346827, -0.50753435266944447, -3.8459639728918971, 0.4268943514928436], [4.7220140179624579, -1.4419287127264258, 3.5892419446138728, 1.1401908290143954]]], [[[0.48463352273991944, 3.9829884913573537, -0.74674905467943642, 1.7131958381166479], [3.5202938942159978, 0.37446261266912284, -4.6297060396712588, -0.90753235920085462], [4.3943793907463196, 3.2434654910303369, 2.516428146837411, -3.4437066542593788]], [[2.1353416128248366, 2.5164869283684776, -3.0140199504858476, 2.9519651265809959], [-1.2048484567709385, 3.7382772718451704, -0.30932925986719972, -1.8119999228303953], [4.635430974925157, -1.5160297222946895, 2.0484603718655041, 4.9224343652461489]]], [[[-1.3790640693229559, 0.74542673244150404, -2.4803608373679129, -0.83451771454648327], [-2.3052439770940114, -2.5141511169091535, 0.05261985447495654, 3.4406906571551872], [0.1545022955734332, 1.3169713280975053, -0.062333210907543624, 4.4356584912606412]], [[-1.4645789671251022, -1.4213509906327104, -4.6280641008204215, 1.5572313843044006], [-1.6655851804714228, 1.7662442942611181, -1.7847394763454529, 2.4909555442510491], [-0.38907876691771737, -2.9678545383186061, 2.8495546149657649, -2.1378919531240737]]]])  
       s1=numpy.array([[[[2.1557791930836201, 1.5399910758778512, -1.3093250491437045, -0.81547434791920459], [0.27230777588100885, 1.6775776770655177, -1.9829228040725813, 0.63989232333097057], [-4.3456795436473268, 2.241476603277289, 0.12008093429437228, 1.5572187103575983]], [[4.960830051433252, 0.19246137337528069, -3.8821997721832782, -1.3555248295522473], [1.0162013292444243, -0.63850856694339519, -4.829543129130883, 0.87031366632301221], [0.10606360396858339, -2.4602367860456011, -4.920204150038483, -0.78307390810965849]]], [[[1.4430500807071596, -3.5843698473266272, 1.2721351754292449, 4.7627245955508997], [-0.89319078879286362, -1.8170573355873954, -1.6854096126601781, 3.866562480243088], [0.12813943911657777, 4.1020971996497781, -3.0878565044214623, -4.6218449798451076]], [[-1.0065916382954265, 1.2515625085536728, 0.077178956427302658, -3.257709691388718], [-4.8293958818416769, -4.3289551631503551, 2.872034501360333, -1.1835578439262884], [4.5273544507294172, -4.256439515471456, 0.31430443555782261, 0.21354675122688427]]], [[[-3.8444886294752587, 3.2997020021530545, -0.92605158278457189, 4.6480751977359418], [2.3795725793638569, -1.2916056519318109, 4.874940419640847, -1.673082636674772], [3.0191777217077771, -2.1922112305409822, -1.9945878496618628, -1.0325400654004815]], [[-4.3807365938952678, -2.4360721180146152, 3.111147684566852, 1.3512422939691673], [1.1746453005397122, -2.8158613029925075, 0.72960980167024037, 1.7337206979380939], [-1.8481383399869822, 2.0490676914287844, 4.9040510241847954, -0.51669678931784446]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-3.7064271077623245, -5.5256827985377157, 0.58475981081170492, 3.0458492210728458], [0.56493671886777186, 0.7531978540944273, -2.3434246193006594, 3.8132347247610596], [3.2013066433334334, -6.949273549809698, -4.2376065794040718, -0.61970760908247602]], [[-3.9388833957455276, -4.2599983740625431, 5.4210015095707176, 0.036641386981429935], [-2.791994695379107, 0.13097421427395073, 0.98357915623898595, -0.44341931483016861], [4.6159504139938745, 1.0183080733191754, 8.5094460946523558, 1.9232647371240539]]], [[[-0.95841655796724012, 7.5673583386839809, -2.0188842301086813, -3.0495287574342518], [4.4134846830088614, 2.1915199482565182, -2.9442964270110807, -4.7740948394439426], [4.2662399516297418, -0.85863170861944127, 5.6042846512588733, 1.1781383255857287]], [[3.1419332511202631, 1.2649244198148049, -3.0911989069131502, 6.2096748179697139], [3.6245474250707383, 8.0672324349955247, -3.1813637612275327, -0.62844207890410697], [0.10807652419573976, 2.7404097931767666, 1.7341559363076815, 4.7088876140192646]]], [[[2.4654245601523028, -2.5542752697115505, -1.554309254583341, -5.4825929122824251], [-4.6848165564578679, -1.2225454649773426, -4.8223205651658905, 5.1137732938299596], [-2.8646754261343439, 3.5091825586384875, 1.9322546387543191, 5.4681985566611226]], [[2.9161576267701657, 1.0147211273819048, -7.7392117853872735, 0.20598909033523327], [-2.840230481011135, 4.5821055972536255, -2.5143492780156933, 0.75723484631295523], [1.4590595730692648, -5.0169222297473901, -2.0544964092190305, -1.6211951638062292]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1984     def test_mult_overloaded_float_rank0_constData_rank0(self):     def test_mult_overloaded_float_rank0_constData_rank0(self):
1985        arg0=-3.23475699401        arg0=-3.23475699401
1986        arg1=Data(3.49463105039,self.functionspace)        arg1=Data(3.49463105039,self.functionspace)
# Line 3468  class Test_util_overloaded_binary_no_tag Line 2081  class Test_util_overloaded_binary_no_tag
2081        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2082        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2083     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_mult_overloaded_float_rank0_Symbol_rank0(self):  
       arg0=-3.99682997451  
       arg1=Symbol(shape=())  
       res=arg0*arg1  
       s1=numpy.array(3.27122290109)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array(-13.0745217444)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_float_rank0_Symbol_rank1(self):  
       arg0=-1.38802945033  
       arg1=Symbol(shape=(2,))  
       res=arg0*arg1  
       s1=numpy.array([-1.9988599349719061, 1.9723531416322704])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([2.7744764568228684, -2.7376842470336804])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_float_rank0_Symbol_rank2(self):  
       arg0=-4.67708933344  
       arg1=Symbol(shape=(4, 5))  
       res=arg0*arg1  
       s1=numpy.array([[3.2557839530925925, -0.98188310524039757, -2.5955869753824401, -4.1619778096726527, -0.022815854229053301], [-3.8564402594265013, 1.2645013361311461, -1.9976686889636652, 4.5079964301528737, -2.3609140658091898], [-2.0984101136525601, 4.9837995450843291, -3.3713553144891906, 2.7078199910291136, -1.8646870585149311], [-2.6366187177131897, -0.8512835760295614, 4.8468953049383536, 0.35796114054844974, 0.28005898249532901]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[-15.227592399005244, 4.5923549982080543, 12.139792156585582, 19.465942019647695, 0.10671178844810253], [18.036915602425022, -5.9141857113437917, 9.3432749169056315, -21.084302018668506, 11.042205994372427], [9.8144515597539428, -23.309675692333514, 15.768129980644794, -12.664715996926814, 8.7213079515899565], [12.331701280973325, 3.9815293331833348, -22.669362331043612, -1.6742162322463541, -1.3098608797638887]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_float_rank0_Symbol_rank3(self):  
       arg0=-3.71839366392  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0*arg1  
       s1=numpy.array([[[4.1047354741782964, 2.8775695569403652], [-0.5759623267529097, -1.4223503546201921]], [[-3.5598901183991547, -1.9189655068039602], [-4.6157637828139126, -0.20854161206194544]], [[0.69981738038356855, -1.5161631457623348], [-4.4706835308278459, 3.4005620689181484]], [[4.6914021428360879, -2.5375932231611142], [0.14020840642389043, -4.2922039864158981]], [[-3.5598470814197256, 2.279639616164201], [-3.6212153115571475, -4.0784181473745704]], [[-1.1775434417841879, -2.5696710208883289], [-2.1179063132353315, 4.8375363806920575]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-15.26302237925367, -10.699936408017141], [2.1416546664548415, 5.288858546494585]], [[13.23707286050808, 7.1354691817815477], [17.163226804168279, 0.77543980895487352]], [[-2.6021965131195985, 5.6376914346722113], [16.623761314423319, -12.644628450833117]], [[-17.444480002824061, 9.4357705626095054], [-0.52135005007496338, 15.960104107342541]], [[13.236912832076456, -8.476597504766783], [13.465104070185452, 15.165164198015374]], [[4.3785700729212857, 9.5550484424308983], [7.8752094159111641, -17.987864626949527]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_float_rank0_Symbol_rank4(self):  
       arg0=2.51137241677  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0*arg1  
       s1=numpy.array([[[[-3.1776871552585719, 2.6185420330619822, -2.7145092227141299, -3.5868184499426849], [0.34971316457166601, -0.74644419856278077, 4.0568461402062397, -2.9414082260930865], [-3.3206004994485436, 3.8862957789423884, 4.3288928089700764, -1.1345498786192909]], [[-0.50860546079107305, -3.8324702658179821, -1.6881575359991006, -0.11889958949547896], [-0.80375383059163497, -4.1136656969976881, 2.6986254928957623, 3.2852397524678221], [3.7765647392497765, 4.7560925337979469, -3.2281691514910027, 4.2489058373395672]]], [[[-2.0337988691350137, -4.2205670831267348, 4.0757785005984992, 1.6740091429449633], [1.8068601552111163, -2.511254361677965, 3.4594497943673286, -3.0853987248028023], [2.7673441246895694, 2.5314763847968491, -3.4458602837493335, -1.6294748186525476]], [[2.6380712914005517, -3.3086195342397495, -0.72830427630706129, 1.7030855690068671], [-0.24236423999319179, 4.6938842991481806, -0.5728067129104355, -4.332105588615363], [0.08341006873729917, -3.6277478553852993, -0.30762585111748564, 1.9085815882403079]]], [[[-3.2074489700837248, -2.9086591391141203, 4.3566387996781089, 2.2802390515977962], [4.0571958859932771, 4.5364086125789136, -2.699010006828122, 0.56255880746047726], [3.6484420689146173, 0.18011622079911405, 1.4099692593854849, 1.1901977223656299]], [[-0.7121196529261784, 0.14080337471048221, 1.6657506529463415, 0.63300945605868097], [1.8864512760784322, -3.4213760444141328, 4.908483355764087, -2.7687243565923025], [-4.6046057143734558, 3.6991610193449702, -1.1467624555030254, -4.3025114316853852]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-7.9803558708506896, 6.576134233992927, -6.817143587000567, -9.0078369191590557], [0.87825999528772836, -1.8745993709309017, 10.188251495606536, -7.386971485479795], [-8.3392645014381905, 9.759936022657806, 10.871461995615055, -2.8492772706178036]], [[-1.2772977252508946, -9.6247601136785121, -4.2395922710758533, -0.29860114942459548], [-2.0185252000235847, -10.330946563265856, 6.7772536260592418, 8.2504604968343127], [9.4843605163099411, 11.944319601000846, -8.107134963732463, 10.670584921360978]]], [[[-5.1076263812100828, -10.599415755705158, 10.235797703280065, 4.2040603870180284], [4.5376987547636354, -6.3066949354192845, 8.6879667907856266, -7.7485852522167837], [6.949831702464599, 6.3574799664913995, -8.6538384686621477, -4.0922181133904258]], [[6.6251794747044475, -8.3091758358865064, -1.8290432705354787, 4.2770821214082373], [-0.60866686713108786, 11.788091556405272, -1.4385309789457597, -10.879530481797399], [0.20947374590800491, -9.1106258990225619, -0.77256307718281469, 4.7931591558677837]]], [[[-8.0550988716756891, -7.3047263317663145, 10.941142511355253, 5.7265294578316546], [10.189129837528984, 11.392611460842803, -6.7782192837428354, 1.4127946718690354], [9.1625967760669038, 0.45233890872831589, 3.5409579065187624, 2.9890297304552611]], [[-1.7883976538008677, 0.35360971143647801, 4.183320243031293, 1.5897224875023417], [4.7375817003298701, -8.5923494253500525, 12.327029707855997, -6.9532979787938736], [-11.563879781193485, 9.2899709491853777, -2.8799475993413353, -10.805208532385796]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2084     def test_mult_overloaded_constData_rank0_float_rank0(self):     def test_mult_overloaded_constData_rank0_float_rank0(self):
2085        arg0=Data(-1.85600455227,self.functionspace)        arg0=Data(-1.85600455227,self.functionspace)
2086        arg1=-3.60193121332        arg1=-3.60193121332
# Line 4442  class Test_util_overloaded_binary_no_tag Line 3000  class Test_util_overloaded_binary_no_tag
3000        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
3001        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3002     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_mult_overloaded_Symbol_rank0_float_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=-4.63958857853  
       res=arg0*arg1  
       s0=numpy.array(0.811316856443)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(-3.76417642072)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_array_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array(-2.22217812547)  
       res=arg0*arg1  
       s0=numpy.array(-1.23562147421)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(2.74577101135)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_array_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([-0.49255185346092034, -0.93209929304488437])  
       res=arg0*arg1  
       s0=numpy.array(-1.20692497543)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([0.59447313363637289, 1.1249739163566133])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_array_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[0.76768714074578082, 1.4571677796231208, -4.0617303212850508, 0.77139816615527934, 3.5714093600117991], [-3.4485526167244207, -1.7140012841356289, 2.2230309883049193, 2.3728639542260748, -3.5373142132680324], [4.8872051518943209, -1.9486805339851978, -2.5530087367872936, 4.2141226178140361, 3.8339776787056223], [-0.80606272275779389, -1.9224899537654236, 3.8389715559765332, -1.0828023768387682, -4.2969507105754134]])  
       res=arg0*arg1  
       s0=numpy.array(-4.40874524263)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-3.3845370295934494, -6.4242815161314466, 17.907134230823452, -3.400897995212866, -15.745434025446791], [15.203789942953184, 7.5565950072997135, -9.800777293914928, -10.461352669609406, 15.595117209443337], [-21.546442463185308, 8.5912360336186691, 11.255565122711326, -18.578993043159524, -16.903030851354316], [3.5537251942221828, 8.4757684376729419, -16.925047584014738, 4.7737998275995652, 18.944161003077607]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_array_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[-1.522300541861159, 4.4412233510677233], [-1.0349131229335518, -1.3356999436417882]], [[-1.2853209213356722, -2.8137395206848126], [-3.6113929107312561, 0.81299832389533755]], [[-4.1922417914811883, -0.091025787085811771], [0.9777559209167217, -4.6593961220125557]], [[1.9512665378984568, 2.8951111516233787], [3.3082566022997799, -4.2870122432092304]], [[2.9712961128505064, 0.55848309366950755], [-1.1821727974410945, 4.3203671963116932]], [[3.3734286896392582, 2.8940709715409003], [4.0398945281002714, 1.3577109731061512]]])  
       res=arg0*arg1  
       s0=numpy.array(3.6538015637)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-5.5621841002810806, 16.227348824893848], [-3.7813671868733065, -4.8803825427188787]], [[-4.6963075922388686, -10.280845860536372], [-13.195313064382562, 2.9705345471382265]], [[-15.31761961314289, -0.332590163191606], [3.5725261127672172, -17.024508836529904]], [[7.1295407273783784, 10.578161652900921], [12.08771314661991, -15.663892037859828]], [[10.856526383363395, 2.0405864009523826], [-4.3194248158596364, 15.785764417662909]], [[12.325839021250808, 10.574361041289027], [14.760972943975537, 4.9608064765945219]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_array_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[[0.57004751083308669, 0.79257365971206362, 3.4695437014711956, 1.1316815324403713], [2.3249952196386792, -3.0635560354711489, -4.6915328122245405, 1.5469264337175934], [3.9295896100235197, 3.5112462730341925, 0.96201956498031738, 2.7324643836778515]], [[2.4320179028217224, -0.29317615609428049, 3.7159823465704296, 0.86800647136786502], [-3.9703437945264355, -4.0212622298369274, -3.5723073891961157, -3.4489612270504133], [3.0782044933865684, 0.85434805262426394, -2.7752440372956877, -0.35920380309796851]]], [[[0.55460840756196195, 0.051170820695292107, 0.96886809931833984, 4.5238022211769895], [4.09835900374636, -1.8419757714220051, -0.14875417306983696, -4.161514824548588], [-1.860634931198625, -1.837759625553701, -3.4605490067546718, -2.3526168462716521]], [[-0.80877387002426726, -4.6769372336943107, -0.27201188461516868, 0.46618216111530408], [3.4163773667655288, -3.4840444745014123, 4.4474651978598789, -4.2763155861668123], [-3.348002236991455, -2.6484641823621402, 4.9117492075430036, -1.418507743928962]]], [[[3.4326256184205928, 0.29840477155415712, 3.3921314632123103, -0.06167257156601913], [-4.1866111554386256, 4.3663744779541567, -0.89999823445457316, 4.7374915286789872], [3.8416313880592838, 0.072977533953916485, 0.4133211084639008, -3.5333119169712948]], [[0.13195008445524348, 4.8267386646641395, 2.2350617951514646, 2.494481196437107], [0.82464399105577879, -2.1713699219092932, 3.0420962088199985, -3.478618548675537], [2.7732122200360081, 2.6150463262137915, 2.7295682328507178, 0.058868007088567431]]]])  
       res=arg0*arg1  
       s0=numpy.array(1.25653182283)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[0.71628283788783265, 0.99589402536647564, 4.359592071604216, 1.4219938588223924], [2.9214304814078269, -3.8494556495979464, -5.895060276419736, 1.9437622915458741], [4.9376543956637828, 4.4119926798670424, 1.2088081975845801, 3.4334284528457206]], [[3.0559078885921673, -0.36838516982796865, 4.6692500715469576, 1.0906777536976682], [-4.988863325405255, -5.0528439597416908, -4.4887179154621286, -4.3337295375018812], [3.867861903124084, 1.0735155158967709, -3.4871824489862537, -0.45135100947480783]]], [[[0.69688311331167774, 0.064297764604054938, 1.2174135989200618, 5.6843014511060996], [5.1497185095965623, -2.3145011736769159, -0.18691435224128033, -5.2290758082316247], [-2.337947001723542, -2.3092034522236911, -4.3482899514562465, -2.9561379342705361]], [[-1.0162501051603274, -5.8767204675238611, -0.34179158920741304, 0.58577272067788422], [4.2927868801432183, -4.3778127543723446, 5.5883815520478963, -5.3733266184902515], [-4.2068713536918407, -3.3278795267682515, 6.1717691850466938, -1.7824001211800926]]], [[[4.3132033254131859, 0.374955091542654, 4.2623211307552893, -0.077493548768575088], [-5.260610146631274, 5.4864884819500164, -1.1308764220846128, 5.9528088661812513], [4.8271320906860167, 0.091698593764884762, 0.51935112583300824, -4.4397188636652869]], [[0.16579948014335796, 6.0649507326431928, 2.8084262716034005, 3.134395004778785], [1.036191417268614, -2.7283954060188425, 3.8224906944983221, -4.3709949059038076], [3.4846294059412872, 3.2858889270670355, 3.4297893471677066, 0.073969524253473362]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_constData_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Data(4.12882773659,self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array(4.29208272207)  
       sub=res.substitute({arg0:s0})  
       ref=Data(17.7212701906,self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_constData_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([-3.487189870854742, -4.7322416587365348]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array(4.25025085497)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-14.821431730052977, -20.113214155983023]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_constData_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[-4.7566673706979596, 3.6865042716351457, 3.5301620745792448, 2.7802907377458963, -4.5008736089145627], [1.1919872210214706, 3.51935375918546, -0.46459853762211623, -2.6150881676169768, -2.9389879391749965], [3.7942428793654255, -0.058418474440401269, 4.5511517463836029, 3.1252033164390163, -3.0202010090215659], [-1.6321467266690615, -1.5106730259246515, -1.6835059434166788, -2.300269324480734, -2.2675545859443536]]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array(-0.996168777636)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[4.7384435202882731, -3.6723804540239322, -3.5166372386898606, -2.7696388256924616, 4.4836297612856439], [-1.1874204529224506, -3.5058703323557316, 0.46281855731440302, 2.6050691833448436, 2.9277280228543106], [-3.7797062911907879, 0.058194660274642665, -4.5337152720299825, -3.1132299676003981, 3.0086299473714182], [1.6258936096281884, 1.5048853016427328, 1.6770560577959945, 2.2914564812010965, 2.2588670801026356]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_constData_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[-3.0715144593695265, 3.2900475320153877], [1.953817156550901, 3.839773541274571]], [[4.6306799850694365, -0.19429392027819148], [0.8806902281988247, 3.3896528802937258]], [[-4.3549018689023136, -0.1282313308733265], [-0.33708658805644021, 3.7714738045302969]], [[3.0043011894136278, 4.4447491720075085], [-3.4017908590022694, 3.7782512053746213]], [[-0.20128788175413082, -3.7129374697892539], [-2.0491749069396068, -2.9742257711444218]], [[-2.9466653292391487, -4.7563491382111609], [0.92606115852405679, -4.9879842893225455]]]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array(3.79859949806)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-11.667453283654233, 12.497572903716959], [7.4217688701810678, 14.58576184656105]], [[17.590098666974992, -0.7380447880454245], [3.3453894587850161, 12.875933729691441]], [[-16.54252805332581, -0.48709946909136442], [-1.2804569441949523, 14.326318500846419]], [[11.412136990136585, 16.883821973803514], [-12.922041049521214, 14.352063132291841]], [[-0.76461204659739934, -14.103962409080646], [-7.7839947729440198, -11.297892521395145]], [[-11.19320144060738, -18.067465449021146], [3.517735451945093, -18.947354617766592]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_constData_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[[1.0254255894201112, 0.35380763787272684, 4.0695025417182826, 1.9100836954809575], [-0.2669962185421717, -1.8622861218073608, 2.5375785734291769, 4.643088639446626], [3.1255663262798521, 3.8438507159072106, 0.60926532945627798, 3.1078375283570931]], [[-2.9307690375522233, -4.5905739674667911, -4.1821643001470701, -2.0281769514762313], [3.067805244033682, 4.8560021262113136, 2.7254751367356214, -3.2185043256857861], [-0.13260275055946202, -1.3653988648608073, -0.35228776168152898, 3.236126520702955]]], [[[-1.5226539724787225, 3.2074039812327744, -2.4210279507372934, 2.8147079057834192], [-0.94911495816773606, -0.23948900503241966, 4.5766621943597112, -1.6120669699093249], [2.2477378110699684, -4.6353547155058985, -4.1511655847023663, -4.8749209546768846]], [[0.99462006845624273, -3.5610878308235039, 0.79299710767857601, -4.9486477790410941], [-3.7998877723616675, -2.0659778696097941, 2.8169577673975184, -2.858431355918861], [-4.431972381232069, 1.2159534330564394, -3.2059689441689732, -4.0635237097661978]]], [[[1.8801029270434899, 1.1129789860635935, -1.6794583434314991, -0.26236379736947768], [0.38351954236795294, -0.83337901319415764, 0.37600677359349799, -1.0089847751735572], [-3.6173892764365645, 4.0894067489956836, 3.696879322723797, -4.3868846068081782]], [[-0.015300748318272994, -1.022876856783931, 2.4142537963331465, 1.4198997014875285], [4.5002081884478109, -2.7625606805073244, 0.29886974407053124, -4.038060976326415], [-2.1876489165567339, 0.17223532673451114, 3.448980830113257, 2.2257916852037116]]]]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array(2.20841948555)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[2.2645698526526581, 0.78135568161306124, 8.9871687096088042, 4.2182660521234716], [-0.58963965159557619, -4.1127089590608898, 5.6040379676645014, 10.253887424470255], [6.9025615783222189, 8.4888348205386475, 1.3455134254387242, 6.8634089555342941]], [[-6.4723674501646329, -10.137912999592942, -9.2359731321987919, -4.4790654997749826], [6.7750008787835636, 10.724089717376888, 6.0189923993375434, -7.1078076671579273], [-0.29284249817248481, -3.0153734587007199, -0.7779991574168027, 7.1467248660119314]]], [[[-3.3626587025657253, 7.0832934501716265, -5.3466453014592501, 6.2160557852519078], [-2.0960439676406128, -0.52889218528757109, 10.107189968784773, -3.5601201083525238], [4.9639479803649769, -10.236807676139822, -9.1675149649838197, -10.765870426803954]], [[2.1965383398936615, -7.8643757553306424, 1.7512702645788263, -10.928690182337286], [-8.3917461993707203, -4.5625457839526646, 6.2210244234802659, -6.312615504506307], [-9.7876541661137093, 2.6853352550781482, -7.0801242863574476, -8.9739649406250166]]], [[[4.1520559389145317, 2.4579244798258442, -3.7089485307965884, -0.57940932241254373], [0.8469720304529943, -1.8404504515829059, 0.83038068550108801, -2.2282616381123295], [-7.988712964886922, 9.0311255488045603, 8.1642603320145835, -9.6880814465160956]], [[-0.033790470729506174, -2.2589411818354712, 5.331685126875036, 3.1357341682857194], [9.9383474523808992, -6.1008928368350333, 0.66002976644544675, -8.9177325439413426], [-4.8312464948570435, 0.38036785165984144, 7.6167964704960367, 4.9154817283696941]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_expandedData_rank0(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-0.311572477677)+(1.-msk_arg1)*(4.3963271303)  
       res=arg0*arg1  
       s0=numpy.array(-4.82850314065)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(1.50442868701)+(1.-msk_ref)*(-21.227679356)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_expandedData_rank1(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([0.95220277657435037, 3.1312998091270643])+(1.-msk_arg1)*numpy.array([-2.7816286982074399, -4.3083229513338281])  
       res=arg0*arg1  
       s0=numpy.array(-4.2574251188)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-4.0539320191747947, -13.331274461858223])+(1.-msk_ref)*numpy.array([11.842575890911762, 18.342362352893321])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_expandedData_rank2(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[1.0549118227904017, -4.2764763911779742, 4.5681654973037329, 1.1453195994281344, -4.0075251121128108], [0.68588782721152786, -4.9185099423903367, 1.2142017168607513, 2.5301540213620193, -4.8683903030404689], [-1.4067760251301809, 0.29843155015513823, -2.0361477658964411, 0.37079655086606511, -0.46581654472586198], [0.74835565928812109, -2.230085659345431, 0.68617312122543517, -2.5998437011266962, 3.0076363544395992]])+(1.-msk_arg1)*numpy.array([[-2.1120879446290042, -0.7533152187175931, -4.7886650266908317, -2.181703878327319, 0.64354016509777701], [-1.6828519070778181, 2.5166147231284617, 3.928531381661605, 0.11193911167318049, -4.6621348190665088], [-4.1192686570236559, -1.0217680883457412, 0.97082189889331794, -1.9392446160223633, 3.0158963660131075], [-3.1965675161325735, 0.9642634012796254, -2.8403792468225033, -4.8527016868844033, 4.4921078686011224]])  
       res=arg0*arg1  
       s0=numpy.array(-2.23524781217)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-2.3579893439277826, 9.5589844971904814, -10.21098193349281, -2.5600731288607088, 8.9578117390789185], [-1.5331292651707289, 10.994088587879641, -2.7140417311498162, -5.6555212407104252, 10.882058773675944], [3.144493032389807, -0.6670684695676995, 4.5512948389811658, -0.82882217908470368, 1.0412154124725159], [-1.6727603501511306, 4.98479409101048, -1.5337669679911414, 5.8112949449354625, -6.7228125810733923]])+(1.-msk_ref)*numpy.array([[4.721039957349161, 1.6838461945152003, 10.703853024140521, 4.8766488208407068, -1.4384717460803216], [3.7615910435070221, -5.6252575539555059, -8.7812411759124682, -0.250211654464077, 10.421026654374446], [9.207586253365351, 2.2839048840231087, -2.1700275255110233, 4.3346922852324514, -6.7412757538716015], [7.1451205468989354, -2.1553676580688745, 6.3489514972018783, 10.846990828737075, -10.040974285336226]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_expandedData_rank3(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[0.7019890759261127, -3.6043203452594774], [-1.5987988639731898, 4.3629931529885226]], [[-4.3642328363694496, 3.9953544524695133], [-2.4952257874718473, -2.4929908993012253]], [[3.9346028122077783, 1.3281258581241371], [-1.0560539212662845, -1.2848173959323974]], [[1.8788180959086942, 2.0816708316905643], [-4.2146610648033072, 3.5131741539578982]], [[-0.52566639549556182, 2.426444066260915], [4.4703829477114621, -1.2359778587957782]], [[-0.075375149765330995, -4.4828875725254562], [2.5537562060348717, 1.2240902351465994]]])+(1.-msk_arg1)*numpy.array([[[1.9339983271503787, 4.7130999687716741], [0.76606446845221576, 1.2628886545127047]], [[-4.4019268924630435, -3.2995220943648498], [3.6022768870978954, 4.3754225847849462]], [[-2.6413880257380509, -4.1567701175061682], [-0.093170680353541258, 2.5193464911215599]], [[0.59105115148110166, 2.2367393200648973], [2.9849286370356616, -4.7025379771465738]], [[4.7797732944586393, 0.32560119180280722], [-4.1519166841461494, -2.2189893458976186]], [[-4.522107676267848, 0.64179915822566347], [1.9325120045242166, 1.2109500485399662]]])  
       res=arg0*arg1  
       s0=numpy.array(1.74044847648)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[1.221775817702317, -6.2731338536584298], [-2.7826270470026238, 7.5935647860184519]], [[-7.5957223910701055, 6.9537085698044727], [-4.3428119202829345, -4.3389222125712683]], [[6.8479734700671795, 2.311534626347949], [-1.8380074383503062, -2.2361584793075755]], [[3.2699860926103153, 3.6230408275519923], [-7.3354004291231618, 6.1144986038704978]], [[-0.91489527717781571, 4.2231008783915867], [7.7804711906336612, -2.1511557813060809]], [[-0.13118656457364147, -7.8022348458401511], [4.4446810980987799, 2.1304659848368814]]])+(1.-msk_ref)*numpy.array([[[3.3660244420068066, 8.2029076601540556], [1.3332957370043326, 2.1979926347125129]], [[-7.6613269535706126, -5.7426482022546246], [6.269577320014351, 7.615197571652069]], [[-4.597199765192487, -7.234644218097781], [-0.16215876867407342, 4.3847927622017409]], [[1.0286940761179686, 3.8929295418934018], [5.1951144987349647, -8.1845250579215385]], [[8.3189491482678957, 0.56669209821378352], [-7.2261970674006308, -3.8620366263963746]], [[-7.8704954156460474, 1.1170183671410183], [3.3634375740565425, 2.1075961670766832]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_expandedData_rank4(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[2.1862684623673712, 4.3254923151184546, -3.8901677601932585, 0.3115152636203522], [2.1769616428179752, -0.10317722451117284, -2.2536328815724573, -0.86156653818483253], [2.5395960221102563, 0.10950074910341812, 4.9854792169248707, -0.65224087364948424]], [[3.83143844460335, -2.2982783589854372, -1.7599925316566001, -0.50250837976119911], [3.7854219856294442, -3.3962883047758154, 1.9112740728565445, 3.4888296408644095], [4.4604033148967854, 4.5072615962821931, -1.772374048526034, -1.1580987808800645]]], [[[-2.4859424112324757, -4.3281715345421343, -3.2242540145435141, -3.9202507691984003], [3.3045145522601249, 0.55402679243285746, -1.2676446993576409, 4.5806679497842815], [3.3448668043386895, 2.4350635809618453, -2.8836639850217063, 0.93627281910653615]], [[2.0444609327013925, 1.5822464709857655, 2.8773553208155391, 2.9949598300977751], [-3.1637981876108254, -1.692909529276756, 0.47418992469904353, 2.6954413556028864], [4.7768526036643824, 2.2406153081587945, 4.7529446448624473, 4.6359377185387523]]], [[[-1.0866968737566793, 3.1020464792222704, -2.6189138669905079, 4.6298069163810123], [-1.7973173035450429, -4.3664015321476315, -4.1383655132119799, -4.1784406530195009], [3.3329039346157376, -2.0499765081751642, -0.66451202257116826, 1.6928056124875726]], [[2.5415366289017918, -2.1141694441299386, -4.9761900354210091, -4.496894075746253], [-3.56718572990368, -3.7948299963083789, -2.6075433398450487, -2.7102153033677743], [-1.4595503751078533, 1.3747982377887986, 3.8747030668419313, -2.9278134056173255]]]])+(1.-msk_arg1)*numpy.array([[[[4.2577703716838791, -4.6424903325033142, 3.630655383488735, -1.924095398410921], [2.7989578431628637, -2.2418608914511893, 3.7882421093976042, 1.1391776501478077], [3.6853885162711233, 3.9528834795042336, 0.045908674618076795, 2.1632489502031849]], [[-2.7566010284076259, 2.9572203275808553, -0.51609316845262221, 4.1321203134492333], [-0.028097621857110511, 1.2527620206379453, -0.067463607261130321, 0.8261422534091114], [-0.14051550840412563, 4.4402872085450014, -4.3020183596330819, -0.66790596426605298]]], [[[2.5286961674056556, -4.7481051572896762, -0.21071009573666455, -3.5184422171104544], [-2.926915435498052, 0.12359717386660218, -2.0696089015429897, -1.0386016395967177], [2.3590209546091732, 3.4050018657440777, 1.7682055717862788, -1.5311775446447715]], [[3.6004435773120296, -0.73342002238001136, -2.6333495447896982, 0.85328257157177401], [0.33311423337835855, -1.8227454472325699, 0.69686124068275035, 4.8457008242291764], [-0.8290137313827719, 0.7727029363716218, -4.7942800685359712, -4.4575286599941428]]], [[[4.8236551133887922, -1.0102576065199873, -4.0858608235605303, 1.8580966922838424], [-1.6520926674224832, -1.9490087192685426, 1.0074893215951164, -3.1224234935383164], [3.528198641136095, -1.5576303063922925, 0.76939813610091168, 2.2478981299455505]], [[-0.59295438213726648, 1.4761752751184911, 0.0024443061683445677, 4.230488019481971], [0.68753476730222918, 3.9497451389548246, 1.0324166044016092, 0.27901192753383075], [-2.7971304387194063, 0.41772451933693144, 0.37506248342038528, 4.2389712735818925]]]])  
       res=arg0*arg1  
       s0=numpy.array(3.46653515801)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[7.5787764896421157, 14.994471186054577, -13.485403311261894, 1.0798786135962999], [7.546514072464892, -0.35766747627373779, -7.8122976172153837, -2.9866506955815684], [8.8035988977842479, 0.3795881965952887, 17.282338984991753, -2.2610159199962485]], [[13.281816073963688, -7.9670627343135623, -6.1010759888203472, -1.741962965636185], [13.122298401083578, -11.773352815239138, 6.6254987701476962, 12.094150610359348], [15.462144909988265, 15.624580789854646, -6.1439969523577176, -4.0145901403677593]]], [[[-8.6176067693223022, -15.003758794382781, -11.176989899765791, -13.58968711963691], [11.455215875561105, 1.9205533544472897, -4.3943349181866331, 15.879046495090849], [11.59509837609628, 8.4412335153908042, -9.9963225879612221, 3.2456226449207288]], [[7.0871957023846388, 5.4849130203073511, 9.9744533816904735, 10.382133547857705], [-10.967417650197136, -5.8685304025658356, 1.6437960455427332, 9.3438422255480411], [16.559127495227987, 7.7671717413049626, 16.476249715484855, 16.070641091653233]]], [[[-3.7670729189756726, 10.75335318200111, -9.0785569957191203, 16.049388450426633], [-6.2304636228362886, -15.136284425172827, -14.345789548240052, -14.484711429344937], [11.553628667610989, -7.106315638681119, -2.3035542891624265, 5.8681701713626246]], [[8.8103260794549758, -7.3288427080641458, -17.250137710719493, -15.588641415415431], [-12.365774747858039, -13.154911600869028, -9.039140663604293, -9.3950566348976086], [-5.0595826901961622, 4.7657864264632774, 13.431794408051696, -10.149368106661651]]]])+(1.-msk_ref)*numpy.array([[[[14.759710688169944, -16.093355958338247, 12.585794533477264, -6.6699443459542174], [9.7026857691082729, -7.7714895995802769, 13.132074459275842, 3.948999375455112], [12.775528862575372, 13.702809557213195, 0.1591440346211449, 7.4989785414047549]], [[-9.5558543815779782, 10.251308235537044, -1.7890551132491221, 14.324140343693703], [-0.097401394024107329, 4.3427435891594603, -0.23386496645679938, 2.8638511669592188], [-0.48710195012836871, 15.392411720077563, -14.913097894067, -2.3153195073719761]]], [[[8.7658141682335629, -16.459473461667098, -0.73043395501852704, -12.196803647035475], [-10.146255261672348, 0.42845394863909075, -7.1743720205265431, -3.6003490988275044], [8.1776290776319485, 11.80355868068707, 6.1295467811840147, -5.3078807916645392]], [[12.481064245178771, -2.5424262931678383, -9.1285987803396988, 2.957934034069631], [1.1547522016391956, -6.3186111769319986, 2.4156939910803179, 16.797792272382182], [-2.8738052463103605, 2.6786018956287876, -16.619540414920312, -15.452179817701111]]], [[[16.721370040670699, -3.5020935116472569, -14.163780195602966, 6.4411575107816157], [-5.7270373159084151, -6.7563072486099145, 3.4924971546278063, -10.82399081854293], [12.230624633936799, -5.3995802202887475, 2.6671456893001744, 7.7924178990782638]], [[-2.0554972127741609, 5.1172134905814168, 0.0084732732695039798, 14.665135455068853], [2.3833634432065089, 13.691930389360865, 3.5789084568701397, 0.96720465629980035], [-9.6963510073571264, 1.4480567326437586, 1.3001672852268213, 14.694542953660553]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_Symbol_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=())  
       res=arg0*arg1  
       s0=numpy.array(3.27578763202)  
       s1=numpy.array(4.64015534273)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array(15.2001634824)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_Symbol_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(2,))  
       res=arg0*arg1  
       s0=numpy.array(-3.19055356322)  
       s1=numpy.array([-2.1774480208593729, 3.2809425023892018])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([6.9472645416831238, -10.468022791723708])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_Symbol_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(4, 5))  
       res=arg0*arg1  
       s0=numpy.array(2.88365719838)  
       s1=numpy.array([[-2.729709414142667, 4.6283564123167906, -2.6887971907521324, -2.6720290537992564, -3.682985430597955], [4.882708339508655, -2.8494148521304674, -0.91974761877363775, 2.4424830268618392, 2.9008677126526186], [3.118486806696696, -1.0793525793111947, 3.1473221605075317, 2.9586914736788286, 2.186774281301286], [0.99156331322435598, 3.2310749690234495, -1.5905827303989728, -4.2578725637513877, 3.493865024391539]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-7.8715462015799647, 13.346593285048614, -7.7535693740980927, -7.7052158152704981, -10.6204674484749], [14.080057050817429, -8.216735649518796, -2.6522368415700748, 7.0432837623327336, 8.3651080611407735], [8.9926469281860548, -3.1124828349214622, 9.0757982037705247, 8.5318519658614473, 6.3059073975081548], [2.8593286858295945, 9.3173125929320495, -4.5866953401349679, -12.278244868249219, 10.075109027757094]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_Symbol_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0*arg1  
       s0=numpy.array(-3.40745469088)  
       s1=numpy.array([[[0.26790810735883319, -1.8914981291445834], [-1.4608512054047198, -2.3343123104530128]], [[-0.29681555165166795, -1.7782527081331159], [4.2135634072434378, -3.082918614836323]], [[-4.7813691958093605, 3.8998129272424773], [4.0042689969625869, -3.9965690787198724]], [[-0.91602743069198933, -2.9627782879986198], [4.1545315397276799, 3.804380748474518]], [[0.65736504537292362, -2.3970807589575402], [-2.0639472519439463, -3.8607292233053023]], [[-3.6169691058740403, -1.2034990661296465], [-2.972986140359585, -2.5185292768502467]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[-0.9128847371433062, 6.4451941729350466], [4.9777842925267484, 7.9540634322204387]], [[1.0113855438001345, 6.0593155318894043], [-14.357526397311011, 10.504905495709966]], [[16.292298895065958, -13.288435852467446], [-13.644365177225602, 13.618128054690111]], [[3.1213219656816169, 10.095532775463576], [-14.156377983433327, -12.96325502726414]], [[-2.2399416074732428, 8.1679440765161377], [7.0328067453550194, 13.155259902149949]], [[12.324658346560547, 4.1008685383471768], [10.130315569874707, 8.5817743985094612]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank0_Symbol_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0*arg1  
       s0=numpy.array(-0.543726522387)  
       s1=numpy.array([[[[0.42972211737078414, 1.0964262496127555, 3.1768700080606784, -2.7180267440927852], [4.4230540044227222, 4.5632991360025859, -2.5949595417053528, -2.8847966623836943], [3.1952835346972375, -3.1392058717477953, -2.8811500501224119, 1.5466436971640558]], [[-3.0374823829434447, -3.5384033754439406, 4.0603582252338626, 3.7098643356337551], [-4.5976072323474462, -1.9939098727606144, 3.047040046915189, 0.35399313156942647], [2.79402723566273, 1.5612762510727691, 1.6362657486385226, -4.4922926443984785]]], [[[-2.5326135074096525, 3.7851200930977829, -3.9754590859538608, 1.0240776764488384], [4.117422782321615, 1.857839401651658, -0.0035999165629618801, -0.89321868754429357], [-4.9579315314656958, -0.47629193706821393, 1.5064083725104327, 4.035184722156508]], [[-3.3080141965252476, -2.2645044462949415, -3.5834596195939072, -1.0052258119678124], [0.42318054376883385, -0.88385200808750497, -4.4189623152112372, -4.3156913627844187], [-3.5827620552005457, 1.3833226377520145, -0.19096924618453848, -4.5721824064515761]]], [[[-1.8231658612112156, -1.0919466606405557, 4.80014148778994, -2.4444735772914097], [2.299339960436388, -1.4713933831612405, -4.8264676049499853, 0.28715133552513983], [-0.33038904429687488, -4.2233836159988076, -3.9350038564338483, -1.4748369248526458]], [[-0.042801621345733842, -2.4218666359399146, 2.5439610789969871, -2.6665283185282185], [0.45114038986938709, -1.1793426890889256, -0.63707906228498423, -0.41187861871241616], [-1.4893035820034584, -4.9155930865835273, 1.2654662263274865, -2.4769954887580425]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-0.23365131247085683, -0.59615603175592291, -1.7273484815588527, 1.4778632293208236], [-2.404931772155301, -2.4811867698309475, 1.41094832734679, 1.5685404570319277], [-1.737360404361832, 1.7068694917027334, 1.5665576972286064, -0.84095119883100811]], [[1.6515597328900562, 1.9239237621330678, -2.2077244574524464, -2.0171516337422362], [2.4998409917462614, 1.0841416810695228, -1.6567564882835577, -0.19247545437717917], [-1.519186712301863, -0.8489073064814352, -0.8896810852084216, 2.4425786570841344]]], [[[1.3770491349345593, -2.0580701850377623, 2.1615625436980692, -0.55681819366983432], [-2.2387519706293326, -1.0101565570138695, 0.0019573701136631452, 0.48566669070966823], [2.6957588698374129, 0.25897255858313667, -0.81907418567997581, -2.1940369561678943]], [[1.7986550550839773, 1.231271127514175, 1.9484220370765553, 0.54656793495505229], [-0.23009448540532887, 0.48057377866231349, 2.402707012209651, 2.3465558563830089], [1.9480427528148117, -0.75214920716431455, 0.10383504411081358, 2.4860168395796016]]], [[[0.99130363345133776, 0.59372036042234488, -2.6099642381222785, 1.329125117247921], [-1.2502121204738719, 0.80003560728971668, 2.6242784462536664, -0.1561317970639084], [0.17964128609035204, 2.2963656862338753, 2.1395659624387791, 0.8019079522382796]], [[0.023272376726847236, 1.3168331236450626, -1.3832191105712799, 1.4498621694801883], [-0.24529699529206245, 0.64123989904102496, 0.34639678302187754, 0.22394932899812273], [0.80977385742145802, 2.6727383344383515, -0.68806755043942747, 1.3468081430710559]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_float_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=-4.05534560973  
       res=arg0*arg1  
       s0=numpy.array([3.1198052903544529, 4.3445984354746106])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([-12.651888687451903, -17.618848191342547])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_array_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array(4.82220556333)  
       res=arg0*arg1  
       s0=numpy.array([3.9800039592802285, 2.9366735742353089])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([19.192397234535882, 14.161243647375969])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_array_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array([2.5046167485017143, 2.0901664229688137])  
       res=arg0*arg1  
       s0=numpy.array([-1.8879480660149737, -0.94591663351846478])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([-4.7285863464425235, -1.9771231863079919])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_constData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(0.127427756678,self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([4.2716726912442322, -0.71184535333915111])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([0.54432966830888063, -0.090708856477825131]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_constData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(numpy.array([-0.14881546012353652, -0.19119684508667412]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([4.9585997286793386, 3.8137239583096374])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-0.73791630019185916, -0.72917198886026535]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_expandedData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-1.82256697768)+(1.-msk_arg1)*(-1.56302957219)  
       res=arg0*arg1  
       s0=numpy.array([2.3630097005999033, 0.56679021033550914])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-4.3067434482425435, -1.033013120627799])+(1.-msk_ref)*numpy.array([-3.6934540414087471, -0.88590985998201355])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_expandedData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([3.1497923711438816, -2.4663395184492778])+(1.-msk_arg1)*numpy.array([4.86461337066123, 3.5904738431316989])  
       res=arg0*arg1  
       s0=numpy.array([1.4282861654063908, 4.954110874309487])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([4.4988048676073982, -12.218519428088792])+(1.-msk_ref)*numpy.array([6.9480599773663858, 17.787605510182527])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_Symbol_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=())  
       res=arg0*arg1  
       s0=numpy.array([2.6971542837570537, -0.69052681477674316])  
       s1=numpy.array(-4.77813194463)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([-12.887359042822441, 3.2994282323102069])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank1_Symbol_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=(2,))  
       res=arg0*arg1  
       s0=numpy.array([-1.9003754306248788, -3.7743358256192505])  
       s1=numpy.array([-2.3647439885306252, -2.9534773301417969])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([4.4939013755214798, 11.147415297308479])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_float_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=0.0299863446824  
       res=arg0*arg1  
       s0=numpy.array([[-0.62667861177158102, -2.5525350207561956, 4.2824436780961914, -2.4434669123113206, -1.747890856215836], [3.7391713632630399, -0.86298484989527058, -4.9404172464735581, 4.3631645417500149, -3.4483867566739148], [1.5301253486269584, 0.74298686549049808, -0.16767995888774934, -3.264484349475488, -4.969947627678156], [1.4523929974403966, -4.097414998986558, 4.8871888259266409, 2.6049473405041681, 3.1081701346586854]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-0.018791800857639963, -0.076541194946167693, 0.12841483221414812, -0.073270641052487609, -0.052412857681617971], [0.11212408132518245, -0.025877761164606671, -0.1481450544273884, 0.13083535585472875, -0.10340451388367905], [0.045882866111130731, 0.022279460243057762, -0.0050281090435305258, -0.097889952913512934, -0.14903056261679071], [0.043551957035480919, -0.12286649846624652, 0.14654892866197142, 0.078112848831731987, 0.093202660989265204]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_array_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array(3.16444172789)  
       res=arg0*arg1  
       s0=numpy.array([[-4.8725088305701378, -3.8756115238245501, 3.021783589988015, 1.6743605859943855, -3.255899039076243], [0.63975100551336261, 2.1438223533020579, 1.0554204001880931, 0.44980186145803103, -2.4590515611935304], [1.3405471557485926, 0.47045402800288372, -2.6863323388024716, 4.0017590911026435, -3.8897031319318054], [1.9070764981986734, -4.0147941704030323, -4.8002908503782225, 0.30942933418010554, 0.488521295802542]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-15.418770262960821, -12.264146827075528, 9.5622580848064658, 5.2984165058522956, -10.303102781044585], [2.0244547773050421, 6.784000911968926, 3.3398163548198689, 1.4233717796796674, -7.7815253712699057], [4.2420833578529473, 1.4887243572654998, -8.500742147882562, 12.663333452841934, -12.308738899783176], [6.0348324491751564, -12.704582201706419, -15.190240672937707, 0.97917109691224824, 1.5458971733996729]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_array_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array([[-3.6958973725237811, -0.40310848847419045, 0.075108122483240614, -4.8016223039739412, -0.14606544688871015], [-2.92307108891697, 2.5427765925665415, -2.5079671580372418, -0.087843540771573636, -4.4613789808805198], [-4.169138037413477, 3.0379789387488607, 4.6140964642030742, 0.53690815775183953, -4.2920280031169629], [4.7952426892715181, 1.6996133357630665, 4.0264384023137794, 3.623784110267362, 4.5719940903996594]])  
       res=arg0*arg1  
       s0=numpy.array([[4.5631136532071164, 2.2609358162556079, -3.5639432947554193, 2.0627228771657089, -1.8312104037473453], [-0.44235754694430796, 3.3430772683771206, 0.78477896159094929, -0.50000733882573645, 1.8921043866913481], [2.1846320191712589, -0.34920334826435617, 4.7054993743582738, 1.5902546707962495, -2.1018229653361544], [0.86849077933277208, -1.5264343200990202, -3.2754009243841287, -0.62793112870877721, -2.4258415965329307]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-16.864799761415572, -0.91140241942795808, -0.26768108950581415, -9.904416173916168, 0.26747656597061131], [1.2930425564371379, 8.5006986251706369, -1.9681998619886709, 0.04392241505422461, -8.441394740416607], [-9.1080324488783031, -1.0608724173676976, 21.711628025536289, 0.85382070565347234, 9.0210830248171092], [4.1646240602951989, -2.5943481266067243, -13.188200064914307, -2.2754868465571167, -11.090933443594235]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_constData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(-4.93069625962,self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([[-2.3291736159646605, -0.032185216729903487, 2.8692389185274623, -0.061183340766605809, 2.0862555045691931], [-2.1186831452592205, -1.8048950174430125, -2.323628122308079, -2.1987098893598542, -3.7380461986486235], [4.8742198429774035, 1.2938647847873312, 3.74299889585145, -2.475564234598906, -2.61167042807813], [-0.98295934368217175, 4.8860328699326239, 4.8040677447329561, 4.2901310505964609, -1.2076997054079239]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[11.484447636241841, 0.1586955277451845, -14.147345603538628, 0.30167646946894072, -10.286692212990328], [10.446583059648939, 8.8993891115124928, 11.45710449141159, 10.841170627455476, 18.431170409962402], [-24.033297548332801, -6.3796542548045414, -18.45559065553541, 12.20625531198513, 12.877353611084214], [4.8466739592519188, -24.091543996155693, -23.687398859914431, -21.153333124454299, 5.9548004201986631]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_constData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(numpy.array([[4.0716513801712821, 2.1238345023986618, 4.2083380194805891, 4.3162103729077224, -0.83071216029823525], [1.542267757443855, 0.42908199854271967, 0.28667707467688075, 2.1252364955345815, 1.796147983809937], [-2.8107136614044403, -1.6030731381680563, 0.40183301813773387, 2.8892142856723826, 3.8418937742749701], [-3.7063465214588409, 2.6077762666835111, -4.7090099567438681, -2.0125129564918143, -4.68151108220047]]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([[1.7785237983186519, -3.9458497236169632, -0.95285744138674211, -3.2339431801259853, 2.5907635506944882], [-0.7894565480157123, 1.8630929401499587, 2.1426147749216486, -1.6117444772591218, 2.8597331455685238], [-3.2291357803648868, -3.6503161782510385, -2.9679868368320186, 1.3459948162365301, -4.1032140705427436], [-2.5397507422330055, -3.8357509710560711, 2.0496212753218099, -2.7126492515448164, 4.2145374722889901]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[7.2415288780916098, -8.3803317842979297, -4.0099461977328241, -13.958379099453964, -2.1521787860193449], [-1.2175533799075597, 0.79941964223037587, 0.61423853583400145, -3.425338184547392, 5.1365039236473526], [9.0761760524014754, 5.8517238111745185, -1.1926351084372759, 3.888867451511556, -15.764112592135625], [9.4131963288478087, -10.002780347228255, -9.6516869930444678, 5.4592417651517655, -19.730403882870064]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_expandedData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(0.389014392257)+(1.-msk_arg1)*(-3.89765147949)  
       res=arg0*arg1  
       s0=numpy.array([[0.0077871456971916331, 4.0662304375122389, -3.6229730762296697, -2.7418271774371572, -4.1707652944820497], [-1.7550256064814218, -0.38842597880437513, 0.48659510163078767, 3.2909059162222434, 3.617684860692858], [-1.3427632236009259, -0.69091999627943501, -2.879477098986186, 0.045442937416710905, -2.5289599898759398], [2.5074981514844641, -3.04948620630902, 4.4426218121711933, -3.7548164787468985, 1.2398602634961788]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[0.0030293117508060135, 1.5818221624238056, -1.4093886694112363, -1.066610233103138, -1.6224877262775392], [-0.6827302197000088, -0.15110329608122969, 0.18929249773590268, 1.2802097649725972, 1.4073314774580619], [-0.522354219373526, -0.26877782245052462, -1.1201580336786916, 0.017677956681513073, -0.98380183350265527], [0.9754528694840876, -1.1862940232419581, 1.7282438242873566, -1.4606776505145083, 0.4823234868869804]])+(1.-msk_ref)*numpy.array([[-0.030351579947696303, -15.848749080734155, 14.12108637073443, 10.686686754655497, 16.256189520661259], [6.8404781516526185, 1.5139490909608775, -1.8965781177858976, -12.826804313240029, -14.100474749623491], [5.2336230650786257, 2.6929653457107059, 11.223198175033337, -0.17712073225480818, 9.8570046461217373], [-9.773353879962535, 11.885834423717679, -17.315791479042506, 14.634966003617263, -4.8325431903820197]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_expandedData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[3.151385930740954, -0.18705783646469953, -1.3021024272604755, -0.38336419532578514, -0.5627711808449618], [-1.1937332281976722, -4.5055740233059272, -0.24201300635204959, 0.00029209670765784068, 3.0136972062987528], [4.088088719060547, -2.6964474581562667, 4.1869444042987798, 1.9996023319150744, -3.3086170974091855], [2.6057720088095842, -1.4952027581034075, -2.1616218607765934, 4.9421546379325036, -1.6060032767725838]])+(1.-msk_arg1)*numpy.array([[0.88022030363978043, 4.6148876548676725, 2.7330704385576432, -2.8889681197446713, -2.3149347581712378], [-3.2663480451227866, -4.8719731337322436, -0.94398001210868188, -0.65831533366779471, -1.2435456923820043], [4.5251965064372435, 4.6575526254490178, -3.6869016955770819, -1.6323459651298347, 0.268477323148824], [-1.6364343743911967, 3.3336652705554162, 0.82294367705927218, 0.77146727087564404, -4.8838511110390943]])  
       res=arg0*arg1  
       s0=numpy.array([[2.4502098623764725, 1.040646279213302, -4.2236491823002833, 4.8519147811091567, 2.0969210428636913], [-4.634009000097258, 2.5110874421313492, 0.91982407252284926, 3.3150295050492886, 0.78822194154031422], [-3.1316281980494489, -0.17191924006532844, 3.9111312358290853, -3.32920052031072, -1.5903785760192912], [-0.91784244455787256, -0.83687980587176547, -2.7319057711624528, 0.77761141786525911, 1.4713440254533108]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[7.7215568876559448, -0.19466104151467989, 5.4996238521699219, -1.8600504058491949, -1.1800867314310484], [5.5317705231831669, -11.313890349516733, -0.22260938910624042, 0.00096830920421349831, 2.3754622631634237], [-12.802373908737861, 0.46357119788231188, 16.375689042332759, -6.6570771238261948, 5.2619537479707015], [-2.3916881505262668, 1.2513049939405081, 5.9053472365264952, 3.8430758753120604, -2.3629833261377811]])+(1.-msk_ref)*numpy.array([[2.1567244690422034, 4.8024656670254444, -11.543530722983066, -14.017027122342299, -4.8542354072658389], [15.136286238549078, -12.233950554516353, -0.8682955391179763, -2.1823347547351069, -0.98019000004343781], [-14.171232981273727, -0.8007229079314705, -14.419956385002742, 5.4344070364373502, -0.42698058288289781], [1.5019889265497488, -2.7898771444638633, -2.2482045806998756, 0.59990175834225146, -7.1858251534308852]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_Symbol_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=())  
       res=arg0*arg1  
       s0=numpy.array([[-0.39570586021246079, -4.1070041430053292, 1.680441706253351, -3.3778682784565794, 1.6851733506120601], [-4.0148687973060078, 3.2532458137880056, -2.2174755109447872, -3.7977914643429256, -1.3029875013206405], [1.1298434474268912, 2.5486774277453881, 3.8600062258760914, 2.217375371447722, -1.5515484723070894], [-3.7374956938282313, -2.9223843539890626, 3.3424323115366068, 3.6408560268232737, 4.2787628513995735]])  
       s1=numpy.array(2.17110727177)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-0.85911987059122008, -8.9167465600885567, 3.6484192082404894, -7.3337143824548798, 3.6586921157151355], [-8.7167108410532652, 7.0631456431864272, -4.8143772067950144, -8.2454126649196144, -2.8289256391490643], [2.4530113246757579, 5.5334520967865881, 8.3804875860960131, 4.8141597932047437, -3.3685781707371762], [-8.1145040790978893, -6.3448099218668794, 7.2567790969925525, 7.9046889953215205, 9.289653140873968]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank2_Symbol_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=(4, 5))  
       res=arg0*arg1  
       s0=numpy.array([[4.650499655118665, 0.28670797743585741, 1.1346639949477479, -1.5790121024387416, -0.85485062338840567], [4.4824782485200849, -3.1005652514748547, -4.7385506223513518, 0.31984101372421136, -4.8912031412845716], [-3.5317107476759571, 0.83249915972990252, -3.1948521427357104, -0.34559596176327645, -0.95239630236267114], [2.1330911430158235, -2.2542695242625332, 0.75442029335458738, -1.2167003445761937, 4.5219584351418689]])  
       s1=numpy.array([[-4.3736056006777169, -2.7733804185218114, 3.6424282022809713, -4.7744594869667223, -4.5857327269835988], [3.9552003251921768, -0.0059655726723892855, 4.7792896195479972, 2.8004961077306412, -0.22176999811348441], [1.9381649670137655, -3.0680367531401131, -2.9550118383966675, 0.012027820312439097, -2.6872337711439043], [-2.4832257258372312, 3.8707569482025619, 3.7720186854756026, -0.81723078470947463, -4.5358028994935591]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-20.339451337576783, -0.79515029045460028, 4.1329321353104707, 7.5389293125239192, 3.920116480354543], [17.729099426213498, 0.018496647333158207, -22.646905801106517, 0.8957135140272765, 1.0847221114153485], [-6.845038044771532, -2.5541380190096024, 9.4408259037109836, -0.0041567661287932618, 2.5593115072215511], [-5.2969468018924371, -8.7257294241604839, 2.8456874432354891, 0.99432497735429093, -20.510712181505845]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_float_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=2.91657713678  
       res=arg0*arg1  
       s0=numpy.array([[[-0.27411938835651917, -0.4975269571005656], [-2.0447857609457367, 3.8261502044536506]], [[1.5734080248402069, -4.2607509138635944], [-1.6259756102123668, 1.2968628748320787]], [[1.1449346824506703, 1.4654456900267974], [4.7713468978134586, 3.2143380464411724]], [[-0.69282813716663938, 2.4999079265242861], [4.4185183217573112, -0.71444566649463503]], [[-0.61870092098766705, -2.5556571345193446], [-2.960510818591624, -0.15492361301114954]], [[-2.1037560284194323, 4.1388223855598341], [-4.6408836511387594, -4.3199768371793965]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-0.79949034082861714, -1.4510757480110077], [-5.9637753999867025, 11.159262208193903]], [[4.5889658720744118, -12.426808700887117], [-4.7422832897065597, 3.7824006102734349]], [[3.3392903179415749, 4.2740853947242829], [13.916001273806746, 9.3748648561309551]], [[-2.0206867045777837, 7.291174302554694], [12.886949515678904, -2.0837358963694772]], [[-1.8044889606570782, -7.4537711679866492], [-8.6345581666928286, -0.45184666765560094]], [[-6.1357667338502573, 12.071194742915191], [-13.535495151365289, -12.599545674734644]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_array_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array(1.13011288485)  
       res=arg0*arg1  
       s0=numpy.array([[[4.8126262790682333, -3.5932858037464377], [-3.2214884193807514, -2.2782350397236528]], [[1.3484528459177074, 4.2829253835076457], [0.84053913689055193, -3.1346017793814984]], [[2.3340924859971448, 1.2888435131036413], [2.2918103270706691, 2.2169961720029203]], [[1.1128075679517133, 4.9988637402908616], [2.7411611267733349, -0.74077600533022725]], [[1.0461190830445046, -1.2744702847733382], [-4.383369673632842e-05, 3.5153824410712122]], [[3.3386194489954644, -2.3022894358694455], [-2.2658323558555526, -3.7671385345518749]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[5.4388109679545193, -4.060818585771246], [-3.6406455711451446, -2.5746627731140364]], [[1.5239039357875583, 4.8401891607636172], [0.9499041088227711, -3.5424538597604522]], [[2.6377879928626631, 1.4565386607169242], [2.5900043802604737, 2.5054559396490617]], [[1.2575981709035511, 5.6492803225244206], [3.0978215088232095, -0.83716050841321799]], [[1.1822326548386262, -1.4402952901839223], [-4.9537025472439591e-05, 3.97277899183864]], [[3.7730168569287659, -2.6018469561357418], [-2.5606463402679447, -4.2572917969212556]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_array_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array([[[-1.2888902955556047, 1.686088012185011], [-1.8389731166020331, 4.179065351898327]], [[-1.354883677958366, 0.69972280651875796], [2.6262096283977501, 1.1416018494216509]], [[-4.8975457319725972, -4.2373519224797329], [2.6266050607665274, 1.5489566824135936]], [[-1.6519481949775527, 4.061551036016839], [1.9354550051673067, -2.5218818318937073]], [[1.014660005035517, -1.4114098718958079], [0.0090855432546614878, 1.9524211972536518]], [[0.56906411640134991, -0.61319994908931363], [-4.8537446012949079, 1.1493037873235306]]])  
       res=arg0*arg1  
       s0=numpy.array([[[1.1723354033041922, 1.6792955048921137], [1.9440663512902283, 1.1920190178822168]], [[0.65244488175911908, 4.8156427636867694], [4.86948519208579, -4.4420234103322533]], [[-3.4597420795495983, -0.52909111956993371], [4.762149761115392, 1.403842480640515]], [[0.63645697168644944, 1.0702492293737018], [-0.61792830336997717, -4.0733740686379711]], [[-3.9693679975081384, -4.5819752929166491], [2.6039553212802851, 4.9627185002846126]], [[0.13546214220077779, 1.2784071468561695], [0.68516884036792902, 0.32151210816695386]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-1.5110117244550394, 2.8314400197147682], [-3.5750857569133343, 4.9815253764354441]], [[-0.88398692106290644, 3.369615069798654], [12.788288896795969, -5.0710221404095694]], [[16.944245055424133, 2.2419452726766127], [12.508286662673799, 2.1744911914442016]], [[-1.0513939455583095, 4.346871866358982], [-1.1959724275919643, 10.272568058205051]], [[-4.0275589523394277, 6.4670451612052444], [0.02365834870469798, 9.6893167959585309]], [[0.07708664425731962, -0.78391919736761784], [-3.3256345599113279, 0.36951508358665269]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_constData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(4.81917399417,self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([[[2.5507399396489783, -2.6584155603662252], [3.6249977512411888, -2.5313885686449025]], [[-4.2937858328981822, 2.6242210080367396], [-0.93871985690942061, 2.3023934558657446]], [[-2.4977776909283023, 4.218167373642757], [-0.49317690537568204, 0.51148819563979675]], [[-3.0445541663640077, -1.2009439784847564], [0.45768302371445913, -0.90107442314554032]], [[1.9619144693685602, 4.2019317185707408], [-2.8098231745493796, 3.351066736373209]], [[3.8537318102048204, -0.92211303276152545], [2.5077766726095154, -4.7838269381959631]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[12.292459583051173, -12.811367134218013], [17.469494891712039, -12.199201959156765]], [[-20.692501022445331, 12.646577636889416], [-4.523854322230358, 11.095634666859056]], [[-12.037225291343644, 20.328082510122261], [-2.3767053169125112, 2.4649506107530601]], [[-14.672236262388198, -5.7875579895707068], [2.2056541254585418, -4.3424344268361574]], [[9.4548071895699248, 20.249840063420859], [-13.541026771009037, 16.149373668663241]], [[18.571804120250885, -4.4438231471710408], [12.085412123829943, -23.054094373171498]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_constData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(numpy.array([[[0.67486118533761097, 3.7553149929489056], [-2.7082372215235182, 3.7851710821045383]], [[-4.79769883143807, -0.10232161092825898], [0.00074126357390724706, -4.098125093580598]], [[-3.2330609686225795, -2.5186850910767866], [0.84288959023645482, 0.60563868996875314]], [[-3.4492564526643799, 4.3300428142337637], [3.8098963514686961, -1.4585886823527563]], [[2.7262396695468238, 0.45724940571616557], [-2.9266112028547653, 1.7939076573690329]], [[-2.7026009891206604, -1.5947101909384056], [-0.54561234725088426, -4.5119024594447579]]]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([[[-2.5229099465293556, -0.68827719475500171], [3.3747999951293135, 0.95844443670576673]], [[3.3586776476238125, -0.38398338998126391], [1.2876095945919772, 0.73993592430383259]], [[-2.1077532516198327, -0.7510799642014927], [1.2967086673326431, 1.7101051804482781]], [[-2.7054797948028386, -2.7491319933999669], [-0.96333780090382159, -2.8445416991566286]], [[0.27662261866319859, -1.8471356412856177], [2.3688546765061478, 4.3846114795698998]], [[-1.7947127643135108, -3.0650706787963578], [-2.8908395561063225, -2.4180617920633098]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-1.7026139970148497, -2.5846976687682717], [-9.139758962006594, 3.6278761656226419]], [[-16.113923825181931, 0.039289799032576823], [0.00095445808988451058, -3.0323499790312902]], [[6.814494769299408, 1.8917339080407862], [1.092982237264071, 1.0357058611954733]], [[9.3318936397767942, -11.90385923340167], [-3.670217172895347, 4.1490163288703377]], [[0.75413955649353559, -0.8446016742549971], [-6.932716634197793, 7.8655881077886081]], [[4.850392492021169, 4.8878994474230479], [1.577277755732875, 10.910058946699847]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_expandedData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(2.7616622597)+(1.-msk_arg1)*(3.72369052111)  
       res=arg0*arg1  
       s0=numpy.array([[[4.390025781528216, -0.4940436993986097], [-3.5969743471025097, -0.35557164744523462]], [[4.0197646813239949, 0.35167034286771592], [-0.21829781206295618, -0.062507219440274042]], [[1.7495683540135758, 1.8861869875202597], [-0.18030990820246018, 4.2219593091230738]], [[3.0002498827424979, -2.1305734189246106], [-1.4449730827711571, -1.4152537083685122]], [[-0.54164914151200083, 1.668801282028717], [2.2322443666428011, -3.3849889743984551]], [[-2.0007562020324245, -4.5408563414990972], [-1.6118871082188866, -0.48895509098065126]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[12.12376851994556, -1.3643818392704841], [-9.9336283034931085, -0.98196879936797454]], [[11.101232413277483, 0.97119471375265609], [-0.60286482894880689, -0.17262382888683561]], [[4.831716894040393, 5.2090114181672478], [-0.49795506853225757, 11.659625685983785]], [[8.2856768708318498, -5.8839242025587994], [-3.9905276289678775, -3.9084527542982723]], [[-1.495851992111251, 4.6086655195135355], [6.1647050217798052, -9.348196300088409]], [[-5.5254128940086824, -12.540311585026185], [-4.4514877936610624, -1.3503288214482292]]])+(1.-msk_ref)*numpy.array([[[16.347097390086169, -1.8396658404625863], [-13.394019280965903, -1.3240387731657504]], [[14.96835964092155, 1.3095115222904978], [-0.81287349355693883, -0.23275754053042108]], [[6.5148510958668169, 7.0235766064620666], [-0.67141829603493608, 15.721269859875472]], [[11.172002049316664, -7.933596044569291], [-5.3806325715678094, -5.2699668188114899]], [[-2.0169337740132662, 6.2140995154993384], [8.3121871888593493, -12.604651358014761]], [[-7.4501969045515377, -16.908743716542801], [-6.0021687459671114, -1.820717437531016]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_expandedData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[3.1331255040095254, -0.54926312160556989], [2.0346589372505077, -1.7399571972811021]], [[1.2533270574525606, -0.90483515130326886], [-4.9372169751323067, 3.8157041901821973]], [[-3.3580854279202099, 3.6216038381713034], [-3.0738042330685298, 2.0171570943196313]], [[-3.7974736241210536, -1.6412549741350024], [0.12948354540635254, 3.1489732063088294]], [[0.61698612359268079, -1.8422750511237362], [-1.364430162570792, 0.12548410228946683]], [[-3.6267562005743259, 1.6147362056845891], [2.5102788075156903, 0.32679035424312808]]])+(1.-msk_arg1)*numpy.array([[[4.7346832182312966, -1.3676663084923799], [1.2448339123302485, -4.0548294609885538]], [[-3.5375987473912298, 2.7780212488209619], [1.9103845383425817, -4.7825923483697883]], [[-4.3740688963854177, -3.3494591395602349], [-0.12448269442926563, 1.623779704097192]], [[-4.3132507573337042, -1.4551799263613105], [3.3197297261379024, 3.4192985047537121]], [[3.1276041324528361, -4.6298358022816792], [3.2877398319995503, -2.5511292259119775]], [[-1.6910795856669072, 4.7607312076680746], [-3.6377784165379587, -4.4772029578680508]]])  
       res=arg0*arg1  
       s0=numpy.array([[[-4.0157637235454802, 2.069302983501097], [-0.04592186039857804, 2.7107238463243446]], [[-0.056470296327355562, 2.5388748218426773], [1.9479572492394954, -0.34456000659720409]], [[-3.336292034431084, 3.0789827633861435], [-3.8318010406309067, -0.3713203760047783]], [[0.44894100442012164, -0.22240833028562257], [0.010141503585250788, 0.70724959140323662]], [[0.21388899062002587, -2.9385388007227187], [1.2626185435498494, -2.8690090464695785]], [[-3.9150718928349804, 2.8049438670744991], [1.3906965402533622, -1.1292401618723504]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-12.581891740316602, -1.1365918162655315], [-0.093435323675136975, -4.7165434662535555]], [[-0.070775750329438683, -2.2972631835620785], [-9.61748759777727, -1.3147390609421572]], [[11.203553664109295, 11.150855793542544], [11.778206258967678, -0.74901153072347149]], [[-1.7048416230718253, 0.36502877837033854], [0.0013131578399695075, 2.2271100135016595]], [[0.13196653920180101, 5.4135967193305294], [-1.7227548246406175, -0.3600150246565943]], [[14.199011263033528, 4.529244417078135], [3.4910360526834063, -0.36902479252383269]]])+(1.-msk_ref)*numpy.array([[[-19.01336911025281, -2.8301159725972136], [-0.057165089141445406, -10.991522912680162]], [[0.19976924955246461, 7.053048203175492], [3.721347410299479, 1.6478900511060321]], [[14.593171217063432, -10.312926957372147], [0.4769929180545992, -0.60294249027429692]], [[-1.9363951273132436, 0.32364413768717426], [0.033667050919691154, 2.4182974703727607]], [[0.66896009094935882, 13.604952145979912], [4.1511612782500986, 7.3192128278543969]], [[6.6206981543915324, 13.353583803738738], [-5.0590458580876936, 5.055837392878284]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_Symbol_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=())  
       res=arg0*arg1  
       s0=numpy.array([[[-4.1948878030278012, 3.2526258506602588], [-1.389141747093773, 1.8137813248087653]], [[-3.278957963765079, -2.7924168965195326], [-1.1895003861760123, 1.5482778504583727]], [[-4.3320520033804, 0.66545558398733196], [-2.412361107149211, 3.6288885456538384]], [[2.3720475534590646, -1.7188981697700036], [-4.9496514597430128, -3.4525773332393985]], [[4.0235338530090274, 0.20830241454283449], [4.4958811042037858, 2.4547405025668576]], [[-0.65822911101097592, 2.0065949384497834], [0.60253481015205246, 4.9560490789838632]]])  
       s1=numpy.array(-1.40336590772)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[5.8869625294783123, -4.5646242293843216], [1.9494741688615511, -2.5453988752952514]], [[4.6015778191938441, 3.9187826727158979], [1.6693042891788059, -2.1728003510107849]], [[6.0794540920127806, -0.93387767966950996], [3.3854253348820977, -5.0926584678850384]], [[-3.3288506680143195, 2.4122430902969731], [6.9461721136982781, 4.845229323233891]], [[-5.6464902378688642, -0.29232450706510543], [-6.3093662668006907, -3.4448991336009946]], [[0.92373629386143441, -2.8159869272232902], [-0.84557681078173841, -6.9551503144314593]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank3_Symbol_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0*arg1  
       s0=numpy.array([[[1.8855846251370254, 2.2602477804471253], [4.0797065024206329, -2.4593417195217482]], [[-4.2616733197954133, 4.6213746011501726], [-4.5875068719387233, -3.5733676756336221]], [[-1.1833193524113517, -2.4270115500935829], [-1.8228109167710893, -2.8642325759195675]], [[4.5833152266489048, 2.1619102143690059], [1.4799485466277753, 4.8397521584499845]], [[-1.1661607663841789, 2.6300282166442512], [0.42632677519596296, -3.6596272407114538]], [[-3.7794473506692015, -0.62955677227947859], [4.6472134416239363, -1.4976148516312051]]])  
       s1=numpy.array([[[0.12840060684233823, -4.2676909359758621], [-3.7753639342381904, -2.5034362497915055]], [[2.8790487017494124, 2.0029085724885407], [-3.9486401354420075, -2.7572339749761565]], [[-3.0316606298576287, -0.048789715771229147], [-4.7793720385470886, 0.82235789335268805]], [[-4.3009688975851459, 4.1119069316118146], [-3.0684230639259944, 2.2895354431801938]], [[3.6574840217084308, -1.4943238087287289], [1.8666668242500508, -1.2226275097352435]], [[-1.3909446818606552, 3.5572882651178883], [4.7322894628385814, 3.3931672169319604]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[0.24211021012017692, -9.6460389656737568], [-15.402376791515888, 6.1568052112753175]], [[-12.269565038637094, 9.2561908053244917], [18.114413756153262, 9.8526107603386013]], [[3.5874226932541196, 0.11841320370255619], [8.711891527174128, -2.3554242672053585]], [[-19.712696237645353, 8.8895735959862989], [-4.5411082538964207, 11.080784102979084]], [[-4.2652143697933926, -3.9301137817598644], [0.79581004754781348, 4.474360939870305]], [[5.2570021927856683, -2.239514918255284], [21.991959201358775, -5.0816576181454272]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_float_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=-0.322948666418  
       res=arg0*arg1  
       s0=numpy.array([[[[0.49460522451152755, 4.0117725273544043, -2.336833285539921, -3.7279924114774077], [2.4460875643453139, -2.7308513130280021, -0.9684621435770584, 1.3769004738800881], [4.1750110910558931, 1.7147599663702966, 4.2637492556144245, -3.5187084042364858]], [[2.7848814071133727, 1.8143457124056939, 4.6594513950797527, -0.07128399946421915], [-2.563310888089144, 1.6732036530752303, 4.4616628471294337, -3.48336315334145], [3.1742514488521394, 2.4796311107440161, -1.2939987386628813, 0.77734695893015715]]], [[[-1.1128636094485191, 3.7578216737330727, 4.683905230797393, -1.6215776487815736], [-2.5835932693370456, 0.77359053875062322, -0.10803402561185216, 4.1933964628110765], [-0.92744170012022931, 1.7962046073610995, -2.0942788137799662, -2.7736666999769897]], [[-0.10550170693669969, 3.738597115724648, 2.8369474003988939, 3.1266789557401449], [-3.6897863351629221, 2.758501409898388, 2.2735337384490535, -0.026831594764615829], [1.7758273379468488, 1.2602367051510779, 0.72298334229158012, -0.3810502034276908]]], [[[2.4607225213774857, 2.6597110063518317, -3.7049560301294902, -2.1631222111591599], [-4.2703515546928639, 2.4215806317442361, -3.7362181061447575, -0.49094901098471766], [3.9434092721386058, -3.2922535968195135, -3.3109606440911818, 0.81617667099672353]], [[1.3293330457265453, -2.5186003975324898, -3.3208527853407332, 2.615293307654694], [1.3999941332469188, 4.4569736860046163, -4.1453050758197749, -1.4174928199571202], [-1.1094367120933857, 4.1397068696068366, 1.9561551822093746, 2.0241755307371427]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-0.1597320976594318, -1.2955965876819486, 0.75467719320658722, 1.2039501777034936], [-0.78996071684726221, 0.88192478972856048, 0.31276355774464321, -0.44466817183004953], [-1.3483142641373536, -0.55377944436646465, -1.3769721360419229, 1.1363621866623981]], [[-0.8993737365598764, -0.58594052824284959, -1.5047636142810468, 0.023021072563919432], [0.82781783292343147, -0.54035888840656943, -1.4408880664877153, 1.1249474850216323], [-1.0251202722825781, -0.80079356042365735, 0.41789516699790463, -0.25104316373067398]]], [[[0.35939781857665287, -1.2135834981691969, -1.5126609479148665, 0.5236863391674369], [0.83436800089922514, -0.24983003284318742, 0.034889444499128487, -1.3542517954272915], [0.29951606023438038, -0.58008188256134685, 0.67634455001795868, 0.89575196184591177]], [[0.0340716355600423, -1.2073749527978985, -0.91618837965717015, -1.0097567990738743], [1.1916115763086617, -0.89085435163918336, -0.73423468888872068, 0.0086652277471040463], [-0.57350107057877187, -0.40699176329970388, -0.2334865062355797, 0.12305965503532541]]], [[[-0.79468705670388851, -0.85895012255891534, 1.1965106090680844, 0.69857743339326195], [1.3791043397245983, -0.78204623564574538, 1.2066066548266767, 0.15855132837680866], [-1.2735187655780051, 1.063228908603115, 1.0692703245721211, -0.26358316745997112]], [[-0.4293063343429232, 0.81337863962326007, 1.0724649783966833, -0.84460548599931295], [-0.45212623832528176, -1.4393737081558358, 1.338720746132253, 0.45777741586240978], [0.35829110664586072, -1.3369128129014509, -0.63173770740140867, -0.65370478824774703]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_array_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array(-2.46405456404)  
       res=arg0*arg1  
       s0=numpy.array([[[[-3.7213720498152139, -3.2690068438678765, 3.8566168179439266, -0.60217241283546841], [1.61945889137289, -1.0230577269638186, 3.7800920318315043, 0.99636902089079182], [1.2354917815769904, -1.6053574388928804, -0.46202994821574173, 1.3339353772537335]], [[0.74521959591106057, -1.5996527382178769, -2.2832704776155843, -2.8003129198540524], [4.0361307270316669, -1.1800901629772476, 1.8006643789728747, 1.7021934972965216], [0.078586609286190878, -3.4918739184655454, 1.7868325238283109, 3.6449077980659705]]], [[[2.7190102168068702, -1.2377383659655896, -4.85743924743627, -1.3249009776320686], [-2.9431137447071909, 2.9496706966141595, 1.8518672604573796, 1.7649604515829074], [1.0399452012447563, 3.1524273667219482, -0.26409304506794484, -2.5278276252377649]], [[2.2448349079702004, -0.53656211467789028, -2.6265987533366442, 4.1098547162293837], [2.7293768952084205, 0.57574065111439676, 1.8908420366267089, 2.1484999196611998], [2.9636647454486296, -2.3054499387586356, 2.6454153054470861, 2.5873014450085305]]], [[[-4.6620634264534626, -1.8503721563401934, 1.5976829150343796, -1.0158166258226475], [-3.8623327296999599, -1.9624681580904744, -3.064096296534502, -1.097998298799757], [-2.4063959359953335, -2.5609002419843474, 0.4628770142316494, -4.5185601409561222]], [[-1.4326078464978376, -2.3844050481910504, 2.8842078802101669, -2.2254617853376657], [-2.6681539347387329, -4.3525807380540336, -3.7159267229423243, -1.2232840087309471], [1.4836614042782292, -3.7380976467153815, -2.1131975631716546, 4.078994230414617]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[9.1696637838470334, 8.0550112335185133, -9.5029142720174455, 1.4837856821876658], [-3.9904350725664299, 2.5208700614040502, -9.3143530235347622, -2.4551076333964224], [-3.0443191632316706, 3.9556883242234351, 1.1384670026252763, -3.286889554459695]], [[-1.8362617465184887, 3.9416316304886969, 5.6261030413119721, 6.9001238309133033], [-9.9452463390141865, 2.9078065520656375, -4.4369352813167025, -4.1942976558968041], [-0.19364169328425621, 8.6041678658556791, -4.4028528355185665, -8.9812516953382229]]], [[[-6.6997895344009093, 3.0498548697479047, 11.968995347204066, 3.2646283008385484], [7.2519928551416992, -7.2681495424142719, -4.5631019751307189, -4.3489588560772141], [-2.5624817194811436, -7.7677530407834103, 0.65073967303152713, 6.2287051970795995]], [[-5.5313957005056942, 1.322118327564302, 6.4720826460672605, -10.126906271076233], [-6.7253335956302092, -1.4186563790831777, -4.6591379502332861, -5.2940210328859285], [-7.3026316423142807, 5.6807544437695086, -6.5184476571745362, -6.3752519341267897]]], [[[11.487578663807847, 4.5594179570070477, -3.9367778786830439, 2.5030275930884547], [9.5169985904675638, 4.8356286217307334, 7.5501004641412832, 2.7055277194683423], [5.9294908889824072, 6.310197929318841, -1.1405542195078189, 11.133978738223044]], [[3.5300239026459637, 5.8753041415209184, -7.1068455908789439, 5.4836592692632431], [6.5744768804606872, 10.724996432965119, 9.1562462013131878, 3.0142385448335847], [-3.6558226547053407, 9.2108765672252257, 5.2070341002564131, -10.050864350155791]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_array_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array([[[[-0.20326449935601154, 4.1983386541810628, -2.4883826303422318, -2.5312556285643781], [-2.3746216642347164, 3.2534617181032885, 0.82645389623971788, -4.3471871718433253], [1.0837256393715942, 0.56719483680022353, -1.2158787697641005, 1.0232959878005961]], [[1.8993220807358782, -2.5016101478944086, -3.5035152000395886, 0.24782785105056426], [3.7664706242199095, -1.712554102623276, 2.3012161394933939, -2.786528964870211], [3.4170598602331026, -4.2875846425976256, 2.588441243969517, -0.9164708078399979]]], [[[4.169769297075316, -0.18233117736095572, -3.481610857075129, -2.2317042119194697], [-3.1326173893727773, 0.71736435470513893, -2.294001235849624, 1.2231531045953776], [-4.345097169953843, -1.6942776295443851, -4.5075494058305257, -2.6514618696637093]], [[0.25629778415216542, -3.7350558462022452, -4.182371649884578, -1.2037841134661775], [-2.6156921764787509, -0.3907838828229071, 4.3942233939580024, 1.9708869287987687], [-0.57937018175705113, -1.8037657630226089, -0.17294371838503331, 0.45629604372152688]]], [[[-2.6074758168128809, 1.8647941609778034, 3.4846944159831619, 4.1600756574885249], [-3.2418823197902391, 1.1245007681743138, 2.1177109367870841, 2.0613873459362653], [4.7138633798114355, -4.8520866103085005, -3.886852858560502, 4.0488475486644884]], [[2.1468946049065476, 0.81587642718032072, 3.7435318711723422, -1.162722685982871], [0.53932560181764977, 3.5559413500072026, -4.0875628595830875, -3.4086576031100355], [-4.1092282304692587, -1.9625002883924401, -4.8620403509341887, 1.9491416324340509]]]])  
       res=arg0*arg1  
       s0=numpy.array([[[[0.55231778653330377, -0.15974616879436532, -3.0586706374502026, -3.085947707556882], [1.8614883702678657, 2.2605432477212348, 3.9442116904484976, 1.2800904725814224], [-1.3030476248554757, 1.1737000157203408, 1.0131349295291248, -2.406655414856532]], [[-4.9947256120577075, 3.245304781244112, -2.1203416358492531, 3.8614827711654858], [-2.1831204144180019, 4.7835527179580151, 1.8002907414027973, -4.041834652069463], [0.79286892698733258, 2.9496034548984742, -3.7879787818146857, -4.9393788033738684]]], [[[1.0176951311025348, -4.5153336311575734, 3.8829902864797496, -2.6690850983603722], [-4.0701826148783304, 3.0168100433417635, 3.6685761791366627, -0.71647945943753566], [-4.7392112945728737, 3.3083369293326221, -2.2024343192737197, 4.0279035314925693]], [[2.9531271137621573, 3.9137112354987842, 4.1554980357944498, -0.74492945107374808], [2.0795754338007866, -1.8682617997791215, -1.2693096450164587, 0.51508794113552803], [-3.3481736244131666, 1.6331833413132957, -2.1199343278534455, -4.4529552182932459]]], [[[4.4024389669194743, -1.3622678335581559, -1.634364003411374, 2.008802537056626], [2.5342222697764418, 3.4689999970584449, 4.6948666309054072, -0.48599967506570074], [2.8600525407011625, 3.6513297251929426, -4.3904332253067029, -2.6761683838353587]], [[-3.7922965624036644, -4.7496774741158898, 3.3865880827142831, -0.58082677766936364], [1.7652758872831029, 2.5351787388458931, -3.1607329621431113, -4.1513717601463789], [3.3598386653300611, 4.4860196162743211, 0.87511588647327887, 3.9709281228438016]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-0.11226659836511245, -0.67066851530671656, 7.6111428861688859, 7.8113225042086967], [-4.4203306117590495, 7.3545909185779168, 3.2597091191654051, -5.5647928812048191], [-1.4121461203781376, 0.66571658886891849, -1.2318492517209108, -2.4627208300412682]], [[-9.486592642198227, -8.118487373770515, 7.4286491504746648, 0.95698297704672008], [-8.2226589100401988, -8.1920928322537208, 4.142858109896645, 11.262689329207671], [2.7092805848345045, -12.646674474975596, -9.8049605101305417, 4.5267964821558113]]], [[[4.2435539114543879, 0.82328609714647971, -13.519061139325162, 5.9566084559823347], [12.75032483729062, 2.1641519900098465, -8.4157182887479962, -0.87636407518983972], [20.592333583861883, -5.6052412503638251, 9.9275815072230138, -10.679832628436346]], [[0.75687993557692068, -14.617930030497146, -17.379837176057755, 0.89673423885565806], [-5.4395291925901219, 0.7300866002473978, -5.5776301363078504, 1.0151800903658819], [1.9398319613304209, -2.9458801957997909, 0.36662932539105114, -2.0318658489763362]]], [[[-11.479253141237212, -2.5403491017071311, -5.6952591163715001, 8.35677053511046], [-8.2156503708069373, 3.9008931614889133, 9.9423704110251112, -1.0018335803095721], [13.481896935947866, -17.716568069430092, 17.064967932102363, -10.835397800705199]], [[-8.1416610300300736, -3.8751498878405224, 12.677800422173355, 0.67534047102249828], [0.95205848028314521, 9.0149469071212227, 12.919694665116218, 14.150604913559246], [-13.806343893396443, -8.8038147906724991, -4.254848751776624, 7.7399013236380485]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_constData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(-3.87591682807,self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([[[[-4.7015424185320498, 4.2227494088627253, -2.1082296386137589, 1.7923673150192618], [-1.6847816073468458, -4.4815568477006877, -0.30721439822210872, 1.2050920034572048], [-4.9704371530658511, -2.414750632834104, -1.1055045223811577, -4.5057971575849933]], [[-3.0517357306977, 2.6218973030475512, 4.0158817764671273, -1.7941845432793779], [-1.2160982223302632, 1.5848170220393998, -1.5682536143654313, 3.0455571096729752], [-4.3678222655471703, 2.5095731346109105, -2.4634955617222998, 3.8140815388684164]]], [[[-2.6131074329443695, -4.5180577114410303, 4.4536886804078986, 0.19348280495347048], [4.9480894201747638, 0.83460580746370994, -1.7601671823761569, 2.450600479092345], [-2.4353811647393453, -2.2168349294574039, 4.484811758261408, -2.2697508890834097]], [[0.14179137336110692, -2.5416498864814607, 2.4025015667187262, 1.0023265276583704], [-1.3716985832045445, -2.8939641951640871, 1.9529307095593849, 2.5215073087718123], [3.3602058083085122, -2.9681785190551899, 0.58080929708275253, -0.75856022798608702]]], [[[-4.5077202701775452, 0.24183504012352675, 1.7649121323672121, 3.0807100009020338], [1.045248842096095, 3.0537692395227172, -2.6403883814197204, -2.497530242418752], [1.2964724205558564, -2.4664411186662805, -0.30384957761061759, -3.7311376722709566]], [[-2.017670497289501, 1.1235801537099128, -2.8763414631875426, -0.26746682684747825], [-2.2739933211059071, -4.3100429482834004, -3.9913254059564087, -1.7364462951569362], [-0.94396181596931772, -3.6088928161364753, -1.5125246909796699, 4.2411074761955341]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[18.222787377890452, -16.367025494549086, 8.1713227337466936, -6.9470666383723385], [6.5300733835446092, 17.370141601971788, 1.1907374558955901, -4.6708363755767666], [19.265001004450408, 9.3593726134031936, 4.2848435818086497, 17.464095026970085]], [[11.828273873444846, -10.162255878362917, -15.565223756963235, 6.9541100639661737], [4.7134955645203158, -6.1426189651400751, 6.0784205746062963, -11.804326052240825], [16.929315821069043, -9.726896743719962, 9.5483039035642054, -14.783062820145132]]], [[[10.128187072913414, 17.511615913982205, -17.262126903394094, -0.74992325966204765], [-19.178383050468547, -3.2348626939565883, 6.8222616023947245, -9.4983236357993643], [9.439334839186829, 8.5922678081454098, -17.382757364587956, 8.797365666533512]], [[-0.54957157008598789, 9.8512235660849701, -9.3118962519184141, -3.8849342557757045], [5.3165896216872754, 11.216764523879096, -7.5693970012430301, -9.7731526101793627], [-13.023878238213777, 11.504413070732729, -2.2511685284646674, 2.9401163527586576]]], [[[17.471548851429837, -0.93733250163264314, -6.8406526339134235, -11.940575734910976], [-4.0512975766047497, -11.836155584519766, 10.233925760194836, 9.6802194952136986], [-5.02501927196582, 9.5597206372914307, 1.1776956910640626, 14.461579291814541]], [[7.8203230339521026, -4.3549032254538274, 11.148460280454575, 1.0366791751296016], [8.8138089802014683, 16.705367992971791, 15.470045307264328, 6.7303214164449097], [3.6587174875744384, 13.987768396777462, 5.862419902644997, -16.43817983665523]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_constData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(numpy.array([[[[4.675550130934182, -4.7802448522527916, -0.54192281192670144, -2.8744144899987658], [2.2785820358139262, 4.1397361241456423, -4.8753632280921479, 3.5724328281426114], [4.2625237336441799, 4.229646224777369, 1.234828426346807, 3.997055408656724]], [[0.28828183866449208, -4.4867727147622691, 1.7404507691236937, -4.1269825910519389], [1.2227160284920959, 0.55507447082979233, 3.5208153508376228, -2.3918977977395226], [-4.3769242685766496, -3.3934685803504294, 0.80522381864743497, 4.1417077907800675]]], [[[-0.75069137140423159, -4.0402772063985779, -4.1268492565586037, -4.2010422529163396], [1.7709003231123521, -3.8364601094048534, -3.6434670274147907, -3.6596393531906459], [-3.3067578005034792, 1.1948257665407267, -3.2365770261696758, -0.96851063570594498]], [[3.179103851587314, 2.025537325429462, 0.49013398741583725, 0.35335939055179644], [3.5617575399460542, -4.5772516127093983, -2.3223075496777055, -3.3168961885928541], [0.85268671494552084, -3.9976187152303764, 4.8923573764398753, -4.2102343010160688]]], [[[-1.078970017900629, 3.3180761383277932, 1.7904024578919753, -0.89109335829228797], [-4.7074718617451694, 4.814773950811059, 2.1607249824766654, -2.921626082919083], [-0.9314184849116991, 0.431697916452495, -1.6446094516360477, -3.7750863523402813]], [[-4.5589755604106212, -4.693005258512577, -4.7843353548812999, -3.5662174262662525], [-4.1851683994671625, -1.326452035558888, 0.17677881826491859, -4.5704910327970101], [0.69320339902661487, -1.7443871829443527, -1.4686858902626074, -0.54379124430032011]]]]),self.functionspace)  
       res=arg0*arg1  
       s0=numpy.array([[[[-0.49241302755038685, -1.0853734425155972, 1.7024323985700427, 0.64225770232718116], [0.73017270594844863, -1.0355519011504057, 2.6467943036303776, -4.0888425587846573], [-3.9216392832237501, -4.9619194938147704, 0.88481011162984835, 3.5111221401375872]], [[-0.77250207325997344, -3.6994029686329544, -2.9842867631960424, 0.82441861738192568], [4.1155915058368393, -0.38303228931279065, 4.107514076983966, -1.8298638693169309], [4.3601620636154959, -0.15997014922520769, 0.40763453010520045, -4.2756217332198503]]], [[[-4.6824486694742218, -0.62241062806757252, 3.2001229392965254, 0.35451617194108032], [3.7096322203426553, -0.83792444850651115, 0.089146012198593638, 2.9514882753236114], [-3.7505735636993354, -3.777159114323049, 0.51230467663051815, -2.9568724118677601]], [[-3.8648157837805721, -4.2980980387221415, -0.52592860638063321, -2.7016376325613312], [1.9496704276963133, 2.4594804448846466, -1.3628510331348256, -1.6917536298293703], [2.9274266444830621, -2.5139752329968501, 4.8781711435472452, -3.4792580070165524]]], [[[-2.2414154603278647, -3.2269131543920571, 3.0147504087456181, -2.4214126782157419], [4.7122590138396259, -2.5442174728780929, -4.7712900961288618, -2.1349182892136467], [1.4568346015138003, -0.0061210393035802113, -3.3594769731286691, -0.99675920977015853]], [[2.3631004845480081, 3.3749926986464338, 0.091879711872118186, 2.6105856823437925], [1.9229063847205143, -2.9796701354664687, 2.8438772798146337, -3.37769552339797], [3.6308089628397759, -3.6585573083261034, 3.2428551246460575, -4.4982282207953661]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-2.3023017954369083, 5.1883508113570747, -0.92258695254819645, -1.8461148458825636], [1.6637584108157792, -4.286911613620032, -12.904083620243307, -14.607115386108946], [-16.716080519532586, -20.987164054662877, 1.0925886777596283, 14.034149740691316]], [[-0.2226983180515173, 16.598380300572877, -5.19400419229021, -3.4023612816743167], [5.0321997009126251, -0.21261144530102119, 14.461798616026776, 4.376847359182289], [-19.084099151165908, 0.54285367518971184, 0.32823703294386231, -17.70837584290523]]], [[[3.5150738132175232, 2.5147114736016363, -13.206424972932, -1.4893374176666325], [6.5693888976328001, 3.2146637213902913, -0.32480055607109265, -10.801382642855076], [12.402238388124911, -4.5130470341173297, -1.6581135467816199, 2.8637623793194149]], [[-12.286650743892261, -8.7059580057868633, -0.25777548494139407, -0.95464902733367019], [6.9442533462571916, -11.257660832775477, 3.1649592433350664, 5.6113711668191648], [2.4961778087282513, 10.049914441053854, 23.865756577669508, 14.648491403225895]]], [[[2.4184200793527024, -10.707143538044354, 5.3976165417489916, 2.1577047552427886], [-22.182826712905079, -12.249832013611783, -10.309445709349122, 6.2374329586675765], [-1.3569226773089227, -0.0026424399138794082, 5.5250275825610693, 3.7628520893728092]], [[-10.773317355848866, -15.838858482189266, -0.43958335390608216, -9.3099161531356085], [-8.047687036465943, 3.952389516483525, 0.50273726481608216, 15.437727101209026], [2.516889114256831, 6.3819404767114447, -4.762735565733454, 2.4460971213331271]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_expandedData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-3.84751804559)+(1.-msk_arg1)*(2.8745129689)  
       res=arg0*arg1  
       s0=numpy.array([[[[2.7686079187409396, 3.3566501625833425, -4.4520780116775791, 0.38154344250589922], [-2.6007363609698739, -4.9272805087288347, -0.89958708784189856, 4.8236771645065453], [4.3374673306082006, 2.6285079356072245, -1.8880835311569455, -3.8664685705442992]], [[-0.33120480894068738, -2.7633519610878188, 3.9229533287043665, 2.1658229616346336], [-1.2725894447095731, 4.0889304135158682, 2.0194991506116233, 1.3583463930005646], [4.458241622052979, -0.96982148154982095, 1.4611897638643221, 2.5990396248464709]]], [[[-3.8249761771113491, 0.45152240967616919, -1.1992280706327962, -0.57150550990872695], [-1.8045417200833826, 1.0852716194474956, -1.7957014915757141, 4.4195198548361034], [2.39323495666493, 3.8830308989810796, 4.4395233053354346, 2.9618382058578323]], [[3.8446887205373663, 2.6229791171665955, 1.7454758648665258, 1.7120629808984633], [0.3150665762828222, -1.4765593056057211, 1.2503184274544203, -4.3142310081359883], [-1.9186672934734004, -4.8615102042118616, -1.3730190985411705, 3.798842116798486]]], [[[-4.2292535121231802, 0.37675374656653915, 1.1659052188385246, -4.6293076511925157], [1.7037713304545319, -3.9380181570758932, -0.61012108755522121, -2.4457534486632095], [-2.1863158146853845, -2.2089367090341994, 4.9705782547277977, 2.9016744885074512]], [[-3.2959819869941565, -4.1075575890646041, 4.3011756382462796, 3.3327762137042853], [-1.2644610708105333, 2.4321839411902619, 4.4308382532584787, 1.1864102460713681], [3.7353891159501522, -2.6507818543757153, -2.7665952756844039, 4.1758456386062228]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-10.652268928527278, -12.914772073281886, 17.129450490317023, -1.4679952802190996], [10.006380080661305, 18.957800673032555, 3.4611775540541059, -18.559184936553518], [-16.688483826684891, -10.113231715233042, 7.264435457713188, 14.876307597887131]], [[1.2743164791864567, 10.632046536610023, -15.093633724208942, -8.3330429284487995], [4.8963108531511814, -15.732233553176105, -7.7700594250378359, -5.2262622592357522], [-17.153165092462377, 3.7314056512666167, -5.6219539845036666, -9.9998518578079025]]], [[[14.716664865399013, -1.7372406192186693, 4.6140516425412885, 2.1988777625296216], [6.9430068320461391, -4.1756021401941137, 6.9089938933357189, -17.004182394338198], [-9.2080146831121557, -14.94003145542468, -17.081146031108499, -11.395725945164626]], [[-14.792509231955149, -10.091959486511914, -6.7157498882209019, -6.5871932141984786], [-1.2122243378113431, 5.6810885737061927, -4.8106227123682697, 16.599081656659838], [7.3821070351278735, 18.704748239539356, 5.2827157585809053, -14.616113596740659]]], [[[16.272129207281257, -1.4495668386595086, -4.485841368932209, 17.811344726564673], [-6.5552909394877039, 15.151595923222152, 2.3474518943655038, 9.4100805288028653], [8.4118895503672473, 8.4989238495817645, -19.124389532097062, -11.164244956969084]], [[12.681350172909292, 15.803901947238295, -16.548850885417291, -12.822916624150151], [4.865036787893299, -9.3578716039308905, -17.047730136515497, -4.564734831235949], [-14.371977030929671, 10.198931019640883, 10.64452524804792, -16.066641450148015]]]])+(1.-msk_ref)*numpy.array([[[[7.9583993682093332, 9.6487344243930959, -12.797555983104465, 1.0967515736804794], [-7.4758503982876103, -14.16353172373012, -2.5858747506530331, 13.865722567142139], [12.468106093996518, 7.5556801497493415, -5.4273205966698264, -11.114214049858841]], [[-0.95205251866076834, -7.943291049771469, 11.276580219734916, 6.2256861915517634], [-3.6580748628979833, 11.753683502565149, 5.8050764991078152, 3.9045843229333923], [12.815273361063774, -2.7877644262290122, 4.2002089262462565, 7.4709731082960937]]], [[[-10.994943626825286, 1.2979070223613765, -3.4471966416982482, -1.6428000000282272], [-5.1871785772937997, 3.1196273448767236, -5.1617672258005021, 12.703967139020289], [6.8793849205488913, 11.161822677745484, 12.761467316903287, 8.5138423345103629]], [[11.051607588553299, 7.5397874894390808, 5.0173930104540041, 4.9213472421595874], [0.90566295959067189, -4.2443888733078987, 3.5940565349675371, -12.401312983700691], [-5.5152340180861126, -13.974474130427835, -3.946761205298658, 10.919820931526047]]], [[[-12.157044069347556, 1.0829835305857198, 3.3514096720550111, -13.307004880362934], [4.8975127854249534, -11.319884264263063, -1.7538009787744901, -7.030350006904813], [-6.2845931634158294, -6.3496172175895271, 14.28799165612811, 8.3409009487296917]], [[-9.4743429668627144, -11.807227560253894, 12.363785153638988, 9.580108448721484], [-3.6347097467091563, 6.9913442816922924, 12.736502022072539, 3.4103516387633879], [10.737424457672136, -7.6197068181175069, -7.9526139996415628, 12.003522444281899]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_expandedData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-1.1138824540739387, 3.1626243813457418, -1.1414212978750071, 2.1278105972635366], [-4.6941995846913471, -3.5412232103647403, 1.4491499233065577, 2.3387560487905015], [1.8899257069946156, -0.56393697845560897, 0.40412142115569427, 4.1360813973539159]], [[-4.5211680777196372, -0.53141296241943436, -1.7477003114669909, 2.916272316730363], [-0.85007827433378935, 2.7924779720361945, -3.8839436822181916, -0.17107862989327671], [2.1515301861513532, 0.28443088375872705, -1.4997109558301105, -1.1180685158907]]], [[[-2.9245891503486234, 2.6357691753761809, -2.4577929617626024, -0.84106037042664727], [2.9398006599743081, 1.1722233080594, 1.5752765021035895, 3.5579446169615991], [-0.55559559453015961, -0.096172978154982047, 2.103965159321306, -2.8714560682683956]], [[-0.87573819151882937, -3.2374564044588583, -0.73339854455455189, 2.1289970494636865], [3.9649033873613284, -1.2164896743291322, 3.5434919716856506, -0.57628935616829136], [3.7585050263074731, -4.2597421030805478, -4.0620608720927915, -3.0103428395089593]]], [[[4.1967521943468142, 1.9933364443273778, -4.1539241528284245, -2.8529303792809402], [1.9436908350064721, -4.7264968973617139, -1.296896287393805, -1.2210487048585774], [2.8030687901723548, 2.9558453940257401, -1.6524255521320574, 3.3629709844417306]], [[4.3245531225330449, -0.09833609241389496, 3.7498685267149785, 0.85786065981529092], [2.5698579508092676, 1.0232213325327697, -2.4745819883240125, 1.7527487601603724], [3.602827575176736, -3.5880447726818532, 1.9159580242988241, 2.0689263489770156]]]])+(1.-msk_arg1)*numpy.array([[[[2.1655431698749874, 2.3017510044933607, 1.8541575483032773, 3.960788064908888], [-4.3333502922542984, 3.4414212200052905, -4.0249925999044134, 1.3968551089642247], [3.1812553528939578, -0.98683894694010643, 4.7229512179811159, -1.4668581359939936]], [[-3.3502101347766642, 1.7202298814779002, -4.7025400934274906, 1.2242902217540452], [3.0044167558882915, 4.84697876714473, -0.34278301156962776, -0.48004664956220822], [-0.67406672259805056, 4.6196886183630355, 1.3857981394514507, -4.0077827093404128]]], [[[-1.91126048938842, -2.2191935031372201, 2.1023949692246733, -4.7736802138034617], [-0.95285785005312906, 4.594202420089653, -2.4920546813637956, 4.6776439709495463], [-2.7543440403694355, 1.8206951105470059, 2.2855575261810692, -1.399338503370017]], [[-4.267564424983906, -0.44758185639756043, 0.068937322952876912, -2.9962046182656277], [2.0539943982056403, 0.22881916874607633, -0.2303456675576756, -4.6974145296738277], [0.3555908139907924, 0.48345186230100889, -2.1874527534960375, -1.8248444410047195]]], [[[3.5110666973984532, 4.1454160929062969, 3.2734726355529826, 4.0563569520691587], [-4.9577671730497617, -4.460809586341731, -1.7533768273077763, -3.5475409858495088], [-3.5637779764012123, 4.8366173790341644, 3.6927805488421832, 1.2947443182585738]], [[-1.2570361175587008, 4.2672020631752758, 2.9545406671384677, -4.4932128547587515], [-3.5891038711216314, 1.0891918770943541, 0.99948645336000208, 1.226267290390803], [-4.4952557846720431, -0.026035305444837675, -4.7956166604733754, -4.2924975691223066]]]])  
       res=arg0*arg1  
       s0=numpy.array([[[[3.5522912979199557, -2.5949648033437143, 1.9793917886588606, -1.8792722810019349], [0.48030612611261425, -3.6729878020222042, 3.2478490342641226, 0.015629719697236588], [1.2788173195069854, 0.82912319416072133, -1.3993358215520999, -3.2497055011096254]], [[3.2661016667066498, 1.7566635131561377, -1.4754615606174393, -2.4019157001301772], [-4.7319121827486166, -4.5515115910263848, 3.7962115685697135, -4.9783141963152353], [4.7098544983890491, -0.069465225027292909, -0.48159081681140847, 3.2908377734364542]]], [[[-3.2956738335259752, -1.2034453504189759, 0.30852941528604294, 2.4592660072594423], [2.9726625987905866, 0.74207173453011421, -4.511615275463523, 1.9853214380670225], [3.0401330239851294, -2.232655117137301, -4.2333491069601745, -2.747357882364506]], [[2.5944944139666219, 2.322021843922073, 2.2164924879020074, 3.3909179361519364], [-3.0695840086946333, 1.0793944673134703, 2.068054258976181, -0.53056032649620999], [1.1424344786376208, 2.0369643216679503, -1.6841719799036303, -2.5212298057219531]]], [[[3.8312238555307978, -0.69420967896049657, -3.8717515953693837, -3.8378720851011394], [-4.6991554670466762, 4.9753999925101908, 0.71387481558160459, -2.4893724038016019], [4.8941669317210792, -0.74732606304168225, -0.22255139980782879, -0.62044115835808267]], [[2.1449016466284823, 2.5695051308519208, 1.353366842050697, 4.1875443528895033], [-1.0881368498431687, -2.6243107273991595, -2.069893446214548, 4.7745856359809089], [-1.5045402402450825, 1.735497071826666, -1.3894160768977457, 3.4342823179008519]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-3.9568349485125771, -8.2068989557888887, -2.2593199444141283, -3.998735474659536], [-2.2546528177225436, 13.006869655907602, 4.7066201789151307, 0.036554101482812115], [2.4168697266861985, -0.46757322888246039, -0.56550158087970559, -13.441046470018208]], [[-14.766594594101008, -0.93351376150043408, 2.5786646290486712, -7.0046402634096641], [4.0224957426099781, -12.709995857408591, -14.74427193810995, 0.85168317188385945], [10.133394125664779, -0.019758055345011766, 0.72224702419924103, -3.6793821053831519]]], [[[9.6384919366179229, -3.1720041588841235, -0.75830142538676737, -2.0683911790432883], [8.7390354698055077, 0.86987378346826738, -7.1070415299693011, 7.0636637235090234], [-1.6890845149117899, 0.21472109180805454, -8.9068190282881723, 7.8889174630205696]], [[-2.2720978459928345, -7.5174444898988826, -1.6255723646434299, 7.2192542810409659], [-12.170604033863517, -1.3130722240148307, 7.328133663692415, 0.30575626896493929], [4.2938457301864554, -8.6769426834818759, 6.8412091014415841, 7.5897660924116463]]], [[[16.078697122732738, -1.3837934530767666, 16.082962465756868, 10.949181863379327], [-9.1337054135691833, -23.516212627732912, -0.92582159799172026, 3.0396449495726294], [13.71868658020095, -2.2089803012771463, 0.36774961970521375, -2.086525613111649]], [[9.2757411134534724, -0.25267509400543176, 5.0749477261055507, 3.5923295615755846], [-2.7963571351380172, -2.6852507194694102, 5.1221210397524386, 8.3686490537450613], [-5.4205990655180143, -6.2270411965723316, -2.662062881622028, 7.1052771773309322]]]])+(1.-msk_ref)*numpy.array([[[[7.6926401576169141, -5.9729628427213104, 3.6701042259913517, -7.4433992213065654], [-2.0813346919616267, -12.640298162699805, -13.07256832851979, 0.021832453810763704], [4.0682444430551001, -0.81821105980918363, -6.608994822764096, 4.7668569538870917]], [[-10.942126905011573, 3.0218650670331346, 6.9384171451146042, -2.9406419051468973], [-14.216636249241883, -22.061080040118014, -1.3012768340297869, 2.389823050409106], [-3.1747561856427917, -0.32090770943061214, -0.66738765791415433, -13.188962727622924]]], [[[6.2988911839294657, 2.6706781030304865, 0.64865069055520674, -11.73974947933384], [-2.8325248928169455, 3.409227758658377, 11.243191967731283, 9.2866268551710913], [-8.3735722765437508, -4.0649842553096365, -9.675562912364736, 3.8444836673297669]], [[-11.072172061863423, -1.0392948474983277, 0.15279905846112629, -10.159883980458183], [-6.3049083586803905, 0.24698614475978214, -0.47636733882936255, 2.4922617865517869], [0.40623920618989812, 0.98477419475108185, 3.6840466348010694, 4.6008521954671151]]], [[[13.451682489432686, -2.8777879750141562, -12.674072899100281, -15.567779113552165], [23.297318715581333, -22.194311982474037, -1.2516915592393978, 8.8311506315288959], [-17.441724324098679, -3.6145302243125821, -0.82183348032795012, -0.80331266459789563]], [[-2.6962188384231318, 10.964597595710773, 3.9985773723955478, -18.815528116275534], [3.9054361800822144, -2.85837792725474, -2.0688304593900906, 5.8549181905731578], [6.7632932182335725, -0.045184196363628637, 6.663106886700386, -14.741648501269127]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_Symbol_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=())  
       res=arg0*arg1  
       s0=numpy.array([[[[-3.778210818045753, -1.1849760790494193, 3.0650431467202495, -4.9044867709671305], [2.6922278623663196, -1.5542663033884088, 4.7255514829002152, -4.8197634023583502], [0.29379802379585307, 1.2313106780237675, 0.73365954459557958, 2.3860602970605207]], [[-0.97919235261346493, 1.7574026329849541, -0.32080340660735729, -2.0388741203548753], [3.9137838771299034, -4.6868433388591981, -0.46322351434364162, -2.5983680897792438], [-3.3228579070700812, -0.15854198317237156, 0.0003861934702831249, 0.31313474672138675]]], [[[2.8534934382070984, -3.8709574950762571, 1.2357874443779711, 0.96086941800174408], [-3.0464291103804699, 1.3548101308446903, 2.6970721017385539, 3.8060157931149838], [1.8543024185407422, 2.2404840732872007, 1.1360609865860036, -3.2370769323800843]], [[-4.0775309087599769, -3.1545825402187688, 1.0378968739733612, 3.3215106881122463], [-3.2069904393137652, 4.5306972518108068, 4.0340520285722334, -3.3148237894108599], [3.6265674783203767, 3.6117639382334623, -0.11025437408530792, -3.5732655139339897]]], [[[-2.7913449815443849, 2.5113513038322575, -2.9397668145929092, -2.1803277864016799], [-4.1763451287483573, 4.6619367738435713, -0.27871920325813093, -2.9890596735788177], [2.1456958935717685, 2.2214268603505634, -4.7386725424532115, -2.278031767906985]], [[-1.3872874004661218, 2.8614151135137211, 3.9140525703260636, -3.3738162726010179], [0.20802407625612052, -3.591810097677719, 0.40166744501215312, -0.96816264135897168], [1.6619735628515659, -2.8162906884405214, -4.0450413483103418, 4.9867749521912241]]]])  
       s1=numpy.array(2.7747861915)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-10.483727206484739, -3.2880552614027185, 8.504839399867377, -13.608902168468131], [7.4703566968623942, -4.3127566765540406, 13.112395001968194, -13.373812935155224], [0.8152266995183689, 3.4166238668253746, 2.0357483736051121, 6.620807164367057]], [[-2.7170494188530663, 4.8764165589102841, -0.89016086283986984, -5.6574397553649698], [10.859913458770691, -13.004988178384632, -1.285346211178283, -7.2099158959505596], [-9.2202202368506629, -0.43992010567953166, 0.001071604308588617, 0.86888197128097799]]], [[[7.9178341898694899, -10.74107940521638, 3.4290459362875851, 2.6662071929047277], [-8.4531894288637002, 3.7593084431705286, 7.483798425380785, 10.56088006736181], [5.1452927458296793, 6.2168642688303093, 3.1523263382793458, -8.982196372787552]], [[-11.314276461036735, -8.7532920725422461, 2.8799419141010527, 9.2164819922895376], [-8.8987127872765051, 12.571716172186187, 11.193631864669955, -9.1979272781089794], [10.062949361382003, 10.021872702763535, -0.30593231476425553, -9.915047806622896]]], [[[-7.7453855104988314, 6.9684629198762549, -8.1572243633588162, -6.0499434346485259], [-11.588464794184219, 12.935877785701605, -0.77338619650620899, -8.2940015078124123], [5.9538473366386215, 6.1639845775252757, -13.148803136833681, -6.3210510933839004]], [[-3.8494259224536602, 7.9398151451238439, 10.860659024941146, -9.3616188058672538], [0.57722233429477654, -9.9665050615220903, 1.114541279994326, -2.6864443283678794], [4.6116212928365874, -7.8146045135314068, -11.224124877333223, 13.837234277452296]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_mult_overloaded_Symbol_rank4_Symbol_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0*arg1  
       s0=numpy.array([[[[-2.0661122300024246, 1.0580438498189713, -3.6410497117409655, -0.10578252752952988], [-1.9851691312717246, -4.2057449475733168, -3.7366396432265327, -2.3123614484375086], [-2.2938842048257815, 1.8788743858125798, -1.7633113944789014, -3.8652909175067718]], [[-0.84807844026211932, 0.9559166290838732, 3.8304021317197705, -3.3056979910888362], [-3.3555135383346557, -0.13840088426391262, -2.1335169870177673, 3.4466986557390058], [-1.301474608687462, 3.432720657522637, -3.0604593562039453, 0.056094746864902234]]], [[[1.8411126280730707, -3.4796205912810576, -3.3155989332817262, 1.1391599087641993], [-0.4590714399212974, 1.3444660508165214, 1.3870067391861962, 4.6175126237309243], [-1.0179330038709966, -2.4680471927788492, 1.5621114726845065, -4.2948072136324535]], [[-2.4104965958906166, -3.6082065588935244, 2.1605381790820175, -1.4955881812159912], [-3.5853939297026463, -1.2413211680246219, -1.9557543519052745, -2.1399385878463395], [3.6618522069430917, -0.28412129657649476, 2.3242197412619126, 0.10553930286366864]]], [[[4.8358800787182119, -0.72997852013835551, -1.1183940166193906, 2.4806922815051724], [-3.4320371026178953, -1.5490012008772771, -3.0384950476049912, -2.1813983261114722], [1.3844489680145493, 3.9832567089980468, 2.0268814751009341, -3.392252223760174]], [[4.2126947021106478, 2.3637779443006037, 3.3812372857219692, -3.2981894466998352], [-0.42469673150459286, 2.215747484114412, 1.034235718519092, 0.76334948921088852], [4.1715109815752545, 4.0996175596480722, -4.1012082550265907, 3.3053946561335579]]]])  
       s1=numpy.array([[[[3.4547323358810527, 4.9737312710146266, -1.4614073901992275, -4.8072668270325245], [-0.69032606317347334, 2.9820524844786744, -4.6486728088838261, 2.5291915159611156], [-2.1448233429648411, -2.9720264754504089, 2.0051368686913875, -2.3935789003187269]], [[1.3833315606818042, -1.2644430929642638, -3.2692216831366094, 2.1966198251875415], [3.2114413699498385, 0.16985634285641282, -3.8529509212888655, -3.0387372468870879], [-0.57922735553952265, -2.8938663872826922, -2.3494273913570805, 2.1211674702341501]]], [[[-4.9943944161682481, 0.85061740925397533, 2.0614159343024259, 4.7210036187838362], [-1.5067718993184585, 4.7137134378721584, 2.0196290368013203, -2.2483675521511914], [1.0116079052013394, 2.9714156930801172, -3.9569425334457575, 1.1811524768749448]], [[-2.8670413748461234, 1.6634313714465279, 4.8325611060121538, 1.8063507993471131], [-3.6381173430812543, 0.19819873900522644, 0.31329607833222539, 4.4811941874422523], [2.7030019140204757, 0.74623921525782766, 0.81748787065230477, 2.7707042318076365]]], [[[-3.1632037756699649, -0.38669231101049739, 4.1016250758880783, -3.9074216612815671], [-4.9992300717359512, -1.4644644086359957, 0.66416738568439371, -3.1933209545884012], [0.53147163428478628, 3.4724853286560737, 1.2097168193100369, 3.2593642260160998]], [[0.89656763368938996, 0.1774361581617967, -1.0185696669545399, -1.4952985791546967], [0.088558654017845129, -2.9091586941415324, 2.8106420905847624, -1.0125986218296781], [4.6149557364596596, -0.54235226190719388, -2.3378993392105594, -2.7903337124114014]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-7.1378647305486869, 5.2624257819493208, 5.321056956821014, 0.50852483547236382], [1.3704139911243136, -12.541752169994641, 17.370415106064545, -5.8484049572237033], [4.9199763885686787, -5.5840644186806134, -3.5356806880532683, 9.2518787837378209]], [[-1.1731736723483877, -1.2087021790947856, -12.522433704150965, -7.2613617433083668], [-10.776034994434676, -0.023508268049161851, 8.2203362407155502, -10.473611583989774], [0.75384969589187367, -9.9338349277357008, 7.1903270416006047, 0.1189863523008497]]], [[[-9.1952426291849925, -2.9598258525422789, -6.8348284728230757, 5.377978051649249], [0.69171594545307291, 6.3374276904967486, 2.8012390846995574, -10.381865554845124], [-1.0297490736812458, -7.3335941598854015, -6.1811853282489144, -5.0728221780823528]], [[6.9109934743441341, -6.0020039847226121, 10.440932772286079, -2.7015569066336007], [13.044083837429449, -0.24602829020297487, -0.61273016863310559, -9.5894803613403976], [9.8979935242272798, -0.21202245339527998, 1.9000214472122516, 0.29241819306639449]]], [[[-15.296874123688616, 0.28227708094032361, -4.5872329432892807, -9.693110755727302], [17.157543090720907, 2.2684571276191887, -2.0180693121827846, 6.9659049850758272], [0.73579535561457832, 13.831800482266594, 2.4519526111775378, -11.056585543747472]], [[3.7769657205271732, 0.41941967718428858, -3.4440257360120987, 4.9317779934332791], [-0.037610570907824908, -6.445961057433669, 2.9068664420559349, -0.77296664074933441], [19.251338534125185, -2.2234368564295823, 9.5882120693915578, -9.2231541418339589]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3003     def test_quotient_overloaded_float_rank0_constData_rank0(self):     def test_quotient_overloaded_float_rank0_constData_rank0(self):
3004        arg0=-1.58150799807        arg0=-1.58150799807
3005        arg1=Data(0.74133131456,self.functionspace)        arg1=Data(0.74133131456,self.functionspace)
# Line 5208  class Test_util_overloaded_binary_no_tag Line 3100  class Test_util_overloaded_binary_no_tag
3100        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
3101        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3102     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_quotient_overloaded_float_rank0_Symbol_rank0(self):  
       arg0=-3.67302581217  
       arg1=Symbol(shape=())  
       res=arg0/arg1  
       s1=numpy.array(0.860877293856)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array(-4.26660784108)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_float_rank0_Symbol_rank1(self):  
       arg0=1.84515032598  
       arg1=Symbol(shape=(2,))  
       res=arg0/arg1  
       s1=numpy.array([4.1121025942454761, 1.8486000248291621])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([0.44871213295199996, 0.99813388575057449])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_float_rank0_Symbol_rank2(self):  
       arg0=-0.0302478592697  
       arg1=Symbol(shape=(4, 5))  
       res=arg0/arg1  
       s1=numpy.array([[1.1543466748160967, 0.79665903898441037, -2.864664843674154, 2.6235506067321976, -0.165490540913523], [2.9141515023322642, -4.8374009330989445, 1.3902485536186839, 1.8713760261183694, -4.7790320410857232], [1.9657459020288996, 1.6996778055775508, -3.1135382424241556, -0.87046379800506113, 0.53340798701434977], [-3.3080627266089468, 2.773942170795495, 2.6461141992094639, 1.3450961161189063, 0.044391586782907666]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[-0.026203444710001557, -0.037968387716127636, 0.010558952240612735, -0.011529359941485332, 0.18277696781185662], [-0.010379645411540774, 0.0062529154990550468, -0.021757159315854317, -0.016163432066861629, 0.0063292857234842652], [-0.01538747161497226, -0.017796231244803194, 0.0097149470841788009, 0.034749129531911754, -0.056706798559624877], [0.0091436776656059465, -0.010904286177329872, -0.011431048319363689, -0.02248750770093208, -0.68138720559014199]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_float_rank0_Symbol_rank3(self):  
       arg0=-3.25115318677  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0/arg1  
       s1=numpy.array([[[-3.5499792612060754, 4.5301113829030157], [3.3940364219436798, 1.5629170993870929]], [[-2.1382876669181829, -4.3638575120698695], [-2.5912463648843485, 1.4612664274589058]], [[2.1906533988574628, 3.3278319024343439], [-3.3723877433046368, 1.2459674779786987]], [[0.59149758449121315, -2.4104212318679332], [2.2101995048109124, 1.2087460478993233]], [[-3.6470960682658902, -4.2731272988905431], [0.031909489455729911, -0.039400427996532983]], [[-4.9198096892010366, 0.8434129553324432], [-3.46287972163835, -2.7866178405379474]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[0.91582314924918717, -0.71767621410748306], [-0.95790167888216016, -2.0801827480433923]], [[1.5204470554014795, 0.74501818122493191], [1.2546677270156652, -2.2248873481755815]], [[-1.4841020439210932, -0.97695835669728326], [0.9640508251821639, -2.609340327278296]], [[-5.4964775377123241, 1.3487904702231652], [-1.4709772487462367, -2.6896908514548787]], [[0.89143612504643965, 0.76083696069882278], [-101.88671903627868, 82.51568198835642]], [[0.66082905481147358, -3.8547584148568865], [0.93885824750184288, 1.1667022077700566]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_float_rank0_Symbol_rank4(self):  
       arg0=1.2254336203  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0/arg1  
       s1=numpy.array([[[[-3.2761206540383423, -0.94936910169360367, -1.2360828914458888, 4.5459618243065432], [-4.0505447425524279, -4.3307816167551518, -1.3423287956131547, 3.081882894814532], [-0.90463387173839749, -2.4374415447820308, 4.8725608859998673, -4.9140832532170275]], [[-4.2868592124678475, -2.2103589822505798, 1.7205702382151511, 4.3506243935228923], [3.3667899803314896, -1.1450451173343099, -1.537329694538434, 2.9015608194025058], [0.19762087766071001, 2.1166740444841832, 1.5419895906165433, -0.061809630763942636]]], [[[-3.4209479309226665, -1.7977524930395306, 3.646384704732629, -0.63271335013069496], [4.7991412852953417, -0.86093960734551533, 2.7427275031417055, -0.73127911649982913], [-3.4035624076167514, -0.81277635027161033, 4.1912852223475063, -2.8954499447271234]], [[-1.2680763361791589, -3.8136417528760971, -3.4671047104157973, 1.0379163072263387], [1.9384344892789063, -2.0582575975493169, 0.079915742590697114, 2.1796722501757557], [3.3945020411404254, 1.8305088854356093, 0.032154569768005459, 1.1901967055968203]]], [[[-2.7086910566882825, -3.6202658245103061, 2.1039801777613505, 4.4474282552841995], [-4.1242185905741868, -4.0708679289635077, 0.011108797880002186, 1.5708638642424759], [-3.9958527232861951, 2.3571535179553642, -0.12132085218879851, 4.2661726719677588]], [[-4.6027575799518612, -4.6383380927651716, -4.7746174621907436, -0.75316006327159357], [-3.4153565542886444, -2.2166851407464652, 2.1552647198234602, -0.66072874129786996], [-4.1599305009328873, -1.0460959400770498, -0.93815465141024745, -1.5079395808377196]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-0.37405021050932907, -1.2907873429953858, -0.99138466261236813, 0.26956531261323002], [-0.30253551020517866, -0.28295899649060618, -0.91291613820833228, 0.39762497866446334], [-1.3546183252481336, -0.50275405493122827, 0.2514968307154441, -0.24937176623834506]], [[-0.28585814452057745, -0.55440479584418934, 0.71222528036299027, 0.28166844789483547], [0.36397685256754514, -1.0702055331669718, -0.79711829196464301, 0.42233601036470647], [6.2009319804809131, 0.57894299950922834, 0.79470939865880041, -19.825933356195904]]], [[[-0.358214636715178, -0.68164757108756069, 0.33606811116405716, -1.9367911551793147], [0.25534435171803638, -1.4233676901859709, 0.44679379154265536, -1.675739936568104], [-0.36004441039618784, -1.5077131856598589, 0.29237657551032686, -0.42322735453556309]], [[-0.96637212235136971, -0.32132898151034495, -0.35344580641466727, 1.1806670843931275], [0.63217695881631863, -0.59537427276161958, 15.334070366752169, 0.56221003877908304], [0.36100541565304323, 0.66944969786660413, 38.110714251146277, 1.0296059588591393]]], [[[-0.4524080430919466, -0.3384927184077044, 0.58243591515242921, 0.27553758036254039], [-0.29713110335560416, -0.30102514787528689, 110.31199176852444, 0.78010173140493544], [-0.30667637301937506, 0.51987857853228214, -10.100766671091241, 0.28724426189992341]], [[-0.26623900976983872, -0.26419670058299988, -0.2566558745283723, -1.6270560270733645], [-0.35880108000970867, -0.55282258980828469, 0.56857684767251204, -1.8546697664307483], [-0.29458031090235587, -1.1714352129181804, -1.3062170703464653, -0.81265432373373103]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3103     def test_quotient_overloaded_constData_rank0_float_rank0(self):     def test_quotient_overloaded_constData_rank0_float_rank0(self):
3104        arg0=Data(4.25838984482,self.functionspace)        arg0=Data(4.25838984482,self.functionspace)
3105        arg1=0.815954760479        arg1=0.815954760479
# Line 6182  class Test_util_overloaded_binary_no_tag Line 4019  class Test_util_overloaded_binary_no_tag
4019        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
4020        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
4021     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_quotient_overloaded_Symbol_rank0_float_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=-4.7890228975  
       res=arg0/arg1  
       s0=numpy.array(-0.43906979621)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(0.0916825426828)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_array_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array(-0.441661137576)  
       res=arg0/arg1  
       s0=numpy.array(-3.06067114905)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(6.92990822296)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_array_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([0.71668747646409603, -4.4687260962833451])  
       res=arg0/arg1  
       s0=numpy.array(-4.15053990158)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([-5.7912828643999443, 0.92879711402061005])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_array_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[2.8008892800163787, -1.1724808508473128, -2.0236816531813382, -2.9536806982374744, 2.2166531647971262], [-1.7361168401429761, 3.4384227908066549, -0.63656619747821797, -4.2963682974141451, 2.4669545631904546], [-1.0713033500856985, 3.2990992359587583, 0.13293213405751558, 0.3542384532680849, 1.7007319862644446], [3.7532936908350027, 0.6994076662446771, 2.9608295402310683, 2.8320710521156442, -2.2090801005966423]])  
       res=arg0/arg1  
       s0=numpy.array(-0.139687829307)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[-0.049872670906105823, 0.11913868717407948, 0.069026582855608559, 0.047292799587325504, -0.063017449696277192], [0.080459924169154831, -0.040625553576535522, 0.21943959616466499, 0.032513001595037942, -0.056623592258643607], [0.13039054652029441, -0.042341202648334873, -1.050820633378668, -0.39433276658133409, -0.08213394610958806], [-0.037217399120083219, -0.19972304572628016, -0.047178612415422962, -0.049323561004002862, 0.063233483144847835]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_array_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[-1.0220679144772884, 0.71751559412406785], [1.3527603507918577, 2.0770461591302416]], [[-0.80135370978844556, 2.3025426882086864], [4.8631455301546147, -2.8692491573636714]], [[0.99825288356842634, 2.9159724038958235], [2.1435062189637506, -0.75473287438000103]], [[-3.2569479763004896, -4.4738194023176794], [-3.2903205363326538, -2.7404886556408692]], [[0.76910671370102524, -3.1243409037183909], [-4.1169728377454904, -4.7592115397326227]], [[4.7730432324519949, -2.1087498510456171], [-1.7211602990876207, 1.8994555696744397]]])  
       res=arg0/arg1  
       s0=numpy.array(-3.51159233253)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[3.4357720096539714, -4.8940989732960087], [-2.5958717155414228, -1.6906664866788266]], [[4.3820753428015253, -1.5250932590780311], [-0.72208251033253201, 1.2238715217583278]], [[-3.5177382307914669, -1.2042611678474349], [-1.6382468599620432, 4.6527618601630198]], [[1.0781849627562159, 0.78492044866792843], [1.0672493131749556, 1.2813745188466337]], [[-4.5658063698707192, 1.1239465988961714], [0.85295494309101916, 0.73785170152864465]], [[-0.73571349797360008, 1.6652484080960406], [2.0402471137568976, -1.8487362318921476]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_array_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[[1.7450551814990529, 4.5522109899804093, -0.82165366406344376, -2.8505315559512545], [2.8646429363346968, 1.7762693161877756, -2.1529530945869748, 4.482468402841107], [-0.81712829238560758, 1.9317236294178564, -4.6025589995732661, -0.28744782002330993]], [[-1.0690168655744037, 4.3683195656856189, -4.1423481155585442, -2.1018815894299161], [4.3199217626797228, -4.2065039537376467, 0.81869101563374791, -3.7691044119706927], [-4.4448928041530404, -1.0872350994395532, -4.1108008411737273, 3.6599530324597325]]], [[[-1.4847955394565595, 4.6915279968683574, -4.9462204875009332, 0.38311944040291657], [-2.1605058439124027, 4.921789830223247, 0.86876008503447455, 4.0080906317995542], [0.52810821807423114, -4.0083470980521003, -2.7283309652979471, 4.3855921458049316]], [[0.17355427248093136, -4.9979674375438075, -1.4890615846442481, 1.1926145054254835], [4.7492189465882806, -2.8039225223287634, 4.9182457207009573, -1.9797797943087216], [-0.1814442070193909, -0.60423151788723573, 1.955888981947421, 3.1763572948313463]]], [[[4.9633340244177369, -2.9593256257789857, 0.74622472068483603, -3.619627942514545], [-2.1097947112692559, -3.8882515457067459, -2.3822756291961298, 2.4446772210916539], [-4.1926297861519677, 4.9629186883932537, -1.6878019802614377, -3.0302163999127196]], [[4.8901305002202893, -4.3579851683387396, -4.5823886992556027, -3.9919614682494253], [-2.5955574182194718, 2.0062397543385879, 1.9559609862688969, 4.667203774386584], [1.6774343241567058, -0.55274037802019826, -3.8910159204710846, -0.62677331418122506]]]])  
       res=arg0/arg1  
       s0=numpy.array(-3.7748900116)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-2.1631923457924906, -0.82924320070246182, 4.5942593293331919, 1.3242758192671731], [-1.3177523675722878, -2.1251788662914786, 1.7533545069306105, -0.84214536999561496], [4.619702985174432, -1.9541563576265186, 0.82017199821974518, 13.132435693191763]], [[3.5311790984475766, -0.86415152436582299, 0.91129231689289836, 1.7959575033092723], [-0.87383295785955328, 0.89739366778679397, -4.6108848631765413, 1.0015350064633948], [0.84926457800675126, 3.4720089643446514, 0.91828579331672511, -1.0314039492105993]]], [[[2.54236351826993, -0.80461845567671231, 0.76318676475167246, -9.8530369736245316], [1.7472250872362507, -0.76697505212916661, -4.3451466942734598, -0.94181752819033071], [-7.1479478682789157, 0.94175726783709068, 1.383589476356671, -0.8607480782760828]], [[-21.750487369989866, 0.75528503512207812, 2.5350798452745904, -3.1652222863560824], [-0.79484438474163488, 1.3462889867830901, -0.76752773772886507, 1.9067221629678026], [20.804687422182926, 6.2474232142070472, -1.9300124119753108, -1.1884336871506487]]], [[[-0.76055530275279437, 1.2755912964497138, -5.0586504399638903, 1.0428944829566853], [1.789221478014464, 0.97084511308749089, 1.5845731557427165, -1.5441261443580785], [0.9003633051676867, -0.76061895199544338, 2.2365716214052274, 1.2457493173467764]], [[-0.77194054666521206, 0.86620074777428901, 0.82378214930075622, 0.94562285774257748], [1.4543658272040141, -1.8815747237790996, -1.9299413628924611, -0.8088119126747183], [-2.2503951166624794, 6.829408817798245, 0.9701553755522162, 6.0227356943802599]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_constData_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Data(-3.22684796483,self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array(-1.87319517819)  
       sub=res.substitute({arg0:s0})  
       ref=Data(0.580503078734,self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_constData_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([2.4730638665602358, -1.5074203039263478]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array(0.842046458632)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([0.34048714633596366, -0.55860097972570588]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_constData_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[3.2859915102953288, 2.4795448435755159, -3.3945252528690117, 0.2176569929619685, 4.7435531525741776], [-0.69448919513540375, 2.0551060198251614, 2.566869926254479, -2.2481445081249407, 4.2260017282466649], [3.501980230937118, 4.1555384461874496, -3.8274980306313222, -1.7332147962840261, -1.0693866670085308], [4.8075166222787562, -4.3582052192826453, 2.120997896569734, 0.026944412090264436, 4.7479424625405677]]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array(-3.35207139391)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[-1.0201095722287266, -1.3518898045340013, 0.98749343257395561, -15.4007061675262, -0.70665833945499923], [4.8266717717056, -1.6310941438436219, -1.3058984250151955, 1.4910391132776344, -0.79320161454485338], [-0.95719312299418446, -0.8066515175644674, 0.87578657574428376, 1.9340196039760114, 3.1345737676827188], [-0.69725632946968741, 0.76914032847364211, -1.5804218379168893, -124.40692276695719, -0.70600505805644109]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_constData_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[-4.0846598373483847, 4.8129282784933309], [1.8490372238113375, 1.5059684757189196]], [[-1.7801194133764806, 0.47758151262816462], [2.2151654089230313, -3.6940435833758887]], [[-0.15669470414838926, 1.3457128441986015], [1.8288665061204048, 1.6141884239453921]], [[-0.35794691426768743, 2.1605710237263729], [2.945768466443849, -3.1417027197716649]], [[-3.4019159748366068, -3.9064878694324143], [3.2612931901414814, -1.3872832234363699]], [[-2.735224978455455, -4.638954524592469], [2.3140587213509134, 0.079607084072507384]]]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array(4.22693740476)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[-1.0348321703836887, 0.87824649780269337], [2.2860207195015345, 2.8067900974782738]], [[-2.3745246375043894, 8.8507140519346752], [1.9081813880514529, -1.1442575891049525]], [[-26.975623890641646, 3.141039652690198], [2.3112334282554956, 2.6186146189989721]], [[-11.808838786639843, 1.9563982661731918], [1.4349184102256007, -1.3454288269099892]], [[-1.2425166982454152, -1.0820300858572636], [1.2960924266299838, -3.0469174090435396]], [[-1.5453710162990719, -0.91118319491041988], [1.826633596529776, 53.097503243710733]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_constData_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[[3.5642743286862668, 3.3985262213595231, -3.1236958713349661, -0.12652691595332932], [-1.9087712791073761, -2.9584563048972368, 0.5244515237460492, 0.20591344806057243], [4.0707378546171142, 3.3932882775187831, 0.098641720781542652, -4.9166133917477826]], [[2.5788600466459322, 4.3580510247404121, -0.92675390701559923, 4.9427443806894757], [-4.7029199071959731, -0.99574742544777717, 4.654850137810163, -0.70432003795335696], [3.9305972324146108, 2.3700035353041251, 4.5386859107846522, 3.7011575937888246]]], [[[0.027604280800233916, 0.76800937715682416, -2.2990235827481631, 0.71290184097906906], [2.3618229526745953, 2.5713892532869176, -0.053783976134731404, -3.2844177374726637], [-2.1982527031275891, -1.2569220931631255, 2.5681384114851813, 2.6730810266816629]], [[4.2774812134616944, -0.99739556511140659, 4.5522684271263998, -4.0507605959337099], [-0.54541697043551363, -3.8556367417220039, -2.8191293583680066, 2.4793321331829388], [-0.84019134679291252, 0.81320154099700748, -0.40292599323561262, 1.1819303417127545]]], [[[3.6378069075430837, 1.0180462589209807, 1.8572065937073763, 3.0476476217429003], [-4.2907866013685423, 4.8175693418627059, -0.07299146617172525, -3.3873077060599499], [0.26639651954577381, -2.6392407917156699, -3.7635915230668893, -4.4639834809555055]], [[-2.1405474023181004, -4.7659823586961831, -3.0046597688054613, -4.3435262197749971], [2.9464554346517282, -2.3558940524048646, 4.0170019076782957, 0.76110492785930006], [1.8698058807759477, 1.797999068975189, -3.3748722377281357, 4.2746000071845351]]]]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array(-4.9330235231)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-1.3840190367503409, -1.4515184529395693, 1.5792265720779408, 38.987937751694894], [2.5843973959044639, 1.6674315976668399, -9.406061951859277, -23.956781694273872], [-1.2118253985594281, -1.4537590442240371, -50.009503930160328, 1.0033376900006203]], [[-1.9128698083163644, -1.1319334021327048, 5.3229055585943179, -0.99803330764481402], [1.0489278194073173, 4.9540911651205191, -1.0597599014053407, 7.003951694228272], [-1.2550315464583794, -2.0814414196514339, -1.0868836531253843, -1.3328326065825438]]], [[[-178.7050189353433, -6.4231292869944125, 2.1457037501135989, -6.9196391979119181], [-2.0886508523071297, -1.9184273702616679, 91.719204819384828, 1.5019476562985139], [2.244065714594059, 3.9246851892690207, -1.9208557845017069, -1.8454448158745651]], [[-1.1532542814162638, 4.9459048101455405, -1.0836407391328382, 1.2178017945702027], [9.0444995122966798, 1.2794316097577048, 1.7498393638658929, -1.98965820556255], [5.8713096033803946, -6.0661758179335381, 12.243001459123361, -4.173700724150808]]], [[[-1.356043255862093, -4.8455789507353115, -2.6561522771976485, -1.6186331674005077], [1.1496781316341744, -1.0239652349653547, 67.583565337576999, 1.4563257758594159], [-18.517597495318306, 1.8691070320626426, 1.3107223493485007, 1.1050720828488445]], [[2.3045616825678001, 1.0350486325450539, 1.6417910521241872, 1.1357186013160236], [-1.6742230223771974, 2.093907201839901, -1.2280361414997365, -6.4813974296251926], [-2.6382543630974076, -2.7436185080529687, 1.4616919324990805, -1.1540316087613238]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_expandedData_rank0(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-2.24305121942)+(1.-msk_arg1)*(0.887986195932)  
       res=arg0/arg1  
       s0=numpy.array(2.27020141933)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(-1.01210413729)+(1.-msk_ref)*(2.55657287211)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_expandedData_rank1(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([1.2776447073931969, -1.5715069234809134])+(1.-msk_arg1)*numpy.array([-1.723411354547717, -3.9839396851542705])  
       res=arg0/arg1  
       s0=numpy.array(1.26673298926)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([0.99145950508129255, -0.80606262074618018])+(1.-msk_ref)*numpy.array([-0.7350148795986241, -0.31795988126580788])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_expandedData_rank2(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[-2.6393442498487873, 4.7705452192639584, 3.8297424567273701, 1.0723244677415114, -2.146471225103781], [-0.13344771525756638, -3.7178834725818577, 1.3665966404513652, -3.3064432398259616, -2.5353311118420407], [-2.3639632959155064, 1.0157340105612249, 4.9331685276087001, 4.908508010976556, -1.519044973432353], [-2.0823253267151731, 4.581272117722623, -4.2190415400175585, 2.0991604926092853, 2.2921722871510646]])+(1.-msk_arg1)*numpy.array([[0.38685955037830766, -4.8242765295085004, -1.6844246622648162, 0.32494600795168793, 1.5332506934017349], [-3.7921811148924798, 1.4906670633992221, -2.164672021679217, 2.7543259553940347, -4.2154852083671805], [0.73297388308072087, 2.6849749176949578, -3.1831223657091865, 2.464394339508039, 4.8470926265240806], [-4.7306307422582785, -2.7964023267268101, -3.9303851774316634, -2.2617975139049751, 0.6476905050656514]])  
       res=arg0/arg1  
       s0=numpy.array(-4.69778265939)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[1.7799052395904469, -0.98474753795826908, -1.2266575918536231, -4.3809339436999544, 2.1886073311612355], [35.203170397646907, 1.2635637168387186, -3.4375780829061391, 1.4207964022500648, 1.8529266798511408], [1.9872485615600199, -4.625012661329615, -0.95228505434132682, -0.95706936789823882, 3.0925895819752558], [2.2560272398931214, -1.0254319190548473, 1.1134715349044, -2.23793401025253, -2.0494893362608604]])+(1.-msk_ref)*numpy.array([[-12.143380342542507, 0.97377972233846766, 2.7889538574389583, -14.457117627021987, -3.063936432316932], [1.2388075666902769, -3.1514633781981134, 2.1702052839138783, -1.705601564763495, 1.1144108986705248], [-6.4092087969680316, -1.74965606882533, 1.4758410515400111, -1.9062625587456028, -0.96919597403229762], [0.99305629953822527, 1.6799380455699771, 1.1952473987444079, 2.077012920258317, -7.2531288055745016]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_expandedData_rank3(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[0.25361929255679794, 4.6979337641309282], [-1.7116737278380842, 0.025339543945705145]], [[0.054527040975695051, -1.1649142005766624], [3.401085474785992, 1.2266278123878651]], [[-1.378764078666519, 3.8524819853574286], [0.7430957776670768, -2.6487962024480485]], [[3.6745948242463395, -0.52879315952560901], [2.8123554867380873, -4.5928034915110558]], [[1.1308118572068224, 0.78665940688850711], [-3.7950676162021955, -2.3698842366961115]], [[0.48730612496882042, -4.7728542642079752], [4.062020957681046, 2.9209232801565843]]])+(1.-msk_arg1)*numpy.array([[[-4.377206551932888, 2.7528113954709896], [-4.6967530033111391, -4.2886865814356536]], [[2.049743309027753, -0.12862715426957472], [-1.6830407667662728, -0.94468396157668622]], [[-3.8806000920297778, -3.9420054850643127], [0.33724294842999925, 4.3610309191107604]], [[1.2593296851410249, -0.54170932780752956], [-4.9820478737709673, -2.1754149816359014]], [[-1.6849404731662618, -2.5837372783570856], [0.64964466089223905, -1.88057151872954]], [[-2.5839416236624189, 4.9121674265636059], [3.4445625306216172, -0.95352077642177768]]])  
       res=arg0/arg1  
       s0=numpy.array(-0.107557861451)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-0.42409179667063202, -0.022894716454275987], [0.062837829255343647, -4.244664453362323]], [[-1.972560027577694, 0.092331144557687761], [-0.0316245687584535, -0.087685816646669038]], [[0.078010345000264589, -0.027919108216353669], [-0.14474293177714079, 0.040606318202714445]], [[-0.029270672440139638, 0.2034025204623286], [-0.038244760293620686, 0.023418781502310693]], [[-0.095115611642437037, -0.13672735685723672], [0.028341487511725157, 0.045385280759829429]], [[-0.22071928904572874, 0.02253533326113313], [-0.02647890362243489, -0.036823240850400271]]])+(1.-msk_ref)*numpy.array([[[0.024572260909929339, -0.039072005306177021], [0.02290047217192823, 0.025079440851735472]], [[-0.052473820003229865, 0.83619871761548148], [0.063906866413821012, 0.11385591989011015]], [[0.027716811549753924, 0.027285061336994133], [-0.3189328700613962, -0.024663402632485523]], [[-0.085408819247123763, 0.19855272178174974], [0.021589086290601085, 0.049442456891541725]], [[0.063834813848722707, 0.04162879188674308], [-0.16556414287007962, 0.057194241420507143]], [[0.041625499765856576, -0.02189621242735024], [-0.031225405401868793, 0.11280075286285135]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_expandedData_rank4(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-1.9218548523454606, 4.8049506470567405, -0.69037247529377677, 2.0116218795060181], [3.3569393839163837, 3.053015064776023, 4.3760374224907768, -1.6302955824912613], [-2.475881380204441, 3.9357192467974151, 3.8291908455350914, -1.5295583075475716]], [[0.81999785047861184, -4.9183238425622751, -4.498143495882724, -4.011335234830149], [-4.4155746631227935, 0.17738911818936565, 2.1013815503083864, 1.0342995976408043], [-3.5157615459815359, -4.416358741608537, 1.7633917697077583, -4.6567596125334845]]], [[[-4.4153661164448952, -3.7883707809528486, 0.61242697643119737, 1.0639880670701363], [4.2560645611324599, -1.5275323899062654, -1.8863580473592556, -2.0370178170350215], [4.7451670493741123, -3.8993028200612279, 1.1261669560743295, 0.10700593134448955]], [[-4.6742861811776582, 0.1248976674323039, -0.30310228858153465, 0.46472397894032014], [-4.4333471257878241, 0.61263143944596887, 2.9190945035942493, -2.3660053852685783], [1.3066376718910169, -1.2874398502853222, 1.6724759610401811, 1.9758214205261551]]], [[[2.7858676714998021, -1.3134639459292705, 4.6216329974630668, -3.1206523832686606], [4.9240105452803657, -0.75755976660862245, -1.3066142401730776, -0.7310987343478681], [-3.581614511043151, 1.199749845602625, -1.3345486714076427, -1.766892681430293]], [[1.1355441056054243, 4.9659988326980571, 4.0519878268280003, 0.75442809464434646], [-4.3942700482087558, -1.1583919847309576, -2.521709416650074, 4.3500829790485334], [-4.1117601199769886, -0.84361285996259472, 1.5452987513122638, -3.4677179476292341]]]])+(1.-msk_arg1)*numpy.array([[[[1.1419547964093937, -0.14604579034430554, -1.6087039885204546, -3.982809594767537], [-4.6472374938936465, 2.6681623597837625, 2.409596432688943, 0.23451015329997205], [3.6209678953089259, 3.4778621364355633, -0.3448424949352944, -3.6131889212886192]], [[3.2619727528997053, -2.0225509445644283, -4.7894142532264903, -1.7462717275800435], [0.3541935802690972, -2.1149488724967638, -2.3714311485631425, 4.5130949636467648], [0.26148367262553762, -4.3747859425548574, -4.6100240060251991, -2.6777575642537998]]], [[[0.047226159017216496, -2.8105894777930605, -4.5434009768706209, 1.0852051086248604], [-3.8777476574321623, -1.4547184533083923, -2.0418858679245258, -1.9051019416216572], [1.5376781546019549, 1.629644864826397, -0.30025050045655099, 4.6849023917389498]], [[4.8480900309568948, -1.5018443924628788, -0.081262965104784257, -2.919831613945314], [-3.5170993940367179, -4.2696467138474956, -1.2058726054684579, -1.5420027054467624], [4.2312161935663433, -0.40640431652962761, 4.5167061578898267, 1.1250083690074275]]], [[[2.132313363967075, -3.1339232587830823, -0.55690010715516181, -1.2706816370831753], [-2.720421176025678, -4.6316800442988306, 4.6386898556038414, 0.60325130684192185], [-1.1912830583247458, -4.7830477147313868, 1.5341704608876423, -0.73120055498447112]], [[1.0263504441609994, -4.1372119047533467, -1.9611705914831146, -0.012435178352796505], [-1.771732137627493, -0.7593409651550882, 1.9726289221577362, 1.1710292717153878], [3.5961298618902742, 0.92133584998993534, 4.4853963984503515, -0.906012375725882]]]])  
       res=arg0/arg1  
       s0=numpy.array(-0.592570404178)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[0.30833254834780283, -0.12332497203509127, 0.85833434180021084, -0.29457345349802028], [-0.17652103193086022, -0.19409350809139839, -0.13541255409122707, 0.36347421322994511], [0.23933715440330824, -0.15056216336072609, -0.15475081501075208, 0.38741275913068546]], [[-0.72264872869166419, 0.12048218522136959, 0.1317366608514518, 0.14772397954501984], [0.13420006440547586, -3.3405115839500827, -0.28199086648081789, -0.57291949598539482], [0.16854681309532085, 0.13417623858211272, -0.33604013263398136, 0.12724951543201551]]], [[[0.13420640294612399, 0.15641827013279394, -0.96757724101468956, -0.55693331769218513], [-0.13922965586325461, 0.38792657235544992, 0.31413463897154387, 0.29090094314480824], [-0.12487872355440602, 0.15196829575010065, -0.5261834410804318, -5.5377341866272314]], [[0.1267723843192185, -4.7444473252428576, 1.9550179147488176, -1.2751018476160108], [0.13366208134964483, -0.96725431641927362, -0.20299801991632704, 0.25045184084016797], [-0.45350782158352687, 0.46027036062845256, -0.35430727734330036, -0.29991091199956044]]], [[[-0.2127058690692403, 0.45115087171960783, -0.1282166724410059, 0.18988670681660194], [-0.12034304125246875, 0.78220944445219653, 0.4535159544103643, 0.81052035291352598], [0.16544784547616745, -0.49391163195409515, 0.44402307452244544, 0.33537430450987138]], [[-0.52183829870908682, -0.1193255222447, -0.14624190138353538, -0.78545643830724066], [0.13485070277367608, 0.51154567019547681, 0.2349875843210584, -0.13622048292694303], [0.14411599579928377, 0.7024198329605128, -0.38346656507361887, 0.17088194978008153]]]])+(1.-msk_ref)*numpy.array([[[[-0.51890880973700837, 4.0574288569445995, 0.36835266674713768, 0.14878200679157813], [0.12751024774543779, -0.22208933500819278, -0.24592101654010112, -2.5268432766758884], [-0.16364972607074457, -0.1703835232484481, 1.7183798774262291, 0.16400205388843328]], [[-0.18166013301352851, 0.2929816951067607, 0.12372502624492518, 0.33933459198783522], [-1.6730128302383775, 0.28018190504942003, 0.24987881454509295, -0.13130022943267411], [-2.2661851052813815, 0.13545129109384663, 0.12853954847171942, 0.22129352264322535]]], [[[-12.547503682487543, 0.21083491874578786, 0.13042441272405889, -0.5460446135654059], [0.15281303904407884, 0.40734370477710891, 0.29020740751812157, 0.31104393483209597], [-0.38536699139857372, -0.36361934858819173, 1.9735867326689656, -0.12648511209607399]], [[-0.12222759899145422, 0.39456178493066674, 7.2920106153421589, 0.20294677314544776], [0.16848270059782106, 0.13878675307172775, 0.49140381951712409, 0.38428622860721995], [-0.1400473001307006, 1.4580809801390651, -0.13119525235068888, -0.52672532978672804]]], [[[-0.27790024402220842, 0.1890826147441671, 1.0640515176147489, 0.46634057413350205], [0.21782303762388922, 0.12793854465566237, -0.12774520880338708, -0.98229443924527715], [0.49742200230025474, 0.12388971206647155, -0.3862480860408537, 0.81040748689099529]], [[-0.57735679616007662, 0.14322940613640003, 0.30215138180821949, 47.652746697035113], [0.33445823530173741, 0.78037460293906225, -0.30039628716894723, -0.50602527066657921], [-0.16478003490863558, -0.6431643837420844, -0.13211104471903351, 0.65404228469120929]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_Symbol_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=())  
       res=arg0/arg1  
       s0=numpy.array(1.82570656056)  
       s1=numpy.array(4.66261797796)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array(0.391562544731)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_Symbol_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(2,))  
       res=arg0/arg1  
       s0=numpy.array(2.59398034121)  
       s1=numpy.array([0.23289932844698047, -1.3210295794887559])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([11.13777510009594, -1.9636050407059973])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_Symbol_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(4, 5))  
       res=arg0/arg1  
       s0=numpy.array(0.447444980617)  
       s1=numpy.array([[-0.45885144250425025, 2.1177099983792953, 2.6403824932467179, 4.5644837216768934, -1.5158889052358706], [-4.5159901760914476, -0.78662354060920947, 2.9211021051253292, -0.91057749527382192, -2.9713901047378624], [-2.3054923119158186, 4.0709664019727931, -3.8890107065002946, 0.47273919781782148, 4.8745505035404708], [0.95850563500844288, 1.7016231332381713, 3.4680303460659285, -1.9487259589377093, -2.7986389146273325]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-0.97514127486407298, 0.21128718330614088, 0.16946218275618757, 0.098027511521594779, -0.29517003460566366], [-0.099080149240730511, -0.56881717558348777, 0.15317676839564495, -0.49138594237084809, -0.15058439479332092], [-0.19407784545809026, 0.10991124377739432, -0.11505367672784513, 0.94649435181646269, 0.091792049398570469], [0.46681518008276729, 0.26295186747098948, 0.12901991504324264, -0.22960898045445291, -0.15987949652175668]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_Symbol_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0/arg1  
       s0=numpy.array(2.83060246908)  
       s1=numpy.array([[[-1.219338701825615, 1.4040404155797859], [-3.2466087602626379, 1.3772636953123572]], [[-2.4757278583941691, -2.6504047465338907], [4.7868871022061086, -1.1664894053298913]], [[1.5269686644901199, -2.9417064338297436], [-3.0119601495359838, 4.137438840077504]], [[-1.241390553802435, -1.9080219199684425], [-1.7323738873145933, -0.48834118950778294]], [[-3.3323846558383439, 2.7650561302022991], [1.6790552820178872, 1.6465471842472006]], [[-0.75905002472250072, 4.4585191626976624], [-4.0336584484326856, -2.0057026381151632]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[-2.3214242809153207, 2.0160405909034158], [-0.87186436004342094, 2.0552363927924358]], [[-1.143341526606144, -1.0679887563510875], [0.59132425909381137, -2.4265993811381725]], [[1.8537397229581878, -0.96223145740367066], [-0.93978749005488194, 0.68414364018121054]], [[-2.2801868923583206, -1.4835272275721891], [-1.6339443175662005, -5.7963623177697077]], [[-0.84942248912307539, 1.0237052471230139], [1.6858304186839717, 1.7191140929082436]], [[-3.7291382344827433, 0.63487502594136447], [-0.70174569941032194, -1.4112772328692633]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank0_Symbol_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0/arg1  
       s0=numpy.array(2.84790065661)  
       s1=numpy.array([[[[-4.1030282028335465, 0.088101066597992883, -2.0462594205254101, -3.7193022238920683], [1.6452873554059968, -2.0145080649129445, -1.0091976515541043, -2.4046330703599708], [-4.317313541147306, -2.0936680174368929, -4.3308925148156954, -4.290816307559318]], [[-0.68852685298637173, -4.3708655779911956, 1.5677689375964254, -3.73694607810378], [0.16294440377048769, -2.5271750822121861, 0.76778107241644733, -2.0605734833280041], [-4.1281298096464401, 2.8256959183040875, 2.8578167862022363, 4.3002795054986791]]], [[[2.5637546437882088, 4.2864185836616446, -4.8442330834716856, -3.4791458478692738], [-2.105397079855087, 1.4207582030633903, -3.0996680696844536, -1.4857572814300268], [-1.1897483735121952, 0.95779424221727538, 4.8962577967723639, -3.7104632755925646]], [[1.0992149719613096, -4.5020933405322863, -3.0105306326018977, -1.4676502112368883], [-3.4187278166935275, 1.1039557494388301, -0.49636358874846032, 1.4504020348099704], [-0.33090900189614203, -2.4803026612581203, -2.0740674761722797, 3.0162498790294308]]], [[[-2.95267082119374, 2.9990579190592754, 3.4025951293105123, -2.7980960450982248], [-2.5636192032978764, 4.6486611582692348, -4.423583042556368, -4.4614284512271212], [2.1962770601963815, -1.7996536085134629, 4.6592660998956656, -4.1808406985835846]], [[1.2160733195852416, -0.47265399850406808, 3.1145056262250765, -0.081667879270925781], [4.491647535786548, 1.9600044904975409, -3.5835703234534098, -2.1815625516843005], [1.5591653897616977, 1.4601958643991528, 3.16548165610266, -3.7083117138779653]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-0.6940972656835408, 32.325382274930341, -1.3917593380598694, -0.76570831977967835], [1.7309442312625438, -1.4136953364504334, -2.8219453862418518, -1.1843389711773735], [-0.65964647447227109, -1.3602446199162317, -0.65757823517132741, -0.66372001327391861]], [[-4.1362230743171704, -0.65156445692344589, 1.8165308600739241, -0.76209305595715549], [17.477744498795886, -1.1269107062088792, 3.7092613492619479, -1.382091286552718], [-0.68987672091957053, 1.007858148557774, 0.99653017308845848, 0.6622594305713535]]], [[[1.1108319836726472, 0.66440096808660642, -0.58789505119523067, -0.81856317071425755], [-1.3526667647915784, 2.0044935517308087, -0.91877600845794216, -1.9168007400698319], [-2.3936999789309024, 2.9733950477885327, 0.58164842923233462, -0.76753236592926644]], [[2.5908495874358031, -0.63257254818988429, -0.94597963088914816, -1.9404491852381487], [-0.83302936335060607, 2.579723560529378, -5.7375293457563288, 1.963525000833541], [-8.6062955081017982, -1.1482069108310493, -1.3730993274457286, 0.94418591656126805]]], [[[-0.96451681513817866, 0.94959841839350922, 0.83697899643625939, -1.0177994646031687], [-1.1108906708709456, 0.61262814381367658, -0.64379952387271755, -0.6383383007803024], [1.2966946239262591, -1.5824715618255112, 0.61123374272892239, -0.68117894508012444]], [[2.3418823608271682, -6.0253391817750703, 0.91439894429120128, -34.871735155036468], [0.63404366302542281, 1.4530072101448535, -0.7947104143514494, -1.3054407513598281], [1.8265545626589934, 1.9503552407204512, 0.89967371983306677, -0.76797768805444511]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_float_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=0.250579789999  
       res=arg0/arg1  
       s0=numpy.array([-3.6836287510414643, -1.2956959618775787])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([-14.700422372692062, -5.1707919536697942])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_array_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array(-1.83922816262)  
       res=arg0/arg1  
       s0=numpy.array([-2.2583935191033069, -2.2086784778047894])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([1.2279028589288774, 1.2008724761254168])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_array_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array([0.52815694592065032, 0.33949980125469281])  
       res=arg0/arg1  
       s0=numpy.array([0.022953566558036265, 2.5537574781691896])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([0.043459745697417715, 7.5221177412512246])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_constData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(-0.237789555411,self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([1.0482138325029133, 0.22620091375497342])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-4.4081575857729796, -0.95126513594733952]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_constData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(numpy.array([-1.0535278251483007, -1.4908682127893949]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([3.6581062478907427, 2.7196120669501873])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([-3.4722445488099059, -1.8241800607324163]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_expandedData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-2.46042867527)+(1.-msk_arg1)*(0.905188745543)  
       res=arg0/arg1  
       s0=numpy.array([3.5865775481840014, 2.1018236972393218])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-1.4577043359303656, -0.85425101664908099])+(1.-msk_ref)*numpy.array([3.96224275417172, 2.3219728565884816])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_expandedData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([-3.7476436001557212, -1.3759840886481376])+(1.-msk_arg1)*numpy.array([-0.85538783864736523, 2.4154956612046732])  
       res=arg0/arg1  
       s0=numpy.array([-2.1717690958504807, 0.37320093079628691])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([0.57950256949733425, -0.27122474298590576])+(1.-msk_ref)*numpy.array([2.5389291239921352, 0.15450283632890546])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_Symbol_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=())  
       res=arg0/arg1  
       s0=numpy.array([2.9660616955749521, 3.4821028971432408])  
       s1=numpy.array(-4.93979079908)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([-0.60044277505177879, -0.70490898071870256])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank1_Symbol_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=(2,))  
       res=arg0/arg1  
       s0=numpy.array([2.4680663572838144, 2.1900392256599517])  
       s1=numpy.array([1.9989402657396482, 4.7915920033295674])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([1.2346873989106324, 0.4570587863361788])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_float_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=3.84217553729  
       res=arg0/arg1  
       s0=numpy.array([[4.8604483205501356, -3.4024056155006188, -2.7976478135049865, -4.1659652779524503, -2.7071790414266781], [4.6823810675911286, 2.8379994226202809, -1.7398937229372691, -3.731261886709869, 2.8973035802519185], [4.4236264798371714, 3.4024116398224855, 2.549059399038307, 1.2253306068120136, 0.15363497548075333], [-4.5408268893126422, -0.4319486644371171, -4.7142073216583622, 0.80001848187669111, 0.82970695625790736]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[1.2650250550430411, -0.88554142893144783, -0.72814159226974617, -1.0842725007006555, -0.70459535623753489], [1.2186796314072366, 0.73864387378281715, -0.45284076847845939, -0.97113259154680187, 0.75407892016630629], [1.1513337787145699, 0.8855429968769537, 0.66344168148905103, 0.31891583164757187, 0.039986454025722117], [-1.1818374369513871, -0.11242293857853103, -1.226963025478724, 0.20822017997651748, 0.21594717581339351]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_array_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array(-4.63257727746)  
       res=arg0/arg1  
       s0=numpy.array([[-1.9685718235986682, -0.87021437619160924, -1.8672734012043088, 1.2150612833849781, 4.5599062001565436], [4.2647892721195042, -3.81357985274947, -0.64294283578962741, 3.7879983547050919, 1.5828048363193368], [-0.61115006872056288, -0.44286041419836231, -0.86564480177718828, 3.6559817391590794, -2.6233123603298525], [-4.9804312159968775, -4.1322960136462452, 4.2175543346794182, 3.4026924504688001, -1.5630660528376241]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[0.4249409574183326, 0.18784670477608559, 0.40307442042882347, -0.26228624167731884, -0.98431303506625256], [-0.92060833887631899, 0.82320911759072479, 0.13878728778422353, -0.81768702988182884, -0.34166830719051711], [0.13192441963008672, 0.095596983638681562, 0.18686030473551779, -0.78918958501710568, 0.56627492715408156], [1.075088642390998, 0.89200800464813812, -0.91041208426230524, -0.73451391022100088, 0.33740744281643564]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_array_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array([[4.802917856698329, -3.9225242412760442, -3.5705591721489292, 2.6448047966927204, 4.5327944493473034], [-1.415482016265055, 0.42611453399021482, 4.080278329078439, 0.84966506980636147, -1.6149914786019162], [-0.98468445983360908, -4.1376028647082546, -2.5515707271226407, -2.5097439665160937, 0.47848120897668345], [-3.3603885239252138, -4.913173298107159, 4.2579084643805576, -3.5864988244677587, -0.31262332324325737]])  
       res=arg0/arg1  
       s0=numpy.array([[3.6608200581160801, -1.7066363423464628, -3.9780707177149619, -2.3524004416383804, 4.7802687777018313], [3.6276335807827884, -2.0172971351419888, 3.7615985384535264, 0.6993542012406726, -1.2835246353030305], [4.689564220794594, 4.8919720674111407, 4.9910236206998437, 3.0822290237611494, -3.1796339084534706], [1.8338315896901829, 1.5252136815442725, -0.20322185761106937, -3.614335020182089, -4.4938247839592185]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[0.76220750954767291, 0.43508624481853386, 1.114131015876926, -0.88944199004025315, 1.0545964153283329], [-2.5628256234260052, -4.7341664604857474, 0.921897536167125, 0.82309397678317564, 0.79475628962090028], [-4.7625045505308687, -1.1823203500600044, -1.9560592883616161, -1.2281049640452975, -6.6452639075496389], [-0.54572010844392327, -0.31043352004942992, -0.047728094511922337, 1.0077613843128643, 14.374566610510053]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_constData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(-3.7591290551,self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([[-3.9553109148976029, -2.70740941632336, -1.3556826080619788, 1.4160132531482637, -3.9597021050411274], [-4.9271526555616916, 0.198012798739855, 1.8838787164367607, -1.2108056587474927, 4.1164130361434843], [-1.92804425400087, 0.011597615055991994, 2.3300730518596167, -1.834529575188836, 2.1468773360336648], [3.7093451434958169, 1.5264515426978829, -1.8686801895989911, -0.17609287978349997, 2.0844426282106951]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[1.0521881150979122, 0.72022252405747056, 0.36063742111274288, -0.37668652296637622, 1.0533562553982738], [1.3107165471944555, -0.052675179765670599, -0.50114765649769044, 0.3220973903793331, -1.0950443509132874], [0.51289653154739534, -0.0030851867243693785, -0.61984385683624066, 0.48801984403779464, -0.57111030362733672], [-0.98675653033549182, -0.40606521359678382, 0.49710455858458696, 0.046844063399339816, -0.55450148096980356]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_constData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(numpy.array([[4.6593190286526394, -2.2563646223555036, 1.2957050024388455, -1.2806413271211001, -0.50274644149954284], [-1.3515174181976897, -3.0192215147593959, -4.3372668393659817, -0.41270382952712303, -2.4250755068099714], [-1.9923062738763475, 3.8939089572798835, -1.4523322255050877, 4.3246840380068186, 0.15013064111686436], [-4.3252042285107581, 0.29845172545702248, -4.2663963698627425, -3.8495753555604129, -2.7832985460320758]]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([[4.0606327150318968, 0.76547763798667923, 4.1500470308296791, -0.096782367836682148, -3.0003357102717896], [-4.6536297722512092, -4.3426219587571975, -0.84233709033134119, 1.5288077284683226, 2.5942876879079222], [-4.1154533892682643, -4.0162159850809553, 0.22381783455923632, 3.9580110339772201, -4.7600128538328832], [1.4887741356876392, -1.9025207483301765, 0.95921315452608713, 4.824710644126057, -0.9040727600038494]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[0.87150776541827235, -0.33925263248790366, 3.2029258380713497, 0.075573359837020321, 5.9678904962960697], [3.443262890726956, 1.4383250574786872, 0.19420919245412932, -3.7043701053611104, -1.0697760464046493], [2.0656730560111112, -1.0314098324185037, -0.1541092531231259, 0.915213920645497, -31.705805146916042], [-0.34420897997694078, -6.3746347769202041, -0.22482982624442527, -1.25330983251364, 0.32482062022872571]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_expandedData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(0.835967454073)+(1.-msk_arg1)*(-1.06653482743)  
       res=arg0/arg1  
       s0=numpy.array([[-0.14655320990715559, -3.8001570185285671, 1.1126554486164455, 3.9816673468095836, -4.4840430826626339], [-0.17118166526439715, -1.2503714485166806, 4.9628077234834915, -1.5652911714598861, 0.59876994028452568], [-3.0679099745083791, 3.9437241167655266, -3.0843900728631404, -0.51335700946831597, -2.6101078962790423], [-1.6462587586108834, -4.1546791144355977, -0.62781066902453109, 4.8548024268764891, 3.4316591977990001]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-0.17530970756464487, -4.545819337836611, 1.3309793858539967, 4.7629454082315661, -5.3638967172869361], [-0.20477072932719939, -1.4957178565076108, 5.9366039901455068, -1.8724307553276913, 0.71625987036572447], [-3.6698916441779064, 4.7175570024279967, -3.6896054479563438, -0.61408731520221005, -3.1222601831698791], [-1.969285706745328, -4.9699053404430398, -0.75099893657996752, 5.8074060218744492, 4.1050153101988984]])+(1.-msk_ref)*numpy.array([[0.13741061814238281, 3.5630875999572966, -1.043243427221658, -3.7332745677086154, 4.2043100397193278], [0.16050264919836998, 1.1723681368501686, -4.6532073738793063, 1.4676418727326397, -0.56141620965994998], [2.8765211370630994, -3.6976983923524047, 2.8919731391271255, 0.48133168863005682, 2.4472786346558615], [1.5435583689114967, 3.895493149959103, 0.58864525834470738, -4.5519398917216538, -3.2175781883064065]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_expandedData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[-2.1839175205691275, -4.2007488324810645, 2.2458259090040658, 0.99064130655618321, -0.49309020203387366], [2.7937860435087059, 1.1198202516992586, 1.9493749682414645, 0.12007162205864841, 3.0544074383360709], [3.6516814549311807, 4.627156426129762, -3.6298502116198037, -3.4472182673273846, 3.8907748338656116], [3.9925127326601135, -1.3254125552525906, -3.5219278020998459, -4.6012167569495652, -0.69185800276755227]])+(1.-msk_arg1)*numpy.array([[-2.7291180936639092, 1.765768464449545, -3.6079136180523852, -3.9674261251403555, 4.635166494670953], [-1.2679254334611012, -0.44031739374268852, -2.9882872151661166, -0.88858512897545427, -4.8809222394930103], [-2.2915333941538076, -1.8888526739041955, -3.1163084775995111, -4.7914928523250104, 3.1434562487691444], [3.6296447844742588, -4.6866746521540517, 4.9390511146654141, -3.7067786752720533, 4.2554868400298815]])  
       res=arg0/arg1  
       s0=numpy.array([[1.9585987331175936, -3.1903594408658655, 0.0201274699999896, -4.0776181300987222, 1.0868318318236518], [3.8507933676487749, 0.28494356300721968, -4.0030067174638253, 1.6989022127300561, -3.4167657099741646], [2.5540312258727056, 2.2723170524823733, 4.391100541813449, 4.3682416352815938, 0.91691219102361643], [-3.9020417511508523, 2.6895595664033092, -4.2789732367998026, -1.7906459332683511, 1.828099326417024]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-0.8968281607114833, 0.75947398144762723, 0.0089621684028551134, -4.1161398208539817, -2.2041237634427588], [1.37834225945684, 0.25445473286881115, -2.0534821584761329, 14.149073557948901, -1.1186345564413283], [0.69941238232151293, 0.49108282565302869, -1.2097194886325464, -1.2671787210817593, 0.23566313399653463], [-0.97733983895175136, -2.0292244522240446, 1.2149520027777374, 0.38916791532670209, -2.6423042287641523]])+(1.-msk_ref)*numpy.array([[-0.71766727048741441, -1.8067824321805508, -0.0055787006371995013, 1.027774179400623, 0.23447525198354396], [-3.0370818866982794, -0.64713219840171521, 1.3395655869850185, -1.9119183489925202, 0.70002461467795685], [-1.1145511701416118, -1.2030144456875875, -1.4090712050419054, -0.91166610697581663, 0.29168918491633011], [-1.0750478305320033, -0.57387375186522827, -0.86635532564025164, 0.48307333405518993, 0.42958641282137938]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_Symbol_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=())  
       res=arg0/arg1  
       s0=numpy.array([[2.3654005635645365, -0.47985318232124374, 0.70302761718657347, -4.5935397614416242, -0.48858161634655595], [-1.5710860928228563, -2.8402165987557924, -3.9812558479339755, 1.5037093071846623, -1.8172653047495277], [-0.023510921596018974, 4.8363738014508559, 4.0987675552425227, -3.7682407339950053, -3.7291689654194213], [1.2011303232123076, 1.613115010751236, 4.2949765481585445, -0.69643986747194297, 1.2807978499390504]])  
       s1=numpy.array(-3.29311374632)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-0.71828693017559042, 0.1457141232540804, -0.21348415856324646, 1.3948925288633875, 0.14836463419833831], [0.4770822430830553, 0.8624714533253276, 1.2089639637807121, -0.4566223407448961, 0.55183800036645825], [0.0071394198339729568, -1.4686324779557809, -1.2446480355622593, 1.1442789482154607, 1.1324142597821432], [-0.36474000467001416, -0.4898449112342308, -1.304229637666096, 0.21148369631927186, -0.38893216226424426]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank2_Symbol_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=(4, 5))  
       res=arg0/arg1  
       s0=numpy.array([[4.9131349618220366, -3.5871090264995287, -1.709951920753523, 4.7490548484091573, 2.1948395516770756], [3.3642955096618046, -4.1565068688518387, 1.2961288132870159, 3.2268100489885434, -2.1119221705093496], [-4.0254756191684704, -2.1428400152526716, 4.9743390747385074, -0.85218241610914536, 0.60727499525218498], [-4.3907335294931249, 0.68489282986810096, -0.97290889051195784, 3.1771259248236952, -4.4361337745317266]])  
       s1=numpy.array([[-3.8853910394329825, -0.89222862517818413, -1.0835636118388958, -4.8250934548253461, -0.88873280977836444], [3.7435733351941671, -2.7025708737941381, -1.0734304593235833, -0.74552847887954954, -2.1845032660367614], [3.2809979725576142, 0.23551922731252972, 3.926408644912744, 3.1880684988826324, -4.6075992396575671], [-0.81849846846867269, -1.166217652400392, -1.649368774518809, -1.6086608148476844, 2.9355110853601047]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[-1.2645149257715482, 4.0203922237791447, 1.578081713035375, -0.98424100856737884, -2.4696281351697063], [0.89868561623551291, 1.5379825591831826, -1.2074641650319526, -4.3282183583893366, 0.96677455389705502], [-1.2269058539010673, -9.0983655122524745, 1.2668928592502759, -0.26730367192794691, -0.13179857094023592], [5.3643759868087963, -0.58727702196790277, 0.58986741203209492, -1.9750129396447818, -1.511196396653204]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_float_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=-0.58370956364  
       res=arg0/arg1  
       s0=numpy.array([[[2.5022326038819038, 1.3439248114356221], [2.750568222095513, 2.0737934784647898]], [[-2.2553961681594856, -4.4584683610261946], [-3.9987196300860282, 4.7211460918374097]], [[-2.9328381949587143, -0.85954838294985514], [-3.9841858143360498, -2.3705099776243643]], [[1.8446190490138488, -3.8201808686382988], [4.0763827948933979, 1.266289097926383]], [[-2.7501762589509426, 1.0321595727918185], [4.3014031345767769, 2.2247538361316144]], [[4.8202945613627826, 1.0956037981103446], [2.4112999359225071, 3.7471567969899482]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-4.2867767803517136, -2.3023861439832327], [-4.7122205861117603, -3.5527831093464735]], [[3.8639013452070841, 7.6381622621051468], [6.8505295769850827, -8.0881766993761186]], [[5.0244819986651494, 1.4725617610057351], [6.8256305233198633, 4.0611121100042178]], [[-3.1601658837150342, 6.544660404079444], [-6.9835806175111994, -2.1693821324931997]], [[4.7115490823897277, -1.7682759322204638], [-7.3690811364338158, -3.8114054912128861]], [[-8.2580359507939924, -1.8769673590370317], [-4.1309926821911214, -6.4195569687460345]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_array_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array(3.89226644376)  
       res=arg0/arg1  
       s0=numpy.array([[[3.9943435749589433, -3.3488547949307259], [-1.143688963025574, 2.0281701369660219]], [[-2.481046279351963, -0.58868685615565663], [0.45117187958983695, 1.1867115940200481]], [[-0.21656532851600385, 3.9362015543303794], [4.7358592930523855, -3.9422724665364592]], [[4.8074492613577195, -2.1628143381781384], [-2.9396358398326794, -0.98449648367712506]], [[-2.7127062435785234, -2.5781589440365016], [1.9323493519269332, -1.8991620958934363]], [[-0.36609542993290223, -3.8243446152521199], [3.5914308557193646, 1.2644485662121916]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[1.0262256278370616, -0.86038683202114463], [-0.29383624670877284, 0.52107690115007921]], [[-0.63742971227680256, -0.1512452615105786], [0.11591495240848597, 0.30488960896341066]], [[-0.055639903291584018, 1.0112877962500839], [1.2167356375723444, -1.012847533306577]], [[1.235128512094094, -0.55566965145572711], [-0.75525041317349062, -0.25293655968873985]], [[-0.69694772512965453, -0.66237987077383298], [0.49645865200820621, -0.48793219152226397]], [[-0.094057134891064875, -0.98254954292276497], [0.92270940533248547, 0.32486176999486494]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_array_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array([[[-1.017553102578943, 0.96193106062414824], [-0.62794048091135046, -3.0558954901641497]], [[1.8360779261924431, 2.8614721321425698], [-1.6509249120893332, 2.5054709054441684]], [[2.5302640719994232, 4.3290261206851408], [-2.2301358666200954, 4.1718168788611383]], [[-1.9315946055743813, -1.3112139632837638], [-3.782113392179264, 2.8359511681657246]], [[-0.65070211247534182, -1.4191275732866693], [-2.9812636334619969, -0.65272098130150891]], [[2.0531304670113535, -4.7422968227910367], [3.7109709127961459, 2.4072790103906483]]])  
       res=arg0/arg1  
       s0=numpy.array([[[3.6798207854000822, -0.42765449834289093], [2.2515124619399582, 0.4802205274495428]], [[0.63413269446528275, 2.3108617428122429], [4.0885121224255734, -0.9502441775390027]], [[4.4108168221788819, -1.4959163756423388], [-2.3372817560913139, -2.1545795370600054]], [[-4.9469641233066719, -4.40094459629867], [0.51578787106283919, 2.5686220415858774]], [[-0.85363702380658601, 4.1110605345277698], [1.2204112525632818, -2.6335321568907721]], [[-2.8648156729376884, -2.613590248070341], [4.7352515119354859, -4.8138185239661704]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[-3.6163427501461496, -0.44457915525194458], [-3.5855507494472483, -0.15714559905441902]], [[0.34537351896621954, 0.80757793055351224], [-2.4764979270022307, -0.37926769593460674]], [[1.7432239073344782, -0.34555494329186098], [1.0480445568698038, -0.5164607171463822]], [[2.5610778312541602, 3.3563893609530209], [-0.13637557037009956, 0.90573563833514315]], [[1.3118706815923151, -2.8968928600313508], [-0.40936039297741589, 4.0346981824294605]], [[-1.3953402956938568, 0.55112329441499097], [1.276014181519834, -1.9996928080160488]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_constData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(0.481307018833,self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([[[4.811262310876387, -4.9359961388745175], [0.97483788878457656, -1.5295283138350158]], [[-0.08935743741468638, 1.2771696072233052], [2.0161186706055894, 3.7825818109070308]], [[0.60444369408747978, 3.7327006943909513], [4.794743803239518, 2.1743275450316855]], [[3.6842584112884662, 3.9771578847791176], [3.4378492104429412, 4.0518493011089145]], [[-3.100929998833525, 2.1055796834786777], [2.3995271545001557, 1.353004570277565]], [[3.0551256028968012, 2.5963182497174486], [-3.0208683688004099, 2.9112442906062714]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[9.9962438165675849, -10.255400286590936], [2.0253972010400716, -3.1778641365852449]], [[-0.18565579540355123, 2.6535445303102758], [4.188841200561467, 7.8589791191519787]], [[1.2558381042385192, 7.7553423248308393], [9.9619237111244257, 4.5175479682496134]], [[7.6546949600365828, 8.2632451411684649], [7.1427364985889126, 8.4184296978178832]], [[-6.4427275678515707, 4.3747121922001639], [4.985439772559193, 2.811105006445008]], [[6.3475608776839989, 5.3943078910723781], [-6.2763854475407221, 6.0486221407432863]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_constData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(numpy.array([[[1.0934762742660595, -3.9863941676371519], [1.1769382460543278, 4.8475623577700624]], [[-1.2914398749109179, -4.0939229739924254], [4.5952176801962459, 1.9542489546580768]], [[-1.606325803607056, 2.9929930604580761], [1.7014988536569859, 3.0238306150893912]], [[0.519093132670152, -2.2222008211898636], [2.8817773125148518, -2.0669649899584441]], [[-4.8662820979454029, 1.723624784484171], [1.7318218413813629, -0.3396969185950347]], [[-0.87663117415045644, -4.1452571226603041], [-4.1500392156391435, -4.742403156568634]]]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([[[2.6714183032092507, -2.0736481018198747], [4.7989903758033741, -0.7416197722514184]], [[-1.8708383241337945, 4.0796808334501105], [-2.5958485722460303, 0.73991918294291281]], [[0.51144533038886486, -1.4650566497237314], [-3.9836133928094486, -0.45218521340218487]], [[0.94368266780976562, -2.0275736976267078], [-1.840874793405749, 3.0393255600353903]], [[-1.987943831477347, 0.76084226224679874], [4.8395143333857238, -1.8976875962596451]], [[4.188484266693612, 0.82201213035433174], [-2.4362843783830455, 0.92070893209697147]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[2.4430509980678865, 0.52018140068898011], [4.0775209675545296, -0.15298818612672216]], [[1.4486453147986025, -0.99652115082946324], [-0.56490219896071836, 0.37862073876476604]], [[-0.31839451824804033, -0.48949550504454065], [-2.3412377764742978, -0.14954052358148284]], [[1.8179448126303976, 0.91241695093112962], [-0.63879841978465213, -1.4704291435998127]], [[0.4085138903715998, 0.44141988969745288], [2.7944643136764893, 5.5864139248255853]], [[-4.7779321454689008, -0.19830184377725368], [0.58705092935075687, -0.19414396070939496]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_expandedData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(0.264228413595)+(1.-msk_arg1)*(3.69068505919)  
       res=arg0/arg1  
       s0=numpy.array([[[-4.4209840461541745, -0.6680093020710185], [-0.30407049501128469, 3.4693664467452496]], [[1.4315387299053466, 0.53526780893456838], [0.74240949490033437, 4.445632530701829]], [[-2.0339451150739096, 1.4992582046627634], [-0.48386139311845611, -0.34550233445572509]], [[2.2985763534290671, 1.3849870914184397], [-0.93291616323830873, 3.0243867593031108]], [[4.1088847598146803, 0.0031388828692779924], [-0.61052756038113642, -0.88179522001403043]], [[-2.7859510152809888, -1.0224766082522274], [-4.3748196286901297, -1.7765465529096538]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-16.731675394032898, -2.5281509016458852], [-1.1507865141149829, 13.130179300327315]], [[5.417807685508012, 2.0257768710473418], [2.8097261940870455, 16.824960155547689]], [[-7.6976775033376263, 5.6740991033612733], [-1.8312239268099415, -1.3075896333583339]], [[8.6992020356713571, 5.2416281526049584], [-3.5307185572697364, 11.446107245442445]], [[15.550503081437849, 0.011879429719800997], [-2.3106052527590952, -3.3372460138414306]], [[-10.543722294566344, -3.8696694058758436], [-16.556961339492272, -6.723525788682708]]])+(1.-msk_ref)*numpy.array([[[-1.1978762682955559, -0.18099872824640478], [-0.082388632499081849, 0.94003318926070678]], [[0.38787886447843911, 0.14503210118187321], [0.20115763956941177, 1.2045548345108694]], [[-0.55110232448862906, 0.40622761915985794], [-0.13110340908495838, -0.093614689120005493]], [[0.62280479546928391, 0.37526558598397169], [-0.25277587989141126, 0.81946487191421091]], [[1.1133122154613735, 0.00085048786849579268], [-0.16542391198112033, -0.23892453728036581]], [[-0.75486013317375944, -0.27704249803347114], [-1.1853679082692461, -0.4813595645304295]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_expandedData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[2.0358230085352425, 3.1580474339245157], [-0.71050908958133263, -4.5682212248371474]], [[-3.7626788869693959, 4.5221700976091004], [0.28596263069047723, 3.1947138017562331]], [[-4.258054781436349, 3.203663289226073], [0.86246630848964045, 4.1442565438249659]], [[0.36177956287775626, -1.564955248260941], [-3.2981602109502726, 4.562042318919433]], [[-3.8670190023565612, 4.0328438320380187], [0.86619544071279186, 4.6779383230768516]], [[4.1372426959449182, 4.6703421259592908], [-1.4104724817125458, -4.4941550413711964]]])+(1.-msk_arg1)*numpy.array([[[-3.8063249490102988, -4.6335397937937417], [4.6855877849627543, 2.4790051273719804]], [[-2.3225046518438086, 2.7192147691239832], [-3.8670891923081729, 0.85017500224662079]], [[-2.0513028045774684, 2.6955808867842155], [1.3677135472129969, 4.6661985123970862]], [[3.168939941587654, 2.5745180099514355], [4.2210703327235972, -4.2438382220083604]], [[-3.1001710006552443, 3.9847770584240561], [1.202716755383852, -1.9798123193048522]], [[2.0219433216643967, -4.9923793259716884], [-0.60866137483297411, -3.5901957674698002]]])  
       res=arg0/arg1  
       s0=numpy.array([[[-2.1211682629566053, 0.36960432425757972], [3.6941064486272683, -2.4596343529892661]], [[1.3138577382887675, 3.0065667312789568], [-0.33184210526166158, 2.0701231136838736]], [[1.9960154063910291, 2.919939605358195], [-3.3541753533434573, 3.3084427046304192]], [[1.855458189222877, 1.1677186990891908], [3.9689395126118363, -0.3560796182990158]], [[-1.8568079361083112, 1.7024208692609024], [-3.2148044071034687, -3.0954345563844008]], [[0.6659197854510186, 4.1502612949700755], [4.6757737978044318, 0.98834133927792944]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-1.0419217456839571, 0.1170357101945968], [-5.1992388314187785, 0.5384227759409681]], [[-0.34918146824561963, 0.66485042941408756], [-1.160438706485547, 0.64798390157699348]], [[-0.46876226559906375, 0.91143773291592733], [-3.8890508769175254, 0.79831995670250488]], [[5.1286981897587962, -0.74616747053107113], [-1.2033798417173609, -0.078052677596238726]], [[0.48016519571710731, 0.42213905129090384], [-3.71140767545256, -0.66170914249002322]], [[0.16095738983446969, 0.88864181317714697], [-3.3150407813183795, -0.21991705452519947]]])+(1.-msk_ref)*numpy.array([[[0.55727461301172954, -0.079767163055907142], [0.78839766069106587, -0.99218606925462494]], [[-0.56570725800084476, 1.1056746107066586], [0.085811857125434696, 2.4349376401487834]], [[-0.97304766606711313, 1.0832320483031899], [-2.4523960884779514, 0.70902313646549719]], [[0.58551383851512295, 0.45356788904779038], [0.94026851006079393, 0.08390508772280772]], [[0.59893726369153866, 0.42723114600900525], [-2.6729522081676249, 1.5634989873541465]], [[0.32934641555770983, -0.83131930167631884], [-7.6820609802741879, -0.27528898235386912]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_Symbol_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=())  
       res=arg0/arg1  
       s0=numpy.array([[[-4.6124855932265207, -0.56828165747182613], [-4.2141671249920885, -4.0285116789180861]], [[3.5840149695253753, -1.9392877965409183], [-0.23648100526193172, -0.68536276919646166]], [[-3.9846305279824601, 0.71912821055158815], [-0.057666947733906682, -2.1183434857340631]], [[-3.4307195648020805, -2.8525348601388636], [-3.7205656855595324, 3.2213033993721787]], [[0.77814087131638932, -4.2069905378022341], [0.8574581244243884, 4.3390554154071008]], [[-0.58307060609323091, -0.12508729878059555], [2.543616292591163, -2.5355954979724284]]])  
       s1=numpy.array(4.97313252093)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[-0.92748093355875361, -0.11427036281051871], [-0.84738685471452269, -0.81005516381496789]], [[0.72067554090692965, -0.38995296995966938], [-0.047551720020836387, -0.13781309191170613]], [[-0.80123151981374352, 0.14460266391948975], [-0.011595698986739568, -0.42595757841107362]], [[-0.68985082347218707, -0.57358915092887797], [-0.74813322787975411, 0.64774131511937016]], [[0.15646895956240731, -0.84594378293639372], [0.17241811289265385, 0.87249945525137251]], [[-0.11724413207147331, -0.025152617239550892], [0.51147164928431432, -0.50985882384984771]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank3_Symbol_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0/arg1  
       s0=numpy.array([[[2.4645648081172826, 1.6980176207009627], [4.7027202859553991, 2.7604541725129064]], [[-1.7513225113892936, 2.3814399998416196], [1.9888233729828588, -4.7816532557077771]], [[-1.9751639832620382, -4.9328245725020246], [0.72835204531473607, -0.016188327291017934]], [[0.45903782490552825, 0.71151035439200427], [-0.31247113370263513, -4.001209310940955]], [[-4.4961635875307069, -2.4681702955441889], [2.9055873946982658, -2.5862104232829553]], [[3.3865992870041026, -1.2849283689353985], [-0.091088044037289428, -4.8362741867263974]]])  
       s1=numpy.array([[[-1.6494097388594087, -2.1252299672746835], [-1.7109310933939548, -4.933453949440862]], [[3.8170427831702263, -1.4677908390608896], [-1.7552884213494115, 1.9681278051680131]], [[4.0242295328380848, 1.3775005481500582], [-2.2724112023066025, 4.1743518571099454]], [[-4.6769218157461792, 1.0828394842276081], [2.2012776471635886, -3.774148675501813]], [[2.6754829908813962, -3.5258664834266504], [-3.0387192159337459, -0.91993770557317056]], [[-3.4898730470900787, 2.7149080420814373], [4.9740267734221781, 0.62582120980931677]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[-1.4942101711013092, -0.79898065002275398], [-2.7486321945477452, -0.55953784119658501]], [[-0.45881657892624961, -1.6224655015324212], [-1.13304648329755, -2.42954407897285]], [[-0.49081792356636661, -3.5809964497848363], [-0.32051947489759997, -0.003878045705094371]], [[-0.098149561397423341, 0.65707832486319639], [-0.1419498962819449, 1.0601620802362672]], [[-1.6805053901873306, 0.70001808268856269], [-0.95618817936932321, 2.8112886422799761]], [[-0.97040758827256257, -0.47328614782483869], [-0.018312736980830521, -7.7278847551363361]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_float_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=-3.71619728349  
       res=arg0/arg1  
       s0=numpy.array([[[[1.7813621774755903, -4.784107009829917, 1.0849323873322279, -4.6185100523094871], [2.2937774254919123, -2.5872103671605826, -1.0519690484153688, 0.068973317805904877], [-1.5629472412639589, -3.7034175697267093, -2.3559579978147083, -1.8948688536090663]], [[-3.6671175859935081, 1.6443757911446513, 2.0739029993336233, -1.0763804521179154], [-1.1481244441536189, -4.9271722313444126, -4.6348514543584702, 0.85703417349832556], [1.8712560406957692, 0.56879558015418574, 3.6539135783865575, 0.096898691807437487]]], [[[0.80259216166159497, 3.9056252783064345, -2.6173560997829681, -4.5763739026622652], [0.16444996810291279, -0.57983416699148904, 3.7055975031377955, -0.24221686553212241], [0.25228193113052377, 4.0085532694076296, -3.2897426609799894, 0.22129103719573706]], [[0.17461875198297605, 4.2958531238569044, -2.9613835033619482, 2.6447517640189862], [4.4214521629274834, 3.4860002097846881, 1.5792707712446008, -1.8332265862689212], [4.9955884282417955, 2.1209301601548844, -4.2968046485035938, -2.2302744358990489]]], [[[2.6671551030012708, -3.9961171915997085, -1.6836106604532719, 2.0533472945235776], [2.1618778516789146, -4.8071715327037223, 4.1170248782760837, 2.1760055271593171], [-4.4246290468759399, 1.4612833879472724, 4.6371956520143502, 2.1396190598324711]], [[1.3087591042708189, 4.8591126469474979, -3.4319061255317584, 4.2934471519325399], [-1.8184330676389218, 2.2837424110830344, 4.913045368415359, -0.4354466706842306], [-3.2678552204354503, -4.4381745142099529, 4.8656506586439576, -1.1404669445260751]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[-0.47935080986950934, 1.2873662631111924, -0.29194692976941794, 1.2428054002484619], [-0.617237797272707, 0.69619833657785735, 0.28307674974337099, -0.018560187348594697], [0.4205770366949762, 0.99656107768561508, 0.63397010925168984, 0.50989458014719813]], [[0.98679303229833815, -0.44248883084069229, -0.55807128662076866, 0.2896456700240575], [0.30895142441832768, 1.3258640097593886, 1.2472027453844656, -0.23062127979749211], [-0.50354055448278978, -0.15305849952618208, -0.98323993578604751, -0.026074689908940556]]], [[[-0.21597135470373907, -1.0509736110239554, 0.70431032050193965, 1.2314668876688348], [-0.044252216865217686, 0.15602889802637634, -0.99714768093748529, 0.065178688604141485], [-0.067887120054516512, -1.0786707388267465, 0.88524435330593576, -0.059547709745899673]], [[-0.046988558104484358, -1.1559809117084983, 0.7968854389186707, -0.71168228225373686], [-1.1897786434997017, -0.93805574458396024, -0.42496957259536144, 0.49330712188334019], [-1.344274280172465, -0.570725932548797, 1.1562369596451665, 0.60014963301539037]]], [[[-0.71771084782043026, 1.0753242862949681, 0.45304663127904216, -0.55253990514611684], [-0.58174464022235195, 1.2935727481587642, -1.1078596113740611, -0.58554628862868641], [1.1906335184447352, -0.39322007861087183, -1.2478335508764924, -0.57575497117401164]], [[-0.35217697135871023, -1.3075497010171448, 0.92349944411701235, -1.1553334832377189], [0.4893263002257483, -0.614537452365438, -1.3220625800043491, 0.11717533743938924], [0.87935461202611154, 1.1942784991335145, -1.3093090294913103, 0.30689085038433739]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_array_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array(-3.42758815335)  
       res=arg0/arg1  
       s0=numpy.array([[[[-1.3381817381408254, -3.1710543873417829, 2.075389938327552, -2.4951219330019714], [-3.8176396241873101, 3.0982244659996496, 3.3225005505586509, 3.6522372758228503], [-0.12526623056292951, 1.1452246990138342, -2.0855841869778304, 2.1803178178645135]], [[-0.497277890334753, -2.4523117417653029, -4.7835315257962119, 0.48826462722017272], [-0.051085556518286168, 3.7786344297891254, 0.52831373701439777, -1.454437537093062], [-3.1234790331454465, -4.5841925007118292, 2.4897893191598488, -2.3422459603880919]]], [[[3.86593621397253, -4.8357227697130103, -1.4156902742415332, -4.164291452461204], [-2.3993788279733561, -2.9559202543441865, -3.3532957940794716, 0.70948438845695438], [3.1577973674940054, -3.2582788816777586, 0.043363625173825859, 3.1413576186892662]], [[-1.9537718741038224, 1.0636753607943934, -1.692681221703717, -2.5678640389909169], [2.5742934759392924, -2.922551166343017, 2.541392045041877, 1.1479064612110124], [1.1841615447339162, -3.9984329301379562, 2.6463680007799901, 0.84393543228244194]]], [[[-2.9150749086296002, 0.22949290082715912, 2.3860522405392803, -3.9221565784339365], [-1.8696848259209053, 3.272861267959847, 3.9210836285143618, -4.1055940255393413], [-0.69850315470944935, -4.2817748738470733, -3.9305948070377381, 2.2345367419484843]], [[-1.6380732544786456, 3.916012198472508, -4.8353779610939371, 4.0353326972970169], [4.4785494162056132, -2.6659181237330145, 0.48461763377230849, -3.3768850687192362], [4.2662497549259477, -1.3684445389828168, 0.81407866567121623, -1.4037512916676578]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[0.39041497352341747, 0.92515618722714443, -0.60549571461694018, 0.72795266565515537], [1.1137976481952163, -0.90390803310720735, -0.96934065643435641, -1.0655414572632296], [0.036546465023914239, -0.33411969226619148, 0.60846989009957619, -0.63610845886811018]], [[0.145080992256369, 0.71546277792031199, 1.39559693632258, -0.14245136970216543], [0.014904228347358337, -1.1024178695715743, -0.15413571099475551, 0.42433264208534244], [0.91127606159134289, 1.3374397085093925, -0.7263968737678177, 0.68335104907403488]]], [[[-1.1278881945573753, 1.4108237493414457, 0.41302811507744769, 1.2149334360332911], [0.70001958246517759, 0.86239073135197164, 0.97832517911999117, -0.20699230966903998], [-0.92128844721444603, 0.95060396287388527, -0.012651352272703777, -0.91649214495489573]], [[0.57001360335315621, -0.31032764533090096, 0.49384031743937712, 0.74917519961617629], [-0.75105099001476439, 0.85265528867093709, -0.74145198645150912, -0.33490209729188108], [-0.34547953013994032, 1.1665441561949426, -0.77207875695058303, -0.24621844706070084]]], [[[0.85047408796101476, -0.066954631233219444, -0.69613154608570893, 1.1442905048543099], [0.54548117867995305, -0.95485837899089154, -1.1439774713533262, 1.1978084419279087], [0.20378853101880742, 1.2492092638543533, 1.1467523608960122, -0.65192684825976399]], [[0.47790842458006783, -1.1424978799278245, 1.4107231513105136, -1.1773096757113275], [-1.3066183029671761, 0.77778251191714598, -0.14138735813347805, 0.98520735795372372], [-1.2446798051718875, 0.39924415587789014, -0.23750772533002523, 0.40954491288403561]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_array_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array([[[[2.6088318312845349, -3.8555118588727257, -2.666375938101504, 2.5954389555040294], [-0.28669236149270461, 4.6428561770952665, -0.48532622824660265, 1.0661514102815186], [2.3698821906871812, 3.4340649178306784, -1.4928658890977653, 0.50504110628694754]], [[-1.9919884165108459, -3.7769329506080052, -3.3752193942655238, -0.018872838935369174], [1.3082165149355234, 4.1010372745976742, -0.18546655074581686, -4.5704865012382347], [-2.3301269377493372, -1.5103330683661707, -0.9221732361477164, 4.0964006002504281]]], [[[-1.6269497668668298, 3.8022708687403544, 1.9570932065807822, -2.3469691763113509], [-4.3085167368769159, -1.0313727244860149, 3.6935607395965562, 1.776600985149174], [-4.1889234590043394, -4.4986065369257915, -2.2975334720530514, 4.2992482748544205]], [[3.0229599088238217, -1.9190732403470867, -1.819267332412128, -3.6489912761988919], [1.1090439772933696, 0.21113602817269506, 1.0963998921952456, -3.1308830148033917], [0.50092949167332623, -2.9053102706720049, 2.2746922158309264, -0.67767770297447072]]], [[[0.97572647372002308, -2.4136798663563352, 2.2608577070584222, -0.542850867724324], [-2.7668419236487263, -2.7379563607552138, 4.3404093611300283, -4.9806970685211018], [0.38475028289221314, 3.6145520581353043, 4.1846701146499932, -3.2451986406576658]], [[-1.6569108904697547, -4.898687525899291, 1.9676643147393893, 1.7469414314863911], [3.1722608816839752, -0.84682627919871756, -2.3572119052528584, -3.9270878706470933], [2.2429501579067637, 3.5601308913773089, 3.567587249397473, -2.6399682875000652]]]])  
       res=arg0/arg1  
       s0=numpy.array([[[[0.19376428256109968, 4.6522050031395654, 2.2436292058244502, -3.2618058078679724], [-3.3490535435142021, 3.4625339945985196, -4.2868769294648281, 4.9763889196504412], [4.971360331973937, 3.0213132760755386, 3.0154028223000733, 4.900006358005319]], [[4.942223347136478, 4.8221502717850697, 3.0091785843705736, 4.6164951333998836], [-3.8595089462608723, -2.5941234669696192, 3.8634984276039948, -1.4648776978560529], [2.8634755579151916, -2.197222740992272, -0.30340262340333801, 1.6680512522106774]]], [[[-2.6062872712531124, 3.0480419865587702, 2.0260383510826818, -3.6167083938030418], [0.586423541278565, 0.72374271593172246, -1.9705763163287928, -3.1710035625205899], [4.2369530820892489, 0.2183708894141132, -0.12711905144573699, -2.6896159641935178]], [[3.8334195958589916, 0.80754480000805096, 1.3462414315511477, 1.8728627125274517], [1.9004365164127934, -3.5129397107128013, 4.2405658659575369, -3.4041955581628311], [-1.0938638792995716, -1.82438585572298, 0.77341022551479011, -3.4873288951127157]]], [[[-1.195209518821343, 2.7497330097939274, 4.0358691590928313, -4.9790423078611523], [-2.4606854907602527, 0.77354411266824386, 2.2302925457131648, 2.439886879595675], [0.54525253332151102, -4.603388186670764, -0.04927021599852921, -1.8443152743858935]], [[3.1668833440765241, -1.9000621963132791, -1.9941477936517948, 3.160719036203659], [1.4837865175497624, 2.6256740319805205, 2.1191914433307959, 2.5638379526441648], [0.92775472558789751, 2.7973545251209062, 0.67334792884109085, -4.4613292437894732]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[0.074272431146201606, -1.2066374513758535, -0.84145269005913126, -1.2567453381828955], [11.68169785227928, 0.74577670781195771, 8.8329801275166027, 4.6676193190387654], [2.0977246681331532, 0.87980668635237169, -2.0198752241050095, 9.7021931423168137]], [[-2.4810502441541527, -1.2767370601611572, -0.89155051357051007, -244.61052993718985], [-2.9502065615270814, -0.63255300873219, -20.831241062432571, 0.32050804601636801], [-1.2288925171952281, 1.4547935068184372, 0.32900827253539822, 0.40719925002176383]]], [[[1.6019469834476112, 0.80163725620330384, 1.0352283398001023, 1.5410123108166658], [-0.13610798729393858, -0.70172760899062947, -0.53351669439285754, -1.7848709918700927], [-1.0114658631400073, -0.048541895722967833, 0.055328487263406334, -0.62560145221773511]], [[1.2681013680232713, -0.42079936452138589, -0.73999098844159139, -0.51325491643224452], [1.7135808455953419, -16.638276949301392, 3.8677182441772642, 1.0872956741172275], [-2.183668355491672, 0.62794871657580154, 0.34000653808553599, 5.1459991671647032]]], [[[-1.2249432100212736, -1.1392285481275917, 1.7851053370111725, 9.1720260644211766], [0.88934805770011793, -0.28252609272957013, 0.51384382442961707, -0.48986855575220534], [1.4171595384486364, -1.2735708637284329, -0.01177397850933112, 0.56832122732928547]], [[-1.911317839898242, 0.38787168731781269, -1.0134593480778316, 1.8092873517312771], [0.46773786043791687, -3.1006052793555026, -0.89902458010174946, -0.65285983840786932], [0.41363144977493654, 0.78574485334124688, 0.18874042364480703, 1.6899177406461035]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_constData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(-4.04111708221,self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([[[[0.42223799448164989, -3.1033236588102033, -0.80033310251004508, -1.0896528775545566], [1.6682569558322813, 4.0098792160980121, 1.5945552317949012, -3.7745188113230475], [1.8270101878950697, -2.9535452781404903, 2.5615509576539655, 2.5799210092797047]], [[-0.54195967462241068, -0.38040632653450146, -2.2818765608541023, 1.3722782314155992], [-3.6267169517011166, 0.11727240120324822, 2.1914452045925206, 2.7772738909684467], [-3.8921811336392298, 1.2193418031955332, 3.7882387946529974, 0.7073832370004105]]], [[[-4.2429986352576012, -2.4599942310306879, 2.2504380814880545, 2.3267122667262168], [3.24541415814201, 3.4539207928741718, -2.2645912175840488, 4.9232625664947243], [3.2376676783859217, -3.0106165895391146, 2.1065297844395934, 2.9012506423358584]], [[4.6388193402169602, 4.7251918425866091, -4.0573036939816749, 1.3132581689534737], [-0.756445103779674, 4.818652701627796, 1.133988837026374, -4.1805696912020904], [2.537841436541834, -2.6221682660892629, 4.646107301549776, -2.7482559990685571]]], [[[-2.7806957737834512, 4.3360364782797003, -0.54372666005866677, 2.8648417441461458], [0.74447191148349745, 0.21961440038853031, -1.9059116749417173, -4.1624851217276078], [-4.2737013221937712, 0.8079143452498343, 3.6029053993523981, -2.1724533635371213]], [[-1.6664598089428728, -4.3402863750227008, 0.075213826512115389, 0.17787976680823636], [-1.0290771648761843, 2.6480226865935919, -0.75447931364687193, -4.1875971824891831], [4.5305751456389878, 0.64209445393431785, 1.1757275741401498, -1.0346461578929276]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-0.10448546426454527, 0.76793708167355157, 0.19804749187648046, 0.26964150144340815], [-0.41282074285304093, -0.99226999231344615, -0.39458278474934944, 0.93402857045231558], [-0.45210523494603855, 0.73087347336355402, -0.6338719976546231, -0.63841778320155218]], [[0.1341113517865703, 0.094133953259990105, 0.56466479798417668, -0.33957893411654905], [0.8974540647858632, -0.029019797946373403, -0.54228698649740281, -0.68725400290865923], [0.96314485684606688, -0.30173384695154409, -0.93742366716712333, -0.17504645933552263]]], [[[1.0499568680998679, 0.60874114285448311, -0.55688514727707872, -0.5757596771871426], [-0.80309827508650034, -0.85469456158121238, 0.56038743038545846, -1.2182924835742459], [-0.80118135963997728, 0.74499613059858605, -0.52127412831350217, -0.71793283473793712]], [[-1.1479052068654727, -1.1692786292664157, 1.0040054795361468, -0.32497404609635061], [0.1871871288041945, -1.192406110391059, -0.28061271523650561, 1.0345084307530747], [-0.62800492658743434, 0.64887213430055546, -1.1497086590259922, 0.6800733418910252]]], [[[0.68810076946983412, -1.0729796712331334, 0.1345486035168002, -0.70892322243295536], [-0.1842242865869031, -0.054344973412317012, 0.47162990731796139, 1.0300332895714162], [1.0575544423130387, -0.19992351837746253, -0.8915617454433804, 0.53758733522052538]], [[0.41237602748032337, 1.0740313350816555, -0.018612137431826672, -0.044017474176013198], [0.25465165793080469, -0.65526997429835554, 0.18670068159348188, 1.0362474279521505], [-1.1211194957920161, -0.15889033672438146, -0.29094122991814259, 0.25602974050140515]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_constData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Data(numpy.array([[[[-4.0792610526149549, 0.12535299261993949, -1.3501512171276131, 0.84952612322295895], [-0.073861710505221723, 3.6205506819674795, 3.0260767268167612, 2.5885205168110161], [4.6161275499839842, 3.4536810991367091, -3.1347372821860686, 0.6022917738749376]], [[0.67796085624115676, -2.7924971486147743, -0.11847612528569673, -4.868281946201888], [1.340614466676266, -1.7797122354966266, -2.3531080310924244, 3.2955380064758995], [1.8720738958930596, 2.5506171551483696, -3.4737918495065645, 2.9752788288947674]]], [[[1.3166642309901446, 1.4918719185378135, -1.6990552524782245, -3.158145057688817], [-4.8177863171279061, 4.4905934294762915, -1.7851443690509439, -1.4730149241694059], [3.9340144125177385, -0.60089959424441908, 1.0208971169612973, -4.4449813485963858]], [[4.5822242033093943, 2.9065651948738802, 4.3691310369781018, -2.8137577716233997], [0.99789292284098607, 1.2503978000412355, -1.8014256639911408, 0.28517475709550588], [3.8679268681260712, 0.24184578963827974, -4.1017137989614403, -3.3332083942381785]]], [[[1.0921691085713707, 4.9194406375856268, 3.3206743355523862, -3.6331081413682407], [-4.9167768377489471, -4.1867997816916507, 1.121934932728637, 1.1502854226564549], [0.75329954254751552, 0.26905732829576934, 4.9137516103808778, -4.5251954004105297]], [[1.0041645596930131, -3.1149636648451229, -4.430917844297678, -3.8847590467581448], [4.3408305818149699, 2.7122090772051806, -3.5735278196684828, -3.2526285658220289], [0.80959944644830628, 3.0209451211314935, -1.4917142020211607, -2.208089126718523]]]]),self.functionspace)  
       res=arg0/arg1  
       s0=numpy.array([[[[1.9613833021963911, 1.7878737096911106, -1.5862872080811083, 2.621725097223063], [3.0959315321187972, -0.30298129117201356, 0.75689092957398962, -3.6904333716402005], [0.65531586383235219, -4.2771148146318483, 4.889524123152567, 3.3147698117881532]], [[-4.8247059976847995, 4.254155786133051, -4.4370883921304056, 0.13485332920727711], [1.3432779894584055, 4.4788963425491986, 1.8667696566625791, -2.8273342982596206], [2.3237924496910249, 1.7806006001970687, 0.53071667663675637, -1.9329962872703743]]], [[[-3.5676217985163641, 4.6752142507704626, 0.74525612751321191, -4.7597524473931365], [-3.2998574566717807, -1.8700724053916309, 1.0888970938497273, -0.16734288642158202], [-1.2075210569802763, 4.1295383758707125, 3.2817195471491303, -3.8120299201692989]], [[4.8355875999388811, -3.0149581625525066, 1.9383836555147536, -3.0396282039448286], [4.6492378042465958, 4.818365613902726, -4.8071950752127313, 0.86073488818045885], [4.692011928003609, 1.3230879681131791, -0.67485655550354551, -2.9426475954300879]]], [[[-0.61055325246166969, 3.7627526489948533, 0.35677382841293337, 3.8305950691112205], [-3.0606684665902084, 1.906033791793357, -1.8906117357413255, -4.9374881256126351], [-3.6470442954522344, 1.8577700207240522, 3.1665927842755153, 1.649456740608672]], [[2.6182492477581532, 4.4735447831907535, 4.2232823466171912, 2.8446256300233941], [4.599930858070465, -2.9483138355926286, -0.46758843469270506, -2.6200035489886875], [-4.1917128110665205, 3.8797742932721153, -3.6950152619315588, -4.3361147004833089]]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[-0.48081828470847016, 14.262712619169807, 1.1748959582881864, 3.0861029761823917], [-41.915242836136692, -0.083683759125660812, 0.25012284813088342, -1.4256921464106105], [0.14196225228538709, -1.238422046465427, -1.5597875301826776, 5.5035946954116062]], [[-7.1164964072329981, -1.5234235022382516, 37.451329383288687, -0.027700394245342815], [1.0019867925107082, -2.5166407541719056, -0.7933208471503691, -0.85792799011990306], [1.2412931213820895, 0.69810578847670735, -0.15277733946901342, -0.6496857600362882]]], [[[-2.7095911885093718, 3.1337906375720572, -0.43862971873703871, 1.5071354736556661], [0.68493229866595051, -0.4164421550872231, -0.60997704876308112, 0.11360569650435974], [-0.30694372982926421, -6.8722602168890816, 3.2145448279031057, 0.85760313063474225]], [[1.0552926669206848, -1.0372924604855904, 0.44365427338050994, 1.0802735880818599], [4.6590547921817969, 3.8534661639230543, 2.6685503439326888, 3.0182716624255637], [1.2130560085477493, 5.4707918218964044, 0.16453038621915067, 0.88282736852480681]]], [[[-0.55902812821753733, 0.76487408349774189, 0.10744017400115959, -1.0543575693479372], [0.6224948919974731, -0.45524837374077531, -1.6851349223463468, -4.2924025884028509], [-4.841426404055186, 6.9047367432484235, 0.64443485046857396, -0.36450508644533491]], [[2.6073906139035499, -1.4361466984922855, -0.95313939346726972, -0.73225278473764066], [1.0596891012841974, -1.0870525655163519, 0.13084785072026761, 0.80550345542653146], [-5.1775144232811252, 1.2842915503936556, 2.4770262674479406, 1.9637407965172489]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_expandedData_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-4.96856646121)+(1.-msk_arg1)*(2.66740615716)  
       res=arg0/arg1  
       s0=numpy.array([[[[-2.6429964304682239, -4.2883401550714808, 0.44979137161551996, 1.6898952919827179], [1.8799657376448051, 4.8264302694336845, -0.28797806285801286, 4.4283193242659191], [2.1167448135077844, 0.13376131666582136, -4.4097056987454488, -4.626146913652577]], [[3.8955023752976992, 0.47219102088716092, 2.6501797956028241, 3.806050672886478], [4.0635896582267996, 3.9907087208817682, -2.9372316305520529, -3.3870488895567763], [-2.4267024384306577, -4.6365358261267762, 2.4908116023211493, -4.7466255914921085]]], [[[-4.5287125294560511, -1.121917741944384, 4.128267380020116, 3.2191578929467628], [-2.2049499302009457, 4.7248756546032293, -1.8646869790027232, 1.3312355974332499], [-2.9258654608047463, -3.0993093890230905, -2.2517402185237154, -4.8392417623491042]], [[-2.0218788319849859, -3.132486410055626, 2.6847367445791672, 0.45094441184780543], [-4.6480020869798775, -4.0138474711467769, -4.5136851211754347, 4.4845606894318149], [-1.9063484943414712, 0.46295792885244857, -4.8211044607982725, -3.5847960055772576]]], [[[-0.24359761893841458, -1.7616341828717017, 0.72790375775981353, -0.63798761637837575], [-0.17808114736094982, 1.3036452104407097, -1.4910748833487553, 2.4612729538058726], [2.5091339560726444, -1.6062217600547033, -2.2123973885325112, 3.5385491957112247]], [[-3.4168709024399013, -0.31341708980142435, 1.9699518662462143, -0.39839518503311933], [4.9059521107844546, 3.1652841626784074, 2.3072134256474373, -3.5588516047162577], [-0.79304371618789649, 1.4739622381390411, 4.9351434610316058, 0.49911547335664608]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[0.53194345916539287, 0.863094051081431, -0.090527393590735694, -0.34011727631631633], [-0.37837186084206492, -0.97139291727620081, 0.057959990090982474, -0.89126700001696779], [-0.42602727165555015, -0.026921511005268076, 0.8875207231651242, 0.9310828283713205]], [[-0.78402943901659428, -0.095035665633894442, -0.53338922127619171, -0.76602591564428746], [-0.81785957578570745, -0.80319117235102544, 0.59116279383285808, 0.681695397656647], [0.48841098481363149, 0.93317375591658125, -0.50131393466667673, 0.95533100514024627]]], [[[0.91147266818583439, 0.22580310653056607, -0.83087695661341388, -0.64790476651166495], [0.44377990058419953, -0.95095349765218296, 0.37529677695994923, -0.26793152669422993], [0.58887517831316083, 0.62378342188250813, 0.45319716181801473, 0.97397142619128618]], [[0.40693404179469184, 0.63046080484428668, -0.54034433584417518, -0.090759460574500073], [0.93548151630232301, 0.80784819977446098, 0.90844817240864351, -0.90258643503006408], [0.3836817941805134, -0.093177364631623613, 0.97032101682423078, 0.72149502951512812]]], [[[0.049027746904522877, 0.35455582543286368, -0.14650176533671966, 0.12840476651755248], [0.035841554853157279, -0.2623785392867049, 0.30010162790218253, -0.49536882982690095], [-0.50500158861969247, 0.32327669813721949, 0.44527881549048315, -0.71218715163383128]], [[0.68769753390982158, 0.063079983381205212, -0.39648294565978276, 0.080183124879896497], [-0.98739790422195928, -0.63706185423727524, -0.46436199327530248, 0.7162733219937415], [0.15961217835758995, -0.29665744629702134, -0.99327310997296636, -0.10045462353245463]]]])+(1.-msk_ref)*numpy.array([[[[-0.99084889017463096, -1.6076817336416631, 0.16862500313570561, 0.63353504956333739], [0.70479170657891743, 1.8094095855916092, -0.10796183479027698, 1.6601593695722214], [0.79355924399622857, 0.050146587652843196, -1.653181195112176, -1.7343241490361749]], [[1.4604084064360867, 0.17702254289975836, 0.99354190530294761, 1.4268733176116617], [1.5234236628408269, 1.4961008881859938, -1.1011565009199562, -1.2697912091353076], [-0.90976112952113075, -1.7382189111616608, 0.93379540106180914, -1.7794911280191388]]], [[[-1.6977963844379937, -0.42060251639306406, 1.5476710844866359, 1.2068495396939025], [-0.82662699277395191, 1.7713371628532093, -0.69906376049876673, 0.49907495109405758], [-1.0968953689146963, -1.1619188104152318, -0.84416848648204368, -1.8142125635261934]], [[-0.75799436338436199, -1.1743567441522687, 1.006497168558814, 0.16905727335041956], [-1.7425175669259199, -1.5047755139841263, -1.6921626686125011, 1.6812440345434341], [-0.7146824975354561, 0.17356109327765115, -1.8074129610351601, -1.343925819453119]]], [[[-0.091323782201079548, -0.66042967552661036, 0.27288823481402957, -0.23917902965978752], [-0.066761916584337777, 0.48873142432425259, -0.55899806609714009, 0.92272147876618382], [0.94066437888969057, -0.60216617395983263, -0.82941901539546792, 1.3265880736651847]], [[-1.2809713636097437, -0.11749882520139773, 0.73852714966463595, -0.14935677641874479], [1.8392220088467912, 1.186652491665158, 0.86496517204670398, -1.3341993663625964], [-0.29730894714282119, 0.55258260320868147, 1.8501657303976995, 0.18711641345531671]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_expandedData_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[2.3160749392833146, -4.1082167444071427, -1.8507068979627972, -4.5095532905758553], [4.7514663127987529, 3.0568746546166832, 0.20878523885059064, 1.5215698798884203], [-3.529352116664084, -1.6506304315879095, 2.476471407122216, 3.9976407334037471]], [[3.3857545269712315, -4.0988669717852444, -3.8913301704295944, -4.553531293887481], [0.21111500760259716, -4.2651784583207437, -2.197709292342239, -1.1957550040589462], [0.69004614918223428, -4.3478988409148212, -3.9274127806240555, 3.5185579114648071]]], [[[3.5495186417315558, -3.467459279516957, 2.0236975099720675, 4.8670361677902392], [4.6944334107638177, -4.0340566540381442, 4.9971786745252729, -2.7776293517414565], [2.1321602055900488, -0.96868518657274372, -4.9622729937429373, -3.6564733291875227]], [[-3.1396081527685329, 1.9698368095212837, 1.1809845225485809, 1.7521001419909785], [3.9339719970744689, -2.4542582939082989, 0.3626651720757792, 0.79777721563240256], [0.45258755377689219, 0.0087160507261421216, 4.6056331315159067, -4.4236185297521633]]], [[[-3.3380204502363275, -3.2779869879702672, -4.3398753796512457, -2.4412570049691418], [-3.4486178755649757, 2.6818407829953319, -0.94514647664915241, 1.2680497486404194], [4.5603770192677828, 0.85756834204332666, -0.69086713726633064, -4.2242739375724758]], [[4.0503444072632782, 1.5492294893256382, -3.8536107825536026, -3.744331596499638], [1.0963392078769267, 3.4671176404740116, -0.42964752811371909, -4.4672624750670273], [3.8206133555167057, -2.8698412984449462, -4.2381675243236554, 0.60922957090934915]]]])+(1.-msk_arg1)*numpy.array([[[[0.63252823440169248, -4.4525508541057848, 2.7769151453437937, -4.6251900596437672], [3.6226993448933538, -0.056122209687133662, -4.8119267375959165, 0.43721425160748506], [2.4763254933476713, 4.0084829090910095, 3.4186559385225124, -1.0106832902771834]], [[2.3729043665434455, -0.014909565288815152, -1.931704732268904, 2.1495261115995952], [0.23992392812824193, 0.65658926401294693, -4.8589360414561336, -3.182921435071544], [1.2819312296007652, -4.1406694590900051, 1.3262628368912868, 2.9638388580673229]]], [[[1.8872507789712198, 2.2189886821834426, 3.6361917910149391, 2.335714859928931], [-2.2341255894844823, 1.5815736360033128, -0.48116773530751011, 4.0169082213111196], [3.96496738764254, -2.9459286239820468, -2.4150305816714956, 4.2852117090534243]], [[-0.78470419942831171, -4.074279987297853, 2.5476908578048443, 1.275167619154514], [1.7229703600928161, -3.7476309096977811, 0.88456709325854899, 3.0870583772123847], [-3.3241360176457069, 2.8546396483032641, 0.50007505175749678, 3.450827505824785]]], [[[3.2116561118905729, -0.85846516041034437, 0.20999626035701802, -3.7734151950481487], [-1.1352948501016691, -0.2781957856871724, -2.2983594846545596, -4.1039694480554703], [-1.6540176659186456, 4.034272633484937, -1.679271979012368, -0.5770651958429962]], [[-3.6252602516845203, -2.1549220004894662, 3.0484330753756872, -2.9368357996101602], [-0.95414657650842294, -4.6291859878224439, 3.9017776794543231, 0.8910541651444035], [2.0784602841300392, 3.8700189312205797, 4.5216189513825729, 3.1991357533518485]]]])  
       res=arg0/arg1  
       s0=numpy.array([[[[-2.8998062924874635, -2.4071534868718789, -4.5315690103363524, 1.9167730963803251], [2.5895856482940802, 2.7298640080819201, -1.0776085996575278, 2.270415241991131], [-1.1140952775871735, -1.259381623107465, 4.361221916584892, -2.1192000131387987]], [[-4.3723651177679423, 4.4027185416529733, 1.0258426889776722, -2.4638168407553698], [0.93451857576353436, 3.1765510452974084, 0.17415345909922753, 1.4507647929602294], [-0.17281088242814668, 4.6561579860183979, 1.9474340894629192, 1.4039417104821581]]], [[[3.2336065387156232, -4.9163240801700061, -1.781910099586951, 1.1867202924271734], [-4.3061798323795575, 1.8600733794720625, -3.7350789174247079, 4.8462811770442986], [-2.7487579427204234, 3.9293255674150558, -0.43938158949401362, 0.99039431969202152]], [[4.9675486094339032, 3.2866602536442571, 4.6233774485810724, 1.1090144442991923], [-4.444544309265992, 2.2427435441449521, 4.9062153282612222, -3.5887281139559581], [3.57707169902055, -2.5371662613665205, 4.4548036499960926, -0.13006863388599488]]], [[[4.3410798854682362, -3.1312537543030947, 0.66761208571708153, 4.766822872561395], [1.0665253973541144, -2.6304769204459157, 2.3583337797095023, -0.66607771064257726], [-1.5203676036335043, -1.8240126352372057, -1.7520035739621651, 1.2137109739552523]], [[-3.2140556186284011, 4.5725135743316141, 1.08378323718859, -2.3035223730266283], [3.4778255684307293, 3.2018680285985539, -4.3871778232309699, -4.6094450316874429], [-1.3447759539005122, 3.105850428981924, -2.4881810605750543, -2.8332717631230917]]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-1.2520347434806141, 0.58593634090726521, 2.4485611499717042, -0.42504722150329871], [0.54500768348470907, 0.8930245157285428, -5.1613256070687932, 1.492153118960021], [0.315665663487328, 0.76297007434664688, 1.7610628994311106, -0.53011267256485783]], [[-1.2914005084944229, -1.0741306248676297, -0.26362262877951098, 0.54107827128864161], [4.4265852360561304, -0.7447639240277083, -0.079243173656339719, -1.2132625730485442], [-0.25043380451139807, -1.0708984170015137, -0.49585673781747919, 0.39901054517465212]]], [[[0.91099860716273862, 1.4178462337573252, -0.88052196081989853, 0.24382812280722688], [-0.91729490134122738, -0.46109252769420189, -0.74743753639738264, -1.7447544518514986], [-1.2891892154791149, -4.0563493918155231, 0.088544421084459007, -0.27086053432586898]], [[-1.5822192986260011, 1.6684936730586288, 3.9148501612906492, 0.63296293272311288], [-1.1297854465083164, -0.91381724153144506, 13.528223016783272, -4.498408883626932], [7.9036015665245296, -291.09126840631814, 0.96725108639511415, 0.029403221143773008]]], [[[-1.3004952935986038, 0.95523678580614813, -0.15383208671091636, -1.9526100131442936], [-0.30926169144773369, -0.98084753469516262, -2.4952045402216938, -0.52527727035688787], [-0.33338638389104408, -2.1269589207212731, 2.5359486353549978, -0.28731824495565839]], [[-0.79352649934282071, 2.9514759471316134, -0.28123837573197236, 0.61520255716135286], [3.1722167222000368, 0.923495641226874, 10.211109191043157, 1.0318276701702607], [-0.35197907476262869, -1.0822376940024041, 0.58708888836859474, -4.6505814858823902]]]])+(1.-msk_ref)*numpy.array([[[[-4.5844693323933372, 0.54062346860164334, -1.6318716176598638, -0.41442039606215775], [0.71482212619836194, -48.64142063008893, 0.22394534630756058, 5.1929122475847986], [-0.44989856163095143, -0.31417911755374078, 1.275712442261663, 2.0967992975896541]], [[-1.8426217168360075, -295.29489668996598, -0.53105563797669941, -1.1462139619796903], [3.8950620017525894, 4.8379576386658245, -0.035841891643224211, -0.45579660778765652], [-0.13480511156746339, -1.124494005624318, 1.4683621038704786, 0.47369029752098213]]], [[[1.7133952597854167, -2.215569696070931, -0.49004843583610358, 0.50807584127083127], [1.9274564745365079, 1.1760902794083794, 7.7625298692100611, 1.20647047680429], [-0.69326117316560298, -1.3338156041621061, 0.18193624247603027, 0.2311191107780281]], [[-6.3304728240946853, -0.80668492688055005, 1.8147325192212265, 0.86970091432725694], [-2.5795825698513846, -0.59844301591743809, 5.5464592405170912, -1.1625073696198067], [-1.0760906533403476, -0.88878687818778002, 8.9082701373320603, -0.037692012616233936]]], [[[1.3516639808963908, 3.6475024249165364, 3.1791617840339801, -1.2632648744344102], [-0.93942590971728968, 9.4554880259899168, -1.0260943927420287, 0.16230084533357725], [0.91919671413490511, -0.4521292438437815, 1.0433113848493873, -2.1032475753146445]], [[0.88657238253031678, -2.1218928449814052, 0.35552141391689407, 0.78435518027000395], [-3.6449594371101619, -0.69166977456110024, -1.1244048696912254, -5.1730245051269579], [-0.64700584570629982, 0.80254140462366119, -0.55028543699248356, -0.88563661612501809]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_Symbol_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=())  
       res=arg0/arg1  
       s0=numpy.array([[[[1.9723965344554504, -3.1030793702499535, -2.9762306339668934, -3.6445536640482334], [-3.4637753511633305, -2.4733260123363743, -4.5602505790536529, 3.2365694057851542], [0.62947934539060491, -1.6612811693173346, -0.29055206992581795, 4.9397702898430147]], [[4.5653811928796237, -4.2714483832708545, -1.603237810117486, 2.2529140938722891], [2.1743042862433661, 0.098334875687674739, -2.1610472879978948, -2.523457459372044], [-2.8742489742585953, 1.1769795308915896, 2.9501187337144117, -2.1673531246826094]]], [[[1.50786402174767, -4.3272797005070611, 1.2598723673170822, -3.1087946326862248], [3.7454312311816924, -0.93008130044379378, 1.038950761965812, -1.9594526998837534], [-2.6136323070708309, -2.6551115542462043, 2.1677213597189127, -1.0263084145969081]], [[2.2395140998654544, 3.5499630191251903, -2.8952346560077857, -4.84646295274755], [-3.0945492114608655, -4.2521694229144096, -4.5772261559767582, 3.1190729608332006], [-0.43276783883599901, -2.0521960845891973, -3.5301804674899873, -2.2210351830806383]]], [[[-0.18080782120350669, 3.8344499783133514, -1.205362276539379, -3.8500885031333554], [-1.0796805564510716, -4.8057890307292483, -2.9726681318449009, -4.6433077223383066], [-4.661833115137485, -1.250272961567882, 1.0045456181256194, -1.716271218674883]], [[2.4904195737752239, -2.371912051647973, 1.2021819827380931, 1.5505893123734715], [0.25625383026043558, 2.3350261273912851, -2.3065173558477889, -2.1840026029602799], [-1.632049023694111, -3.0042169415946987, 1.8949461493465645, -3.4080951303894036]]]])  
       s1=numpy.array(3.16533477977)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[0.62312414694975848, -0.98033212476629894, -0.94025777399186949, -1.1513959557577831], [-1.0942840464456314, -0.78137896444400856, -1.4406850764085704, 1.0225046104029814], [0.19886659364229001, -0.52483584988672705, -0.091791892529864499, 1.5605838350532315]], [[1.442305951981909, -1.3494460082289774, -0.50649865548606388, 0.71174591334538073], [0.68691131823989859, 0.031066184947039541, -0.68272313620929881, -0.79721660896617519], [-0.90803948846958316, 0.37183413849722202, 0.93200844111897585, -0.68471529094914274]]], [[[0.4763679442010148, -1.3670843691356993, 0.39802183812230857, -0.98213770390212862], [1.1832654337599628, -0.29383346949195893, 0.32822776554486521, -0.61903490032269815], [-0.82570485870047328, -0.83880907991601528, 0.68483162462691249, -0.32423376546320026]], [[0.70751255575790861, 1.1215126569902907, -0.91466933434980502, -1.5311059619095244], [-0.97763725696160364, -1.3433553537807812, -1.4460480405511282, 0.98538485747737159], [-0.13672103235388408, -0.64833460830244682, -1.1152629068022135, -0.70167465295441722]]], [[[-0.057121231649489242, 1.2113884454870472, -0.38080088218233688, -1.2163290049880342], [-0.34109521790584463, -1.5182561609095686, -0.93913229995204295, -1.4669246842426118], [-1.4727772698577475, -0.39498917130597472, 0.3173584116742843, -0.54220843546881825]], [[0.78677920253196343, -0.74934002772979302, 0.37979615629311647, 0.48986581839076709], [0.080956312077341414, 0.73768693988189338, -0.72868038179973216, -0.68997523324152576], [-0.51560076176586334, -0.9490992740463523, 0.59865583933065747, -1.0766934202882465]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_quotient_overloaded_Symbol_rank4_Symbol_rank4(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0/arg1  
       s0=numpy.array([[[[0.73932335645857172, -1.896995360515267, 3.3880628348146402, 3.5253356454322446], [-4.7189562513465795, 4.5783164837149286, 0.19802110395748507, 0.68194361908009515], [0.039078559692921289, 1.0933197278718207, 2.622251308058642, -2.148381922003356]], [[3.3444777297573651, 4.3725014237083215, 4.2162873990795031, -0.73958423405905371], [1.0918542642160114, -4.0606635824352333, -0.074708691027041141, -1.9836385749052896], [3.0808856972569973, -3.3563577942073861, 1.5311173329962084, -2.3366980258717698]]], [[[1.4900329229951179, 1.3866124764269774, 2.3141193586769448, -2.0654207107191489], [0.95384053245745282, -0.72233347074864529, -0.22737772731292072, -1.8697167906306267], [2.6340099002463138, 2.0707277650445723, -3.0702655821800473, 0.57376499557555505]], [[-3.428299233684351, 0.59824625458041769, 4.2652550719136322, 2.3979736890736589], [0.36987392000107366, 2.6664863978620588, -2.0782382318065551, 2.4508982006282309], [4.4330131737896075, -3.2914332546853431, 3.2647013139688283, -1.6777845864045715]]], [[[3.2931032147420218, 1.3222966578140385, 4.1443411301534194, -2.2730606036014809], [0.052541889529167385, 2.2663719648536427, 0.73032463931391067, -4.010381110298975], [0.0095848820717572281, 1.9639304605350105, -4.8239927256658124, 0.86027499129008156]], [[-0.16510536622939664, -0.76301133438433766, 3.4117387018744942, -4.7812806122461335], [-3.1899758978255797, -3.2286801682939803, 3.8217255543007376, 2.8249294753446446], [-3.6019699802642888, -2.1928251973889434, 1.1921114311119592, 1.2966960454614291]]]])  
       s1=numpy.array([[[[-3.8105466010020739, -0.40538514026363792, -4.5468084839700671, 2.6640255011771776], [4.5082944950855346, 2.5970571099212423, -4.5119639556081221, 1.7447005721547013], [0.090138112745002275, -1.7062253330809787, -4.3786608268221929, -1.6085701115291497]], [[2.3672934287030634, -2.3458453149364611, -2.7298621281922451, -0.058241991799430792], [-0.57056090505499846, 0.71999903100793095, -3.8922769793583267, -1.9441654905082983], [-1.0633310179076991, -2.3147859060880904, -0.4320912069156666, 4.1385484464035223]]], [[[-0.23342346528012836, -3.0925217332105834, 0.82152488768582366, -1.555330265743339], [4.3763678022797432, -4.3422578085867745, 1.650837442418462, -0.11115306566138727], [-3.2251326474743514, -4.1241477595882969, -3.6514281650059854, 0.064699947703774185]], [[0.24572590894977075, 0.37598379996604514, -1.798785959972431, -2.9885412318923485], [-1.0341957376474475, 3.6193270997275704, 1.0784146206314986, 4.4629462155215265], [0.09102651066065448, -0.95170073824843726, 0.74391125713720285, -2.6337422398687482]]], [[[1.9252071028664597, 3.7330042870604068, -2.6845339886805242, 0.044721563018432775], [-3.6522996258756657, -2.9352721209494979, 0.11493293379678882, -1.0672243383706173], [-2.5678506418116198, 0.4261031826699373, -2.1682139739041508, -1.4775622195715519]], [[1.5110913348803079, -4.6498520730200168, 2.8811708641339395, -3.9935576260223571], [0.012469097821639075, -2.6697267979425865, -1.6836791698154983, 0.98016746872761118], [-1.9713215050250188, -3.9990867567184987, -3.9836498230059183, 3.0647652694869514]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[-0.19402028996683809, 4.6794891378642447, -0.74515186790017096, 1.3233115238102908], [-1.0467275943243473, 1.7628863324664314, -0.043888006621009411, 0.39086570496041984], [0.43354091297066799, -0.64078273055387291, -0.59887061632991045, 1.3355848816319524]], [[1.412785457521275, -1.8639342482932444, -1.5445056200957632, 12.698470831938165], [-1.9136506804839066, -5.6398181213531444, 0.019194083931652128, 1.0203033561647425], [-2.8973909773827637, 1.4499646750828532, -3.5435049556448028, -0.56461777749693975]]], [[[-6.3833896099817959, -0.44837598440656029, 2.8168584949333089, 1.327962784632126], [0.21795255233359886, 0.16634974305768707, -0.13773477719272856, 16.821099620648027], [-0.8167136636407949, -0.50209834510179818, 0.84083965052480081, 8.8680905617190362]], [[-13.951720631889637, 1.5911490192780777, -2.3711854366369436, -0.80238936089740964], [-0.35764401895762016, 0.73673539981030378, -1.9271235682891421, 0.54916597294055136], [48.700242837120456, 3.4584750462031573, 4.3885628596781743, 0.63703446791671736]]], [[[1.7105189409694614, 0.35421782460777584, -1.5437841903392719, -50.826949019304159], [-0.014385974567070215, -0.77211647556565211, 6.3543547979483987, 3.7577676652519161], [-0.0037326478089064748, 4.6090490294607482, 2.2248693088992444, -0.58222589877774156]], [[-0.10926233406167635, 0.16409367919714746, 1.1841500774373686, 1.1972484335998828], [-255.83052947821483, 1.2093672546502319, -2.269865674420342, 2.8820885873837274], [1.8271854545707777, 0.54833148935940912, -0.29925105972603661, 0.42309799656483937]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_float_rank0_Symbol_rank0(self):  
       arg0=3.7702812398  
       arg1=Symbol(shape=())  
       res=arg0**arg1  
       s1=numpy.array(0.437799243278)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array(1.78787021918)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_float_rank0_Symbol_rank1(self):  
       arg0=4.08574631235  
       arg1=Symbol(shape=(2,))  
       res=arg0**arg1  
       s1=numpy.array([2.2766533019165691, 4.8274560558022745])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([24.640700228629047, 893.07063402665869])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_float_rank0_Symbol_rank2(self):  
       arg0=3.86065618214  
       arg1=Symbol(shape=(4, 5))  
       res=arg0**arg1  
       s1=numpy.array([[0.69779120930924243, 3.585974448863456, 1.0253309034266909, 1.4427291056602751, 3.6637657756391722], [2.6465319244788268, 1.328693504258244, 4.0231931902909404, 1.4229214141539899, 2.4145237494555807], [1.5821398459124658, 0.21771623295217807, 1.5338149243419494, 2.2858744178189214, 0.36445160352321015], [3.0406713530402776, 0.9152900533403725, 1.2385299760802031, 0.55443923014312269, 2.3224519692925223]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[2.566651929770551, 126.98482055383509, 3.9950459864673324, 7.0209047681791343, 141.05515320716921], [35.695823043565333, 6.0185632355833381, 229.2192298086338, 6.8355376491576658, 26.091991158974665], [8.4757852440379651, 1.3419169867370699, 7.9401661689066367, 21.929748997529114, 1.6360990341413777], [60.791615008440559, 3.4432225486039174, 5.3284070090810207, 2.1147933851274767, 23.040520636818499]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_float_rank0_Symbol_rank3(self):  
       arg0=4.64625604757  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0**arg1  
       s1=numpy.array([[[0.48929377313596345, 1.9379351733799641], [1.9528098086901116, 0.2781999987733898]], [[2.3161138279168192, 2.4972619549953987], [0.48325765893066408, 2.9132245192571471]], [[1.1505627364452558, 4.1833903484831749], [0.26908288311169448, 3.2756092792059461]], [[3.2544485696302217, 3.7701708276904777], [2.0623295516263314, 2.3508024496339956]], [[1.5799743210915149, 4.4529391533630411], [3.6395191940876241, 4.5430953125223974]], [[4.2129347621198088, 3.0936777058419493], [2.8037611187678095, 3.2180470912729695]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[2.1203590691960001, 19.624682449641167], [20.078235970441149, 1.5331621623734204]], [[35.082198842693316, 46.337360334987011], [2.1007902899638395, 87.785183748581588]], [[5.8552307310145366, 617.66477529431563], [1.511840711657918, 153.16842039014369]], [[148.2698532638571, 327.41064482838533], [23.756722148133036, 37.002212609980234]], [[11.324155640905518, 934.47930663425291], [267.87653965259886, 1073.2802691395027]], [[646.34144645516312, 115.82494690811518], [74.198964496262846, 140.20687746040377]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_float_rank0_Symbol_rank4(self):  
       arg0=1.2843488503  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0**arg1  
       s1=numpy.array([[[[0.42953191785205092, 1.9945096622419052, 3.1804584603277082, 3.5047997678834926], [1.0964022259690165, 2.9955206475075769, 1.6810157393633633, 4.094671926478469], [3.4434024041549325, 1.7739736996055815, 0.047850201901338624, 3.9999141125648729]], [[1.7931244747478161, 3.9304014254343738, 0.83649208680367648, 4.3944908572455681], [4.2135979090802218, 2.0192230017299053, 0.65084367820825406, 2.7281327918335614], [1.4230930783387012, 0.76966081700651645, 0.14628719915628804, 4.1121230580502663]]], [[[4.8411268881696587, 2.4618824073601506, 3.6745673752876704, 0.65255021237954758], [0.9781905690708026, 1.7135477539250386, 1.902379810769764, 2.314203598827361], [4.057748796659185, 1.3069388175782211, 2.6592949100499035, 2.4419603598451123]], [[3.7775249132036191, 3.227673201121982, 0.38323800105601497, 4.4105095696495953], [4.4293462495059996, 0.44206691435987028, 1.0182372869123639, 1.6390431801966634], [0.094902548843604287, 1.6711672938437461, 3.855268391506018, 3.1522542431012179]]], [[[4.6706510705648796, 1.2886411137088054, 4.6219890325857698, 4.6189362306058239], [1.5015145370554208, 2.6008716008520145, 4.2240428514049446, 1.6213140239465365], [4.3265182238069944, 3.4937540144339705, 3.6722414984193987, 1.5345888737272466]], [[1.3849922709380966, 1.974499128724811, 4.6012199764560204, 4.3521430293730976], [3.1772312860464651, 4.1955355577406088, 1.0138339647399988, 0.36524809008428011], [3.5433520802631908, 0.39701196791332577, 4.524465217787732, 3.3811147243865571]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[1.1134810184045756, 1.6472870952124046, 2.2164695583530634, 2.4038765322319655], [1.315710330217662, 2.1162266264594152, 1.5229927494011997, 2.786257395764554], [2.3672237420873756, 1.5588372885164137, 1.0120465845418214, 2.7209632157048831]], [[1.5663259733280399, 2.6740395305935483, 1.2328563333812035, 3.0033535212657601], [2.8704267390409846, 1.6575064080725255, 1.1768893811730841, 1.9792545853035226], [1.4277955592288831, 1.2124087096357294, 1.0372869923680199, 2.7984520868876062]]], [[[3.358522018123113, 1.8516750246540885, 2.5082048933281236, 1.1773920948303018], [1.2773581605492481, 1.5354423421016816, 1.6097422668358585, 1.7844919482002668], [2.7606307279199793, 1.3868900525487859, 1.945450352350764, 1.8424664183079575]], [[2.5736693172957752, 2.2428137537294033, 1.1006556217888195, 3.0154172661121588], [3.0296652396930153, 1.1169793880458341, 1.2902239056447999, 1.5070793947389174], [1.0240338054806857, 1.5192438156590875, 2.624231471731596, 2.2008804464142093]]], [[[3.2182544343579336, 1.3805539529663413, 3.1793009512831634, 3.1768729903018968], [1.4560929742295208, 1.9172137346318592, 2.8779394649128691, 1.5004076651053353], [2.9526976996060843, 2.3972408632996678, 2.5067454048982509, 1.4681949452798979]], [[1.414246513529487, 1.6390586396683826, 3.162819419249923, 2.9716931725374445], [2.2146802460637747, 2.8574812965772853, 1.2888029399377057, 1.0957115980201899], [2.4271808598195008, 1.1044560848395475, 3.1026476576171049, 2.3306104850953133]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
4022     def test_pow_overloaded_constData_rank0_float_rank0(self):     def test_pow_overloaded_constData_rank0_float_rank0(self):
4023        arg0=Data(2.63077914853,self.functionspace)        arg0=Data(2.63077914853,self.functionspace)
4024        arg1=1.64689700006        arg1=1.64689700006
# Line 7822  class Test_util_overloaded_binary_no_tag Line 4938  class Test_util_overloaded_binary_no_tag
4938        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
4939        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
4940     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_pow_overloaded_Symbol_rank0_float_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=3.10936989976  
       res=arg0**arg1  
       s0=numpy.array(3.30675932637)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(41.2111534618)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_array_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array(0.542076989686)  
       res=arg0**arg1  
       s0=numpy.array(2.08110675749)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array(1.48778456283)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_array_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([3.668390347262545, 1.6878589595552234])  
       res=arg0**arg1  
       s0=numpy.array(3.44305617932)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([93.265406302124759, 8.0590885042084821])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_array_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[0.96907286312776875, 3.9299139446507878, 3.4057539041652403, 0.45472487497804875, 2.1555701423671834], [1.5383253353381352, 1.3404491536866854, 0.089762057677992987, 2.5145453769894788, 0.35147913655893598], [2.9532766149409451, 3.5565418449425885, 4.6109559746060462, 1.057817295583485, 1.3559078010962042], [3.5191718551507281, 2.319504638109009, 4.1531170781798163, 0.9986279083061923, 0.78679280776635308]])  
       res=arg0**arg1  
       s0=numpy.array(2.29872972849)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[2.2403100455571043, 26.340037430890128, 17.027028736351539, 1.4600830045330593, 6.0146803373468742], [3.5982059226615064, 3.0518006856044768, 1.0775759720093474, 8.1091952810436574, 1.3398477748268629], [11.683522474081888, 19.303981243011776, 46.43065918324649, 2.4120603288411231, 3.0913222547579178], [18.71277032905428, 6.8940255631574372, 31.717695291002155, 2.2961059175229637, 1.9249350907186553]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_array_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[0.076923944458511223, 1.0177193780090092], [4.862686661344866, 4.092952832443447]], [[0.97098489422959389, 4.7146676559976433], [1.2975705060659664, 1.5672317918260714]], [[4.5902566293871319, 0.040147196277378894], [2.2249629559473862, 3.0463617559149414]], [[3.5104455272448813, 4.6567463162203158], [2.984391045323239, 3.1914601726979832]], [[0.73589711888433862, 4.3578589228238789], [3.3022909418866013, 4.2403544989296043]], [[1.5701888088937304, 4.3505847709304248], [0.65329808748640406, 3.099915255030544]]])  
       res=arg0**arg1  
       s0=numpy.array(4.42973780698)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[1.1213003223881224, 4.5481150054862693], [1390.3808671163754, 442.17557936765411]], [[4.242514103659035, 1115.4691175064804], [6.8979661102078103, 10.304435014463925]], [[926.9173211805321, 1.0615739804931992], [27.426295640859554, 93.132504971470723]], [[185.8124604652044, 1023.3365127080943], [84.926803633260093, 115.58186871604128]], [[2.989976146824973, 655.87975850778992], [136.31017806162725, 550.64531824104165]], [[10.349885268123446, 648.817232532807], [2.6440978630927559, 100.85956460954971]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_array_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=numpy.array([[[[2.797877630292501, 1.358732540146449, 1.6803575964356727, 1.0587060334244722], [0.63037483684916451, 2.1598398721554206, 2.3225555114197989, 4.2727152249721261], [4.3073616681889924, 2.3725716864676079, 3.3665283402000186, 4.5187219433466534]], [[3.3014225822701038, 2.4041316232656751, 2.4663264227260755, 1.6926351322686508], [1.2755923065928971, 0.4501593030398513, 0.4708481516441515, 0.88054115880376593], [2.2192854496801466, 2.3782112614302386, 0.15892300616520535, 3.120997765261583]]], [[[4.0894615037102131, 2.4449739860046238, 0.10697080435980494, 1.4718400964693852], [2.6943019584219332, 1.5808462181341711, 3.5817208004147587, 4.4007774730856406], [1.041608998347856, 2.3892529423699078, 2.7717327886859486, 0.8665321736232352]], [[3.4526548169690834, 2.2152819780290312, 2.6926934413837587, 1.540893858207935], [2.0102995828392607, 1.1700417787379145, 1.8938215554247713, 2.2188164567720214], [4.4646689409737039, 0.10102195316376016, 2.6949555348064829, 4.0085383266866783]]], [[[4.1167015564616065, 4.6175324605553252, 4.7875970584013681, 4.596911694778929], [4.262642235543459, 3.7844459465048814, 3.1003475032652843, 3.1351499355614676], [3.4736509286098363, 3.1584548999786612, 0.35943889984286559, 4.5777606990500015]], [[1.5993819401538296, 4.9565546562429406, 1.9799305165228307, 0.27006488336416029], [3.7006871976627846, 0.070814970736787344, 1.3452607805258388, 0.98770254049436779], [4.5441953008056872, 1.4996083046379973, 1.7612638940420335, 2.2858223630457122]]]])  
       res=arg0**arg1  
       s0=numpy.array(2.59237478756)  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[14.370629398905468, 3.6484184873605643, 4.9563300884946173, 2.7414753498476907], [1.822991636710898, 7.8256600808357311, 9.1376828380062065, 58.561587571104802], [60.526560969970987, 9.5835775386358755, 24.701614004991104, 74.026169475751004]], [[23.216204623616477, 9.8760649420277797, 10.478853966997846, 5.0146359734127071], [3.3706194065171005, 1.5354295989299214, 1.5659894766469959, 2.3135448897384059], [8.2815853820534517, 9.6352001518482364, 1.1634456395774218, 19.550140147123965]]], [[[49.18143342333908, 10.267869307911766, 1.1072701320860447, 4.0634694005521519], [13.020473055224276, 4.5080900774402775, 30.321450711884669, 66.159453720845093], [2.6971887504861285, 9.7370782394943376, 14.017150180962513, 2.2828766411915447]], [[26.813633195333065, 8.2500628366194899, 13.000537945071681, 4.3397467066955402], [6.7866662563691635, 3.0482016717198843, 6.0739301086001989, 8.2778864049691148], [70.311063924282436, 1.1010132834719579, 13.028581866669555, 45.532704096116966]]], [[[50.47430317239187, 81.332284222739744, 95.63532052995545, 79.750277783510128], [58.002360498566617, 36.780440033041316, 19.169328828884982, 19.815479984726601], [27.355314300511122, 20.260297063243886, 1.4083126430347566, 78.308603630554629]], [[4.5883947316756304, 112.33515850857933, 6.5931487955070756, 1.29337733199218], [33.959877229482466, 1.0697837503479968, 3.6018980035494557, 2.5621842499996927], [75.844405031521788, 4.1723875421714416, 5.3534158306307527, 8.823474962728465]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_constData_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Data(2.80420135797,self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array(2.63908272164)  
       sub=res.substitute({arg0:s0})  
       ref=Data(15.1998423747,self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_constData_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([3.4266095327729227, 3.5185019713944032]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array(3.62383875011)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([82.423938354836437, 92.776236787473337]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_constData_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[3.2121226359955775, 2.5525264361966515, 3.3430070736322666, 4.9866221566469813, 0.89728871016585665], [1.6216283754382455, 3.1535230529586467, 0.89553452760461438, 3.2739138772027605, 2.9919308315001429], [3.9677614353916906, 3.4201730506955546, 0.79188840993147946, 1.1425430319864134, 3.8271309769891353], [4.6916404720348215, 0.4654072862096621, 2.2546290070107813, 3.5463786041733747, 2.7082676481036843]]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array(1.50628169225)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[3.7278336510795551, 2.8451834416071904, 3.9331605727525818, 7.7117152781191471, 1.4442195598062639], [1.9431115720486611, 3.6394126089252108, 1.443182129937949, 3.8233985327042328, 3.4063011228749249], [5.0802998958896994, 4.0594760412210844, 1.3831900492309495, 1.5968550144664972, 4.7959022177977451], [6.8339518862545567, 1.2100375305798741, 2.5183290404116492, 4.2748682327108964, 3.0326172385983217]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_constData_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[1.9666935462147874, 4.1134598941207248], [1.9869227951859865, 2.4946378172556534]], [[2.138130199255317, 0.14117650825822928], [2.4186955388970799, 4.8879463912076231]], [[1.5748346265629647, 0.93955923607421576], [2.014559290560217, 4.171542784347726]], [[4.8750027195787347, 1.8879178748962244], [4.4568034877969742, 0.26759593622914241]], [[0.71145895109971136, 1.7272664071968948], [3.757279181668657, 0.39032256871316418]], [[2.7484512921446962, 4.8971229527182132], [0.33935550823115523, 3.4081652727387173]]]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array(3.91988121602)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[14.682026275813113, 275.67939591123508], [15.09341322719769, 30.199588777876201]], [[18.556442424389669, 1.2127078740422956], [27.223661310148465, 794.12005476235049]], [[8.596204065163052, 3.6092339935048221], [15.674130065270093, 298.44431709033381]], [[780.20195491828792, 13.184101123909517], [440.65708813411493, 1.4413100633971052]], [[2.6429522692160923, 10.586206522664318], [169.46965362777428, 1.7043853984988633]], [[42.715125562838097, 804.13759959158961], [1.589755839134342, 105.18943399553341]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_constData_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Data(numpy.array([[[[4.6243582362163798, 4.9053952332933939, 0.18711744464281901, 1.642508141237683], [4.7717081387424303, 3.265821257383017, 4.4696181450279102, 2.3295857475421706], [3.6178453499267307, 3.5517519557926112, 3.3262379571623328, 2.9854778207240802]], [[0.46778506853486596, 1.4868602216506781, 4.2022046333078862, 3.3248490137362849], [2.940304739363238, 1.6290743528594125, 0.80175836624227992, 0.19538445412187963], [4.0998714240938474, 2.260912621903127, 4.7667426456976072, 1.6882257509627432]]], [[[1.5856256775180457, 1.6609525889375629, 0.27497953810721715, 0.089041242169021415], [0.99154899577957356, 1.8884622177055048, 0.87055790536585842, 2.5327288299513553], [1.022730316552146, 0.7138939417047544, 2.3570115506653329, 0.7327320125589436]], [[3.5892504184023286, 2.7346144863925423, 0.63005326693006136, 2.5752183590671551], [2.6182943301571693, 0.068102918361823972, 2.4238818932525734, 3.7962347710590323], [3.5478091411743033, 3.4991737050287615, 2.4314516947311868, 0.39207158260407315]]], [[[1.8916842842667607, 4.2400742507070115, 2.9528902987386059, 2.7438819597505546], [0.99809144515184023, 3.1427611423474158, 0.21082763194366561, 2.7076297079787199], [1.1801024901676289, 3.6372850943954664, 3.758361576136716, 0.78412483500199193]], [[4.5638710389194177, 2.7667875670827495, 3.4357818163457603, 4.0687915645888513], [3.6710615701573834, 1.6180994104145248, 4.9034822782677763, 0.69938913244447809], [2.4614308343822526, 2.0188055792762358, 4.964599973497406, 2.51958102827246]]]]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array(4.94158271705)  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[[1616.9078625861175, 2533.3040032686517, 1.3484487524885731, 13.79369655939335], [2046.09771605278, 184.51962327150554, 1262.7470832902579, 41.344762926119621], [323.81736366030219, 291.36687032583689, 203.21869458084333, 117.9021597852862]], [[2.1114470110713812, 10.7567693824194, 823.69648321890361, 202.76823298408948], [109.69269139500776, 13.500797335574958, 3.6000864206405443, 1.3663773152692777], [699.45804568393191, 37.048493606100521, 2029.9296329338852, 14.838929315480367]]], [[[12.595396873514774, 14.206223546250209, 1.5516685984208105, 1.1528762611266299], [4.8753096463422843, 20.433363276902327, 4.01837619134505, 57.197177480794373], [5.1243391426649882, 3.1285765323194505, 43.196677116829761, 3.2241696199789316]], [[309.35638201878953, 78.968921180743564, 2.7363559079675768, 61.214829002713728], [65.576101670834404, 1.1149472078958063, 48.06726392177471, 430.60443562438871], [289.53720906908387, 267.8908652091157, 48.652126847509614, 1.8708767071206214]]], [[[20.538822368058018, 875.07173111518136, 111.92069155330093, 80.14687441894479], [4.9265374437399476, 151.58468337094018, 1.4005097618649811, 75.636666979704614], [6.58920586548986, 334.03249062901426, 405.32143751131389, 3.5000771488093436]], [[1467.9635061158963, 83.134255920868952, 242.08753271530807, 665.57409477191993], [352.55352574738765, 13.266130886192945, 2525.5732838659751, 3.0569081395101163], [51.039138845877922, 25.164058850793712, 2784.6298212928314, 56.008221817016803]]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_expandedData_rank0(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(2.5277597359)+(1.-msk_arg1)*(4.4438527945)  
       res=arg0**arg1  
       s0=numpy.array(1.96404041677)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(5.50825236775)+(1.-msk_ref)*(20.077855111)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_expandedData_rank1(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([2.6142605202487683, 0.35944507287913852])+(1.-msk_arg1)*numpy.array([0.97860685499853728, 0.14387745893393633])  
       res=arg0**arg1  
       s0=numpy.array(1.29469625647)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([1.9644278944701283, 1.0972818514192944])+(1.-msk_ref)*numpy.array([1.2875623482835192, 1.0378591805876143])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_expandedData_rank2(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[0.55960811315306325, 0.55826796652740884, 0.76888638596191416, 2.5532725180120091, 3.1539478217391821], [3.0626649632021201, 1.3024564808198458, 2.7686863573852794, 4.8070512532387797, 4.7662591534346532], [4.3493582151636101, 1.0257219619151625, 1.2773448284521938, 1.5555900636327809, 1.9454828983992984], [0.057360392064311844, 1.8201886178020437, 2.6170394582015364, 4.2928984417079521, 2.4108077531498604]])+(1.-msk_arg1)*numpy.array([[1.8795949206347113, 0.19880272360050144, 1.8882834659870058, 3.6274145115871224, 2.1444891459776914], [3.6007037414928176, 3.6548481621407212, 4.044695537876553, 3.1126980467431977, 2.7356718280098407], [1.4693042173515283, 1.657899949683777, 0.33076499135012438, 1.1618937549653745, 1.3390603538026746], [3.7498297638060998, 1.1992202354643349, 2.8905639155109557, 1.4963587835563301, 0.64206570347267267]])  
       res=arg0**arg1  
       s0=numpy.array(0.88314230268)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[0.932821044362389, 0.93297640800187076, 0.90887410666326529, 0.72811778454253395, 0.67574619062453745], [0.68345524258324708, 0.85056463175325192, 0.70888518853480786, 0.55025848911238084, 0.55305493621510871], [0.58246271428964347, 0.88032389745340467, 0.85322304802184734, 0.82422517344055146, 0.78524219172416965], [0.99289723002560104, 0.79756423850985336, 0.72237079780997604, 0.58656375678292305, 0.74112312449715934]])+(1.-msk_ref)*numpy.array([[0.79169801379849691, 0.97559766857854768, 0.79084366588825095, 0.63713422486177473, 0.76606107627784226], [0.63925259035901028, 0.63496583668949014, 0.60493758019254062, 0.67921900320897588, 0.71179949200449089], [0.83311060409878568, 0.81381235793695272, 0.95972949275571173, 0.86555245692531735, 0.84670443393392103], [0.62751522561897422, 0.8615468700721064, 0.69822959750446556, 0.83031435437921386, 0.92331131068334094]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_expandedData_rank3(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[3.3478403910521299, 0.24303256694506548], [0.064899631806504252, 2.6080646894888515]], [[3.004198878140822, 4.8581873566282834], [1.037492186308886, 4.7510685347379473]], [[1.3086690541888597, 1.8499755264318305], [4.3450740105199346, 1.3877331580206815]], [[3.0727450175061226, 0.7971154916656501], [3.4715049437581516, 0.52813179013628608]], [[1.846932829571297, 4.4098853278678298], [2.3795954728438455, 1.8702238767876214]], [[3.0465854417886926, 3.5885001008897257], [4.3381384462040637, 4.8519402934639411]]])+(1.-msk_arg1)*numpy.array([[[1.413131547521848, 0.68321547161900009], [0.27976947807093172, 2.9284944211679851]], [[0.82464146264800697, 3.1536346049812378], [1.3127211785459851, 0.39081432581690584]], [[4.4872611303329979, 2.4495024539389716], [2.2492385445385028, 1.8504324833021379]], [[3.8183836979124974, 2.9765876428375235], [1.360768492810694, 4.2266281183818437]], [[0.4612472820918207, 4.6407375253884462], [1.740857437728385, 2.8902106369859948]], [[1.1900146946225598, 2.6862365241662309], [1.1217230555311866, 4.571429137471009]]])  
       res=arg0**arg1  
       s0=numpy.array(0.603610661085)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[0.18450540802616741, 0.88453859470575802], [0.96776787949501708, 0.26804012825561047]], [[0.2194573497713867, 0.086074786095381647], [0.59229354375352505, 0.090857548481595982]], [[0.51651548012960524, 0.39301183968689879], [0.11152507188908697, 0.49630549415216135]], [[0.2119931666905876, 0.66871017275155287], [0.17333908533750983, 0.76596821808112636]], [[0.39361598238044243, 0.10793519434601982], [0.30080850827707195, 0.38901497785520067]], [[0.21481132240922407, 0.16339776801627276], [0.11191623369618638, 0.086346666846677481]]])+(1.-msk_ref)*numpy.array([[[0.48998260387478398, 0.70828773792810473], [0.86828534862474893, 0.22800680550236702]], [[0.65948215860522164, 0.20351076110202057], [0.51545996709195563, 0.82094990392307698]], [[0.10380038568135729, 0.29037785502457875], [0.32126985170388478, 0.39292118873408444]], [[0.14549421571667412, 0.22253775526235856], [0.50310762522508123, 0.11839707035257506]], [[0.79227274648696577, 0.096061712997494525], [0.41526853118092044, 0.23245627030231542]], [[0.54840005718268914, 0.25766841254096923], [0.56763604041834503, 0.099482275961130295]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_expandedData_rank4(self):  
       arg0=Symbol(shape=())  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[1.5663343663913329, 3.5164329254755571, 3.0627576055311749, 3.6448778665681991], [0.89817353539210198, 0.84247692970066035, 4.7400766713032834, 1.8454543444558296], [0.30324677572118053, 2.2242534916885455, 1.7625135735847715, 2.0749475523406549]], [[4.6858978011448515, 4.2613335925837337, 4.7069346547661981, 1.7535768340127165], [2.6565031450783945, 4.2869832760752624, 1.7692773392666583, 1.5051360897310342], [1.0936444880342684, 0.9113293961414225, 2.1035463175999736, 2.1360794941125434]]], [[[3.1351149343777887, 4.2845573455312067, 2.3237178257404221, 4.9907889729478168], [4.0200901770055868, 0.65916740476713176, 4.0158945801435149, 2.7467259686517549], [4.4156567533809552, 1.7769437014840637, 0.78007376999941458, 0.34566903232357948]], [[1.9768806918659114, 1.3698281932007907, 4.232986556876944, 2.3846177242412763], [4.2718838480627532, 2.1911308212928264, 2.0954451860887819, 2.351367113058954], [0.11917912631001699, 2.8012661455430043, 0.32439001333700906, 0.31040730839065889]]], [[[2.5835423362202983, 3.993730608656477, 0.82856114963074978, 2.6010728721551377], [1.8455072352573823, 2.6925598307465468, 3.1125553717857923, 0.86615500331920814], [0.80616482462782657, 3.7448144941190602, 1.1006778043613623, 3.7060962830255741]], [[1.1037446133456503, 4.6014919315857234, 1.7559119368946281, 4.5875145943931397], [4.0089434273952307, 3.2385532955870224, 3.1053565756271717, 4.4982344907423721], [1.5930209648042979, 1.39171205248776, 0.21398092897416329, 1.5997964526181085]]]])+(1.-msk_arg1)*numpy.array([[[[4.9826247406899693, 0.91331048863122544, 4.0294546043800592, 0.8243680925252268], [3.6190090581728684, 3.5482577524930599, 4.0410880569392722, 1.6155194928734016], [0.56312701722401504, 1.729977163184597, 0.19261078094019585, 1.0734341277554531]], [[3.136831967070822, 4.6662113798738805, 2.4836695335912653, 0.55066547875879579], [4.2845778751278907, 3.9971552534024508, 4.0521459180894306, 0.57483665865953482], [0.94215204987266077, 3.6840460379779763, 0.13217183789915365, 1.5049671526895469]]], [[[1.0342079278252492, 1.1277464054894135, 0.67972980921781578, 3.298778257310059], [3.1212461866689485, 2.9953716452354335, 3.0711501489465829, 2.8977218202382451], [0.14118691022302265, 0.52453783860456282, 4.7076441035325214, 1.5479464739826232]], [[0.38603318952544396, 4.5106076672775304, 2.6765382281492243, 0.025584170393580546], [3.8872074778327099, 0.54304999378942553, 4.3972678158435672, 3.0180947698918827], [4.6361431214831708, 1.3762822583112868, 3.0019458730083173, 3.6917068617651121]]], [[[1.9217074878291072, 2.1083197748624531, 3.8915891806882317, 0.28659982931455297], [4.2944945668062591, 2.486656125661598, 2.0079383165674871, 2.4411357919689118], [2.5423833539846239, 1.4915969314363038, 2.6790067737309164, 1.906544470826663]], [[4.7903675794533251, 3.4182817042770131, 2.438955496698032, 4.1643864499544669], [3.3888360838551086, 0.85015442500776461, 2.9257685460469203, 3.0091174613402916], [4.4406831854570967, 3.8057638250091887, 2.6905421270704881, 3.1605432878739079]]]])  
       res=arg0**arg1  
       s0=numpy.array(2.5158022881)  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[4.2422219224848314, 25.642009951838826, 16.872328466039505, 28.868015834433916], [2.2902191171577146, 2.1755081473203797, 79.29345970297355, 5.4882034439152418], [1.3228294624652286, 7.7840590431390568, 5.0839091793434097, 6.7823896906136838]], [[75.427405038194848, 50.981928826495952, 76.905630992593757, 5.0421648667677266], [11.59840856348397, 52.202762747045384, 5.1157329511495586, 4.0093380180291094], [2.7428221891948881, 2.3181860062453321, 6.9637246815375384, 7.1759081637020206]]], [[[18.037107903848337, 52.086056123915064, 8.5321629955477682, 99.929081757009271], [40.808975595363151, 1.837015809022609, 40.651316603145382, 12.605165987529597], [58.782753777931063, 5.1520443968174368, 2.0537956703157607, 1.3756294370949074]], [[6.1956896020156691, 3.5388159554222405, 49.665895574234767, 9.0252720573516356], [51.48058837732053, 7.5497860678305608, 6.9118715621585229, 8.7526097140400267], [1.1162263647323103, 13.255665505944933, 1.3488866538652478, 1.3315973319520573]]], [[[10.843381081719061, 39.828507586273723, 2.1477562321937826, 11.020182707124347], [5.4884712562128595, 11.990725749433551, 17.665576573827707, 2.2235554385618492], [2.1038332112162053, 31.656230080786141, 2.7606779014028255, 30.545392928247125]], [[2.7685000592996816, 69.776586168655612, 5.0530391471036911, 68.88256759327119], [40.39145077222949, 19.843223533017035, 17.548638519005912, 63.436160156856715], [4.3479653756333638, 3.61099032669786, 1.2182519952820152, 4.3752296730430613]]]])+(1.-msk_ref)*numpy.array([[[[99.179218221714791, 2.3224269210604889, 41.163073935686505, 2.1394637303894246], [28.187198315015632, 26.406055087105887, 41.607253630074815, 4.4391590813462045], [1.6812479457312519, 4.9335690196521051, 1.1944682630663626, 2.6921536175889984]], [[18.065703494343261, 74.069818459742748, 9.8889011387002412, 1.6620294732303358], [52.087042665902175, 39.95454671625015, 42.033898911824835, 1.6995092979441355], [2.3850538725255266, 29.930274573556684, 1.1296870503171847, 4.0087131716162467]]], [[[2.596467081112825, 2.8304891300991057, 1.8721979535344329, 20.976979416753611], [17.807789853036024, 15.855321412859062, 17.003476148073052, 14.489355211628792], [1.1391221012703439, 1.6224450223836944, 76.955984634110592, 4.1708616801825009]], [[1.4278231866712128, 64.164457697524696, 11.814789549416172, 1.0238845177632716], [36.100458453584402, 1.6503930080268376, 57.793888029402694, 16.191223679081467], [72.043306246512032, 3.5599505794011805, 15.951781377995511, 30.142565485404749]]], [[[5.8882066740782681, 6.9944602221730428, 36.246690758979106, 1.3026682216432091], [52.565776681921228, 9.9161866425288139, 6.3757857173754662, 9.5083632349604912], [10.439345800208875, 3.9595683987322485, 11.841727921520837, 5.8064084180052564]], [[83.059201699281886, 23.422064675328947, 9.4892561725495934, 46.619951759229686], [22.794339243330835, 2.1909723967569827, 14.869169890155765, 16.057675449106366], [60.155789489282235, 33.487302003366757, 11.9684255748402, 18.465260856490413]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_Symbol_rank0(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=())  
       res=arg0**arg1  
       s0=numpy.array(0.446316283878)  
       s1=numpy.array(1.44762843333)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array(0.311037575212)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_Symbol_rank1(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(2,))  
       res=arg0**arg1  
       s0=numpy.array(2.95320486033)  
       s1=numpy.array([4.5940755638626314, 4.9832270114038257])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([144.73188501385553, 220.58686259100335])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_Symbol_rank2(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(4, 5))  
       res=arg0**arg1  
       s0=numpy.array(4.18292557603)  
       s1=numpy.array([[4.6867343934897621, 1.1960710464511657, 3.3343743181477361, 4.4609959167461168, 3.387580945020368], [1.2747770464044168, 3.3622066348069062, 3.249932388757943, 0.67721201110786644, 4.8150073383478187], [4.0760314139079448, 4.1132515599940778, 3.0255200566902074, 4.2071448728470422, 1.5473882439053273], [0.47090089109000516, 0.26841844512847007, 4.6086968074037387, 3.5513955014100258, 4.9873346808711414]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[817.92283945895463, 5.537763423067636, 118.09932349259222, 592.1344869748915, 127.44249687335613], [6.1979577885592096, 122.89795089007443, 104.65703529474605, 2.635565499292595, 982.7236841415604], [341.32850906763053, 360.00136316063481, 75.910284826337829, 411.77215402231701, 9.1552679331242839], [1.9618037057644206, 1.4683065366393118, 731.49864459166963, 161.10972808968697, 1257.5621091619355]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_Symbol_rank3(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0**arg1  
       s0=numpy.array(0.498435880029)  
       s1=numpy.array([[[2.5385321554575091, 4.1817382595990971], [0.26174787395644922, 4.1712797759306506]], [[1.0703429407751128, 1.5714801019030615], [0.59717380384593077, 0.90712009414730288]], [[3.1211695908847354, 0.97114694608193808], [4.7782539356266822, 2.8834806566368103]], [[2.4168984940930804, 1.5025804800273288], [4.6203038923723492, 2.7107930980674517]], [[3.552727509636497, 1.2804764296068492], [3.997845021987084, 2.0879837015534157]], [[1.9840629189257686, 2.6576561763257409], [1.3208008819026757, 4.6491867818070647]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[0.17075423288975577, 0.054385262654606546], [0.83339305413568687, 0.054782743595412971]], [[0.47461148818190652, 0.33481046814403248], [0.65981197597826957, 0.53173508575919315]], [[0.11381181126765771, 0.50855062549613772], [0.035900494942393626, 0.13429574685980439]], [[0.18584563564064716, 0.35126399244785056], [0.040074033837098531, 0.15145421730175898]], [[0.08427295699083355, 0.41001130648905298], [0.061814282926809204, 0.23367547912147787]], [[0.25121051872088546, 0.15716270028817159], [0.3986594778074169, 0.039276171103334548]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank0_Symbol_rank4(self):  
       arg0=Symbol(shape=())  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=arg0**arg1  
       s0=numpy.array(4.59128914822)  
       s1=numpy.array([[[[0.30754399515696224, 4.7937430546333646, 0.68750350841693775, 1.602658899386125], [0.14980982385113159, 2.1261123929304842, 0.66420833879699814, 1.5657662202602356], [4.0321649094728507, 4.2731803149787115, 4.2670464508690724, 4.2920869581222583]], [[1.0027558270336361, 4.7213728891111204, 1.454206667979083, 2.8048247694359514], [4.0650817895236369, 0.15173169044340437, 3.2084321903126538, 3.1793307298212294], [0.78902881647477507, 2.1208038838317935, 0.46048408876737978, 3.8811637083798645]]], [[[4.497969724852374, 4.9773204810828142, 2.7933154452192652, 1.9240791404203754], [0.57488028900349952, 0.2029096609730254, 2.7036038322449913, 4.8741622606337227], [3.5162063775870771, 3.7652182634440163, 4.80418855289762, 4.8342099758874797]], [[2.7145285442722749, 0.027870965772698146, 3.3870376725070948, 0.26861930705079101], [1.9411178715494879, 3.3818575199808172, 4.938337812533323, 0.80840223018044377], [0.53783527454323565, 0.87196618353301947, 4.4505946649741244, 0.94984485176021671]]], [[[1.6036656677048209, 2.2207302811469489, 0.40330351335053144, 0.50003345895482754], [0.39082630945970415, 3.7365577101126943, 1.313865869429919, 0.39093584052385383], [3.0855485039638366, 3.8332821450753189, 4.3093547027356802, 0.62421495100236635]], [[1.1030456867050047, 1.3139378169735267, 4.8045299524710119, 3.7558316544344224], [3.3364415103512743, 0.060187924508811171, 4.1356447561961369, 1.0122192075489318], [2.0611918812342287, 0.73710365752514329, 4.826169241480561, 1.6534385209655604]]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[[1.597989881708614, 1489.8570637816267, 2.851559188029464, 11.504174184125965], [1.2565052643457746, 25.547443705699582, 2.752089228785267, 10.875141246335584], [466.69123634838661, 673.85443712956976, 667.58393216036973, 693.55523556925311]], [[4.6106146068387801, 1334.2594413918027, 9.1746556656489897, 71.880433310791133], [490.70272411801398, 1.2601912579801398, 132.9757416168795, 127.20645686307698], [3.3287831856654178, 25.341572760224917, 2.0174852654421471, 370.7462093315458]]], [[[949.2093128697411, 1970.8830881309441, 70.630497618883979, 18.776500004232091], [2.4017797546221149, 1.362426035609255, 61.604018327886067, 1684.1348502588021], [212.5684561378024, 310.690813648919, 1513.766331303618, 1584.6416317042963]], [[62.638375617895363, 1.0433950158276781, 174.58124145175145, 1.5059426233834132], [19.270508206043168, 173.20828237598326, 1857.1923412967878, 3.4285417537691454], [2.2699265324740523, 3.7773273713695352, 883.08558795589488, 4.2533900836259004]]], [[[11.521840624008256, 29.510618313891115, 1.8491007200314982, 2.1428386440603839], [1.8142681404626861, 297.41098084423743, 7.4078697402351903, 1.8145710450381507], [110.26341826367, 344.65315126369762, 712.05111840088443, 2.5893425118807132]], [[5.3721008175926865, 7.4086821290237692, 1514.5542213486569, 306.2774980614895], [161.62413918924446, 1.0960755053188593, 546.41994244170201, 4.6775987119733173], [23.140583997756654, 3.0754909079300439, 1565.3397754593568, 12.429917309037906]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_float_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=3.77046202527  
       res=arg0**arg1  
       s0=numpy.array([4.8109800331058379, 2.2003559709696319])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([373.538791570478, 19.559450398996947])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_array_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array(2.25789047181)  
       res=arg0**arg1  
       s0=numpy.array([0.95902248725192929, 3.3031797535547134])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([0.90985335237856324, 14.848824960708631])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_array_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=numpy.array([3.0164589437092495, 1.3733072304425962])  
       res=arg0**arg1  
       s0=numpy.array([4.6526584217987779, 1.4008709359803542])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([103.29829777817667, 1.5887281973052112])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_constData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(3.61070649147,self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array([1.1359998683215817, 1.7186186214212793])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([1.5847279541227477, 7.0658464374448249]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_constData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Data(numpy.array([0.39671612358529229, 1.193810640368014]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array([0.62339915124317435, 2.1642113062453685])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([0.82904946823324732, 2.5135313345485213]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_expandedData_rank0(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.84031687449)+(1.-msk_arg1)*(0.476647408691)  
       res=arg0**arg1  
       s0=numpy.array([3.9968187653736726, 0.24545518554726758])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([204.53808146744555, 0.0045425528637505945])+(1.-msk_ref)*numpy.array([1.9355555326936107, 0.51195505483776593])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_expandedData_rank1(self):  
       arg0=Symbol(shape=(2,))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([4.1462534827657223, 0.90838693197922504])+(1.-msk_arg1)*numpy.array([4.0497673424762608, 1.7337518200428657])  
       res=arg0**arg1  
       s0=numpy.array([1.9241547121004405, 1.739830161829409])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([15.084504290717561, 1.6537630513401289])+(1.-msk_ref)*numpy.array([14.161388049944231, 2.6120362422213081])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_Symbol_rank0(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=())  
       res=arg0**arg1  
       s0=numpy.array([4.2517303868441365, 3.4114558956298522])  
       s1=numpy.array(2.29993774073)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([27.903714198316138, 16.816215715047409])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank1_Symbol_rank1(self):  
       arg0=Symbol(shape=(2,))  
       arg1=Symbol(shape=(2,))  
       res=arg0**arg1  
       s0=numpy.array([4.7236220856947639, 3.5876711989971528])  
       s1=numpy.array([3.8537482065342985, 3.9848605135450832])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([396.72231441166349, 162.4990994271011])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_float_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=1.00896531813  
       res=arg0**arg1  
       s0=numpy.array([[3.4786797409016748, 4.1204132132959703, 1.0954873375618892, 3.5066823750608198, 2.0130791588154464], [3.1831936722807463, 0.946298059583221, 1.9776388823883164, 4.7557631524153834, 0.88504398310958976], [1.9760127538498542, 3.3963957170519583, 1.7805186077681687, 2.3516059265995639, 3.2819343340941445], [0.64855367786694185, 0.80865765581178595, 1.460064137678287, 3.2383605763290038, 4.762057644782038]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[3.5177777748663903, 4.1730530991705486, 1.096383408169938, 3.5463500423403076, 2.0257463351207372], [3.2164098997919326, 0.94582988581973826, 1.9897661766138457, 4.8227162709673728, 0.8840755440432444], [1.9881154142424755, 3.4338319121666454, 1.7897515449014043, 2.3697031581649313, 3.3170892430834895], [0.64604082329031409, 0.80711939542816724, 1.4650268376972666, 3.2726565579209037, 4.8291566439525218]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_array_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array(3.96201977373)  
       res=arg0**arg1  
       s0=numpy.array([[4.5639828255792958, 0.18981624962132629, 3.1944788879034949, 0.03927429382387608, 0.66005101094122121], [4.6788075679329593, 1.9924257894157544, 4.9477591682257032, 4.6545703518306478, 2.5116060184351245], [3.5469817665990053, 4.245434513572361, 1.8830158974340052, 0.71395705438995982, 3.1163840284055966], [2.2565424981631734, 1.0399565544208518, 0.68034996913061152, 4.2303456726663482, 3.2901771877029913]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[409.5755013865562, 0.0013827466491954327, 99.642097737940006, 2.6904790907302805e-06, 0.19282462241342091], [451.9483955031713, 15.351754474622037, 563.97572986900309, 442.74348289498005, 38.425171207707301], [150.85234175014924, 307.49634619583816, 12.273740297417262, 0.26317578286650489, 90.334761876336586], [25.139127683619144, 1.1679238972547388, 0.21741141375897535, 303.18906096130735, 112.00387338522359]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_array_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=numpy.array([[2.4935779537463207, 3.4527886175707381, 1.3143921251841439, 2.8168942045112648, 3.6232891097461826], [1.6324943673116841, 2.9841936731411312, 0.53330014478311594, 1.5731485762245387, 0.35701903986733452], [3.6412135838375432, 4.6786765789958773, 2.0482750236974723, 1.8276918144654868, 3.9466966384581417], [2.5560150927976708, 3.5119787330855576, 2.9155167726298887, 0.77254589769864246, 0.63906811126256879]])  
       res=arg0**arg1  
       s0=numpy.array([[1.6254213480936244, 0.81451197213972493, 2.3687500616125323, 0.76030813024790622, 0.1790759659530157], [4.8204922220430513, 1.1024594010803728, 3.7236878542972769, 2.3461572148791001, 1.9128752458270697], [3.2100439371808256, 3.1344679287218917, 4.5614310662622639, 1.9334803050946854, 4.3880527302464651], [2.9180017318899449, 0.19107738758728848, 4.4155068166604741, 1.179040641956361, 2.4486166135122009]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[3.3578405189238798, 0.49243374500305709, 3.1064555088344021, 0.46212598724170034, 0.0019657948484713885], [13.035954643771429, 1.3378832559372602, 2.0160445583915001, 3.824958797313319, 1.260571535568451], [69.873846121559879, 209.59942817353118, 22.388260633495975, 3.3368817905037145, 342.65107844745717], [15.444209112452127, 0.0029896636453368647, 75.936685918340885, 1.1356885890545192, 1.7723393333460693]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_constData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(3.38633680917,self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array([[0.13750467965114596, 1.9072878368116848, 4.8045372596908233, 1.0967820309722454, 2.6002585971258356], [1.4995523185725836, 4.2575022379350811, 0.13649332220870652, 4.8730097782102471, 4.0867015880253144], [2.1882212276540871, 1.9755209185833509, 0.13790663603941508, 2.6281736214194935, 3.7487212164280099], [2.5298578373328064, 0.53486877112937015, 0.21071885811117108, 1.9698098273664391, 4.8508244968902563]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[0.0012079605746092693, 8.9039729647683359, 203.37697718026433, 1.3672909486463725, 25.432308849376962], [3.9433499486816328, 135.06111958618476, 0.0011781373194923563, 213.36012451410068, 117.57490740689062], [14.179582364534378, 10.029461064873566, 0.0012199599473737622, 26.368775549252025, 87.773135986898083], [23.174972054554509, 0.12015826042042686, 0.0051266296345756539, 9.9316142732567272, 210.08859771576093]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_constData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Data(numpy.array([[1.1384668665360873, 1.2422338415044896, 1.0599548900770228, 2.6479139377215786, 3.9507547586100835], [2.0991927115422748, 2.1110627552839114, 2.6684587427287743, 0.89644949594080225, 1.8246281860028954], [2.0821074993582571, 1.61995609459384, 1.9123993675240785, 3.9399239363532299, 4.6140961029911063], [4.9529150741229815, 3.2982346188040741, 4.4871593725682599, 2.9391198156034237, 1.5282232998724041]]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array([[4.176517279416851, 1.9782387528236915, 3.9393585030921661, 1.2346879147432424, 2.0828907180527008], [2.8687244464562629, 4.1168693721918945, 1.3027101941466057, 1.7330256554499563, 3.5305867689564803], [0.16627967394907561, 0.83094878947510797, 2.7917310134652769, 3.8903229999263313, 4.4158441128535015], [1.9215476344388465, 2.9194688465309513, 3.7509628287428862, 0.36074605643790664, 4.8606866607446735]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[5.090688120711496, 2.3337129393476155, 4.2768515540572176, 1.7475740158180095, 18.154033420027812], [9.1364412357722351, 19.833058286025132, 2.0251940702438387, 1.6371053007517691, 9.9911821316009508], [0.023861809854988935, 0.74082193260638751, 7.1234164610534254, 211.10505218043932, 946.57570741111067], [25.403881663786699, 34.251630538236334, 376.93812727704096, 0.049953097750523208, 11.205398639028887]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_expandedData_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(0.110879931679)+(1.-msk_arg1)*(0.511931419204)  
       res=arg0**arg1  
       s0=numpy.array([[1.8843902420035159, 3.7188180205684493, 4.0737850164927165, 0.17625553729630183, 1.7340501390177425], [1.1730173799351939, 1.2397523878542196, 4.4458559502315271, 4.1115131871685859, 1.2693816949021588], [1.1393536910285775, 3.4383938086241415, 1.6979652103927176, 1.1450906183295673, 1.5300174595945442], [3.2799233977329498, 3.6584901711791038, 1.8387100067066831, 3.8034051798008144, 0.85031599512414491]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[1.0727806332908962, 1.1567685146153261, 1.168521071783446, 0.82492100426951442, 1.062936057051667], [1.0178516203269887, 1.0241155802233914, 1.179900130186162, 1.1697160934753286, 1.0268010391745097], [1.0145706569689881, 1.1467561398633912, 1.0604604797558754, 1.0151358357698888, 1.048284399598278], [1.1407722073523887, 1.1546726401340253, 1.0698655662796419, 1.1596568496416431, 0.98218178087626185]])+(1.-msk_ref)*numpy.array([[1.3831478374183366, 1.9588816758360275, 2.0524717883760468, 0.41122243300791028, 1.3255104932137374], [1.0851233874307673, 1.1163004380904509, 2.1463904180107569, 2.0621808772570276, 1.1298794711238096], [1.069067922959567, 1.8818165849415338, 1.3113172390033263, 1.0718202828435832, 1.2432311507152767], [1.8369055931560774, 1.9425487978720661, 1.3658802901908615, 1.9815661700947413, 0.92034353917316969]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_expandedData_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[0.96298788541035074, 1.835031030550156, 3.6160789514013985, 4.0205311098243932, 1.3343486301903422], [0.73740311792176139, 4.8413193482418313, 2.4364430810765971, 2.0947845916426173, 3.5114856784229649], [1.999832871527611, 2.1106075303509302, 2.439894594325565, 4.3524242705933913, 3.4360787438679958], [3.5801151579227928, 1.6776071241626687, 3.399674372645729, 4.9021587785776441, 0.86491972905660275]])+(1.-msk_arg1)*numpy.array([[0.43528617436583572, 3.9811736473856407, 3.2668279441923342, 0.37888058367759081, 2.8698105934863443], [1.2579313517894075, 2.0015321444943015, 3.0895096718568276, 0.30058366530281089, 1.0644861793802283], [3.5126270401471644, 0.72189124526057635, 4.9466150004749716, 0.53481188027701143, 1.7904099529869624], [4.1102627881996892, 2.7081529350918823, 3.7414853659711333, 0.23786745163559761, 0.5246632777429675]])  
       res=arg0**arg1  
       s0=numpy.array([[0.30632161344749093, 3.9235284029379702, 4.3608815499172557, 2.8915326427942065, 4.4786562996728119], [4.2434398378319322, 1.0130630846129247, 0.47924714869939899, 0.61167831603068978, 2.6680522875226971], [4.5460787243140341, 3.4696678156665945, 2.3565464895699546, 2.8593494997321249, 1.5911642946329747], [0.99172562455986291, 0.024892209502221332, 2.5922863995122558, 3.1735072641909396, 2.6786657029973924]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[0.32003339074629783, 12.286136942982605, 205.47128164960077, 71.446320836337648, 7.3936363862428234], [2.9032286883127449, 1.0648490534276862, 0.16661016551525779, 0.35711808813553447, 31.374391300346105], [20.66160213371894, 13.814517003907877, 8.0968152339197061, 96.798498493273428, 4.9329726645686787], [0.97069161730551567, 0.0020380958883663329, 25.491032695516068, 287.49231952398515, 2.3448505493732266]])+(1.-msk_ref)*numpy.array([[0.59750319372421012, 230.95663041262361, 122.8511326053535, 1.4952454291229664, 73.904463443192768], [6.1606454319971125, 1.0263172214535941, 0.10305892360034093, 0.86264543105440605, 2.8423527884991082], [204.18946940905107, 2.454873417742208, 69.423436012168509, 1.7539497302438791, 2.296955534402199], [0.96642523125132929, 4.5320481748108541e-05, 35.301147335422158, 1.3161334347692339, 1.6769230402381448]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_Symbol_rank0(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=())  
       res=arg0**arg1  
       s0=numpy.array([[3.3383227154075805, 0.85413731221946532, 4.2330245762499592, 0.34864274731319994, 4.6303315051862066], [0.80509048085063306, 2.9686701224825227, 1.0436428307939478, 1.7948060475710934, 0.63431146316397891], [1.8238278494780609, 4.2832327664724748, 4.8457716477600181, 4.7208478487394077, 1.3190784395425887], [1.6427722393682722, 1.7235670300065395, 2.8998898474536214, 0.3985374789323014, 1.114804763238314]])  
       s1=numpy.array(1.39700902141)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[5.3873325260889686, 0.80231252275155807, 7.5064882097326091, 0.22945716261636265, 8.5087563492056972], [0.73869334242016571, 4.5727061697786446, 1.0614930705756116, 2.2639392708614072, 0.52943773609849265], [2.3152440838925901, 7.6311630177320735, 9.0668872785397649, 8.7420246250251417, 1.4723774033471337], [2.0006149512286475, 2.1394015073235653, 4.4253857078731045, 0.27659977663355573, 1.1639576292473091]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank2_Symbol_rank2(self):  
       arg0=Symbol(shape=(4, 5))  
       arg1=Symbol(shape=(4, 5))  
       res=arg0**arg1  
       s0=numpy.array([[4.9679057149557657, 1.6724273708288637, 3.2077930763327567, 2.998623644960007, 4.627340390154588], [2.4180287730842713, 1.1900039758380851, 2.633455761600183, 2.6736354655716887, 0.59162656283566761], [1.2968100740775126, 3.4522973293014467, 1.9944770438900683, 4.1552321773708645, 0.85788091717856207], [2.5589079911781085, 1.2948792679213916, 4.9610132650734027, 2.7824744315281351, 3.1661532855898527]])  
       s1=numpy.array([[3.5004078992492342, 4.2906548118534804, 1.7932688188800698, 4.2158917215048719, 1.6850859329693291], [1.6530619430986664, 2.7455731004945099, 1.683387925453443, 4.5663951774142904, 1.5954661716259875], [4.311743535869244, 3.695568724251387, 2.6597203630501736, 1.6574882859135731, 3.9361388856254447], [3.2126343111253401, 1.2443488483627902, 4.0447171204132522, 1.168168382579851, 0.43884443737104945]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[273.45802668671223, 9.0846044803126116, 8.0865645131500976, 102.48288624506995, 13.217236566371342], [4.3041317180089669, 1.6122177148995849, 5.10397380200674, 89.19025313722949, 0.43282243132370901], [3.0668602236748042, 97.4127504196627, 6.2727995325014074, 10.600209675725001, 0.54696489704541229], [20.461168668732505, 1.3792797884264092, 650.70696889787803, 3.3049923253437234, 1.6582715743167751]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_float_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=3.67233588927  
       res=arg0**arg1  
       s0=numpy.array([[[0.44044929340328504, 0.66634074908605179], [3.5728800279057102, 0.35306127460919567]], [[1.7664740138870989, 0.40411933180369092], [2.5244565398349996, 0.65931056595317605]], [[1.9363090503094518, 2.0066712438221659], [4.8158469424957371, 0.22670479937208388]], [[4.2341834597909136, 0.20878747575578499], [4.0388646779415964, 1.5017655190746146]], [[1.2839698299226414, 2.224850085128586], [1.3348289904325386, 1.2240761601253998]], [[1.3539997328252877, 1.3827230552557359], [3.883014708760133, 1.605315159275559]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[0.049234122045869265, 0.22519246879235605], [107.3666593912763, 0.021855142317662096]], [[8.0809204926231786, 0.03588981158017697], [29.984416851531321, 0.21658972275011465]], [[11.320546673850783, 12.906078567956083], [321.3685458015463, 0.0042957129106845834]], [[200.31282612952592, 0.003174871945513425], [168.41772414383948, 4.4518685754425169]], [[2.50408898494367, 18.854065798813323], [2.8880522329285778, 2.1011743222193475]], [[3.0433200699782197, 3.2872061550457969], [145.75605136740424, 5.6870427408167572]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_array_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array(4.33762908476)  
       res=arg0**arg1  
       s0=numpy.array([[[3.0077002735060825, 1.4034135042940306], [3.8598034781132085, 3.1406105319145432]], [[2.8072052903632874, 2.9111917244271606], [0.2398566695103353, 4.2735753940473424]], [[4.7652573046436233, 0.64420650581883354], [3.7704453170516845, 2.1066154137955717]], [[3.9163507142214593, 4.752262520668296], [2.6700992947839723, 0.68612128355994406]], [[2.9616882507010103, 3.6828897272321859], [1.5071762504714152, 2.2252126489502317]], [[0.48570212115482492, 3.7736644418697685], [3.3273964703699725, 0.67767269375366501]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[118.68726343140844, 4.3494742242801703], [350.18879177516123, 143.17353265549741]], [[87.992791110309369, 103.03079104972653], [0.0020439058640126561, 544.67694582701085]], [[873.54865366001968, 0.14846420162889365], [316.35704337151668, 25.327529184661927]], [[372.99273256419616, 863.26267728597463], [70.813768688456889, 0.19514963722948389]], [[111.01016967846076, 285.70420972292226], [5.9266534122457921, 32.119502380333962]], [[0.043610331776292567, 317.53030223194071], [183.94834646030716, 0.18493852031957317]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_array_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=numpy.array([[[1.0618180217944018, 0.31825432829297451], [4.3334742322919082, 1.2220104047591667]], [[4.7706202136882023, 2.6180982160476991], [0.96631643724776783, 0.12851043589940278]], [[0.65147593800563186, 0.27857929415644533], [2.3843921829543211, 1.8645890643646361]], [[1.3234042181856271, 1.7551293386497409], [3.9515318607988981, 3.1354891498272384]], [[0.077334843521652818, 1.6015634281965472], [0.1206933849087677, 4.5258502344801217]], [[3.6635425173498191, 0.086628327076671605], [4.2087910306604517, 0.6868754911183953]]])  
       res=arg0**arg1  
       s0=numpy.array([[[1.780805642960591, 1.8902508150975148], [4.063736419688996, 4.1573679640621064]], [[4.4183785122468535, 4.8328970860470859], [0.58713757499188646, 3.430048541271919]], [[3.2926862355762907, 2.6716663820511433], [1.7292702870116361, 1.2260315208420067]], [[2.9009655243390737, 2.7395140900938126], [2.7096581368573602, 0.094202958238920234]], [[2.3544269755051768, 0.54033736634760121], [1.0371848041705725, 2.9847502148111094]], [[1.6215344706996906, 0.05592052584941333], [1.9049092234882581, 0.37110138320694486]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[1.8454791411186466, 1.2246260875221957], [435.27437310342094, 5.7043032210402105]], [[1197.579409477705, 61.847558300049293], [0.59776370181992466, 1.1716332025932104]], [[2.1735598267545266, 1.3148998965194012], [3.6911219169066807, 1.46224175911377]], [[4.093839245508005, 5.8637259962250114], [51.36596440712259, 0.00060700252847081825]], [[1.0684634875792356, 0.37311786490835347], [1.0044162534510948, 141.04654342195565]], [[5.8758879523847467, 0.77894033375397864], [15.063725007617117, 0.50616836616906591]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_constData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(4.3169524087,self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array([[[4.6723647441424747, 3.7306211660514643], [4.1234579978325128, 4.9299389815695003]], [[4.0704526877481699, 1.2279575805652287], [4.6215705025059037, 3.7122542907800851]], [[0.25988957862326156, 0.2225575636141929], [0.17519759952078881, 4.4190724173521181]], [[1.5806783765849057, 0.7909343572895422], [4.4721833370819564, 0.72733824178434758]], [[0.015601485587139186, 2.3322422785379002], [2.791462649725903, 1.3149009208826958]], [[4.8635040208131217, 0.27231646301441009], [1.6008406113728684, 0.60665421166098632]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[776.88768092553767, 294.00316951036598], [452.95487558574581, 979.40873315890917]], [[428.34980188117953, 2.4266119956346488], [741.07982450992449, 287.8053868486968]], [[0.0029762635184969132, 0.0015238412200482472], [0.00054243415917307419, 610.75035327729722]], [[7.2176859121394079, 0.36330981635752946], [643.07577590759661, 0.25300127836019198]], [[1.5848326653951481e-08, 38.695583892152179], [84.068781890045017, 3.260284882380907]], [[923.69234769946763, 0.0036411695442799949], [7.6236156608622148, 0.11560258990984176]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_constData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Data(numpy.array([[[0.65135874487715339, 2.7268673477623278], [1.1694086448380991, 3.4067123964254176]], [[0.79004159133301666, 0.82978392334579454], [2.872950328112978, 0.074676827697260278]], [[2.9910432845170125, 1.9098228723360049], [1.9559815117145556, 4.2295332346145189]], [[3.7226294532817148, 2.4612693059714301], [1.2221031244411173, 1.4476504446700251]], [[4.8105392552955548, 4.0500618255730751], [4.4580642956215497, 1.4594742974653951]], [[0.82191708473332403, 2.528647001908829], [1.4192145274558869, 3.0840513290934015]]]),self.functionspace)  
       res=arg0**arg1  
       s0=numpy.array([[[2.1798875497062165, 4.3596488118256334], [0.279164013678037, 0.74717796308113571]], [[0.10396760137192775, 1.8224030719040263], [3.4173324001499994, 4.0027884648096128]], [[0.8242545665634603, 0.25424494024646394], [0.87266487251667735, 0.83390325198223247]], [[2.6417355074489377, 3.6336628790573422], [1.4157701065471811, 1.4155439323722929]], [[1.0518243514607657, 2.2474813413706713], [4.3501790293941633, 3.5675151072322153]], [[2.1869288414266914, 0.28578792809770465], [2.7296103000824989, 1.4104950046327638]]])  
       sub=res.substitute({arg0:s0})  
       ref=Data(numpy.array([[[1.6612768175221593, 55.424200020257295], [0.22489677689127313, 0.37050336566934106]], [[0.16722782868461022, 1.6454267939184395], [34.139478746546303, 1.1091302009868522]], [[0.56096517418784808, 0.073137022395491497], [0.76612351593899486, 0.46382707255527594]], [[37.199547675589251, 23.941923790872977], [1.5294268035578249, 1.6538048392945341]], [[1.2751425183030933, 26.569961686052491], [702.27278871678777, 6.3997604529944629]], [[1.9024616307001394, 0.04212374623179603], [4.1583436350231269, 2.8884811301973947]]]),self.functionspace)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_expandedData_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.17040326604)+(1.-msk_arg1)*(0.0619947718176)  
       res=arg0**arg1  
       s0=numpy.array([[[2.0727270379558465, 0.78571420197420905], [1.6472281288312665, 4.9594458378007982]], [[2.9252129062080536, 3.5281328412238109], [4.4214484486095085, 4.6540106138443456]], [[4.0651628035817042, 3.920150308881611], [0.90891541298590073, 0.99320872186051179]], [[0.23699749948035859, 3.5471154735698365], [0.24178989303086668, 1.2026578111588466]], [[3.2421793123283997, 0.7216870485620287], [2.6967359076738853, 1.5917909283642864]], [[4.5636668167967143, 3.9818413105584249], [1.3882215503418645, 4.2133427674367345]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[10.08245164409815, 0.46552880220993131], [4.8662766661048753, 160.25202843034094]], [[30.054340324788498, 54.442521415980494], [111.35250918972744, 131.00325092866493]], [[85.314470582390229, 76.034182192542744], [0.73875880083550149, 0.97862717141270095]], [[0.010415631032048818, 55.376631182374382], [0.011098141947770956, 1.795075421590929]], [[41.644666578774427, 0.35555674879217714], [23.223706127783174, 4.3657625795008013]], [[123.10934965898066, 79.892885805307273], [2.8291227279910536, 95.569391391421703]]])+(1.-msk_ref)*numpy.array([[[1.0462222599195035, 0.98516041491251982], [1.031424870569968, 1.1043664881312547]], [[1.0688070914707193, 1.081296812909484], [1.0965328023275656, 1.1000231003359582]], [[1.0908364669783688, 1.0883827920104674], [0.99409679098553516, 0.99957762933445859]], [[0.91461302592450044, 1.08165657716741], [0.91574886354293206, 1.0115058288001391]], [[1.0756456497331688, 0.97998261897513683], [1.0634320116795251, 1.0292381560859323]], [[1.0986870779357398, 1.0894368658290106], [1.0205439199649411, 1.0932603446540492]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_expandedData_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[2.7555410825451698, 3.9658544183312574], [1.0585267017838034, 0.84297543727297841]], [[2.1466415747790419, 2.7200799220099761], [4.2419704808140448, 4.8293541247268861]], [[1.2043619017127256, 0.27996155881328505], [1.5138726334939265, 4.4839392547134604]], [[4.8676966118466787, 4.1350068769985011], [4.5616178855613363, 1.6802524098976721]], [[0.63165088646016088, 3.514085788082169], [0.17359786324937296, 2.959599040972027]], [[3.1673171361513126, 0.7814619425228061], [1.7637315072826842, 4.74953384585283]]])+(1.-msk_arg1)*numpy.array([[[3.8453341429233165, 1.5134370344248871], [1.6781215307543764, 4.9948763610482674]], [[4.3220948433859814, 4.4735225934440654], [2.3510385384873302, 3.293931695807458]], [[0.6088404159868821, 1.8849122595538819], [3.8596362325508604, 2.36217948314671]], [[2.1524247684668092, 2.5661974085426653], [0.2124082866546278, 4.7064902800753945]], [[2.735481408532844, 2.7326942774546907], [3.1542764255292828, 0.58052133439940878]], [[2.3762725841859988, 2.9028242396278401], [4.0840550873414427, 3.6212435442722271]]])  
       res=arg0**arg1  
       s0=numpy.array([[[3.6908272154728019, 0.46599344985704194], [2.5570989833938511, 2.5082269319461292]], [[4.8674889716644154, 0.90679800556415024], [2.8212417391851061, 3.210622949052873]], [[1.2943275210493175, 4.3887870685146355], [3.0872409982568181, 4.3806285155203675]], [[3.8641704108944945, 3.3275041828528091], [1.4990611473596345, 2.1506463684793293]], [[3.7457920336414299, 3.077820272744856], [3.032830061009788, 4.9628467140627199]], [[1.3079917498670313, 3.325068503727858], [4.1399132120597271, 4.9962094424158652]]])  
       sub=res.substitute({arg0:s0})  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[36.536983898175293, 0.048399693660946916], [2.701541592274292, 2.1709830135474562]], [[29.881158864753647, 0.76634674511893608], [81.424379529110766, 279.57552733695076]], [[1.3644001184544547, 1.5129750647061737], [5.5099471351254081, 752.67997744375998]], [[720.46322812407504, 144.1995958838111], [6.3389990064525774, 3.6207611122618806]], [[2.3029227088137003, 51.967124504881085], [1.2124052168528989, 114.57355547055738]], [[2.340588298653079, 2.5572153828868145], [12.251997063604923, 2080.7377473792485]]])+(1.-msk_ref)*numpy.array([[[151.62827075211109, 0.31485727059571955], [4.8333686990921327, 98.8070475425599]], [[934.53870629070923, 0.64553904205859036], [11.45519550394855, 46.630553509767815]], [[1.1700839671936882, 16.246620757919686], [77.546851127229644, 32.766057032191647]], [[18.34824191258334, 21.870535866053952], [1.0897966950785754, 36.747922331582537]], [[37.061075949135684, 21.588355019493093], [33.104118441003756, 2.5344668087088356]], [[1.8927152259850422, 32.711120559467638], [330.99863246135624, 338.80350319129326]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_Symbol_rank0(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=())  
       res=arg0**arg1  
       s0=numpy.array([[[0.5466154679616293, 0.71093328933216127], [2.1469271127959746, 3.5492117697779069]], [[3.0997750089788645, 0.098729469690927385], [3.6587799939821104, 4.462136087977556]], [[4.1848380805842265, 4.3662001496969527], [0.71987833347505359, 1.39155283819853]], [[2.9770463776729499, 0.60541693873677749], [3.3139383792318435, 4.7066167830165595]], [[2.7917060016778277, 4.9655470340281775], [0.73237502773091334, 2.9697226983428076]], [[2.4714729875530881, 0.68519685889814985], [2.0365050791557855, 3.9236985231045769]]])  
       s1=numpy.array(0.174244020609)  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[0.90010389817732939, 0.94228453442818827], [1.1423973330436519, 1.2469734201966733]], [[1.2178991986496845, 0.6680183128295657], [1.2535971067295946, 1.2977138837797726]], [[1.2832869831044251, 1.2928085982946176], [0.94433970943476175, 1.0592633957833697]], [[1.2093564017834462, 0.91627178117413399], [1.2321594306163353, 1.3098316879046801]], [[1.1958869473377558, 1.3221115696260359], [0.94717587091981303, 1.2088374853057546]], [[1.1707662930419385, 0.93624995276128986], [1.1319349016701874, 1.2689599451685691]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank3_Symbol_rank3(self):  
       arg0=Symbol(shape=(6, 2, 2))  
       arg1=Symbol(shape=(6, 2, 2))  
       res=arg0**arg1  
       s0=numpy.array([[[2.3651372302103306, 0.43338075862715958], [3.2541037782573095, 3.3982251985563932]], [[0.10961262003072847, 1.9549504488690495], [2.638372019610963, 4.6751894437871542]], [[3.3947956835492215, 3.3562339765467728], [3.1233918726895551, 4.2783107541563981]], [[4.0068460516235564, 0.21054211427682024], [3.6084169108335828, 0.17853309010170332]], [[3.2752453605854446, 3.935058031899628], [3.1273581539346016, 2.3424760208032125]], [[1.1971009867583238, 4.5457548527735154], [0.91797783337467387, 4.8044522623199697]]])  
       s1=numpy.array([[[3.7974689568807993, 3.5533014895163646], [2.2861216538368003, 1.672946683123125]], [[1.7811053791954787, 1.7432768186123848], [1.5525056730301454, 2.0735752700827019]], [[1.1468153098343661, 3.976354896875272], [1.9865838685928503, 2.9734318866105451]], [[0.087863469111300205, 1.0327911307073312], [3.2027146807359625, 0.60668734673912517]], [[2.7461468142225507, 2.2539825924208867], [4.4695334313829047, 0.56734502962957423]], [[3.6486787221389498, 1.1656219719324088], [0.55980942561539138, 2.597797436452765]]])  
       sub=res.substitute({arg0:s0,arg1:s1})  
       ref=numpy.array([[[26.284992806112516, 0.051249342651829725], [14.841592995135619, 7.7402775206157566]], [[0.019493529348119008, 3.2175863516794712], [4.5094812010648306, 24.483814777030044]], [[4.0620494917390726, 123.30341027472693], [9.6076456718587195, 75.343408580374231]], [[1.1297031314722707, 0.20005550194014143], [60.943361778416389, 0.35158247315975449]], [[25.997718090953342, 21.928529842648746], [163.38528135312103, 1.6208146784965438]], [[1.9278540253727272, 5.8414412792276149], [0.95321992564474201, 58.989230456027897]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank4_float_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=3.1086065929  
       res=arg0**arg1  
       s0=numpy.array([[[[1.076444227727291, 3.541325183741491, 2.3386427678824333, 0.27538919907410608], [0.8482960286024267, 1.8982336994400004, 4.6462188023093587, 1.3520892308647341], [2.198586845456203, 4.9936930343295298, 3.8548459379067452, 0.89864884731434558]], [[4.65560109005611, 1.930150671361871, 2.3209589030960345, 3.9389443398284643], [2.75939136538602, 1.9462870640447432, 3.1306487950849395, 2.5995018524536526], [2.3144815264023388, 2.0861999889727678, 2.7194184415289127, 0.21199747103371558]]], [[[4.3833619174714427, 4.656717415678389, 0.7684209396488787, 1.5287926181457931], [1.8633205861335629, 3.9351595944516804, 1.6188309514529942, 0.057845902299296405], [2.3725582023243983, 1.6910166022113533, 3.5190965924648898, 3.6869205034421846]], [[3.4816738706355173, 2.8010383450057774, 2.8166426085584879, 2.7734763832097657], [3.6061410748081295, 3.5842719968329377, 2.7425700136323035, 3.9552456833955771], [2.8467421784153331, 0.8971368395355076, 3.2726531534454977, 1.1013684383568765]]], [[[4.2593616200910764, 1.1295022161983845, 2.2485991934803535, 1.5551131813568906], [1.1918991420696818, 0.017447183595545184, 2.2102826265772277, 0.95165953813134441], [0.59526096131850637, 4.7887451033430795, 3.3296600685733866, 2.2574857395156478]], [[1.3629406865094909, 4.2022137041605978, 3.7019355709728612, 3.7697956617594977], [0.30706486632133539, 0.80322432917065656, 0.94764376482830759, 2.7595329818163172], [2.8253318104142235, 3.0070691788820847, 3.2162233454661724, 3.8568161587946581]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[1.257329459282323, 50.949561542650898, 14.026960481481975, 0.01815579415507123], [0.59962824486589339, 7.3329656029356656, 118.50874388934652, 2.5541365169838888], [11.57683727755624, 148.29234882959628, 66.323174304544722, 0.71734757600020538]], [[119.25424718114535, 7.7230834078404031, 13.699863736254484, 70.925386023197987], [23.459304567628234, 7.9255692320751807, 34.732193190319506, 19.486336475589056], [13.581359111879557, 9.8344930272529059, 22.418940135600327, 0.0080505789042726785]]], [[[98.884107472124896, 119.34316003232746, 0.44093329202481329, 3.7416848197454535], [6.9217794910744148, 70.713752591072549, 4.4701815334049648, 0.00014203404099969076], [14.669038612057996, 5.11943434178239, 49.961974362600337, 57.747706749837484]], [[48.328801241942244, 24.577571087568064, 25.005702894027667, 23.833553272587597], [53.90470194062415, 52.894982391884426, 23.017597278487589, 71.841827472556062], [25.845778095494968, 0.71360225709539071, 39.867726646565423, 1.3500567989031063]]], [[[90.444987517199351, 1.46017580699349, 12.41526861947956, 3.9455960971209993], [1.7258324661576461, 3.4214939173965186e-06, 11.769356909305893, 0.85725055429960995], [0.19936730701499708, 130.17923835169236, 42.066440617008276, 12.56843069829168]], [[2.6183997625169808, 86.725785123873862, 58.481929004649693, 61.879293245971695], [0.025468314026973762, 0.50602878096492487, 0.84605546139254206, 23.463047437586216], [25.246285827608059, 30.645011292133709, 37.769370125967832, 66.428606430698537]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_pow_overloaded_Symbol_rank4_array_rank0(self):  
       arg0=Symbol(shape=(3, 2, 3, 4))  
       arg1=numpy.array(0.816282563282)  
       res=arg0**arg1  
       s0=numpy.array([[[[1.0575461767314325, 2.4150846109301423, 0.80916994112397056, 2.2081844827367862], [1.8438264080542748, 0.41681834333297751, 3.6884995628030053, 1.057153268307474], [2.3635853582423154, 1.7765678841517905, 1.5586952787827959, 2.7981794250036427]], [[1.0367106660883503, 3.8193270199478504, 1.5048725786676111, 1.5618960978988738], [4.5899129299193371, 1.7451978774906582, 2.8233851583415985, 1.6663170665343345], [1.029415917731566, 3.0702660825436854, 3.2223670053780031, 4.7111516444245884]]], [[[3.0508794011081304, 3.2641774841271065, 0.31435474762249016, 2.0213729359206267], [0.37924272686152666, 1.3037872131229198, 3.585240851576351, 3.52316286300861], [2.6165729019407418, 3.9225531599299144, 0.85755600472867455, 4.1052484908553772]], [[1.1866246600987096, 2.9742200996415931, 0.27760758918889911, 2.7690067739940027], [2.6920147249882445, 1.7294746130437946, 1.9938010298104338, 3.2177279143158453], [0.13023254546117607, 1.8446334007235869, 0.53823961012654309, 3.9111890098983406]]], [[[4.7488312240068948, 0.80138965543300589, 2.8941990444381496, 1.8553734089597065], [4.0572030945834792, 0.27053954940159575, 1.1494464264606814, 4.9704262398829382], [1.0259475782397978, 3.9759962393677029, 2.5440410896725338, 1.6884278372561492]], [[4.8457285808355888, 4.4630791656504023, 3.7607353946619653, 0.54535679087855615], [3.7202351533076596, 2.4752103983486529, 1.3715456790127303, 4.4095398451264893], [2.4827394226198809, 4.8140696504120122, 0.27398429715291939, 4.1856779414240224]]]])  
       sub=res.substitute({arg0:s0})  
       ref=numpy.array([[[[1.0467310981221087, 2.0539080671719878, 0.84126814471593103, 1.9091060783343798], [1.6477929024386737, 0.48951862307970151, 2.9020811730070801, 1.0464136429033637], [2.0180862851971915, 1.5985612347581621, 1.4366389034227283, 2.3162035701368415]], [[1.0298666595690984, 2.9858343767086892, 1.3960145138554125, 1.4390466245868245], [3.4691208605540504, 1.5754825312853831, 2.3332205619170159, 1.5171093913791398], [1.0239475597041769, 2.4984650937020105, 2.5990485566224435, 3.5437404128025309]]], [[[2.4855798177592594, 2.6265433051929881, 0.38882370009908329, 1.7762081764766815], [0.45318706138377624, 1.2417702032587605, 2.8355913896580964, 2.7954494427929961], [2.1927445128772178, 3.0515458000753961, 0.8821111997087604, 3.1670746383759418]], [[1.1499016780125908, 2.4344799993511876, 0.35130368324299083, 2.2964732096827878], [2.2442162766954428, 1.5638864110661583, 1.7564065213148263, 2.5959938446272406], [0.18939171992534465, 1.6483815769724472, 0.60311498382351314, 3.0443273455119444]]], [[[3.5668591018316169, 0.83465945071415748, 2.3808804117122397, 1.6562115634975063], [3.1367859855606537, 0.34398529023965202, 1.1204072210222258, 3.7021497356893396], [1.0211305812465283, 3.085441302648861, 2.1430004850808828, 1.5335219665221274]], [[3.626157558321609, 3.3906689452180574, 2.9483914113733602, 0.60961699745649689], [2.9224471244891883, 2.0955532972052908, 1.2942028623796134, 3.3574301897556955], [2.1007549886581818, 3.6068073528974818, 0.34755638464889244, 3.2176336019101019]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")