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

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

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

revision 3974 by jfenwick, Wed Jul 4 06:16:52 2012 UTC revision 3975 by caltinay, Thu Sep 20 01:54:06 2012 UTC
# Line 40  from test_util_base import Test_util_bas Line 40  from test_util_base import Test_util_bas
40    
41  class Test_util_binary_no_tagged_data(Test_util_base):  class Test_util_binary_no_tagged_data(Test_util_base):
42     """     """
43     test for the binary operation add, mult, ...,inner, without tagged data     test for the binary operations inner, ... without tagged data
44     """     """
45     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_update_float0_float0(self):  
       arg0=Data(1)  
       arg0+=0.5  
       ref=Data(1.5)  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(+)")  
       arg0=Data(1)  
       arg0-=0.5;  
       ref=Data(0.5)  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(-)")  
       arg0=Data(1)  
       arg0/=2;  
       ref=Data(0.5)  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(/)")  
       arg0=Data(1)  
       arg0*=0.5;  
       ref=Data(0.5)  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(*)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_update_rank1_float0(self):  
       arg0=Data([1,1])  
       arg0+=0.5  
       ref=Data([1.5,1.5])  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(+)")  
       arg0=Data([1,1])  
       arg0-=0.5;  
       ref=Data([0.5,0.5])  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(-)")  
       arg0=Data([1,1])  
       arg0/=2;  
       ref=Data([0.5,0.5])  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(/)")  
       arg0=Data([1,1])  
       arg0*=0.5;  
       ref=Data([0.5,0.5])  
       self.assertTrue(Lsup(arg0-ref)<=self.RES_TOL*Lsup(ref),"wrong result(*)")  
         
         
         
    def test_add_float_rank0_float_rank0(self):  
       arg0=-1.85774987434  
       arg1=4.45161012244  
       res=add(arg0,arg1)  
       ref=2.59386024809  
       self.assertTrue(isinstance(res,float),"wrong type of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_array_rank0(self):  
       arg0=4.19995915455  
       arg1=numpy.array(4.05252282996)  
       res=add(arg0,arg1)  
       ref=numpy.array(8.25248198451)  
       if not isinstance(res,float):  
          self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
          self.assertEqual(res.shape,(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_array_rank1(self):  
       arg0=-0.789081574676  
       arg1=numpy.array([3.0989284588762782, -3.1117486239932548])  
       res=add(arg0,arg1)  
       ref=numpy.array([2.3098468842001276, -3.9008301986694054])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_array_rank2(self):  
       arg0=4.22980968095  
       arg1=numpy.array([[3.8263049168469063, -3.8107552261242961, -0.95796615082511938, 0.89217770425415566, -1.367568567046141], [-4.589204301639521, -1.8350562314947796, -2.6796711234567594, -1.517018639147719, -4.2515860077769299], [-4.9092386861845885, 1.6349807040932944, -2.8837636918332867, -2.1359802030830366, 1.1877691579576872], [0.64362175988040171, 4.6388736621003481, -4.6187851625380176, -0.19670267515157747, -4.3703403640373848]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[8.0561145978015265, 0.41905445483032411, 3.2718435301295008, 5.1219873852087758, 2.8622411139084791], [-0.3593946206849008, 2.3947534494598406, 1.5501385574978608, 2.7127910418069012, -0.021776326822309677], [-0.6794290052299683, 5.8647903850479146, 1.3460459891213334, 2.0938294778715836, 5.4175788389123074], [4.8734314408350219, 8.8686833430549683, -0.38897548158339745, 4.0331070058030427, -0.14053068308276462]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_array_rank3(self):  
       arg0=-3.53456651889  
       arg1=numpy.array([[[0.87245810664775725, -1.4729436956315931], [3.6218982325488049, -0.1513040114711881]], [[-4.803075549420659, -3.3367420122420577], [0.38976894263068385, -0.74090579708685667]], [[1.7577043473476319, -4.8686481097693255], [2.4278786968981949, 2.7439916415727748]], [[2.5828147603109199, 4.0079889484954307], [2.524821182993823, -2.0178731238106442]], [[2.151779590210027, -1.6354150996023509], [4.9382783295598127, -4.3504386799573149]], [[0.092273497705008367, -4.1474467200211969], [-0.60528749249019143, 1.9950618216367015]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[-2.6621084122403653, -5.0075102145197157], [0.087331713660682375, -3.6858705303593107]], [[-8.3376420683087815, -6.8713085311301807], [-3.1447975762574387, -4.2754723159749792]], [[-1.7768621715404906, -8.4032146286574481], [-1.1066878219899277, -0.79057487731534781]], [[-0.95175175857720262, 0.47342242960730818], [-1.0097453358942996, -5.5524396426987668]], [[-1.3827869286780956, -5.169981618490473], [1.4037118106716902, -7.8850051988454375]], [[-3.4422930211831142, -7.6820132389093194], [-4.139854011378314, -1.539504697251421]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_array_rank4(self):  
       arg0=3.80068783153  
       arg1=numpy.array([[[[1.3978431583839148, 1.9361714942297823, 3.7535362284174631, -2.4337387184773607], [0.5635202106026318, 0.5241409957813481, -3.4140270807067696, -4.0577985422064451], [-2.0363977249490803, -2.3513631626652174, -2.5087195515781522, -3.0669612737249476]], [[4.6317401569348267, -4.1439582154345613, -3.6372822610617805, 4.6787916736384147], [-2.5381953826017636, -2.8933892555674765, -0.0015529869204300439, 3.368719966547113], [-1.54864554787543, -0.26211688245501907, 0.67676437972178505, 0.12480115088498778]]], [[[4.894835715060978, -3.3315078814192765, 1.8436785068574633, 3.4665920947384645], [-3.723024429466204, 4.2365082256016997, 0.72839877670346365, 0.90510572900029551], [-3.2047842373454714, -0.33107722023435482, -3.9336604429996869, 0.65895488106780942]], [[4.6190345897679812, 3.6494961841140832, 2.2829072964851331, 4.7807363050102971], [-1.7472315219470702, -0.42863932143535166, 2.9525380415836278, 2.1875556999155874], [2.3575775491104451, 0.32119760477087844, -0.37696828550394113, -2.6964854519636559]]], [[[4.3982042140790654, 2.3176626766340434, 3.4260859254330853, -2.0671657497831522], [-3.4340980107632046, -0.48771134437134123, 2.8880405802296929, -1.0519636764358919], [-3.2701944375206917, -4.4066273243377907, -3.1497730012828362, -2.1539355246109393]], [[-1.0427009575469182, -4.4421507628283061, 4.6981075789821212, 0.33354438781718088], [-1.7993614761104681, 3.8567553357167359, -2.9189515487035655, 2.2452482328529575], [3.0261417383010603, 2.1481041392277875, -4.4526930233913689, -0.011526918493140137]]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[5.1985309899152865, 5.736859325761154, 7.5542240599488348, 1.366949113054011], [4.3642080421340035, 4.3248288273127198, 0.38666075082460205, -0.25711071067507341], [1.7642901065822914, 1.4493246688661543, 1.2919682799532195, 0.73372655780642404]], [[8.4324279884661983, -0.34327038390318965, 0.16340557046959114, 8.4794795051697864], [1.2624924489296081, 0.90729857596389518, 3.7991348446109416, 7.1694077980784847], [2.2520422836559417, 3.5385709490763526, 4.4774522112531567, 3.9254889824163595]]], [[[8.6955235465923497, 0.46917995011209523, 5.6443663383888349, 7.2672799262698362], [0.077663402065167642, 8.0371960571330714, 4.5290866082348353, 4.7057935605316672], [0.59590359418590033, 3.4696106112970169, -0.13297261146831518, 4.4596427125991811]], [[8.4197224212993529, 7.4501840156454548, 6.0835951280165048, 8.5814241365416688], [2.0534563095843015, 3.37204851009602, 6.7532258731149994, 5.9882435314469591], [6.1582653806418168, 4.1218854363022501, 3.4237195460274306, 1.1042023795677158]]], [[[8.1988920456104371, 6.118350508165415, 7.226773756964457, 1.7335220817482195], [0.36658982076816704, 3.3129764871600305, 6.6887284117610646, 2.7487241550954797], [0.53049339401067996, -0.60593949280641901, 0.65091483024853547, 1.6467523069204324]], [[2.7579868739844535, -0.64146293129693444, 8.4987954105134929, 4.1342322193485526], [2.0013263554209035, 7.6574431672481076, 0.88173628282780614, 6.0459360643843292], [6.8268295698324319, 5.9487919707591592, -0.65200519185999717, 3.7891609130382315]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_constData_rank0(self):  
       arg0=2.35482602484  
       arg1=Data(-1.75764487301,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(0.597181151825,self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_constData_rank1(self):  
       arg0=-4.08948100306  
       arg1=Data(numpy.array([-0.016471342920057808, -0.44847422512511859]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-4.1059523459788441, -4.5379552281839048]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_constData_rank2(self):  
       arg0=-2.56745749608  
       arg1=Data(numpy.array([[-2.3029390682099082, 1.4295953141991617, -0.56084530396881416, -2.8574339203423946, -2.9165894610513474], [2.3619178172931079, 0.86359445821872605, 4.6737388110442577, -1.4370611290572244, 1.5357863607532387], [0.45252277488710213, 2.2443491296499865, 1.0077804345422585, 1.8940556365182557, -0.084761000616873083], [-2.1888602716382231, 2.6468775075702276, -1.3190824924732691, -0.91818098816045168, 0.9617601275468699]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-4.870396564294289, -1.137862181885219, -3.1283028000531949, -5.4248914164267754, -5.4840469571357282], [-0.20553967879127288, -1.7038630378656547, 2.1062813149598769, -4.0045186251416052, -1.0316711353311421], [-2.1149347211972787, -0.32310836643439433, -1.5596770615421223, -0.67340185956612508, -2.6522184967012539], [-4.7563177677226038, 0.079420011485846764, -3.8865399885576499, -3.4856384842448325, -1.6056973685375109]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_constData_rank3(self):  
       arg0=-0.709741937158  
       arg1=Data(numpy.array([[[-0.061249786137445028, -4.8627991904153678], [-1.5999354808136426, -4.8067460897192831]], [[1.0893477333147414, -2.6279269220096579], [2.5218892229740906, -0.67056201455284992]], [[1.7185502503293097, 3.3400238069534858], [0.37738121324869223, -1.2257147190919793]], [[-0.66523522998579576, -2.3320065120603282], [-0.9845840332612088, 4.4499847257165506]], [[0.44211704567061005, -3.6129530518906172], [-4.3886297706270021, -1.373377459230082]], [[-2.8380278520902689, 1.2683977856655773], [3.0303778309363416, -1.5172989776410617]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-0.77099172329565757, -5.5725411275735803], [-2.3096774179718551, -5.5164880268774956]], [[0.3796057961565289, -3.3376688591678705], [1.812147285815878, -1.3803039517110625]], [[1.0088083131710972, 2.6302818697952732], [-0.33236072390952032, -1.9354566562501918]], [[-1.3749771671440083, -3.0417484492185407], [-1.6943259704194213, 3.740242788558338]], [[-0.26762489148760249, -4.3226949890488298], [-5.0983717077852146, -2.0831193963882946]], [[-3.5477697892484814, 0.55865584850736472], [2.3206358937781291, -2.2270409147992742]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_constData_rank4(self):  
       arg0=-4.34128905836  
       arg1=Data(numpy.array([[[[1.0357041081133929, -3.7517458309119367, -2.8947725548960088, 3.0395740583222128], [-2.8360178331578014, 4.2274371889777029, 3.5361632007109822, 2.6627044210714867], [2.2467890175752814, 1.461757496329489, -3.0618202279979787, -0.712590675791132]], [[3.4222196636825881, -4.1390931292808073, 3.9638940058277949, -4.081690756344365], [-4.6458877810031129, 0.75941968973279739, -4.2662221128849884, -0.34362371441538819], [0.53243754491381345, -1.7402345788400164, 0.39104344049589379, -4.6755369588983333]]], [[[-4.644752591725128, -3.3045799322296743, -1.656135180913072, -2.5590928922155176], [-1.1036992125334844, -0.70334792464694207, -1.8871914915830623, -0.75869375904431546], [-3.8201619786584553, 1.6179471249543473, -4.8789114487473864, 4.1084644106649542]], [[-2.0810800622981827, -3.1038195601766483, 4.0632065869562837, 2.9658044349255004], [4.4532595665785486, -3.4204073109291255, 0.77838217419011002, 2.7874885199997177], [0.3000812730739133, -0.10042490155611183, 3.1350652182413103, -3.7146876835951135]]], [[[3.1960547749300758, 2.401371034203386, -0.91651947626425123, 2.8809638561372122], [-0.073128925729001537, -4.4807884812897933, 4.4845487505744472, 1.6523767523700306], [-1.3204206159060119, -0.012579385009651389, -3.7232425291925919, 1.7162055184672234]], [[-0.18456994589283493, -2.60724993891706, -0.017599020742514959, -0.13610558129630768], [-2.9833660051000122, -0.56269798150890438, -2.1174354711901886, 4.7304193703197353], [-1.7697262835667695, -4.9820825514859468, 0.36812906382106902, -3.5720741638533338]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-3.3055849502427641, -8.0930348892680932, -7.2360616132521658, -1.3017150000339441], [-7.1773068915139584, -0.11385186937845404, -0.80512585764517475, -1.6785846372846702], [-2.0945000407808756, -2.8795315620266679, -7.4031092863541357, -5.053879734147289]], [[-0.91906939467356885, -8.4803821876369643, -0.37739505252836203, -8.4229798147005219], [-8.9871768393592699, -3.5818693686233596, -8.6075111712411463, -4.6849127727715452], [-3.8088515134423435, -6.0815236371961738, -3.9502456178602632, -9.0168260172544912]]], [[[-8.986041650081285, -7.6458689905858312, -5.997424239269229, -6.9003819505716741], [-5.4449882708896418, -5.044636983003099, -6.2284805499392188, -5.0999828174004724], [-8.1614510370146114, -2.7233419334018096, -9.2202005071035433, -0.23282464769120281]], [[-6.4223691206543396, -7.4451086185328048, -0.2780824713998733, -1.3754846234306566], [0.11197050822239163, -7.7616963692852821, -3.562906884166047, -1.5538005383564393], [-4.0412077852822437, -4.4417139599122688, -1.2062238401148466, -8.0559767419512696]]], [[[-1.1452342834260811, -1.9399180241527709, -5.2578085346204082, -1.4603252022189448], [-4.4144179840851585, -8.8220775396459494, 0.14325969221829027, -2.6889123059861264], [-5.6617096742621689, -4.3538684433658084, -8.0645315875487498, -2.6250835398889336]], [[-4.5258590042489919, -6.948538997273217, -4.3588880790986719, -4.4773946396524646], [-7.3246550634561691, -4.9039870398650613, -6.4587245295463456, 0.38913031196357828], [-6.1110153419229265, -9.3233716098421038, -3.9731599945350879, -7.9133632222094903]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_expandedData_rank0(self):  
       arg0=1.76311838444  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-3.77226058376)+(1.-msk_arg1)*(0.412008256265)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(-2.00914219932)+(1.-msk_ref)*(2.17512664071)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_expandedData_rank1(self):  
       arg0=-0.504412364386  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([-3.9921533258491984, -4.6259171358901092])+(1.-msk_arg1)*numpy.array([4.0129104531915214, -0.13988376090421895])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-4.4965656902356521, -5.130329500276563])+(1.-msk_ref)*numpy.array([3.5084980888050676, -0.64429612529067271])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_expandedData_rank2(self):  
       arg0=2.17716970217  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[4.8131055362655282, -0.7514838229580505, -0.60033151487952807, -4.4289288135380147, 3.9785741860005306], [-2.6354999257010157, -4.6724232545247792, 1.9155575254103425, 3.7214301524682547, 4.2817101543718508], [-0.43867934697933642, 2.3417991468874053, -0.73276064853387091, 1.1962341396768794, -0.87364010850748208], [2.4575513647025682, 4.15927498681142, 4.9190841426120375, -1.7668155137055663, 4.6883638281449951]])+(1.-msk_arg1)*numpy.array([[3.319813755337309, 3.5237762525812482, -4.2566115213926459, -2.0581671219191322, 2.0848536870423917], [-3.2700592440192566, -0.41291068236184092, 0.59948607238558349, 1.2287223644060772, 0.90426641926430662], [1.6550694393095986, -4.7117674670511516, 4.6655741229383612, -0.70189591885743585, 2.8958959825961541], [4.9675001087382054, 1.5222503737275144, 2.040023207468761, -4.5201869835428488, 3.7182906048687983]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[6.9902752384398221, 1.4256858792162435, 1.5768381872947659, -2.2517591113637208, 6.1557438881748245], [-0.4583302235267217, -2.4952535523504853, 4.0927272275846365, 5.8985998546425487, 6.4588798565461447], [1.7384903551949575, 4.5189688490616993, 1.444409053640423, 3.3734038418511734, 1.3035295936668119], [4.6347210668768621, 6.336444688985714, 7.0962538447863315, 0.41035418846872762, 6.865533530319289]])+(1.-msk_ref)*numpy.array([[5.496983457511603, 5.7009459547555421, -2.0794418192183519, 0.11900258025516175, 4.2620233892166857], [-1.0928895418449627, 1.764259019812453, 2.7766557745598774, 3.4058920665803711, 3.0814361214386006], [3.8322391414838926, -2.5345977648768576, 6.8427438251126551, 1.4752737833168581, 5.0730656847704481], [7.1446698109124993, 3.6994200759018083, 4.2171929096430549, -2.3430172813685548, 5.8954603070430922]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_expandedData_rank3(self):  
       arg0=-3.4277435804  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-2.3667655378960948, -0.040564208830195625], [-4.7398266228075077, -3.2412496716836614]], [[-2.125593021037254, -2.2407941583076854], [2.2372727603914431, -4.2790560801448274]], [[0.68720835205358011, 2.4059893868804307], [-2.4964395423263408, 3.1745348353480622]], [[-4.9075702105934997, -4.9431164153204303], [-0.36043730260638007, 0.42691490242330854]], [[1.4179477912549476, 3.326452959805998], [1.3560731213960029, -0.46102835566925382]], [[3.3782733559655824, 2.090288099439177], [-2.6857999013168654, 1.3585843360631298]]])+(1.-msk_arg1)*numpy.array([[[4.4938161858323067, 1.5931510430370563], [4.696507901895183, 3.8539864360665828]], [[3.4958480064806814, -4.9774435447926155], [-1.1442003125479094, -2.7341070988450089]], [[-2.5968388662322694, 4.6425307414676773], [0.022578761912285472, -1.6818160819470487]], [[-3.6684032758674068, -1.8490089454186887], [-1.3695984802097696, -3.7571783693651764]], [[-4.7345542971273904, 4.0275167708886741], [1.3537075831257699, -2.6886129591653916]], [[2.0970632990006521, -0.84516650168325214], [4.684668775643118, 1.8671292564746604]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-5.7945091183010167, -3.4683077892351175], [-8.1675702032124295, -6.6689932520885833]], [[-5.5533366014421759, -5.6685377387126072], [-1.1904708200134788, -7.7067996605497493]], [[-2.7405352283513418, -1.0217541935244911], [-5.9241831227312627, -0.25320874505685964]], [[-8.3353137909984216, -8.3708599957253522], [-3.788180883011302, -3.0008286779816133]], [[-2.0097957891499743, -0.10129062059892391], [-2.071670459008919, -3.8887719360741757]], [[-0.049470224439339461, -1.3374554809657448], [-6.1135434817217877, -2.0691592443417921]]])+(1.-msk_ref)*numpy.array([[[1.0660726054273848, -1.8345925373678655], [1.2687643214902611, 0.42624285566166087]], [[0.068104426075759505, -8.4051871251975374], [-4.5719438929528309, -6.1618506792499304]], [[-6.0245824466371918, 1.2147871610627554], [-3.4051648184926364, -5.1095596623519706]], [[-7.0961468562723287, -5.2767525258236105], [-4.7973420606146915, -7.1849219497700982]], [[-8.1622978775323123, 0.59977319048375222], [-2.074035997279152, -6.1163565395703134]], [[-1.3306802814042697, -4.272910082088174], [1.2569251952381961, -1.5606143239302614]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_expandedData_rank4(self):  
       arg0=-4.82349391804  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-3.8109549360227235, -1.3578743659797397, -1.5307488465365049, 1.0995740321806471], [-1.8283475037924779, 0.25260880491340476, -1.4429213896834092, 2.3268743622905017], [4.9731871059293962, -2.063416595442801, 1.315376982673615, -3.809855869589418]], [[-4.8902650317303529, -4.7144665236613754, 1.5202146754225367, -1.931518729228785], [-3.8847500473125898, 4.3867702181759043, 1.8940301389418037, 2.4329833823640215], [-1.2082757809402835, -0.83047266047446833, 2.2612219009520551, 4.639906260760263]]], [[[-4.5922406054129619, -3.3090319850155634, -0.81711775519249485, -0.72102149605557209], [2.8051873600354966, -4.9304797325002925, 0.08450373603638095, 4.3824557957977515], [0.432042655953083, 2.1903859731742568, 4.5126338452224974, -1.8218060301476569]], [[2.2493555987865435, -4.1902867199417084, -2.3893780255933041, -4.147052641364497], [-2.1048598086596968, -4.6356381079134588, -4.276799709157685, -3.5315164247719744], [-2.3519110246426687, -1.6614443381712354, 2.9385286009249922, 4.0996351564150917]]], [[[1.7104570918047308, 0.2235597679830974, -3.4917239383453511, 0.87133958814354706], [-0.28810732352935453, 4.6278305539238556, 3.6035025224879966, -2.121177037151647], [-0.56589289362297279, 4.2940943961545059, -2.2108275043603243, -0.37651332795693104]], [[0.6578187034936267, -2.8655996123955427, -2.4907326443067368, -4.7898037053595619], [3.2321208553708622, 2.4831791881685152, 0.95312974395303929, 2.2609801150226314], [-1.7851896770877937, 0.42156063765933371, -1.8379248609183243, 4.2123297453359037]]]])+(1.-msk_arg1)*numpy.array([[[[-4.1321016159626023, -4.8113703944978559, 2.4028239884241085, -3.4302225408424492], [0.90351586424905506, 0.52660889258420962, 4.0435956180305546, -2.6607474227569639], [-0.7832580356081511, -0.33442954239381173, -1.2561360976342097, -2.2350468099654641]], [[1.1250963489572454, -0.87979079585863129, 2.1478695136255412, 4.1105578894489359], [-0.44340244267575279, -2.7961650387130863, -3.2323191921253391, 2.4342529430946094], [3.8445768917161285, -4.9716543799691459, -0.79269017613685744, 4.405102562986853]]], [[[4.5645304913391964, 4.9165683584068702, -3.2829387981742042, -0.53889403485878518], [-0.73921008647266273, 4.0350083353222193, -0.73020558781198819, -0.24064926836505052], [0.16438247300546571, -1.6446268542027909, 2.4503440972397268, -1.1907122824654914]], [[-4.1074300732924591, -0.067858202710286974, -0.028415585086349004, 4.4634408454547181], [4.1841128649341783, 4.1761493395633291, 2.4035029342319492, 3.4393059799507064], [-2.2004044533027267, -3.632821962195024, -2.3980108435935521, 4.5236186873410205]]], [[[2.8644780568283394, 1.659967686466743, 2.7197053129349635, -2.761375672874423], [-1.1773175597763896, 4.6301944373010588, -3.4489909340126945, 4.0249839112076931], [4.4993349080399536, -1.9642384639900801, 3.1916685340315727, -1.7621738983806843]], [[4.7831338763505507, 1.0031396748124122, -4.7052094854052484, -0.14144022568461789], [-4.5702356565627813, -3.0718436491226973, -3.4989330324035461, 2.526069954914564], [-4.6424659831601254, 4.5228542484255421, 3.2984796317107481, -1.1667722423294711]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-8.6344488540610982, -6.1813682840181139, -6.3542427645748791, -3.7239198858577272], [-6.6518414218308521, -4.5708851131249695, -6.2664153077217835, -2.4966195557478725], [0.14969318789102193, -6.8869105134811752, -3.5081169353647592, -8.6333497876277931]], [[-9.713758949768728, -9.5379604416997488, -3.3032792426158375, -6.7550126472671597], [-8.7082439653509631, -0.43672369986246995, -2.9294637790965705, -2.3905105356743528], [-6.0317696989786578, -5.6539665785128426, -2.5622720170863191, -0.18358765727811122]]], [[[-9.4157345234513361, -8.1325259030539385, -5.6406116732308691, -5.5445154140939463], [-2.0183065580028776, -9.7539736505386667, -4.7389901820019933, -0.44103812224062278], [-4.3914512620852912, -2.6331079448641175, -0.3108600728158768, -6.6452999481860306]], [[-2.5741383192518308, -9.0137806379800836, -7.2128719436316784, -8.9705465594028713], [-6.928353726698071, -9.459132025951833, -9.1002936271960593, -8.355010342810349], [-7.1754049426810429, -6.4849382562096096, -1.884965317113382, -0.72385876162328255]]], [[[-3.1130368262336434, -4.5999341500552768, -8.3152178563837253, -3.9521543298948272], [-5.1116012415677288, -0.19566336411451868, -1.2199913955503776, -6.9446709551900216], [-5.389386811661347, -0.5293995218838683, -7.0343214223986985, -5.2000072459953053]], [[-4.1656752145447475, -7.689093530433917, -7.3142265623451106, -9.613297623397937], [-1.591373062667512, -2.340314729869859, -3.870364174085335, -2.5625138030157428], [-6.608683595126168, -4.4019332803790405, -6.6614187789566985, -0.61116417270247059]]]])+(1.-msk_ref)*numpy.array([[[[-8.9555955340009774, -9.6348643125362301, -2.4206699296142657, -8.2537164588808238], [-3.9199780537893192, -4.2968850254541646, -0.77989830000781968, -7.4842413407953376], [-5.6067519536465253, -5.157923460432186, -6.079630015672584, -7.0585407280038384]], [[-3.6983975690811288, -5.7032847138970055, -2.675624404412833, -0.71293602858943839], [-5.266896360714127, -7.6196589567514605, -8.0558131101637134, -2.3892409749437649], [-0.97891702632224575, -9.7951482980075202, -5.6161840941752317, -0.41839135505152125]]], [[[-0.25896342669917782, 0.093074440368495992, -8.1064327162125789, -5.3623879528971594], [-5.562704004511037, -0.78848558271615499, -5.5536995058503624, -5.0641431864034248], [-4.6591114450329085, -6.4681207722411651, -2.3731498207986474, -6.0142062005038657]], [[-8.9309239913308325, -4.8913521207486612, -4.8519095031247232, -0.36005307258365615], [-0.63938105310419591, -0.64734457847504512, -2.4199909838064251, -1.3841879380876678], [-7.023898371341101, -8.4563158802333973, -7.2215047616319268, -0.29987523069735378]]], [[[-1.9590158612100348, -3.1635262315716313, -2.1037886051034107, -7.5848695909127972], [-6.0008114778147643, -0.1932994807373154, -8.2724848520510683, -0.79851000683068118], [-0.32415900999842062, -6.7877323820284543, -1.6318253840068015, -6.5856678164190585]], [[-0.040360041687823589, -3.8203542432259621, -9.5287034034436218, -4.9649341437229921], [-9.3937295746011564, -7.8953375671610715, -8.3224269504419208, -2.2974239631238103], [-9.4659599011984987, -0.30063966961283217, -1.5250142863276261, -5.9902661603678453]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_Symbol_rank0(self):  
       arg0=4.58635587393  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(-4.31091150464)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array(0.275444369289)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_Symbol_rank1(self):  
       arg0=4.4744829082  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([-4.9680064667685464, -4.5511267989231508])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([-0.49352355857036834, -0.076643890724972685])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_Symbol_rank2(self):  
       arg0=-3.07454986574  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[4.1412478820857928, -2.7018642680402891, 3.3256994166022675, 0.52236922109603334, 1.8043946242411835], [-0.78685256991081953, -2.2055711693225066, 3.0058461269182555, -1.953299488338204, -4.2276674176271767], [0.96166936702801831, 1.9994193020553883, 0.48607828085469684, 2.7104735431531477, 3.867059074384473], [1.9476045779265743, 4.7176858648120952, 2.3019157431851802, -2.4668650012062687, -4.5197956265245676]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[1.0666980163485156, -5.7764141337775659, 0.25114955086499036, -2.5521806446412438, -1.2701552414960937], [-3.8614024356480967, -5.2801210350597838, -0.068703738819021698, -5.0278493540754816, -7.3022172833644543], [-2.1128804987092589, -1.0751305636818889, -2.5884715848825803, -0.36407632258412947, 0.79250920864719587], [-1.1269452878107029, 1.643135999074818, -0.77263412255209696, -5.5414148669435459, -7.5943454922618443]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_Symbol_rank3(self):  
       arg0=3.46531781526  
       arg1=Symbol(shape=(6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[-4.3363277001154756, -0.54529380075444678], [1.3226792458865324, 3.1370593530705033]], [[4.128129025541206, 4.6237219562851912], [-3.7545684418668115, 3.002100785453635]], [[4.6204731352838095, 2.4010071532077877], [-1.6875066466758035, -2.9580139131405723]], [[-0.40697800877773993, 1.3156291535055056], [-2.797725893076497, 0.40745980171637353]], [[1.0104155249317532, 0.86837294668118048], [-2.0201519317121508, 1.3816095350849187]], [[-2.7113588826521418, 4.505507148712292], [1.2691632140632816, 2.3427111590423149]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-0.87100988485109809, 2.9200240145099308], [4.7879970611509099, 6.6023771683348809]], [[7.5934468408055835, 8.0890397715495688], [-0.28925062660243395, 6.4674186007180126]], [[8.0857909505481871, 5.8663249684721652], [1.777811168588574, 0.50730390212380527]], [[3.0583398064866376, 4.7809469687698831], [0.66759192218788055, 3.8727776169807511]], [[4.4757333401961308, 4.333690761945558], [1.4451658835522267, 4.8469273503492962]], [[0.75395893261223579, 7.9708249639766695], [4.7344810293276591, 5.8080289743066924]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_float_rank0_Symbol_rank4(self):  
       arg0=4.87448645573  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[4.8231015092065466, -0.8733006783309003, -0.84553967390328033, -2.6798567242803362], [2.9148704683834321, 2.276922490608662, 3.6068468113976415, -3.5955481389072985], [-3.6037339904415622, 1.6660812555497797, 0.15183434474671742, -3.9092222642251375]], [[-1.8325506914193133, 4.9815867978393413, 4.992160061922009, -4.9441017637029034], [-2.8238270749979599, 3.7516923570822147, 1.6240475821251277, -2.5168995609562472], [0.83527019818977788, 1.9084815442266398, -2.4039555678120705, -1.1228799890616772]]], [[[-1.9319677684520387, 3.0039415764432142, 2.1643237641285351, 3.0530576280047725], [-4.3684708166219046, 3.6195065112371516, 2.5199263303335968, 3.0495188889255811], [-0.56723461757061688, -4.0107725795996156, -0.11668341198683851, 1.9526617188813331]], [[2.3363733100504707, 0.052986334566856641, -3.8858316327649431, -1.9542104283766513], [-3.1405596805449756, 0.66354494486993243, -4.8654170889568062, -2.7260594614159848], [3.7841195940298018, 2.2546340560787348, -1.0779187218090849, -4.3073136199076476]]], [[[-2.5326470238674412, 1.9999160620696692, 3.7703940059030092, -4.9639748035653337], [0.9600399338422001, 3.5918472047290386, -3.7318537817438124, 0.51126590078121925], [-0.83768813180396684, -1.4420607470738087, -3.2099905387719563, 3.5942719280820601]], [[-2.0924192973912401, 1.5187396632730827, -1.8822693150129988, -1.9407219860386093], [2.8212923460942365, -2.3307209206797475, -0.18059144514730985, 3.8128688493899006], [-1.4454592948801412, 4.6565764980033002, 4.8523257855612751, 1.8231176092365731]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[9.6975879649394674, 4.0011857774020205, 4.0289467818296405, 2.1946297314525847], [7.7893569241163529, 7.1514089463415829, 8.4813332671305623, 1.2789383168256223], [1.2707524652913587, 6.5405677112827005, 5.0263208004796383, 0.96526419150778331]], [[3.0419357643136076, 9.8560732535722622, 9.8666465176549298, -0.069615307969982609], [2.0506593807349609, 8.6261788128151355, 6.4985340378580485, 2.3575868947766736], [5.7097566539226987, 6.7829679999595607, 2.4705308879208503, 3.7516064666712436]]], [[[2.9425186872808822, 7.8784280321761351, 7.0388102198614559, 7.9275440837376934], [0.50601563911101621, 8.4939929669700724, 7.3944127860665176, 7.9240053446585019], [4.3072518381623039, 0.86371387613330519, 4.7578030437460823, 6.8271481746142539]], [[7.2108597657833915, 4.9274727902997775, 0.98865482296797769, 2.9202760273562696], [1.7339267751879452, 5.5380314006028533, 0.0090693667761145846, 2.1484269943169361], [8.6586060497627226, 7.1291205118116556, 3.796567733923836, 0.56717283582527322]]], [[[2.3418394318654796, 6.87440251780259, 8.64488046163593, -0.089488347832412884], [5.8345263895751209, 8.4663336604619595, 1.1426326739891084, 5.3857523565141401], [4.036798323928954, 3.4324257086591121, 1.6644959169609645, 8.4687583838149809]], [[2.7820671583416807, 6.3932261190060036, 2.9922171407199221, 2.9337644696943115], [7.6957788018271573, 2.5437655350531734, 4.693895010585611, 8.6873553051228214], [3.4290271608527796, 9.531062953736221, 9.726812241294196, 6.6976040649694939]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_float_rank0(self):  
       arg0=numpy.array(2.38317374412)  
       arg1=2.36940652044  
       res=add(arg0,arg1)  
       ref=numpy.array(4.75258026456)  
       if not isinstance(res,float):  
          self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
          self.assertEqual(res.shape,(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_float_rank0(self):  
       arg0=numpy.array([1.6042930994751856, 1.007121679463852])  
       arg1=1.32834203209  
       res=add(arg0,arg1)  
       ref=numpy.array([2.9326351315657506, 2.335463711554417])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_float_rank0(self):  
       arg0=numpy.array([[-3.7532313430987605, 4.5302670575758714, -4.2580362689864639, -1.7120459202168217, -3.5319860499180402], [-1.3288856768048838, -2.3758863669706196, 3.6864682201450591, -3.8052095854722987, -4.9623101490208708], [-4.6001117997329519, -0.73642425828320501, -4.2922113350669644, -4.2102155238932673, 2.9769593503098877], [4.5551705175098558, -2.6992149606809193, 0.98747845345735463, 3.4562881818126261, -2.031282760391222]])  
       arg1=1.85032943598  
       res=add(arg0,arg1)  
       ref=numpy.array([[-1.9029019071191628, 6.3805964935554691, -2.4077068330068663, 0.13828351576277598, -1.6816566139384426], [0.52144375917471386, -0.52555693099102196, 5.5367976561246568, -1.9548801494927011, -3.1119807130412731], [-2.7497823637533543, 1.1139051776963926, -2.4418818990873667, -2.3598860879136696, 4.8272887862894853], [6.4054999534894534, -0.84888552470132161, 2.8378078894369523, 5.3066176177922237, -0.18095332441162437]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_float_rank0(self):  
       arg0=numpy.array([[[1.4910450657310372, 4.0173156155044847], [-1.2708076832213067, 4.3673140853814996]], [[1.690052116553372, -3.1533563655658545], [-0.38018556786379332, -2.6613086083113782]], [[3.0231634649823604, -3.3251144042183487], [3.7026206440395963, 1.1772299869005609]], [[-1.9309449738859086, 2.0076785635424113], [0.1594969257372556, -1.9487263974764444]], [[-1.0363406405435849, -0.66296928909350683], [3.4828811037771423, 1.613443903778057]], [[2.0094990195603737, -4.5677942385151766], [2.6684442004618081, -3.2902212208081916]]])  
       arg1=-0.19805765964  
       res=add(arg0,arg1)  
       ref=numpy.array([[[1.2929874060906634, 3.8192579558641109], [-1.4688653428616805, 4.1692564257411258]], [[1.4919944569129981, -3.3514140252062283], [-0.57824322750416712, -2.859366267951752]], [[2.8251058053419866, -3.5231720638587225], [3.5045629843992225, 0.9791723272601871]], [[-2.1290026335262824, 1.8096209039020374], [-0.038560733903118205, -2.1467840571168182]], [[-1.2343983001839587, -0.86102694873388064], [3.2848234441367685, 1.4153862441376832]], [[1.8114413599199999, -4.7658518981555504], [2.4703865408214343, -3.4882788804485654]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_float_rank0(self):  
       arg0=numpy.array([[[[-4.6318713314440272, 0.32992122843829375, -4.3305065735956436, 0.66214105444459737], [-3.6774863753451239, 1.0048038926583125, 1.5940124503517712, -3.3335913986729295], [-2.5919188359554743, -3.0861565701458673, -0.27381459528204211, -2.3811572641514855]], [[-1.3087211054194348, 1.7502375221859845, 4.7394896808235654, -4.0263876500808928], [-2.5547537047463287, 0.16225810997317147, -3.0299656927454546, -2.020068231740729], [1.4562833182814527, -4.9929460066209197, 3.699792812778032, 4.2431200611001483]]], [[[0.72154828294466355, -1.9665432354872481, 2.9707147097543798, -0.05954393325510754], [-1.2504190901241454, 4.9750395461494641, -1.3861596996758632, 2.4153641408327911], [-4.3958531366669717, 1.2042227750044274, 1.2139633799816689, 0.38908250553922574]], [[1.6398099034499678, 4.1925440278441588, -1.62868396858486, -1.3482997564846624], [1.9275141767965494, -3.2404603042417293, -3.1154214119258681, 4.6245999631097838], [-2.1394990909765244, 3.106417922170003, -2.7957935977788075, 4.1246271568222763]]], [[[0.71355550405330881, 0.47250528402715286, 4.808883901738719, 2.7335995100102251], [-0.29039904918905624, 4.3168244070916355, -4.2995847680604404, -4.440315116333883], [4.0036535017096728, -4.5256899514529225, -3.8202870542297229, 1.2888173873195701]], [[3.8743301316245784, -2.6000803337068135, 4.4704236185911252, -3.3938647638192911], [1.8957700598353959, 3.3173347547763541, -2.0092060146361188, 2.7906778119742608], [-3.1189533989453744, -1.456658173030041, 2.7797291161980819, 4.4307400356790154]]]])  
       arg1=-3.35661382179  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[-7.9884851532337029, -3.026692593351382, -7.6871203953853193, -2.6944727673450783], [-7.0341001971347996, -2.3518099291313632, -1.7626013714379045, -6.6902052204626052], [-5.9485326577451501, -6.442770391935543, -3.6304284170717178, -5.7377710859411613]], [[-4.6653349272091109, -1.6063762996036912, 1.3828758590338897, -7.3830014718705685], [-5.9113675265360044, -3.1943557118165042, -6.3865795145351303, -5.3766820535304047], [-1.900330503508223, -8.3495598284105945, 0.34317899098835625, 0.88650623931047257]]], [[[-2.6350655388450122, -5.3231570572769238, -0.38589911203529592, -3.4161577550447833], [-4.6070329119138211, 1.6184257243597884, -4.7427735214655389, -0.94124968095688466], [-7.7524669584566475, -2.1523910467852483, -2.1426504418080068, -2.96753131625045]], [[-1.7168039183397079, 0.83593020605448309, -4.9852977903745357, -4.7049135782743381], [-1.4290996449931264, -6.597074126031405, -6.4720352337155438, 1.2679861413201081], [-5.4961129127662005, -0.2501958996196727, -6.1524074195684832, 0.76801333503260061]]], [[[-2.6430583177363669, -2.8841085377625229, 1.4522700799490433, -0.62301431177945066], [-3.6470128709787319, 0.9602105853019598, -7.6561985898501161, -7.7969289381235587], [0.64703967991999711, -7.8823037732425982, -7.1769008760193991, -2.0677964344701056]], [[0.51771630983490269, -5.9566941554964892, 1.1138097968014495, -6.7504785856089669], [-1.4608437619542798, -0.039279067013321622, -5.3658198364257945, -0.56593600981541492], [-6.4755672207350496, -4.8132719948197167, -0.57688470559159377, 1.0741262138893397]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_array_rank0(self):  
       arg0=numpy.array(-0.00476703296164)  
       arg1=numpy.array(0.298008631333)  
       res=add(arg0,arg1)  
       ref=numpy.array(0.293241598371)  
       if not isinstance(res,float):  
          self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
          self.assertEqual(res.shape,(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_array_rank0(self):  
       arg0=numpy.array([-4.2490656901064616, -3.6035258027505677])  
       arg1=numpy.array(-4.95703994009)  
       res=add(arg0,arg1)  
       ref=numpy.array([-9.2061056301927309, -8.560565742836836])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_AAAadd_array_rank0_array_rank1(self):  
       arg0=numpy.array(-4.19219670267)  
       arg1=numpy.array([-1.4956124890848423, -1.9457489768254597])  
       res=add(arg0,arg1)  
       ref=numpy.array([-5.6878091917526552, -6.1379456794932725])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_array_rank0(self):  
       arg0=numpy.array([[-1.2073469933316803, -2.5719257887179294, 2.3731574302185461, 2.559107598722397, 4.8120744496147729], [-0.80958434935306745, 1.6509570806468634, -3.1682777066983689, 4.088169114706707, 1.5789451859482329], [1.5798804850179131, -0.71661726542526694, -0.9242175880816097, -2.202474695573593, -1.8614529593729801], [-3.100515079656204, 0.63965392065915516, -2.5805545339083791, 0.37718816203634553, -3.9409679252680996]])  
       arg1=numpy.array(3.52295258272)  
       res=add(arg0,arg1)  
       ref=numpy.array([[2.3156055893896594, 0.95102679400341028, 5.8961100129398858, 6.0820601814437367, 8.3350270323361126], [2.7133682333682723, 5.1739096633682031, 0.35467487602297076, 7.6111216974280467, 5.1018977686695726], [5.1028330677392528, 2.8063353172960728, 2.59873499463973, 1.3204778871477467, 1.6614996233483597], [0.42243750306513572, 4.1626065033804949, 0.94239804881296063, 3.9001407447576852, -0.41801534254675987]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_array_rank2(self):  
       arg0=numpy.array(0.921717560057)  
       arg1=numpy.array([[-2.6376606442722106, -2.5450350461679538, 3.0776063903864124, -1.2182844062274101, 2.1577351811933143], [-1.0500197144789878, 3.1018771810298702, -1.0374330157429759, 2.3802967978005807, -1.6964344556258992], [-2.8198673537061012, -2.202395728503046, -0.5814170546775097, -2.5917367046660491, 3.2960519461552682], [3.8262800364388525, 2.1942741486262136, 0.1267807558110583, 0.57807380916485762, -1.8391694035340644]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[-1.7159430842156609, -1.6233174861114041, 3.9993239504429621, -0.29656684617086038, 3.079452741249864], [-0.12830215442243809, 4.0235947410864199, -0.11571545568642616, 3.3020143578571304, -0.77471689556934953], [-1.8981497936495515, -1.2806781684464963, 0.34030050537904, -1.6700191446094994, 4.2177695062118179], [4.7479975964954022, 3.1159917086827633, 1.048498315867608, 1.4997913692214073, -0.91745184347751474]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_array_rank0(self):  
       arg0=numpy.array([[[-3.2843317895265756, -4.9180086412877646], [-0.65130274904348529, -4.2436854182413359]], [[-4.0664961097086625, 0.60045630744651834], [-1.8617735170547522, -2.2746468059171301]], [[3.4476543376040816, 1.8652721379327044], [-1.1093052324935302, 2.0735612251187181]], [[-1.6825172700066582, -3.186021603713165], [2.1768630501203523, -4.3283170194421441]], [[-0.13336388903442575, -3.0582002583830201], [2.2960378806573338, 1.6371890561810511]], [[-3.0904985408535635, -4.574808248245315], [3.0868496102863361, 0.77465847942717225]]])  
       arg1=numpy.array(4.8896702396)  
       res=add(arg0,arg1)  
       ref=numpy.array([[[1.6053384500747754, -0.028338401686413661], [4.2383674905578657, 0.645984821360015]], [[0.82317412989268846, 5.4901265470478693], [3.0278967225465987, 2.6150234336842209]], [[8.3373245772054325, 6.7549423775340554], [3.7803650071078208, 6.963231464720069]], [[3.2071529695946928, 1.7036486358881859], [7.0665332897217032, 0.56135322015920686]], [[4.7563063505669252, 1.8314699812183308], [7.1857081202586848, 6.5268592957824021]], [[1.7991716987477875, 0.31486199135603599], [7.976519849887687, 5.6643287190285232]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_array_rank3(self):  
       arg0=numpy.array(-1.28150406444)  
       arg1=numpy.array([[[-1.5901370480611146, 4.6165155084884439], [-3.5121102970514082, 4.9430738821348505]], [[2.6504092274269357, -0.65352740450155178], [3.9280418461125315, -0.19076070360867448]], [[1.0588296225372176, 3.9169165624029141], [0.14844011577448235, 0.33505942459659988]], [[0.29007157367791603, -1.8012584802175202], [-3.9765803770039208, -4.6737934555461624]], [[-4.9237884110830787, 3.8840362158609842], [3.3349488661630371, -1.1874616233064641]], [[0.67507275712204606, 3.7545570346174131], [3.4486663014614809, -2.8194124659854323]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[-2.8716411125034185, 3.33501144404614], [-4.7936143614937121, 3.6615698176925466]], [[1.3689051629846318, -1.9350314689438557], [2.6465377816702276, -1.4722647680509784]], [[-0.22267444190508634, 2.6354124979606102], [-1.1330639486678216, -0.94644463984570404]], [[-0.99143249076438789, -3.0827625446598241], [-5.2580844414462247, -5.9552975199884663]], [[-6.2052924755253827, 2.6025321514186803], [2.0534448017207332, -2.468965687748768]], [[-0.60643130732025785, 2.4730529701751092], [2.167162237019177, -4.1009165304277362]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_array_rank0(self):  
       arg0=numpy.array([[[[0.26915919801196875, 4.7218230369143637, 0.025728303253822915, -2.1167001069129299], [-4.5666760046398682, -3.4506421509430374, 1.5590824350213488, -1.7748669413688423], [-1.1634257233823089, 2.3312523994832111, -3.1793983882974617, -0.2608033678460453]], [[-4.2278328955901214, 0.98252352566210099, -3.0727120470665414, 1.6656632962218243], [2.588482426482031, 2.2419545404571872, -4.2414668679059577, 3.9114581908945709], [3.0520617499571685, 0.51610212829791102, 1.7862143219029143, 1.0751396599179248]]], [[[-1.481546222429678, 0.26025799904837665, -2.1825064365298363, 3.1514948421007265], [0.52295579070889087, 4.672713832467398, 1.2357668443116356, 2.7255766039553979], [1.5290869563492215, 3.3341118230249265, 3.9527153268003055, 3.9842988957701628]], [[-4.9259862870156432, 2.4536024285155644, 3.1938115312732123, 4.9835854453082256], [-4.4163596622855703, 0.61545248779144579, -2.0834847650524067, 2.9342171453860368], [1.5710455072679537, 1.4599860070359449, -1.0142749445907184, -1.8777469105637854]]], [[[-1.9250040836312921, 2.4186035985949328, -1.4675920341397952, -2.9369263042079155], [-2.2148606460636824, 2.6910527606967438, 1.7740788985038778, 4.8452550561800738], [3.9690190658724731, -4.7054516494142042, -0.026426570524904491, -0.29849272600142829]], [[-3.2686873374417722, -2.9660615085482025, 1.1279523224212049, -0.16914692689189081], [-0.37483236233949846, 1.9182204864522499, 3.5414572953396721, 4.542192058473244], [-3.0991076731556841, -0.25878813319753924, 3.3703751606677983, 3.5165011039831402]]]])  
       arg1=numpy.array(0.694051607941)  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[0.9632108059526745, 5.4158746448550694, 0.71977991119452867, -1.4226484989722241], [-3.8726243966991625, -2.7565905430023316, 2.2531340429620546, -1.0808153334281365], [-0.46937411544160312, 3.0253040074239168, -2.4853467803567559, 0.43324824009466045]], [[-3.5337812876494157, 1.6765751336028067, -2.3786604391258357, 2.35971490416253], [3.2825340344227367, 2.936006148397893, -3.547415259965252, 4.6055097988352767], [3.7461133578978743, 1.2101537362386168, 2.48026592984362, 1.7691912678586306]]], [[[-0.78749461448897229, 0.9543096069890824, -1.4884548285891306, 3.8455464500414323], [1.2170073986495966, 5.3667654404081038, 1.9298184522523414, 3.4196282118961037], [2.2231385642899273, 4.0281634309656322, 4.6467669347410112, 4.6783505037108686]], [[-4.2319346790749375, 3.1476540364562702, 3.887863139213918, 5.6776370532489313], [-3.7223080543448646, 1.3095040957321515, -1.3894331571117009, 3.6282687533267426], [2.2650971152086594, 2.1540376149766507, -0.32022333665001268, -1.1836953026230796]]], [[[-1.2309524756905863, 3.1126552065356385, -0.77354042619908947, -2.2428746962672097], [-1.5208090381229766, 3.3851043686374496, 2.4681305064445835, 5.5393066641207795], [4.6630706738131789, -4.0114000414734985, 0.66762503741580126, 0.39555888193927746]], [[-2.5746357295010665, -2.2720099006074967, 1.8220039303619107, 0.52490468104881494], [0.31921924560120729, 2.6122720943929556, 4.2355089032803779, 5.2362436664139498], [-2.4050560652149784, 0.43526347474316651, 4.064426768608504, 4.2105527119238459]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_array_rank4(self):  
       arg0=numpy.array(-3.50055541717)  
       arg1=numpy.array([[[[-2.7921233792676881, 1.4518660542252091, -2.5957720416270824, 3.8469184699717971], [1.2561651413954502, 0.62237044380650364, -3.9771251495103446, 2.9006328668683619], [1.8254333604913509, 2.0555687076044276, 1.6865948185269932, -0.90614429975510546]], [[3.3654853061248993, -3.6552470865880746, -0.39173995437403697, 0.83073115192597058], [4.415907728954739, 1.9768512102477818, 0.65921396849240477, -3.3600753837269526], [4.6381460547428883, 3.7627830157940938, -1.7017417399383028, -4.4343460944632387]]], [[[3.3133004217013671, 0.87683971075770728, 1.4309825330623767, 3.5645482919792073], [1.4073075303718428, -1.478758692959393, -1.6604371093540058, -1.9843450208159386], [-3.4528042660171367, 4.1687085596909377, 3.7920459371255433, -4.5893267693698858]], [[-2.1877001826293538, 2.5425541388339941, -3.6139938712114206, -4.9161150905906217], [4.6935060733436202, -1.1385971046149699, -2.3689581494147074, 3.6847378761947791], [-3.0784966371524813, -3.3905314719188584, -1.2157108962925136, -3.5800237322103676]]], [[[1.3880053051070806, 1.642755393083597, -0.28251889773738448, -3.5510542010740096], [4.0211816099264386, -1.2953845856815271, -3.8654722551819445, -4.2229001313485357], [-4.6863789834596892, -2.1806763503075666, -3.6022170445351565, 3.0353160980312772]], [[-0.5068069165760134, 3.7628338599866904, -2.7379708610109632, -1.8285924429714373], [-4.9219909915260862, 2.5903520823976649, -1.327116424654621, 3.3799592191036183], [4.7425359478859583, 4.301895056839431, 3.5841178214520077, -2.212351247576505]]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[-6.2926787964359683, -2.0486893629430707, -6.0963274587953622, 0.34636305280351731], [-2.2443902757728296, -2.8781849733617761, -7.4776805666786244, -0.59992255029991792], [-1.6751220566769289, -1.4449867095638522, -1.8139605986412866, -4.4066997169233852]], [[-0.13507011104338051, -7.1558025037563544, -3.8922953715423168, -2.6698242652423092], [0.91535231178645926, -1.523704206920498, -2.841341448675875, -6.8606308008952324], [1.1375906375746085, 0.26222759862581402, -5.2022971571065826, -7.9349015116315185]]], [[[-0.18725499546691271, -2.6237157064105725, -2.0695728841059031, 0.063992874810927525], [-2.093247886796437, -4.9793141101276728, -5.1609925265222856, -5.4849004379842183], [-6.9533596831854165, 0.66815314252265789, 0.29149051995726349, -8.0898821865381656]], [[-5.6882555997976336, -0.95800127833428572, -7.1145492883797008, -8.4166705077589015], [1.1929506561753405, -4.6391525217832497, -5.8695135665829872, 0.18418245902649932], [-6.5790520543207611, -6.8910868890871377, -4.7162663134607934, -7.0805791493786474]]], [[[-2.1125501120611991, -1.8578000240846828, -3.7830743149056643, -7.0516096182422894], [0.5206261927581588, -4.7959400028498074, -7.3660276723502243, -7.7234555485168155], [-8.186934400627969, -5.6812317674758468, -7.1027724617034362, -0.46523931913700256]], [[-4.0073623337442932, 0.26227844281841062, -6.2385262781792434, -5.3291478601397166], [-8.422546408694366, -0.91020333477061488, -4.8276718418229008, -0.12059619806466149], [1.2419805307176786, 0.80133963967115118, 0.083562404283727965, -5.7129066647447848]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_array_rank1(self):  
       arg0=numpy.array([0.89204258467738828, -4.6241418717807292])  
       arg1=numpy.array([-3.8432158609349876, -2.9712360581677766])  
       res=add(arg0,arg1)  
       ref=numpy.array([-2.9511732762575993, -7.5953779299485058])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_array_rank1(self):  
       arg0=numpy.array([[-3.4310104540531681, -3.4078681636663499], [3.4632430705163877, 3.3617013756585266]])  
       arg1=numpy.array([2.9026457109358228, -4.0769726819144818])  
       res=add(arg0,arg1)  
       ref=numpy.array([[-0.52836474311734527, -0.50522245273052713], [-0.61372961139809412, -0.71527130625595525]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_array_rank2(self):  
       arg0=numpy.array([-0.81718210838440974, -1.4685466577903714])  
       arg1=numpy.array([[2.1943352629319204, 4.6430102156284399], [-1.9195597281529677, -2.8719384327168909]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[1.3771531545475106, 3.8258281072440301], [-3.3881063859433391, -4.3404850905072623]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_array_rank1(self):  
       arg0=numpy.array([[[4.8480791661411846, -3.3139745022267677, 0.23075402943809387, 1.1460077243120201, 0.5430057803744992], [3.1966458427396578, -2.3099355752149684, -0.80993398761333601, 2.7377783492166818, -0.52642531146664595], [-2.3405623436273215, -4.6986809091986279, -4.5327719148713417, 1.0842206169324182, -1.3827159954219015], [-4.3314886100620251, 1.5439450020197185, -4.4576280346485646, -4.9473020620086841, -4.2100166474002618]], [[-0.64634838603928735, 1.6158881982668651, 3.2016038443099966, -4.6130610189609325, 3.3248292761667422], [-3.785156541201331, -2.5117751782092599, 4.8863625851326802, -4.1428745488986971, -1.0411200162174583], [2.1152254516342435, -1.455760072996922, 4.3665108820706671, 0.96848281645678469, 2.976394418880024], [-2.5254720531206565, 1.1119630787341013, 3.9988823099750075, 2.5472116254180266, 3.9352959539153396]]])  
       arg1=numpy.array([2.9504404931533941, -1.0523978626173935])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[7.7985196592945787, -0.36353400907337363, 3.1811945225914879, 4.0964482174654142, 3.4934462735278933], [6.1470863358930519, 0.64050491793842568, 2.1405065055400581, 5.6882188423700759, 2.4240151816867481], [0.60987814952607255, -1.7482404160452338, -1.5823314217179476, 4.0346611100858123, 1.5677244977314926], [-1.3810481169086311, 4.4943854951731126, -1.5071875414951705, -1.99686156885529, -1.2595761542468678]], [[-1.6987462486566809, 0.5634903356494716, 2.149205981692603, -5.665458881578326, 2.2724314135493486], [-4.837554403818725, -3.5641730408266534, 3.8339647225152866, -5.1952724115160906, -2.0935178788348519], [1.0628275890168499, -2.5081579356143155, 3.3141130194532735, -0.083915046160608853, 1.9239965562626304], [-3.57786991573805, 0.059565216116707731, 2.9464844473576139, 1.4948137628006331, 2.8828980912979461]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_array_rank3(self):  
       arg0=numpy.array([-2.2898564034696278, 4.4193876348458776])  
       arg1=numpy.array([[[1.3836448504950072, -1.2771567592674593, 0.99788358778879171, 4.0786129679533776, -2.418218626164589], [-4.1121013524402699, 0.46073007670794297, -1.6092950263915906, -1.0395441999201251, 4.2514484711087128], [2.192601754127236, -2.502892404580852, -2.6246331317839964, -4.7307392472393541, -2.75755102649231], [2.8350887708088042, 4.1435832734055627, -3.7452714656379174, -2.7760560469485429, -1.8766780930815852]], [[0.79300550194821717, 3.5500186866035826, 1.0620719781151697, -0.037605509149448935, -3.5097961357443683], [2.8069464999288982, 2.8516484824169144, -3.3431131243591992, 3.969787882211925, -0.70258592577141243], [-0.34354835337907019, -3.2843292735063825, 3.9198809886387984, 3.6019806857498882, -4.9849759940480904], [-4.9051958979035124, 3.3661470525649886, 2.3115462478411875, 2.6808046361223825, -2.340331435874111]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[-0.90621155297462064, -3.5670131627370871, -1.2919728156808361, 1.7887565644837498, -4.7080750296342169], [-6.4019577559098977, -1.8291263267616849, -3.8991514298612184, -3.329400603389753, 1.961592067639085], [-0.097254649342391808, -4.7927488080504794, -4.9144895352536242, -7.0205956507089819, -5.0474074299619378], [0.54523236733917635, 1.8537268699359348, -6.0351278691075452, -5.0659124504181712, -4.166534496551213]], [[5.2123931367940948, 7.9694063214494602, 5.4814596129610473, 4.3817821256964287, 0.90959149910150927], [7.2263341347747758, 7.271036117262792, 1.0762745104866784, 8.3891755170578026, 3.7168017090744652], [4.0758392814668074, 1.1350583613394951, 8.339268623484676, 8.0213683205957658, -0.56558835920221284], [-0.4858082630576348, 7.7855346874108662, 6.7309338826870651, 7.1001922709682601, 2.0790561989717666]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_array_rank1(self):  
       arg0=numpy.array([[[[2.5103936566467668, -2.0390924910031338], [-2.1993452176878217, -0.34621614679682722]], [[-0.84514184021590744, 2.2740635493242785], [2.3783255651985371, 4.2061153353864604]], [[3.0226777401952134, 4.9022654560108556], [-0.87127978081883217, 2.2207059675799812]], [[2.6594602581843461, 4.6334712039864332], [2.1325620938727363, -4.0374969618148402]], [[-2.8668751868999562, 4.0512245963673479], [-0.13429656719510952, -3.0467988996922224]], [[-1.9167653590702285, -3.6416881564872297], [1.8147889611585653, -4.0915719127677601]]], [[[3.9280800303689887, 1.3496085240856353], [0.31038197427590308, 4.1641255475919561]], [[-2.9583427988061017, -4.3981765750537694], [-1.2693582533257963, 0.99005843926215675]], [[3.9624587605520372, -4.2817248602011855], [-1.2628416077771853, 4.3535767653713044]], [[-1.4949476331978695, 0.24311931631928907], [-3.6896773793773683, -4.2492218443129719]], [[0.59237224656472076, -4.003962799627045], [1.4188257014470738, 2.336164948449019]], [[-1.7007659405846534, 4.6697746346927698], [0.25130711141437256, -0.88866717142117135]]]])  
       arg1=numpy.array([0.10797743018794215, 0.33402842836277635])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[2.618371086834709, -1.9311150608151917], [-2.0913677874998795, -0.23823871660888507]], [[-0.73716441002796529, 2.3820409795122206], [2.4863029953864793, 4.3140927655744026]], [[3.1306551703831555, 5.0102428861987978], [-0.76330235063089003, 2.3286833977679233]], [[2.7674376883722882, 4.7414486341743753], [2.2405395240606785, -3.929519531626898]], [[-2.7588977567120141, 4.15920202655529], [-0.02631913700716737, -2.9388214695042802]], [[-1.8087879288822863, -3.5337107262992875], [1.9227663913465074, -3.983594482579818]]], [[[4.262108458731765, 1.6836369524484116], [0.64441040263867944, 4.4981539759547324]], [[-2.6243143704433254, -4.064148146690993], [-0.93532982496301997, 1.3240868676249331]], [[4.2964871889148135, -3.9476964318384091], [-0.928813179414409, 4.6876051937340808]], [[-1.1609192048350931, 0.57714774468206542], [-3.3556489510145919, -3.9151934159501955]], [[0.92640067492749711, -3.6699343712642687], [1.7528541298098501, 2.6701933768117954]], [[-1.366737512221877, 5.0038030630555461], [0.58533553977714892, -0.554638743058395]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_array_rank4(self):  
       arg0=numpy.array([3.7518071356804903, -1.9041790140670067])  
       arg1=numpy.array([[[[-3.2728960625368533, -4.182975470946273], [0.50166107416151107, 1.9033756836243274]], [[-3.2818478146658103, -3.9612056433096132], [-1.6404990573785949, -1.4847107044277044]], [[-2.0558251600164024, -1.9052003868539327], [0.94295735376089418, -3.3755553862364995]], [[0.60535597726572821, -0.97580839450195533], [-0.28708633414262508, -1.542866243623795]], [[2.0312466148739716, -4.7206948220643348], [3.1162114064636448, 4.5032953474655955]], [[-1.1431940395194138, 0.060787170786806399], [0.30951226009041211, 0.89525908663356901]]], [[[4.2507806949460392, -3.4579965072722496], [2.0742526817133591, 4.8811003135629321]], [[0.56997803531888991, 0.78411016871976713], [0.48784369788951665, -1.8617012977648741]], [[3.0991254241361386, 0.11164154885224153], [3.6547124010490037, 1.6186370725000288]], [[4.7711681541482278, 1.4231043259148111], [-2.7007887058400026, 0.78876530217467344]], [[-0.91127101210405037, -0.58692331099470429], [-0.89256321606332989, -2.5196431582091239]], [[1.6181038941534549, 1.83026267412958], [2.8825122810413726, 1.8161724244498334]]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[0.47891107314363701, -0.43116833526578269], [4.2534682098420014, 5.6551828193048177]], [[0.46995932101467996, -0.20939850762912293], [2.1113080783018954, 2.2670964312527859]], [[1.6959819756640879, 1.8466067488265576], [4.6947644894413845, 0.37625174944399076]], [[4.3571631129462185, 2.775998741178535], [3.4647208015378652, 2.2089408920566953]], [[5.7830537505544619, -0.96888768638384448], [6.8680185421441351, 8.2551024831460857]], [[2.6086130961610765, 3.8125943064672967], [4.0613193957709024, 4.6470662223140593]]], [[[2.3466016808790324, -5.3621755213392568], [0.17007366764635234, 2.9769212994959253]], [[-1.3342009787481168, -1.1200688453472396], [-1.4163353161774901, -3.7658803118318809]], [[1.1949464100691318, -1.7925374652147652], [1.750533386981997, -0.28554194156697799]], [[2.8669891400812211, -0.48107468815219567], [-4.6049677199070089, -1.1154137118923333]], [[-2.8154500261710571, -2.491102325061711], [-2.7967422301303366, -4.4238221722761306]], [[-0.28607511991355183, -0.073916339937426745], [0.97833326697436584, -0.088006589617173336]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_array_rank2(self):  
       arg0=numpy.array([[-2.3932536057761733, 4.6044945009204756, 1.2999081070423539, -1.9592981433763956, 3.1646707378213481], [0.44074283211048382, 2.8140818237553411, 1.9533041067253789, 0.50594992425220475, -1.6329078312134113], [2.032167266226832, -3.1383228895803117, -3.4785914234267032, -2.6654509176332919, 1.1901692816981324], [-3.6728166346815261, -0.65516651098922818, 3.1900000481748094, 2.542120532552536, 2.8679967416023375]])  
       arg1=numpy.array([[-3.8909305291257779, -1.8158618973461849, 4.7848218549372241, -4.4671585130773606, -3.7549945863186651], [-3.8595154057683678, 2.9370390337334031, -4.057756827572609, 3.6365495098807195, 3.6830760746398994], [-0.0079678139186034613, -1.0881170586162936, 0.43969247086615937, -1.1742947139199322, -0.21032239984684509], [3.4659017294010486, -3.0657575595410802, 4.8147426787990515, -3.7537774017847605, 1.1761183793296928]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[-6.2841841349019507, 2.7886326035742908, 6.0847299619795781, -6.4264566564537562, -0.59032384849731701], [-3.418772573657884, 5.7511208574887442, -2.1044527208472301, 4.1424994341329242, 2.0501682434264881], [2.0241994523082285, -4.2264399481966048, -3.0388989525605439, -3.8397456315532241, 0.97984688185128732], [-0.20691490528047751, -3.7209240705303084, 8.0047427269738609, -1.2116568692322245, 4.0441151209320303]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_array_rank2(self):  
       arg0=numpy.array([[[4.1175075159634247, 4.542167990108247], [0.19284380691997693, 3.0418399376068663], [1.1050408430711078, 0.41000056238432947], [3.8729434050398446, -4.3384428977277594], [1.4222030700165389, -3.4399298490028229]], [[-2.2891903651668066, -2.1598983658210491], [1.5520532076385578, 2.5255643449641161], [0.74223566849527156, -1.4055358511777403], [-0.25810909593639764, -1.1190540165460936], [-3.3580605136110755, 0.67182373083657243]], [[3.8761498320230903, 3.371979323190974], [-4.014381901748191, 2.9579498604360062], [0.63646979068009202, 4.3798700981207688], [0.15540201599420289, -2.4676594378473196], [1.7561044589929029, -0.56767801291649]], [[-1.1517304856208965, 3.3880304374066625], [4.92750601712698, 3.5166773877344255], [-3.0281395328985603, 0.93511927080632606], [-2.95617861025534, 0.88412573887346557], [-0.17936364232855073, 0.39782122018110755]]])  
       arg1=numpy.array([[-0.11789777831407644, -2.2368626498282707, 1.0721412206455447, 2.7605271523683008, 1.521664133467552], [-2.0018876329299875, 1.7387958322649713, 4.3738825199665481, 3.3714013349220888, 2.5862112533881305], [-1.9667173744001798, 0.154122093956234, -1.5963229066842901, 4.2650913886356996, -2.1389528806427069], [-3.0883128948751901, 0.57342823614888161, 4.8828887394666989, -3.3314671084784484, 4.4112181735812364]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[3.9996097376493482, 4.4242702117941706], [-2.0440188429082937, 0.80497728777859567], [2.1771820637166526, 1.4821417830298742], [6.6334705574081454, -1.5779157453594586], [2.9438672034840909, -1.9182657155352709]], [[-4.2910779980967941, -4.1617859987510366], [3.2908490399035291, 4.2643601772290873], [5.1161181884618196, 2.9683466687888078], [3.1132922389856912, 2.2523473183759952], [-0.77184926022294498, 3.2580349842247029]], [[1.9094324576229105, 1.4052619487907942], [-3.860259807791957, 3.1120719543922402], [-0.95985311600419809, 2.7835471914364787], [4.4204934046299025, 1.79743195078838], [-0.38284842164980404, -2.7066308935591969]], [[-4.2400433804960862, 0.29971754253147243], [5.5009342532758616, 4.0901056238833071], [1.8547492065681386, 5.8180080102730249], [-6.2876457187337884, -2.4473413696049828], [4.2318545312526856, 4.8090393937623439]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_array_rank3(self):  
       arg0=numpy.array([[1.5754164222679758, -2.5122850182046674, 3.7779621086136661, -4.8053171835989321, -1.8659105173687864], [0.74145530968957019, -2.380638358943715, 2.9186380590656515, 3.1143007502074109, -3.7619303773107458], [0.47725716770278659, 3.9883347825124833, 4.9592569646862774, 4.3261705099006349, 4.213223331194806], [-0.99918609600999719, -4.1864682183757012, 0.19682361200920617, -3.0549648809563621, -2.0833464414596192]])  
       arg1=numpy.array([[[-3.1274742010681278, 4.4896862365691472], [-4.6080048930411905, -3.9170007056111631], [0.97431443901890802, -1.7912163693057472], [4.68680758237719, -0.92222761160976319], [2.9836463018379789, -2.1477362451632187]], [[-2.6730769359730977, 0.84442355341361619], [-4.8773294913408014, 2.4352659218511814], [-0.41172410237021495, -3.7554415716316791], [-2.1298934504786726, 1.8495051558421611], [2.7410046648788891, -0.87862956021926486]], [[0.36895914751083314, -1.7908748859480328], [-2.4713730134184067, 0.63921733010383797], [-1.4316215625115767, -1.4768578828908496], [0.86714361007569707, -1.111604239323094], [3.9851026118490527, 0.61519171679510443]], [[-1.3655194293849879, 2.1562280008039769], [1.6237025360956157, 2.2428800384139569], [-0.46462599420193929, -1.7382655960688389], [-4.7644473307255053, -2.6923244448857107], [-0.2798800027031545, 1.8777029637677565]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[-1.5520577788001519, 6.0651026588371231], [-7.120289911245858, -6.4292857238158305], [4.7522765476325741, 1.9867457393079189], [-0.11850960122174214, -5.7275447952086953], [1.1177357844691924, -4.0136467625320051]], [[-1.9316216262835275, 1.5858788631031864], [-7.2579678502845164, 0.054627562907466398], [2.5069139566954366, -0.83680351256602759], [0.98440729972873831, 4.9638059060495721], [-1.0209257124318567, -4.6405599375300106]], [[0.84621631521361973, -1.3136177182452462], [1.5169617690940767, 4.6275521126163213], [3.5276354021747007, 3.4823990817954278], [5.193314119976332, 3.2145662705775409], [8.1983259430438586, 4.8284150479899104]], [[-2.3647055253949851, 1.1570419047939797], [-2.5627656822800855, -1.9435881799617443], [-0.26780238219273311, -1.5414419840596327], [-7.8194122116818674, -5.7472893258420727], [-2.3632264441627737, -0.20564347769186275]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_array_rank2(self):  
       arg0=numpy.array([[[[-2.5046461689953903, -4.2244632383820102, -0.44723640804478126, 1.3998577615833803, 2.155746113856738], [-2.508276712143811, 4.2277819225053221, 0.60909994492729158, -2.6804491084216222, -4.9095874380789928], [0.74975630368198587, 3.6335900081332966, 1.3712615132026613, -2.8980820615440828, 2.2425760596786768], [-4.1079301196631226, -3.2093856313996802, -0.68731677342682573, 4.9764221748634778, 3.3563398761528838]], [[1.3129674663897282, 1.659104839627517, -2.6850117116704886, -0.28459698262047084, -3.9795511646822659], [4.9525903835483476, 1.7537063342619792, 1.5927053731413219, 0.39549172142929656, -4.7164304776388093], [2.523735720249082, 2.9467727799175911, 2.8723921003088551, -1.9352713309149561, -4.3150251208191168], [-1.2039703622958999, -0.84341441276691143, 2.5003719104538122, 0.55132588338546373, -0.92752708006642948]], [[-3.1018884373860836, 2.5489263704136018, 0.45416957021377957, 3.5099059943951687, 0.23872479658090828], [1.822709430369307, 1.7526109408276618, -0.46892156505811222, -4.1875932384122034, 1.9929089326436831], [-2.2652626627443553, -0.067063747500943904, -3.0410537440184218, -0.21360064073601048, 3.056142904815971], [1.4863397231698086, -2.5844494922934604, -0.18422928115497506, 4.933016947023253, 2.7544214182995832]], [[-2.4847830871570933, 3.5026959846750838, -3.5320768072732855, -1.7468192409379348, 4.8681480184851527], [3.4923242468946754, -3.2877365267507641, 4.1785084439837092, -4.4829715414771751, 0.35709129013571062], [-0.79773065573400714, -2.250304422919005, -2.0053393896242069, 0.23748449225979229, -1.1125258801075102], [-2.3715897629926417, -2.1388188126213903, 3.5858579671993382, -0.84038613848794519, -1.4354025678503159]], [[-3.2822113106664363, -0.13946122765855584, -2.7715850830573774, -2.0356895021517962, 2.0937754417481962], [3.7563823289770362, -2.0824275284824378, 4.2067400277325557, -3.9016016096824311, 0.17638738576000712], [4.8017902112210571, 1.92203919975735, -2.8893815775499156, -4.479413951418918, -0.55313927407352548], [-3.8761366567748787, -3.5396748187666982, -1.0850578182213386, 2.7857774453125996, 4.1788740765489187]]], [[[-1.9651382428352737, 4.8616489057900871, -0.43172513252083, -0.054859737031574873, -3.5460081800863499], [-4.810310812183678, 1.8207261716815388, -4.3223015938437017, 1.800839870029959, -2.2203603834124754], [3.565423638137295, 0.027824082459369848, -1.7836518092622877, -3.3258321999379681, 3.163457929000284], [-4.0052109881853406, -1.8148065222834298, 0.82215134704610282, 2.0193418039296462, 4.4471214980901177]], [[-2.8657059084201206, -2.3329499171320234, -2.2162961082830934, -4.8079117409277652, -2.197700947170361], [3.9715032123302638, 0.65999945078663913, 4.1588184818858913, -0.18755039575474175, 1.1354055022396237], [1.255487142958696, 3.1430236673767293, -2.1154988428417774, 3.0966701219915311, 4.3141393239523538], [-4.8817176883361775, 1.4600917371891615, 3.7487872365665975, -1.474314785809109, -4.2810653238151817]], [[-1.8231488954160158, -3.4814582839201034, 4.3885470815806986, -3.1970505743690323, -3.0658393815483653], [3.9247734660693734, -3.1793025189906166, -2.9237785337276612, -1.7240558515060345, -1.6817771153357008], [-3.888049614859499, 1.256416323201214, -1.7072992866185066, -0.58728091758395529, -4.6273047847960243], [2.367471620618268, 0.015018822799611087, -0.29060233151567516, 2.7957927875993116, -1.2703809614085335]], [[2.0555646534644678, -4.0824306185884076, -4.8327824602961291, -4.193455466679251, 0.80041064274131468], [-3.6646017876054318, 4.2540720928232041, -4.9703392037974892, -0.23928754654725548, 4.5828900717319083], [2.0304054011722954, -1.9727377879258667, 3.8533547747417565, -0.31921572896113215, -3.6275514939627773], [-4.5876717083999328, -0.017435221331201234, 2.0983134776536847, -1.2284916351829422, 4.1201597597518997]], [[3.9196394768490759, 4.9483270712052523, 4.423804818263612, 3.1975456400713167, 0.33426198637637494], [-2.4126015697079737, -1.3088448034883235, 4.9672641665700539, -2.7158551936396078, -0.76963649748323704], [2.4722783151214642, -0.3876458860667249, -1.6511204499442123, 4.1303250551320545, 0.9326495794030274], [3.3365736689270911, -2.517166846685762, 0.44906256710072778, -3.0373755159107141, -2.9303083956282228]]], [[[-4.3431662378354075, 2.539726773369023, 0.99280761534602568, -1.9255269883547435, -0.942727820741041], [-4.1906786823303275, -1.5795032340549744, 0.48073473127577682, 3.5941149454360843, -2.4617986342690923], [-1.7960257166064952, -1.4683147789759197, -0.27592876729811611, -3.0479691744265534, 4.1434875654704371], [-2.4694107325654899, -0.46694580675032782, -0.6312593190743776, -1.7644052849665193, -4.805487215552894]], [[2.4952363068057162, -4.2777524942321774, -3.514135851850698, 2.0251657196993431, 2.4287383907419589], [4.889568072257843, 3.9646414408752779, 2.7386990517708814, 4.6330716454066572, -2.2665108603911222], [-1.3416627285528615, -2.5377970468857503, 4.9447471742763103, 3.2433766620515438, -0.6189768011583876], [-0.28975918906883003, -0.16228377405352212, -2.2948398623911381, 0.35144736248781605, 1.7226694984576145]], [[-3.4623650092900062, -0.30920689303172733, -1.0786564545020241, -2.6213912883593826, -1.1921363280439348], [3.0482365564059783, -3.5867167982048054, 3.0671305985542485, -3.0463998211846697, -3.9376960536638848], [-1.1035079645712531, 4.1753410446853039, 4.3594794744424235, -4.5334021430069837, 1.5831648775871354], [-1.4665161865408418, -4.6241804083435181, -2.315925746483888, 0.42030641056100926, 3.4847920080173935]], [[0.95235423546563869, -3.9699986182355653, -3.3274941572181027, 2.5903943358283819, 1.1765259704473454], [0.75888780465270234, -4.1932042190534133, 0.70486414759477345, -0.62140463664983514, -1.2231194370797671], [3.7477215639862589, -4.2055889444542158, -3.1020409322238942, -0.68787830569812503, -0.46918980188225579], [4.4869097091540624, -1.2525021567272021, -2.1240312706522548, -4.2821221163563807, -0.70107303250834541]], [[2.4162623822794806, -0.73444331564069909, -1.5348011309226806, 2.0567342577268501, 4.8545025901058843], [-0.19331776405546197, 4.7283805410468496, -3.2375041502972204, 4.1591274218828467, 2.0825776580889723], [0.63191672076259486, -3.7385876363932748, -1.221832347010511, 4.0203887599549049, 0.82615965684098658], [-0.63897976149787894, -4.4624601894426261, 3.5928829259431954, 4.2083882710744689, -4.3247202178196975]]], [[[1.4228522934434906, 0.83110992155134067, -4.4503562920839359, -2.2601364529178838, -3.6643418532582963], [4.6761152839532212, -4.6536747983764517, 4.7158568110217232, -0.64622454680247188, 4.7054421295158679], [-4.3563300968027372, -0.37572079474052078, 2.1095019827661137, -2.545000196840749, 2.4277640414926207], [1.0527463392923178, 0.0047664586261797481, -1.6463238063161101, 1.0680524780654537, 2.2789934989529739]], [[3.1873879837728722, -4.727986513740559, 0.61925766979179198, 4.5387943081272084, -0.78462043193908926], [4.4821895186421763, -0.28680370469972161, -1.5535411363580165, -4.5521096647127326, -0.40626583141160921], [2.6194953404182009, -2.2881015723111755, -3.6612468100878215, 3.1623230810972043, -1.6830059633963956], [-4.6775773276507167, 3.7764648932906315, -3.3753223497614782, 4.708910124308332, -2.1537135004667487]], [[4.8158388485023025, 3.769593211478611, 0.065618812245730851, 4.4976556902119658, -2.2633031326963247], [-4.417295428567928, -2.3865943978852044, -1.633093481140441, 4.434975177416959, 1.4712910457977149], [4.073342194177064, 0.75395449351767763, 4.2431780655648907, 3.7079870633727374, 3.6092901491239022], [4.2832915796380906, -3.7511243406555095, 1.7863322393372609, -4.6883062726082301, 1.3643638533069771]], [[0.36619692998106945, -3.036742747198975, -2.9247432830413853, 1.0342886367741144, 2.8648250740561396], [3.128894426392602, -4.5947230267564452, -1.3577251801838655, 1.0244775401185757, 4.8860090210932299], [4.9489864309786462, -1.3877587203205142, 4.0659219734030607, 2.2187513948686677, -4.2979254917176233], [-1.7725791596616691, 1.244244693400006, -2.5758532954575974, -0.10299520609133239, 3.7741245426998908]], [[-0.75837447420683723, -0.19251739642004928, -1.4186453602426328, 4.6907726733294375, 3.5188772030276532], [3.2381148575477301, 2.5706485604029297, 4.9698764055856994, -0.10260633371904948, 0.64546397346189011], [-1.2377836524122712, 0.16839646874719882, 3.1642248496334417, 0.47992683064039721, -4.0951556783875773], [-0.51375573418917675, 0.31966893917731909, 4.292842409284793, -2.9934553339927037, 0.34048534129331376]]]])  
       arg1=numpy.array([[-1.0906768054337936, -2.82761557168139, -2.1760186426021253, 3.6478506437752483, 0.24771354302712822], [-0.1889216392349411, 3.2270364688774951, -2.5623126148961237, -4.7246130377995543, 3.5364402640962052], [-1.4805507113197214, 0.93657904616790688, -1.3799205358396138, 4.1524254757674974, -4.1553290886582026], [0.39685970402536697, 2.3835254424075023, 1.2425962718187131, -2.793849174408586, 3.6313349551159284]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[-3.5953229744291839, -5.3151400438158038, -1.5379132134785749, 0.30918095614958663, 1.0650693084229443], [-3.5989535175776046, 3.1371051170715285, -0.48157686050650206, -3.7711259138554158, -6.0002642435127864], [-0.34092050175180777, 2.5429132026995029, 0.28058470776886768, -3.9887588669778764, 1.1518992542448832], [-5.1986069250969162, -4.3000624368334739, -1.7779935788606194, 3.8857453694296842, 2.2656630707190901]], [[-1.5146481052916618, -1.168510732053873, -5.512627283351879, -3.1122125543018608, -6.8071667363636559], [2.1249748118669576, -1.0739092374194108, -1.2349101985400681, -2.4321238502520934, -7.5440460493201993], [-0.303879851432308, 0.11915720823620113, 0.044776528627465062, -4.7628869025963461, -7.1426406925005068], [-4.0315859339772899, -3.6710299844483014, -0.32724366122757775, -2.2762896882959263, -3.7551426517478195]], [[-5.2779070799882088, 0.37290772781147652, -1.7218490723883457, 1.3338873517930434, -1.937293846021217], [-0.3533092122328183, -0.42340770177446352, -2.6449402076602375, -6.3636118810143287, -0.18310970995844222], [-4.4412813053464806, -2.2430823901030692, -5.2170723866205471, -2.3896192833381358, 0.88012426221384565], [-0.68967891943231674, -4.7604681348955857, -2.3602479237571004, 2.7569983044211277, 0.5784027756974579]], [[1.163067556618155, 7.1505466284503321, 0.11577383650196271, 1.9010314028373134, 8.5159986622604009], [7.1401748906699236, 0.36011411702448415, 7.8263590877589575, -0.83512089770192688, 4.0049419339109589], [2.8501199880412411, 1.3975462208562432, 1.6425112541510414, 3.8853351360350405, 2.5353247636677381], [1.2762608807826066, 1.509031831153858, 7.2337086109745865, 2.8074645052873031, 2.2124480759249323]], [[-3.0344977676393081, 0.10825231536857238, -2.5238715400302492, -1.787975959124668, 2.3414889847753244], [4.0040958720041644, -1.8347139854553096, 4.454453570759684, -3.6538880666553029, 0.42410092878713535], [5.0495037542481853, 2.1697527427844783, -2.6416680345227874, -4.2317004083917897, -0.30542573104639725], [-3.6284231137477505, -3.29196127573957, -0.8373442751942104, 3.0334909883397279, 4.426587619576047]]], [[[-2.1540598820702148, 4.672727266555146, -0.6206467717557711, -0.24378137626651597, -3.734929819321291], [-4.999232451418619, 1.6318045324465977, -4.5112232330786428, 1.6119182307950179, -2.4092820226474165], [3.3765019989023539, -0.16109755677557125, -1.9725734484972288, -3.5147538391729092, 2.9745362897653429], [-4.1941326274202817, -2.0037281615183709, 0.63322970781116172, 1.8304201646947051, 4.2581998588551766]], [[0.36133056045737444, 0.89408655174547169, 1.0107403605944016, -1.5808752720502701, 1.029335521707134], [7.1985396812077589, 3.8870359196641342, 7.3858549507633864, 3.0394860731227533, 4.3624419711171187], [4.4825236118361911, 6.3700601362542244, 1.1115376260357177, 6.3237065908690262, 7.5411757928298488], [-1.6546812194586824, 4.6871282060666566, 6.9758237054440926, 1.752721683068386, -1.0540288549376866]], [[-4.3854615103121395, -6.0437708988162271, 1.8262344666845749, -5.759363189265156, -5.6281519964444886], [1.3624608511732497, -5.7416151338867403, -5.4860911486237853, -4.2863684664021582, -4.2440897302318241], [-6.4503622297556227, -1.3058962916949097, -4.2696119015146303, -3.149593532480079, -7.189617399692148], [-0.19484099427785573, -2.5472937920965126, -2.8529149464117989, 0.23348017270318788, -3.8326935763046572]], [[-2.6690483843350865, -8.8070436563879611, -9.5573954980956835, -8.9180685044788053, -3.9242023950582396], [-8.3892148254049861, -0.47054094497635024, -9.6949522415970435, -4.9639005843468098, -0.14172296606764601], [-2.6942076366272589, -6.6973508257254206, -0.87125826305779785, -5.0438287667606865, -8.3521645317623321], [-9.312284746199488, -4.7420482591307556, -2.6262995601458696, -5.9531046729824961, -0.60445327804765459]], [[7.456079740945281, 8.4847673353014574, 7.9602450823598172, 6.7339859041675219, 3.8707022504725801], [1.1238386943882315, 2.2275954606078816, 8.503704430666259, 0.82058507045659734, 2.7668037666129681], [6.0087185792176694, 3.1487943780294803, 1.8853198141519929, 7.6667653192282597, 4.4690898434992326], [6.8730139330232962, 1.0192734174104432, 3.9855028311969329, 0.49906474818549107, 0.60613186846798239]]], [[[-5.8237169491551288, 1.0591760620493016, -0.4877430959736957, -3.4060776996744648, -2.4232785320607624], [-5.6712293936500489, -3.0600539453746958, -0.99981598004394456, 2.113564234116363, -3.9423493455888137], [-3.2765764279262166, -2.948865490295641, -1.7564794786178375, -4.5285198857462747, 2.6629368541507157], [-3.9499614438852113, -1.9474965180700492, -2.111810030394099, -3.2449559962862407, -6.2860379268726154]], [[3.4318153529736231, -3.3411734480642705, -2.5775568056827911, 2.96174476586725, 3.3653174369098657], [5.8261471184257498, 4.9012204870431848, 3.6752780979387882, 5.569650691574564, -1.3299318142232153], [-0.40508368238495462, -1.6012180007178434, 5.8813262204442172, 4.1799557082194507, 0.31760224500951928], [0.64681985709907686, 0.77429527211438476, -1.3582608162232312, 1.2880264086557229, 2.6592485446255214]], [[-4.8422855451296201, -1.6891274288713412, -2.4585769903416379, -4.0013118241989964, -2.5720568638835486], [1.6683160205663645, -4.9666373340444192, 1.6872100627146347, -4.4263203570242835, -5.3176165895034986], [-2.4834285004108669, 2.79542050884569, 2.9795589386028096, -5.9133226788465976, 0.2032443417475216], [-2.8464367223804556, -6.0041009441831319, -3.6958462823235019, -0.95961412527860457, 2.1048714721777797]], [[5.1047797112331361, 0.18242685753193211, 0.82493131854939472, 6.7428198115958793, 5.3289514462148428], [4.9113132804201998, -0.040778743285915908, 4.8572896233622709, 3.5310208391176623, 2.9293060386877303], [7.9001470397537563, -0.053163468686718396, 1.0503845435436032, 3.4645471700693724, 3.6832356738852416], [8.6393351849215598, 2.8999233190402953, 2.0283942051152426, -0.12969664058888331, 3.451352443259152]], [[-1.739066706378722, -4.8897724042989017, -5.6901302195808832, -2.0985948309313525, 0.69917350144768164], [-4.3486468527136646, 0.57305145238864696, -7.392833238955423, 0.0037983332246440682, -2.0727514305692303], [-3.5234123678956077, -7.8939167250514775, -5.3771614356687136, -0.13494032870329775, -3.329169431817216], [-4.7943088501560815, -8.6177892781008296, -0.56244616271500725, 0.053059182416266282, -8.4800493064779001]]], [[[1.8197119974688576, 1.2279696255767076, -4.0534965880585689, -1.8632767488925168, -3.2674821492329293], [5.0729749879785881, -4.2568150943510847, 5.1127165150470901, -0.24936484277710491, 5.1023018335412349], [-3.9594703927773702, 0.021138909284846186, 2.5063616867914806, -2.148140492815382, 2.8246237455179877], [1.4496060433176847, 0.40162616265154671, -1.2494641022907431, 1.4649121820908206, 2.6758532029783408]], [[5.5709134261803746, -2.3444610713330567, 3.0027831121992943, 6.9223197505347107, 1.598905010468413], [6.8657149610496786, 2.0967217377077807, 0.82998430604948581, -2.1685842223052303, 1.9772596109958931], [5.0030207828257032, 0.095423870096326802, -1.2777213676803192, 5.5458485235047066, 0.70051947901110667], [-2.2940518852432144, 6.1599903356981338, -0.99179690735397585, 7.0924355667158343, 0.22981194194075361]], [[6.0584351203210156, 5.0121894832973242, 1.308215084064444, 5.7402519620306789, -1.0207068608776115], [-3.1746991567492149, -1.1439981260664913, -0.39049720932172782, 5.6775714492356721, 2.713887317616428], [5.3159384659957771, 1.9965507653363908, 5.4857743373836039, 4.9505833351914506, 4.8518864209426154], [5.5258878514568037, -2.5085280688367964, 3.0289285111559741, -3.4457100007895169, 2.6069601251256902]], [[-2.4276522444275166, -5.830591921607561, -5.7185924574499714, -1.7595605376344716, 0.070975899647553575], [0.33504525198401591, -7.3885722011650312, -4.1515743545924515, -1.7693716342900103, 2.0921598466846438], [2.1551372565700602, -4.1816078947291002, 1.2720727989944747, -0.57509777953991836, -7.0917746661262093], [-4.5664283340702552, -1.5496044810085801, -5.3697024698661835, -2.8968443804999184, 0.98027536829130479]], [[2.8729604809090912, 3.4388175586958791, 2.2126895948732956, 8.3221076284453659, 7.1502121581435816], [6.8694498126636585, 6.2019835155188581, 8.6012113607016278, 3.5287286213968789, 4.2767989285778185], [2.3935513027036572, 3.7997314238631272, 6.7955598047493702, 4.1112617857563256, -0.46382072327164892], [3.1175792209267517, 3.9510038942932475, 7.9241773644007214, 0.63787962112322472, 3.9718202964092422]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_array_rank4(self):  
       arg0=numpy.array([[2.7785956856444551, -1.0393254760391333, 3.7940467324892797, -0.12514562601400669, 4.8857420051683214], [2.2324138667562918, -4.9541437567872588, 0.75646215941666295, -2.6994591144076905, -3.2278522642315135], [-3.7428426325668838, -0.37559306525741043, -0.87685296648245892, -4.336115919934354, 2.3476613452902697], [1.4843752930855727, 3.3863386142003851, -0.97620494691586046, 1.5116871740876743, -4.1640308199522345]])  
       arg1=numpy.array([[[[-2.8847140903626856, 4.5301005762052693, -4.4034045124846202, 2.4021072991142827, 3.6802514386058185], [-3.2499148960161497, -1.5309022853249941, -0.28698632160374604, -4.802100019776673, -1.3580072547924149], [1.1897370136052379, -1.8541180586965353, 1.1905335743937249, 0.98608970192652823, 4.9080431314365196], [-3.6960430064000871, -4.4745140718412282, 1.5651250483370589, -3.6425598343391097, -2.2911821203391716]], [[-1.0897711019446632, -3.926186299652926, 0.09570038807585135, -4.4975213454271357, -0.73580857039537584], [-0.67306273425968843, 2.9675463603572885, -3.4780918458823704, 2.4005737959966735, 3.0900728486777069], [1.5292896345525602, 2.8335187391790226, -3.9143485292665536, -0.83290037325656296, 1.4555105062554707], [-2.8876279844146238, 2.4418605759064294, 4.1485259351670969, -4.2862662704654033, -4.7427369837838658]], [[3.6259395982621339, -4.5198255010881674, 3.131571367171853, -3.0985809558640618, 3.5465311226191467], [4.376169548811955, -3.4854404730252995, -1.536196268405905, -2.1400458689959709, 1.8757652986797275], [-2.4774016727229609, -0.96140973105898553, 3.1349454124501595, 0.16471206082226075, -2.8026604307834257], [1.4299950015943574, -0.26882874834537773, 3.2470689419838159, -4.3563815357327682, 3.3610635670085891]], [[2.4064173010289638, -1.1621704339914753, 4.3605930803797719, -1.3640529768808172, 4.1282587795821808], [-1.8583221730572275, 3.9496332501238189, 1.4709522163298994, 4.444279900522119, 3.092735113270308], [3.3259941320841548, 3.3252840560471721, -0.016158424349731249, 1.5409925016276933, 2.4395599061035336], [4.2439903692753909, -3.467636597811532, 0.78167947098890522, 4.2522198035696377, -3.5398830108135004]], [[0.66403701661435655, 0.52931205243668167, 1.7258772857054261, -4.4293684470709795, -0.17702270736168302], [-1.5151784408865376, -4.6919572695385572, 2.5977855379644126, 2.1522758996844047, -2.1744716801212647], [3.5041261323448332, 4.0865873291299817, -4.3207649310661367, 1.2833932956384828, -0.56441804397003192], [0.54274290867358932, -3.1995644074126717, -2.2013877785580362, -3.2196546811052151, 0.57255639726768504]]], [[[-2.7016732105111263, 4.4590195279834646, 3.7569970286655483, 4.5612972155969107, 0.0040470053263330641], [3.9561160353484386, 4.0578643792316846, 3.2238472475057893, 4.7724180072345135, -0.43602100619855388], [1.6193169847368791, 3.2557273126151465, -2.193997896320854, 2.2369361709801172, -4.0763587987537706], [-4.3239913730293322, 0.86013618492116528, 1.4709880518330776, -2.5777870725550667, 1.3089454403599854]], [[1.51921641306462, -3.3786016782210804, -2.9733472211441248, 2.9158862748378356, 3.7721296342959025], [1.3095939422083305, -4.5430643818949745, -1.4445437326138002, 3.3016416917852602, 2.7014977402164639], [4.4456018151117469, 3.0023140434470754, 2.0198931145250167, 2.9518058006842463, -1.862843053670872], [-4.437246823047106, 0.11507857119042697, -4.4600559187197097, -2.8581203795110763, 0.60717877365178019]], [[-0.6425928026430423, 4.50281242803376, 2.678989380468316, 1.9662371075655019, -3.276065293070598], [4.4234399746434825, 4.8135855302617259, -4.153700385296113, 2.1791101884587141, -3.1630037632694483], [-1.0744589847388974, -1.7032701337189948, -1.3273591262929587, 4.8229304768164329, -1.1516163636243961], [-4.1489350261017144, -4.377635324133812, -0.81303736071653621, -1.9337221487515244, 1.5009441445418501]], [[-2.3726581318642315, -3.1395974449848385, 3.2573925878028156, -1.2658404652379582, 0.69325414564968302], [-2.9281378667995748, 3.8845226967324642, -1.6446557591456945, -2.5008315930549072, 4.1182479561692489], [-1.9368488217839896, -3.4587756297242258, 1.8434807358519842, -3.7200861159528742, 4.2296601538462664], [-0.76643214811182681, -2.8106568768848685, -4.7211019057619446, -1.7665660887889336, -4.9401747812272303]], [[1.7702592182688033, -3.3779427523225491, -3.5532155650281871, 2.4161310111659606, 1.3849226082467405], [-2.6123980723637095, 2.9271667522470066, -3.8932293174612465, 0.65657321978474048, 1.9338766313448108], [-3.7373302000663133, 2.6673863371485096, 3.6087327685482897, 4.239814403707749, 4.689904089789545], [-0.19879733194320881, 3.1359415174600578, -4.1317024809820655, 1.3462064935530815, 2.8511944377283607]]], [[[-3.0454553224688361, -4.2624408774261093, -4.4118554678479409, 0.66982913023489665, 4.6211567643126585], [1.4088360447092629, 4.3936800683534614, 1.8451977126727108, -2.1891816198767158, -3.121334682702682], [2.5064923315433258, 0.65094206102781449, 1.2464566210918262, 4.3689464406243737, -4.3331109320735131], [-3.0289163690739529, 3.8826101653079892, 4.9636148802069897, -4.6771403157328537, 2.0215955063801463]], [[1.0940751188053754, -4.5315780362387148, 3.2502382225270772, 1.0185935980409697, -3.4518468274315275], [1.143936439583527, -3.4946888078283687, 2.5540781733872207, 4.0348801776151042, -1.8055477998468037], [3.9974746326618096, -3.4348522299648412, 1.0048350859357509, -0.34758080285042503, -1.645439618265454], [2.2844880282555717, 1.3896187521218017, -4.3688955805569964, 0.64393661751579767, -4.8252783444973071]], [[2.5230556892516915, 1.3496790494839388, -0.3045618509010275, -0.940671726167297, -3.9910008581945586], [-2.8222849160619834, 2.0297124751402027, 4.7351236689737295, -4.711100762315815, 1.6785625304158653], [-4.8437727791014309, 3.6720220859611405, -0.828047438364238, 3.9675346976625843, -1.2743032008633302], [4.0762048533890205, 1.5537047647647455, 1.4038285639928052, -3.7453487779312744, -2.5078754972757089]], [[-1.551089216489304, -2.2071102539252885, -0.78567153627260655, 2.6234871709890015, -1.0845985325691574], [-0.18373918320027638, 0.52831829540759045, -4.858416702056755, 4.0001409033278019, -2.1605985079408532], [3.8651454846757307, -3.8361478713967823, 3.4086370963296435, -2.2383766311383155, -1.2995949731349055], [0.95216316432277637, 2.3807474676291847, -4.499399236647009, 1.8293615168857453, 2.9268640537504318]], [[-4.1874086878639289, 0.94762878545914564, -4.6290151596723863, -2.3462476741666394, -1.4991299839160668], [1.1557559051894231, 2.9592217749640506, -3.4531515925716558, -4.3326058013668813, 0.35062396135482388], [0.10352236359494693, -2.0426708702901974, -1.3840906791920271, -1.6073003903364089, 2.6272340858201373], [1.2955086615687508, 2.1840269186199235, 3.90212999009497, 2.8200225783397315, -0.96679304813221556]]], [[[0.15545636318707423, 0.37792566461955523, 0.083593262087995335, 1.9533265471393584, -0.45360148784276255], [-4.6849891832749986, 0.68937076545058318, 4.4623581089677629, -0.71908778542911556, -3.9689950202529358], [3.0624541145644031, -0.4949617851494903, -2.3826558233667319, -3.8709747741242451, -0.62316909126761377], [0.49817349136570499, 4.1933492142203672, -0.99615549414611504, 1.7468266971962345, -2.3054840679070798]], [[4.9226463499819566, 3.2243417174853057, -3.6596392314224802, -4.0112038676730899, 3.9974552383118098], [0.46587390156158826, -0.26380834905648598, -1.3470978764117971, -3.7118005097282025, -4.3217257683668562], [4.8206762475484659, -4.8885067763001615, 3.7138504405481214, 3.1791768251986401, -4.4577029401778496], [4.0467484201025101, -3.214657079853882, 4.6787753759780824, 2.5408753408482232, -4.9423230438682335]], [[1.5537820335850929, -1.2763186448429984, 4.5331511095952539, 1.7629570228112481, 3.2835515714634678], [3.254693669774527, 2.5643144799706459, -0.36508941354492386, 2.7885017029698087, -3.2616751728609072], [-1.2643555895033485, -3.1943819839230558, 1.459205354087425, 1.1637310685652213, -3.619639200426831], [3.8361332865156594, 0.99260865879742255, 2.7977695419162014, -4.4585762014343864, -1.328146560512443]], [[4.5054662661344942, 2.350341292722085, 1.0886420953859481, 4.4743765301108098, -0.44574632791776381], [-0.81085411680797392, -0.64734497403316205, 0.057850900395445493, 2.4155852363008679, 2.8781648489694858], [4.3487155489847478, 2.0416359899942762, -4.0760289011860795, 0.54249361158190545, 1.5217232998482562], [-0.98397449707201989, 3.53294823657858, 1.429483869647167, -4.5811681836295817, -2.9242304662391847]], [[2.0229210353033018, -2.9356226982368061, -3.8900531544155834, -3.7231423921993558, 3.535500551460709], [-2.1408847677427199, 1.6049118743800728, 3.8652807076461286, -0.048303121370598667, 2.1453571673386804], [-2.4540666038841188, -4.6319275387934367, -3.3056720735845713, -3.9882984079943617, 1.8726959635112985], [-2.1564254511009073, -1.820671513792782, 3.6224199176151863, -0.41636721544821143, -2.5621075239623217]]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[-0.10611840471823042, 7.3086962618497244, -1.624808826840165, 5.1807029847587378, 6.4588471242502736], [-0.47131921037169455, 1.2476934003194611, 2.4916093640407091, -2.0235043341322179, 1.4205884308520402], [3.968332699249693, 0.92447762694791979, 3.96912926003818, 3.7646853875709834, 7.6866388170809747], [-0.91744732075563196, -1.695918386196773, 4.343720733981514, -0.86396414869465454, 0.48741356530528357]], [[-2.1290965779837965, -4.9655117756920593, -0.94362508796328193, -5.5368468214662689, -1.7751340464345091], [-1.7123882102988217, 1.9282208843181552, -4.5174173219215037, 1.3612483199575403, 2.0507473726385737], [0.4899641585134269, 1.7941932631398894, -4.9536740053056869, -1.8722258492956962, 0.41618503021633746], [-3.926953460453757, 1.4025350998672961, 3.1092004591279636, -5.3255917465045366, -5.782062459822999]], [[7.4199863307514136, -0.72577876859888768, 6.9256180996611327, 0.69546577662521791, 7.3405778551084264], [8.1702162813012347, 0.30860625946398024, 2.2578504640833748, 1.6540008634933088, 5.6698120311690072], [1.3166450597663188, 2.8326370014302942, 6.9289921449394392, 3.9587587933115405, 0.99138630170585396], [5.2240417340836371, 3.525217984143902, 7.0411156744730956, -0.5623348032434885, 7.1551102994978688]], [[2.2812716750149571, -1.287316060005482, 4.2354474543657652, -1.4891986028948239, 4.0031131535681741], [-1.9834677990712342, 3.8244876241098122, 1.3458065903158927, 4.3191342745081123, 2.9675894872563013], [3.2008485060701481, 3.2001384300331654, -0.14130405036373794, 1.4158468756136866, 2.3144142800895269], [4.1188447432613842, -3.5927822238255387, 0.65653384497489853, 4.127074177555631, -3.6650286368275071]], [[5.5497790217826779, 5.415054057605003, 6.6116192908737474, 0.45637355809734181, 4.7087192978066383], [3.3705635642817837, 0.19378473562976417, 7.4835275431327339, 7.038017904852726, 2.7112703250470567], [8.3898681375131545, 8.972329334298303, 0.56497707410218467, 6.1691353008068042, 4.3213239611982894], [5.4284849138419107, 1.6861775977556497, 2.6843542266102851, 1.6660873240631062, 5.4582984024360064]]], [[[-0.46925934375483447, 6.6914333947397564, 5.9894108954218401, 6.7937110823532025, 2.2364608720826249], [6.1885299021047304, 6.2902782459879765, 5.4562611142620812, 7.0048318739908053, 1.7963928605577379], [3.851730851493171, 5.4881411793714383, 0.038415970435437874, 4.469350037736409, -1.8439449319974788], [-2.0915775062730404, 3.0925500516774571, 3.7034019185893694, -0.34537320579877484, 3.5413593071162772]], [[-3.4349273437226389, -8.3327454350083396, -7.9274909779313836, -2.0382574819494232, -1.1820141224913563], [-3.6445498145789283, -9.4972081386822325, -6.398687489401059, -1.6525020650019986, -2.2526460165707949], [-0.50854194167551192, -1.9518297133401834, -2.9342506422622421, -2.0023379561030126, -6.8169868104581308], [-9.3913905798343649, -4.8390651855968319, -9.4141996755069677, -7.8122641362983352, -4.3469649831354786]], [[0.11386935677362064, 5.259274587450423, 3.435451539884979, 2.7226992669821648, -2.5196031336539351], [5.1799021340601454, 5.5700476896783888, -3.39723822587945, 2.935572347875377, -2.4065416038527854], [-0.3179968253222345, -0.94680797430233188, -0.57089696687629576, 5.5793926362330959, -0.39515420420773317], [-3.3924728666850514, -3.621173164717149, -0.056575201299873257, -1.1772599893348614, 2.257406303958513]], [[-5.0721172462719224, -5.839056559392529, 0.55793347339512511, -3.9652995796456487, -2.0062049687580075], [-5.6275969812072653, 1.1850635823247737, -4.3441148735533854, -5.2002907074625977, 1.4187888417615584], [-4.6363079361916801, -6.1582347441319163, -0.85597837855570624, -6.4195452303605647, 1.5302010394385759], [-3.4658912625195173, -5.510115991292559, -7.420561020169635, -4.4660252031966241, -7.6396338956349208]], [[-1.4575930459627102, -6.6057950165540626, -6.7810678292597011, -0.81172125306555287, -1.842929655984773], [-5.840250336595223, -0.30068551198450688, -7.12108158169276, -2.571279044446773, -1.2939756328867027], [-6.9651824642978273, -0.56046592708300391, 0.38088050431677622, 1.0119621394762355, 1.4620518255580315], [-3.4266495961747223, -0.09191074677145572, -7.359554745213579, -1.881645770678432, -0.37665782650315283]]], [[[-6.7882979550357199, -8.0052835099929922, -8.1546981004148247, -3.0730135023319871, 0.87831413174577477], [-2.3340065878576208, 0.6508374357865776, -1.8976449198941729, -5.9320242524435995, -6.8641773152695658], [-1.2363503010235579, -3.0919005715390693, -2.4963860114750576, 0.62610380805748989, -8.0759535646403968], [-6.7717590016408362, 0.13976753274110543, 1.2207722476401059, -8.4199829482997366, -1.7212471261867375]], [[0.71848205354796502, -4.9071711014961252, 2.8746451572696667, 0.64300053278355929, -3.8274398926889379], [0.76834337432611655, -3.8702818730857791, 2.1784851081298102, 3.6592871123576938, -2.1811408651042141], [3.6218815674043991, -3.8104452952222516, 0.62924202067834045, -0.72317386810783546, -2.0210326835228645], [1.9088949629981613, 1.0140256868643913, -4.7444886458144069, 0.26834355225838724, -5.2008714097547175]], [[1.6462027227692326, 0.47282608300147988, -1.1814148173834864, -1.8175246926497559, -4.8678538246770175], [-3.6991378825444423, 1.1528595086577438, 3.8582707024912706, -5.5879537287982739, 0.80170956393340642], [-5.7206257455838898, 2.7951691194786816, -1.7049004048466969, 3.0906817311801253, -2.1511561673457891], [3.1993518869065616, 0.67685179828228659, 0.52697559751034628, -4.6222017444137329, -3.3847284637581678]], [[-5.8872051364236579, -6.543226173859642, -5.1217874562069605, -1.7126287489453524, -5.4207144525035114], [-4.5198551031346303, -3.8077976245267635, -9.1945326219911081, -0.33597501660655205, -6.4967144278752071], [-0.47097043525862325, -8.1722637913311367, -0.92747882360471046, -6.5744925510726695, -5.635710893069259], [-3.3839527556115776, -1.9553684523051693, -8.8355151565813621, -2.5067544030486086, -1.4092518661839222]], [[-1.8397473425736592, 3.2952901307494153, -2.2813538143821166, 0.0014136711236303334, 0.84853136137420293], [3.5034172504796928, 5.3068831202543203, -1.1054902472813861, -1.9849444560766116, 2.6982853066450936], [2.4511837088852166, 0.30499047500007226, 0.9635706660982426, 0.74036095495386078, 4.974895431110407], [3.6431700068590205, 4.5316882639101932, 6.2497913353852397, 5.1676839236300012, 1.3808682971580541]]], [[[1.6398316562726469, 1.8623009577051279, 1.567968555173568, 3.4377018402249311, 1.0307738052428101], [-3.2006138901894259, 2.1737460585361559, 5.9467334020533356, 0.76528750765645714, -2.4846197271673631], [4.5468294076499758, 0.9894135079360824, -0.89828053028115917, -2.3865994810386724, 0.86120620181795893], [1.9825487844512777, 5.6777245073059399, 0.48821979893945766, 3.2312019902818072, -0.82110877482150713]], [[8.3089849641823417, 6.6106803316856908, -0.27330061722209509, -0.62486525347270483, 7.3837938525121949], [3.8522125157619733, 3.1225302651438991, 2.0392407377885879, -0.32546189552781746, -0.93538715416647111], [8.207014861748851, -1.5021681620997764, 7.1001890547485065, 6.5655154393990252, -1.0713643259774646], [7.4330870343028952, 0.17168153434650302, 8.0651139901784674, 5.9272139550486083, -1.5559844296678484]], [[0.57757708666923246, -2.2525235917588589, 3.5569461626793935, 0.78675207589538765, 2.3073466245476073], [2.2784887228586665, 1.5881095330547854, -1.3412943604607843, 1.8122967560539482, -4.2378801197767677], [-2.2405605364192089, -4.1705869308389163, 0.48300040717156456, 0.18752612164936089, -4.5958441473426914], [2.859928339599799, 0.016403711881562089, 1.821564595000341, -5.4347811483502468, -2.3043515074283034]], [[6.0171534402221685, 3.8620284668097593, 2.6003292694736224, 5.9860637041984841, 1.0659408461699105], [0.70083305727970036, 0.86434220005451223, 1.5695380744831198, 3.9272724103885421, 4.38985202305716], [5.860402723072422, 3.5533231640819505, -2.5643417270984052, 2.0541807856695797, 3.0334104739359304], [0.52771267701565439, 5.0446354106662543, 2.9411710437348413, -3.0694810095419074, -1.4125432921515104]], [[-2.1411097846489326, -7.0996535181890401, -8.054083974367817, -7.8871732121515903, -0.62853026849152549], [-6.3049155876949543, -2.5591189455721617, -0.29875011230610582, -4.2123339413228331, -2.018673652613554], [-6.6180974238363532, -8.795958358745672, -7.4697028935368053, -8.1523292279465966, -2.2913348564409359], [-6.3204562710531418, -5.984702333745016, -0.54161090233704812, -4.5803980354004459, -6.7261383439145561]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_array_rank3(self):  
       arg0=numpy.array([[[-4.8162648037926603, 1.6603316889571289], [-4.264768521630482, -2.6575953987648058]], [[3.907455930273855, -4.1075890801164858], [2.5379884577624559, 1.1198040078348708]], [[1.3239499094085794, -1.4283957879090634], [-1.244028896377769, 4.567019310390366]], [[2.2831789885970206, 3.408163062651159], [0.1736715776497908, -2.4818883823433047]], [[-4.4680336274062835, 3.375950563827125], [0.21327360899315906, -2.3434323125449206]], [[-2.1434619393174223, -4.0795642964997452], [-4.4205716818355656, -1.2065001510986004]]])  
       arg1=numpy.array([[[3.233897134372409, 2.5553644352512244], [1.4630308795654585, -4.3663648911630286]], [[4.1040252813031657, -0.6193714354551938], [3.1367378951521268, 1.3964441417176925]], [[-4.8790080756826164, 1.9059365708205185], [-2.8334112277542491, 3.5624332865880177]], [[3.7374980712691848, -3.5071195381512297], [1.0723936164845522, -3.2106391895822228]], [[1.7611000663974998, 0.092358589748772424], [-2.4561993990644684, 2.3762893867204795]], [[-3.8682692222162718, 4.5709428503156264], [-0.33675148546058598, -0.57318919954880521]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[-1.5823676694202513, 4.2156961242083533], [-2.8017376420650235, -7.0239602899278344]], [[8.0114812115770206, -4.7269605155716796], [5.6747263529145826, 2.5162481495525633]], [[-3.555058166274037, 0.47754078291145508], [-4.0774401241320177, 8.1294525969783837]], [[6.0206770598662054, -0.098956475500070695], [1.246065194134343, -5.6925275719255275]], [[-2.7069335610087837, 3.4683091535758974], [-2.2429257900713093, 0.032857074175558942]], [[-6.0117311615336941, 0.49137855381588125], [-4.7573231672961516, -1.7796893506474056]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_array_rank3(self):  
       arg0=numpy.array([[[[4.4393146128816579, 1.4490240710644322], [-2.9419314540361983, 2.8478200185360141]], [[1.6153209637498565, -0.093651273199339968], [1.7281244062891243, 3.0615610567180447]]], [[[-3.2168405811976006, -2.0136383653893217], [-2.8289297409311533, -3.73011482707465]], [[-3.0633325356330756, -0.43761018679317498], [0.41252562386887437, -1.4658535730578137]]], [[[1.0907894559026623, 4.6138252971488001], [2.6130122184292439, -3.9406604201830433]], [[1.1106951384954407, -1.6034886449483166], [-3.5260207611482386, -2.2377275039777733]]], [[[0.9763952838443597, -1.9564804756188412], [-2.6800446471867225, -3.3729943506301852]], [[4.0513826011596574, 4.3941768671545969], [4.4447292791553998, -3.1423952604000602]]], [[[-4.5339892081721711, -2.3567642325976523], [-3.7303530131330276, -2.398449515910678]], [[4.8000803528527403, -0.72571192696479692], [4.0428474579852356, -2.1341947649102266]]], [[[1.9690351276429521, 2.8324989969193179], [-1.7356396901989504, 1.9747523335471895]], [[-3.6277020865600171, -1.8382189746029907], [0.81584805155681206, 4.680815531110337]]]])  
       arg1=numpy.array([[[-4.7673791937287477, 3.7154632393990727], [-4.6877095274671454, -3.8982868392370618]], [[-3.9741286813198231, 0.13209936717769466], [3.045841866071104, -4.2606123931471886]], [[-4.1396601056109077, -4.6830183558067118], [1.712169742293888, 3.9538116043777674]], [[-4.9590921306442626, 2.9986434130450466], [1.3330381425427635, -2.116340132766358]], [[-3.20634382873103, 0.64758548422823736], [-1.6212311634161116, -3.9893744788499417]], [[4.3153253897604706, -1.9740281141053826], [-3.0751216990509955, -1.3407608487685163]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[-0.32806458084708989, -3.3183551226643155], [0.77353178536287448, 6.5632832579350868]], [[-3.072388563717289, -4.7813608006664854], [-2.1701624329479374, -0.83672578251901708]]], [[[-7.1909692625174237, -5.9877670467091448], [-2.6968303737534587, -3.5980154598969554]], [[-0.01749066956197165, 2.608231679277929], [-3.8480867692783143, -5.7264659662050024]]], [[[-3.0488706497082454, 0.47416519153789238], [-2.0700061373774679, -8.623678775989756]], [[2.8228648807893286, 0.10868109734557141], [0.42779084322952876, 1.716084100399994]]], [[[-3.9826968467999029, -6.9155726062631038], [0.31859876585832403, -0.3743509375851386]], [[5.384420743702421, 5.7272150096973604], [2.3283891463890418, -5.2587353931664182]]], [[[-7.7403330369032011, -5.5631080613286823], [-3.0827675289047902, -1.7508640316824406]], [[3.1788491894366286, -2.3469430903809085], [0.053472979135293919, -6.1235692437601683]]], [[[6.2843605174034227, 7.1478243866797886], [-3.709667804304333, 0.00072421944180689479]], [[-6.7028237856110131, -4.9133406736539857], [-0.52491279721170425, 3.3400546823418207]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_array_rank4(self):  
       arg0=numpy.array([[[-3.6168293521064578, -3.017783259045669], [-3.2181771404881765, -2.2859842516189444]], [[-4.6607180657697134, 4.753847627023017], [-1.5262762233340288, -0.19975459683040686]], [[1.4628503134209172, -0.33520203556978423], [-1.2914390091941783, -4.9521945997646064]], [[2.823350498159158, 4.6925770857511786], [-0.84721445530974471, 1.0110870361960806]], [[1.0564576548406022, -3.0537000214256196], [-2.9434117548841932, 4.3385116307666785]], [[-4.7831336968150762, 0.36413231328448603], [4.9112363385924436, 1.984628884819327]]])  
       arg1=numpy.array([[[[4.941404152579068, 2.2705511170843913], [-3.915212526111973, 2.6902222158982099]], [[3.0065880078640745, -3.8668984930451558], [-0.7035933136620045, 1.7990704691713075]]], [[[-1.3097045373307759, -4.4623223180322578], [-2.5484159423873143, 4.4589555168020958]], [[0.25482043717761993, -3.8568928968582905], [-3.3492837217277707, 0.035185030279927254]]], [[[-3.6490131961023966, 2.5691324403830542], [2.1112580829261098, -0.72097650109338218]], [[2.9981238560026648, -2.454852675933068], [-1.9058317772134838, 2.3330701181771518]]], [[[-3.0543444769565653, 3.1758802428435686], [0.43419074321997364, -2.0940014610030202]], [[-4.3316990420058108, -1.9410939183092148], [-2.5734712705239793, -1.6401917642342734]]], [[[-4.1756361990012287, -2.5516816990554139], [-2.9850002665551223, -3.6427922428918547]], [[-4.9930997539057786, 2.410042480707391], [-1.8529396860163616, -3.0651837594578071]]], [[[4.3339251388264604, -3.5872934423541434], [2.4784939885193999, -3.9824701166037202]], [[-4.9943262890045128, 3.4229469807352011], [-4.298316287465016, -4.4076951165236693]]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[1.3245748004726101, -1.3462782350220666], [-6.932995785157642, -0.32756104314745915]], [[-0.21158913262410195, -7.0850756335333323], [-2.9895775652809489, -0.48691378244763683]]], [[[-5.9704226031004897, -9.1230403838019711], [2.2054316846357027, 9.2128031438251128]], [[-1.2714557861564089, -5.3831691201923189], [-3.5490383185581775, -0.16456956655047961]]], [[[-2.1861628826814794, 4.0319827538039714], [1.7760560473563256, -1.0561785366631664]], [[1.7066848468084865, -3.7462916851272463], [-6.8580263769780903, -2.6191244815874546]]], [[[-0.23099397879740735, 5.9992307410027266], [5.1267678289711522, 2.5985756247481584]], [[-5.1789134973155555, -2.7883083736189596], [-1.5623842343278986, -0.62910472803819273]]], [[[-3.1191785441606266, -1.4952240442148117], [-6.0387002879807419, -6.6964922643174738]], [[-7.9365115087899714, -0.53336927417680213], [2.4855719447503168, 1.2733278713088714]]], [[[-0.44920855798861581, -8.3704271391692195], [2.842626301803886, -3.6183378033192342]], [[-0.083089950412069236, 8.3341833193276447], [-2.3136874026456891, -2.4230662317043423]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_array_rank4(self):  
       arg0=numpy.array([[[[0.20707199587456415, -2.8389586455840554, -1.4188431515093147, -1.5007258976297844], [4.1780896919113246, 0.41370523497105793, 3.3172576680099244, 4.8988860263969798], [0.95864181795463832, -4.3098910169217195, 4.333851981884397, -1.4135593957145964]], [[3.5832575678913727, 1.5324925432023351, -3.3963943517212689, -2.1466822344802217], [2.1738415883853897, 4.0882065623806607, 2.5476255491489486, -3.5574616591181032], [4.82913663235718, 1.6962851647438431, 4.565957622257006, 4.9166165254259724]]], [[[3.3370816889492954, 0.51922608449754293, -4.9009419782762738, 1.9356440975342863], [1.2941682468457163, 3.4476611127651147, -3.4621338206790861, -3.8519039019066015], [1.8794061425144477, -3.8755542830091851, -2.5594438097811842, 4.5100770560125181]], [[-4.3774278646768403, -2.2413395008091475, -1.5356834242226967, -2.9882533136924039], [4.3710954372305988, -0.178814287090451, 1.5886832579298371, -1.5850731242110596], [2.7762847490735121, -4.0179143756718911, 0.74975534739382965, -1.3435636487398117]]], [[[-1.2846985979955292, -1.8050585602992109, 3.6884182630231539, 1.9860303880987287], [3.2667423001524334, 0.68769889003960216, 3.5150011116435884, 4.6536274273340421], [-1.9740333387752509, -3.6457687846294018, -0.21977046054667149, 3.1112277618152078]], [[4.2999661726965339, 4.345492310509794, -2.5281918668153356, 0.98026859980009728], [-3.0135980268779816, -3.8131809797016292, -3.5587365673156368, -0.62640235530673571], [2.0191668179310049, -2.3600713401751641, -3.4404244351342648, -3.8805217468959476]]]])  
       arg1=numpy.array([[[[1.1138526891519849, -4.8465740282892265, 2.8504860185910914, -4.7066030422504168], [4.4454574423686797, 1.6399924913779369, -3.9425765443906204, 1.8345134654423658], [0.16921289634268, -4.1149726046189024, -3.8985285194547692, 4.5517556913682302]], [[2.5472743590695881, -3.2809328643991731, -4.4114702616399324, 4.4088680114609033], [-3.1312413067695188, 4.5957843462307668, 4.4176418099324923, -3.1806616944375445], [4.0697428199251835, -3.6752083343903497, -4.0576349149613655, -0.98144487715212847]]], [[[-4.8326104317198402, -3.2916302267986799, -1.6183183180436291, 2.2939346707747017], [-1.0848031940206218, 0.28494407928834509, 2.22106027477352, -4.9543128911282119], [-0.92782697971742234, 4.2621644610647795, -1.140804795291591, -1.4243204037339128]], [[4.9709348752035503, -2.2831685852029873, 3.9361279001785672, 2.7810077916828169], [3.4430315533724638, -4.70707264622654, -1.4483171688294973, 4.0894432299277099], [4.4826982347042001, 2.1550760387491321, -3.2704296865112168, 4.3915305523324228]]], [[[0.51796219816416578, 4.6431871713130377, -4.2581280183958823, -0.78755218271505445], [-1.5109214489606693, -1.515141241280423, 1.9242611987554712, 0.63393242913819314], [2.2128380231246991, -4.442445128369763, -4.7325496868154566, -2.216136734462566]], [[4.313660138580639, 0.16184750040414198, -1.7140079361203453, 4.4470495445894116], [4.0220813138875595, -3.2798509400048745, -4.3208226063445423, -2.8021294165793922], [3.9746010252769679, -3.6968121510622112, -0.092370941208526958, 0.91539399072196215]]]])  
       res=add(arg0,arg1)  
       ref=numpy.array([[[[1.320924685026549, -7.6855326738732819, 1.4316428670817767, -6.2073289398802007], [8.6235471342800043, 2.0536977263489948, -0.62531887638069605, 6.7333994918393456], [1.1278547142973183, -8.4248636215406218, 0.43532346242962783, 3.1381962956536338]], [[6.1305319269609608, -1.748440321196838, -7.8078646133612013, 2.2621857769806817], [-0.95739971838412918, 8.6839909086114275, 6.9652673590814409, -6.7381233535556477], [8.8988794522823635, -1.9789231696465066, 0.50832270729564044, 3.9351716482738439]]], [[[-1.4955287427705448, -2.772404142301137, -6.5192602963199029, 4.229578768308988], [0.20936505282509454, 3.7326051920534598, -1.2410735459055662, -8.8062167930348139], [0.95157916279702537, 0.38661017805559439, -3.7002486050727752, 3.0857566522786053]], [[0.59350701052670995, -4.5245080860121352, 2.4004444759558705, -0.20724552200958701], [7.8141269906030626, -4.885886933316991, 0.14036608910033976, 2.5043701057166503], [7.2589829837777122, -1.862838336922759, -2.5206743391173871, 3.0479669035926111]]], [[[-0.76673639983136344, 2.8381286110138269, -0.56970975537272839, 1.1984782053836742], [1.7558208511917641, -0.82744235124082088, 5.4392623103990596, 5.2875598564722353], [0.23880468434944824, -8.0882139129991657, -4.9523201473621281, 0.89509102735264179]], [[8.6136263112771729, 4.507339810913936, -4.2421998029356809, 5.4273181443895089], [1.0084832870095779, -7.0930319197065037, -7.8795591736601791, -3.4285317718861279], [5.9937678432079728, -6.0568834912373752, -3.5327953763427917, -2.9651277561739855]]]])  
       self.assertTrue(isinstance(res,numpy.ndarray),"wrong type of result.")  
       self.assertEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_constData_rank0(self):  
       arg0=numpy.array(1.08658937568)  
       arg1=Data(3.65141620993,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(4.73800558561,self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_constData_rank0(self):  
       arg0=numpy.array([3.5280575234979707, 4.1465688862900478])  
       arg1=Data(-1.36307882552,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([2.1649786979777743, 2.7834900607698514]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_constData_rank1(self):  
       arg0=numpy.array(-3.385118395)  
       arg1=Data(numpy.array([1.085706277824805, 3.8406256213182406]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-2.2994121171759776, 0.45550722631745799]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_constData_rank0(self):  
       arg0=numpy.array([[-3.0477207454583342, -3.0282959083223329, 0.7749831657258941, 2.2073872448035026, -3.7893888343855853], [0.5056893479560145, -3.9931013948895542, 0.64289331930294313, 1.5293872363775343, 1.7719605880888309], [4.761986051881248, 0.95146295589421293, 4.3254401779764127, 3.098982283003231, 2.3783040188654949], [3.6009352632269849, -1.0081042135408502, 3.9993844068665698, -2.4416357558142856, -3.6111770255188591]])  
       arg1=Data(3.96111381725,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[0.91339307178848284, 0.93281790892448413, 4.7360969829727111, 6.1685010620503196, 0.17172498286123172], [4.4668031652028315, -0.031987577642737186, 4.6040071365497601, 5.4905010536243513, 5.7330744053356479], [8.723099869128065, 4.9125767731410299, 8.2865539952232297, 7.060096100250048, 6.3394178361123119], [7.5620490804738019, 2.9530096037059668, 7.9604982241133868, 1.5194780614325314, 0.34993679172795789]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_constData_rank2(self):  
       arg0=numpy.array(0.245502573595)  
       arg1=Data(numpy.array([[-3.347386236437945, -4.6038209544801942, -3.5666187117124726, 2.8146042254161943, -1.5550935369486787], [0.37813565573573982, 1.5402207449279128, 4.4046765968804902, 0.15966966316012243, -0.44805648217900007], [0.99860196185272176, -1.330939726195389, 2.9997006743083645, 2.7071238598906717, 0.76807732551295693], [-3.2741221969535395, 2.5142299816695957, -3.9962842508079568, -3.6221757152495293, 4.2729910604551211]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-3.1018836628431972, -4.3583183808854464, -3.3211161381177248, 3.0601067990109421, -1.3095909633539309], [0.62363822933048763, 1.7857233185226606, 4.650179170475238, 0.40517223675487024, -0.20255390858425226], [1.2441045354474696, -1.0854371526006412, 3.2452032479031123, 2.9526264334854195, 1.0135798991077047], [-3.0286196233587916, 2.7597325552643435, -3.750781677213209, -3.3766731416547815, 4.5184936340498689]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_constData_rank0(self):  
       arg0=numpy.array([[[-4.8760725432093457, -2.4320485747519962], [0.22343669466661087, 1.3063243978050378]], [[4.8645820226350249, -1.5196963249695172], [3.0779274966733929, 3.0605575871487787]], [[-3.6783835986969549, 0.64699995109955832], [-4.2006918725202453, 0.24282648215983915]], [[-0.91845753535747932, -3.7796246458366145], [2.8429441447387855, 3.2474441929073468]], [[-3.8776268215997445, 4.3104602214874799], [3.6792269317970234, -1.9498562138166395]], [[2.8742858031281617, -4.0269956630186137], [-3.1673012889040342, 2.4813424216184652]]])  
       arg1=Data(2.76874531517,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-2.1073272280365272, 0.33669674042082232], [2.9921820098394294, 4.0750697129778564]], [[7.6333273378078434, 1.2490489902033013], [5.8466728118462115, 5.8293029023215972]], [[-0.90963828352413634, 3.4157452662723768], [-1.4319465573474268, 3.0115717973326577]], [[1.8502877798153392, -1.010879330663796], [5.6116894599116041, 6.0161895080801653]], [[-1.108881506426926, 7.0792055366602984], [6.4479722469698419, 0.81888910135617898]], [[5.6430311183009803, -1.2582503478457951], [-0.39855597373121565, 5.2500877367912837]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_constData_rank3(self):  
       arg0=numpy.array(1.56702109346)  
       arg1=Data(numpy.array([[[-1.3274772152884582, -0.97180571143130035], [2.6608136717593318, -3.6169826289923792]], [[-2.1623932906776409, 4.5805786048914303], [1.8005801739055887, -2.4928651318745434]], [[-0.56815281881184809, 2.0083775489363056], [-1.3007826854702698, -1.6229294664235496]], [[-2.6376285630495699, -3.8819487079682204], [3.8227340472803757, 3.6326641398582336]], [[-0.52821848477423039, -2.4663666254753069], [1.2871299483985768, -2.9439183662419675]], [[-1.1032952125692841, 4.2922431807084109], [3.8169836472318348, -4.4152986571792274]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[0.23954387816840672, 0.59521538202556457], [4.2278347652161967, -2.0499615355355143]], [[-0.59537219722077594, 6.1475996983482952], [3.3676012673624536, -0.92584403841767848]], [[0.99886827464501682, 3.5753986423931705], [0.26623840798659515, -0.055908372966684716]], [[-1.070607469592705, -2.3149276145113555], [5.3897551407372406, 5.1996852333150985]], [[1.0388026086826345, -0.89934553201844203], [2.8541510418554417, -1.3768972727851025]], [[0.46372588088758082, 5.8592642741652758], [5.3840047406886997, -2.8482775637223625]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_constData_rank0(self):  
       arg0=numpy.array([[[[-0.38000849757054755, -4.67613031168744, 0.10163285231516639, 3.1003173714705756], [-1.0971053399203026, 3.9911749716252416, 3.3572620298476767, 3.2146832855684124], [2.8960016662144206, -1.0430469281355759, 3.9998202420318325, -1.6559279424621645]], [[-3.5156930576395293, -0.48597850185245317, 3.7257929438079795, -4.1940095797975072], [-2.3096213898909235, -3.6340920079081185, -4.7700735518790953, -2.2339075528794918], [0.20614635973201789, 4.9806994714110715, -2.7530593314426186, 2.9830417882330096]]], [[[-2.7432466375239195, 1.1429716817385858, -0.93269032081848913, 4.311637016133048], [-0.63104519316364183, 4.4154426898402761, -4.2532695261352425, 4.4482583634171959], [1.2769472884211366, -2.0419442658110185, -1.4118869594094718, -2.3518706970118086]], [[-3.0611152612339865, 2.2066550902203979, -2.4752383284222823, -0.41623234583664726], [-2.4327557926133228, -0.39424423280582399, -4.8673728447706734, -3.6689858049217361], [0.75963398714993691, -3.9265463066210291, -0.26832728265191808, 1.3766908891334237]]], [[[3.0084995918718906, -3.2214522080267036, 2.8036711098677252, -0.61895370707546604], [2.4696848170803145, 0.57390353065400568, 1.1348836122681583, -4.8577409188472807], [-2.9920739915278158, 0.78088062815757198, 0.8111487027398212, 4.9996664785566018]], [[-3.3796179893674405, -2.578919846883303, 0.37436921793775912, -0.59870001465307077], [-3.4805701616581541, -4.4117016206229458, -2.6433859931937653, -0.5827338927498289], [-4.4766069154127406, 4.1008142643804852, -2.7856573674927656, -2.5597325874899934]]]])  
       arg1=Data(0.275517936362,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-0.10449056120904388, -4.4006123753259363, 0.37715078867667007, 3.3758353078320793], [-0.82158740355879889, 4.2666929079867453, 3.6327799662091804, 3.4902012219299161], [3.1715196025759242, -0.76752899177407219, 4.2753381783933362, -1.3804100061006608]], [[-3.2401751212780256, -0.21046056549094949, 4.0013108801694832, -3.9184916434360035], [-2.0341034535294198, -3.3585740715466148, -4.4945556155175916, -1.9583896165179882], [0.48166429609352157, 5.2562174077725752, -2.4775413950811149, 3.2585597245945133]]], [[[-2.4677287011624158, 1.4184896181000894, -0.65717238445698545, 4.5871549524945516], [-0.35552725680213815, 4.6909606262017798, -3.9777515897737388, 4.7237762997786996], [1.5524652247826403, -1.7664263294495148, -1.1363690230479682, -2.0763527606503049]], [[-2.7855973248724828, 2.4821730265819015, -2.1997203920607786, -0.14071440947514358], [-2.1572378562518191, -0.11872629644432031, -4.5918549084091698, -3.3934678685602324], [1.0351519235114406, -3.6510283702595254, 0.0071906537095856038, 1.6522088254949274]]], [[[3.2840175282333943, -2.9459342716651999, 3.0791890462292288, -0.34343577071396236], [2.7452027534418182, 0.84942146701550936, 1.4104015486296619, -4.582222982485777], [-2.7165560551663122, 1.0563985645190757, 1.0866666391013249, 5.2751844149181055]], [[-3.1041000530059368, -2.3034019105217993, 0.6498871542992628, -0.32318207829156709], [-3.2050522252966505, -4.1361836842614421, -2.3678680568322616, -0.30721595638832522], [-4.2010889790512369, 4.3763322007419889, -2.5101394311312619, -2.2842146511284898]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_constData_rank4(self):  
       arg0=numpy.array(2.81041052209)  
       arg1=Data(numpy.array([[[[1.2307826611393757, -3.8662040472860051, 0.9806767100046283, -4.6916207764987856], [-4.7602334193577516, -1.21962512123332, 4.4686693436364102, -0.15623600416114858], [3.9390707769362958, 2.7985922915462789, -1.5615882500031919, -0.19683139525321458]], [[-2.1856697279459048, 0.56959511659904116, 1.8308962982620809, -0.021681863063705009], [-3.5482366472171103, 4.4887600660916167, -0.00013818205776416903, 2.4547876173066285], [4.6094427486838612, 0.88607977342562805, -2.4526974004843116, 3.2501910549078676]]], [[[2.9450290468070541, 1.5448794797300671, 2.4057832184870511, 2.7747709951026653], [-4.155118196734283, 3.0314451917192766, -3.4040048679846269, 3.3989035902773264], [2.3610997072140947, -0.22395856367735689, -1.5721089891494113, 2.7236223985428882]], [[1.8235554180878584, 3.3063710178376002, -4.3887024958780447, -2.9391701723554187], [0.91508758449939887, -2.4160465984421586, 1.0246857734137604, 0.91913021214545143], [1.4530979842840965, -2.3001241658008609, -2.9998128795019285, 3.7767938728595034]]], [[[-1.8958919868867694, -4.6403026516731973, 2.5702402524152124, -2.9951428137137603], [-1.9057099085962403, 2.4474186076438675, 1.4069805925703456, -4.361641017486642], [-2.0727218861953234, 4.5236969215095399, -3.0160538253391076, 4.0129130605886836]], [[2.0706158939616479, 2.2322411383838014, -0.93303291879747707, 3.3826200928243182], [-4.460195998821435, 1.6087300203935495, -2.5051110617218511, -3.8733154376218595], [2.3044250765985979, -0.16837706537052544, 2.1503764556314202, 1.6898236289827633]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[4.0411931832330117, -1.0557935251923691, 3.7910872320982643, -1.8812102544051497], [-1.9498228972641156, 1.5907854008603159, 7.2790798657300462, 2.6541745179324874], [6.7494812990299318, 5.6090028136399148, 1.2488222720904441, 2.6135791268404214]], [[0.6247407941477312, 3.3800056386926771, 4.6413068203557168, 2.7887286590299309], [-0.73782612512347434, 7.2991705881852527, 2.8102723400358718, 5.2651981394002645], [7.4198532707774971, 3.696490295519264, 0.35771312160932434, 6.0606015770015036]]], [[[5.7554395689006901, 4.3552900018237031, 5.2161937405806871, 5.5851815171963013], [-1.344707674640647, 5.8418557138129126, -0.59359434589099092, 6.2093141123709623], [5.1715102293077306, 2.5864519584162791, 1.2383015329442246, 5.5340329206365242]], [[4.6339659401814943, 6.1167815399312362, -1.5782919737844088, -0.12875965026178271], [3.7254981065930348, 0.39436392365147732, 3.8350962955073964, 3.7295407342390874], [4.2635085063777325, 0.51028635629277508, -0.18940235740829259, 6.5872043949531394]]], [[[0.91451853520686655, -1.8298921295795614, 5.3806507745088483, -0.18473229162012439], [0.90470061349739561, 5.2578291297375035, 4.2173911146639815, -1.5512304953930061], [0.73768863589831257, 7.3341074436031759, -0.20564330324547164, 6.8233235826823195]], [[4.8810264160552839, 5.0426516604774374, 1.8773776032961589, 6.1930306149179541], [-1.6497854767277991, 4.4191405424871855, 0.3052994603717849, -1.0629049155282235], [5.1148355986922338, 2.6420334567231105, 4.9607869777250562, 4.5002341510763992]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_constData_rank1(self):  
       arg0=numpy.array([-3.3596764032837232, -0.62914598804125532])  
       arg1=Data(numpy.array([-2.9122735967358659, 3.8550610160036456]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-6.2719500000195891, 3.2259150279623903]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_constData_rank1(self):  
       arg0=numpy.array([[2.3825933653622657, 0.42851169841824976], [0.46568198109130687, 0.8255960585588511]])  
       arg1=Data(numpy.array([-1.68703679490942, -0.8863704182659804]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[0.69555657045284569, -1.2585250964911703], [-0.42068843717467352, -0.0607743597071293]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_constData_rank2(self):  
       arg0=numpy.array([4.217663001280739, -4.679685407904266])  
       arg1=Data(numpy.array([[0.87105539176877045, -3.0340137359672537], [-4.2193610162528481, 3.8654124854618672]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[5.0887183930495095, 1.1836492653134854], [-8.8990464241571132, -0.81427292244239879]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_constData_rank1(self):  
       arg0=numpy.array([[[1.0985173607158929, 1.1848100515586024, 3.8574035277399155, 2.6015631763778293, 4.6575712416566493], [-1.3065676750152022, 3.5931313113830647, 4.2059792424232647, -3.8604251861616201, -3.5444627467386072], [2.1517207299765175, 0.32652232615408217, 1.9282115933558526, 1.8414080725312747, 0.42458272299923916], [-2.2538157825225591, 2.5620148519804662, -4.5528026485208164, -3.9928711949989748, -1.2089047084365911]], [[0.26540605768766135, -2.020462440074823, 0.81119981604763147, -1.0622685906686566, 4.2422114124165784], [2.5419855750281615, 1.844785874027882, 2.2291436489774963, 0.43143265935409048, 2.3336767782491563], [-3.1301146342023376, -1.1505153770616596, 4.5039205827614719, 3.3384086033856288, 3.3210580605360249], [4.6365960087522655, 2.4948309974026941, 3.3216713220322074, -2.8811715322891551, -1.8763999528224371]]])  
       arg1=Data(numpy.array([2.3722840465843404, -1.9236456924961356]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[3.4708014073002333, 3.5570940981429429, 6.2296875743242559, 4.9738472229621697, 7.0298552882409897], [1.0657163715691382, 5.9654153579674052, 6.5782632890076052, -1.4881411395772797, -1.1721787001542667], [4.524004776560858, 2.6988063727384226, 4.300495639940193, 4.2136921191156151, 2.7968667695835796], [0.11846826406178135, 4.9342988985648066, -2.180518601936476, -1.6205871484146344, 1.1633793381477493]], [[-1.6582396348084742, -3.9441081325709586, -1.1124458764485041, -2.9859142831647922, 2.3185657199204428], [0.61833988253202588, -0.078859818468253629, 0.30549795648136069, -1.4922130331420451, 0.41003108575302072], [-5.0537603266984732, -3.0741610695577952, 2.5802748902653363, 1.4147629108894932, 1.3974123680398893], [2.7129503162561299, 0.5711853049065585, 1.3980256295360718, -4.8048172247852907, -3.8000456453185727]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_constData_rank3(self):  
       arg0=numpy.array([2.6394859282029328, 0.47554606415998979])  
       arg1=Data(numpy.array([[[4.2075107851721114, -2.9834814949260293, -4.6402371996699934, -1.255511599921757, 4.5063303046395653], [1.6710346052243574, -4.7975384914953798, -3.7064148452087906, 1.6651817248498464, 3.4376853459371137], [-1.0762202417788025, -1.2742243656432919, -1.4336250987118371, 0.02217931741118484, -0.8760271313673087], [-2.2645471788305018, -0.75728009215272341, -3.0124704339979678, -0.53486829146474868, -4.6876494965294224]], [[-3.2214567951490336, 4.9181819842283918, -4.5843353128735229, 0.18319164487528994, -1.705542820867735], [1.8765786339897499, -1.7784546188644668, 4.3347929937156806, 0.85911348662032427, -1.3296707604618963], [-4.6327053983891266, 2.5173647325712798, -4.2000007177475336, 0.53617953816541686, 4.8215475549537548], [-2.5104280346557371, -0.94564165092314845, -2.4654051303541302, 2.4531020760021693, -3.4156315132656578]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[6.8469967133750442, -0.3439955667230965, -2.0007512714670606, 1.3839743282811758, 7.1458162328424981], [4.3105205334272902, -2.158052563292447, -1.0669289170058578, 4.3046676530527792, 6.0771712741400465], [1.5632656864241303, 1.3652615625596409, 1.2058608294910957, 2.6616652456141177, 1.7634587968356241], [0.37493874937243099, 1.8822058360502094, -0.37298450579503495, 2.1046176367381841, -2.0481635683264896]], [[-2.7459107309890438, 5.3937280483883816, -4.1087892487135331, 0.65873770903527973, -1.2299967567077452], [2.3521246981497397, -1.302908554704477, 4.8103390578756704, 1.3346595507803141, -0.85412469630190646], [-4.1571593342291369, 2.9929107967312696, -3.7244546535875438, 1.0117256023254066, 5.2970936191137445], [-2.0348819704957473, -0.47009558676315866, -1.9898590661941404, 2.9286481401621591, -2.940085449105668]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_constData_rank1(self):  
       arg0=numpy.array([[[[3.8746981625231207, 0.75646777202774995], [4.0662061712786084, 0.26207534606165073]], [[-0.1878601083202156, -3.1483218336469978], [-1.476711869524665, 0.92320549301514987]], [[3.1056139177710573, 2.4260447869505777], [-3.5085855583468648, -3.8199382365446857]], [[-3.5240447895921068, -0.139448472634081], [-2.9176468309512407, 2.29093649278113]], [[4.8348672633738641, -3.5122023424433468], [-4.3839098560644878, 1.8938174534125265]], [[3.7041818445548493, 0.91749124663789772], [-4.3918248153087989, 4.4426238334090975]]], [[[3.2168546900385682, -1.9943049304741258], [3.8312428098927658, -3.7762084497727786]], [[-4.2988774179298463, -1.9629077411274212], [-4.0357694842688172, 3.2924904313105916]], [[0.99801677396921384, -0.25246442453144802], [-1.0536167076699368, 3.4918449419957653]], [[-4.269253644382724, -2.4498725301172684], [2.8070428590966028, -1.5059046663714817]], [[3.4088961240565325, 0.5743312098707154], [-1.6645109257888935, -4.8724978187610759]], [[-2.6275022638870582, -0.35493417688280626], [-2.7570783828030967, -0.8151256052999063]]]])  
       arg1=Data(numpy.array([-4.77309241085187, 2.9835412036921927]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-0.89839424832874926, -4.01662463882412], [-0.70688623957326158, -4.5110170647902192]], [[-4.9609525191720856, -7.9214142444988678], [-6.2498042803765355, -3.8498869178367201]], [[-1.6674784930808126, -2.3470476239012923], [-8.2816779691987357, -8.5930306473965565]], [[-8.2971372004439772, -4.912540883485951], [-7.6907392418031106, -2.48215591807074]], [[0.061774852521994106, -8.2852947532952168], [-9.1570022669163578, -2.8792749574393435]], [[-1.0689105662970206, -3.8556011642139723], [-9.164917226160668, -0.33046857744277247]]], [[[6.2003958937307608, 0.98923627321806684], [6.8147840135849584, -0.79266724608058592]], [[-1.3153362142376537, 1.0206334625647715], [-1.0522282805766245, 6.2760316350027843]], [[3.9815579776614065, 2.7310767791607446], [1.9299244960222559, 6.475386145687958]], [[-1.2857124406905314, 0.53366867357492431], [5.7905840627887954, 1.477636537320711]], [[6.3924373277487252, 3.5578724135629081], [1.3190302779032992, -1.8889566150688832]], [[0.35603893980513446, 2.6286070268093864], [0.22646282088909597, 2.1684155983922864]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_constData_rank4(self):  
       arg0=numpy.array([-0.78639111262371486, 0.45827346624463328])  
       arg1=Data(numpy.array([[[[-3.3841271468804024, -3.2157607334156815], [-4.5789125838464226, -0.90149790517015305]], [[4.8006487302317726, 1.9969594729031996], [-1.6495317200198265, 4.4126319717460412]], [[-2.5167325893286985, -1.287444451753764], [-2.2193279315464087, -2.2992866691354683]], [[3.0786396776395915, 3.226887924127853], [4.5702159514962108, -1.6065232933310467]], [[0.071464522171826417, -4.3026494112430091], [-4.4574139614119481, 4.03934456762933]], [[0.65429807936292406, -1.2389616519894719], [2.6117560941413878, -4.7180648532632574]]], [[[-1.4471599025080595, 2.3539535421851552], [-2.7940362807699892, -0.6842593700589763]], [[3.7525752704614384, -2.0284801521715421], [3.8478708188398958, 2.737042875480606]], [[-1.1297120458560936, 3.1588449759757378], [3.9918271698257808, 1.4220666981692078]], [[0.89184938889958243, 1.5250464920196301], [-4.5404286891441785, 4.4163109430450884]], [[-1.5793560999017995, -3.763424126675484], [-3.7282708510542006, 0.5621313902070959]], [[0.79880298809049499, -1.4708348760539991], [0.11822405589665319, -1.8192435849481536]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-4.1705182595041173, -4.0021518460393963], [-5.3653036964701375, -1.6878890177938679]], [[4.0142576176080578, 1.2105683602794848], [-2.4359228326435414, 3.6262408591223263]], [[-3.3031237019524133, -2.0738355643774788], [-3.0057190441701236, -3.0856777817591832]], [[2.2922485650158766, 2.4404968115041381], [3.783824838872496, -2.3929144059547616]], [[-0.71492659045188844, -5.089040523866724], [-5.243805074035663, 3.2529534550056152]], [[-0.1320930332607908, -2.0253527646131868], [1.8253649815176729, -5.5044559658869723]]], [[[-0.98888643626342621, 2.8122270084297885], [-2.3357628145253559, -0.22598590381434303]], [[4.2108487367060716, -1.5702066859269088], [4.3061442850845291, 3.1953163417252393]], [[-0.67143857961146036, 3.617118442220371], [4.4501006360704141, 1.8803401644138411]], [[1.3501228551442157, 1.9833199582642633], [-4.0821552228995452, 4.8745844092897217]], [[-1.1210826336571662, -3.3051506604308507], [-3.2699973848095674, 1.0204048564517292]], [[1.2570764543351283, -1.0125614098093658], [0.57649752214128647, -1.3609701187035204]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_constData_rank2(self):  
       arg0=numpy.array([[1.196768330253847, 2.1196638481093029, -0.16679759963264296, 2.0349466328234218, -4.2201172892854384], [1.2806194894163241, 2.423141384483781, -4.8081569493812371, 0.61998574300412024, 1.676372696710744], [4.8056270310225191, 4.8528505011002832, 2.5892916709377509, -0.91039933527188133, -0.25794384746876364], [-2.3598796755905616, -1.5678155220869883, 0.95593370945686118, 1.8634874312160621, 3.6142211509259674]])  
       arg1=Data(numpy.array([[-4.8771767123778789, -0.5215272527225876, 0.44924765678924583, 0.24469718396752516, 3.0813140121110845], [4.0276378033764875, -4.2805351699076581, -3.6672202887485539, -0.98249536637007573, 3.5030698735972869], [0.4641301859561251, -3.126208312054132, 1.9682677812349505, 4.8983739207502861, 2.2232212626072361], [-1.234808583110941, 4.9665149558365105, -3.86001634525591, -2.9676094773625703, -0.76338324287111803]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-3.6804083821240319, 1.5981365953867153, 0.28245005715660287, 2.279643816790947, -1.1388032771743539], [5.3082572927928116, -1.8573937854238771, -8.4753772381297914, -0.36250962336595549, 5.1794425703080309], [5.2697572169786442, 1.7266421890461512, 4.5575594521727014, 3.9879745854784048, 1.9652774151384724], [-3.5946882587015025, 3.3986994337495222, -2.9040826357990488, -1.1041220461465082, 2.8508379080548494]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_constData_rank2(self):  
       arg0=numpy.array([[[1.1113951087200231, 0.58741013047277413], [2.0985280679075755, 0.6473524153756447], [-1.5805153247492387, -1.370033426579699], [-0.76371388107602023, -3.7551551181401353], [-4.577677730174857, -1.7779134342780658]], [[-1.2255241134155193, -1.6669431653042324], [1.6211822248814833, 2.3511150852554721], [-3.0334180026023407, 2.7555278060210586], [-3.2480837234403848, 0.53183256370784715], [-2.2890283945813064, 3.5314088749601886]], [[-4.5591637879631355, -1.7125952056949822], [-3.4250784932595724, -2.7635841494226252], [-1.8169094521580096, 4.1654885273555333], [-1.0039900382270659, -0.36156590057739457], [-4.872840667930781, 0.3085233501066833]], [[1.1030912910177957, -4.1466310803806019], [2.7668280249143464, 3.7981212812684557], [3.206268761606534, -0.9382427084624867], [0.28198438175467988, -1.1109621374962186], [-3.1640525535623198, -3.3995686932288374]]])  
       arg1=Data(numpy.array([[0.60517304393055227, -1.4576251345052604, 1.0965171266828406, 3.2334613068182385, 3.5536152718194494], [-2.2722281638044048, -3.8084379815412825, -1.3736176799009128, -1.3499550995889829, 2.9778230788276128], [2.6463469745346639, -1.4306691462885546, 1.2030662444953428, 4.9675682163827091, 0.65157348157302764], [3.2495021990782096, 0.19462300361412144, -3.0645759622142577, -0.0087581760099908479, -3.3862179786862621]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[1.7165681526505754, 1.1925831744033264], [0.64090293340231508, -0.81027271912961574], [-0.4839981980663981, -0.27351629989685833], [2.4697474257422183, -0.52169381132189674], [-1.0240624583554077, 1.7757018375413836]], [[-3.4977522772199241, -3.9391713291086372], [-2.1872557566597992, -1.4573228962858105], [-4.4070356825032535, 1.3819101261201459], [-4.5980388230293681, -0.8181225358811357], [0.68879468424630641, 6.5092319537878014]], [[-1.9128168134284715, 0.9337517688396817], [-4.8557476395481274, -4.1942532957111798], [-0.61384320766266676, 5.3685547718508762], [3.9635781781556432, 4.6060023158053145], [-4.2212671863577533, 0.96009683167971094]], [[4.3525934900960053, -0.89712888130239232], [2.9614510285284679, 3.9927442848825772], [0.1416927993922763, -4.0028186706767439], [0.27322620574468903, -1.1197203135062095], [-6.5502705322485824, -6.7857866719150994]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_constData_rank3(self):  
       arg0=numpy.array([[0.26111204865097726, -1.6132810265211619, -2.2151416734869853, 4.6239524598554791, 2.8691293967522649], [4.1290941292366146, 4.1379096784474783, -3.2790089466506869, -3.9401148696450203, 4.6998313312897899], [1.7659603524079799, -0.49550026474787767, 3.9490012745983805, 4.9024056305450863, 1.0232538148652992], [-4.1949758241675408, 4.6128363900308074, 1.2837258801799321, -2.4634716501958733, 0.91292619359647187]])  
       arg1=Data(numpy.array([[[3.0478706052300382, 4.7899215729507461], [1.2320230683961206, -2.1804953428570184], [3.1540398131141085, 3.1762205082576287], [-3.5247256598317978, -0.51918066107483529], [-4.7245085131135811, 4.9792625394975314]], [[3.3166815122276709, 1.4325962376001833], [-4.473911508470402, 4.9815239350075178], [0.39518188533608534, -1.1465522023319896], [1.2153020768603673, 3.426987635672468], [-1.7700049158227529, 2.127420133396912]], [[-0.69307261521535146, 2.7484488026982117], [-2.2074104716686547, 3.0261887605036542], [-1.6671604568076557, -4.0571063341730511], [-2.3245102806291773, 4.4682556715241653], [1.0283923571460765, 3.0617440900873323]], [[1.6044347794697185, -4.8025179501481556], [-1.0749297020373625, -4.0975618907550393], [-0.21888561766658299, 3.7777621117745994], [-1.3860618514526712, 2.306220592808824], [3.4284876348385147, -2.5107188456199703]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[3.3089826538810154, 5.0510336216017233], [-0.38125795812504126, -3.7937763693781803], [0.93889813962712321, 0.96107883477064338], [1.0992268000236813, 4.1047717987806438], [-1.8553791163613162, 7.8483919362497963]], [[7.4457756414642855, 5.5616903668367978], [-0.33600183002292372, 9.119433613454996], [-2.8838270613146015, -4.4255611489826769], [-2.724812792784653, -0.51312723397255233], [2.929826415467037, 6.827251464686702]], [[1.0728877371926284, 4.5144091551061916], [-2.7029107364165323, 2.5306884957557765], [2.2818408177907248, -0.10810505957467065], [2.577895349915909, 9.3706613020692515], [2.0516461720113757, 4.0849979049526315]], [[-2.5905410446978223, -8.9974937743156964], [3.5379066879934449, 0.51527449927576807], [1.0648402625133491, 5.0614879919545315], [-3.8495335016485446, -0.15725105738704936], [4.3414138284349866, -1.5977926520234984]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_constData_rank2(self):  
       arg0=numpy.array([[[[-1.8074233450009594, 1.2928682357815919, -0.12012672835495142, 2.1091874200256608, -0.24965322058969086], [2.478787159366461, 0.54530302442139078, -4.516656324099352, -0.11999636601281516, -0.090602153688142728], [3.4075847162888202, 1.3401548583292389, -4.2586816602308186, -2.0375810418765639, -1.1161334004208889], [-3.8270194781117928, -3.846509880270379, 2.5001521356915726, 3.1750307587180622, -4.0352882927249523]], [[1.8582887215949988, -1.8419473718514148, -0.64457468508066995, 1.4100062122710213, -0.63479402059105894], [1.6229367537436339, -3.5141982128478966, 3.7549645902407178, 3.1079800083249012, 1.4651022149814938], [-4.2185229130647608, -3.5153666368746626, -3.5994622642818275, 3.1954405133656056, 1.4607527381141052], [-0.5981889162720897, 0.78948645015309626, 2.2145189197320772, -2.7311549130873503, -4.6610276103788015]], [[-3.0984463311444665, 1.3739393647161577, -1.7419054923868229, 4.6733105853150043, 1.1021035817495983], [-4.0974549432309848, -4.9112653555946491, 4.6971255664265978, 3.6462480215042028, 3.0627884112110522], [1.2305624350958775, -0.075772538950818813, -1.1449218414373852, -3.0317996001038572, -4.2094299741588417], [-0.63828284500458654, 4.511283453926394, -4.7813396664574199, 3.9945406076566154, 0.46532261610150272]], [[2.8437662627505889, -0.55449836281884224, -3.7384432485750994, 0.32875431077062878, 1.5059889438939154], [3.8615025576174862, 1.1140162933508897, -0.60207353305099165, 4.5190019458569743, -4.1991434930051277], [-3.5431193551704965, 3.6515932315211987, 1.6145414834544161, -3.207303738831655, 0.3589818485136842], [-4.7623428746410044, 3.9106462393011814, -1.5989902246869248, 2.9781281976188287, -1.4545606992909796]], [[3.8134857685812307, -4.5395447267926006, 3.3135893875345488, -4.7868605398041373, 2.0649067628312121], [-4.7108110709380675, -1.6606827814310599, 1.1162854952402412, -3.4703543332328559, -4.1447458127151204], [2.0154341767000101, -0.98178846486905691, 0.58473868966129317, 0.68090903790693424, 2.8297306717224346], [-0.29240743846228057, -2.4396912456419981, -1.5357684459221255, -1.7501737609067201, -2.2578798225054797]]], [[[-0.99849716017310097, -4.847176549022012, -4.5311352536302021, 0.81310869476648406, -4.1556871735111001], [-1.0061813330663947, 4.9440322989112513, -3.5851686303049144, -3.5128016214453197, 0.64609055469028931], [-0.43024574423282758, 3.4620391239559112, 4.5128365048152137, 3.8960424173038675, -3.4254668141242304], [4.2472718436736852, 4.7075281473522637, -0.037446269952607025, 0.22350572424830339, 0.56710559732997723]], [[-0.73884277917770103, 4.6500182271744386, -2.8229190846412422, -3.8546564603771003, 0.69081779372094143], [-4.0748111275556429, 4.915028629587546, -2.9440197921320821, -4.2184248184901332, -2.4025298795855008], [1.5964403041936723, 2.3643540860331091, 2.1711616255126138, -3.4134438543338899, 0.31729446187809884], [2.8256280439213013, 1.9939170064769414, 3.5768777764338804, 4.9007761256555842, 0.15756489949956531]], [[-3.9692617823574206, 1.6398542012844031, 0.52470055412530048, 3.9757064554111672, -1.8472108485738858], [2.9328810608616802, -2.1126927703827159, 4.279975180933862, 3.1754560776255261, 1.9964783684408447], [-3.3694311886528725, 4.6748300627758343, -1.5920988186530707, 2.5750045894363058, -2.285161475142826], [-2.8656057323729565, 3.0780370669006647, -2.5329427419136676, -3.2498261281916307, -1.6571781396134533]], [[-2.2542639718175419, -2.8444184878823977, 2.7361017769149409, -2.6518622844218265, 4.0974607805978316], [-4.7763189872186915, 0.90150553701863601, 3.1418846837086978, -2.2313551058235448, 0.68652981597819362], [1.3213067268766707, 0.11255200641852259, -0.035044153376754039, 3.0074583998438751, 0.66726445551452152], [3.7014083362436505, -1.9166847197267201, -2.9498158321332446, -3.8890697275912558, -3.8273568651279399]], [[0.44222290206361681, -0.30561185416458603, 3.64916765749307, 4.7507001342581621, -3.6462358013365215], [3.4464759102367779, 1.2807285293927793, -1.028623928023038, -3.4397954961129704, -3.0196017521613072], [4.8118721127472703, 2.9953066059880173, -1.1860544200577374, 1.9339053310629861, -1.1049234898259641], [3.8739544867214306, -0.48035119562717732, -0.49969464733114144, -3.7734577641925684, -3.9348161589136565]]], [[[3.9493562760625682, -1.6594206534261402, -0.49004103311767189, 0.56059506333196918, -1.946403948698614], [4.3772559802820705, 3.0455683865210936, -2.4643051083074106, -2.2550688045495604, 1.3254857681724026], [-4.3071141486579467, 3.3597173404707021, 2.3295475060861479, -1.0501353640846469, -3.0805857218678123], [-3.0709540817997913, -1.3297746231425354, 4.3468454414004167, 4.669073957416952, 4.9714886874155777]], [[2.7978024006066482, 3.616884038008644, -4.6025788399591514, 0.18113912435978019, 2.2448508636974163], [2.9577536287444453, 3.499501493361608, -2.2065748060582102, -1.296577709173008, 2.8064150350414501], [-2.0187665505145613, 2.1245478726641318, -1.5203050918805272, -0.63074623791553019, 2.6233558719312935], [-0.0051328977570586076, -3.173517139876588, -0.22620206653303132, -0.71647421228178487, 1.3550536195876841]], [[-2.0413834860268976, 4.468832188112815, 1.6741366743614297, -0.81975753811319851, 0.3197393465940781], [-0.066200390238234874, 4.380455654416517, 1.7712630288578746, -2.8844833808338599, 4.2931213894842717], [-2.7069141568590274, -3.2496066290090662, 2.1196499562497273, 3.4124240181530183, 2.0069910480136999], [-3.8143615233164363, 0.83298073951466822, -3.5938222555580457, -3.1887404391152829, -0.99937404350202996]], [[-1.2822805130015515, 0.65202422642198687, -4.0567089508550289, -1.4698227234275096, -4.5104965787276399], [2.9019097035424171, 0.40938501806635941, 4.9857794612588133, -1.3534028014957888, -3.8575192474758602], [-0.89999613828160019, 1.9744944033312599, 0.59880900068479992, -2.3392655902460344, -2.8996416960804803], [2.6386162350974249, 3.8770337248564815, -4.3844491345521668, -2.9424847401763667, -0.32400081176207607]], [[-4.763467798137456, 0.91842704481917092, 0.09581840976303635, -1.3287470905026888, 3.3437659685937344], [-2.1454890125220452, -2.8451213331556069, 4.1722816610514784, -3.6918984994030346, -0.99338247246933165], [-3.3870671147227052, 3.357012604546366, 1.2903705353939108, -0.17871078101138949, -0.29639920575587908], [-2.8790174924037504, 1.5659533817255298, 1.4946598306941858, -3.535212499642677, -0.99453464692178706]]], [[[-3.5269589579694696, 1.6502776357750832, 3.8492891819150863, -4.2127091649145267, -0.17017138869706194], [4.6897205712591745, -0.29448440560867084, 2.1644649856039777, 0.86531876943053732, -1.7507398760284465], [4.4945553783342653, -2.0580214112214734, 0.23554193103632404, 1.7629412749959759, -1.1980315467945313], [0.33897748261898109, -4.0352572663539128, 1.8750238134151056, 0.35650239998483624, -3.6675218262730072]], [[-3.8540864719531873, -3.0698251135474539, -0.95218607814308243, -3.639730404734677, -1.097390667710354], [-3.78220361080405, 2.0058979863871791, 4.5863183006450221, -3.1219457577301224, 4.2842191973948136], [-3.2639299144850131, -4.7454074905715711, -3.4917600933830006, 0.74005501640920812, -3.4981602719621954], [-1.2033985066331643, -0.6256850758073762, 0.33479300951329805, 1.836434578014055, 1.404689628872859]], [[0.63618500144595114, 2.2453069662621257, -2.494835891043147, 3.509627385351985, 3.9958576704091371], [0.11216730007916453, 0.634749208497702, -0.45352556274114697, -2.8173922614701419, -2.049704094130834], [-1.5516238061884478, -0.81288784734968811, -0.74921990550949502, -2.1340524653201975, -0.44770199826281409], [1.0921824433485794, 4.3989685870620079, 2.0259067747309487, -3.729426865602421, 2.8606913398994607]], [[2.5983396174258164, 1.7388289661832097, -1.5120004956458564, -3.2399494077016486, -4.6797613736398427], [-3.502346438743186, 0.850660864096076, 3.1707036081455442, 0.34769483568041526, -0.11627073795179488], [-4.3958655289529958, -0.2959180773779071, -2.7958898045224823, 2.7657686756607456, 3.2830818962171637], [3.855021522890226, 4.4397054476313933, -3.8023175950439567, -4.0981812503705655, -3.9915209036174359]], [[1.9657194035645276, -0.66181099935762955, -2.102778266359322, 4.2795224887402998, -4.3707756492895689], [-1.3612728740308846, -1.1011001670479414, 2.145947976998082, 4.6829559617278722, -1.1573452829843989], [-0.57562017703247204, -4.1504147038509505, -4.4473637116847753, -3.5503781572973683, 0.53624537540475181], [-0.010036413268483813, 2.9861445420259534, -3.2667983645232059, 2.2845221994019846, 0.49212179308968729]]]])  
       arg1=Data(numpy.array([[2.4011705292041352, 2.3495098899905749, -2.2169747135392148, -0.34748964916941372, 4.4084641839832202], [1.8042311607235888, 1.2211690101397954, 1.82215521394542, -0.20526170094908558, -3.5240113302016085], [1.3262238418264065, 4.4991597680398403, 2.6668813860279927, 0.028265638518827352, 1.9986975536127627], [4.9341112506659286, 3.3411096628897337, -1.9711207925249008, 4.4203100836961653, -2.4774589956953719]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[0.59374718420317585, 3.6940387649857271, 2.2810438008491838, 4.510357949229796, 2.1515173086144443], [4.8799576885705962, 2.946473553625526, -2.1154857948952168, 2.28117416319132, 2.3105683755159925], [5.8087552454929554, 3.7413253875333741, -1.8575111310266834, 0.36358948732757135, 1.2850371287832463], [-1.4258489489076576, -1.4453393510662438, 4.9013226648957078, 5.5762012879221974, -1.6341177635208171]], [[4.2077986115855737, 0.50756251813916009, 1.7049352049099049, 3.7595161022615962, 1.7147158693995159], [3.9724466437342087, -1.1646883228573217, 6.1044744802312927, 5.457489898315476, 3.8146121049720687], [-1.8690130230741859, -1.1658567468840877, -1.2499523742912526, 5.5449504033561805, 3.8102626281046801], [1.7513209737184852, 3.1389963401436711, 4.564028809722652, -0.38164502309677539, -2.3115177203882267]], [[-5.3154210446836814, -0.84303534882305708, -3.9588802059260377, 2.4563358717757895, -1.1148711317896165], [-6.3144296567701996, -7.1282400691338639, 2.480150852887383, 1.429273307964988, 0.84581369767183734], [-0.98641227844333734, -2.2927472524900336, -3.3618965549766, -5.2487743136430716, -6.4264046876980565], [-2.8552575585438014, 2.2943087403871791, -6.9983143799966347, 1.7775658941174006, -1.7516520974377121]], [[2.4962766135811751, -0.90198801198825596, -4.0859328977445131, -0.01873533839878494, 1.1584992947245016], [3.5140129084480725, 0.76652664418147598, -0.94956318222040537, 4.1715122966875606, -4.5466331421745414], [-3.8906090043399102, 3.304103582351785, 1.2670518342850023, -3.5547933880010687, 0.011492199344270482], [-5.1098325238104181, 3.5631565901317677, -1.9464798738563385, 2.630638548449415, -1.8020503484603934]], [[8.2219499525644508, -0.13108054280938042, 7.7220535715177689, -0.37839635582091713, 6.4733709468144323], [-0.30234688695484735, 2.7477814025521603, 5.5247496792234614, 0.93810985075036424, 0.26371837126809972], [6.4238983606832303, 3.4266757191141632, 4.9932028736445133, 5.0893732218901544, 7.2381948557056548], [4.1160567455209396, 1.968772938341222, 2.8726957380610947, 2.6582904230765001, 2.1505843614777405]]], [[[0.80573400055048783, -3.0429453882984232, -2.7269040929066133, 2.6173398554900729, -2.3514560127875113], [0.79804982765719412, 6.7482634596348401, -1.7809374695813256, -1.7085704607217309, 2.4503217154138781], [1.3739854164907612, 5.2662702846795, 6.3170676655388025, 5.7002735780274563, -1.6212356534006416], [6.051503004397274, 6.5117593080758525, 1.7667848907709818, 2.0277368849718922, 2.371336758053566]], [[0.48232623096209437, 5.871187237314234, -1.6017500745014468, -2.6334874502373049, 1.9119868038607368], [-2.8536421174158475, 6.1361976397273414, -1.7228507819922867, -2.9972558083503378, -1.1813608694457054], [2.8176093143334677, 3.5855230961729045, 3.3923306356524092, -2.1922748441940945, 1.5384634720178942], [4.0467970540610967, 3.2150860166167368, 4.7980467865736758, 6.1219451357953796, 1.3787339096393607]], [[-2.1471065684120005, 3.4620094152298231, 2.3468557680707205, 5.7978616693565872, -0.025055634628465828], [4.7550362748071002, -0.29053755643729584, 6.102130394879282, 4.9976112915709461, 3.8186335823862647], [-1.5472759747074525, 6.4969852767212544, 0.23005639529234934, 4.3971598033817259, -0.46300626119740595], [-1.0434505184275364, 4.9001922808460847, -0.71078752796824762, -1.4276709142462107, 0.16497707433196673]], [[-2.4595256727666275, -3.0496801888314833, 2.5308400759658554, -2.8571239853709121, 3.892199079648746], [-4.9815806881677771, 0.69624383606955043, 2.9366229827596122, -2.4366168067726304, 0.48126811502910805], [1.1160450259275851, -0.092709694530562992, -0.24030585432583962, 2.8021966988947895, 0.46200275456543594], [3.4961466352945649, -2.1219464206758056, -3.1550775330823302, -4.0943314285403414, -4.0326185660770255]], [[-3.0817884281379917, -3.8296231843661945, 0.12515632729146153, 1.2266888040565536, -7.1702471315381295], [-0.077535419964830599, -2.2432828008088292, -4.5526352582246465, -6.9638068263145794, -6.5436130823629153], [1.2878607825456618, -0.52870472421359116, -4.7100657502593464, -1.5901059991386224, -4.6289348200275722], [0.34994315651982211, -4.0043625258287854, -4.0237059775327495, -7.2974690943941773, -7.4588274891152651]]], [[[5.2755801178889747, -0.33319681159973369, 0.83618280870873463, 1.8868189051583757, -0.62018010687220748], [5.703479822108477, 4.3717922283475001, -1.1380812664810041, -0.92884496272315387, 2.6517096099988091], [-2.9808903068315402, 4.6859411822971087, 3.6557713479125544, 0.2760884777417596, -1.7543618800414058], [-1.7447302399733848, -0.0035507813161288482, 5.6730692832268232, 5.9952977992433585, 6.2977125292419842]], [[7.2969621686464885, 8.1160438060484843, -0.1034190719193111, 4.6802988923996205, 6.7440106317372566], [7.4569133967842856, 7.9986612614014483, 2.2925849619816301, 3.2025820588668323, 7.3055748030812904], [2.480393217525279, 6.6237076407039721, 2.9788546761593131, 3.8684135301243101, 7.1225156399711338], [4.4940268702827817, 1.3256426281632523, 4.272957701506809, 3.7826855557580554, 5.8542133876275244]], [[0.62549790000109518, 7.1357135741408078, 4.3410180603894224, 1.8471238479147942, 2.9866207326220708], [2.6006809957897579, 7.0473370404445097, 4.4381444148858673, -0.21760199480586717, 6.9600027755122644], [-0.040032770831034625, -0.58272524298107342, 4.78653134227772, 6.0793054041810111, 4.6738724340416926], [-1.1474801372884436, 3.499862125542661, -0.92694086953005295, -0.52185905308729019, 1.6675073425259628]], [[-1.2540148744827242, 0.68028986494081423, -4.0284433123362016, -1.4415570849086823, -4.4822309402088125], [2.9301753420612444, 0.43765065658518676, 5.0140450997776407, -1.3251371629769615, -3.8292536089570328], [-0.87173049976277284, 2.0027600418500873, 0.62707463920362727, -2.3109999517272071, -2.8713760575616529], [2.6668818736162523, 3.9052993633753088, -4.3561834960333394, -2.9142191016575394, -0.29573517324324872]], [[-2.7647702445246933, 2.9171245984319336, 2.094515963375799, 0.66995046311007389, 5.3424635222064971], [-0.14679145890928247, -0.8464237795428442, 6.170979214664241, -1.6932009457902719, 1.005315081143431], [-1.3883695611099425, 5.3557101581591287, 3.2890680890066735, 1.8199867726013732, 1.7022983478568836], [-0.88031993879098769, 3.5646509353382925, 3.4933573843069485, -1.5365149460299143, 1.0041629066909756]]], [[[1.407152292696459, 6.5843888864410118, 8.7834004325810149, 0.72140208575140186, 4.7639398619688667], [9.6238318219251031, 4.6396268450572578, 7.0985762362699063, 5.7994300200964659, 3.1833713746374821], [9.4286666290001939, 2.8760898394444552, 5.1696531817022526, 6.6970525256619045, 3.7360797038713973], [5.2730887332849097, 0.8988539843120158, 6.8091350640810342, 5.2906136506507648, 1.2665894243929214]], [[-0.51297680906345366, 0.27128454934227975, 2.3889235847466512, -0.29862074184494336, 2.2437189951793797], [-0.44109394791431633, 5.3470076492769127, 7.9274279635347558, 0.21916390515961126, 7.6253288602845473], [0.077179748404720527, -1.4042978276818374, -0.15065043049326698, 4.0811646792989418, -0.15705060907246171], [2.1377111562565694, 2.7154245870823575, 3.6759026724030317, 5.1775442409037886, 4.7457992917625926]], [[-1.3349357910789497, 0.27418617373722487, -4.4659566835680478, 1.5385065928270842, 2.0247368778842363], [-1.8589534924457363, -1.3363715840271988, -2.4246463552660478, -4.7885130539950431, -4.0208248866557348], [-3.5227445987133486, -2.7840086398745889, -2.7203406980343958, -4.1051732578450988, -2.4188227907877149], [-0.87893834917632141, 2.4278477945371071, 0.054785982206047912, -5.7005476581273218, 0.88957054737455987]], [[7.0186497011219817, 6.159139049879375, 2.9083095880503089, 1.1803606759945167, -0.25945128994367739], [0.91796364495297933, 5.2709709477922413, 7.5910136918417095, 4.7680049193765806, 4.3040393457443704], [0.024444554743169533, 4.1243920063182582, 1.624420279173683, 7.1860787593569109, 7.703391979913329], [8.2753316065863913, 8.8600155313275586, 0.61799248865220857, 0.32212883332559983, 0.42878918007872935]], [[-0.5117395921308443, -3.1392699950530014, -4.5802372620546938, 1.802063493044928, -6.8482346449849407], [-3.8387318697262565, -3.5785591627433133, -0.33151101869728983, 2.2054969660325003, -3.6348042786797707], [-3.0530791727278439, -6.6278736995463223, -6.9248227073801472, -6.0278371529927401, -1.9412136202906201], [-2.4874954089638557, 0.5086855463305815, -5.7442573602185778, -0.19293679629338722, -1.9853372026056846]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_constData_rank4(self):  
       arg0=numpy.array([[2.8580250601066446, 1.188749513838582, 0.77547152415519793, 0.27409642008861645, 1.2878782664518553], [-3.1340667692596846, -3.0715072427403536, -1.8040223750853035, 1.987654568826148, -3.7091100330548188], [-0.90548765778826557, 0.35810565581452281, 3.3460412928015124, 0.73937905959498806, -4.4329531894213936], [-3.8008589485309621, -3.6770964647562785, -4.1998819874636881, 0.81624591189610918, 1.5359583398710068]])  
       arg1=Data(numpy.array([[[[1.8504333649568947, -4.762147212898169, 4.7615753940390295, 0.18043493824447587, -0.052405721481669332], [-1.8621351221482607, -4.5251783683904083, -1.611315498890562, -0.24053697580681632, 3.2965640584339546], [-1.4438593124499621, 3.6507281174143387, 4.9958477640343943, -4.2956809128917515, -4.1813620276060393], [3.3188208846431611, -2.8822810991615633, -3.9386662860907706, -0.32651651491182676, -4.115506003732734]], [[0.27554024837070124, 0.40819093523262406, 0.2121273775518171, -2.6845159861856005, 3.787531239593509], [-1.1125690820164111, -3.9329354330954902, 2.4051570985580506, 3.7328103303325726, 1.6708809590338056], [1.7786153210095792, 4.858922760432046, -4.6794690345228638, -2.6538496580960249, 4.1671929821813531], [-0.83661116800103663, -1.4609922711816461, 3.4918121506809836, -0.65246745210086665, -3.8040179204352076]], [[-4.7040711019232333, 1.6136911504133868, -2.3090405521745518, 1.1036531126578053, 2.3623932394838176], [3.1888175878375229, -0.19235140322289457, 1.9951867361239568, -4.3162393016848712, 1.4349129808484173], [0.12027984186361351, -2.8299965905468474, -4.9374408204818359, -1.3779111357415639, 3.9220193116124538], [-2.4485274696751826, 1.6132871970129052, 0.061593150839761357, -2.4424326625574189, -4.5244894258823756]], [[4.2690871405862847, 3.8406825725312483, -1.5629891290272715, -1.7968633646707355, -0.87262098528729126], [-4.1363742971384223, -4.3179046701874038, 3.7147395499045501, -4.7540078706893185, -3.7475635452161384], [2.8883550479900109, 2.4044875692232361, 2.5112077698324375, 1.1036758395708652, 3.8023049185277955], [-0.66526375234993385, 3.4193299111339144, -2.8709273237972677, -2.9075228980957779, -3.6448033072350619]], [[-4.224048674593881, -0.3118915048287576, -1.5662302781259916, 1.8920077170230094, 2.788877198042103], [3.6651015802328075, 1.0556608950864668, 4.6132128416563152, -4.0423411509029252, 4.4371304420626974], [-4.2643652412012569, 0.99775404620370267, 2.9903310945953407, -4.2418144172804473, 2.2008727614354138], [4.8124717059339783, -0.31257283186843399, -0.97968701087139998, -2.1728354368176839, 0.92523850700189492]]], [[[-1.1863486887578221, 2.2982009463468431, -2.8360344694427777, -3.1851045317410431, 0.49147289907774638], [3.9984232465772784, -0.68318690357174194, -1.3740954770096492, -1.354713883555243, -2.4183479368760361], [1.7308320350168813, 4.2070376537064877, -4.7958071152260642, 0.38743893460219603, -4.8078708164989479], [-0.54305733290268776, -3.3168080330313576, 4.4350377851024518, -2.9224652623144722, -3.9003918751539537]], [[-2.8403035165174639, 1.6092248749007236, -4.0913773667189837, 4.6642498164107487, -3.1314514924982917], [-2.814317020028513, -1.9008827851700936, 2.8833802722902968, -0.63865908838697472, -2.8122149609638103], [3.2934656831463709, -4.2809744322476764, 3.3118652152592034, -4.3062074797391956, 3.255824063681219], [4.5429023109118418, 0.73251894777712856, -0.41576797600934512, -0.97487497851384575, 4.3181124524849945]], [[-4.1316595211780438, -2.4146385652126767, -3.8244418481783757, -4.3702993333998927, 1.4601818972269029], [4.5228563417864809, -0.38566395818319599, 3.3907193499226889, 3.4814781220851554, 1.4065207113878113], [-3.6955806647015099, -0.58872780160874605, -1.6499154627320323, -4.2429666013598251, 2.917356218329143], [0.023469643057369538, 2.2739972693492838, 2.3855773243363485, -3.9083681941703077, 2.7824827573455471]], [[-4.4599880641910818, -2.8257413455804659, 1.6783164389425052, -3.7584235511769393, -4.9817427576709044], [1.3318524716826738, -4.1453567629070687, 0.82851611332255182, 2.7474466349699034, -2.1474871965631817], [-4.951061569000295, 0.018182291642081516, 1.4239075518959377, 4.6532526050441412, 1.0586461104012388], [1.2161633109679055, 1.4477566373645363, 4.2334047239506525, -4.9310751714874677, 0.99619541341950146]], [[-2.7689891296158899, -2.905032521023172, -1.5264039983105624, 4.0658669903054836, -1.225849659658369], [2.8928966835199974, -0.45952310186604528, -4.3981749303693993, 3.6117224437546795, 3.211830443022567], [-3.5850133299845499, 2.0967777764389979, -3.6437555102060024, 3.8025861912217742, 3.9648526855547868], [-0.84204778959356474, -0.43764073847771101, -1.8384973132083537, -4.964101843922915, -2.2152058603869773]]], [[[2.0882949439050371, -3.4649826810804853, -3.4350561953191083, -2.5183988363728647, -3.9890415898720279], [-2.6111677869878491, -1.7270944652631268, -2.1311460286948303, 3.7152284475863855, -2.4556972251596454], [-2.6737911893548425, 4.4905416219523371, -0.63154204260999514, 0.50798568405367739, 4.9751106818864805], [-0.2773241269984128, -2.7300135301355608, 1.4935592632482635, -0.92526333643181058, 1.6007430829515883]], [[2.8959657046442953, -4.3531818942748277, 2.192005815782883, 1.4161156689577652, 4.1106457071404758], [1.5483962877617312, -0.70443779590603661, -0.11893761457318686, 2.2278021087104429, 2.8857822395636603], [-3.3844202411990141, -2.3797101164646586, 0.73596633817142276, -3.9985771403672632, 4.9176755153757039], [2.1139544024374546, -2.0310102192877846, 1.6035442566777069, -4.3380464708942696, 3.8727357987540945]], [[3.7436234658684047, 1.3793273468616549, -0.79952272763287979, -4.6764995229624269, 2.7160127222779824], [1.7196185871622269, 0.36130158532060186, 0.46881341590830328, 2.0398952296353432, -2.2586213088416249], [-4.1698045240754125, 1.4563395598280247, 0.11250837495297894, -1.0911747417912543, 0.099203225734520117], [0.83218939220810473, -0.72002130591228752, 1.4494137838099981, 2.9854703777946332, -1.883799384479683]], [[-1.0792482039821327, 3.3328340164353794, 4.479194534588931, -2.7583467751381461, 1.3958547820397795], [1.259651141456775, 2.7358538788976841, 3.6506116331711187, 4.1846732363766179, 2.1681799729527889], [-0.33349163515652869, -4.8242695874321173, 4.6553588521801128, 2.7426311151752021, -4.7351543133157232], [4.726407197578256, 3.3537043298744837, 4.4507429821853481, -4.1756575109953786, 0.66670143399686133]], [[-4.7879123328311817, 2.2247343480872068, 3.7629345323177095, 3.8235490592751518, 2.9552537961979457], [-1.6902942874319193, 3.2257610337130966, 1.7211083155370952, -3.3857580026513787, 3.7848194649302975], [-1.5519916797377165, -2.7366590133650401, -4.0031330599442612, 3.2523048160616543, 0.68595984865923665], [-1.7696496841256137, -3.3189016871687849, -3.9250902561715506, 2.1108954142999314, 2.1416336618572487]]], [[[-2.023341380061626, -4.2697784369742688, 2.3276408003416682, 2.1220154066360628, 0.37173041770138049], [-1.4124750316851484, -3.831639696822168, 3.5847004123916886, 1.2308909338678706, -1.2575793821080241], [-4.0357059290608817, -0.81606490155036759, -4.7388671701938456, -4.4197752515978808, -2.4266661593232151], [0.24983451924030931, -1.4515473412449009, -4.5359410915376817, -1.8791493084500219, 2.09685682944402]], [[4.5859883427148223, -1.867259504914526, -2.725521414244978, -3.0379475857437477, -4.6078623403041483], [-1.6230791448228565, 2.0874219223183399, 0.30485037259515924, 0.41265395524574178, -1.4756618034173838], [3.7017293114524961, -0.45705103805503278, 0.76901403903799448, 2.430474281104086, 3.0037211904166004], [4.9216633781162713, 2.9789386406355209, -2.1973538006019275, -3.3473330737909457, -3.5954462512139096]], [[4.3290106627533493, 1.2826364155647969, -0.68726424966154021, -1.1700603599341797, -2.9943994372347271], [4.0809461314364572, -4.9751163746165652, 0.4022940077873649, 0.0066056645768881594, -3.9035107309898898], [1.519438574373785, -1.4273412527019067, 2.6503328273976026, -0.81393871097954928, -1.0376214129333592], [-0.3300537349042818, 1.7871271388164969, -1.041854210402958, -3.9850989962759265, -0.026286930114521212]], [[-2.587572972827398, -2.3736919501895679, -3.6510222769979181, 1.2108565608750261, -4.594810191250609], [-4.7111848407208736, -3.6262718861340595, 4.6788226113022731, 4.1055163283282585, -4.5109598902438686], [1.5797185232197686, 0.91184359948499694, 4.870196012796292, -3.8409321683144624, -2.1500627811902753], [-2.6235830698654592, 3.0492548271742486, 0.55746205136961002, -1.9463844410813813, -0.30041155497086613]], [[3.092138144699172, -1.1638862761247069, -4.1476300253532923, 1.2082240637362807, 1.3448936254238397], [-3.6056863621596849, 3.4493245953495464, 2.3810931077977813, -0.75163071705157769, -4.4402078570135464], [-4.8701559784355988, -2.7287765933388486, 4.0005658241799917, -4.2138564251397277, 2.3991878972791501], [-1.270650018873746, -1.5047292771096132, 0.051769888548166776, -3.5439170883528703, 2.7470012395183847]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[4.7084584250635393, -1.9041221527915244, 7.6196004541456741, 3.0384599983511205, 2.8056193386249753], [0.99588993795838388, -1.6671533082837637, 1.2467095612160826, 2.6174880842998283, 6.1545891185405992], [1.4141657476566825, 6.5087531775209833, 7.8538728241410389, -1.4376558527851069, -1.3233369674993947], [6.1768459447498056, -0.024256039054918688, -1.080641225984126, 2.5315085451948178, -1.2574809436260894]], [[1.4642897622092832, 1.596940449071206, 1.4008768913903991, -1.4957664723470185, 4.976280753432091], [0.076180431822170824, -2.7441859192569082, 3.5939066123966326, 4.9215598441711546, 2.8596304728723876], [2.9673648348481612, 6.0476722742706279, -3.4907195206842818, -1.4651001442574429, 5.3559424960199351], [0.35213834583754533, -0.27224275734306413, 4.6805616645195656, 0.53628206173771531, -2.6152684065966256]], [[-3.9285995777680354, 2.3891626745685848, -1.5335690280193539, 1.8791246368130032, 3.1378647636390156], [3.9642891119927208, 0.58312012093230337, 2.7706582602791547, -3.5407677775296733, 2.2103845050036153], [0.89575136601881145, -2.0545250663916494, -4.1619692963266379, -0.60243961158636594, 4.6974908357676517], [-1.6730559455199847, 2.3887587211681032, 0.83706467499495929, -1.6669611384022209, -3.7490179017271776]], [[4.5431835606749011, 4.1147789926198648, -1.288892708938655, -1.522766944582119, -0.59852456519867481], [-3.8622778770498059, -4.0438082500987873, 3.9888359699931666, -4.4799114506007021, -3.473467125127522], [3.1624514680786273, 2.6785839893118526, 2.785304189921054, 1.3777722596594817, 4.076401338616412], [-0.39116733226131739, 3.6934263312225308, -2.5968309037086512, -2.6334264780071615, -3.3707068871464454]], [[-2.9361704081420257, 0.97598676162309772, -0.27835201167413626, 3.1798859834748647, 4.0767554644939583], [4.9529798466846628, 2.3435391615383221, 5.9010911081081705, -2.7544628844510699, 5.7250087085145527], [-2.9764869747494016, 2.285632312655558, 4.2782093610471961, -2.953936150828592, 3.4887510278872691], [6.1003499723858337, 0.97530543458342134, 0.30819125558045535, -0.88495717036582855, 2.2131167734537502]]], [[[-4.3204154580175071, -0.83586582291284151, -5.9701012387024619, -6.3191713010007273, -2.6425938701819383], [0.8643564773175938, -3.8172536728314266, -4.5081622462693343, -4.4887806528149277, -5.5524147061357212], [-1.4032347342428033, 1.0729708844468031, -7.9298738844857493, -2.7466278346574886, -7.9419375857586321], [-3.6771241021623724, -6.4508748022910423, 1.3009710158427672, -6.0565320315741573, -7.0344586444136379]], [[-5.9118107592578175, -1.4622823678396299, -7.1628846094593372, 1.5927425736703951, -6.2029587352386457], [-5.8858242627688666, -4.9723900279104472, -0.18812697045005677, -3.7101663311273283, -5.8837222037041634], [0.22195844040601731, -7.35248167498803, 0.24035797251884983, -7.3777147224795492, 0.18431682094086543], [1.4713950681714882, -2.338988294963225, -3.4872752187496987, -4.0463822212541993, 1.246605209744641]], [[-5.9356818962633469, -4.2186609402979798, -5.6284642232636788, -6.1743217084851967, -0.34384047785840055], [2.7188339667011774, -2.1896863332684995, 1.5866969748373854, 1.6774557469998519, -0.39750166369749218], [-5.4996030397868134, -2.3927501766940495, -3.4539378378173358, -6.0469889764451281, 1.1133338432438395], [-1.780552732027934, 0.46997489426398031, 0.58155494925104501, -5.7123905692556107, 0.97846038226024357]], [[-2.4723334953649339, -0.83808677675431786, 3.6659710077686531, -1.7707689823507913, -2.9940881888447564], [3.3195070405088218, -2.1577021940809207, 2.8161706821486998, 4.7351012037960514, -0.15983262773703366], [-2.963407000174147, 2.0058368604682295, 3.4115621207220856, 6.6409071738702892, 3.0463006792273868], [3.2038178797940535, 3.4354112061906843, 6.2210592927768005, -2.9434206026613197, 2.9838499822456495]], [[-6.4780991626707092, -6.6141425540779908, -5.2355140313653816, 0.35675695725066481, -4.9349596927131874], [-0.81621334953482139, -4.1686331349208636, -8.1072849634242186, -0.097387589300139243, -0.49727959003225175], [-7.2941233630393683, -1.6123322566158209, -7.3528655432608208, 0.093476158166955425, 0.25574265249996797], [-4.5511578226483831, -4.1467507715325294, -5.5476073462631721, -8.6732118769777333, -5.9243158934417961]]], [[[1.1828072861167716, -4.3704703388687509, -4.3405438531073735, -3.4238864941611302, -4.8945292476602935], [-3.5166554447761147, -2.6325821230513924, -3.0366336864830958, 2.8097407897981199, -3.361184882947911], [-3.5792788471431081, 3.5850539641640715, -1.5370297003982607, -0.39750197373458818, 4.069623024098215], [-1.1828117847866784, -3.6355011879238264, 0.58807160545999793, -1.8307509942200761, 0.69525542516332273]], [[3.2540713604588181, -3.9950762384603049, 2.5501114715974058, 1.774221324772288, 4.4687513629549986], [1.906501943576254, -0.34633214009151381, 0.23916804124133595, 2.5859077645249657, 3.2438878953781831], [-3.0263145853844913, -2.0216044606501358, 1.0940719939859456, -3.6404714845527404, 5.2757811711902267], [2.4720600582519774, -1.6729045634732618, 1.9616499124922298, -3.9799408150797468, 4.2308414545686173]], [[7.0896647586699171, 4.7253686396631673, 2.5465185651686326, -1.3304582301609145, 6.0620540150794948], [5.0656598799637393, 3.7073428781221143, 3.8148547087098157, 5.3859365224368556, 1.0874199839598875], [-0.82376323127390005, 4.8023808526295371, 3.4585496677544914, 2.2548665510102581, 3.4452445185360325], [4.1782306850096171, 2.6260199868892249, 4.7954550766115105, 6.3315116705961456, 1.4622419083218294]], [[-0.33986914438714466, 4.0722130760303674, 5.2185735941839191, -2.018967715543158, 2.1352338416347676], [1.9990302010517631, 3.4752329384926721, 4.3899906927661068, 4.924052295971606, 2.9075590325477769], [0.40588742443845938, -4.0848905278371292, 5.3947379117751009, 3.4820101747701901, -3.9957752537207352], [5.4657862571732441, 4.0930833894694718, 5.1901220417803362, -3.4362784514003906, 1.4060804935918494]], [[-9.2208655222525753, -2.2082188413341868, -0.67001865710368413, -0.60940413014624184, -1.4776993932234479], [-6.1232474768533134, -1.207192155708297, -2.7118448738842984, -7.8187111920727723, -0.64813372449109607], [-5.9849448691591096, -7.1696122027864337, -8.4360862493656548, -1.1806483733597393, -3.746993340762157], [-6.2026028735470078, -7.751854876590178, -8.3580434455929442, -2.3220577751214622, -2.2913195275641449]]], [[[-5.8242003285925881, -8.0706373855052309, -1.4732181481892939, -1.6788435418948993, -3.4291285308295816], [-5.2133339802161105, -7.6324986453531301, -0.21615853613927349, -2.5699680146630914, -5.0584383306389862], [-7.8365648775918437, -4.6169238500813297, -8.5397261187248077, -8.2206342001288419, -6.2275251078541771], [-3.5510244292906528, -5.2524062897758625, -8.3368000400686437, -5.680008256980984, -1.7040021190869421]], [[0.90889187795854376, -5.5443559696708045, -6.4026178790012569, -6.7150440505000262, -8.2849588050604268], [-5.300175609579135, -1.5896745424379386, -3.3722460921611193, -3.2644425095105367, -5.1527582681736623], [0.02463284669621757, -4.1341475028113113, -2.908082425718284, -1.2466221836521925, -0.67337527433967814], [1.2445669133599928, -0.69815782412075755, -5.874450265358206, -7.0244295385472242, -7.2725427159701876]], [[0.12912867528966121, -2.9172455718988912, -4.8871462371252283, -5.3699423473978678, -7.1942814246984153], [-0.11893585602723089, -9.1749983620802524, -3.7975879796763232, -4.1932763228868, -8.103392718453577], [-2.6804434130899031, -5.6272232401655948, -1.5495491600660856, -5.0138206984432374, -5.2375034003970473], [-4.5299357223679699, -2.4127548486471913, -5.2417361978666461, -8.1849809837396137, -4.2261689175782093]], [[-1.7713270609312888, -1.5574460382934587, -2.834776365101809, 2.0271024727711353, -3.7785642793544998], [-3.8949389288247644, -2.8100259742379503, 5.4950685231983822, 4.9217622402243677, -3.6947139783477594], [2.3959644351158778, 1.7280895113811061, 5.6864419246924012, -3.0246862564183532, -1.3338168692941661], [-1.80733715796935, 3.8655007390703577, 1.3737079632657192, -1.1301385291852721, 0.51583435692524304]], [[4.6280964845701789, 0.37207206374629997, -2.6116716854822855, 2.7441824036072875, 2.8808519652948466], [-2.069728022288678, 4.9852829352205532, 3.9170514476687881, 0.78432762281942914, -2.9042495171425395], [-3.3341976385645919, -1.1928182534678418, 5.5365241640509986, -2.6778980852687209, 3.9351462371501569], [0.26530832099726087, 0.031229062761393589, 1.5877282284191736, -2.0079587484818635, 4.2829595793893915]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_constData_rank3(self):  
       arg0=numpy.array([[[1.4855757851565006, 4.592422017921864], [2.0280059245681166, 4.2601244951399018]], [[1.7191615244012759, 1.4326389626940728], [0.90578593066574431, -0.22794924855318932]], [[4.0092236364391738, 0.52795009860981601], [-0.10435676267763405, 2.7339288680534235]], [[1.5778656730443466, 4.4510976136290807], [0.42242953886981649, 0.36441554106929619]], [[-2.4841378596114252, 3.3239651217851964], [0.53309243052212629, 3.0555705419578061]], [[3.480841945191349, -3.3670686033382271], [-1.6766223721465225, 3.6804429353275978]]])  
       arg1=Data(numpy.array([[[2.7929270130010924, 2.2270977999144002], [0.66405123130490473, -0.80494237058631146]], [[-2.8774802414319933, 4.578452062902528], [-4.3698941872869126, -2.0673385268993929]], [[-1.8047092288469155, -4.382456549462967], [0.97270035640662833, -3.1474452878190862]], [[-4.8856773378698133, -1.9989278777281818], [-0.92623553823177218, 0.5407018501828631]], [[-4.3808927355120089, 3.2060595939649215], [1.5663285405992831, -0.81591321250481386]], [[0.072778306027705852, -2.2213953844918697], [4.3640020296432862, -2.863020868975986]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[4.2785027981575929, 6.8195198178362642], [2.6920571558730213, 3.4551821245535903]], [[-1.1583187170307174, 6.0110910255966008], [-3.4641082566211683, -2.2952877754525822]], [[2.2045144075922583, -3.854506450853151], [0.86834359372899428, -0.41351641976566267]], [[-3.3078116648254667, 2.4521697359008989], [-0.50380599936195569, 0.90511739125215929]], [[-6.8650305951234341, 6.5300247157501179], [2.0994209711214094, 2.2396573294529922]], [[3.5536202512190549, -5.5884639878300968], [2.6873796574967637, 0.81742206635161185]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_constData_rank3(self):  
       arg0=numpy.array([[[[2.474134670629744, 4.4842465874243764], [1.4722153036469532, 0.77363883776305364]], [[-4.9259610174629387, -3.0322926343163981], [-4.2158043710614326, -2.5044309884367055]]], [[[-4.2785349478662935, -3.8567856586138962], [-2.3011637901395678, 0.55516391816189348]], [[-3.2365871687441796, 0.4969721129578053], [-2.6383460435648862, 0.05209479962936836]]], [[[4.0645581938416573, -1.8836901710596745], [-0.63711423386463295, -2.3812889662264372]], [[1.3144366351155243, -2.7264559754703042], [2.1339292851015434, 4.1035108707408359]]], [[[1.0976056948168988, 3.9787908513142103], [3.1981683893255859, -1.4570760047554066]], [[4.7224263465411518, -1.0216600494154982], [1.3805464603558004, -2.3990587475048586]]], [[[4.1396048367039899, 1.517724946116024], [-1.0019791303587287, 4.9221162695009344]], [[2.2704241486979253, -3.6951359672208071], [3.9012294080771746, 4.3746231373392259]]], [[[2.3673198845373236, -4.0888781807106351], [4.0493911768444111, -4.2198150018531591]], [[2.3050672142283792, 4.366730830872239], [-4.6585580501363584, 3.5409308209507433]]]])  
       arg1=Data(numpy.array([[[1.9326907074685487, 3.6355958407163076], [1.0307295377428281, -0.79264054034315734]], [[-0.89452504096874108, -0.96963817458160229], [-2.6934180041237155, -3.7818498530817104]], [[1.2429864853175001, -1.1990661605405082], [-3.8970096129185903, 4.5354987684768364]], [[1.5002420194790833, -1.4564755013231769], [3.9538901660856229, 3.8197495107984327]], [[3.8256506683005718, 2.0039200009579448], [-0.84380276093090156, 2.7572206688276024]], [[4.4841363776124918, 1.825484584127266], [0.2577935543700649, 0.093196543461898429]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[4.4068253780982927, 6.4169372948929251], [5.1078111443632608, 4.4092346784793612]], [[-3.8952314797201106, -2.00156309657357], [-5.0084449114045899, -3.2970715287798629]]], [[[-5.1730599888350346, -4.7513106995826373], [-3.2708019647211701, -0.41447425641970881]], [[-5.9300051728678955, -2.1964458911659102], [-6.4201958966465966, -3.729755053452342]]], [[[5.3075446791591574, -0.6407036857421744], [-1.8361803944051411, -3.5803551267669453]], [[-2.5825729778030659, -6.6234655883888944], [6.6694280535783799, 8.6390096392176723]]], [[[2.5978477142959822, 5.4790328707932936], [1.741692888002409, -2.9135515060785835]], [[8.6763165126267747, 2.9322301166701248], [5.2002959711542331, 1.4206907632935741]]], [[[7.9652555050045617, 5.3433756144165958], [1.0019408705992161, 6.9260362704588792]], [[1.4266213877670237, -4.5389387281517086], [6.658450076904777, 7.1318438061668283]]], [[[6.8514562621498154, 0.39525819690185671], [5.8748757609716771, -2.3943304177258931]], [[2.5628607685984441, 4.6245243852423039], [-4.5653615066744599, 3.6341273644126417]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_constData_rank4(self):  
       arg0=numpy.array([[[0.87929878755024671, 1.4194273370701262], [-3.9866216206545069, -2.9841020248999706]], [[0.92393523223474361, 0.65442793172150182], [-1.5778811676323947, 1.7598978940956744]], [[-0.3058091926182005, -1.5671620444826084], [2.7834687233724065, 3.2038285430767743]], [[-1.3150801102930387, -0.50348263254637615], [2.1849621054979451, -2.2050780058038932]], [[-3.4572600566446852, -0.23492688296647746], [0.42935548051574557, 1.1922821407966779]], [[-2.6014057673919835, 3.0916749286841085], [-3.7514412975306763, 4.9845519872927753]]])  
       arg1=Data(numpy.array([[[[1.1458256626962351, 2.7225998999937371], [1.7841840749516447, 0.81173748266682022]], [[-1.6236673673943014, -3.6518994812687824], [2.0734809014836797, 4.4320950788052045]]], [[[-2.2360747337584854, -1.6409566802199804], [1.1428338440775576, -0.70563265838477562]], [[4.0000279809190911, 1.7974025366123625], [2.2856323776563379, 2.4031860681147634]]], [[[-1.6291581653941298, 3.6730016201745759], [4.4044631379672516, 3.1262060036606201]], [[3.5634493045733002, -2.5474250321606862], [0.38518282463545006, 4.1061703824281874]]], [[[2.3497190922100692, 4.0757273926960043], [1.9221857862465193, -1.8805723075610525]], [[4.8299339144390778, 0.28726384397307747], [-4.9808188665491269, 0.54446459525247981]]], [[[-4.9665553553819546, 1.1127557155934751], [-3.2405055043914208, 1.6654311983508894]], [[-1.639139408901229, -4.0117290183646599], [2.3809485833870951, 2.7117186918783078]]], [[[2.4591501532029936, -3.8093651908590029], [2.5963885479737563, -1.1210588064973734]], [[4.5858340066382475, 0.53497872508606736], [-0.24181800527410235, -2.2765716173900188]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[2.0251244502464818, 3.6018986875439838], [3.2036114120217709, 2.2311648197369465]], [[-5.6102889880488078, -7.6385211019232893], [-0.91062112341629087, 1.4479930539052339]]], [[[-1.3121395015237418, -0.71702144798523682], [1.7972617757990594, -0.051204726663273803]], [[2.4221468132866963, 0.21952136897996777], [4.0455302717520123, 4.1630839622104379]]], [[[-1.9349673580123303, 3.3671924275563754], [2.8373010934846432, 1.5590439591780116]], [[6.3469180279457067, 0.23604369121172031], [3.5890113677122244, 7.3099989255049618]]], [[[1.0346389819170305, 2.7606472824029655], [1.4187031537001431, -2.3840549401074287]], [[7.0148960199370229, 2.4722259494710226], [-7.1858968723530197, -1.6606134105514134]]], [[[-8.4238154120266397, -2.3445043410512101], [-3.4754323873578983, 1.4305043153844119]], [[-1.2097839283854834, -3.5823735378489143], [3.5732307241837731, 3.9040008326749858]]], [[[-0.14225561418898991, -6.4107709582509864], [5.6880634766578648, 1.9706161221867351]], [[0.83439270910757113, -3.216462572444609], [4.7427339820186729, 2.7079803699027565]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_constData_rank4(self):  
       arg0=numpy.array([[[[3.9966200745410809, 1.2028622982370241, -1.8135461319610426, -1.5195273264205733], [0.29690221401331574, -3.6382142458415059, -3.0501949480769177, -1.8280428627572576], [3.0726464012762449, -3.8362520423687698, 2.8749553418225107, 3.8421808906823909]], [[2.3061082935350612, -2.8517676710746565, -4.1856406719805612, 2.8650282445593787], [-2.4048028594006654, 3.7666862895520197, -1.331246874082912, 0.63850222294528525], [4.0089470874746063, -3.1697492377395187, 4.4924327062801144, -0.80925245192099204]]], [[[3.3018366400039199, 1.0751046148751566, -1.9477061303084255, -1.0076106163913359], [4.3962984233050442, -4.9954647727544099, -1.2581321291689704, 4.796555377332858], [-1.3569950917708606, 1.2583065674917249, -2.6504013261101891, 0.2682480975978665]], [[-2.161210576845801, -4.0060957532079575, -0.48468652831013959, -2.4607169105069469], [-3.6801085864116989, -2.2131837432858328, -2.7974581268102883, -2.1030044118139521], [3.6725319192738688, -3.5625383315388461, -0.69627599070529644, 3.6123705220140661]]], [[[0.66793016177823894, 1.0808168489402483, -2.7513581031607726, 0.81579401000778429], [2.3689123255981235, 0.29161716302733964, -1.7211296517853683, -0.10217864392211773], [-4.570632426848416, 3.7312545479631218, 1.58208984774891, 0.69117333613936438]], [[3.2248700092819487, 1.9105465008516749, -2.0850063667188214, 0.180386156727951], [-2.9371071869299215, 4.1460039955308883, 4.9856740243290272, -2.3235719256028329], [-0.92730315915474648, -4.6112626510913692, -0.16497684436998306, 4.6396315697339769]]]])  
       arg1=Data(numpy.array([[[[-0.68285498064339301, -0.14086726111035031, 4.2021519517894195, -3.782516178231079], [4.2334952985345549, 2.3395551323807862, -0.18905719419452627, 1.6713989138981749], [3.078131425978885, -4.8277582990623564, -1.875666726259233, 1.8800890537204253]], [[2.3267109119324116, 2.8851078887187818, 3.6961099009586995, -3.7841788451876637], [0.85708627105687185, -4.274163126242235, 4.131290250967961, 4.8706286708049671], [4.0543037244090119, 3.2611506059182531, -4.372882017495332, -0.56080161126494144]]], [[[1.9545834332451317, 3.2082205263902335, -0.63290842822035653, -0.99325550153374209], [-3.1034123130296565, 3.7189316816848041, -3.6820276431822965, 1.4178097163921111], [-0.8613235785818496, 0.075951319247209881, 2.7359512534002413, -0.48246576548086306]], [[3.1415112764769511, -1.4670632874026013, -0.15961675748523874, 0.45637837331374609], [-1.3935025459283832, 1.0648200618737969, 4.0253653598331347, 0.69897838068494522], [2.0928075769048569, 1.5134575161100683, -1.6872438763780648, -1.4558646550396981]]], [[[-4.1178106256130356, -0.43483937514580617, 1.7174834839390405, -2.3089116401597276], [-0.99364655611639918, -4.3893347416383026, -2.3042950616430491, -0.37071452713660769], [4.794533375165976, 0.98587287932622658, 4.3993983233394811, -0.92846510663843773]], [[-4.298118062103824, -0.39448215293227928, -3.6328803224419657, 2.0508766237883203], [2.3686777973396689, 3.1232384523211074, 1.5935223767143487, 1.9645601445031815], [-0.78192421462220363, -1.8459631111008932, -4.2864724591233641, 4.7210908063645789]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[3.3137650938976879, 1.0619950371266738, 2.3886058198283768, -5.3020435046516523], [4.5303975125478706, -1.2986591134607197, -3.239252142271444, -0.15664394885908273], [6.1507778272551299, -8.6640103414311262, 0.99928861556327764, 5.7222699444028162]], [[4.6328192054674728, 0.033340217644125314, -0.48953077102186171, -0.91915060062828502], [-1.5477165883437936, -0.50747683669021537, 2.800043376885049, 5.5091308937502523], [8.0632508118836181, 0.091401368178734455, 0.11955068878478237, -1.3700540631859335]]], [[[5.2564200732490516, 4.2833251412653901, -2.5806145585287821, -2.000866117925078], [1.2928861102753877, -1.2765330910696058, -4.9401597723512669, 6.214365093724969], [-2.2183186703527102, 1.3342578867389348, 0.085549927290052175, -0.21421766788299657]], [[0.98030069963115007, -5.4731590406105592, -0.64430328579537832, -2.0043385371932008], [-5.0736111323400817, -1.1483636814120359, 1.2279072330228464, -1.4040260311290069], [5.7653394961787257, -2.0490808154287778, -2.3835198670833613, 2.156505866974368]]], [[[-3.4498804638347966, 0.64597747379444215, -1.0338746192217321, -1.4931176301519433], [1.3752657694817243, -4.097717578610963, -4.0254247134284178, -0.47289317105872541], [0.22390094831756002, 4.7171274272893484, 5.9814881710883911, -0.23729177049907335]], [[-1.0732480528218753, 1.5160643479193956, -5.7178866891607871, 2.2312627805162712], [-0.56842938959025258, 7.2692424478519957, 6.5791964010433759, -0.35901178109965137], [-1.7092273737769501, -6.4572257621922624, -4.4514493034933471, 9.3607223760985558]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_expandedData_rank0(self):  
       arg0=numpy.array(4.60573897745)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-3.25269155651)+(1.-msk_arg1)*(-1.23770285741)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(1.35304742094)+(1.-msk_ref)*(3.36803612004)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_expandedData_rank0(self):  
       arg0=numpy.array([2.2900319386209951, -0.047592113791001367])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-4.98403942172)+(1.-msk_arg1)*(-2.81701471572)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-2.6940074830967111, -5.0316315355087076])+(1.-msk_ref)*numpy.array([-0.52698277709476837, -2.8646068295067648])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_expandedData_rank1(self):  
       arg0=numpy.array(-4.00112431289)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([3.9629919063161996, 1.2765499415043582])+(1.-msk_arg1)*numpy.array([-0.9073047739676996, -1.7646674858753264])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-0.038132406575114963, -2.7245743713869564])+(1.-msk_ref)*numpy.array([-4.9084290868590141, -5.7657917987666405])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_expandedData_rank0(self):  
       arg0=numpy.array([[-2.9629578377835672, -2.6264422578203819, -1.1088919201404579, 1.5964046917929089, -0.83225525989595006], [1.1892753666066316, -1.5735739125194295, 1.5688687500818466, 2.9147772831287702, -3.348076613620603], [-2.2894758449431096, 2.662648292021613, 4.2178629478859335, -1.5580962346132732, -0.62664433189724278], [2.1660815173065151, -0.6155154221384489, 0.65430184225608112, -3.8147837355630498, -2.933535895121083]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-2.6066905502)+(1.-msk_arg1)*(4.68093942402)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-5.5696483879829346, -5.2331328080197492, -3.7155824703398252, -1.0102858584064585, -3.4389458100953174], [-1.4174151835927358, -4.1802644627187968, -1.0378218001175208, 0.30808673292940281, -5.9547671638199704], [-4.896166395142477, 0.055957741822245666, 1.6111723976865662, -4.164786784812641, -3.2333348820966101], [-0.44060903289285225, -3.2222059723378162, -1.9523887079432862, -6.4214742857624172, -5.5402264453204504]])+(1.-msk_ref)*numpy.array([[1.7179815862346866, 2.0544971661978719, 3.5720475038777959, 6.2773441158111627, 3.8486841641223037], [5.8702147906248854, 3.1073655114988243, 6.2498081741001004, 7.595716707147024, 1.3328628103976508], [2.3914635790751442, 7.3435877160398668, 8.8988023719041873, 3.1228431894049806, 4.054295092121011], [6.8470209413247689, 4.0654240018798049, 5.3352412662743349, 0.86615568845520396, 1.7474035288971708]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_expandedData_rank2(self):  
       arg0=numpy.array(3.38090071426)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[-2.9470358042208655, -3.8304675083019015, -1.2982540158949964, 1.1801250555067879, -4.6982852593800741], [-0.41923346775052295, 1.9987918776830496, -4.9410769542298718, 3.0299688949586265, 4.8555443920406169], [1.9403761425197512, -3.9599253672326995, -2.1961931458000095, -3.8636223760508601, 2.4740127777147549], [4.28535209881505, 1.922639288328865, 4.8101975818734548, -1.781400869082308, 3.1635918597018211]])+(1.-msk_arg1)*numpy.array([[-3.7221657731108659, -2.8121902336705928, 3.6607358174884723, -0.91780337830377157, -4.1288937127729302], [-4.7621480451289768, -1.1599815241662883, 1.9710788247226674, -3.9024560439274989, -3.7303929121375656], [3.0929788420766435, -3.2404004842391676, -0.81956042839048759, 4.7767758413406707, -0.63005574639846262], [-2.9853286381703201, -1.2971386598842241, 1.4111808906334842, 0.83506922922911375, -2.5608605181097088]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[0.43386491003672845, -0.44956679404430755, 2.0826466983625975, 4.5610257697643819, -1.3173845451224802], [2.961667246507071, 5.3796925919406435, -1.5601762399722778, 6.4108696092162205, 8.2364451062982109], [5.3212768567773452, -0.57902465297510552, 1.1847075684575845, -0.48272166179326614, 5.8549134919723489], [7.6662528130726439, 5.303540002586459, 8.1910982961310488, 1.599499845175286, 6.5444925739594151]])+(1.-msk_ref)*numpy.array([[-0.34126505885327196, 0.56871048058700113, 7.0416365317460663, 2.4630973359538224, -0.74799299851533618], [-1.3812473308713829, 2.2209191900913057, 5.3519795389802614, -0.52155532966990492, -0.34949219787997166], [6.4738795563342375, 0.14050023001842638, 2.5613402858671064, 8.1576765555982647, 2.7508449678591314], [0.39557207608727385, 2.0837620543733699, 4.7920816048910782, 4.2159699434867077, 0.82004019614788515]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_expandedData_rank0(self):  
       arg0=numpy.array([[[-2.9965957016436393, 2.5513496079212752], [2.0523313415190785, -0.44495902037177704]], [[-4.4152858390991634, 2.4062495601144507], [0.88265312575714372, 1.4004060636252857]], [[4.3026462767988374, 0.50561631402907636], [3.7709669995862836, -0.39715492204412417]], [[2.3182516436021796, 1.1197213788595537], [1.916962719158458, 4.6452191838096404]], [[-1.7982123418191884, -1.8548467478545017], [3.1431719021094331, 1.589623643211401]], [[3.7084120036306132, 1.9805885957585705], [-0.24004768865483417, -1.3526411664571283]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(0.612726686437)+(1.-msk_arg1)*(0.354716228902)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-2.3838690152062423, 3.1640762943586722], [2.6650580279564755, 0.16776766606561999]], [[-3.8025591526617664, 3.0189762465518477], [1.4953798121945407, 2.0131327500626828]], [[4.9153729632362344, 1.1183430004664734], [4.3836936860236806, 0.21557176439327286]], [[2.9309783300395766, 1.7324480652969507], [2.529689405595855, 5.2579458702470374]], [[-1.1854856553817914, -1.2421200614171046], [3.7558985885468301, 2.2023503296487981]], [[4.3211386900680102, 2.5933152821959675], [0.37267899778256286, -0.73991448001973126]]])+(1.-msk_ref)*numpy.array([[[-2.6418794727411985, 2.906065836823716], [2.4070475704215193, -0.090242791469336225]], [[-4.0605696101967226, 2.7609657890168915], [1.2373693546595845, 1.7551222925277266]], [[4.6573625057012782, 0.86033254293151717], [4.1256832284887244, -0.042438693141683359]], [[2.6729678725046204, 1.4744376077619945], [2.2716789480608988, 4.9999354127120812]], [[-1.4434961129167476, -1.5001305189520608], [3.4978881310118739, 1.9443398721138418]], [[4.063128232533054, 2.3353048246610113], [0.11466854024760664, -0.99792493755468747]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_expandedData_rank3(self):  
       arg0=numpy.array(2.14379852417)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[2.6600665448460337, 0.39158054031152467], [4.2343525379142601, 0.64976700277080379]], [[4.9842847347892398, 3.644098148943911], [3.8874752660815908, 3.3663470814645873]], [[-4.6490822834154644, -3.0798116648583318], [3.1260739526726837, -3.8868887711749514]], [[-2.8642097063176877, -4.2669947917986235], [3.0032745142568391, 3.4794815844630875]], [[1.5288121462414948, 2.0991145250981713], [1.8475229456152373, 2.6327392607684637]], [[-3.712191166628843, 3.1177490397165357], [1.606700597299735, -2.4625923368587808]]])+(1.-msk_arg1)*numpy.array([[[-0.62883645206957439, 0.89239105373864813], [0.4363105856796734, 4.3785028805098047]], [[-4.4509546138452265, 2.0474958169941981], [0.97334676124469155, -0.5617039202427101]], [[-4.2739902202480549, -2.9840391229359131], [-3.7323990207426561, -2.5802135304134142]], [[0.72420849963517675, 1.447077441136563], [0.9219091575814673, 1.2268740485361809]], [[3.4736358477117761, 1.9312595345930355], [-3.4601687079725618, -3.6049558199872567]], [[-1.2569729676943564, -0.94051849356611239], [3.3412035223645304, -0.99059603799875529]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[4.8038650690136677, 2.5353790644791587], [6.3781510620818942, 2.7935655269384378]], [[7.1280832589568739, 5.7878966731115451], [6.0312737902492248, 5.5101456056322213]], [[-2.5052837592478303, -0.93601314069069774], [5.2698724768403178, -1.7430902470073173]], [[-0.72041118215005362, -2.1231962676309895], [5.1470730384244732, 5.6232801086307216]], [[3.6726106704091288, 4.2429130492658054], [3.9913214697828714, 4.7765377849360977]], [[-1.5683926424612089, 5.2615475638841698], [3.7504991214673691, -0.31879381269114671]]])+(1.-msk_ref)*numpy.array([[[1.5149620720980597, 3.0361895779062822], [2.5801091098473075, 6.5223014046774388]], [[-2.3071560896775924, 4.1912943411618322], [3.1171452854123256, 1.582094603924924]], [[-2.1301916960804208, -0.84024059876827906], [-1.588600496575022, -0.43641500624578011]], [[2.8680070238028108, 3.5908759653041971], [3.0657076817491014, 3.3706725727038149]], [[5.6174343718794102, 4.0750580587606695], [-1.3163701838049278, -1.4611572958196226]], [[0.88682555647327765, 1.2032800306015217], [5.4850020465321645, 1.1532024861688788]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_expandedData_rank0(self):  
       arg0=numpy.array([[[[2.1823008198263256, -2.3152674786714633, -3.1127002262575933, 2.191405372350447], [-1.7729056650225883, 1.2715198918258057, 4.5680218088123414, -1.5092705871342127], [3.5174063500473878, -4.4606564854649982, 3.5334770594031042, 3.079668163881319]], [[1.899482549088809, -1.4440115299378631, -4.8551344423215319, 1.3495264630058017], [-2.5706260800313907, 1.6556225815866368, -0.65512755257743649, 2.8824461661642067], [1.6968882502780964, 3.4375994085335506, 2.1931274321762348, -4.7147891701569566]]], [[[-1.9553652005469466, 4.5719331923404241, 2.4322058373914608, 4.0253842756959859], [-2.658633066939494, -1.1398171696473334, 4.0272863887186325, 3.7670594774519799], [-1.3746505909758335, 4.4992205617450143, 4.2931588972856325, 2.4403022129179757]], [[-0.7381837945755958, 2.106479165114445, 4.4610289578805382, 0.30530165140419196], [2.3638772249926294, -3.9692931185668878, 4.7710467956452405, -1.0837893193606396], [-1.0832601946364697, -0.34460157870270969, 2.5605870461575595, 2.8752053435110589]]], [[[3.1601547151200453, -2.3733043342334414, -2.9907574203388956, 0.1777714228353533], [3.6378965896220219, 4.0503704167903152, -3.6012745150737988, -2.2860806597418035], [-0.86663162915989655, -4.1874531386712182, 4.9587921504621715, 0.27508923389959428]], [[4.4912620455354713, 4.0418923967212557, 2.7647916782994484, 4.5503056223637675], [0.39009270679185715, 2.9852981155544969, -3.707782238686268, 4.5473200613816598], [1.3162870342761988, 4.0248285414876346, 2.1703729759773669, 2.9353850590538277]]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.61548093281)+(1.-msk_arg1)*(3.93973020395)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[5.7977817526371567, 1.3002134541393677, 0.5027807065532377, 5.806886305161278], [1.8425752677882428, 4.8870008246366368, 8.1835027416231725, 2.1062103456766184], [7.1328872828582188, -0.84517555265416711, 7.1489579922139352, 6.6951490966921501]], [[5.51496348189964, 2.171469402872968, -1.2396535095107009, 4.9650073958166328], [1.0448548527794403, 5.2711035143974678, 2.9603533802333946, 6.4979270989750377], [5.3123691830889275, 7.0530803413443817, 5.8086083649870659, -1.0993082373461256]]], [[[1.6601157322638844, 8.1874141251512551, 6.0476867702022918, 7.6408652085068169], [0.95684786587133708, 2.4756637631634977, 7.6427673215294636, 7.3825404102628109], [2.2408303418349975, 8.1147014945558453, 7.9086398300964635, 6.0557831457288067]], [[2.8772971382352353, 5.721960097925276, 8.0765098906913693, 3.920782584215023], [5.9793581578034605, -0.35381218575605677, 8.3865277284560715, 2.5316916134501914], [2.5322207381743613, 3.2708793541081214, 6.1760679789683905, 6.49068627632189]]], [[[6.7756356479308764, 1.2421765985773896, 0.62472351247193547, 3.7932523556461843], [7.2533775224328529, 7.6658513496011462, 0.01420641773703224, 1.3294002730690275], [2.7488493036509345, -0.57197220586038711, 8.5742730832730025, 3.8905701667104253]], [[8.1067429783463023, 7.6573733295320867, 6.3802726111102794, 8.1657865551745985], [4.0055736396026882, 6.6007790483653279, -0.092301305875436945, 8.1628009941924908], [4.9317679670870298, 7.6403094742984656, 5.7858539087881979, 6.5508659918646588]]]])+(1.-msk_ref)*numpy.array([[[[6.1220310237783018, 1.6244627252805128, 0.8270299776943828, 6.1311355763024231], [2.1668245389293879, 5.2112500957777819, 8.5077520127643176, 2.4304596168177635], [7.4571365539993639, -0.520926281513022, 7.4732072633550803, 7.0193983678332952]], [[5.8392127530407851, 2.4957186740141131, -0.91540423836955576, 5.2892566669577779], [1.3691041239205854, 5.5953527855386129, 3.2846026513745397, 6.8221763701161828], [5.6366184542300726, 7.3773296124855268, 6.132857636128211, -0.77505896620498049]]], [[[1.9843650034050295, 8.5116633962924002, 6.3719360413434369, 7.965114479647962], [1.2810971370124822, 2.7999130343046428, 7.9670165926706087, 7.706789681403956], [2.5650796129761426, 8.4389507656969904, 8.2328891012376086, 6.3800324168699518]], [[3.2015464093763804, 6.0462093690664211, 8.4007591618325144, 4.2450318553561681], [6.3036074289446056, -0.029562914614911673, 8.7107769995972166, 2.8559408845913365], [2.8564700093155064, 3.5951286252492665, 6.5003172501095356, 6.8149355474630351]]], [[[7.0998849190720215, 1.5664258697185347, 0.94897278361308057, 4.1175016267873294], [7.577626793573998, 7.9901006207422913, 0.33845568887817734, 1.6536495442101726], [3.0730985747920796, -0.24772293471924201, 8.8985223544141476, 4.2148194378515704]], [[8.4309922494874474, 7.9816226006732318, 6.7045218822514245, 8.4900358263157436], [4.3298229107438333, 6.925028319506473, 0.23194796526570816, 8.4870502653336359], [5.2560172382281749, 7.9645587454396107, 6.110103179929343, 6.8751152630058039]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_expandedData_rank4(self):  
       arg0=numpy.array(-2.07689461008)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-0.97201154258677214, -1.6963580647408802, -0.84214550696182133, -1.9833943544838153], [4.2272686986455774, -4.045462544750551, 3.9428631910892733, -0.43484906501067222], [3.03270504256359, 0.70692372456239383, 1.545312580200827, -1.9481817826687364]], [[-0.20862835805177671, -2.3857838611048221, 3.203949261344043, -4.8660536695259236], [4.5334078495440462, -3.8327019616128655, -4.0692703335183653, 4.6392151236330683], [0.7610852270498043, 4.0536338277552577, 1.853217859186528, -1.7219491013460155]]], [[[-4.467898207071026, 3.3945415674616335, -2.6888488821618353, 1.5178062175673777], [3.5234453927307126, 1.51647537148766, -2.2768668113827237, 1.974437888294859], [4.8073937643995244, -1.4874821438533692, -0.45634183042491028, -2.3767137848106055]], [[-4.8018798445144029, 4.6357310949035391, -1.6029658399808264, -2.7494400796220795], [0.70384491619381251, -4.0032344870588696, 3.3079211678339355, -4.7059749917343225], [1.7829450693011095, 1.1276730331815221, 1.2624729629451181, 4.7455492884037529]]], [[[4.2056882218672129, -0.82316872553680298, -2.0001302464709125, -0.95925596208400421], [3.2645937015763398, 4.9562353299622544, 0.9038318953084632, -3.7869908429772248], [4.6557203544484889, -2.4924370596234136, 0.55363665483289815, 0.89493400599397965]], [[0.30232184836053033, -3.2853160238730128, 2.4651709593260742, -4.457485437944201], [4.787459253526233, -3.3880732884771514, 3.5687404270355589, 3.4651447531447737], [4.3433946888123618, 3.4450205494612245, 3.0417659634823373, 2.1528913679998949]]]])+(1.-msk_arg1)*numpy.array([[[[2.0759692187557208, -1.2684665643760029, -0.69298268334834567, -2.9881132000197796], [-0.40317665727650365, -1.8466459254467771, 0.96327725704196698, 2.9252788620556336], [1.9466794625458839, -4.9422288471297362, -2.5181436908674937, -2.7968289875502537]], [[3.8576155892979695, -4.5515390249682479, 3.4427168834073534, 1.7790636700740272], [-1.0170352614261411, -1.7751323130380268, 2.4679875345026243, -2.6788908909978937], [-4.0496935502002342, 0.74940706753586905, 0.73653201661187939, 0.25615289956514786]]], [[[2.4156630301587967, -1.1557801953106948, 0.860736640006313, 0.35246630980212146], [1.9170720879637315, 1.6253927060302225, 0.72493001481675101, -3.8349824987028445], [-0.019107092626987843, -2.5491350127557642, 0.20474515293419415, 4.2198418656931338]], [[0.05659512997617, 0.38817094877683278, -0.080198188909704982, -1.05122267538035], [1.3078843587918056, 0.69628507984258903, 1.6503581283978122, 4.0741233129300536], [-0.43870200424096595, -1.4112033326199258, 4.4469884998423641, -0.77069240450599619]]], [[[-3.7890665896042206, -0.52760077096252189, 4.5458786983200614, 1.5101772287532675], [1.5615222723460054, 4.5473118314156142, -4.079798376972585, -2.1749911271966682], [1.3838446927546588, 0.37200492312992672, -2.325703054321596, 4.9622825491330662]], [[-0.88537795962315791, -0.13118918645030142, -0.67281415815571766, 0.87276370744177179], [3.9319844257339582, 1.856517508369131, -4.9862581265657333, -2.3149148107991446], [2.5196109539893738, 1.7216699132252948, -3.9604079391893245, 2.9723058741752482]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-3.0489061526655954, -3.7732526748197035, -2.9190401170406446, -4.0602889645626385], [2.1503740885667542, -6.1223571548293743, 1.86596858101045, -2.5117436750894955], [0.95581043248476671, -1.3699708855164294, -0.5315820298779963, -4.0250763927475592]], [[-2.2855229681306, -4.4626784711836454, 1.1270546512652198, -6.9429482796047468], [2.4565132394652229, -5.9095965716916883, -6.1461649435971886, 2.5623205135542451], [-1.315809383029019, 1.9767392176764345, -0.22367675089229522, -3.7988437114248388]]], [[[-6.5447928171498493, 1.3176469573828102, -4.7657434922406585, -0.5590883925114456], [1.4465507826518893, -0.56041923859116327, -4.353761421461547, -0.10245672178396426], [2.7304991543207011, -3.5643767539321924, -2.5332364405037335, -4.4536083948894287]], [[-6.8787744545932261, 2.5588364848247158, -3.6798604500596497, -4.8263346897009027], [-1.3730496938850107, -6.0801290971376929, 1.2310265577551123, -6.7828696018131458], [-0.29394954077771374, -0.94922157689730113, -0.81442164713370513, 2.6686546783249296]]], [[[2.1287936117883897, -2.9000633356156262, -4.0770248565497358, -3.0361505721628275], [1.1876990914975165, 2.8793407198834311, -1.1730627147703601, -5.8638854530560476], [2.5788257443696656, -4.5693316697022368, -1.5232579552459251, -1.1819606040848436]], [[-1.7745727617182929, -5.3622106339518361, 0.38827634924725096, -6.5343800480230243], [2.7105646434474098, -5.4649678985559742, 1.4918458169567357, 1.3882501430659504], [2.2665000787335385, 1.3681259393824012, 0.96487135340351404, 0.075996757921071634]]]])+(1.-msk_ref)*numpy.array([[[[-0.00092539132310243133, -3.3453611744548262, -2.7698772934271689, -5.0650078100986029], [-2.4800712673553269, -3.9235405355256003, -1.1136173530368563, 0.84838425197681033], [-0.13021514753293939, -7.0191234572085595, -4.5950383009463174, -4.8737235976290769]], [[1.7807209792191463, -6.6284336350470712, 1.3658222733285301, -0.29783094000479604], [-3.0939298715049643, -3.85202692311685, 0.39109292442380106, -4.7557855010767174], [-6.1265881602790575, -1.3274875425429542, -1.3403625934669439, -1.8207417105136754]]], [[[0.33876842007997343, -3.232674805389518, -1.2161579700725103, -1.7244283002767018], [-0.15982252211509174, -0.4515019040486008, -1.3519645952620722, -5.9118771087816677], [-2.0960017027058111, -4.6260296228345874, -1.8721494571446291, 2.1429472556143105]], [[-2.0202994801026533, -1.6887236613019905, -2.1570927989885282, -3.1281172854591732], [-0.76901025128701761, -1.3806095302362342, -0.4265364816810111, 1.9972287028512303], [-2.5155966143197892, -3.4880979426987491, 2.3700938897635409, -2.8475870145848194]]], [[[-5.8659611996830439, -2.6044953810413451, 2.4689840882412382, -0.56671738132555571], [-0.51537233773281788, 2.470417221336791, -6.1566929870514082, -4.2518857372754919], [-0.69304991732416443, -1.7048896869488965, -4.4025976644004192, 2.885387939054243]], [[-2.9622725697019812, -2.2080837965291247, -2.7497087682345409, -1.2041309026370515], [1.855089815655135, -0.22037710170969227, -7.0631527366445566, -4.3918094208779674], [0.44271634391055059, -0.35522469685352842, -6.0373025492681478, 0.89541126409642491]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_expandedData_rank1(self):  
       arg0=numpy.array([-0.11615604807470259, 0.77617041391929931])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([-0.297052202763747, 2.0899018942884426])+(1.-msk_arg1)*numpy.array([2.8155753444009015, 0.11356971064863863])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([-0.41320825083844959, 2.8660723082077419])+(1.-msk_ref)*numpy.array([2.6994192963261989, 0.88974012456793794])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_expandedData_rank1(self):  
       arg0=numpy.array([[-1.6624274366095904, -2.6213454739501585], [2.6487456410906081, -4.3959044947467349]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([4.0971878493427667, 1.2742200567746256])+(1.-msk_arg1)*numpy.array([0.045482077426734158, -1.2851117608893938])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[2.4347604127331763, 1.4758423753926082], [3.9229656978652336, -3.1216844379721094]])+(1.-msk_ref)*numpy.array([[-1.6169453591828562, -2.5758633965234243], [1.3636338802012142, -5.6810162556361288]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_expandedData_rank2(self):  
       arg0=numpy.array([-2.1870540723043987, 1.5756813736345467])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[-4.0266837433531757, -1.0021302983906812], [0.59527983386483818, 1.7826943177764933]])+(1.-msk_arg1)*numpy.array([[-2.2667171096214367, 0.49629966897668876], [-4.4710663061770282, -2.9901553965551075]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-6.2137378156575744, -3.18918437069508], [2.1709612074993849, 3.3583756914110401]])+(1.-msk_ref)*numpy.array([[-4.4537711819258359, -1.69075440332771], [-2.8953849325424814, -1.4144740229205608]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_expandedData_rank1(self):  
       arg0=numpy.array([[[-0.12956725054919183, 4.8220614900062895, 1.5533139234803608, -2.2747254417197404, -0.33960001210992097], [2.1764799302513493, 2.8148085117902983, 2.9036667299574432, 2.3224838586437455, 2.8244896568416644], [0.29085825754997163, 3.5723054387154143, 1.4152036560376757, -3.2044270195127824, 2.3874341352901363], [0.050691153925111365, 2.6046706642557904, -2.6785145812543796, -0.63266637255317271, 2.6896917629070494]], [[-2.4611684785477941, 0.8651513535335944, 4.1865218874460943, 0.51940508548450115, -0.6154699257261198], [-4.8815631840642411, -1.7531770362342582, -0.54178122383865457, -4.1555928631733714, 4.813981433474062], [2.0944110609799003, -0.92745010906252823, 3.9706715045374192, -2.9813458716070054, 2.0144972177717477], [0.073413703621736381, 0.95844173369420105, -4.3489095413584655, -1.904559758398312, 1.5842933125051486]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([1.3947362639006009, 0.069870593557721961])+(1.-msk_arg1)*numpy.array([-3.2471652471356451, -4.5622038387101842])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[1.2651690133514091, 6.2167977539068904, 2.9480501873809617, -0.87998917781913955, 1.0551362517906799], [3.5712161941519502, 4.2095447756908992, 4.2984029938580441, 3.7172201225443464, 4.2192259207422653], [1.6855945214505725, 4.9670417026160152, 2.8099399199382766, -1.8096907556121815, 3.7821703991907372], [1.4454274178257123, 3.9994069281563913, -1.2837783173537787, 0.7620698913474282, 4.0844280268076503]], [[-2.3912978849900721, 0.93502194709131636, 4.2563924810038163, 0.58927567904222311, -0.54559933216839784], [-4.8116925905065191, -1.6833064426765363, -0.47191063028093261, -4.0857222696156494, 4.883852027031784], [2.1642816545376222, -0.85757951550480627, 4.0405420980951412, -2.9114752780492834, 2.0843678113294697], [0.14328429717945834, 1.028312327251923, -4.2790389478007436, -1.8346891648405901, 1.6541639060628706]]])+(1.-msk_ref)*numpy.array([[[-3.376732497684837, 1.5748962428706443, -1.6938513236552843, -5.521890688855386, -3.5867652592455661], [-1.0706853168842958, -0.4323567353453468, -0.3434985171782019, -0.92468138849189963, -0.42267559029398072], [-2.9563069895856735, 0.32514019157976914, -1.8319615910979694, -6.4515922666484276, -0.85973111184550888], [-3.1964740932105338, -0.64249458287985473, -5.9256798283900247, -3.8798316196888178, -0.55747348422859577]], [[-7.0233723172579783, -3.6970524851765898, -0.37568195126408988, -4.0427987532256831, -5.177673764436304], [-9.4437670227744253, -6.3153808749444424, -5.1039850625488388, -8.7177967018835556, 0.25177759476387784], [-2.4677927777302839, -5.4896539477727124, -0.59153233417276496, -7.5435497103171896, -2.5477066209384365], [-4.4887901350884478, -3.6037621050159832, -8.9111133800686488, -6.4667635971084962, -2.9779105262050356]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_expandedData_rank3(self):  
       arg0=numpy.array([-4.4226850544175731, -3.5064184525599251])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[1.8998499538055, -4.1921130859415667, -4.4827107750770807, -1.6584600895237744, -4.1080931255923856], [-1.7778394572608027, 4.2746451568520705, -0.10904402948457825, 3.8121467771216491, 3.338064696034488], [1.2743126042635406, 3.9389068960014377, 2.0370606978774948, 2.3521083775801177, -2.5779920959100302], [2.2197178982604813, 1.112284698269451, 4.8387727338978657, 3.2163718280546263, 3.5178903083715163]], [[-1.3135188855508471, -2.662577405698098, 4.5177322170092964, -1.0262758558416083, -1.4438511780139773], [4.2054738674485765, 4.2861799189611194, -1.0126036058697974, 4.994471467131028, -4.0843142859000778], [-3.6160704612948225, -0.60514325922962797, -4.0103288842097058, -1.6864701526049011, 0.040786657534202853], [3.8540228645443371, 2.0904606259666032, -3.2797359797943937, -2.7388766428150682, -1.7062721544161832]]])+(1.-msk_arg1)*numpy.array([[[-4.335642555957774, 3.6769843704539635, -2.791655486804431, -2.3273208891535955, 4.1003591047415071], [-4.1618623343891841, 3.8417443041034396, -2.5907923504604593, -4.0626138220249199, 3.158883919231922], [2.8512028089729533, -2.8083399723664746, -1.0798260057758213, -1.850767950605805, 2.6146224045442619], [4.9815440083141045, 0.42448565305791242, -3.8067707873979009, 0.088576327646434194, -2.5673844302299975]], [[0.86457973483070027, 0.27618304646388925, -2.9434133124117801, 3.2035562390376349, -0.64123637191235971], [-4.2046180198692937, -1.7522843462901614, 2.2313301121841311, 1.6362672016694599, -1.5168237416281083], [-3.0836576915827427, -0.93015917411946525, 1.355650572000525, -3.6670513281671999, 4.3744468600844577], [-4.4727330110286267, -0.5511193638547196, 0.62386977462344362, -0.61966166038022052, -4.5160930557666381]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-2.5228351006120731, -8.6147981403591398, -8.9053958294946547, -6.0811451439413471, -8.5307781800099587], [-6.2005245116783758, -0.14803989756550262, -4.5317290839021513, -0.61053827729592403, -1.0846203583830851], [-3.1483724501540324, -0.48377815841613536, -2.3856243565400783, -2.0705766768374554, -7.0006771503276033], [-2.2029671561570918, -3.3104003561481221, 0.41608767948029257, -1.2063132263629468, -0.90479474604605681]], [[-4.8199373381107726, -6.1689958582580235, 1.0113137644493713, -4.532694308401533, -4.9502696305739029], [0.69905541488865142, 0.77976146640119426, -4.5190220584297229, 1.4880530145711028, -7.5907327384600034], [-7.1224889138547471, -4.1115617117895535, -7.5167473367696314, -5.1928886051648266, -3.4656317950257223], [0.34760441198441194, -1.4159578265933219, -6.7861544323543193, -6.2452950953749937, -5.2126906069761088]]])+(1.-msk_ref)*numpy.array([[[-8.7583276103753462, -0.74570068396360956, -7.2143405412220041, -6.7500059435711686, -0.32232594967606598], [-8.5845473888067581, -0.5809407503141335, -7.0134774048780324, -8.4852988764424921, -1.2638011351856511], [-1.5714822454446198, -7.2310250267840477, -5.5025110601933944, -6.2734530050233781, -1.8080626498733112], [0.5588589538965314, -3.9981994013596607, -8.229455841815474, -4.3341087267711389, -6.9900694846475702]], [[-2.6418387177292249, -3.2302354060960359, -6.4498317649717052, -0.30286221352229026, -4.1476548244722853], [-7.7110364724292193, -5.2587027988500861, -1.275088340375794, -1.8701512508904652, -5.0232421941880334], [-6.5900761441426674, -4.4365776266793908, -2.1507678805594002, -7.1734697807271246, 0.86802840752453259], [-7.9791514635885523, -4.0575378164146443, -2.8825486779364815, -4.1260801129401461, -8.0225115083265628]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_expandedData_rank1(self):  
       arg0=numpy.array([[[[-0.61395482706517068, 1.6217058146312802], [-0.98768925287394893, 1.7202972401084482]], [[-1.3944225164516055, 2.1759871981421401], [-0.76269022815220033, -0.043658342468365419]], [[3.8216679022719866, -2.0755791954259264], [2.3062339310870614, 4.8749408274989126]], [[1.9233079106627446, 4.4276539292630428], [-2.0308657476121308, -1.8281902970332031]], [[2.978473926422244, -2.5882428295697335], [-4.9842932281211736, 1.7069480935841561]], [[1.2065152995931783, -3.0988325378170423], [-4.8490681749601503, 0.77240920709691441]]], [[[1.2804288160478698, 4.0850108403634184], [4.4343028036699668, 3.9202698792457049]], [[-0.018402887963874903, -1.4268843655333221], [2.154080323583047, -0.13370761798127884]], [[-2.4902339031082121, -1.0594862997182339], [-3.3258365817077316, -3.277490117385514]], [[-4.7894245132965807, -0.78381684885984271], [-1.4970587924394452, 4.0191412790604399]], [[1.2841564410383031, -3.3514333399563965], [4.3047411908019164, -0.72283662405227034]], [[-0.92427461814751943, 3.9565831887770422], [-0.73487054485643277, -2.1791180935417942]]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([-3.3282107067139699, 0.24085532457492143])+(1.-msk_arg1)*numpy.array([1.3589088719435694, 0.65772027741370032])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-3.9421655337791406, -1.7065048920826897], [-4.3158999595879184, -1.6079134666055217]], [[-4.722633223165575, -1.1522235085718298], [-4.0909009348661698, -3.3718690491823353]], [[0.4934571955580167, -5.4037899021398967], [-1.0219767756269085, 1.5467301207849427]], [[-1.4049027960512253, 1.0994432225490729], [-5.3590764543261002, -5.156401003747173]], [[-0.34973678029172595, -5.9164535362837034], [-8.3125039348351439, -1.6212626131298138]], [[-2.1216954071207916, -6.4270432445310117], [-8.1772788816741198, -2.5558014996170555]]], [[[1.5212841406227913, 4.3258661649383399], [4.6751581282448882, 4.1611252038206263]], [[0.22245243661104652, -1.1860290409584007], [2.3949356481579684, 0.10714770659364259]], [[-2.2493785785332907, -0.81863097514331251], [-3.0849812571328101, -3.0366347928105926]], [[-4.5485691887216593, -0.54296152428492128], [-1.2562034678645237, 4.2599966036353614]], [[1.5250117656132245, -3.110578015381475], [4.5455965153768378, -0.48198129947734891]], [[-0.68341929357259801, 4.1974385133519636], [-0.49401522028151135, -1.9382627689668728]]]])+(1.-msk_ref)*numpy.array([[[[0.74495404487839867, 2.9806146865748495], [0.37121961906962042, 3.0792061120520176]], [[-0.03551364450803618, 3.5348960700857095], [0.59621864379136902, 1.3152505294752039]], [[5.180576774215556, -0.71667032348235704], [3.6651428030306308, 6.2338496994424819]], [[3.282216782606314, 5.7865628012066121], [-0.67195687566856144, -0.46928142508963377]], [[4.3373827983658133, -1.2293339576261642], [-3.6253843561776042, 3.0658569655277255]], [[2.5654241715367476, -1.7399236658734729], [-3.4901593030165809, 2.1313180790404838]]], [[[1.9381490934615702, 4.7427311177771188], [5.0920230810836671, 4.5779901566594052]], [[0.63931738944982541, -0.76916408811962178], [2.8118006009967473, 0.52401265943242148]], [[-1.8325136256945118, -0.40176602230453362], [-2.6681163042940312, -2.6197698399718137]], [[-4.1317042358828804, -0.12609657144614239], [-0.83933851502574486, 4.6768615564741403]], [[1.9418767184520034, -2.6937130625426962], [4.9624614682156167, -0.065116346638570022]], [[-0.26655434073381912, 4.6143034661907425], [-0.077150267442732456, -1.5213978161280939]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_expandedData_rank4(self):  
       arg0=numpy.array([-4.7158916126049135, 1.1252678639050506])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-4.7274963705339532, 4.7195633043632661], [4.73636524920982, -4.2391422562907746]], [[2.2689799648543953, -1.8498889275597827], [-3.7174995253416574, 1.8182220241563645]], [[2.3729579806579384, 2.6548600855283224], [-0.31070672475390548, 2.4531898171013804]], [[-0.019277816095603306, -3.335326535581209], [-4.778079199572673, 2.6064587798734955]], [[4.3931398304307692, 4.5975423150528911], [1.3810426240468887, -3.6870195694842902]], [[-3.5339098365574326, 3.840639969839545], [2.4922510906576054, 3.9718123671363283]]], [[[2.9844723758716167, -2.5974589891293931], [-0.016968300761742938, 2.6548491821217146]], [[-3.8822173097798984, -4.1178336945158032], [-1.7826449442204959, 4.4253050774195462]], [[-2.0742742751294649, -0.17140888514521979], [3.7289107649790711, 4.8396520332969395]], [[-1.1082838234780357, -0.53804795767446922], [2.9887013495321044, -4.3028306070505948]], [[1.3946457009979785, -4.012482646920537], [1.4076070453983922, 4.4670906262086501]], [[-0.98910961040326928, 4.7527311510752579], [1.0688645243888297, 1.6956676270128508]]]])+(1.-msk_arg1)*numpy.array([[[[0.12261135318004435, 4.3912906706421353], [-0.31763235241825249, -1.8369053129255741]], [[1.4123502579588809, 0.72994979519038683], [1.5980741012660085, -2.8904114306756332]], [[-3.8626623190511831, -4.8439762106943771], [3.4727221036725222, 4.8813000729962699]], [[2.89652525155081, -4.5612879267069664], [-4.5388938844085667, 0.80054950869428154]], [[1.7751480918335076, -2.9979276630818044], [-2.6914681248973595, 0.99617058549010729]], [[-3.5051871944328541, -0.30447921886317619], [4.4753598558532843, -3.6606018515864989]]], [[[4.1345152361382187, 1.7992268444762969], [-2.2240143347715433, 2.9395629941148922]], [[0.32717323111329222, 4.039437246879622], [4.0993102564645874, -1.5283447277259068]], [[4.1939950274354096, 3.3952133310820241], [-4.5348215131386596, 2.0285245550389464]], [[1.9981862149738649, -3.5988093525739173], [-3.2161933870485546, 4.1406452650205221]], [[3.4331428921203173, 4.2566360379383905], [-4.6863798126895482, 0.67581930068134533]], [[-4.282674087030113, -0.22557811227906921], [4.3721648940770805, 1.3468794042673151]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-9.4433879831388658, 0.0036716917583525799], [0.020473636604906531, -8.9550338688956881]], [[-2.4469116477505182, -6.5657805401646963], [-8.4333911379465718, -2.897669588448549]], [[-2.3429336319469751, -2.0610315270765911], [-5.026598337358819, -2.2627017955035331]], [[-4.7351694287005168, -8.0512181481861234], [-9.4939708121775865, -2.109432832731418]], [[-0.32275178217414435, -0.11834929755202239], [-3.3348489885580248, -8.4029111820892037]], [[-8.2498014491623461, -0.87525164276536849], [-2.2236405219473081, -0.74407924546858517]]], [[[4.1097402397766674, -1.4721911252243425], [1.1082995631433077, 3.7801170460267652]], [[-2.7569494458748478, -2.9925658306107525], [-0.65737708031544528, 5.5505729413245968]], [[-0.94900641122441431, 0.95385897875983083], [4.8541786288841218, 5.9649198972019901]], [[0.016984040427014957, 0.5872199062305814], [4.113969213437155, -3.1775627431455442]], [[2.5199135649030291, -2.8872147830154864], [2.5328749093034428, 5.5923584901137007]], [[0.13615825350178135, 5.8779990149803085], [2.1941323882938804, 2.8209354909179014]]]])+(1.-msk_ref)*numpy.array([[[[-4.5932802594248692, -0.32460094196277822], [-5.033523965023166, -6.5527969255304876]], [[-3.3035413546460326, -3.9859418174145267], [-3.1178175113389051, -7.6063030432805467]], [[-8.5785539316560957, -9.5598678232992906], [-1.2431695089323913, 0.16540846039135637]], [[-1.8193663610541035, -9.2771795393118808], [-9.2547854970134793, -3.915342103910632]], [[-2.9407435207714059, -7.7138192756867179], [-7.4073597375022731, -3.7197210271148062]], [[-8.2210788070377667, -5.0203708314680897], [-0.24053175675162919, -8.3764934641914124]]], [[[5.2597831000432693, 2.9244947083813475], [-1.0987464708664927, 4.0648308580199428]], [[1.4524410950183428, 5.1647051107846726], [5.224578120369638, -0.40307686382085617]], [[5.3192628913404603, 4.5204811949870747], [-3.4095536492336089, 3.153792418943997]], [[3.1234540788789156, -2.4735414886688667], [-2.090925523143504, 5.2659131289255727]], [[4.5584107560253679, 5.3819039018434411], [-3.5611119487844975, 1.801087164586396]], [[-3.1574062231250624, 0.89968975162598142], [5.4974327579821312, 2.4721472681723657]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_expandedData_rank2(self):  
       arg0=numpy.array([[0.87504978232714237, 0.88669539546189302, 0.91223224259084024, -3.4228713114199163, -2.3542694678956488], [-0.00054770116750813003, -4.0190695516370631, -0.014541295070815252, 1.2975243441836328, 2.0506677925839076], [-2.950451983682898, 3.6099637198446626, 0.30226385140547052, -2.4257717735844233, 4.7787139193649804], [3.8686212758143093, 3.8429232721006308, 3.3029149378634362, 1.5870277585988655, -1.6390934242986068]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[-1.7174736991800863, 3.6894371409646354, -0.65036676288996542, -2.3538612822292704, 4.4847779796255267], [-4.1048938787948073, -1.5394488350545132, 1.9692182996981327, 4.9972961088113621, 1.7193201365444892], [1.4729803246785345, -1.3126423193605619, -1.2256012868732014, 0.94610593586021885, -2.2601621858768004], [-1.1243050480798154, -4.9200929026679683, -3.0521328163359396, 3.416567041656684, -1.0142435303032062]])+(1.-msk_arg1)*numpy.array([[-2.6750184432634172, 1.3520726793432125, 2.7142662758307354, 1.8064621447800144, -4.715757439146552], [-4.0313988795919853, 3.2268302228983288, 2.3761731251683651, -4.4872337797959059, -2.5279045391425372], [0.5026012425561035, 3.7323416419336883, 3.5888730223768093, -1.3497248049030288, -3.9398083729729114], [2.8924192989916033, 2.8180793726689179, 3.3843766945184921, 0.5253792231270733, 2.5595722812396771]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-0.84242391685294393, 4.5761325364265284, 0.26186547970087481, -5.7767325936491867, 2.1305085117298779], [-4.1054415799623154, -5.5585183866915759, 1.9546770046273174, 6.2948204529949949, 3.7699879291283969], [-1.4774716590043635, 2.2973214004841007, -0.92333743546773084, -1.4796658377242045, 2.51855173348818], [2.7443162277344939, -1.0771696305673375, 0.25078212152749657, 5.0035948002555495, -2.6533369546018131]])+(1.-msk_ref)*numpy.array([[-1.7999686609362748, 2.2387680748051055, 3.6264985184215757, -1.6164091666399019, -7.0700269070422008], [-4.0319465807594934, -0.79223932873873437, 2.3616318300975498, -3.189709435612273, -0.47723674655862958], [-2.4478507411267945, 7.3423053617783509, 3.8911368737822798, -3.7754965784874521, 0.83890554639206893], [6.7610405748059126, 6.6610026447695487, 6.6872916323819283, 2.1124069817259388, 0.92047885694107023]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_expandedData_rank2(self):  
       arg0=numpy.array([[[3.6329384634138968, -3.3116577613389464], [1.824043881346519, 0.1670046052362455], [-3.3547990995336576, -0.61316502878188128], [4.6021870248727907, -3.2971181142518571], [-4.404290616021723, -2.9649772090253768]], [[-0.43147100020192752, -4.2166648550661048], [4.6425352097469226, -4.2189649903353166], [-1.82822582018325, 3.0113979986274266], [-2.2442725786109818, -4.099924296473608], [3.4277946398794832, 1.8893320149769046]], [[-3.7571484676957736, 0.97293544330055148], [-0.057696555165098751, 2.9018594695128686], [4.5935570123365075, -3.4247522677846867], [-1.6239005116827068, -4.5417489508361664], [1.743630612848202, 0.10287304653918117]], [[-4.2077768949986538, -0.51176886563246615], [-2.8715796108353131, 3.0687736284760323], [-4.1455028490254442, 2.2257246114318043], [4.1347259842182815, -4.1887655646234894], [-0.8874247966387987, -2.6033330007295619]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[3.2248410936901024, 1.2167329409248939, -2.7591148751818464, -3.4719323741204757, -2.9079523754963308], [0.17920267478073448, -4.4324287473273589, 0.80490661124281537, -3.3222680807171701, -3.4717897361981107], [-3.293695872328295, -3.5084698395773852, 0.56460092474128754, 2.715540114473459, 0.99151100165985007], [2.4818756478462127, 2.1224371442921255, -1.1291801644025368, 4.3857173560650828, -2.3793180914333978]])+(1.-msk_arg1)*numpy.array([[-2.9897673226800925, 1.4483319149277385, 0.67301174575337708, -0.95764297872868465, 3.2023518036195728], [-2.7329967131337121, 0.37678896014769769, 0.7330676918376513, 0.8570716918039869, 1.8556114630283105], [-0.31730000787958179, 4.0758813691418982, -0.25202166614935706, -3.0217656184455457, 2.6570413965820947], [1.8621245024606035, 1.2943222909121976, 4.1014142866589562, -2.3529918121555271, 0.92191191369442205]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[6.8577795571039992, -0.086816667648843993], [3.0407768222714129, 1.3837375461611394], [-6.113913974715504, -3.3722799039637277], [1.130254650752315, -6.7690504883723328], [-7.3122429915180538, -5.8729295845217075]], [[-0.25226832542119304, -4.0374621802853703], [0.21010646241956366, -8.6513937376626764], [-1.0233192089404346, 3.816304609870242], [-5.5665406593281519, -7.4221923771907781], [-0.043995096318627525, -1.5824577212212061]], [[-7.050844340024069, -2.3207604290277435], [-3.566166394742484, -0.60661037006451668], [5.158157937077795, -2.8601513430433991], [1.0916396027907522, -1.8262088363627074], [2.735141614508052, 1.0943840481990312]], [[-1.7259012471524411, 1.9701067822137466], [-0.74914246654318761, 5.1912107727681578], [-5.274683013427981, 1.0965444470292676], [8.5204433402833644, 0.19695179144159347], [-3.2667428880721965, -4.9826510921629596]]])+(1.-msk_ref)*numpy.array([[[0.64317114073380433, -6.3014250840190389], [3.2723757962742575, 1.615336520163984], [-2.6817873537802805, 0.059846716971495795], [3.6445440461441061, -4.2547610929805417], [-1.2019388124021502, 0.23737459459419608]], [[-3.1644677133356396, -6.9496615681998168], [5.0193241698946203, -3.8421760301876189], [-1.0951581283455987, 3.7444656904650779], [-1.3872008868069949, -3.2428526046696211], [5.2834061029077937, 3.7449434780052151]], [[-4.0744484755753554, 0.65563543542096969], [4.0181848139767995, 6.9777408386547668], [4.3415353461871504, -3.6767739339340437], [-4.6456661301282525, -7.5635145692817121], [4.4006720094302967, 2.7599144431212759]], [[-2.3456523925380504, 1.3503556368281373], [-1.5772573199231155, 4.3630959193882299], [-0.044088562366487949, 6.3271388980907606], [1.7817341720627544, -6.5417573767790165], [0.034487117055623351, -1.6814210870351398]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_expandedData_rank3(self):  
       arg0=numpy.array([[4.9488656891814333, -0.21560335799239549, 4.1970483915199885, 1.1689651306408608, -0.33325944612937874], [-3.6718566393597598, 1.0541577214006583, -1.3244939734065477, -4.5023379369180763, 4.0895764158042009], [-4.809877277214289, 3.2879091997740915, -2.847000330160252, -2.4317930688382559, 4.9415310678726687], [3.6920266231808814, 1.3746212743288471, -2.7341120477959659, -1.7660101299364914, 0.90000283409352821]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-3.6370352285612082, 0.70296882323477128], [-0.80063401119203981, -1.7781152927759889], [1.8836423816438455, -3.7929123185482903], [-1.5370026860893726, -1.6505612385770974], [2.1318062100587962, 0.89248921935175307]], [[-4.4700074617663805, -4.4779081291849661], [-0.34613031275107708, 4.0182796233941502], [1.3192355129185209, -0.80107655326860439], [-1.860915291387788, 4.6434271454169913], [-3.1635378620107502, 1.4299684162620867]], [[4.0094702929470429, 0.21039031006335751], [1.0596294119644671, 3.4535768065737358], [0.93351951476863171, -2.6959260008999362], [1.0312358879795367, 3.8787507961903813], [4.6712663739907825, 2.7994173764901173]], [[-2.3902521812264532, 2.4315332972102519], [4.1351973731330247, 2.4769389782898985], [4.0883308296236098, -2.6598447007153405], [1.9694505217054701, -2.7396998798218872], [3.5740205331134263, -1.4551101506288955]]])+(1.-msk_arg1)*numpy.array([[[0.20957961584079854, 0.33518007563904462], [-3.3011635197287048, -1.073376894106354], [2.7625090990938519, -2.4438483595412199], [-4.9442257568995629, -0.65283148979895778], [-2.3645965997580132, -3.141767966943827]], [[4.2551966231953298, -4.3264679524665883], [3.6358560437015655, -2.583344335770088], [1.3790555721506026, -0.19730146001942295], [-2.201200846111675, 3.4267095584034983], [-3.9066565396581243, 2.1643571558346046]], [[4.5958723939625621, 3.6788670064817648], [2.0083914802161864, 1.4995275721724601], [-2.3759576388348034, 0.14885043994241176], [3.9768433528488512, -0.9316154969064776], [1.5235300684250515, 3.4642870658304972]], [[-3.713098752044842, -3.3769668470880019], [2.0453298276769729, -1.0577813104880409], [3.2567093687510855, -0.23649127928966696], [2.2722983033791238, 4.2004786455644467], [1.5271391186250458, -0.64909200627976382]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[1.3118304606202251, 5.6518345124162046], [-1.0162373691844353, -1.9937186507683844], [6.080690773163834, 0.40413607297169829], [-0.3680375554485118, -0.48159610793623653], [1.7985467639294175, 0.55922977322237433]], [[-8.1418641011261403, -8.1497647685447259], [0.70802740864958125, 5.0724373447948086], [-0.005258460488026806, -2.1255705266751521], [-6.3632532283058643, 0.14108920849891504], [0.92603855379345079, 5.5195448320662877]], [[-0.8004069842672461, -4.5994869671509315], [4.3475386117385586, 6.7414860063478272], [-1.9134808153916203, -5.5429263310601886], [-1.4005571808587192, 1.4469577273521255], [9.6127974418634512, 7.7409484443627861]], [[1.3017744419544282, 6.1235599203911333], [5.5098186474618718, 3.8515602526187456], [1.3542187818276439, -5.3939567485113065], [0.20344039176897866, -4.5057100097583787], [4.4740233672069545, -0.55510731653536727]]])+(1.-msk_ref)*numpy.array([[[5.1584453050222319, 5.2840457648204779], [-3.5167668777211003, -1.2889802520987494], [6.9595574906138404, 1.7532000319787686], [-3.7752606262587021, 0.51613364084190305], [-2.6978560458873919, -3.4750274130732057]], [[0.58333998383556995, -7.9983245918263481], [4.6900137651022238, -1.5291866143694297], [0.054561598744054862, -1.5217954334259707], [-6.7035387830297513, -1.0756283785145779], [0.18291987614607663, 6.2539335716388056]], [[-0.21400488325172695, -1.1310102707325242], [5.2963006799902779, 4.7874367719465516], [-5.2229579689950558, -2.6981498902178402], [1.5450502840105953, -3.3634085657447335], [6.4650611362977202, 8.4058181337031659]], [[-0.021072128863960593, 0.3150597760928795], [3.41995110200582, 0.31683996384080615], [0.52259732095511957, -2.9706033270856329], [0.50628817344263233, 2.4344685156279553], [2.427141952718574, 0.25091082781376439]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_expandedData_rank2(self):  
       arg0=numpy.array([[[[2.3162108977577436, 1.730480826888309, 3.2280203996501378, -3.8749989019493922, 0.3106050803635485], [0.42650735086678626, 0.732726485030323, 0.81456570000273754, -4.9692173516510527, 0.15309195748151083], [-4.2124661446708576, -0.57665622287890805, 1.122655982491545, 1.7061129209978105, 3.559645317119891], [2.9296700901289334, 2.4518255312983523, -4.084235914426654, -4.9902423198639489, 3.6172335863143417]], [[-2.5296100373837946, -2.368617688913881, -3.0362436399217563, 0.26253356677376605, 3.6538193361575484], [-2.4474063052551207, 0.83258317998367204, -1.2095608343823483, -3.1291130344495697, -3.0944818859214687], [-0.94481198126626076, -2.3466510872042301, -3.3190456154622905, 0.37223688242552644, -1.9436358270074305], [-2.1541595633099431, 4.4017236742029482, 0.075364602960419802, 2.1513576178462079, -0.64017532054967319]], [[-4.9903126925032826, -3.9481012328124496, 1.9712100160162693, -4.6556085772504829, -4.6614041071541656], [-0.15655788634387591, 3.2457261675680336, 4.1415674934115358, 0.47826882987288677, -1.1395064262430732], [4.298100839076362, -2.0597556647773718, -4.7291513347114602, -3.1888598327993343, -3.1672604055534235], [0.43424008293700034, -0.99622742275366427, -4.3103421386671652, -3.6840620800256527, 3.0194024178730015]], [[-2.6924872516748231, 1.8592211966303562, -3.7622345869169771, 4.9229386889697828, 3.4819449030352878], [3.3027036987339962, 4.0066230320866687, -3.0096541719143568, 0.37641435396412515, -0.77915924988534258], [-3.1137848508611521, 0.55014053021884735, 2.2021782337345783, -1.7449375821897051, 1.2600542772914283], [-0.62681898392224866, -1.7591906859666393, -3.3359542710630006, -1.2100329463911299, -0.21248431029430215]], [[2.700357349535798, 0.77769848977013911, 3.5741099781918528, -2.0308652384664772, -2.9580726841927918], [-0.4092080867036465, -0.52858394950601539, -4.8366235892910812, 3.3045035907636624, -0.63124651454396918], [1.8750083804869613, 3.9959595414958482, -0.40545368604103338, -4.9978663744863248, 0.49606317148573531], [1.9302476583363193, -1.1721958301133215, -1.5690598461767093, -4.3223642784665062, -2.6183835891758278]]], [[[0.44515349375502744, 4.7575640578592822, 4.0001998097793905, 3.7209682689306707, 2.4915038241333987], [-4.8952715156287532, 4.9314747189035266, 2.7354826565505919, 3.5684788341425744, 1.5845211096466123], [-3.629495993951557, -3.9281343493568932, -0.94609142775629529, 3.1440872304386787, -1.1075077572639436], [4.90993898849338, -0.84249422382930916, 0.81209684015318295, -2.46993482733909, 4.3967907873281717]], [[1.8837967441881158, 1.0455267853060111, -1.2309036255965209, 2.3764937940339745, 2.1880870910274304], [3.3539955686873633, 4.1472259010252728, -3.3069443789302322, 0.26596486846630274, -3.3929758312643656], [0.96886490307606543, 2.7314024459479302, -4.3545471603129862, 0.81117212304525665, -4.6612473930416787], [-1.2988959021970081, -0.0092050940258854297, -2.135989769158706, 0.23266738092716377, -0.050282894601397565]], [[-4.4533800799350285, 2.2098204539941975, 1.4397502579102097, -0.43603970279459325, 4.0729892504318439], [-0.91360808920167091, -2.0112552319780508, 1.6963288495673678, 1.5642961310410799, 4.906926059821707], [-2.529277634855239, 1.8623327999787058, -2.8798970260554513, 1.176238968978021, -1.8325001037539099], [4.4856765863715893, 0.066002614197905096, -2.4802301152306128, 3.1189830892694239, 3.9886018092888627]], [[1.6919998112882171, -3.5080177454715722, -0.79214134594954544, 0.77167238248863956, -4.5429527449108464], [-3.9660721289357381, -2.41596341874014, -0.5431068857943, 2.6265854214337461, 1.5525011873305283], [-4.5167543102300343, 4.5761539088205669, 2.5980684304851245, 1.5076742120661946, -1.6761354854966006], [0.21180649169755306, -4.1410072939319189, 0.41453860453295732, -0.34270872825566023, -0.71122889214294016]], [[1.5530749508200259, -4.5138044129945865, -2.0648755589817669, 1.9078859474727068, 1.6555633028422942], [2.9583478209514613, 4.7641545928484224, 4.2246266274324977, 1.7540040669370685, 3.2014647438800594], [-0.55767686173776987, -1.250182798269166, -2.2947283772902671, -4.0578107124459297, -3.9826200049749705], [3.6113558064563307, -0.27966811805294789, 3.5132777325323055, -0.25757417456401832, -0.48021429268338345]]], [[[0.012753917394745073, 4.6005259906318621, 0.31514980316814523, -4.0707983498642353, 0.44854039165962423], [-1.9409404300241819, -1.6289446247952579, 1.6449130372347787, -0.56118709526788102, -1.4746129183849299], [2.5889198520382486, -2.4194517228474766, 2.3345970212587428, -3.494480943295788, 3.4884689287727824], [-4.2293232680029389, -4.7961662350206993, 0.13886534569144438, 2.2804546123503391, -1.3114191753514213]], [[3.5161254529405053, 3.3701194516938422, -0.46371507016739866, 4.5475787185070367, -4.213613770942942], [0.44789268591656128, 1.8642073393112852, -1.4210511436192008, -3.703176222056288, 2.6160332365684642], [-1.9479170817800471, -2.9392531457977356, -1.2595199262738985, -3.0471755117499253, -2.2605264489267318], [-2.9898529345645319, -3.5461585677274932, -1.4456541671699408, -3.3317292520590014, -0.38208749913247431]], [[0.39498573177214702, 1.2705780959885775, -4.2225908818030744, -1.1354922556378213, 4.6958128170162343], [1.8207496323800552, 3.8550013136363201, 0.014859055263415577, 1.355074362854233, -0.12294117102859126], [-2.9373130056827335, -2.3591266419916179, -3.8824679954522221, 4.8395130480161832, -2.538526081705065], [4.9275171444897055, -4.0148379939622538, 2.200773400954203, 1.5935365518975155, -4.5819129260651827]], [[0.65164193770634071, 4.6270131105231052, -2.3678399668771477, 3.5353204234791935, 4.1603986163898856], [-1.5222497099147345, -4.6947566272503831, 2.1840230313803897, 0.48204440729491793, 3.5322739043689335], [-0.066103087636641966, 2.5626159823230861, 0.32828479782656927, -4.0532840061790107, -3.2378278867630863], [1.9764456686453444, 3.8741179315965866, 1.5242322993744297, -0.65591972833239343, -1.045463899652729]], [[-3.858756655975184, -2.4586826040015506, -4.4793816680646774, 1.3976005752575311, -3.4006171608981797], [0.76499499866913112, -1.9767466298146861, 2.3476952867354006, 2.4952778334239367, -1.959287673435556], [-4.0683968921893845, 4.7783549036380304, 3.1650891337316125, -3.3860620446097567, -2.656657966491843], [-4.280907361215859, -2.3292159839853865, -1.9921347212102472, 4.8893970756031155, 0.58545340192941442]]], [[[0.22520391889970259, -2.0411181990003358, 0.54962377861671996, -2.9766377076127917, 0.60204205953490231], [1.8608709119560585, -3.0307739502561093, 3.4865202503695425, 3.9540357208864254, 3.9735425453368869], [-3.3060571020972942, 4.0337909005843962, -1.7786506480680044, 3.1348928854361571, 4.5462257387280438], [-3.6773870674117335, 1.6496627392882406, 4.0391239197229503, 1.4304030946111688, -2.4075170349722939]], [[-3.2224865855128204, -0.99064981585553369, -4.118591198842708, -0.45683564697208912, 2.4364656779519853], [1.4581606244857408, 4.1059806596927277, -3.6131553850515186, 0.72555570514437395, 0.26138551940355548], [3.1712441510460447, -4.3494786947593935, -0.662037567344953, -2.7256466841260272, -1.5427387566054263], [0.040099118413106538, -1.1399736486736023, 4.5076079917455267, 3.7907960468164017, 0.25760496172686409]], [[1.6858129169420355, 0.077851605923760836, -0.88647682767117608, -4.4908114143373359, -1.7311885451142937], [-3.3903137203879377, -0.5236135165073863, -1.5728785369561482, -4.7768689023855178, 4.9242362844353273], [0.86472577080595059, -4.8955409337810423, -3.4034039379158596, -4.290207282375075, 4.798970581642287], [0.11688665693227307, -0.76240792154516424, 3.2136369378679088, 1.7290873011212762, -3.4877966585667819]], [[2.4327237028412796, 2.3591037846859937, -1.1705502899488374, -3.407497015153691, -1.263522286029878], [-1.6536884533743712, -1.6237128719326277, -3.6872282357476194, 1.8111316523349448, -3.7126511795279473], [2.8047791763601193, -3.4045357568569914, -4.7908919976889326, 2.9571377526023817, 1.0917334429592671], [-0.051318129645185451, -0.75027469932896729, -1.9867418295009429, 1.8844559886167271, 2.4301752181520007]], [[-0.52252451788804866, -2.6719603594042285, -3.6891439058764322, 2.7476056701124527, 4.2083274705389719], [-0.18796722835246094, 1.0387811837838186, -3.1040129148292825, -4.3994830931797306, 3.9666133028324175], [-4.4570989798610583, -4.6564698829524618, -4.5942094245700718, -3.3630180426275889, 2.1982228054564761], [3.1576113917934805, -1.7015343800562146, 2.6308282974866959, -4.3021393767749316, 4.7872291291289049]]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[0.17513519875471495, 4.6695054745031133, 4.187671951402006, 4.9725106840528053, 1.9160706683262951], [0.3263629889569426, 0.36325791099229754, -0.087311489662593722, -3.5433879210942774, -3.7937260765986283], [2.5899132527224742, -1.9696798064103325, 1.9909261605440021, -0.017337565930107601, -0.71663462951397072], [0.36605049648665844, 3.0963931741949065, 4.7130542162812503, 3.2212531873184727, 4.7995891992839574]])+(1.-msk_arg1)*numpy.array([[0.35334168169576685, 4.1020757069632552, 3.5408655461201874, 1.5320555858755647, -4.7269253100511799], [3.8525067012626497, -0.034350841940103294, -2.2428500897249783, -1.8394782146189401, 4.4107566578819899], [1.2823776982231641, 0.6952411093443196, 1.9630336377590538, 4.0486715966068321, -4.5915788681209335], [-0.46212390399173131, -2.9342369541963178, 0.52676371944356948, -4.1061610521743654, -3.1929627727350729]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[2.4913460965124585, 1.9056160256430239, 3.4031555984048527, -3.6998637031946773, 0.48574027911826345], [0.60164254962150121, 0.90786168378503795, 0.98970089875745249, -4.7940821528963378, 0.32822715623622578], [-4.0373309459161426, -0.4015210241241931, 1.2977911812462599, 1.8812481197525255, 3.7347805158746059], [3.1048052888836484, 2.6269607300530673, -3.9091007156719391, -4.815107121109234, 3.7923687850690566]], [[2.1398954371193186, 2.3008877855892322, 1.633261834581357, 4.9320390412768793, 8.3233248106606617], [2.2220991692479926, 5.5020886544867853, 3.459944640120765, 1.5403924400535436, 1.5750235885816446], [3.7246934932368525, 2.3228543872988832, 1.3504598590408228, 5.0417423569286397, 2.7258696474956827], [2.5153459111931702, 9.0712291487060615, 4.7448700774635331, 6.8208630923493212, 4.0293301539534401]], [[-0.80264074110127659, 0.23957071858955636, 6.1588819674182753, -0.46793662584847695, -0.47373215575215966], [4.0311140650581301, 7.4333981189700395, 8.3292394448135418, 4.6659407812748928, 3.0481655251589328], [8.485772790478368, 2.1279162866246342, -0.54147938330945422, 0.99881211860267172, 1.0204115458485825], [4.6219120343390063, 3.1914445286483417, -0.12267018726515921, 0.50360987137635327, 7.2070743692750074]], [[2.2800234323779822, 6.8317318806831615, 1.2102760971358282, 9.8954493730225881, 8.4544555870880931], [8.2752143827868014, 8.979133716139474, 1.9628565121384485, 5.3489250380169304, 4.1933514341674627], [1.8587258331916532, 5.5226512142716526, 7.1746889177873836, 3.2275731018631002, 6.2325649613442335], [4.3456917001305566, 3.213319998086166, 1.6365564129898047, 3.7624777376616754, 4.7600263737585031]], [[4.6164280178620931, 2.6937691580964342, 5.490180646518148, -0.11479457014018202, -1.0420020158664967], [1.5068625816226486, 1.3874867188202797, -2.920552920964786, 5.2205742590899575, 1.284824153782326], [3.7910790488132564, 5.9120302098221433, 1.5106169822852618, -3.0817957061600296, 2.4121338398120304], [3.8463183266626144, 0.74387483821297362, 0.34701082214958578, -2.406293610140211, -0.70231292084953267]]], [[[0.77151648271197004, 5.0839270468162248, 4.3265627987363331, 4.0473312578876133, 2.8178668130903413], [-4.5689085266718106, 5.2578377078604692, 3.0618456455075345, 3.894841823099517, 1.9108840986035549], [-3.3031330049946144, -3.6017713603999506, -0.61972843879935269, 3.4704502193956213, -0.78114476830700097], [5.2363019774503226, -0.51613123487236656, 1.1384598291101256, -2.1435718383821474, 4.7231537762851143]], [[2.2470546551804134, 1.4087846962983086, -0.86764571460422335, 2.7397517050262721, 2.5513450020197279], [3.7172534796796608, 4.5104838120175703, -2.9436864679379346, 0.62922277945860028, -3.0297179202720681], [1.332122814068363, 3.0946603569402278, -3.9912892493206886, 1.1744300340375542, -4.2979894820493811], [-0.93563799120471058, 0.35405281696641211, -1.7727318581664084, 0.59592529191946131, 0.31297501639089997]], [[-4.5406915695976222, 2.1225089643316037, 1.352438768247616, -0.52335119245718698, 3.9856777607692502], [-1.0009195788642646, -2.0985667216406445, 1.6090173599047741, 1.4769846413784862, 4.8196145701591133], [-2.6165891245178328, 1.7750213103161121, -2.967208515718045, 1.0889274793154273, -1.9198115934165036], [4.3983650967089956, -0.021308875464688626, -2.5675416048932065, 3.0316715996068302, 3.9012903196262689]], [[-1.8513881098060603, -7.0514056665658496, -4.3355292670438228, -2.7717155386056378, -8.0863406660051247], [-7.5094600500300155, -5.9593513398344173, -4.0864948068885774, -0.91680249966053129, -1.990886733763749], [-8.0601422313243116, 1.0327659877262896, -0.94531949060915288, -2.0357137090280828, -5.219523406590878], [-3.3315814293967243, -7.6843952150261963, -3.12884931656132, -3.8860966493499376, -4.2546168132372175]], [[-2.2406511257786024, -8.3075304895932156, -5.8586016355803956, -1.8858401291259215, -2.138162773756334], [-0.83537825564716695, 0.97042851624979409, 0.43090055083386947, -2.0397220096615598, -0.59226133271856884], [-4.3514029383363981, -5.0439088748677943, -6.0884544538888949, -7.851536789044558, -7.7763460815735987], [-0.18237027014229756, -4.0733941946515762, -0.2804483440663228, -4.0513002511626466, -4.2739403692820117]]], [[[2.6026671701172193, 7.1904392433543363, 2.9050630558906194, -1.4808850971417611, 3.0384536443820984], [0.64897282269829226, 0.96096862792721627, 4.2348262899572529, 2.0287261574545932, 1.1153003343375443], [5.1788331047607228, 0.17046152987499763, 4.924510273981217, -0.90456769057331377, 6.0783821814952566], [-1.6394100152804647, -2.2062529822982251, 2.7287785984139186, 4.8703678650728133, 1.2784940773710529]], [[1.5464456465301728, 1.4004396452835097, -2.4333948765777311, 2.5778989120967042, -6.1832935773532745], [-1.5217871204937712, -0.10547246709904723, -3.3907309500295333, -5.6728560284666205, 0.64635343015813174], [-3.9175968881903795, -4.908932952208068, -3.229199732684231, -5.0168553181602578, -4.2302062553370643], [-4.9595327409748649, -5.5158383741378252, -3.4153339735802732, -5.3014090584693339, -2.3517673055428068]], [[2.3859118923161491, 3.2615042565325796, -2.2316647212590723, 0.85543390490618076, 6.6867389775602364], [3.8116757929240572, 5.8459274741803222, 2.0057852158074176, 3.3460005233982351, 1.8679849895154108], [-0.94638684513873139, -0.36820048144761586, -1.89154183490822, 6.8304392085601853, -0.54759992116106293], [6.9184433050337075, -2.0239118334182518, 4.1916995614982051, 3.5844627124415176, -2.5909867655211807]], [[0.63430437177623311, 4.6096755445929976, -2.3851775328072553, 3.5179828575490859, 4.143061050459778], [-1.5395872758448421, -4.7120941931804907, 2.1666854654502821, 0.46470684136481033, 3.5149363384388259], [-0.083440653566749567, 2.5452784163929785, 0.31094723189646167, -4.0706215721091183, -3.2551654526931939], [1.9591081027152368, 3.856780365666479, 1.5068947334443221, -0.67325729426250103, -1.0628014655828366]], [[-4.5753912854891547, -3.1753172335155213, -5.1960162975786481, 0.6809659457435604, -4.1172517904121504], [0.048360369155160399, -2.6933812593286568, 1.6310606572214299, 1.778643203909966, -2.6759223029495267], [-4.7850315217033552, 4.0617202741240597, 2.4484545042176418, -4.1026966741237274, -3.3732925960058138], [-4.9975419907298297, -3.0458506134993573, -2.7087693507242179, 4.1727624460891448, -0.1311812275845563]]], [[[0.59125441538636103, -1.6750677025136773, 0.9156742751033784, -2.6105872111261332, 0.96809255602156075], [2.2269214084427169, -2.6647234537694509, 3.8525707468562009, 4.3200862173730838, 4.3395930418235453], [-2.9400066056106358, 4.3998413970710546, -1.412600151581346, 3.5009433819228155, 4.9122762352147022], [-3.3113365709250751, 2.015713235774899, 4.4051744162096087, 1.7964535910978272, -2.0414665384856354]], [[-0.12609341131791396, 2.1057433583393728, -1.0221980246478015, 2.6395575272228173, 5.5328588521468918], [4.5545537986806472, 7.2023738338876342, -0.51676221085661211, 3.8219488793392804, 3.3577786935984619], [6.2676373252409512, -1.2530855205644871, 2.4343556068499534, 0.37074649006887928, 1.5536544175894802], [3.136492292608013, 1.9564195255213042, 7.6040011659404332, 6.8871892210113081, 3.3539981359217705]], [[6.3988671332232858, 4.7909058222050112, 3.8265773886100742, 0.22224280194391444, 2.9818656711669567], [1.3227404958933127, 4.189440699773864, 3.1401756793251021, -0.063814686104267437, 9.6372905007165777], [5.5777799870872009, -0.18248671749979195, 1.3096502783653907, 0.42284693390617534, 9.5120247979235373], [4.8299408732135234, 3.9506462947360861, 7.9266911541491591, 6.4421415174025265, 1.2252575577144684]], [[5.6539768901597522, 5.5803569720044663, 2.0507028973696353, -0.18624382783521831, 1.9577309012885946], [1.5675647339441015, 1.597540315385845, -0.46597504842914672, 5.0323848396534174, -0.49139799220947467], [6.026032363678592, -0.18328256953851874, -1.5696388103704599, 6.1783909399208543, 4.3129866302777398], [3.1699350576732872, 2.4709784879895054, 1.2345113578175297, 5.1057091759351998, 5.6514284054704733]], [[4.2770646813959088, 2.127628839879729, 1.1104452934075253, 7.5471948693964102, 9.0079166698229294], [4.6116219709314965, 5.838370383067776, 1.6955762844546749, 0.40010610610422681, 8.766202502116375], [0.34249021942289914, 0.14311931633149566, 0.20537977471388569, 1.4365711566563686, 6.9978120047404335], [7.9572005910774379, 3.0980548192277428, 7.4304174967706533, 0.49744982250902581, 9.5868183284128623]]]])+(1.-msk_ref)*numpy.array([[[[2.6695525794535104, 2.0838225085840758, 3.5813620813459046, -3.5216572202536254, 0.66394676205931535], [0.77984903256255311, 1.0860681667260899, 1.1679073816985044, -4.6158756699552859, 0.50643363917727768], [-3.8591244629750907, -0.2233145411831412, 1.4759976641873118, 2.0594546026935774, 3.9129869988156578], [3.2830117718247003, 2.8051672129941192, -3.7308942327308872, -4.6369006381681821, 3.9705752680101085]], [[1.5724656695794605, 1.7334580180493742, 1.0658320670414989, 4.3646092737370212, 7.7558950431208036], [1.6546694017081345, 4.9346588869469272, 2.8925148725809069, 0.97296267251368551, 1.0075938210417865], [3.1572637256969944, 1.7554246197590251, 0.7830300915009647, 4.4743125893887816, 2.1584398799558246], [1.9479161436533121, 8.5037993811662034, 4.177440309923675, 6.2534333248094631, 3.461900386413582]], [[-1.4494471463830951, -0.40723568669226218, 5.5120755621364568, -1.1147430311302955, -1.1205385610339782], [3.3843076597763115, 6.786591713688221, 7.6824330395317233, 4.0191343759930742, 2.4013591198771143], [7.8389663851965494, 1.4811098813428156, -1.1882857885912728, 0.35200571332085318, 0.37360514056676397], [3.9751056290571878, 2.5446381233665232, -0.76947659254697776, -0.14319653390546527, 6.5602679639931889]], [[-1.1604316657992584, 3.3912767825059209, -2.2301790010414124, 6.4549942748453475, 5.0140004889108525], [4.8347592846095608, 5.5386786179622334, -1.4775985860387921, 1.9084699398396898, 0.7528963359902221], [-1.5817292649855874, 2.082196116094412, 3.734233819610143, -0.2128819963141404, 2.7921098631669929], [0.90523660195331601, -0.22713510009107463, -1.8038986851874359, 0.32202263948443477, 1.3195712755812625]], [[-2.0265679605153819, -3.9492268202810408, -1.1528153318593271, -6.757790548517657, -7.6849979942439717], [-5.1361333967548264, -5.2555092595571953, -9.5635488993422619, -1.4224217192875175, -5.3581718245951491], [-2.8519169295642186, -0.73096576855533169, -5.1323789960922133, -9.7247916845375038, -4.2308621385654446], [-2.7966776517148606, -5.8991211401645014, -6.2959851562278892, -9.0492895885176861, -7.3453088992270077]]], [[[4.2976601950176772, 8.6100707591219319, 7.8527065110420402, 7.5734749701933204, 6.3440105253960484], [-1.0427648143661035, 8.7839814201661763, 6.5879893578132416, 7.4209855354052241, 5.437027810909262], [0.22301070731109274, -0.075627648094243494, 2.9064152735063544, 6.9965939317013284, 2.7449989439987061], [8.7624456897560297, 3.0100124774333405, 4.6646035414158327, 1.3825718739235597, 8.2492974885908215]], [[1.8494459022480125, 1.0111759433659078, -1.2652544675366242, 2.3421429520938712, 2.1537362490873271], [3.31964472674726, 4.1128750590851695, -3.3412952208703355, 0.23161402652619945, -3.4273266732044689], [0.93451406113596214, 2.697051604007827, -4.3888980022530895, 0.77682128110515336, -4.695598234981782], [-1.3332467441371114, -0.043555935965988724, -2.1703406110988093, 0.19831653898706048, -0.084633736541500859]], [[-6.6962301696600068, -0.033029635730780882, -0.80309983181476863, -2.6788897925195716, 1.8301391607068656], [-3.1564581789266493, -4.2541053217030296, -0.5465212401576105, -0.67855395868389845, 2.6640759700967287], [-4.7721277245802174, -0.38051728974627252, -5.1227471157804292, -1.0666111207469573, -4.0753501934788883], [2.2428264966466109, -2.1768474755270733, -4.7230802049555916, 0.87613299954444557, 1.7457517195638843]], [[-0.14747840333072304, -5.3474959600905123, -2.6316195605684856, -1.0678058321303006, -6.3824309595297866], [-5.8055503435546782, -4.2554416333590801, -2.3825851004132401, 0.78710720681480595, -0.28697702728841179], [-6.3562325248489744, 2.7366756942016268, 0.75859021586618436, -0.33180400255274556, -3.5156137001155408], [-1.6276717229213871, -5.980485508550859, -1.4249396100859828, -2.1821869428746004, -2.5507071067618803]], [[5.9638316087020158, -0.10304775511259656, 2.345881098900223, 6.3186426053546967, 6.0663199607242841], [7.3691044788334512, 9.1749112507304122, 8.6353832853144876, 6.1647607248190583, 7.6122214017620493], [3.85307979614422, 3.1605738596128239, 2.1160282805917228, 0.35294594543606017, 0.42813665290701941], [8.0221124643383206, 4.131088539829042, 7.9240343904142954, 4.1531824833179716, 3.9305423651986064]]], [[[1.2951316156179091, 5.8829036888550261, 1.5975275013913093, -2.7884206516410712, 1.7309180898827883], [-0.65856273180101788, -0.34656692657209387, 2.9272907354579427, 0.72119060295528303, -0.19223522016176586], [3.8712975502614126, -1.1370740246243125, 3.6169747194819069, -2.2121032450726239, 4.7708466269959464], [-2.9469455697797748, -3.5137885367975352, 1.4212430439146084, 3.5628323105735031, -0.02904147712825722]], [[4.2113665622848249, 4.0653605610381618, 0.23152603917692094, 5.2428198278513563, -3.5183726615986224], [1.1431337952608809, 2.5594484486556048, -0.72581003427488122, -3.0079351127119685, 3.3112743459127838], [-1.2526759724357275, -2.244012036453416, -0.56427881692957893, -2.3519344024056057, -1.5652853395824122], [-2.2946118252202123, -2.8509174583831736, -0.75041305782562118, -2.6364881427146818, 0.31315361021184529]], [[2.3580193695312008, 3.2336117337476313, -2.2595572440440206, 0.82754138212123252, 6.6588464547752881], [3.783783270139109, 5.818034951395374, 1.9778926930224694, 3.3181080006132868, 1.8400924667304626], [-0.97427936792367964, -0.39609300423256411, -1.9194343576931683, 6.802546685775237, -0.57549244394601118], [6.8905507822487593, -2.0518043562032, 4.1638070387132569, 3.5565701896565693, -2.6188792883061289]], [[4.7003135343131728, 8.6756847071299372, 1.6808316297296844, 7.5839920200860256, 8.2090702129967177], [2.5264218866920976, -0.64608503064355105, 6.2326946279872217, 4.53071600390175, 7.5809455009757656], [3.9825685089701901, 6.6112875789299181, 4.3769563944334013, -0.0046124095721786773, 0.81084370984374576], [6.0251172652521765, 7.9227895282034186, 5.5729038959812618, 3.3927518682744386, 3.0032076969541031]], [[-8.4503355240961184, -7.0502614721224841, -9.0709605361856109, -3.1939782928634024, -7.9921960290191132], [-3.8265838694518024, -6.5683254979356196, -2.2438835813855329, -2.0963010346969968, -6.5508665415564895], [-8.6599757603103171, 0.18677603551709687, -1.426489734389321, -7.9776409127306902, -7.2482368346127766], [-8.8724862293367934, -6.9207948521063205, -6.5837135893311807, 0.29781820748218202, -4.0061254661915191]]], [[[-0.23691998509202872, -2.5032421029920671, 0.087499874624988649, -3.438761611604523, 0.139918155543171], [1.3987470079643272, -3.4928978542478406, 3.0243963463778112, 3.4919118168946941, 3.5114186413451556], [-3.7681810060890255, 3.5716669965926648, -2.2407745520597357, 2.6727689814444258, 4.0841018347363125], [-4.1395109714034648, 1.1875388352965093, 3.577000015731219, 0.96827919061943746, -2.8696409389640252]], [[-6.1567235397091382, -3.9248867700518515, -7.0528281530390258, -3.3910726011684069, -0.49777127624433248], [-1.476076329710577, 1.1717437054964099, -6.5473923392478364, -2.2086812490519439, -2.6728514347927623], [0.23700719684972693, -7.2837156489557113, -3.5962745215412708, -5.659883638322345, -4.4769757108017441], [-2.8941378357832113, -4.0742106028699201, 1.5733710375492089, 0.8565590926200839, -2.6766319924694537]], [[2.212576636385605, 0.60461532536733031, -0.3597131082276066, -3.9640476948937664, -1.2044248256707242], [-2.8635500009443682, 0.0031502029361831774, -1.0461148175125787, -4.2501051829419483, 5.4510000038788968], [1.3914894902495201, -4.3687772143374728, -2.8766402184722901, -3.7634435629315055, 5.3257343010858564], [0.64365037637584255, -0.23564420210159476, 3.7404006573114783, 2.2558510205648457, -2.9610329391232124]], [[-1.6734373493330859, -1.7470572674883718, -5.2767113421232033, -7.5136580673280564, -5.3696833382042435], [-5.7598495055487362, -5.7298739241069931, -7.7933892879219844, -2.2950293998394207, -7.8188122317023128], [-1.3013818758142461, -7.5106968090313568, -8.8970530498632989, -1.1490232995719838, -3.0144276092150983], [-4.1574791818195509, -4.8564357515033327, -6.0929028816753084, -2.2217050635576383, -1.6759858340223648]], [[-3.7154872906231216, -5.8649231321393014, -6.882106678611505, -0.44535710262262018, 1.015364697803899], [-3.3809300010875338, -2.1541815889512543, -6.2969756875643554, -7.5924458659148035, 0.77365053009734464], [-7.6500617525961312, -7.8494326556875347, -7.7871721973051446, -6.5559808153626618, -0.99473996727859681], [-0.035351380941592403, -4.8944971527912875, -0.56213447524837701, -7.4951021495100045, 1.594266356393832]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_expandedData_rank4(self):  
       arg0=numpy.array([[3.413552830644738, 4.9907455623773469, 0.55283009644976566, 3.5952154267421577, 4.5253568338022561], [-3.6317818597598004, -3.2755423086309463, 1.0198088397612972, 0.68821456202118458, -3.7916846480646162], [-0.091189422872552051, 1.8289994043787585, -2.6299197453154077, -4.9573940040278366, -3.8254140129750338], [-2.2633699842560304, -2.0406870364743277, 1.733588140446944, 0.18088500599928636, 4.6994198608356843]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-0.25636652722941111, -2.8039283448744556, -3.2928751796348421, -2.9800561135103742, 3.2234117554913606], [-0.98833665889860356, -0.44619111569988945, -1.6270120836443533, -4.9724496093892379, 0.35595383656441015], [0.30786475321511197, -1.321410190784138, -0.52591494841654196, -4.2447063128692619, 0.7265389770731181], [2.7112072463148866, 3.3226542263471561, -3.6108658759502763, 2.6232054496648107, -1.5676703673837142]], [[2.5424214273803445, -2.179369744365923, 3.9022151657915529, -0.77785177064323197, -1.3928236805423055], [1.6392194084720222, -3.6193157331520656, 1.593748897708867, -0.56175380233957917, 0.84102649741711133], [-3.2398768247103114, 1.1655883201980997, -3.5393791261785825, -1.0345162796399188, 0.77943696926730066], [-2.1552935745662571, -3.978877987444458, 0.42199460398242206, 3.5002240140815282, 3.1247415486996886]], [[-0.008995692751074813, 4.3179640997066961, 1.9369767717321569, -3.532437836211181, 4.5845426168653294], [-3.4791988776336611, -1.4026924341389591, 2.8946696405389503, -2.2374311393972235, -2.8368903257205624], [-0.69492354629588693, 0.66065194169611008, -4.3644424754138562, 4.4980885146284866, 0.28184983042698786], [-4.270533746053065, 2.4580524394670045, -4.4175175986617461, -1.5786894575400687, -1.3859474269606444]], [[-2.369154234295384, 2.1700237794137589, -4.4142861865508856, 4.2475548646857337, 4.1107842461884729], [-2.410335188344721, 2.9236978488845331, 0.56835471749784183, -2.7831624852199424, -3.784477368849799], [3.0154897906502232, -0.43605852890219765, 4.2068698723675197, 3.6994265899272563, 1.5924808240251807], [-0.24427375580971944, -4.0330941093370019, 0.30153886862906187, 0.55108833823844794, -2.6481176448726638]], [[-3.0043008643067823, 1.5586345009362956, 2.5954944836633125, 2.3735262175564777, 3.3107257126037481], [-0.96144050575101936, -2.639542006196308, 2.9243262322523567, 0.19602129882254538, -0.071424227651176508], [-1.8401387023847491, 0.72701055983842, -2.6007779184273341, -4.4201189639394336, -2.2342016973451506], [3.5725707530949009, -3.3269670763420356, -3.2514513817074517, 2.4435640336583431, 4.3332655304625032]]], [[[2.5274772491297872, 3.3316278895847056, 2.8016375824058706, 4.9497983765123692, 1.2295460270818221], [3.7899790613566218, -0.27187177010716113, -1.1379646524623732, -1.1902375702457881, -4.8558451010950385], [1.5103328729541543, -0.60619182858829301, 0.26421056393031073, -1.9675108306949673, -4.9600021441109163], [-0.10883027054653027, -4.3900751604985242, -1.9322638926623048, -2.8236669857857786, 2.8291701865053085]], [[0.14027180544229267, 3.346284284224069, 0.21376121762271882, -2.7557261684424228, -1.4473109097051418], [-3.041524342700769, -3.1996116069878977, 1.8076369746160728, -3.4823852208222061, 1.5398630982711978], [-0.17787104037158574, -2.7860021683539515, 4.4220815638768762, -0.22286370857537641, -3.2498266274286838], [3.7651085627850804, 2.446154208464816, 1.696758091418948, 2.508517137913401, 3.590241619457629]], [[2.2166816075028972, -4.139100727658775, 1.9287194399784671, -3.709433262930161, -4.9713050011514435], [-2.4488064204961879, -0.058546974714507982, 0.76077091874265079, 1.5011640836624585, -2.3598276877924853], [1.088156695791719, -1.18702799945802, 4.7357493167425506, -3.6249787398114774, 2.3541378414348575], [-4.0035571929782465, -3.3092379055114152, 0.31163247750999545, 4.0485956706188837, -2.7254679350835209]], [[2.1550600136293143, -0.64622174442837821, -2.4598593979142533, 3.9671481812406348, -4.1642035896646625], [-4.8261663524430247, -0.75472251236041377, -0.19938641223651654, 0.9144622822620736, -2.5212427177867927], [-3.1073484211034508, -1.6870520432849756, 0.050407646432304887, -3.2839909342792737, -3.5148689231559249], [-4.836454383824452, 1.6390610446897487, 4.7977162561724302, 4.5919195193022126, -2.0856364198832034]], [[-0.48922115610031192, -2.1678417392922702, -0.075536504239270386, -1.156419925428116, 3.4882565026352612], [2.0659172721893952, 3.5583309524672551, 4.6130467153621311, 0.20393195262176178, -0.87210873386523602], [2.6523052994955378, 2.6372353110838054, 2.2689082070755964, -2.863199419370086, 2.3119399613706095], [-3.65293557918727, 4.7746802851430346, 4.4723480628883436, -3.9557820445415501, 1.7485777646838843]]], [[[-1.1468800436632822, 1.5790277960889574, -2.1031083494780614, -0.059894268577309617, 4.9833307855173192], [1.6479230227436323, -4.7860547395759614, -2.6520214343796225, 1.6062503760902249, -2.8019455768623489], [2.7010048982561683, -1.2360370956269664, 2.7874584196694485, 0.10305128044211997, -0.13246673758836813], [-1.5132308830442787, -4.3872020037133534, -1.4453214800919065, 0.63159473710805258, 2.0520366207807728]], [[4.0623440919435829, 1.9082478376007543, -0.79193987886616846, 1.3353707353448465, -3.7492075673569425], [-1.5154814337279432, -1.5536399579459745, 4.5634129350727211, 3.3804196342779012, 3.2112682106830839], [-0.25984485801736312, 4.5426736805911521, 3.7551542763704706, 1.7900462277904525, 3.6628063584370611], [-2.2745053890451605, 3.2240382772039595, -1.9897772495283874, 4.0585972104053099, -1.5590766084683927]], [[-0.37056212224438578, -2.8031293412101412, -4.0122155202865759, 0.70465751655720421, -3.7253205129966673], [0.43375342369254088, 1.1394599004159724, 3.4594922343439656, -2.1990465600858675, -4.9035546219180803], [0.75790621225961985, 3.7002623400387762, -0.60727796223015407, 0.42958017522841097, -2.8644475196648402], [-4.8873791287301902, 4.7634103649381281, 1.0847763473454028, 2.7860646217330434, 4.3921415056155322]], [[-4.4600481827019509, -0.48842465042294148, 0.13994667587490373, 1.2409918198206373, -0.68500732706287959], [3.6299051283299111, 4.4397546195600981, 2.0177748266215563, -0.1494151970314519, -3.5144138432533314], [-2.9834945709090945, -2.33108982058438, -4.5782918661638528, 0.41607393366120071, 3.5397537249736679], [-1.7461086205743417, -2.8042704482577738, -1.4207058536654502, 3.3439309341820174, 4.5392143770051305]], [[-3.7914911287507023, 4.7271666519748425, 2.631289200394006, 1.4271471102878008, -2.4560694230545899], [-3.6744376955856906, -1.4275853519879833, -4.4394853400662999, 4.335870006224571, -0.24870780849679441], [-3.3825960653051967, -2.6421286670356849, -4.6575525432283005, 0.9419403353672342, 2.0589689090601695], [-1.5928201763965033, -1.0203052235279864, 0.50648511911151939, 3.6335247698423565, -0.16392003414818923]]], [[[-2.104900783159632, -2.192590871697746, -3.4538684108885231, 1.7048658726629187, 1.4905519897639854], [2.3730682474708331, 1.542166404953818, 4.1543595091920622, -1.1578541843129364, 1.7740680942702731], [3.0935922145133539, -2.5220919519081599, -2.6253748583367864, 0.15144510018346935, 0.16601142464628182], [-1.8578710462851578, 0.4301263345136741, 1.2438935596161693, 4.7605958945804279, 3.9486714077693179]], [[2.292877511245619, 0.8648210870538664, -0.13048079481249175, -0.22372138575125788, -4.0586242126785246], [4.968346838696295, 0.69586895528144321, -0.15076687626093932, 1.944739982578545, 1.9654058912616126], [3.584105273716677, -3.7716773228936082, -4.145852026247737, 0.74658457064715744, -4.5967282428704213], [1.1751376730627818, -4.0857176320847612, 4.3503651860354164, 0.37752752027169478, -3.5330343076082249]], [[-3.5370840115134472, 3.44949571181143, -2.6220465334924126, -0.38578566928079816, -2.4242083422118741], [-2.7236647484117613, -4.9552295136845572, 2.7359991672622979, -4.0671293708892886, 4.3820002549328603], [1.7286422041802609, -4.2147446231433694, -3.193506492388829, -4.3790321349194521, -3.727399594873928], [-2.6119947235741883, -0.11384476222688011, 3.9604682727994049, -0.50442340159708809, 1.1173637806962695]], [[2.5634597902192038, 0.40441801350387507, 4.6380895480956568, 3.8437527729404923, -2.3467729835414444], [-2.7524315184877279, -1.5920598458973254, -3.3316966551887917, 3.8140363507064983, 0.20525337161538992], [3.9592216783396204, 4.2958286552380756, -4.4589321305260139, -1.9656468944474303, -1.492570216601977], [2.2971001930917563, 0.69530379917067986, 2.760750402546277, 0.99787707866195063, 2.3268943342026782]], [[-4.1604981998659385, 4.189126799002068, -4.8742543547413844, 1.9906817239783381, 3.6054265187525676], [0.85732588811316646, 0.59753260429887867, 2.5848823848803946, 4.9348914882661781, -4.2579963719534781], [4.9927828113911463, -1.2257725815945628, 2.1626458562948283, -0.31370941607021141, -1.1508557520787877], [1.8495551225262927, 0.59733148956172233, -1.0456098539254146, 2.3110888555911133, 0.076516685324187428]]]])+(1.-msk_arg1)*numpy.array([[[[-0.4886756011343909, -0.44534407645434815, 1.9269679109047377, -0.42475062479379933, 0.76113960244103662], [0.65051370186012569, 4.0261411936340394, -2.6273329802163001, 2.5249830725735558, 1.6664606846824723], [-3.5385330150351435, 4.0189899185076268, 0.7563603611012768, -0.75557522826994816, 3.6578056345727479], [-3.2079106520376346, 2.5641932571610058, 2.3544080075388294, 3.2802353606040349, 2.3617976532756195]], [[-3.2435967953765399, -3.7703455468358236, 1.6264418470153261, 2.3855072726703233, -1.8403798027639362], [1.7215497095549512, -0.46996644681035882, 4.7040194417241903, -1.1100630147164892, 2.7864047981708531], [-2.3101209359391941, 1.3937077391152277, -4.6887621626068317, -0.64602807658070471, -2.6956284974690847], [4.7596671859562338, -3.5902515479353916, -4.676001409628129, 1.4758828614071531, 1.5342991865824063]], [[2.237819902279349, 0.74083385435220883, -1.2852648538420874, -0.52100724676176569, 4.6012834693211886], [3.0742282162710879, 3.516261467746137, -4.6591368386422367, -4.6983690626757388, -4.2133338193495664], [-4.9527525341585088, -0.91195793820504445, -3.6696926572596178, -2.992207175387207, 4.7388636992697428], [-0.9246526457310198, 0.22565399154752086, -3.4379195923818342, 0.40821038936037013, -1.8802832129646552]], [[2.6235135974420709, -3.6356492571197063, 3.0109077079633835, -1.2613647448118925, 2.7922321737440861], [-4.7294440896175463, -4.6706898392417662, 2.2355243769523963, 4.1857240834549501, -3.1498421228640918], [-4.5232095712319644, -3.5650686671557663, -2.9117548355080758, 2.6377166781292321, -3.8219987883023476], [1.0175622936202933, 1.6317496761103936, 4.84898215404999, -2.6025319141315908, 3.6412913838923551]], [[1.3865641978607925, -3.4970824735118136, -2.3954264917054626, -1.4404226382506713, -1.8901183363874772], [3.9823600078147798, 2.7854617704743321, 4.362585075288532, 1.1412718253491594, -4.159027401823411], [-2.0611686726547465, -0.62524600721672563, 4.4909538083864327, 2.144159963592144, -2.2746986815379868], [4.1823158140106127, -3.5859414272965475, -3.8847092109238424, -3.5506432259605694, -1.4948837396266645]]], [[[4.7298572629710218, -3.6149566373967525, -4.2958211091382568, -2.1669024743430985, 1.8789138617383037], [0.68890315967369276, 2.9119340525340407, -3.1742837791791221, -2.494460467052193, -0.18210199292817819], [-0.86178302787129457, -3.919963062427513, -3.5220794215090843, -2.986302324155087, -4.2954249270263887], [2.1875860637249307, 0.92248131782718623, 3.671508283492507, -3.7844410421931851, -3.3352492455391602]], [[1.4035683430853751, 4.0193193677842594, 4.3142952741798766, -0.43490453848334987, -0.18447633822118981], [2.3918960849629221, 1.9097719332199512, -0.16191969893690938, 4.9044980872695518, 3.3250621303668559], [0.37549063374906844, 4.4810850120900945, 3.3657523393202915, -4.9664940278597509, 0.712678433215026], [-3.038309447159623, -0.35270395338862581, 2.7456764570799503, 0.12260085419000699, 2.7452532276798483]], [[1.8385981466756327, -4.1286602941196415, 2.9578218293254102, 2.0021824747299206, 1.6993272735573512], [4.5196076507752618, 2.1934471849623316, -3.4223449525194716, -2.1124231689965711, -0.46984368417784061], [-4.2659119269921604, -3.489185855188266, -1.0515461336010268, 2.4074666593677474, 2.718963836313975], [-0.40860150528553518, -4.6909919917590015, -2.4506101436501018, -4.6350382639903813, -3.9351179705673465]], [[-0.4368975557909156, 4.6687784964457943, 4.568415602485759, -4.9061207995153779, -4.8262118574969728], [1.2952635354258817, 4.5295707707972372, 1.1072785204111932, -0.23195289071690883, 1.4306189259560949], [4.2465581389005003, 2.0092579794582406, 4.7662815706627413, -3.5735471868596393, -3.9514229848503568], [-0.2091067921018519, 1.1644610335184726, -2.5610103008707141, -1.0646348048921772, -4.8192332944941221]], [[3.2086006014465145, 4.9047492389811413, 3.725480953160222, -3.5147049355423277, -2.0497932775057395], [0.68639424609507493, -2.1994958120577888, -0.10711839599910533, -2.543085824313136, 0.7812679307021817], [-3.6911641548284244, -3.8822747383086242, 0.019662525660325336, -0.71787864281625868, 3.8341592473320478], [-0.22431646478831802, 0.31421528887606609, 1.1246225063320416, 2.8725683736736149, 2.5958438570702409]]], [[[-0.93804431525083576, 3.9434926186002457, 4.9560001080623177, 4.96875601642307, 1.2364961117512818], [-4.4087452928564463, -1.280620017696148, -4.2369382350408813, -1.9524737169702422, -1.2232892764940462], [-4.1654082274573989, -1.7974978717586607, 3.1156799546839604, 1.7661907775887773, -4.7127042276049549], [1.9949968860329337, 2.7711088501463275, -1.599972605953468, 1.7383976488851038, -2.5270989354614359]], [[2.4263247828627632, -2.9481037212088932, -3.4639734198926631, -0.89436278979313144, 1.4602311369962937], [1.0723185751808595, -1.7853201972769686, 2.1532740553380059, 4.0747678778920875, -4.730441426274675], [-4.9945674176323287, -2.182176122144186, -0.4093986781618959, 4.0263870682826663, 4.3599958201121254], [4.3234908549885649, 4.6031558410857674, -0.21068152457013412, 3.4706909484729174, -2.4870527387037278]], [[-0.76687944617954606, -3.5257737248124013, -1.4053099240220215, 3.632082035819975, -1.6130254310259695], [2.3575022456159456, -3.9843420182853939, 0.37480375068443816, -1.5512374282371044, -0.055291317768555004], [-2.1121637451875674, -2.6168544959376092, -0.25431324524035492, -1.4068123672760757, -1.5626099732314236], [2.3969466744753163, 4.0347877138010695, -2.8392519960166727, 2.5344623602309735, 3.3924869847610122]], [[4.0049990861231528, 0.57972492583667989, -3.2438619567106364, -4.7246732698973526, -2.1923380275845239], [-0.11524545565395972, -4.336898032281451, 3.8194038941373023, -2.3868587435180268, 4.2576329662420473], [-4.709598673151695, 0.46288070750810117, 0.60722415688929487, 0.93468767631348015, -3.5733681874696721], [1.4930696110941124, -0.62853667164306959, -0.12051171850361975, 4.5493567614844537, -4.3847486816898087]], [[-1.4176755691236576, 2.4453598996656307, -3.6958776962914253, -0.56135869739005972, 0.040273989419755907], [0.32971052898971642, -3.1917916757223699, -4.8747575324200643, -1.7133970832745771, 4.4832527911353868], [0.36926948926633596, 1.921231135893775, 1.9600542910537344, 1.7193753231834457, 3.9549516094774102], [4.3391848326804645, 3.5497255924722122, 1.817449042922008, 1.2712098174031379, 0.35241209166391751]]], [[[0.34153151078710753, -3.7419788835827115, -4.7787371023713003, 4.4742605514214979, 3.4141095970509365], [3.0767951713085662, 4.8245008482305636, -3.5365170268269432, 4.5432662200386709, -1.1883533801463808], [3.7823590002706791, -2.2945980599319915, -4.2424335655609209, -2.9771938074287196, -4.6078117526945928], [-2.0151227108426104, -1.3939447080208875, 4.6309888238261152, -1.6448629575079874, -1.2097769916052381]], [[-2.8328973365696717, 1.1090385826411975, -4.782061365379203, 4.6564212827694273, -3.1055616741261494], [-2.8429835774716414, 3.7835300581108537, -1.0429958550466045, 0.09521054848214483, 4.7949698416304578], [-4.0398899822983134, -2.5455494543185377, 4.8522427558373007, -2.0712174839328004, -4.3983346307690487], [-4.2763142192238925, 4.5569774985184672, 1.3878783000788184, -0.34426698160256652, 0.8765448578157562]], [[-1.7901437065891801, -2.0306187014716159, 3.8259195091815741, 2.6253568326083476, 3.8890081974674473], [4.2416034796378916, -4.0223688338132018, -0.96550437376796605, -4.3842717278011767, -2.6980411575420984], [-4.0198257661807926, 4.572727128810806, -2.832483848043883, -0.6736995813090072, 3.0091910485722071], [-0.84978773305103417, 1.3483030503627136, 4.7336168335269981, -2.3386316163730534, -4.3508566799891462]], [[-2.6522137705826889, 2.7080025265579177, -0.31422524771162941, -3.4409197004878922, -2.3084113700232347], [-0.98383839671141704, 0.95805916872489849, 0.9499707548847649, -1.9939716280790956, 0.2908997005833136], [-2.2051889333358785, 3.6118971919665128, -1.6268343710857271, 3.3540324247340916, -4.0061369146105381], [1.3478004483155983, -2.7407353032116619, -2.1929708675539858, -2.8843265140124763, 4.9393545268705985]], [[4.2693072620529051, -1.2753636478908028, -3.4227458450765602, -4.8066174525633514, -0.038865506636271085], [-1.925187985401553, 0.23950580854013204, -1.8380477639754389, 2.8605774906380086, -1.5385785659156204], [-1.1575468681005843, 1.2168994116357821, 3.9145445190572126, -0.15804671650569801, 1.8533872600795647], [-3.2855853315356276, 0.55919528326437451, -0.87781816860159179, -3.0170324519102953, 1.4111596768004189]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[3.1571863034153269, 0.60962448577028239, 0.12067765100989591, 0.43349671713436377, 6.6369645861360986], [2.4252161717461345, 2.9673617149448486, 1.7865407470003847, -1.5588967787444998, 3.7695066672091482], [3.72141758385985, 2.0921426398606, 2.8876378822281961, -0.8311534822245239, 4.1400918077178561], [6.1247600769596247, 6.7362070569918941, -0.19731304530553828, 6.0367582803095488, 1.8458824632610238]], [[7.5331669897576914, 2.8113758180114239, 8.8929607281688998, 4.2128937917341149, 3.5979218818350414], [6.6299649708493691, 1.3714298292252813, 6.5844944600862139, 4.4289917600377677, 5.8317720597944582], [1.7508687376670355, 6.1563338825754466, 1.4513664361987644, 3.9562292827374281, 5.7701825316446476], [2.8354519878110898, 1.0118675749328889, 5.412740166359769, 8.4909695764588751, 8.1154871110770355]], [[0.54383440369869085, 4.8707941961564618, 2.4898068681819225, -2.9796077397614154, 5.137372713315095], [-2.9263687811838954, -0.84986233768919339, 3.4474997369887159, -1.6846010429474578, -2.2840602292707968], [-0.14209344984612127, 1.2134820381458757, -3.8116123789640906, 5.0509186110782522, 0.83467992687675352], [-3.7177036496032994, 3.0108825359167701, -3.8646875022119804, -1.0258593610903031, -0.83311733051087877]], [[1.2260611924467737, 5.7652392061559166, -0.8190707598087279, 7.8427702914278914, 7.7059996729306306], [1.1848802383974366, 6.5189132756266908, 4.1635701442399995, 0.8120529415222153, -0.18926194210764136], [6.6107052173923808, 3.15915689783996, 7.8020852991096774, 7.2946420166694139, 5.1876962507673383], [3.3509416709324382, -0.43787868259484419, 3.8967542953712195, 4.1463037649806056, 0.94709778186949389]], [[1.5210559694954737, 6.0839913347385517, 7.1208513174655685, 6.8988830513587338, 7.8360825464060042], [3.5639163280512367, 1.8858148276059481, 7.4496830660546127, 4.7213781326248014, 4.4539326061510796], [2.685218131417507, 5.2523673936406761, 1.924578915374922, 0.10523786986282246, 2.2911551364571054], [8.097927586897157, 1.1983897574602205, 1.2739054520948043, 6.9689208674605991, 8.8586223642647592]]], [[[-1.1043046106300132, -0.30015397017509482, -0.83014427735392982, 1.3180165167525688, -2.4022358326779782], [0.15819720159682138, -3.9036536298669615, -4.7697465122221736, -4.8220194300055885, -8.4876269608548398], [-2.1214489868056461, -4.2379736883480934, -3.3675712958294897, -5.5992926904547673, -8.5917840038707176], [-3.7406121303063307, -8.0218570202583237, -5.5640457524221052, -6.455448845545579, -0.8026116732544919]], [[-3.1352705031886536, 0.070741975593122675, -3.0617810910082275, -6.0312684770733691, -4.7228532183360876], [-6.3170666513317153, -6.4751539156188436, -1.4679053340148736, -6.757927529453152, -1.7356792103597485], [-3.4534133490025321, -6.0615444769848974, 1.1465392552459299, -3.4984060172063227, -6.5253689360596301], [0.48956625415413413, -0.82938810016613029, -1.5787842172119984, -0.76702517071754528, 0.31469931082668268]], [[3.2364904472641944, -3.1192918878974778, 2.9485282797397643, -2.6896244231688637, -3.9514961613901463], [-1.4289975807348907, 0.96126186504678923, 1.780579758503948, 2.5209729234237557, -1.3400188480311881], [2.1079655355530162, -0.16721915969672274, 5.7555581565038478, -2.6051699000501802, 3.3739466811961547], [-2.9837483532169493, -2.289429065750118, 1.3314413172712927, 5.0684045103801809, -1.7056590953222237]], [[2.8432745756504989, 0.041992817592806375, -1.7716448358930688, 4.6553627432618194, -3.4759890276434779], [-4.1379517904218401, -0.066507950339229183, 0.48882814978466804, 1.6026768442832582, -1.8330281557656081], [-2.4191338590822662, -0.99883748126379102, 0.73862220845348947, -2.5957763722580891, -2.8266543611347403], [-4.1482398218032674, 2.3272756067109333, 5.4859308181936148, 5.2801340813233972, -1.3974218578620188]], [[-4.2809058041649282, -5.9595263873568864, -3.8672211523038866, -4.9481045734927322, -0.30342814542935503], [-1.725767375875221, -0.23335369559736119, 0.82136206729751482, -3.5877526954428545, -4.6637933819298523], [-1.1393793485690784, -1.1544493369808109, -1.5227764409890199, -6.6548840674347023, -1.4797446866940067], [-7.4446202272518862, 0.98299563707841831, 0.68066341482372739, -7.7474666926061664, -2.043106883380732]]], [[[-1.2380694665358343, 1.4878383732164053, -2.1942977723506134, -0.15108369144986167, 4.8921413626447672], [1.5567335998710803, -4.8772441624485134, -2.7432108572521745, 1.5150609532176729, -2.893134999734901], [2.6098154753836162, -1.3272265184995184, 2.6962689967968965, 0.011861857569567924, -0.22365616046092018], [-1.6044203059168307, -4.4783914265859055, -1.5365109029644586, 0.54040531423550053, 1.9608471979082207]], [[5.8913434963223414, 3.7372472419795129, 1.0370595255125901, 3.164370139723605, -1.920208162978184], [0.31351797065081533, 0.27535944643278398, 6.3924123394514796, 5.2094190386566597, 5.0402676150618424], [1.5691545463613954, 6.3716730849699106, 5.5841536807492291, 3.619045632169211, 5.4918057628158197], [-0.44550598466640201, 5.053037681582718, -0.1607778451496289, 5.8875966147840684, 0.26992279591036583]], [[-3.0004818675597935, -5.433049086525549, -6.6421352656019836, -1.9252622287582035, -6.3552402583120751], [-2.1961663216228668, -1.4904598448994353, 0.82957248902855785, -4.8289663054012752, -7.5334743672334881], [-1.8720135330557879, 1.0703425947233685, -3.2371977075455618, -2.2003395700869968, -5.494367264980248], [-7.5172988740455979, 2.1334906196227204, -1.5451433979700049, 0.15614487641763564, 1.7622217603001245]], [[-9.4174421867297866, -5.4458186544507781, -4.8174473281529329, -3.7164021842071993, -5.6424013310907162], [-1.3274888756979255, -0.51763938446773849, -2.9396191774062803, -5.1068092010592885, -8.471807847281168], [-7.9408885749369311, -7.2884838246122161, -9.5356858701916885, -4.5413200703666359, -1.4176402790541687], [-6.7035026246021783, -7.7616644522856104, -6.3780998576932868, -1.6134630698458192, -0.41817962702270606]], [[-7.6169051417257361, 0.90175263899980873, -1.1941248125810278, -2.398266902687233, -6.2814834360296237], [-7.4998517085607244, -5.2529993649630171, -8.2648993530413328, 0.51045599324953717, -4.0741218214718282], [-7.2080100782802301, -6.4675426800107187, -8.4829665562033334, -2.8834736776077996, -1.7664451039148643], [-5.4182341893715371, -4.8457192365030206, -3.3189288938635144, -0.1918892431326773, -3.989334047123223]]], [[[-4.3682707674156624, -4.4559608559537764, -5.7172383951445536, -0.55850411159311175, -0.77281799449204502], [0.10969826321480269, -0.72120357930221246, 1.8909895249360318, -3.4212241685689668, -0.4893018899857573], [0.83022223025732345, -4.7854619361641904, -4.8887448425928168, -2.1119248840725611, -2.0973585596097486], [-4.1212410305411886, -1.8332436497423563, -1.0194764246398611, 2.4972259103243974, 1.6853014235132875]], [[0.25219047477129131, -1.1758659494204613, -2.1711678312868194, -2.2644084222255856, -6.0993112491528523], [2.9276598022219673, -1.3448180811928845, -2.191453912735267, -0.09594705389578273, -0.075281145212715117], [1.5434182372423493, -5.8123643593679359, -6.1865390627220647, -1.2941024658271703, -6.637415279344749], [-0.86554936341154587, -6.1264046685590889, 2.3096781495610887, -1.6631595162026329, -5.5737213440825526]], [[-1.8034958710665032, 5.183083852258374, -0.88845839304546859, 1.3478024711661458, -0.69062020176493011], [-0.99007660796481733, -3.2216413732376132, 4.4695873077092418, -2.3335412304423446, 6.1155883953798043], [3.4622303446272049, -2.4811564826964254, -1.459918351941885, -2.6454439944725081, -1.993811454426984], [-0.87840658312724429, 1.6197433782200639, 5.6940564132463489, 1.2291647388498559, 2.8509519211432135]], [[2.7443447962184901, 0.58530301950316144, 4.8189745540949431, 4.0246377789397787, -2.165887977542158], [-2.5715465124884416, -1.411174839898039, -3.1508116491895053, 3.9949213567057846, 0.38613837761467629], [4.1401066843389067, 4.4767136612373619, -4.2780471245267275, -1.784761888448144, -1.3116852106026906], [2.4779851990910426, 0.87618880516996622, 2.9416354085455634, 1.178762084661237, 2.5077793402019646]], [[0.53892166096974581, 8.8885466598377523, -0.17483449390570005, 6.6901015848140224, 8.3048463795882519], [5.5567457489488508, 5.296952465134563, 7.2843022457160789, 9.6343113491018624, 0.44142348888220617], [9.6922026722268306, 3.4736472792411215, 6.8620657171305126, 4.3857104447654729, 3.5485641087568967], [6.548974983361977, 5.2967513503974066, 3.6538100069102697, 7.0105087164267976, 4.7759365461598717]]]])+(1.-msk_ref)*numpy.array([[[[2.9248772295103471, 2.9682087541903899, 5.3405207415494758, 2.9888022058509387, 4.1746924330857746], [4.0640665325048637, 7.4396940242787775, 0.78621985042843789, 5.9385359032182938, 5.0800135153272103], [-0.12498018439040548, 7.4325427491523648, 4.1699131917460148, 2.6579776023747899, 7.0713584652174859], [0.20564217860710343, 5.9777460878057438, 5.7679608381835674, 6.6937881912487729, 5.7753504839203575]], [[1.747148767000807, 1.2204000155415233, 6.617187409392673, 7.3762528350476702, 3.1503657596134107], [6.7122952719322981, 4.5207791155669881, 9.6947650041015372, 3.8806825476608577, 7.7771503605482], [2.6806246264381528, 6.3844533014925746, 0.30198339977051525, 4.3447174857966422, 2.2951170649082622], [9.7504127483335807, 1.4004940144419553, 0.31474415274921785, 6.4666284237845, 6.5250447489597532]], [[2.7906499987291147, 1.2936639508019745, -0.73243475739232178, 0.031822849687999977, 5.1541135657709543], [3.6270583127208536, 4.0690915641959027, -4.106306742192471, -4.1455389662259732, -3.6605037228998007], [-4.3999224377087431, -0.35912784175527879, -3.1168625608098521, -2.4393770789374414, 5.2916937957195085], [-0.37182254928125413, 0.77848408799728652, -2.8850894959320685, 0.96104048581013579, -1.3274531165148895]], [[6.2187290241842286, -0.040433830377548663, 6.6061231347055411, 2.3338506819302651, 6.3874476004862437], [-1.1342286628753886, -1.0754744124996085, 5.8307398036945539, 7.7809395101971077, 0.44537330387806584], [-0.92799414448980677, 0.030146759586391347, 0.68346059123408187, 6.2329321048713897, -0.22678336156018997], [4.6127777203624509, 5.2269651028525512, 8.4441975807921477, 0.99268351261056686, 7.2365068106345127]], [[5.9119210316630486, 1.0282743602904425, 2.1299303420967934, 3.0849341955515848, 2.6352384974147789], [8.5077168416170359, 7.3108186042765881, 8.8879419090907881, 5.6666286591514154, 0.36632943197884504], [2.4641881611475096, 3.9001108265855304, 9.0163106421886887, 6.6695167973944001, 2.2506581522642692], [8.7076726478128688, 0.93941540650570854, 0.6406476228784137, 0.9747136078416867, 3.0304730941755915]]], [[[1.0980754032112214, -7.2467384971565529, -7.9276029688980572, -5.7986843341028989, -1.7528679980214967], [-2.9428787000861076, -0.71984780722575969, -6.8060656389389225, -6.1262423268119939, -3.8138838526879786], [-4.493564887631095, -7.5517449221873134, -7.1538612812688847, -6.6180841839148874, -7.9272067867861891], [-1.4441957960348697, -2.7093005419326142, 0.039726423732706628, -7.4162229019529855, -6.9670311052989611]], [[-1.8719739655455712, 0.74377705915331305, 1.0387529655489303, -3.7104468471142962, -3.4600186468521361], [-0.88364622366802426, -1.3657703754109951, -3.4374620075678557, 1.6289557786386055, 0.04951982173590963], [-2.9000516748818779, 1.2055427034591482, 0.090210030689345189, -8.2420363364906972, -2.5628638754159203], [-6.3138517557905693, -3.6282462620195721, -0.52986585155099597, -3.1529414544409393, -0.53028908095109806]], [[2.8584069864369299, -3.1088514543583443, 3.9776306690867074, 3.0219913144912178, 2.7191361133186485], [5.539416490536559, 3.2132560247236288, -2.4025361127581744, -1.0926143292352739, 0.5499651555834566], [-3.2461030872308632, -2.4693770154269687, -0.031737293839729563, 3.4272754991290446, 3.7387726760752722], [0.61120733447576203, -3.6711831519977043, -1.4308013038888046, -3.6152294242290841, -2.9153091308060493]], [[0.25131700623026898, 5.3569930584669789, 5.2566301645069435, -4.2179062374941934, -4.1379972954757882], [1.9834780974470663, 5.2177853328184218, 1.7954930824323778, 0.45626167130427575, 2.1188334879772794], [4.9347727009216849, 2.6974725414794252, 5.4544961326839259, -2.8853326248384548, -3.2632084228291722], [0.47910776991933268, 1.8526755955396572, -1.8727957388495295, -0.37642024287099263, -4.1310187324729375]], [[-0.58308404661810176, 1.1130645909165251, -0.066203694904394261, -7.3063895836069435, -5.8414779255703557], [-3.1052904019695413, -5.991180460122405, -3.8988030440637216, -6.3347704723777518, -3.0104167173624345], [-7.4828488028930407, -7.6739593863732409, -3.7720221224042909, -4.5095632908808749, 0.042474599267431579], [-4.0160011128529343, -3.4774693591885502, -2.6670621417325746, -0.9191162743910013, -1.1958407909943753]]], [[[-1.0292337381233878, 3.8523031957276936, 4.8648106851897657, 4.8775665935505179, 1.1453066888787298], [-4.4999347157289984, -1.3718094405687, -4.3281276579134333, -2.0436631398427942, -1.3144786993665982], [-4.256597650329951, -1.8886872946312128, 3.0244905318114084, 1.6750013547162252, -4.8038936504775069], [1.9038074631603816, 2.6799194272737754, -1.6911620288260201, 1.6472082260125518, -2.618288358333988]], [[4.2553241872415217, -1.1191043168301347, -1.6349740155139045, 0.93463661458562708, 3.2892305413750522], [2.901317979559618, 0.043679207101789963, 3.9822734597167644, 5.903767282270846, -2.9014420218959165], [-3.1655680132535702, -0.35317671776542747, 1.4196007262168626, 5.8553864726614249, 6.1889952244908839], [6.1524902593673234, 6.4321552454645259, 1.6183178798086244, 5.2996903528516759, -0.65805333432496926]], [[-3.3967991914949538, -6.155693470127809, -4.0352296693374292, 1.0021622905045673, -4.2429451763413777], [-0.27241749969946216, -6.6142617636008012, -2.2551159946309696, -4.1811571735525117, -2.6852110630839627], [-4.7420834905029752, -5.2467742412530169, -2.8842329905557627, -4.0367321125914835, -4.1925297185468313], [-0.23297307084009145, 1.4048679684856618, -5.4691717413320804, -0.095457385084434243, 0.76256723944560445]], [[-0.95239491790468378, -4.3776690781911567, -8.2012559607384734, -9.6820672739251883, -7.1497320316123609], [-5.0726394596817963, -9.2942920363092867, -1.1379901098905343, -7.3442527475458634, -0.69976103778578924], [-9.6669926771795325, -4.4945132965197354, -4.3501698471385417, -4.0227063277143564, -8.5307621914975087], [-3.4643243929337242, -5.5859306756709062, -5.0779057225314563, -0.40803724254338292, -9.3421426857176453]], [[-5.2430895820986914, -1.3800541133094031, -7.5212917092664586, -4.3867727103650935, -3.7851400235552779], [-3.4957034839853174, -7.0172056886974037, -8.7001715453950972, -5.5388110962496109, 0.65783877816035297], [-3.4561445237086978, -1.9041828770812588, -1.8653597219212994, -2.1060386897915881, 0.1295375965023764], [0.5137708197054307, -0.27568842050282161, -2.0079649700530258, -2.5542041955718959, -3.4730019213111163]]], [[[-1.9218384734689229, -6.0053488678387419, -7.0421070866273308, 2.2108905671654675, 1.1507396127949061], [0.81342518705253575, 2.5611308639745332, -5.7998870110829737, 2.2798962357826404, -3.4517233644024112], [1.5189890160146486, -4.5579680441880219, -6.5058035498169513, -5.2405637916847496, -6.8711817369506232], [-4.2784926950986408, -3.657314692276918, 2.3676188395700848, -3.9082329417640178, -3.4731469758612685]], [[-4.8735843730439994, -0.93164845383313022, -6.8227484018535307, 2.6157342462950997, -5.1462487106004771], [-4.8836706139459691, 1.742843021636526, -3.0836828915209322, -1.9454764879921829, 2.7542828051561301], [-6.0805770187726411, -4.5862364907928654, 2.811555719362973, -4.1119045204071281, -6.4390216672433764], [-6.3170012556982202, 2.5162904620441395, -0.65280873639550929, -2.3849540180768942, -1.1641421786585715]], [[-0.056555566142236113, -0.29703056102467196, 5.5595076496285181, 4.3589449730552916, 5.6225963379143913], [5.9751916200848356, -2.2887806933662578, 0.76808376667897793, -2.6506835873542327, -0.96445301709515441], [-2.2862376257338486, 6.30631526925775, -1.098895707596939, 1.0598885591379368, 4.7427791890191511], [0.88380040739590982, 3.0818911908096576, 6.4672049739739421, -0.60504347592610941, -2.6172685395422022]], [[-2.4713287645834026, 2.8888875325572041, -0.13334024171234304, -3.2600346944886058, -2.1275263640239483], [-0.80295339071213068, 1.1389441747241849, 1.1308557608840513, -1.8130866220798092, 0.47178470658259997], [-2.0243039273365921, 3.7927821979657992, -1.4459493650864408, 3.5349174307333779, -3.8252519086112517], [1.5286854543148847, -2.5598502972123756, -2.0120858615546995, -2.7034415080131899, 5.1202395328698849]], [[8.9687271228885894, 3.4240562129448815, 1.2766740157591241, -0.10719759172766707, 4.6605543541994132], [2.7742318754341313, 4.9389256693758163, 2.8613720968602454, 7.5599973514736929, 3.1608412949200639], [3.5418729927351, 5.9163192724714664, 8.6139643798928969, 4.5413731443299863, 6.552807120915249], [1.4138345293000567, 5.2586151441000588, 3.8216016922340925, 1.682387408925389, 6.1105795376361032]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_expandedData_rank3(self):  
       arg0=numpy.array([[[3.0375466687956099, -2.3208203419688345], [4.4188049152675895, 4.0104863863246756]], [[-4.8579023433555886, 3.6025242293605881], [-1.7536341369826891, -3.0315480347692714]], [[-2.1962133124896743, -0.2105278171406173], [3.6883769437881746, -4.5211038984829415]], [[-0.85470445756831026, 1.2328397817211929], [-3.8522091885679313, -2.9330412926877814]], [[-1.5601254928097532, -1.8277085242069422], [-3.4879555270772666, 1.6846233639800046]], [[4.5874480238694222, -0.41769025321377029], [-1.9495024775351188, -1.821152667001984]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-2.9436946201698158, -2.0888465513384133], [3.302199854437939, 1.4404566260549156]], [[-3.0455633218431952, -2.0085785502071185], [2.1859372235227212, -0.65592197756721671]], [[-1.0037586735481185, 2.51521604702448], [-2.9847388393229157, -3.2167190473113862]], [[0.92948514742103416, 3.7497473418205178], [-3.9043690519131182, 1.1280734677974156]], [[-0.58095464936006991, -1.3762968755410254], [-3.9269082222104599, 3.2728219448531828]], [[-0.1462067740350399, 3.0211985800119834], [-3.7715938052894993, -0.11019209125010221]]])+(1.-msk_arg1)*numpy.array([[[0.21231921032862555, 3.7063442555767452], [-1.8984442253048615, -2.2108285356189681]], [[1.445670242443021, -3.1481323043686125], [0.16224567219952313, 4.4176660163578667]], [[-4.2629910301345237, 3.7567928170878755], [-0.78441064591608711, -4.3344298651524866]], [[2.8727649820693566, -4.1323316317036554], [0.62896333699929396, 1.5500249859593005]], [[4.0029723251215739, -0.51726525846121518], [-4.6940157367164925, -3.3526198053443457]], [[-3.2309921404564248, 1.2887509864310598], [-0.4246882434427004, -3.407485191400077]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[0.093852048625794104, -4.4096668933072483], [7.7210047697055284, 5.4509430123795912]], [[-7.9034656651987838, 1.5939456791534696], [0.43230308654003213, -3.6874700123364881]], [[-3.1999719860377929, 2.3046882298838627], [0.70363810446525887, -7.7378229457943277]], [[0.074780689852723903, 4.9825871235417107], [-7.7565782404810495, -1.8049678248903658]], [[-2.1410801421698231, -3.2040053997479676], [-7.4148637492877265, 4.9574453088331873]], [[4.4412412498343823, 2.6035083267982131], [-5.7210962828246181, -1.9313447582520862]]])+(1.-msk_ref)*numpy.array([[[3.2498658791242354, 1.3855239136079107], [2.520360689962728, 1.7996578507057075]], [[-3.4122321009125676, 0.45439192499197567], [-1.591388464783166, 1.3861179815885953]], [[-6.4592043426241981, 3.5462649999472582], [2.9039662978720875, -8.8555337636354281]], [[2.0180605245010463, -2.8994918499824625], [-3.2232458515686373, -1.3830163067284809]], [[2.4428468323118206, -2.3449737826681574], [-8.1819712637937592, -1.6679964413643411]], [[1.3564558834129974, 0.8710607332172895], [-2.3741907209778192, -5.2286378584020614]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_expandedData_rank3(self):  
       arg0=numpy.array([[[[-4.9407783252525679, -0.14424175273414352], [-4.3545195599278514, -3.8686580478958801]], [[1.7425577670443015, -0.3951190268107494], [-4.4907386430361367, -2.8108131631641573]]], [[[-0.075099569244216902, 4.0887904658084828], [4.0463519265595576, 1.6192761630580961]], [[-3.8737287658098305, -4.7394259307583457], [0.368153406977477, -4.9483556236364681]]], [[[-3.5683005037082918, 1.4242049761970623], [2.620195527695123, -3.1477482580412031]], [[1.0876020960683119, -4.2996264212844961], [-3.8001454401025048, -4.4701199797760038]]], [[[-1.3588645993283164, 4.8085871551782908], [-3.0252709580280204, 1.4664447535918868]], [[-0.71884429318254739, 1.9742312519676783], [-2.0019765595787309, -1.4305495117255895]]], [[[-0.79634063020349899, -2.9541777967788541], [-2.9373302340336336, -1.7517914190720143]], [[2.4077852343230512, -0.073969092729551988], [-3.6667125240402854, 0.051769693949651696]]], [[[3.8126167457681692, -2.498143046851359], [-3.7396731275215025, -3.6902480052146291]], [[-2.0919733809295615, -3.5413220908795662], [1.7033636008269184, -3.8210183386230776]]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-4.5646817902965502, 4.9273036898982898], [4.2290469849042474, 1.12758062327811]], [[-2.5527072270238973, 4.1126506110498919], [3.5924661996207679, 4.671252371793571]], [[-1.271502866785621, -0.73601200052148918], [-1.4008452590472564, 0.93037965731568129]], [[-3.0366057208944284, 2.8810293366365292], [-2.3963386585886459, 3.3054634301136492]], [[4.6856079925384773, -3.1338376645210397], [-3.8675242552947253, -0.88569683161757151]], [[4.0868360753748139, 3.4985448419039606], [4.0703207230620038, 4.7080190182159338]]])+(1.-msk_arg1)*numpy.array([[[-0.43354560971988843, 2.203513193832034], [4.5311103625538713, -4.5210537726922606]], [[0.22190220196093602, 3.5795464554700391], [3.4700992167327964, 2.5745888379826649]], [[4.9657509544094811, 4.9756270326869014], [3.0505771159862487, -0.65990862154152197]], [[1.9462425674708861, -3.3274330761441107], [-2.4987428941635539, 4.2222761100664048]], [[4.1515445645442064, 4.7466161741612929], [1.9172116407644673, -2.4969930283197348]], [[-3.8337672241687439, -2.1509820304718339], [4.4256521897855627, 1.485636682620064]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-9.5054601155491181, -4.7089235430306937], [0.57278412997043837, 1.0586456420024097]], [[5.9716047519485489, 3.833927958093498], [-3.3631580197580266, -1.6832325398860473]]], [[[-2.6278067962681142, 1.5360832387845855], [8.1590025376094495, 5.731926774107988]], [[-0.28126256618906265, -1.1469597311375779], [5.039405778771048, -0.27710325184289708]]], [[[-4.8398033704939127, 0.15270210941144136], [1.8841835271736338, -3.8837602585626922]], [[-0.3132431629789445, -5.7004716803317521], [-2.8697657827868235, -3.5397403224603226]]], [[[-4.3954703202227448, 1.7719814342838625], [-0.14424162139149121, 4.3474740902284159]], [[-3.1151829517711933, -0.42210740662096757], [1.3034868705349183, 1.8749139183880597]]], [[[3.8892673623349783, 1.7314301957596232], [-6.0711678985546733, -4.885629083593054]], [[-1.4597390209716741, -3.9414933480242773], [-4.5524093556578569, -0.83392713766791982]]], [[[7.8994528211429831, 1.5886930285234548], [-0.24112828561754185, -0.1917031633106685]], [[1.9783473421324422, 0.52899863218243759], [6.4113826190428522, 0.88700067959285622]]]])+(1.-msk_ref)*numpy.array([[[[-5.3743239349724563, -0.57778736245403195], [-2.1510063660958174, -1.665144854063846]], [[6.2736681295981729, 4.1359913357431219], [-9.0117924157283973, -7.3318669358564179]]], [[[0.14680263271671912, 4.3106926677694188], [7.6258983820295967, 5.1988226185281352]], [[-0.40362954907703408, -1.2693267140255493], [2.9427422449601419, -2.3737667856538032]]], [[[1.3974504507011893, 6.3899559306065434], [7.5958225603820244, 1.8278787746456984]], [[4.1381792120545606, -1.2490493052982474], [-4.4600540616440263, -5.1300286013175258]]], [[[0.58737796814256971, 6.7548297226491769], [-6.352704034172131, -1.8609883225522239]], [[-3.2175871873461013, -0.52451164219587554], [2.2202995504876739, 2.7917265983408153]]], [[[3.3552039343407074, 1.1973667677653523], [1.8092859401276593, 2.9948247550892786]], [[4.3249968750875185, 1.8432425480349153], [-6.1637055523600202, -2.4452233343700831]]], [[[-0.021150478400574713, -6.331910271020103], [-5.8906551579933364, -5.841230035686463]], [[2.3336788088560012, 0.88433009890599656], [3.1890002834469824, -2.3353816560030136]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_expandedData_rank4(self):  
       arg0=numpy.array([[[1.6447569414674419, -2.295741962205089], [-4.4918773354351069, -1.117543037315889]], [[0.22242231036159499, -4.9843709339327491], [2.840388974918354, 4.177744599319503]], [[-3.4444892787723704, 2.9933296151998032], [-0.66201237626009135, -2.0626589985640842]], [[-3.7665124492090305, -3.8979520569483128], [2.0377095057369718, 4.5134080679875197]], [[3.333392922725448, -0.26835657169502625], [2.7936687440567054, 0.97462816778735917]], [[-4.5664305446874129, 4.3665433206034443], [4.9925063869548119, -3.2696297286936868]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[2.495269447859112, 2.7654595684037631], [-4.9765388350565223, -1.2954371863293455]], [[-4.8947169508126578, -4.9344512995588339], [1.8022463688570802, 4.9714230490991937]]], [[[-3.1726945494926193, 0.99429036690305495], [3.0585880933949685, 3.2228624860664929]], [[2.9526371849861812, -3.4645793920483037], [1.5379847965451106, 1.9091770771415337]]], [[[4.8023312167673957, -1.2828804187588947], [-0.75098071787032428, -2.8796733949564768]], [[4.1882100081938329, 4.5151319571256092], [-3.4801719247528484, -0.58792383355739553]]], [[[3.0768780499284798, 3.3596018898371902], [-2.0710167648810107, -2.5528256024032983]], [[-1.9664819469846826, -4.9714629175255158], [1.6036810330010702, -3.0681899746855423]]], [[[-1.1852006495493139, -1.1577391558152508], [2.4670740963509008, 0.70137149893834927]], [[2.586505815921269, -4.0397107103693415], [4.2340379948111657, 4.925121844410727]]], [[[2.4285686471336092, 2.4948787312822764], [4.8340041893923651, -3.3450925741147652]], [[-1.6849049506279998, 3.732084286015585], [-4.3741054237491941, -2.7114155090528689]]]])+(1.-msk_arg1)*numpy.array([[[[-2.8898509517482474, 0.29683381658014341], [-2.025778302704059, -2.9469703671691461]], [[4.6132869291444507, 4.2021757162541267], [2.1395104897466517, 3.8373392002531261]]], [[[-4.8990320041550186, 0.59800884529124332], [-4.2344413843488056, -3.6241637896220666]], [[-3.9391121283338992, -1.8747478189517652], [3.6139365794079481, 2.5754991237061295]]], [[[0.74476531228321541, 4.8708573977043574], [-4.9320243704635001, 3.5937988557580027]], [[-2.4887064045311047, 1.1840827469462099], [-3.6464312324028136, -3.2552817297364669]]], [[[-3.5376885308626385, 3.1773930152579126], [-3.7138405324823944, -3.8622953232719706]], [[-0.82923184919801329, 0.98497533478601618], [-2.2313144363203063, -0.64271683560391679]]], [[[4.1883295221464927, -3.4093823106104493], [3.005788842150432, -4.5637066225676666]], [[0.12899572918106195, 2.8296456854213279], [3.2210066812486176, 0.82167173524936743]]], [[[3.685777860942185, 0.84168667477981884], [3.8171812489859587, 0.19305678111132796]], [[-0.61120955540878974, -2.5868103080909677], [-0.3258396007000659, -4.4218800769744906]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[4.1400263893265539, 4.4102165098712049], [-7.2722807972616117, -3.5911791485344344]], [[-9.3865942862477638, -9.4263286349939399], [0.68470333154119123, 3.8538800117833047]]], [[[-2.9502722391310243, 1.2167126772646499], [-1.9257828405377806, -1.7615084478662562]], [[5.7930261599045352, -0.62419041712994972], [5.7157293958646136, 6.0869216764610368]]], [[[1.3578419379950253, -4.7273696975312651], [2.242348897329479, 0.11365622024332644]], [[3.5261976319337416, 3.8531195808655179], [-5.5428309233169326, -2.6505828321214797]]], [[[-0.6896343992805507, -0.40691055937184029], [-5.9689688218293231, -6.4507776593516111]], [[0.071227558752289255, -2.933753411788544], [6.1170891009885899, 1.4452180933019774]]], [[[2.148192273176134, 2.1756537669101972], [2.1987175246558746, 0.43301492724332302]], [[5.3801745599779744, -1.2460419663126361], [5.2086661625985249, 5.8997500121980861]]], [[[-2.1378618975538037, -2.0715518134051365], [9.2005475099958094, 1.0214507464886791]], [[3.307601436326812, 8.7245906729703968], [-7.6437351524428809, -5.9810452377465557]]]])+(1.-msk_ref)*numpy.array([[[[-1.2450940102808055, 1.9415907580475853], [-4.3215202649091484, -5.2427123293742355]], [[0.12140959370934379, -0.28970161918098025], [1.0219674524307627, 2.7197961629372371]]], [[[-4.6766096937934236, 0.82043115565283831], [-9.2188123182815538, -8.6085347235548149]], [[-1.0987231534155453, 0.96564115596658873], [7.7916811787274511, 6.7532437230256326]]], [[[-2.699723966489155, 1.426368118931987], [-1.9386947552636968, 6.587128470957806]], [[-3.150718780791196, 0.5220703706861185], [-5.7090902309668978, -5.3179407283005506]]], [[[-7.304200980071669, -0.58911943395111788], [-7.6117925894307072, -7.7602473802202834]], [[1.2084776565389586, 3.022684840522988], [2.2820936316672134, 3.8706912323836029]]], [[[7.5217224448719406, -0.075989387885001314], [2.7374322704554057, -4.8320631942626928]], [[2.9226644732377673, 5.6233144294780333], [4.1956348490359767, 1.7962999030367266]]], [[[-0.88065268374522798, -3.7247438699075941], [8.183724569589403, 4.5596001017147723]], [[4.3812968315460221, 2.4056960788638442], [-3.5954693293937527, -7.6915098056681774]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_expandedData_rank4(self):  
       arg0=numpy.array([[[[3.8701602651161036, 0.50954964199084429, 0.14927991787008033, 3.8304531128781356], [0.33259539048517972, -3.7833046556467655, 0.035526344471827898, 1.8348337929517093], [2.5868695080397783, -1.9246505865067123, -0.49354223687480392, -0.19832702078029474]], [[-0.72353412669570361, -1.0668302657559559, 3.4654805163762656, 2.3061681210365812], [1.694566709744123, 1.9286491626770141, -2.5233389663167669, 3.0899581215590537], [-3.970137201013185, 1.5568924279289984, 1.4395758813617192, -1.9701575573450336]]], [[[-1.4470293282799318, 2.02451686276593, -3.4201230576769923, -3.7782038777554794], [1.9882285788729952, -2.4087997248203874, -4.7447612087758699, 4.4672321626999825], [1.1220620996866524, 2.7182869627297102, 2.3768075937825541, -0.33229877862627966]], [[-2.4876593831981761, 2.0667288652601945, -4.8122963541660235, 4.0825599581113199], [4.6001709097319061, 1.2493958367453173, -2.6223621221638203, 0.23566054389351088], [-2.692500319789346, 0.75153688742200053, -4.038244909677652, -2.7168803189479238]]], [[[0.20281369635485902, -2.8852975888952237, 3.7903051534502623, 2.0164483112690492], [3.9718489459713719, -2.4596169830847883, 4.5938107151184422, -1.4579726113669498], [-1.8294860814782243, -2.6260347239187523, -0.89928097830869191, -2.9344245904752841]], [[3.1856771530383092, 2.1006802171585512, 2.7777127242949682, -4.7948374736610848], [1.3702005265584472, 4.1140671374807631, 3.5571312712910661, 1.7653426972037147], [-2.7291753084854986, 2.3787176604532263, 0.99912592180664461, 0.8536168145113523]]]])  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-0.19451709343487344, 4.5770920061724425, 3.9982481567361443, -4.8324775464974934], [-4.4424010855469938, 4.660021459194617, 2.7907052917064874, 2.0841616275536978], [1.2643254581057937, 0.85741333096824501, 2.638113009897789, -3.5245227608115179]], [[-4.4836080793567579, -0.11015320542279028, 4.1594257006116493, 1.0410690287410471], [0.87040137116893934, 4.323983038262055, 1.3601383323555902, -4.5317588590343423], [1.7584107552472394, -3.0314584466484487, -3.7291315270834802, 3.1510171950419696]]], [[[-4.6806958034552366, -1.2409105227816797, 2.3513942110696897, 4.8064770111648123], [-2.3524966297819514, 0.12269876313284467, -2.3701835738065826, -2.2337147927953529], [-3.3956189992612473, -0.92273080184294809, -1.5320087959523541, 4.986655608269178]], [[-3.6998789138279942, 2.1386465586353918, 1.2164710159571204, -2.4316606527248865], [-1.4253998012169466, -3.2797061876075806, 4.8083422177576161, 0.99224066653165011], [-3.9706006155765361, 0.36813694034108746, 0.28276190740001628, -1.7560069603048802]]], [[[3.3217394484686835, -3.1355341140328399, 1.661291894389616, 2.8749869677018616], [-0.89843478897567852, -4.3427548797086022, -4.8139331798245122, -1.645309268535339], [-2.4120453436444587, -2.784280578486733, -3.3745874341942206, -2.7294071093365737]], [[4.7293838097464338, 4.2493105808668492, 0.078130064194308346, 2.0429707371804229], [0.20388175224661964, 3.8976324051359157, -3.1755428239050829, 1.856332284122189], [1.4369223357822598, 4.8588285245020604, -0.69057026167179281, 0.36403275208727415]]]])+(1.-msk_arg1)*numpy.array([[[[-0.019223712678879679, 1.2422438235294369, 3.6133261429663186, -3.7010108183348445], [-2.120518555150781, -4.1797812154401228, 1.1817851388964185, -0.28342945311600154], [4.3945006436640472, -4.6519171501963807, 1.6160360255094695, 0.60450625306693784]], [[0.46946850966075004, 2.8386655084782948, 4.6205973652228423, 0.96521459071841775], [-0.64895885949998533, 3.1638030004227087, -3.2330365356719604, -2.9267968341886941], [3.3833589324980444, 0.65708965742753023, -0.46058077646507822, 1.1456370657907371]]], [[[2.8272979670317167, -1.1620748513547561, 4.5553658284971768, -3.0942301160451926], [1.676406775354172, 1.5887542545161271, -1.5146700120769383, -1.9702116218150314], [-4.7735596378561347, 0.96071606740066784, 3.6460892339361735, -1.554957193860953]], [[4.0757752486417118, 0.89683105739400126, -3.7338420636609735, -4.6712570163714133], [-2.6311215379972519, 2.7802461774958243, -0.67393826548219593, 2.7995374296888151], [1.331346314062066, -3.3541504268733591, -4.6391574246711542, -4.2657907093067191]]], [[[-1.3661806436946975, 3.9776215882015205, 1.4769421191959093, -0.9036573773305312], [-0.9342176815950145, -3.2425416043463295, -0.98767709855303565, 1.2989744811283881], [-3.5278274982944868, -4.1100196578702786, -1.0045526792631074, 3.9948432403598275]], [[3.4405356131441085, -3.8784797377266278, -0.45465127512168202, 0.0048613446554579554], [-4.5920188002740296, 1.6570693489149875, -1.5488639816865621, 4.8018268016772065], [-2.8180587424375347, -0.19837413133840709, 4.2287325946838159, 3.7707090228362556]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[3.6756431716812301, 5.0866416481632868, 4.1475280746062246, -1.0020244336193578], [-4.109805695061814, 0.87671680354785142, 2.8262316361783153, 3.9189954205054072], [3.851194966145572, -1.0672372555384673, 2.144570773022985, -3.7228497815918127]], [[-5.2071422060524615, -1.1769834711787461, 7.6249062169879149, 3.3472371497776283], [2.5649680809130624, 6.2526322009390691, -1.1632006339611767, -1.4418007374752886], [-2.2117264457659456, -1.4745660187194503, -2.289555645721761, 1.180859637696936]]], [[[-6.1277251317351684, 0.78360633998425033, -1.0687288466073026, 1.0282731334093329], [-0.3642680509089562, -2.2861009616875427, -7.1149447825824526, 2.2335173699046296], [-2.2735568995745949, 1.7955561608867621, 0.84479879783020007, 4.6543568296428983]], [[-6.1875382970261708, 4.2053754238955863, -3.5958253382089032, 1.6508993053864334], [3.1747711085149595, -2.0303103508622633, 2.1859800955937958, 1.227901210425161], [-6.6631009353658825, 1.119673827763088, -3.7554830022776358, -4.472887279252804]]], [[[3.5245531448235425, -6.0208317029280636, 5.4515970478398783, 4.8914352789709108], [3.0734141569956934, -6.8023718627933905, -0.22012246470607, -3.1032818799022888], [-4.241531425122683, -5.4103153024054853, -4.2738684125029121, -5.6638316998118583]], [[7.915060962784743, 6.3499907980254005, 2.8558427884892765, -2.7518667364806619], [1.5740822788050668, 8.0116995426166788, 0.38158844738598319, 3.6216749813259037], [-1.2922529727032388, 7.2375461849552867, 0.30855566013485181, 1.2176495665986264]]]])+(1.-msk_ref)*numpy.array([[[[3.8509365524372239, 1.7517934655202811, 3.7626060608363989, 0.12944229454329115], [-1.7879231646656013, -7.9630858710868884, 1.2173114833682463, 1.5514043398357078], [6.9813701517038256, -6.576567736703093, 1.1224937886346655, 0.4061792322866431]], [[-0.25406561703495356, 1.7718352427223389, 8.0860778815991079, 3.271382711754999], [1.0456078502441377, 5.0924521630997228, -5.7563755019887273, 0.16316128737035962], [-0.58677826851514059, 2.2139820853565286, 0.97899510489664099, -0.82452049155429652]]], [[[1.3802686387517848, 0.86244201141117394, 1.1352427708201844, -6.872433993800672], [3.6646353542271672, -0.82004547030426034, -6.2594312208528082, 2.4970205408849511], [-3.6514975381694823, 3.679003030130378, 6.0228968277187276, -1.8872559724872326]], [[1.5881158654435357, 2.9635599226541958, -8.546138417826997, -0.58869705826009344], [1.9690493717346542, 4.0296420142411415, -3.2963003876460162, 3.035197973582326], [-1.36115400572728, -2.6026135394513585, -8.6774023343488054, -6.9826710282546429]]], [[[-1.1633669473398385, 1.0923239993062968, 5.2672472726461717, 1.112790933938518], [3.0376312643763574, -5.7021585874311178, 3.6061336165654065, -0.15899813023856169], [-5.3573135797727112, -6.7360543817890308, -1.9038336575717993, 1.0604186498845434]], [[6.6262127661824177, -1.7777995205680766, 2.3230614491732862, -4.7899761290056269], [-3.2218182737155825, 5.7711364863957506, 2.008267289604504, 6.5671694988809213], [-5.5472340509230333, 2.1803435291148192, 5.2278585164904605, 4.6243258373476079]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_Symbol_rank0(self):  
       arg0=numpy.array(-4.47192871421)  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(-0.994656650032)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array(-5.46658536424)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_Symbol_rank0(self):  
       arg0=numpy.array([4.7316220993229479, -0.27418741243809208])  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(3.25381102268)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([7.9854331220060413, 2.9796236102450013])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_Symbol_rank1(self):  
       arg0=numpy.array(3.94200915762)  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([0.13513554926292048, 4.061857308270362])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([4.0771447068818789, 8.0038664658893204])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_Symbol_rank0(self):  
       arg0=numpy.array([[-0.58020763927283259, 0.60485804924583864, 4.9259644719532787, -2.1486954063895256, 2.7934642190283299], [1.6822159521784155, 2.7483124573452136, -2.8004331565202198, 2.9438221066670476, -2.5864136655771022], [0.9101345547641273, 4.8357937536703144, -3.5367998859469263, -2.0694611786669439, 4.2626165752161072], [-4.5220527903149641, -3.1964999090581756, 0.23269630643061756, -0.0072734125635163238, -1.3970124456729383]])  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(4.90605848579)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[4.3258508465184553, 5.5109165350371265, 9.8320229577445666, 2.7573630794017623, 7.6995227048196178], [6.5882744379697034, 7.6543709431365015, 2.105625329271068, 7.8498805924583355, 2.3196448202141857], [5.8161930405554152, 9.7418522394616023, 1.3692585998443616, 2.836597307124344, 9.168675061007395], [0.38400569547632379, 1.7095585767331123, 5.1387547922219055, 4.8987850732277716, 3.5090460401183496]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_Symbol_rank2(self):  
       arg0=numpy.array(-2.12053457399)  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[4.5173353010468951, 2.8786652805833732, 1.5955340829923781, -2.4130959114722836, -0.29040785737722885], [0.66619216479382537, -3.2916227754910485, -4.6826358866854756, 0.089824275062710512, -1.2938807246062387], [-3.9333778300471698, -1.2006085122827246, -1.1255115122552182, 3.9788209630774816, 2.804202030760913], [-3.3592030812168638, -2.1487020184632986, 3.4730435821484846, 3.7132268171008533, 2.5541706104285797]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[2.3968007270581313, 0.75813070659460946, -0.52500049099638568, -4.5336304854610479, -2.4109424313659926], [-1.4543424091949384, -5.4121573494798128, -6.8031704606742398, -2.0307102989260533, -3.4144152985950025], [-6.053912404035934, -3.3211430862714884, -3.2460460862439819, 1.8582863890887178, 0.68366745677214924], [-5.4797376552056276, -4.2692365924520619, 1.3525090081597209, 1.5926922431120896, 0.43363603643981596]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_Symbol_rank0(self):  
       arg0=numpy.array([[[-4.4879082778629362, 2.0145869612406209], [-4.750338221649379, -2.6471533445484652]], [[3.9552770481468684, 0.43581580074175807], [0.96651350692065741, 4.558178090539327]], [[4.8565657558103599, -1.7643683387935374], [-0.18162060180462625, -0.66785288476699201]], [[1.0600037763615493, 0.56388130965752215], [0.8144263422850333, -3.9829827764512329]], [[0.32623128638073062, 2.7300470107894235], [1.1222062602809633, -4.2672726278791071]], [[-4.7220859231675529, 4.7273220596197199], [2.7956687654768579, 1.5839867175852351]]])  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(-2.97897452242)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-7.4668828002812822, -0.96438756117772506], [-7.7293127440677249, -5.6261278669668116]], [[0.9763025257285225, -2.5431587216765879], [-2.0124610154976885, 1.5792035681209811]], [[1.8775912333920139, -4.7433428612118833], [-3.1605951242229722, -3.6468274071853379]], [[-1.9189707460567966, -2.4150932127608238], [-2.1645481801333126, -6.9619572988695788]], [[-2.6527432360376153, -0.24892751162892246], [-1.8567682621373827, -7.246247150297453]], [[-7.7010604455858989, 1.7483475372013739], [-0.18330575694148799, -1.3949878048331108]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_Symbol_rank3(self):  
       arg0=numpy.array(-4.92133080405)  
       arg1=Symbol(shape=(6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[0.95903449289262532, 3.7437049510086489], [-2.3956024251720267, -0.035245394753246728]], [[-4.2437958706161911, -0.58265590616375817], [1.2351849723133723, -4.1373689721945093]], [[-1.4305416766926315, -2.1373379401123351], [3.6312390173511844, -3.5168703780930608]], [[0.36020416982131209, 1.6021724103095645], [-1.8836798787082696, 0.64275987238325527]], [[-2.0056220539118517, 4.6743286344238015], [3.8406955144030235, -2.9955028153914052]], [[2.4707264574997145, -3.0682952726235344], [2.7023797918905599, -1.1769499691065031]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-3.9622963111600216, -1.177625853043998], [-7.3169332292246736, -4.9565761988058936]], [[-9.1651266746688371, -5.5039867102164051], [-3.6861458317392746, -9.0586997762471562]], [[-6.3518724807452784, -7.058668744164982], [-1.2900917867014625, -8.4382011821457077]], [[-4.5611266342313348, -3.3191583937430824], [-6.8050106827609165, -4.2785709316693916]], [[-6.9269528579644986, -0.24700216962884536], [-1.0806352896496234, -7.9168336194440521]], [[-2.4506043465529324, -7.9896260766761813], [-2.218951012162087, -6.09828077315915]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_Symbol_rank0(self):  
       arg0=numpy.array([[[[-2.1684001485832169, -3.5186002014949889, 3.7752339603636997, -1.1270000583921269], [0.11421089471583379, 0.35901104666661965, -0.099075796925709447, -4.5647327211967106], [2.8474512667203129, 2.438315809600371, -2.6880207289695246, -3.1120819526497057]], [[-3.3885278098539007, -1.1376867855499539, -0.070416457621735873, 1.7716814376742338], [-0.53493321780572245, -1.0586964778293972, -0.4763495204744741, -1.959825133838252], [4.7071177058951079, -4.83300370279352, -2.1345435881475918, -2.1988009350515836]]], [[[1.8572655293025875, -2.3219143378976281, -1.9191965844471905, -1.9386724086241669], [-3.7568311676263679, -1.3408781247958568, -2.0274612677761947, 4.5258322341407329], [-3.3710673019386537, 1.0499532961858327, 1.3365257382423321, 1.6025964786299518]], [[0.85865194535353062, 1.2931837175747587, 3.8713433776769186, -4.5057060301320053], [0.50803390563299544, -4.139611667223317, -1.0606135982252249, 1.6381680046585707], [1.5521090287337636, 0.7432625105586288, 2.5728730262335953, 2.395569688988564]]], [[[4.7254064937235576, 2.0448090508646066, -3.2047560663308894, 2.6551638357714165], [-2.9015569883827363, 0.52367359249619838, 4.9722855094471541, 2.9648418410244872], [-4.5387514761914183, 0.50851788554586896, 4.1782047899123178, 2.7584286680815246]], [[2.3215147708723771, -2.4873449202922715, 3.010610962740607, 4.979346540239165], [4.5346771103702608, 2.6772492959587444, -0.7030932772280627, 2.7813716597928986], [3.2804161471466848, -1.2844651891456782, 0.92421359345383358, 2.860413736050508]]]])  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(0.62299305591)  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-1.5454070926729786, -2.8956071455847505, 4.3982270162739381, -0.50400700248188857], [0.73720395062607214, 0.982004102576858, 0.5239172589845289, -3.9417396652864722], [3.4704443226305512, 3.0613088655106093, -2.0650276730592863, -2.4890888967394673]], [[-2.7655347539436623, -0.5146937296397156, 0.55257659828850247, 2.3946744935844722], [0.088059838104515897, -0.4357034219191589, 0.14664353543576425, -1.3368320779280136], [5.3301107618053463, -4.2100106468832816, -1.5115505322373535, -1.5758078791413452]]], [[[2.4802585852128258, -1.6989212819873898, -1.2962035285369522, -1.3156793527139286], [-3.1338381117161296, -0.71788506888561843, -1.4044682118659564, 5.1488252900509712], [-2.7480742460284153, 1.672946352096071, 1.9595187941525705, 2.2255895345401902]], [[1.481645001263769, 1.916176773484997, 4.494336433587157, -3.882712974221767], [1.1310269615432338, -3.5166186113130786, -0.43762054231498659, 2.2611610605688091], [2.1751020846440019, 1.3662555664688671, 3.1958660821438336, 3.0185627448988024]]], [[[5.3483995496337959, 2.667802106774845, -2.581763010420651, 3.2781568916816548], [-2.278563932472498, 1.1466666484064367, 5.5952785653573924, 3.5878348969347256], [-3.9157584202811799, 1.1315109414561073, 4.8011978458225562, 3.381421723991763]], [[2.9445078267826155, -1.8643518643820332, 3.6336040186508454, 5.6023395961494034], [5.1576701662804991, 3.3002423518689827, -0.080100221317824349, 3.4043647157031369], [3.9034092030569232, -0.66147213323543985, 1.5472066493640719, 3.4834067919607463]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank0_Symbol_rank4(self):  
       arg0=numpy.array(2.99234094925)  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[4.7241807029377529, 4.9180200729360006, 2.6145909450537888, -3.1942253790494979], [3.873123713204107, -2.3553971137256093, -2.5554753910992742, 3.2468355714617783], [4.5555976185678535, -2.6958254969593143, 4.6437170879391321, -1.0669870222183953]], [[1.2792554964762086, 0.018734621530476225, 0.45476410237351672, -4.2975062664061667], [0.1947752051679803, -0.91550441874675226, -0.034448691704223044, -0.62324546070114728], [-0.38171044408996124, -2.2411458426085282, 4.8644596571028629, -0.46297198956930163]]], [[[2.8534023877959678, -0.79646773185160136, 3.7750307462560677, 0.056210430436495429], [-1.4633680392656121, 1.7735620399325782, 3.1076940590056772, 1.7422077934761688], [-4.5816290172464846, -3.7820081082963055, -2.3340070811956739, 2.3196325840198053]], [[-2.2129543447787459, -4.6993783438507091, 0.29355064915731166, 3.2331716075706751], [-4.6920367622909867, 1.8238549877119858, -0.80551106479887391, -4.2373146494303651], [0.86632027501163389, -0.33401471830356222, -2.7197267521797661, 0.66953529839336579]]], [[[-3.8325786863333966, -3.3984990729420019, 2.2585518107109781, 2.5022674619634833], [2.4362828414707636, -1.3726204486977531, -2.3842334334219064, -4.7592595486772122], [-3.8931122097727879, 4.2845363357314081, 4.9453770204798086, -2.9382194451126442]], [[3.7856864952926674, -4.5965940569678203, 4.8946037799392847, -4.0725015082434499], [-4.4252578403612262, -1.674387972658943, 3.9488127435751785, -2.90880010605182], [2.5131353596509234, -3.9108057679057695, 0.33156050778387147, 0.98916442129308368]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[7.7165216521833004, 7.9103610221815481, 5.6069318942993362, -0.20188442980395038], [6.8654646624496545, 0.63694383551993816, 0.43686555814627326, 6.2391765207073258], [7.547938567813401, 0.29651545228623322, 7.6360580371846796, 1.9253539270271522]], [[4.2715964457217561, 3.0110755707760237, 3.4471050516190642, -1.3051653171606192], [3.1871161544135278, 2.0768365304987952, 2.9578922575413245, 2.3690954885444002], [2.6106305051555863, 0.75119510663701927, 7.8568006063484104, 2.5293689596762459]]], [[[5.8457433370415153, 2.1958732173939461, 6.7673716955016152, 3.0485513796820429], [1.5289729099799354, 4.7659029891781257, 6.1000350082512247, 4.7345487427217163], [-1.5892880680009371, -0.78966715905075802, 0.65833386804987359, 5.3119735332653528]], [[0.77938660446680164, -1.7070373946051616, 3.2858915984028592, 6.2255125568162226], [-1.6996958130454392, 4.8161959369575333, 2.1868298844466736, -1.2449737001848176], [3.8586612242571814, 2.6583262309419853, 0.27261419706578138, 3.6618762476389133]]], [[[-0.8402377370878491, -0.40615812369645443, 5.2508927599565256, 5.4946084112090308], [5.4286237907163111, 1.6197205005477944, 0.60810751582364109, -1.7669185994316647], [-0.90077126052724044, 7.2768772849769556, 7.9377179697253561, 0.054121504132903286]], [[6.7780274445382149, -1.6042531077222728, 7.8869447291848322, -1.0801605589979024], [-1.4329168911156787, 1.3179529765866045, 6.941153692820726, 0.083540843193727454], [5.5054763088964709, -0.918464818660222, 3.323901457029419, 3.9815053705386312]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_Symbol_rank1(self):  
       arg0=numpy.array([2.0080424168683706, -1.4106062224871319])  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([4.089682963577344, -2.1353135579226556])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([6.0977253804457145, -3.5459197804097875])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_Symbol_rank1(self):  
       arg0=numpy.array([[-4.4343561247068672, 4.5962156611491469], [-1.2310006237532067, 0.031728215970050044]])  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([-1.6633775870468437, 2.9510116445604648])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[-6.0977337117537109, 2.9328380741023032], [1.7200110208072581, 2.9827398605305149]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_Symbol_rank2(self):  
       arg0=numpy.array([-1.7162225282162846, 0.026009389173900388])  
       arg1=Symbol(shape=(2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[-0.49946042170325455, -4.1771545948935005], [1.001086947155633, -1.7197357066668664]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[-2.2156829499195392, -5.8933771231097847], [1.0270963363295333, -1.693726317492966]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_Symbol_rank1(self):  
       arg0=numpy.array([[[-4.3559963026363571, 3.8081860473505262, -3.8407484791905357, 3.1619946963765386, 1.9525874502600518], [-3.7839573226004952, 3.825522902107064, -4.9544993149776229, -1.6273721541056139, -1.8566113866753584], [-4.0943308765072484, -3.1363936106352353, 2.9725263187462216, -3.2444639785579299, -1.0313428834711336], [-2.9826576633065316, 1.3591537008880312, -1.9035915510608925, -2.0003738856910038, 4.1850553918003257]], [[-1.2537424272943207, 4.2817501115606404, -0.52878779708227963, -1.562385820909904, 0.57463065284796677], [-1.2014917384555335, 0.30181126561790617, 1.7840973469398067, -4.3255227493518564, 3.1331683347411907], [-3.8599282191458983, 2.6565668235767479, -0.51462292601794157, 1.6963812889953269, -0.089028436324198879], [2.7902103277412849, -2.3244467831724815, -0.73715284287300342, -3.7594695822423665, -2.4831142698697519]]])  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([-2.6502074887692748, -0.52879673008931594])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-7.0062037914056319, 1.1579785585812514, -6.4909559679598106, 0.51178720760726382, -0.69762003850922305], [-6.4341648113697705, 1.1753154133377892, -7.6047068037468977, -4.2775796428748887, -4.5068188754446332], [-6.7445383652765232, -5.7866010994045105, 0.32231882997694683, -5.8946714673272051, -3.6815503722404084], [-5.6328651520758068, -1.2910537878812436, -4.5537990398301673, -4.6505813744602786, 1.5348479030310509]], [[-1.7825391573836367, 3.7529533814713245, -1.0575845271715956, -2.0911825509992199, 0.045833922758650836], [-1.7302884685448494, -0.22698546447140977, 1.2553006168504908, -4.8543194794411724, 2.6043716046518748], [-4.3887249492352147, 2.127770093487432, -1.0434196561072575, 1.167584558906011, -0.61782516641351481], [2.2614135976519689, -2.8532435132617975, -1.2659495729623194, -4.2882663123316824, -3.0119109999590679]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_Symbol_rank3(self):  
       arg0=numpy.array([3.817542641683362, 1.911113282165199])  
       arg1=Symbol(shape=(2, 4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[-0.63686024364535321, -3.26122224433959, 3.7479556940852259, -3.4215245141585071, -1.3436423241472206], [-4.3162668777656163, -2.8061909664722684, -3.3409660678881323, 4.963072489449079, -4.8176286476361359], [0.7789757441616354, 1.4084962712036262, 3.0023376159093615, 2.4265732350665754, -1.2844664003911133], [0.22336827192255804, -3.7826321622486816, 1.0066887951387207, -3.6264867717868086, -0.18349025180016021]], [[3.9609122483685937, 0.24763515902160727, -3.9945237538493714, 4.7083848328520528, -2.1772419444383018], [-1.148300749257066, 1.9278068860079127, 4.436663969577733, 1.7903291128122367, 2.3978636425539124], [-1.4820392655749548, -1.2226741849594314, -2.134349647188809, 1.9708775918216404, 2.2691609750125714], [-2.3307845661593953, -3.7536087817289654, 3.5273386119244439, 2.9006811242446426, -4.7277224734326868]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[3.1806823980380088, 0.55632039734377203, 7.5654983357685879, 0.39601812752485488, 2.4739003175361414], [-0.49872423608225436, 1.0113516752110936, 0.47657657379522966, 8.780615131132441, -1.0000860059527739], [4.5965183858449974, 5.2260389128869882, 6.8198802575927235, 6.2441158767499374, 2.5330762412922487], [4.04091091360592, 0.034910479434680397, 4.8242314368220827, 0.19105586989655343, 3.6340523898832018]], [[5.8720255305337927, 2.1587484411868063, -2.0834104716841724, 6.6194981150172518, -0.26612866227310272], [0.762812532908133, 3.8389201681731118, 6.3477772517429321, 3.7014423949774358, 4.3089769247191114], [0.42907401659024424, 0.68843909720576768, -0.22323636502361, 3.8819908739868394, 4.1802742571777705], [-0.41967128399419629, -1.8424954995637663, 5.4384518940896429, 4.8117944064098417, -2.8166091912674878]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_Symbol_rank1(self):  
       arg0=numpy.array([[[[-1.09745670005718, 3.9834117147310195], [4.1443000180165335, -4.8604174344880304]], [[4.6492768420284527, 2.1750561243036071], [-1.8022015377541889, 2.9354401288132959]], [[-4.30216656736647, 2.8029944908340365], [2.0241372398953121, 1.8602110122459292]], [[3.5296871922141086, -2.0648821962424946], [-3.986952234613117, -1.57294401233119]], [[4.385908084812284, -4.4633401541743822], [-0.5272732505634341, -2.2006203397311808]], [[1.6203392720654142, -3.6292714112378932], [0.050019676467166541, 3.8034183605744314]]], [[[3.9571875122422622, -4.693539557472298], [0.30894917827554025, -4.6939266623172839]], [[4.6507611949368961, 3.320441500221067], [-2.041539846932694, -1.3198761481919985]], [[0.14021374776337403, 1.7977419326196289], [-0.52943153391919484, -3.6515006971998956]], [[-3.4511764469532724, 3.8889961284293371], [1.2964786565805921, 2.1334807614403068]], [[-3.2306512521618935, -4.0287721255399873], [-3.8122669063237247, -1.9447612492595558]], [[-0.31082510487309989, 2.3874680860143425], [2.5194292845479493, 1.9034861587369587]]]])  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([-2.6638757865440388, -1.4429119028360149])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-3.7613324866012188, 1.3195359281869807], [1.4804242314724947, -7.5242932210320692]], [[1.9854010554844139, -0.48881966224043172], [-4.4660773242982277, 0.27156434226925708]], [[-6.9660423539105087, 0.13911870428999773], [-0.63973854664872665, -0.80366477429810956]], [[0.86581140567006987, -4.7287579827865329], [-6.6508280211571558, -4.2368197988752287]], [[1.7220322982682452, -7.127215940718421], [-3.1911490371074729, -4.8644961262752195]], [[-1.0435365144786246, -6.2931471977819324], [-2.6138561100768722, 1.1395425740303926]]], [[[2.5142756094062473, -6.1364514603083133], [-1.1339627245604746, -6.1368385651532993]], [[3.2078492921008812, 1.8775295973850521], [-3.4844517497687089, -2.7627880510280134]], [[-1.3026981550726409, 0.354830029783614], [-1.9723434367552097, -5.0944126000359109]], [[-4.8940883497892873, 2.4460842255933222], [-0.14643324625542276, 0.69056885860429196]], [[-4.6735631549979084, -5.4716840283760018], [-5.2551788091597391, -3.3876731520955707]], [[-1.7537370077091148, 0.94455618317832757], [1.0765173817119345, 0.46057425590094381]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank1_Symbol_rank4(self):  
       arg0=numpy.array([-0.044722267412026895, -1.0335435228033574])  
       arg1=Symbol(shape=(2, 6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[-1.7555223380078266, -2.44519334052523], [-4.5901200554331547, 2.4171810783794401]], [[-4.4265330311127862, -2.8103620673041565], [-0.70779922005504936, -2.4322677764964884]], [[1.6763243190333696, 4.7424824830844283], [-2.6901125927434713, -2.6398596945775408]], [[0.9365209626671902, 2.9379536228292968], [1.8053785672090701, -2.5970870272729183]], [[1.1503189172483896, 2.6213922036281403], [3.6638777286840156, -0.7771805378040364]], [[3.4571163736014299, 1.8518223526235822], [-4.2736236223077597, 2.9656624601513926]]], [[[4.3173914356417704, 1.7915441476084881], [2.5873211259775299, 1.9248386777444964]], [[-4.119796722464482, 0.56092200516920698], [-3.1755012130685669, -0.19176681060780609]], [[1.3569242777756898, -4.0227706619260504], [4.7959197113731413, 3.894779991093861]], [[-4.3985019264167748, -3.9992116839349858], [2.1030582380144827, -3.8504780098478308]], [[3.7598510186102789, 2.8985505497038204], [1.5006745710375649, -2.5919490666121927]], [[2.9066605554678002, 4.9383256552799839], [-4.7708963359124636, 2.4586903307174026]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-1.8002446054198535, -2.4899156079372569], [-4.6348423228451816, 2.3724588109674132]], [[-4.4712552985248131, -2.8550843347161834], [-0.75252148746707626, -2.4769900439085153]], [[1.6316020516213428, 4.6977602156724014], [-2.7348348601554981, -2.6845819619895677]], [[0.89179869525516331, 2.8932313554172699], [1.7606562997970432, -2.6418092946849452]], [[1.1055966498363627, 2.5766699362161134], [3.6191554612719887, -0.82190280521606329]], [[3.412394106189403, 1.8071000852115553], [-4.3183458897197866, 2.9209401927393657]]], [[[3.283847912838413, 0.75800062480513075], [1.5537776031741726, 0.89129515494113898]], [[-5.1533402452678398, -0.47262151763415039], [-4.2090447358719238, -1.2253103334111635]], [[0.32338075497233243, -5.0563141847294073], [3.762376188569784, 2.8612364682905036]], [[-5.4320454492201318, -5.0327552067383436], [1.0695147152111253, -4.8840215326511878]], [[2.7263074958069216, 1.865007026900463], [0.46713104823420748, -3.6254925894155501]], [[1.8731170326644428, 3.9047821324766265], [-5.8044398587158206, 1.4251468079140452]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_Symbol_rank2(self):  
       arg0=numpy.array([[-0.31985862971808299, -2.5172788364499752, 1.926043209600552, -4.847054241563626, -1.1717896466650233], [-0.27796288179505968, -4.45993341614935, 4.4308166935086764, 1.8376899610271833, 1.492936684771772], [1.1725918536342741, 4.2484876818243471, -0.97066113975151502, 1.0269465902713417, 1.0819277838065124], [-0.21908447997299163, -2.2450493876372688, -1.8274726373628889, -0.97505317456929141, -4.7138258626452352]])  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[-4.9573065837560044, -2.2808240260679069, 1.1246651074825644, -3.9984166305547673, 4.4523879636406125], [-0.82852445648615181, 4.6122987820315871, 3.4204079837831909, -3.5633251518392717, 1.7287298515093106], [2.1336347333652199, -2.6581327886543136, 0.40841868887932531, -2.8270675888004861, 2.9986876695966993], [3.9380587086198364, -0.11715087896316234, 3.5512501773517151, -1.8378887081314965, 0.12035861402014092]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[-5.2771652134740874, -4.7981028625178821, 3.0507083170831164, -8.8454708721183941, 3.2805983169755892], [-1.1064873382812115, 0.15236536588223704, 7.8512246772918672, -1.7256351908120884, 3.2216665362810826], [3.306226586999494, 1.5903548931700335, -0.56224245087218971, -1.8001209985291444, 4.0806154534032117], [3.7189742286468448, -2.3622002666004311, 1.7237775399888262, -2.8129418827007879, -4.5934672486250943]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_Symbol_rank2(self):  
       arg0=numpy.array([[[-3.6858032899362678, -4.38042748485607], [-4.5496687662719379, -4.4964499699784248], [-3.1661589077711003, -1.8470998840291895], [-1.5244632808193548, -2.1399123363059882], [2.8678750517401284, 1.0778783835750305]], [[2.2274986506065888, 0.86931192429742943], [-0.61075098316238563, -3.9384316358210714], [-4.563252068852802, 2.1088086745097492], [0.025569794566790982, 3.0725003875086614], [-2.6897908129824799, -1.7546170998447708]], [[-2.1847693135279647, 1.2174306635654011], [1.3658821645408814, -4.7679498592562304], [1.2183681114507845, -2.1303478822117325], [-4.2222573901055638, -2.1305107685365043], [-0.15783835104424959, -1.7753455453566467]], [[3.6717938468166444, -3.0404615340724837], [4.7423026590228918, -1.8368456869335015], [-1.4726384878634535, -3.061073304476122], [1.5737551522369362, -3.9465637867592376], [0.34455509621447078, 2.5863579098270337]]])  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[1.8074707770492129, -2.4330977933232081, -0.25724785751558521, 1.427191036735838, -3.7026135104527622], [0.35933341169108868, 1.702025325209128, -1.538768948244976, -3.9685691780154233, -4.8091908503490153], [2.5054062033363085, -2.6549119059314217, 0.55369728707701071, -4.2069607764493693, 3.8415935003321113], [-1.7335719512675265, 3.9446525663001335, -3.0047765841633822, 3.8750507333445903, -1.5631300052886465]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-1.8783325128870549, -2.5729567078068571], [-6.982766559595146, -6.9295477633016329], [-3.4234067652866855, -2.1043477415447747], [-0.097272244083516757, -0.71272129957015018], [-0.83473845871263386, -2.6247351268777317]], [[2.5868320622976775, 1.2286453359885181], [1.0912743420467423, -2.2364063106119434], [-6.102021017097778, 0.57003972626477317], [-3.9429993834486323, -0.89606879050676191], [-7.4989816633314952, -6.5638079501937856]], [[0.32063688980834382, 3.7228368669017096], [-1.2890297413905403, -7.4228617651876521], [1.7720653985277952, -1.5766505951347218], [-8.4292181665549322, -6.3374715449858741], [3.6837551492878617, 2.0662479549754647]], [[1.9382218955491179, -4.7740334853400102], [8.6869552253230253, 2.107806879366632], [-4.4774150720268358, -6.0658498886395043], [5.4488058855815265, -0.07151305341464731], [-1.2185749090741758, 1.0232279045383872]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_Symbol_rank3(self):  
       arg0=numpy.array([[3.9490345746071078, 2.2220426895000198, -2.9437075204058685, -2.2299735900628015, 0.2858517471200841], [-3.2067229874149081, 4.2248943259964538, -4.8661414123179618, -3.8580179291540793, 2.0170787502542709], [-3.7315902821587557, -4.554119947226102, -3.7568872303601064, 4.9800473333782431, -4.307723470282161], [0.66733114047748998, -3.4226640328893101, -3.276301992084, 3.4580449661585018, 0.65377278756153956]])  
       arg1=Symbol(shape=(4, 5, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[-1.1010353109004924, 1.5169556318511903], [0.27802317267268428, -2.5589103605112817], [-0.37385966400569792, 3.2990867630840626], [1.4445633789566648, 2.3167713097837126], [-3.5029979954844412, 0.71952112813549274]], [[-2.2309693623804883, 2.939575410400729], [3.6623136656147555, 1.732127588800938], [-3.936408577196481, -0.55395904452014832], [0.30779115863933626, -4.219561483338234], [2.4538491277962979, 1.0351078394336932]], [[2.0256373386894833, 3.2391260640202582], [4.06047348846867, 0.9212212968052409], [4.4832875861368819, -1.2725675276666082], [-1.6544366707313749, 4.2885327196727268], [0.023249948461071313, -1.3456769406526936]], [[-4.1003813190089309, -2.5009883576586525], [1.8078896635147359, 3.7663662362097323], [-3.4704170539363179, 4.5604603308038563], [-3.7021204407049115, 4.1821095584048926], [-0.71130360801243242, 4.8577009181442286]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[2.8479992637066154, 5.4659902064582981], [2.5000658621727041, -0.33686767101126192], [-3.3175671844115664, 0.3553792426781941], [-0.78541021110613674, 0.086797719720911104], [-3.2171462483643571, 1.0053728752555768]], [[-5.4376923497953964, -0.26714757701417913], [7.8872079916112092, 5.9570219147973917], [-8.8025499895144428, -5.4201004568381101], [-3.550226770514743, -8.0775794124923124], [4.4709278780505688, 3.0521865896879641]], [[-1.7059529434692724, -0.4924642181384975], [-0.49364645875743207, -3.6328986504208611], [0.72640035577677553, -5.0294547580267146], [3.3256106626468682, 9.2685800530509699], [-4.2844735218210896, -5.6534004109348546]], [[-3.4330501785314409, -1.8336572171811625], [-1.6147743693745742, 0.34370220332042223], [-6.7467190460203179, 1.2841583387198563], [-0.24407547454640977, 7.6401545245633944], [-0.057530820450892861, 5.5114737057057681]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_Symbol_rank2(self):  
       arg0=numpy.array([[[[2.6479867499676022, -1.4816578310017823, -4.0306640807233372, -3.7836974656858855, -0.50928031777277205], [2.9794645234076462, -3.3043844304270511, 0.31673051372570882, -0.90366403372089366, -4.7575207771551939], [1.3230966790214138, -0.65866316749747256, 3.7021300994646857, -4.6907793935268183, 1.2512611326226288], [-1.3296021716937458, -3.9113899981052991, 2.5352751608020743, -1.3112173382213586, 3.5213016170928828]], [[1.1147456734416297, -0.6234753340979502, -3.1939621611618083, 1.2868122453690054, -4.2065604363676758], [-1.6499814924582412, 1.8971500244958017, -4.5027647221416176, 3.9499836024298354, 2.0047239131455319], [1.7506369956977643, -2.286431977342235, -3.7780311083076001, -2.1360486815327184, -0.90525427762968391], [-0.97119707672111399, 4.7833908519446524, -4.5966441185486664, 0.9755536972297314, -3.4298122527912223]], [[-1.0450041142278232, 4.3745919026352524, 1.7406736078308835, 0.097756145047643628, -3.4765082026198977], [-1.4318258356049904, 0.56041066842534448, 0.31308125823274047, 4.6550180497350642, 2.2031283952876199], [-3.8787451529376984, -4.8235765254481073, 1.3132644928771793, 1.279569939012875, 1.2531159730429167], [-2.7279525624309517, -0.82243028047200628, -3.6533822311169395, -1.5800155703722583, 1.8178516114903687]], [[2.0587184077365004, -2.3462907391336119, 4.7834441487427455, -1.4009985129170275, -3.7025343140386413], [0.11558588286406657, -4.091381052544552, -3.0019285909674598, 3.4937306140463456, 1.6063423575687459], [3.4020679236557996, -2.65964181062605, -1.6411873168148619, -4.1790776329309329, -2.1672207595895285], [-1.9114021621709618, -3.1153642660729464, 2.6093750782413414, 2.5102495122645951, -0.48208700158833739]], [[2.0602321494229336, -4.7640765433225285, 4.6674390604474087, 2.0817210348047697, -3.3004637168680384], [3.5575141110995609, 4.9922742586223983, -3.5513685855573387, 3.1600949415269319, -0.67153607783400293], [1.0536573498572954, 4.6595133842903476, -1.5277797926109491, -0.7498458724182564, 2.5105760365511367], [-4.6296485317601554, 1.7376681265960983, -2.3060663805326498, -2.9755390620996125, 4.9545537330838414]]], [[[2.2891596818189788, 1.2872764807839427, -0.33218734239240533, -2.1033066077701665, -4.9849494549381781], [0.18388955563056175, 0.49703852146942307, -3.1406575828641659, 0.22182779045513801, 3.7774714643154148], [-3.2634497325371226, -2.8566313999792623, 4.1529130330265822, -4.5156440878048514, -0.37693520058379981], [2.5533292534207233, 1.8794794822461149, -2.7036646749889526, 0.9738827371044847, -3.932048417606997]], [[2.0078141024047031, -1.1727488922237326, 4.6566681404767767, -3.052088068490455, 0.15995393184093931], [-0.62192332240212611, 4.2863424913219852, 0.94870915048444271, -1.225189897343999, -1.9742310524105031], [2.8890883473607234, -2.6445525248288213, 2.9850805117215806, -3.8959357214514756, 0.7221887673987224], [0.36311406260310708, -0.17592300337980937, -4.2260035960536264, 4.959966656662294, -2.3099059019426074]], [[2.330640582743162, -0.32698704321493821, 2.7164547889581723, -2.7423541501709261, 1.4372280426558035], [-4.8616152289716243, -0.49483081165618792, -3.5745299711237988, 4.1648544254574578, 3.4996258181806024], [1.5665611873383405, -2.2103467153638681, -1.447810138026294, -0.33973396661848021, -1.7542525945472045], [3.0115712191123745, 3.723456583693352, -0.25974267514918736, -3.2892007773958634, 1.2713102276524939]], [[-0.39180760476446252, 4.9018772019190866, 0.97727893977539182, 0.49530727804202002, -4.9118627040011074], [-3.1886018955543074, -3.3409973954720873, 1.116167818276514, 0.91076217333345078, 4.5649228237672581], [1.9588441961421683, 2.691013310042897, -1.4387308032543822, 2.8114893382244786, 3.3173529706592984], [-3.0585707945042104, -0.92458055839694353, -2.5245327335625256, 0.14039408676587151, 1.9006552646025288]], [[3.0029694799529842, 2.7701191412427946, 2.3440663469058105, 3.9466946779551133, -2.2173137464238102], [1.0370030889426758, 1.762896943244419, -1.9274179648279812, -1.8942401239230087, 4.9531828468238199], [4.3144090463550739, -2.83773704673838, 2.2986248713253001, -3.4166537946751907, 1.2148555869606508], [-4.1148404445037041, 2.7507420175519179, 3.7407123197011707, 4.342398738591088, -2.2929636263990858]]], [[[-3.1342374444724319, -4.7469243278839848, -3.7861867545742731, 3.7353928149629247, 3.4493485551215546], [3.6214963703263532, -4.0241280708639993, 1.8366153045902127, 1.2645203066410149, -3.1316746474028276], [-2.1407013175366041, -3.1011423736537838, 4.118445978011172, 4.2047452000650196, -4.459190275356538], [0.043529796220017403, -4.1969063795126278, 2.8275779861823427, 3.7496758739422766, 1.9617192000524089]], [[4.023264412804691, -3.6619974123558716, 2.9431591418140526, -4.6475319544259683, -1.3274141049144026], [-0.12016019266044786, -3.8263871617271561, 2.1640812933923677, 2.6873369729920826, 0.011922355928367878], [-3.2317552855481457, -0.029195107095357997, -4.3346028012267794, -4.0393956650561709, -3.4342927713498748], [4.9883641857059775, 3.2084999591964092, -2.3139871136337851, 3.4393684119210253, -2.1879531916915629]], [[-4.568711958124986, 4.3028872147217339, 2.2538492433519943, -4.860403165000033, 1.9600125557680714], [-3.3735463897121001, -0.25749561372915952, -2.3508089935497809, 1.3133019020553371, -2.5973780506534272], [1.0001426272964054, -2.6706207642973645, 0.53027188426479555, 4.6252802805218316, 0.98507114868321111], [4.1026196443967642, -0.90787855716675736, 2.1569132875715811, 4.1005585754680336, 3.1882724677076837]], [[2.1533243764731234, 4.2174995190070703, -1.7369362717184034, 0.26786815569621858, 3.4955599494461804], [-2.2711128624274579, 4.6066389701849264, 4.7185565941968584, -3.6622577755517116, 2.1297575081842126], [3.9503639683422076, -0.60897888046007953, 0.15218960212305088, -3.4549029780418019, -0.57201404309963788], [-2.965105596066798, -3.6378530491625174, 1.7128471239241314, 2.8544949231945473, 1.7647457380772735]], [[-0.62752191042744343, 4.466465542255877, 2.2428499068069572, -4.7091492206818772, 0.71267110459280758], [-2.3935315332026672, -1.2528926331757062, 0.62880095029287819, 0.1769393362744589, -0.62432059530293493], [1.9488715138274815, 4.6324970664773772, 0.46303119048688313, 3.7680801632148704, -3.5756771229404838], [4.7337436158532444, 1.9094823009676478, 4.5537617706654956, 4.4298470057736896, 3.3815688023690758]]], [[[3.1638910628378483, -3.2687620835442557, -1.9045153865274358, 4.2786218097310247, -4.0416302559318718], [2.0528913692192639, -2.9652336440138791, -0.87737333011619612, 0.15658587707361082, -4.9633744524315411], [4.1304404838679503, 1.0327386813097217, 2.9935140701652259, -2.6488310454584942, 1.9410762658980483], [4.9693782865809251, 1.1613470282366523, 2.5161070573582336, -4.8821468333672557, 4.316039169171793]], [[-1.9535350459599221, 3.831806343453124, 1.9565165465614225, -4.92705847504293, -3.6552578099649646], [0.91558002634639113, -4.0634619550255913, -4.4387406706793184, -1.0993863986270549, 3.1594256502080977], [4.7257709172709976, 1.6565145625390363, -2.3019228445195825, 1.0443018425322226, 1.9277093061156183], [1.855289935401597, -1.3154162008790502, 2.9778333721745662, 2.7372858009945409, -2.1015259937015163]], [[-1.672278657037686, 1.2206755940634721, 1.2135945360636473, -4.5361755287839287, -3.071874573266884], [0.98162911583306123, 1.759091154973679, -2.8351118595910219, -3.2735674271577428, -0.040080794580118706], [2.8837483794569705, -3.4948030407054764, -4.4049377297875676, 1.2189734752629739, 0.97137095166622167], [0.8888827356761535, -3.9347984558205473, -2.1610880500243033, -2.3979054636544839, -3.5276947136975698]], [[3.5275007896886255, -2.3306324935847589, -1.6381821202172975, 4.2836864515868012, 4.6693018720347919], [0.7123435682065864, -2.2568146436841396, 3.0649399908212143, 2.6846508325128919, 2.1586289237967051], [2.1890469010823432, 1.2551287432746143, -3.4562530348575136, -2.4493708188277443, 3.7155638131108741], [0.040932338603555607, 1.294106630475361, 4.0805474667970927, 1.8051986372054083, 0.12749009609805739]], [[-1.8640740095582196, -3.42386337459775, -4.6150515152395233, -3.7171245404189577, -0.78059858400802362], [-4.8647988127220483, 1.1041833495657816, -2.9784612443123915, 0.54942494790190111, -4.7766996599782088], [-2.6499498482566777, 1.8213921508404081, -0.024931834441868084, 4.8376312567769624, 2.5310474629937634], [3.7272131536765603, 4.6848421211150075, -4.0476070473354646, 4.9924378710631281, 4.6357517702627931]]]])  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[-2.711614822077979, 3.3183112560695278, 3.2974389274449294, -3.9923820390379658, -0.18647543712015313], [-3.3186667647424404, -1.9634311177074224, -0.94176111811217744, -1.134857489643093, 3.156793200449048], [0.72138317581506506, -3.8934642017901524, -1.7747364389524698, 1.0669211753712959, -1.4621186117125387], [-2.0114304706475741, 2.4029523408093754, -3.3162987122964225, -3.4618294893071155, -0.33604490883683624]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-0.063628072110376799, -4.1932726530797613, -6.7422789028013161, -6.4953122877638645, -3.220895139850751], [0.26784970132966723, -6.0159992525050301, -2.3948843083522702, -3.6152788557988726, -7.4691355992331729], [-1.3885181430565652, -3.3702779895754515, 0.99051527738670675, -7.4023942156047973, -1.4603536894553502], [-4.0412169937717248, -6.6230048201832776, -0.17633966127590472, -4.0228321602993375, 0.80968679501490382]], [[4.4330569295111575, 2.6948359219715776, 0.1243490949077195, 4.6051235014385332, -0.88824918029814803], [1.6683297636112866, 5.2154612805653295, -1.1844534660720898, 7.2682948584993632, 5.3230351692150597], [5.0689482517672921, 1.0318792787272928, -0.45971985223807232, 1.1822625745368094, 2.4130569784398439], [2.3471141793484138, 8.1017021080141802, -1.2783328624791386, 4.2938649532992592, -0.11150099672169445]], [[2.2524348132171061, 7.6720308300801818, 5.0381125352758129, 3.395195072492573, -0.17906927517496829], [1.865613091839939, 3.8578495958702739, 3.6105201856776699, 7.9524569771799936, 5.5005673227325493], [-0.581306225492769, -1.5261375980031779, 4.6107034203221087, 4.5770088664578044, 4.5505549004878461], [0.56948636501397765, 2.4750086469729231, -0.3559433036720101, 1.7174233570726711, 5.1152905389352981]], [[-1.9336636313014655, -6.3386727781715777, 0.79106210970477964, -5.3933805519549933, -7.6949163530766072], [-3.8767961561738993, -8.0837630915825187, -6.9943106300054261, -0.4986514249916203, -2.38603968146922], [-0.59031411538216627, -6.6520238496640154, -5.6335693558528277, -8.1714596719688988, -6.1596027986274944], [-5.9037842012089277, -7.1077463051109122, -1.3830069607966244, -1.4821325267733707, -4.4744690406263032]], [[1.8737567123027805, -4.9505519804426816, 4.4809636233272556, 1.8952455976846165, -3.4869391539881915], [3.3710386739794078, 4.8057988215022451, -3.7378440226774918, 2.9736195044067788, -0.85801151495415606], [0.86718191273714229, 4.4730379471701944, -1.7142552297311022, -0.93632130953840953, 2.3241005994309836], [-4.8161239688803086, 1.5511926894759451, -2.4925418176528029, -3.1620144992197656, 4.7680782959636883]]], [[[-1.0295070829234616, -2.0313902839584976, -3.6508541071348457, -5.4219733725126069, -8.3036162196806185], [-3.1347772091118786, -2.8216282432730173, -6.4593243476066062, -3.0968389742873024, 0.45880469957297443], [-6.5821164972795625, -6.1752981647217027, 0.83424626828414183, -7.8343108525472918, -3.6956019653262402], [-0.76533751132171712, -1.4391872824963254, -6.022331439731393, -2.3447840276379557, -7.2507151823494373]], [[0.044382984697280747, -3.136180009931155, 2.6932370227693543, -5.0155191861978778, -1.8034771858664831], [-2.5853544401095485, 2.3229113736145628, -1.0147219672229797, -3.1886210150514214, -3.9376621701179255], [0.92565722965330099, -4.6079836425362437, 1.0216493940141582, -5.8593668391588984, -1.2412423503087], [-1.6003170551043153, -2.1393541210872318, -6.1894347137610488, 2.9965355389548716, -4.2733370196500298]], [[1.3888794646309846, -1.2687481613271157, 1.7746936708459948, -3.6841152682831035, 0.49546692454362606], [-5.8033763470838018, -1.4365919297683654, -4.5162910892359758, 3.2230933073452803, 2.5578647000684249], [0.62480006922616305, -3.1521078334760455, -2.3895712561384714, -1.2814950847306577, -2.6960137126593819], [2.069810101000197, 2.7816954655811745, -1.2015037932613648, -4.2309618955080408, 0.32954910954031646]], [[-1.5266650944075555, 3.7670197122759936, -0.15757854986770115, -0.63955021160107295, -6.0467201936441999], [-4.3234593851974008, -4.4758548851151803, -0.018689671366578953, -0.22409531630964219, 3.4300653341241651], [0.82398670649907535, 1.556155820399804, -2.5735882928974751, 1.6766318485813856, 2.1824954810162054], [-4.1934282841473038, -2.0594380480400365, -3.6593902232056186, -0.99446340287722146, 0.7657977749594358]], [[6.1597626804020322, 5.9269123416918426, 5.5008595473548585, 7.1034878784041613, 0.9394794540252378], [4.1937962893917238, 4.919690143693467, 1.2293752356210668, 1.2625530765260393, 8.1099760472728679], [7.4712022468041219, 0.31905615371066798, 5.4554180717743481, -0.25986059422614272, 4.3716487874096988], [-0.95804724405465613, 5.9075352180009659, 6.8975055201502187, 7.499191939040136, 0.86382957404996219]]], [[[-2.4128542686573669, -4.0255411520689197, -3.0648035787592081, 4.4567759907779898, 4.1707317309366196], [4.3428795461414182, -3.3027448950489342, 2.5579984804052778, 1.9859034824560799, -2.4102914715877626], [-1.419318141721539, -2.3797591978387187, 4.839829153826237, 4.9261283758800847, -3.7378070995414729], [0.76491297203508246, -3.4755232036975627, 3.5489611619974077, 4.4710590497573417, 2.6831023758674739]], [[0.12980021101453865, -7.555461614146024, -0.95030505997609982, -8.5409961562161207, -5.220878306704555], [-4.0136243944506003, -7.7198513635173089, -1.7293829083977847, -1.2061272287980698, -3.8815418458617845], [-7.1252194873382981, -3.9226593088855104, -8.2280670030169318, -7.9328598668463233, -7.3277569731400272], [1.0948999839158251, -0.68496424259374322, -6.2074513154239375, -0.45409578986912713, -6.0814173934817148]], [[-6.3434483970774558, 2.5281507757692641, 0.47911280439952453, -6.6351396039525028, 0.18527611681560163], [-5.1482828286645699, -2.0322320526816293, -4.1255454325022507, -0.46143453689713265, -4.372114489605897], [-0.77459381165606445, -4.4453572032498343, -1.2444645546876743, 2.8505438415693618, -0.78966529026925869], [2.3278832054442944, -2.6826149961192272, 0.38217684861911128, 2.3258221365155638, 1.4135360287552139]], [[3.2202455518444193, 5.2844206943783663, -0.67001509634710743, 1.3347893310675145, 4.5624811248174764], [-1.204191687056162, 5.6735601455562223, 5.7854777695681543, -2.5953366001804157, 3.1966786835555085], [5.0172851437135035, 0.45794229491121641, 1.2191107774943468, -2.387981802670506, 0.49490713227165806], [-1.8981844206955021, -2.5709318737912215, 2.7797682992954273, 3.9214160985658433, 2.8316669134485695]], [[-2.0896405221399821, 3.0043469305433383, 0.78073129509441852, -6.1712678323944159, -0.74944750711973107], [-3.8556501449152059, -2.7150112448882449, -0.83331766141966046, -1.2851792754380797, -2.0864392070154736], [0.48675290211494282, 3.1703784547648386, -0.99908742122565553, 2.3059615515023317, -5.037795734653022], [3.2716250041407058, 0.44736368925510916, 3.0916431589529569, 2.967728394061151, 1.9194501906565371]]], [[[1.1524605921902742, -5.2801925541918298, -3.9159458571750099, 2.2671913390834506, -6.0530607265794458], [0.041460898571689775, -4.9766641146614532, -2.8888038007637702, -1.8548445935739633, -6.9748049230791151], [2.1190100132203762, -0.97869178933785239, 0.98208359951765178, -4.6602615161060683, -0.070354204749525806], [2.957947815933351, -0.85008344241092182, 0.50467658671065951, -6.8935773040148298, 2.3046086985242189]], [[0.44941729484945325, 6.2347586842624994, 4.3594688873707979, -2.5241061342335547, -1.2523054691555893], [3.3185323671557665, -1.6605096142162159, -2.0357883298699431, 1.3035659421823205, 5.5623779910174731], [7.128723258080373, 4.0594669033484116, 0.10102949628979285, 3.4472541833415979, 4.3306616469249937], [4.2582422762109724, 1.0875361399303252, 5.3807857129839416, 5.1402381418039162, 0.30142634710785909]], [[-4.9885773693341084, -2.0956231182329503, -2.1027041762327752, -7.8524742410803512, -6.3881732855633064], [-2.3346695964633613, -1.5572075573227435, -6.1514105718874443, -6.5898661394541653, -3.3563795068765412], [-0.43255033283945199, -6.8111017530018989, -7.7212364420839901, -2.0973252370334485, -2.3449277606302008], [-2.427415976620269, -7.2510971681169698, -5.4773867623207257, -5.7142041759509059, -6.8439934259939923]], [[0.065671300381509923, -5.792461982891874, -5.1000116095244135, 0.82185696227968563, 1.2074723827276763], [-2.7494859211005291, -5.7186441329912547, -0.39688949848590127, -0.7771786567942236, -1.3032005655104104], [-1.2727825882247723, -2.2067007460325012, -6.9180825241646291, -5.9112003081348599, 0.2537343238037586], [-3.4208971507035599, -2.1677228588317545, 0.61871797748997714, -1.6566308521017072, -3.3343393932090581]], [[-2.2001189183950558, -3.7599082834345863, -4.9510964240763595, -4.0531694492557939, -1.1166434928448599], [-5.2008437215588845, 0.76813844072894533, -3.3145061531492277, 0.21338003906506486, -5.112744568815045], [-2.9859947570935139, 1.4853472420035718, -0.36097674327870433, 4.5015863479401261, 2.1950025541569271], [3.391168244839724, 4.3487972122781713, -4.3836519561723009, 4.6563929622262918, 4.2997068614259568]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank2_Symbol_rank4(self):  
       arg0=numpy.array([[0.82079242815354903, 0.85307925268533591, 1.1179191379445008, -0.39214866876211563, 0.28922584171317745], [-0.65605888640043464, 1.7791565764213555, -3.0139111996958556, 2.7090403361618396, -2.9952687341528872], [2.1350477478225329, -0.11155571043461698, 4.076900748177728, 3.5543789495636773, 2.631930072133585], [4.7672321857072539, -3.1672140063987051, 3.6507571879356941, -2.3348334505901489, 0.52695774081606839]])  
       arg1=Symbol(shape=(4, 5, 4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[-2.9037088070192585, -2.3088443806905481, -3.5491161861909113, 4.0816701673192632, 4.398817876463454], [-3.164020019072292, -3.1144810241912593, 0.65593574008539601, 1.5965737406032376, -1.8879592716549753], [1.6059404170685996, -3.6688430766796443, 3.4833953105184055, 0.87476964739523666, -0.22163192175715185], [-4.3073833059103475, -1.2487875602229703, 0.054974856668705385, 3.9085139611574036, 0.36981385771817976]], [[-0.053055274678345477, -3.626616354750527, 2.9253248059269588, 0.16056875614303578, -1.1867316192976594], [2.9721938065327667, 4.2397571782529528, -4.9357900663893925, 1.6971132812188037, 3.6955067330190641], [-3.109972956771232, -0.23345340440622664, 4.9800892998536543, 0.15967686456883357, -1.1216281246070525], [-1.3981194473051497, 1.2224574297797215, 4.5141124666219294, 1.6678153498554424, -3.6753921454292682]], [[-0.089565418438930067, 3.4266243853480738, 2.0263525204266095, 4.728031938058729, -1.279274955234726], [3.7606098398734584, -2.1367801213192985, -3.8065349552897088, 1.7822327748530595, 1.037204046518645], [-4.3795293032719931, -1.1481281573255684, 1.1361904586249283, -4.2486906825959627, 2.5399327559678317], [4.9759845583958668, -1.3124378397600167, 2.9683754786976717, -4.0422096713779512, 1.1297491808499203]], [[-1.6577690025589122, -0.07603236046870876, 2.0389872686225754, -3.3207551814548451, -1.9391329965482829], [2.8699740106931371, -3.3236956383024463, -1.9402342811177342, -3.4265984491967192, -1.2819494016561475], [1.8424024256513434, -0.029282688893451869, 4.6624519878150181, -1.5197654403276859, 3.284710477187005], [-3.303455972534417, 2.6662957193333758, 3.3027268068953859, -0.54504455586076528, 0.99975179278159931]], [[3.3249030597167195, 3.8158845641187789, 0.18930794155570752, -2.4246262221227566, -2.212744823672784], [1.6425565607464794, 2.9512461581548122, 0.13992588732632072, 0.42858842483123016, -2.3869656532921688], [-1.9286697301019586, 2.0811220740018026, -4.7350032488037961, 1.6705200869835126, 4.0818699891609267], [3.3005787696849733, -2.951545256139394, 1.3590945181111449, 3.6151917035387022, -2.0872061580997636]]], [[[-3.1186018004720859, 4.5641800057609121, 2.3974524636389347, -0.647596953460714, -0.71358928470511263], [0.54344148553681748, -1.6211025652152977, -3.4586029084603096, -3.6682543774772345, -0.64998374674554427], [-0.56802303330734549, -0.86035546517422823, 1.9676730966358402, -1.1575342485623819, -4.2598114073751603], [-1.6946941793807446, -1.4998726503963109, -3.659401216309297, 4.0561421650724334, 3.1608647414606175]], [[-3.9007257754505775, 4.1047436381026756, -1.5303007774211022, 0.28749786795889687, -4.4117739354334891], [4.5425877642303476, 0.021915699244199338, 1.3125181593394046, 1.0510659602544381, 1.8790269757655365], [1.2564547862660946, 0.091107574192382579, 2.3091813609149288, 1.023462259313396, -3.8835372741264895], [2.8202512499171757, -2.3309217026373918, 3.5389047783251666, 2.8089626390426883, -2.5093689230168414]], [[-4.3118984509233389, -4.0530515346338447, 4.7047939562986159, -1.2616841425713932, -2.6038861194142537], [2.0255589752590613, 2.4245393158310993, 1.2990514743281167, -3.1341788952554452, -3.7605553276413737], [-4.1253790336287128, -1.8571238557307046, 3.2509163585939174, -3.9192675271272694, -4.7206645523660029], [4.500111298972449, -0.78910379924150043, -1.7159185555772316, -1.0263674434088008, 3.8057942111572043]], [[-2.086678685258152, 0.21291767134524164, 4.7556288039809669, -1.5278664123998031, 2.3182605780074637], [3.9346673571563411, 2.4537058227736814, 3.3732666021298812, 2.1484727491052444, -3.7448850592719163], [-1.9154872855781022, -4.1313137094069665, 1.7347131881947835, 0.88329510001694267, 2.1138529827384547], [4.5190655352467601, 1.7557703660284671, 2.1603283553306198, 1.4958079377877151, -3.3715820869756552]], [[2.697878203102829, 3.5841187151814484, -3.5054392242318633, -4.5763711324258001, 0.2482788893589527], [3.3336676954579154, -1.1273195539497549, -3.9835107034260497, -2.3926896948407625, -0.91064813823116886], [-2.9073836682420016, 1.1832380496251202, -4.7282740057037129, 1.3767425623369736, -0.50483236549286303], [3.2216492989988925, 1.0899559197226782, -0.97624927229300873, 2.3805532212750391, 0.42166542486668845]]], [[[-2.9420332131441382, 3.2392305712128735, -1.8131334064811977, -1.1482638160703438, -2.6888397130136967], [3.9091358591469927, 4.485058656438607, 3.0609692794082015, 0.11039861988860267, 3.6769425233065149], [4.9876952900805698, 1.9371220938807916, 4.1121362047017467, -1.2567288854467309, 3.3374954955636156], [1.7102419214013311, 0.27653253724370241, -2.227244274991401, 1.2488291897015102, -4.3021725745470079]], [[-0.74842837498864689, -0.24963892526461162, 1.8286320372720857, -1.2349200609482249, -2.0702486224926906], [-1.5246399841950211, 4.8475070015304986, 1.866110284671616, 3.6553384392554999, -4.5916794748403591], [-1.9392531703766469, 4.6045358389385349, -4.6197470786784738, 4.8035213950849087, -3.5626564853884002], [3.4445060444649869, -3.3255506457723696, -3.6889180530000489, 0.67893448478247276, 4.0137667158535475]], [[-2.4326549077595261, 4.8316496544330008, -2.2780331042911106, 0.78507606061427726, 1.6445203602465588], [3.3039462359029805, 3.6130303452000661, -2.927267931615237, 3.2228473650868814, 4.5152765881744124], [-4.6107029745239192, 3.5060072056606337, 3.0715584492079167, 3.5351737285279814, -4.8116810983141711], [-0.98083206464823913, 1.658439568506954, -0.42280618808195314, -4.0274643960355512, 1.8374309464201701]], [[1.1495298831846243, 4.700161236872173, -0.77530081245193472, 3.6317488607431567, -1.5946078125752727], [-1.2915486046719593, 2.2705286827439064, -4.743368456984534, 2.7278695558618837, -3.2047488759577911], [0.72911324895546858, -3.5356349856528455, 2.9598648555728762, -0.21463338618892269, -1.0137073810942976], [-2.7279594369049756, -3.3945921339966967, -2.0691256622875756, 4.0024617963799347, 1.7842247013178181]], [[-0.67143570881842951, -1.7681207131840471, -2.3430425049608807, -1.5246164591806286, -2.2863852994284564], [4.0386959914559348, -4.728127250555195, -1.2253027824356266, -4.0828123011987572, 1.9075626753875641], [3.8503183114376256, 0.57519993926961366, 0.72230456786710384, 0.37377973232660011, -2.8581475031761574], [-3.8692738793734249, -2.4221314204564215, -1.9977497302932323, 1.5421292415778236, -0.92949288164397093]]], [[[1.6232218141252979, 3.3001210268111052, -0.58836272273680024, 0.98862234230750445, 4.1470338352230574], [3.2702496179658382, -1.3842858715465542, -4.7573133376401291, 4.9192048081497504, 4.9203925256629475], [3.4144260925346508, -2.6814788973170991, -1.6558906953344401, 0.41045496837063489, 1.8147533717836337], [3.9116059907732552, 3.0404412234091414, 1.0650759056595271, 4.3802582326235164, -4.8114193491359813]], [[1.3522681846484765, 0.58727452430983185, 4.234367955176868, -3.661149502040332, -0.068303276333004703], [4.5982702281299428, -3.4785600329201269, 3.9967005903913364, 4.6271853141093384, 1.042423377648114], [-4.2066136956992528, -2.2315917898708149, 1.6409146745007144, 4.2420810807315164, -0.066465980785471501], [-0.52889419355630451, -3.5449609421183261, 4.0067008800204373, 0.29439600621725237, 3.1573619067558099]], [[-0.25438498668454024, -3.3020747957503485, 2.9244549084604703, 2.829565294721295, 1.3386809880429915], [-0.35837452255310254, -1.8766408215579169, -0.81503286511798656, 1.6283431847151286, 1.5071779557533995], [-1.4626118845407121, 4.7220823548986388, 0.41182329809094576, 0.56844914973003213, 1.3462143112827283], [3.8065792572343042, -3.5952635518938658, -1.0921786696178315, -2.5305214666245748, -0.62120298719256795]], [[-4.3876718686043699, 4.750044331185947, 4.4461457100678015, -3.2498530692889185, 3.6619960409457946], [3.0957480255961585, -3.7945007983183263, -4.8503160633547004, -3.8869230412190001, -0.98675926849345785], [3.311436321824182, -0.85997488762666663, 0.41483619780284364, 4.6231939088925991, 2.7087958340039133], [1.2749804589676312, 4.378327694474919, 0.85459096940476353, -3.6447073622578974, -2.1986252906274761]], [[-4.3088984240758368, -2.2922251930970718, -3.7964252376442174, 3.7796228074999032, 4.7812301971352387], [0.0043247035007665247, 0.42345128399948351, -4.0855633591394858, -1.7236363005699316, 2.0915520024230911], [-1.2484463320612993, -4.6174824167772517, 4.4344584047185496, 4.429926712427557, -2.1343781460102385], [-3.0425345002318349, 1.4106628338357643, 2.3623386729991127, 3.6478360451833289, 0.55684226350401911]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-2.0829163788657095, -1.4880519525369991, -2.7283237580373623, 4.9024625954728123, 5.219610304617003], [-2.343227590918743, -2.2936885960377102, 1.476728168238945, 2.4173661687567867, -1.0671668435014263], [2.4267328452221486, -2.8480506485260952, 4.3041877386719545, 1.6955620755487857, 0.59916050639639717], [-3.4865908777567984, -0.4279951320694213, 0.87576728482225441, 4.7293063893109526, 1.1906062858717288]], [[0.80002397800699043, -2.7735371020651911, 3.7784040586122947, 1.0136480088283717, -0.33365236661232345], [3.8252730592181026, 5.0928364309382887, -4.0827108137040566, 2.5501925339041396, 4.5485859857044], [-2.2568937040858961, 0.61962584827910927, 5.8331685525389902, 1.0127561172541695, -0.26854887192171661], [-0.54504019461981379, 2.0755366824650574, 5.3671917193072654, 2.5208946025407784, -2.8223128927439323]], [[1.0283537195055708, 4.5445435232925746, 3.1442716583711103, 5.8459510760032298, -0.16135581729022519], [4.8785289778179592, -1.0188609833747977, -2.6886158173452079, 2.9001519127975603, 2.1551231844631458], [-3.2616101653274923, -0.03020901938106757, 2.2541095965694291, -3.1307715446514619, 3.6578518939123326], [6.0939036963403677, -0.19451870181551589, 4.0862946166421725, -2.9242905334334504, 2.2476683187944211]], [[-2.0499176713210279, -0.46818102923082439, 1.6468385998604598, -3.7129038502169607, -2.3312816653103985], [2.4778253419310214, -3.7158443070645619, -2.3323829498798498, -3.8187471179588348, -1.6740980704182631], [1.4502537568892278, -0.4214313576555675, 4.2703033190529025, -1.9119141090898015, 2.8925618084248894], [-3.6956046412965327, 2.2741470505712602, 2.9105781381332703, -0.9371932246228809, 0.60760312401948369]], [[3.614128901429897, 4.1051104058319563, 0.47853378326888496, -2.1354003804095791, -1.9235189819596066], [1.9317824024596568, 3.2404719998679896, 0.42915172903949816, 0.71781426654440761, -2.0977398115789914], [-1.6394438883887812, 2.37034791571498, -4.4457774070906186, 1.9597459286966901, 4.3710958308741041], [3.5898046113981508, -2.6623194144262166, 1.6483203598243223, 3.9044175452518797, -1.7979803163865862]]], [[[-3.7746606868725205, 3.9081211193604775, 1.7413935772385001, -1.3036558398611486, -1.3696481711055473], [-0.11261740086361716, -2.2771614516157324, -4.1146617948607442, -4.3243132638776691, -1.3060426331459789], [-1.2240819197077801, -1.5164143515746629, 1.3116142102354056, -1.8135931349628165, -4.9158702937755949], [-2.3507530657811793, -2.1559315367967455, -4.3154601027097321, 3.4000832786719988, 2.5048058550601828]], [[-2.121569199029222, 5.8839002145240311, 0.24885579900025334, 2.0666544443802524, -2.6326173590121336], [6.3217443406517031, 1.8010722756655548, 3.0916747357607601, 2.8302225366757936, 3.658183552186892], [3.0356113626874501, 1.8702641506137381, 4.0883379373362843, 2.8026188357347515, -2.104380697705134], [4.5994078263385312, -0.55176512621603635, 5.3180613547465221, 4.5881192154640438, -0.73021234659548595]], [[-7.3258096506191945, -7.0669627343297003, 1.6908827566027602, -4.2755953422672484, -5.6177973191101094], [-0.98835222443679438, -0.58937188386475636, -1.7148597253677389, -6.1480900949513009, -6.7744665273372293], [-7.1392902333245685, -4.8710350554265602, 0.23700515889806173, -6.9331787268231251, -7.7345757520618585], [1.4862000992765934, -3.8030149989373561, -4.7298297552730872, -4.0402786431046565, 0.79188301146134865]], [[0.62236165090368756, 2.9219580075070812, 7.4646691401428065, 1.1811739237620364, 5.0273009141693032], [6.6437076933181807, 5.162746158935521, 6.0823069382917208, 4.857513085267084, -1.0358447231100767], [0.79355305058373737, -1.4222733732451269, 4.4437535243566231, 3.5923354361787823, 4.8228933189002943], [7.2281058714085997, 4.4648107021903067, 4.8693686914924594, 4.2048482739495547, -0.66254175081381561]], [[-0.29739053105005819, 0.58884998102856123, -6.5007079583847505, -7.5716398665786873, -2.7469898447939345], [0.33839896130502822, -4.1225882881026426, -6.9787794375789369, -5.3879584289936497, -3.905916872384056], [-5.9026524023948888, -1.8120306845277669, -7.7235427398566001, -1.6185261718159136, -3.5001010996457502], [0.22638056484600533, -1.9053128144302089, -3.9715180064458959, -0.61471551287784809, -2.5736033092861987]]], [[[-0.80698546532160531, 5.3742783190354064, 0.32191434134133523, 0.98678393175218915, -0.5537919651911638], [6.0441836069695256, 6.6201064042611399, 5.1960170272307344, 2.2454463677111356, 5.8119902711290479], [7.1227430379031027, 4.0721698417033245, 6.2471839525242796, 0.87831886237580203, 5.4725432433861485], [3.8452896692238641, 2.4115802850662353, -0.092196527168868059, 3.3838769375240432, -2.1671248267244749]], [[-0.85998408542326388, -0.36119463569922861, 1.7170763268374687, -1.3464757713828419, -2.1818043329273076], [-1.6361956946296381, 4.7359512910958816, 1.754554574236999, 3.543782728820883, -4.7032351852749761], [-2.0508088808112639, 4.4929801285039179, -4.7313027891130908, 4.6919656846502917, -3.6742121958230172], [3.3329503340303699, -3.4371063562069866, -3.8004737634346659, 0.56737877434785577, 3.9022110054189305]], [[1.6442458404182019, 8.9085504026107287, 1.7988676438866174, 4.8619768087920052, 5.7214211084242867], [7.3808469840807085, 7.689931093377794, 1.1496328165624909, 7.2997481132646094, 8.5921773363521403], [-0.53380222634619123, 7.5829079538383617, 7.1484591973856446, 7.6120744767057094, -0.73478035013644316], [3.0960686835294888, 5.7353403166846819, 3.6540945600957748, 0.049436352142176787, 5.9143316945978981]], [[4.7039088327483016, 8.2545401864358503, 2.7790781371117426, 7.186127810306834, 1.9597711369884045], [2.262830344891718, 5.8249076323075837, -1.1889895074208567, 6.282248505425561, 0.34963007360588616], [4.2834921985191459, 0.018743963910831773, 6.5142438051365534, 3.3397455633747546, 2.5406715684693797], [0.82641951265870173, 0.1597868155669806, 1.4852532872761017, 7.556840745943612, 5.3386036508814954]], [[1.9604943633151555, 0.86380935894953792, 0.28888756717270425, 1.1073136129529564, 0.34554477270512862], [6.6706260635895198, -2.09619717842161, 1.4066272896979584, -1.4508822290651722, 4.5394927475211491], [6.4822483835712106, 3.2071300114031986, 3.3542346400006888, 3.0057098044601851, -0.22621743104257241], [-1.2373438072398399, 0.20979865167716349, 0.63418034184035266, 4.1740593137114086, 1.7024371904896141]]], [[[6.3904539998325518, 8.0673532125183591, 4.1788694629704537, 5.7558545280147584, 8.9142660209303113], [8.0374818036730922, 3.3829463141606997, 0.0099188480671248414, 9.6864369938570043, 9.6876247113702014], [8.1816582782419047, 2.0857532883901548, 3.1113414903728138, 5.1776871540778888, 6.5819855574908877], [8.6788381764805091, 7.8076734091163953, 5.8323080913667811, 9.1474904183307704, -0.044187163428727416]], [[-1.8149458217502286, -2.5799394820888732, 1.0671539487781629, -6.8283635084390371, -3.2355172827317098], [1.4310562217312377, -6.645774039318832, 0.82948658399263131, 1.4599713077106333, -2.1247906287505911], [-7.3738277020979579, -5.39880579626952, -1.5262993318979907, 1.0748670743328113, -3.2336799871841766], [-3.6961081999550096, -6.7121749485170312, 0.83948687362173224, -2.8728180001814527, -0.0098520996428952401]], [[3.3963722012511539, 0.34868239218534569, 6.5752120963961644, 6.4803224826569892, 4.9894381759786857], [3.2923826653825916, 1.7741163663777773, 2.8357243228177076, 5.2791003726508228, 5.1579351436890937], [2.188145303394982, 8.372839542834333, 4.0625804860266399, 4.2192063376657263, 4.9969714992184224], [7.4573364451699984, 0.055493636041828331, 2.5585785183178626, 1.1202357213111194, 3.0295542007431262]], [[-6.7225053191945188, 2.4152108805957981, 2.1113122594776526, -5.5846865198790674, 1.3271625903556457], [0.76091457500600956, -6.1293342489084752, -7.1851495139448494, -6.221756491809149, -3.3215927190836068], [0.97660287123403311, -3.1948083382168155, -1.9199972527873053, 2.2883604583024502, 0.37396238341376442], [-1.0598529916225177, 2.0434942438847701, -1.4802424811853854, -5.9795408128480467, -4.5334587412176255]], [[-3.7819406832597684, -1.7652674522810035, -3.269467496828149, 4.3065805483159716, 5.3081879379513071], [0.53128244431683491, 0.95040902481555189, -3.5586056183234174, -1.1966785597538632, 2.6185097432391595], [-0.7214885912452309, -4.0905246759611833, 4.961416145534618, 4.9568844532436254, -1.6074204051941701], [-2.5155767594157665, 1.9376205746518327, 2.8892964138151811, 4.1747937859993973, 1.0838000043200875]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_Symbol_rank3(self):  
       arg0=numpy.array([[[-1.6945198235687542, -4.1357612833645767], [-3.5138317310929876, -0.16871813077230513]], [[4.0629340527707143, -0.40324138048890212], [-1.9518997046458364, -2.8727324435899106]], [[3.3512152282660566, 1.4215055023227379], [1.0162398176903498, -4.9905286408106262]], [[1.0076265659149852, -4.1412844417985104], [0.77318701890134545, -2.3879753208694798]], [[4.4424096483389128, -4.4439783598146567], [-2.5253433913779033, 2.2423090703568018]], [[-1.0119717422174457, 3.2552681736849074], [2.6456755747289549, 4.7666855616578871]]])  
       arg1=Symbol(shape=(6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[-1.7386857182739757, -0.33425607030334703], [-4.680751140315901, -0.15898693179051371]], [[2.1228790307925589, -2.6036610003085983], [-3.8658082341952458, -3.4465757263447028]], [[-2.0042969454005286, -1.0613987190524767], [-0.45035950385249901, 4.1552924189465212]], [[1.1795802775403708, 0.18439165954040693], [-2.6093887411538228, 1.528410162394211]], [[-2.7684706760645215, 0.71412066549437547], [-3.9680145521601027, 3.8007482637958461]], [[2.4265783347943213, 3.9031823817703621], [2.7634552597524813, -0.15743347911005312]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[-3.4332055418427299, -4.4700173536679237], [-8.1945828714088886, -0.32770506256281884]], [[6.1858130835632732, -3.0069023807975004], [-5.8177079388410817, -6.3193081699346134]], [[1.3469182828655279, 0.36010678327026113], [0.56588031383785076, -0.83523622186410496]], [[2.187206843455356, -3.9568927822581035], [-1.8362017222524774, -0.85956515847526882]], [[1.6739389722743914, -3.7298576943202812], [-6.4933579435380064, 6.0430573341526479]], [[1.4146065925768756, 7.1584505554552695], [5.4091308344814362, 4.609252082547834]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_Symbol_rank3(self):  
       arg0=numpy.array([[[[-1.6922426852767636, 0.27817179325641916], [-0.47548270623897615, 4.8616980306900217]], [[-2.1567583478455443, 4.8843906276516496], [-1.5441189667625399, -1.8107112228193447]]], [[[-3.0131465276480283, -3.8127181384248376], [-4.839590639951675, 3.3931852929735733]], [[-0.42603883408317955, -0.36105640821485707], [1.1461448889125325, -1.376120803662185]]], [[[-3.4521462096803202, -1.0755722870459925], [-0.10837662734416664, -3.8810864149234603]], [[-4.81872907759477, -2.5636344854727531], [1.8827275801823191, 4.6849423097360283]]], [[[-3.3315957873080326, 0.41577763401766088], [3.4365920656897071, 2.2193375267821942]], [[0.83988200439367233, -4.3273905126150058], [4.7891226571724967, 1.6142229073606256]]], [[[-1.8354355377968243, -0.46825540174735369], [-0.49673219286400982, 0.45845756356086298]], [[-2.2809786608794589, -4.2006717171094667], [-4.1676784055537475, 2.7859023826581888]]], [[[1.2918161638387353, -2.7400608543446401], [-2.0740280911852671, -2.3036029283981865]], [[-3.1421427544157341, 2.3809342596077077], [-1.4092967264865832, -1.365445157021469]]]])  
       arg1=Symbol(shape=(6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[-2.1861793683300821, -4.29834166737351], [3.1320017523265609, 0.26178341012459327]], [[-2.2566075608682521, 0.08907205337418489], [4.0335923288753897, -0.6898881476728107]], [[2.2048038514100812, 3.8189453877497019], [-1.6573463645629505, 1.5199119515333024]], [[-0.01854837389638142, -0.71044385483278294], [-2.2989217403872129, 4.6494445729742555]], [[4.6253322482383563, 4.3911995145542519], [-3.0874870647023309, 3.1722308166396669]], [[1.2256674995272938, -4.8874144115779439], [-3.9743604030991166, 0.41572308305696826]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-3.8784220536068457, -1.9080075750736629], [-4.7738243736124861, 0.56335636331651173]], [[0.97524340448101654, 8.0163923799782104], [-1.2823355566379466, -1.5489278126947514]]], [[[-5.2697540885162804, -6.0693256992930902], [-4.7505185865774902, 3.4822573463477582]], [[3.6075534947922101, 3.6725359206605326], [0.45625674123972182, -2.0660089513349957]]], [[[-1.247342358270239, 1.1292315643640887], [3.7105687604055353, -0.062141027173758356]], [[-6.47607544215772, -4.2209808500357031], [3.4026395317156215, 6.2048542612693307]]], [[[-3.3501441612044141, 0.39722926012127946], [2.7261482108569242, 1.5088936719494113]], [[-1.4590397359935405, -6.6263122530022187], [9.4385672301467523, 6.2636674803348811]]], [[[2.789896710441532, 4.1570768464910026], [3.8944673216902421, 4.8496570781151149]], [[-5.3684657255817898, -7.2881587818117977], [-0.99544758891408058, 5.9581331992978557]]], [[[2.5174836633660291, -1.5143933548173463], [-6.9614425027632105, -7.1910173399761304]], [[-7.1165031575148507, -1.593426143491409], [-0.99357364342961496, -0.9497220739645007]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank3_Symbol_rank4(self):  
       arg0=numpy.array([[[0.51677071894364079, 2.4226362111601567], [-0.16763901643237666, -4.3282004538193881]], [[2.6522488499010795, 1.3715256221174821], [4.2314809159322948, 4.1101063879770354]], [[-3.3866108602031253, 1.4660556619606071], [3.429740421795028, -2.6140326849307502]], [[-0.38897761965553457, 2.1366360569105955], [0.92949151184878875, -2.6220687656109885]], [[2.0516162803152058, -4.9792837437824389], [-3.6473998818341813, 3.5362941414594182]], [[3.2019618970696655, -2.4491438483789407], [-3.8134201048744898, -4.3909805996485236]]])  
       arg1=Symbol(shape=(6, 2, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[-2.5875293860181103, -3.5241596984462706], [-4.7934160670718367, -4.4390577580962454]], [[-4.9770060779473067, -3.4588076743198615], [-0.30511954951621956, 3.7260052723052066]]], [[[-0.14295413202049634, 3.4602858621434791], [-0.53061547346779125, 2.9440946155084804]], [[2.9313813652175034, 2.46844680090841], [4.2357146609208076, -0.80787183362547133]]], [[[2.9169059246069313, 2.1449955648891761], [-2.9109759733471274, -2.2816820434103602]], [[0.94601592878468477, -2.8954209295514199], [-0.17166524696927166, 0.02807249940303258]]], [[[-0.44318516852556744, -4.4110720354586341], [0.039489074647423017, 1.7125421653357815]], [[0.48877562836193622, -4.646761387559275], [4.5663642263475204, 3.5490727192541751]]], [[[-3.7657676082975478, 2.3011896908526133], [-1.9122450455378415, 3.1272163287667567]], [[3.3487038066933188, -1.895493836473674], [0.36105006064445089, -4.705378179027023]]], [[[-0.64500649309775504, -2.6778930649326158], [-0.008276398585564948, -1.8861377473775933]], [[-3.5749518466617172, 0.39223271531760773], [-1.2898957418988366, -4.0891201150099432]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[-2.0707586670744695, -3.0073889795026298], [-2.3707798559116799, -2.0164215469360887]], [[-5.1446450943796833, -3.6264466907522381], [-4.6333200033356077, -0.6021951815141815]]], [[[2.5092947178805831, 6.1125347120445586], [0.84091014864969083, 4.3156202376259625]], [[7.1628622811497982, 6.6999277168407048], [8.345821048897843, 3.3022345543515641]]], [[[-0.46970493559619397, -1.2416152953139492], [-1.4449203113865203, -0.81562638144975308]], [[4.3757563505797128, 0.53431949224360809], [-2.7856979319000219, -2.5859601855277177]]], [[[-0.83216278818110201, -4.8000496551141687], [2.1761251315580186, 3.8491782222463771]], [[1.418267140210725, -3.7172698757104863], [1.9442954607365319, 0.92700395364318666]]], [[[-1.7141513279823419, 4.3528059711678191], [-6.8915287893202803, -1.8520674150156822]], [[-0.29869607514086249, -5.5428937183078553], [3.8973442021038691, -1.1690840375676048]]], [[[2.5569554039719105, 0.52406883213704969], [-2.4574202469645057, -4.335281595756534]], [[-7.3883719515362074, -3.4211873895568821], [-5.6808763415473607, -8.4801007146584659]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_array_rank4_Symbol_rank4(self):  
       arg0=numpy.array([[[[3.7978523213958031, -3.4249619201712997, 1.2020459486643915, 1.7811263494475345], [3.1766964840442036, -1.7459004162025593, 2.1111694956411799, -2.6744227746348215], [-4.2771956337886223, -1.9443021965122509, 1.360485302796266, -4.5361105899383976]], [[-4.8094687455897969, -4.1129601198434962, -4.6394966631729897, -4.7967687844531293], [-0.94579188581287177, -1.8818963818276382, -1.4187918824384571, 2.099494741131581], [1.1610897568379253, 1.7490975966476308, -1.0222670797741653, 1.1520884157326758]]], [[[2.7164268492215706, 1.4016553297339271, 0.40448275338645878, 4.6805411872010332], [0.8859731342640913, -2.4549188767792272, -0.43584702040953882, -4.9052003093463163], [0.76746097302729055, 2.3087322259524745, 3.2869282983650141, -0.2939187696551846]], [[0.81675985908939541, -1.8972205229999703, -0.46127613159541614, -1.1611986958270517], [0.34433512256442533, 1.2005316816602916, 2.8708375475254977, 2.0862907330411442], [0.13295606474434063, 2.2046495410108129, 1.8937268896133794, -1.9106153474180498]]], [[[-3.0783464786859094, 0.66839057771206267, -0.34895773343027159, 2.778719645408855], [0.57643261903676191, -3.331763362836575, -1.7199606455804695, 4.5772131467584174], [-1.4391845802532277, -4.0749858307349696, -4.9525973379898289, -2.4161900730915531]], [[-3.1444136255323429, -4.0157360821329213, 3.3697425234109843, -0.0063677664014409885], [2.5554276868389438, 3.9466821487790522, -1.8960843078263223, 1.9016672093218823], [4.0700171032773618, -3.489456044163437, 2.5557694015917285, -2.8020054731745461]]]])  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[1.9703820602037192, 2.6252423049511533, -1.1437085892144006, 4.2729923680185937], [3.3684841162275951, -4.738475017717219, 0.43354709918337253, -4.3620376444220463], [1.0686471723804143, -2.9262561608049396, 2.4272486449483281, -4.5866877458730926]], [[1.2161615870743825, -4.6704811886088802, -4.3074024725758893, 3.4350821080584719], [-3.1029407593678049, 0.24906048316215745, 1.1694890199715324, 3.5958541087041258], [-0.17740363510561608, 1.4960617499856195, -3.9501980445025886, -2.0150234959201452]]], [[[4.3253368427265215, 3.4023309000065787, 4.5304543698818751, 3.6351365395428807], [-3.6574501776249893, 3.3480112903997323, 0.82578502331960202, 2.4374293760029175], [-2.6377895163094323, 1.3062778688324528, -2.9601939438373872, 1.7998259339038398]], [[3.1825124847200801, -2.3133041308403648, 0.92499552290408182, -3.3549649462015498], [4.1535306095417859, -2.4786830622540554, -2.0459846960320407, -1.1025651576105622], [-0.55354450182142489, -2.0270024222770111, -0.29973858049284008, -4.8351995850311882]]], [[[2.4758768213009743, 3.6799750892949579, 1.9988684521937516, 0.23875994372543197], [-2.9646681569347733, -2.489583818774598, -2.5745803998661376, 2.7216606906954057], [3.1443439406283566, 4.6133964395037435, -3.9822562804931172, -4.5906663055755859]], [[-3.8980044247627452, -4.6134973913830626, -0.65043170135567596, 2.2156024998670318], [-1.800343281761708, 4.7891230539973648, 3.0633056660331253, -0.78454692271157445], [-2.187202375695354, -4.6298317207546171, -4.8690144834446594, -1.7815525506474525]]]])  
       sub=res.substitute({arg1:s1})  
       ref=numpy.array([[[[5.7682343815995223, -0.79971961522014645, 0.058337359449990966, 6.0541187174661282], [6.5451806002717987, -6.4843754339197783, 2.5447165948245525, -7.0364604190568674], [-3.208548461408208, -4.87055835731719, 3.7877339477445942, -9.1227983358114901]], [[-3.5933071585154144, -8.7834413084523764, -8.946899135748879, -1.3616866763946573], [-4.0487326451806762, -1.6328358986654807, -0.24930286246692468, 5.6953488498357068], [0.98368612173230918, 3.2451593466332502, -4.9724651242767539, -0.86293508018746934]]], [[[7.0417636919480922, 4.8039862297405058, 4.9349371232683339, 8.3156777267439139], [-2.771477043360898, 0.89309241362050518, 0.3899380029100632, -2.4677709333433988], [-1.8703285432821417, 3.6150100947849273, 0.32673435452762689, 1.5059071642486552]], [[3.9992723438094755, -4.2105246538403351, 0.46371939130866568, -4.5161636420286015], [4.4978657321062112, -1.2781513805937639, 0.824852851493457, 0.98372557543058203], [-0.42058843707708427, 0.17764711873380179, 1.5939883091205393, -6.745814932449238]]], [[[-0.60246965738493508, 4.3483656670070205, 1.6499107187634801, 3.0174795891342869], [-2.3882355378980114, -5.8213471816111735, -4.2945410454466071, 7.2988738374538231], [1.7051593603751289, 0.53841060876877389, -8.934853618482947, -7.0068563786671394]], [[-7.0424180502950886, -8.6292334735159848, 2.7193108220553084, 2.2092347334655908], [0.75508440507723584, 8.735805202776417, 1.167221358206803, 1.1171202866103078], [1.8828147275820077, -8.1192877649180542, -2.3132450818529309, -4.5835580238219986]]]])  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_float_rank0(self):  
       arg0=Data(-3.70217402322,self.functionspace)  
       arg1=4.85173293914  
       res=add(arg0,arg1)  
       ref=Data(1.14955891592,self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_float_rank0(self):  
       arg0=Data(numpy.array([-4.0388736537610006, 2.7555235021305302]),self.functionspace)  
       arg1=-3.21775048183  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-7.2566241355904131, -0.46222697969888227]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_float_rank0(self):  
       arg0=Data(numpy.array([[-2.4752701793606899, 4.5192359481879993, -2.8733230595669301, 2.7283526152104347, -2.6447479412860018], [-1.7681337040034393, -0.065356322797431865, -3.8577243690454832, -0.00019227650198416768, -1.1841047338163033], [-0.82696763590178168, 0.86452411508529892, 1.8720913107645369, 1.4620527140783048, 3.6465708647242874], [-3.6762523672191638, 0.21157372538753627, -4.7488677235402683, 3.8984506149186622, -3.8610240182152999]]),self.functionspace)  
       arg1=0.10295843898  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-2.3723117403806002, 4.6221943871680891, -2.7703646205868404, 2.8313110541905244, -2.5417895023059121], [-1.6651752650233496, 0.037602116182657852, -3.7547659300653935, 0.10276616247810555, -1.0811462948362136], [-0.72400919692169197, 0.96748255406538863, 1.9750497497446267, 1.5650111530583946, 3.7495293037043771], [-3.5732939282390741, 0.31453216436762599, -4.6459092845601786, 4.0014090538987519, -3.7580655792352102]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_float_rank0(self):  
       arg0=Data(numpy.array([[[2.475094689883802, -4.9633813705569931], [-0.38872267889866308, 0.37227688472055753]], [[-0.34809066022969581, 3.9364223796852453], [-2.0993492587916638, -4.2473922269876923]], [[1.5023016304558041, 3.6466009966679618], [-2.8414636311256611, 1.4602418844453933]], [[3.6809191713957166, 1.6083987140558325], [1.7204808567369732, -2.5553644209021931]], [[2.7304538595543111, 1.2922511134173931], [4.4298443632043529, 4.4765093085097014]], [[-2.4322683522459321, 2.9940636990239708], [4.527722934682366, 0.40442058727411201]]]),self.functionspace)  
       arg1=4.61159539765  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[7.0866900875309664, -0.35178597290982871], [4.2228727187485013, 4.983872282367722]], [[4.2635047374174686, 8.5480177773324098], [2.5122461388555006, 0.36420317065947216]], [[6.1138970281029685, 8.2581963943151262], [1.7701317665215033, 6.0718372820925577]], [[8.292514569042881, 6.2199941117029969], [6.3320762543841376, 2.0562309767449714]], [[7.3420492572014755, 5.9038465110645575], [9.0414397608515173, 9.0881047061568658]], [[2.1793270454012323, 7.6056590966711353], [9.1393183323295304, 5.0160159849212764]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_float_rank0(self):  
       arg0=Data(numpy.array([[[[-2.9482832182957628, -1.9868756352516472, -1.1164721319484472, 2.6159966367492657], [4.7434350949204358, 1.0014496568673401, -1.5446783825512354, -0.99638244678373233], [-4.448092778100543, -1.2901493876650005, -1.0470382121857491, -2.9005182538626242]], [[-1.4078990771671229, -1.5501781493842817, 2.0054547089554262, 4.2240917931882009], [0.2151771493445489, 0.11665166704638352, -0.63498415430187904, -2.9246570223107748], [-4.2148002452811442, 0.83681666454752968, -2.892992768248559, -0.25085859470182914]]], [[[4.4971882725757055, 2.6511736720426544, -4.2317161807649786, 0.23512845024567852], [2.6851166161233762, 2.9616373589105871, 2.5438790249791392, 1.7584468254528618], [2.5617779945944648, -4.1798433056583937, -3.8436070652387624, 3.1854310585876497]], [[3.3940169333880057, 3.419586933323508, 0.95994091294055028, -0.17134507671567878], [-4.6121758951074385, 1.7695660158414963, -4.571083745386975, 0.39289382783435212], [0.15195852194403781, 0.19362640385205321, 2.5437770274842322, 0.98400304611663536]]], [[[-0.539322435799515, -1.4905198611715686, 0.02259411616233642, -2.8354865930997617], [-0.39352434869564856, -4.3320236184606733, -4.6946410161446464, -4.8612213411740672], [-3.0182367060845117, -3.2954962133961829, -1.5922295937708473, 1.6919089261167342]], [[-2.4022778906047848, 3.9665768659659548, 3.8488350963728237, 1.060115020609067], [3.253607241799461, -1.7067658066002886, 4.5433966999663831, -3.51209948126849], [-1.6089520236451236, -2.268572058140339, -1.4125690516060532, 4.9985413592990966]]]]),self.functionspace)  
       arg1=-2.2171118076  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-5.1653950258989232, -4.2039874428548076, -3.3335839395516076, 0.39888482914610535], [2.5263232873172754, -1.2156621507358203, -3.7617901901543958, -3.2134942543868927], [-6.6652045857037034, -3.5072611952681609, -3.2641500197889095, -5.1176300614657846]], [[-3.6250108847702833, -3.7672899569874421, -0.21165709864773419, 2.0069799855850405], [-2.0019346582586115, -2.1004601405567769, -2.8520959619050394, -5.1417688299139357], [-6.4319120528843046, -1.3802951430556307, -5.1101045758517198, -2.4679704023049895]]], [[[2.2800764649725451, 0.43406186443949402, -6.448827988368139, -1.9819833573574819], [0.46800480852021575, 0.7445255513074267, 0.3267672173759788, -0.45866498215029861], [0.34466618699130436, -6.3969551132615541, -6.0607188728419228, 0.96831925098448934]], [[1.1769051257848453, 1.2024751257203476, -1.2571708946626101, -2.3884568843188392], [-6.8292877027105989, -0.44754579176166409, -6.7881955529901354, -1.8242179797688083], [-2.0651532856591226, -2.0234854037511072, 0.32666521988107178, -1.233108761486525]]], [[[-2.7564342434026754, -3.7076316687747291, -2.194517691440824, -5.0525984007029221], [-2.610636156298809, -6.5491354260638337, -6.9117528237478068, -7.0783331487772276], [-5.2353485136876721, -5.5126080209993429, -3.8093414013740077, -0.52520288148642624]], [[-4.6193896982079448, 1.7494650583627944, 1.6317232887696633, -1.1569967869940934], [1.0364954341963006, -3.923877614203449, 2.3262848923632227, -5.7292112888716504], [-3.826063831248284, -4.4856838657434999, -3.6296808592092136, 2.7814295516959362]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_array_rank0(self):  
       arg0=Data(-4.46049050539,self.functionspace)  
       arg1=numpy.array(-1.81936212081)  
       res=add(arg0,arg1)  
       ref=Data(-6.27985262621,self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_array_rank0(self):  
       arg0=Data(numpy.array([-4.637153952954753, -3.9618032965143857]),self.functionspace)  
       arg1=numpy.array(-2.33021196473)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-6.9673659176813878, -6.292015261241021]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_array_rank1(self):  
       arg0=Data(-2.59159619428,self.functionspace)  
       arg1=numpy.array([2.8650096770997759, 2.0514954881782081])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([0.27341348281691902, -0.54010070610464878]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_array_rank0(self):  
       arg0=Data(numpy.array([[1.8374891147197978, 0.43536058523132048, -4.932465963593291, -4.4379320508561211, 1.512069917737751], [-1.9224739906731756, 0.45895440531416298, 4.4710421016878552, -4.6553064980644852, 3.4376677701124176], [0.75575495970562034, 3.3355395868449165, -0.11018602327624638, -4.9743067170451365, -2.7230639052251657], [-3.9319046350544253, 2.4631178911522369, 3.9284287535826881, 3.3411839749442329, -4.1585508409021692]]),self.functionspace)  
       arg1=numpy.array(1.86479543942)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[3.7022845541444998, 2.3001560246560224, -3.0676705241685891, -2.5731366114314191, 3.376865357162453], [-0.057678551248473653, 2.3237498447388649, 6.3358375411125571, -2.7905110586397832, 5.3024632095371196], [2.6205503991303223, 5.2003350262696184, 1.7546094161484556, -3.1095112776204346, -0.85826846580046379], [-2.0671091956297234, 4.3279133305769388, 5.79322419300739, 5.2059794143689349, -2.2937554014774673]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_array_rank2(self):  
       arg0=Data(1.63679678235,self.functionspace)  
       arg1=numpy.array([[1.3610535726892783, 4.587642130448053, 2.2700655633421309, 3.1341855541243344, 2.7801702328043891], [3.3432469389571082, 4.6204376815897561, -4.5632816965545917, -3.0835028681005774, -3.9061322338299007], [-2.9500154599022332, 4.2265447050362237, -2.563099682111678, -2.981922446799917, -4.9224438048803512], [-3.2595239579673994, -3.9241407085390181, 0.49851058055231334, -2.2316374413019666, 0.9944138130464717]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[2.9978503550352666, 6.2244389127940414, 3.9068623456881193, 4.7709823364703228, 4.4169670151503775], [4.9800437213030966, 6.2572344639357445, -2.9264849142086033, -1.446706085754589, -2.2693354514839124], [-1.3132186775562449, 5.8633414873822121, -0.92630289976568969, -1.3451256644539287, -3.2856470225343628], [-1.622727175621411, -2.2873439261930297, 2.1353073628983017, -0.59484065895597826, 2.63121059539246]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_array_rank0(self):  
       arg0=Data(numpy.array([[[1.7074873779289179, 2.426239847464231], [2.7131075331218142, 1.1192802007943961]], [[1.0508089962542355, 1.1748431729833442], [-2.1131509298509665, -2.1454947037749896]], [[3.3776048600947313, -1.9286638349952612], [-3.8320488708874656, 0.91686933932797032]], [[-0.16706671295512177, 1.6332854381796906], [2.5720801685635033, 1.0048958554999929]], [[-3.2933885575175292, -1.1503121687032438], [-1.0385182605836283, 4.0649714319356622]], [[-1.3305060118701997, -1.996607407732677], [3.4917931092630035, -1.0934314625871022]]]),self.functionspace)  
       arg1=numpy.array(0.533087339573)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[2.2405747175016844, 2.9593271870369975], [3.2461948726945806, 1.6523675403671625]], [[1.583896335827002, 1.7079305125561106], [-1.5800635902782001, -1.6124073642022232]], [[3.9106921996674977, -1.3955764954224947], [-3.2989615313146992, 1.4499566789007368]], [[0.36602062661764467, 2.1663727777524571], [3.1051675081362697, 1.5379831950727594]], [[-2.7603012179447628, -0.61722482913047738], [-0.50543092101086184, 4.5980587715084287]], [[-0.79741867229743324, -1.4635200681599105], [4.0248804488357699, -0.56034412301433578]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_array_rank3(self):  
       arg0=Data(0.323639419139,self.functionspace)  
       arg1=numpy.array([[[4.6352846825536673, -0.92045031029851199], [-4.5852912499333156, 1.8521259500224652]], [[-3.108003407774004, -0.35382209639959861], [-2.5470364580834581, -4.8230957742275695]], [[1.4761867081280569, -3.1918089183331064], [1.5628033706215554, 1.4068410101426201]], [[2.7588042307895675, 0.491293260260937], [-3.6623187522937792, -3.1218022760755657]], [[0.3123049642961977, 0.70976792387954646], [4.4490362378435417, 2.5514026951595792]], [[-1.5232202576541787, -2.012094451697056], [-2.1591542717402366, -4.7440635198664873]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[4.9589241016931638, -0.59681089115901553], [-4.2616518307938192, 2.1757653691619616]], [[-2.7843639886345075, -0.030182677260102153], [-2.2233970389439617, -4.4994563550880731]], [[1.7998261272675533, -2.86816949919361], [1.8864427897610518, 1.7304804292821165]], [[3.0824436499290639, 0.81493267940043346], [-3.3386793331542828, -2.7981628569360693]], [[0.63594438343569415, 1.0334073430190429], [4.7726756569830382, 2.8750421142990756]], [[-1.1995808385146822, -1.6884550325575596], [-1.8355148526007401, -4.4204241007269909]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_array_rank0(self):  
       arg0=Data(numpy.array([[[[0.51866211437750032, -1.1441924367307879, 0.10442422943416219, 3.0358720788728082], [-3.6336034039423626, -4.0585813151763208, 2.5204421297349153, 1.1758217778454307], [2.0643924996160168, -0.31277968094197828, -3.0158481276509419, -1.4944406322280845]], [[-0.5932700557688424, 3.0236496527613586, 0.4498118968522089, -4.8236227744504241], [3.922393095177938, 4.4671726010998078, -3.3779827255839114, -1.3273820269733005], [2.5936740361393831, 2.0581944847593769, -3.2558965806210138, 1.4309347502116951]]], [[[1.2588049093232652, -0.31863768793530589, 2.5779363911687518, 4.5736079545057944], [2.0416211709417977, -2.5115710825401747, 3.7050113040552688, -0.40377591666256674], [-2.9734228958152165, -1.3226778029143995, -3.4784680364669942, -4.9710791076741003]], [[-3.4028339951402464, 4.7028669167000956, -0.80078003404031595, 3.0492224182039198], [-0.17798459491821284, -1.8223593836454066, -1.2259419608797764, 2.6656034265059247], [-3.5286178324415554, 2.3523576869490004, 2.8694492929619049, -1.4142835719911306]]], [[[0.54393784608684648, 0.21752484903897784, 0.5422747368473253, 2.2831136795664193], [-3.7867288285021159, 3.4375568724404619, -0.036183191593337938, 3.9035157296903797], [-2.6939132537065911, 4.7631067929096726, 2.529953609833214, 0.43261964795205898]], [[2.939928571635769, 0.092543113665160881, -4.0034515340176391, 4.2272003703695376], [-1.5875861891810219, -3.5152322813944723, -1.0700311884085014, 3.415603735054848], [-4.7991922243908594, 1.2017062165732213, 2.1862285305106299, 4.2973423370934984]]]]),self.functionspace)  
       arg1=numpy.array(1.87013132504)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[2.3887934394190333, 0.72593888831074516, 1.9745555544756952, 4.9060034039143412], [-1.7634720789008296, -2.1884499901347878, 4.3905734547764483, 3.0459531028869637], [3.9345238246575498, 1.5573516440995547, -1.1457168026094089, 0.37569069281344847]], [[1.2768612692726906, 4.8937809778028916, 2.3199432218937419, -2.9534914494088911], [5.792524420219471, 6.3373039261413409, -1.5078514005423784, 0.54274929806823247], [4.4638053611809161, 3.92832580980091, -1.3857652555794808, 3.3010660752532281]]], [[[3.1289362343647982, 1.5514936371062271, 4.4480677162102848, 6.4437392795473274], [3.9117524959833307, -0.64143975749864168, 5.5751426290968018, 1.4663554083789663], [-1.1032915707736834, 0.5474535221271335, -1.6083367114254612, -3.1009477826325673]], [[-1.5327026700987134, 6.5729982417416286, 1.0693512910012171, 4.9193537432454528], [1.6921467301233202, 0.047771941396126394, 0.64418936416175665, 4.5357347515474578], [-1.6584865074000223, 4.2224890119905334, 4.7395806180034379, 0.45584775305040237]]], [[[2.4140691711283795, 2.0876561740805109, 2.4124060618888583, 4.1532450046079523], [-1.9165975034605829, 5.3076881974819949, 1.8339481334481951, 5.7736470547319128], [-0.82378192866505806, 6.6332381179512057, 4.4000849348747471, 2.302750972993592]], [[4.810059896677302, 1.9626744387066939, -2.1333202089761061, 6.0973316954110706], [0.28254513586051111, -1.6451009563529393, 0.80010013663303159, 5.2857350600963811], [-2.9290608993493263, 3.0718375416147543, 4.0563598555521629, 6.1674736621350315]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_array_rank4(self):  
       arg0=Data(1.83942343606,self.functionspace)  
       arg1=numpy.array([[[[-0.31381356182938447, 2.0275196312649761, 0.32904364646013651, 3.7758294022020582], [-3.3318409123232762, -2.9080626624618624, 1.3396589078376593, 4.7226487195751226], [-4.8826814930462294, 4.6479050954828605, -0.027944398055384845, -2.2219923453083656]], [[3.2396572678215865, -0.71664758760689917, -0.25873443807402641, -2.4842174453587051], [-0.93804907892020672, -4.7280022258242269, -2.6591692152370063, 3.3749331498080508], [-3.9765843056890224, -0.5632741679991522, -1.3516415768460757, 4.039873869213741]]], [[[-3.722479657025942, 0.75949948342866413, 3.9436213175731343, -2.3006944794526598], [1.2348816390708954, -4.1616024834833576, -3.4441761948322847, -0.59417337173913687], [0.21742402943597217, 4.7597461316709122, -0.85658747348055098, -3.9669243501113396]], [[-4.7850431678998042, 0.77082059356661681, 2.4973390344321373, -0.58814403568971496], [-4.3424431556730401, -4.1205753114916801, 0.67251673161203041, 4.7223701278152532], [-3.8151216693520542, -1.4939316079923568, -2.9958271414194226, 4.1461125643039551]]], [[[-3.1102170354266114, 0.79878468738305752, -2.9005492462626092, -2.2493276758068594], [0.27153708944211008, 4.1879414862020532, -4.0469068202066865, 4.1989028420471257], [2.2355266623707246, -1.9476585717156745, 4.9943107625320646, -2.6783514458881816]], [[-1.3111479233058954, 1.5049997267928017, -0.43476775936564493, -4.9663794788011382], [-3.8443564405633568, -2.6255512163535375, 2.6265586656267228, 0.32892885298667984], [1.8913814709335766, -2.7353844873246072, -1.7953893673175472, -0.3031685889274609]]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[1.5256098742272162, 3.8669430673215768, 2.1684670825167371, 5.6152528382586588], [-1.4924174762666755, -1.0686392264052618, 3.1790823438942599, 6.5620721556317232], [-3.0432580569896288, 6.4873285315394611, 1.8114790380012158, -0.38256890925176501]], [[5.0790807038781871, 1.1227758484497015, 1.5806889979825742, -0.64479400930210451], [0.90137435713639391, -2.8885787897676263, -0.8197457791804057, 5.2143565858646514], [-2.1371608696324218, 1.2761492680574484, 0.48778185921052497, 5.8792973052703417]]], [[[-1.8830562209693413, 2.5989229194852648, 5.7830447536297349, -0.46127104339605918], [3.0743050751274961, -2.322179047426757, -1.604752758775684, 1.2452500643174638], [2.0568474654925728, 6.5991695677275128, 0.98283596257604966, -2.127500914054739]], [[-2.9456197318432036, 2.6102440296232174, 4.336762470488738, 1.2512794003668857], [-2.5030197196164394, -2.2811518754350795, 2.511940167668631, 6.5617935638718539], [-1.9756982332954536, 0.34549182806424383, -1.156403705362822, 5.9855360003605558]]], [[[-1.2707935993700108, 2.6382081234396582, -1.0611258102060086, -0.4099042397502588], [2.1109605254987107, 6.0273649222586538, -2.2074833841500858, 6.0383262781037264], [4.0749500984273253, -0.10823513565907383, 6.8337341985886653, -0.838928009831581]], [[0.52827551275070528, 3.3444231628494023, 1.4046556766909557, -3.1269560427445375], [-2.0049330045067562, -0.78612778029693686, 4.4659821016833234, 2.1683522890432805], [3.7308049069901772, -0.89596105126800651, 0.044034068739053467, 1.5362548471291397]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_array_rank1(self):  
       arg0=Data(numpy.array([4.0600397148448337, -0.11537044325742762]),self.functionspace)  
       arg1=numpy.array([-2.7268734378624671, 0.80038633870505915])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([1.3331662769823667, 0.68501589544763153]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_array_rank1(self):  
       arg0=Data(numpy.array([[-2.4511079471568542, 3.0446430805506015], [-3.0318322512651008, 0.15204005742998916]]),self.functionspace)  
       arg1=numpy.array([-1.6210016108970016, 1.9849774118721273])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-4.0721095580538558, 1.4236414696535999], [-1.0468548393929735, 2.1370174693021164]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_array_rank2(self):  
       arg0=Data(numpy.array([3.1351577940799569, -0.068062691509139128]),self.functionspace)  
       arg1=numpy.array([[-1.1383953408425054, -0.025743475399853999], [-1.454724508556958, 3.3308761949836114]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[1.9967624532374515, 3.1094143186801029], [-1.5227872000660971, 3.2628135034744723]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_array_rank1(self):  
       arg0=Data(numpy.array([[[-4.4707087220289212, 0.57121875013525081, -3.92388339145886, 2.5377879831118069, 2.3962819274420859], [0.22163058622863474, 4.0726373239667861, -1.7935257043273047, 3.802603296938095, -2.7300969178255343], [-1.8868327714340563, 2.295041078430323, 2.6661210282279271, -2.7558492046355623, 0.87710245362669781], [-3.4072886148193615, -0.29897836286689383, 2.0445238693231724, -0.31401566904958322, -1.8276513192827859]], [[-0.28940437223873694, 2.6197485022212028, -4.8292185835862451, -0.52580308676740994, -3.2022907216854568], [2.6492833640990288, -2.0810724487766494, -3.0284341764873268, -3.7910575644196989, 1.7130435569842275], [3.153273481020797, 3.8838237223572634, 3.8617345034333379, -2.1715112103488297, -1.2163690423407947], [-4.6068450687494957, -3.6070536365920916, -2.2536525405032304, -1.4661565449047522, -4.8628179633327164]]]),self.functionspace)  
       arg1=numpy.array([-2.0255349304962067, -3.3158920914180223])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-6.4962436525251279, -1.4543161803609559, -5.9494183219550667, 0.51225305261560017, 0.3707469969458792], [-1.803904344267572, 2.0471023934705794, -3.8190606348235114, 1.7770683664418883, -4.755631848321741], [-3.912367701930263, 0.26950614793411631, 0.64058609773172037, -4.781384135131769, -1.1484324768695089], [-5.4328235453155678, -2.3245132933631005, 0.018988938826965729, -2.3395505995457899, -3.8531862497789926]], [[-3.6052964636567593, -0.69614358919681951, -8.1451106750042683, -3.8416951781854323, -6.5181828131034791], [-0.66660872731899357, -5.3969645401946718, -6.3443262679053491, -7.1069496558377212, -1.6028485344337948], [-0.16261861039722536, 0.56793163093924104, 0.54584241201531558, -5.487403301766852, -4.5322611337588175], [-7.9227371601675181, -6.9229457280101139, -5.5695446319212527, -4.7820486363227745, -8.1787100547507379]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_array_rank3(self):  
       arg0=Data(numpy.array([0.70221814219295542, 0.4423036630567978]),self.functionspace)  
       arg1=numpy.array([[[4.662291394664944, 4.6230493309139025, -2.2214676544868039, -2.1857828664925116, 2.6285437359495925], [-0.37501089228856976, 2.8604296564504619, 4.5430349698530144, 2.077325201772303, 4.3877155242337746], [3.266638221778507, 4.8826074256898817, -4.1896941694344649, -1.2867298019556319, -0.60773772140887239], [-4.4228659359495044, -0.68590320211604716, -4.0990611425374475, 4.2160243000149595, 2.649620619810019]], [[4.2617420024253878, 4.2396520021092705, -4.5579005700477104, 0.82399929255670123, -0.47311540226721149], [2.3823719115189554, 1.3252107055558229, -3.0120598898376838, -1.6997927111615918, 2.3783837959823151], [3.9185591306312713, -0.0076172682085555721, 2.4347152908790681, -4.6543857699999238, 3.1248262072492725], [-1.3019194491298092, 0.050531041614807037, 3.9522307010598237, 3.3820281713519655, -0.14629290494374381]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[5.3645095368578994, 5.3252674731068579, -1.5192495122938485, -1.4835647242995562, 3.3307618781425479], [0.32720724990438566, 3.5626477986434173, 5.2452531120459698, 2.7795433439652584, 5.0899336664267301], [3.9688563639714625, 5.5848255678828371, -3.4874760272415095, -0.58451165976267649, 0.09448042078408303], [-3.720647793756549, 0.016314940076908258, -3.396843000344492, 4.918242442207915, 3.3518387620029744]], [[4.7040456654821856, 4.6819556651660683, -4.1155969069909126, 1.266302955613499, -0.030811739210413691], [2.8246755745757532, 1.7675143686126207, -2.569756226780886, -1.257489048104794, 2.8206874590391129], [4.3608627936880691, 0.43468639484824223, 2.8770189539358659, -4.212082106943126, 3.5671298703060703], [-0.85961578607301137, 0.49283470467160484, 4.3945343641166215, 3.8243318344087633, 0.296010758113054]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_array_rank1(self):  
       arg0=Data(numpy.array([[[[4.5203023911755604, 4.2578161655634403], [-4.396607693607022, 3.3155633085999252]], [[3.5878097418058168, 0.91822613470749204], [2.3551210414913708, 2.4679071775972918]], [[-1.1724747742930495, 2.1460144565842079], [0.65349984091856772, -1.5995587145541448]], [[2.9745526987794699, -2.5976773613668627], [-1.2363950489328701, -0.786788800814886]], [[-2.9770056594607928, -3.7693725009511567], [3.8033459845913811, -0.7151665966626739]], [[3.2557652654101688, 0.27500237373339953], [-4.0322254541914635, -2.9154048040398917]]], [[[-4.6227964476736343, -2.4569040614394213], [2.3086990652470867, 3.2569174224260493]], [[-0.85990296615269468, 2.7674118363688027], [3.5639459003050682, 3.7006895004250193]], [[-2.501506561795972, 2.0305591065168427], [2.7154452335415913, 3.9411657527663486]], [[-0.48901970882291579, 2.8436842270246254], [-1.6912375497341294, 0.14479803889334697]], [[-2.7111764086779688, -3.7460657174795586], [-0.4673913128868934, -1.8835485471147893]], [[-1.7891375039530644, 0.35886594104741931], [-1.4811898958548877, 1.8999782557284375]]]]),self.functionspace)  
       arg1=numpy.array([2.5939546410340428, -0.34024512478619062])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[7.1142570322096033, 6.8517708065974832], [-1.8026530525729791, 5.909517949633968]], [[6.1817643828398596, 3.5121807757415349], [4.9490756825254136, 5.0618618186313347]], [[1.4214798667409934, 4.7399690976182507], [3.2474544819526105, 0.99439592647989805]], [[5.5685073398135128, -0.0037227203328198399], [1.3575595921011727, 1.8071658402191568]], [[-0.38305101842674993, -1.1754178599171139], [6.3973006256254239, 1.8787880443713689]], [[5.8497199064442116, 2.8689570147674424], [-1.4382708131574207, -0.32145016300584883]]], [[[-4.9630415724598249, -2.7971491862256119], [1.9684539404608961, 2.9166722976398587]], [[-1.2001480909388853, 2.4271667115826121], [3.2237007755188776, 3.3604443756388287]], [[-2.8417516865821626, 1.6903139817306521], [2.3752001087554007, 3.600920627980158]], [[-0.82926483360910641, 2.5034391022384348], [-2.0314826745203201, -0.19544708589284365]], [[-3.0514215334641595, -4.0863108422657497], [-0.80763643767308402, -2.2237936719009799]], [[-2.129382628739255, 0.01862081626122869], [-1.8214350206410783, 1.5597331309422469]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_array_rank4(self):  
       arg0=Data(numpy.array([2.305328651348387, 1.6870050592978192]),self.functionspace)  
       arg1=numpy.array([[[[-3.5823712921820841, -4.7661652895814166], [-2.9107845426478764, -2.8159297375928762]], [[-4.9390706666034419, 0.6902446349508482], [4.5035356558943533, 1.9612509352748111]], [[2.9589285210225604, 1.0869462297341412], [-4.15351394043706, -1.7263392851719814]], [[-0.83650180487941483, -2.8374350612556909], [-4.1507135660404799, -3.5832752997038653]], [[0.7077819020008711, 1.0288725920807851], [2.0019545304033493, 4.5358891880777072]], [[-0.90365213196637129, 2.2560064049508357], [0.37145452209969498, -4.449481254059795]]], [[[0.99111445136182308, 4.8468090818917879], [0.88624028261150833, 1.0256445855808138]], [[1.7360373817416868, 3.6656943033767782], [2.1424021738960271, -2.7958331903411371]], [[2.9322244156624535, -2.0693472009108014], [-1.9016389010643087, -1.1282924148465723]], [[-1.6206806638374029, -2.9617208247303717], [1.9970697515409617, -4.8979362677151936]], [[3.39239075659167, -0.90329865520388353], [2.5968342573758925, -2.5178456003506966]], [[-1.8289276318276682, -1.8106616452381363], [4.2392012880775756, -1.4812504099724966]]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-1.277042640833697, -2.4608366382330296], [-0.6054558912994894, -0.51060108624448919]], [[-2.6337420152550548, 2.9955732862992352], [6.8088643072427404, 4.2665795866231981]], [[5.2642571723709475, 3.3922748810825283], [-1.848185289088673, 0.57898936617640562]], [[1.4688268464689722, -0.53210640990730385], [-1.8453849146920929, -1.2779466483554782]], [[3.0131105533492581, 3.3342012434291721], [4.3072831817517363, 6.8412178394260943]], [[1.4016765193820158, 4.5613350562992228], [2.676783173448082, -2.144152602711408]]], [[[2.6781195106596423, 6.5338141411896071], [2.5732453419093275, 2.712649644878633]], [[3.4230424410395059, 5.3526993626745973], [3.8294072331938462, -1.1088281310433179]], [[4.6192294749602727, -0.38234214161298219], [-0.21463384176648947, 0.55871264445124691]], [[0.066324395460416241, -1.2747157654325525], [3.6840748108387809, -3.2109312084173744]], [[5.0793958158894892, 0.78370640409393566], [4.2838393166737117, -0.83084054105287741]], [[-0.14192257252984897, -0.12365658594031714], [5.9262063473753948, 0.20575464932532261]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_array_rank2(self):  
       arg0=Data(numpy.array([[-1.9320845300508047, -4.2147282407111408, -0.73849420894463513, -4.842365405809824, 1.5030991512265537], [-1.2809658343763966, 0.26410921855392466, 4.2763031923674841, 2.3659897741760769, -0.60378636152829923], [-4.9699051013426576, -0.52571846619295748, -3.8595681964347763, 4.8597754636803199, -2.6624930811061356], [2.884083906167203, -2.3166632910513441, -0.1066881280094627, 2.0589487040037104, -0.13272101140985537]]),self.functionspace)  
       arg1=numpy.array([[-0.19240585263039822, 3.3206991589384991, 3.7873084573980194, -2.1801553850176472, -2.378444642997819], [-3.0730182785137039, -3.2731617514896447, 3.643658559836414, 1.2213231271040108, 4.4072634540960625], [-3.6873552097787989, 2.6393124014257836, -4.5899866626553845, 4.7042177388721118, 3.1656253089646764], [-2.0733582373907122, -1.0850315152837164, -0.093912783898064234, -3.1744513124290363, 3.1975404144255961]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-2.1244903826812029, -0.89402908177264173, 3.0488142484533842, -7.0225207908274712, -0.8753454917712653], [-4.3539841128901005, -3.0090525329357201, 7.9199617522038981, 3.5873129012800877, 3.8034770925677632], [-8.6572603111214566, 2.1135939352328261, -8.4495548590901599, 9.5639932025524317, 0.50313222785854084], [0.81072566877649077, -3.4016948063350605, -0.20060091190752694, -1.1155026084253259, 3.0648194030157407]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_array_rank2(self):  
       arg0=Data(numpy.array([[[-2.1781603719717477, 1.5795712648004283], [-1.3532716582576878, 4.6105921396229608], [-4.4570946446485564, 3.9928960837210514], [3.5386313328886754, 4.1934896404356667], [1.5279658757051076, -1.0550353175293248]], [[-2.3118063151654766, 0.33347310806449482], [3.8772032676309713, 0.71091866289249772], [-2.1962528937369052, 1.2232002671618041], [-3.9762245138104424, 4.1927266418531985], [-3.110546352886189, 2.7921191671696395]], [[4.655489652059341, 2.3450215707548487], [-0.54670412920811629, -0.84689417292528546], [-3.5886659718034997, 3.3494651603502401], [4.4329481084067908, -0.65966817568961211], [2.5997659221368199, 4.5913686848023652]], [[-4.6453891566025955, 4.3982542056059231], [3.1194112729952224, -4.7118177396631369], [2.018812870987988, 3.4487434839616178], [4.6966236245059321, -0.00259849160589809], [1.2552007742037228, 0.71756340141766906]]]),self.functionspace)  
       arg1=numpy.array([[0.72784218729464278, 4.7188717104841977, 2.8454977679989284, -0.34930410343847029, -0.95385510422056008], [0.72569189604733353, 2.9345589771971348, -3.198754428254329, 0.83260282199936597, -1.9033504505137087], [2.4098987795084748, -0.90384037804616657, 0.26346048333739169, 0.67285188374523575, 4.6418598885088276], [-2.4154888987955223, -1.6290532347443367, 4.9574474988775776, 2.2956380743502356, -4.1722105844732029]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-1.4503181846771049, 2.3074134520950711], [3.3656000522265099, 9.3294638501071585], [-1.611596876649628, 6.8383938517199798], [3.1893272294502051, 3.8441855369971965], [0.57411077148454748, -2.0088904217498849]], [[-1.5861144191181431, 1.0591650041118283], [6.8117622448281061, 3.6454776400896325], [-5.3950073219912342, -1.9755541610925249], [-3.1436216918110764, 5.0253294638525645], [-5.0138968033998976, 0.88876871665593082]], [[7.0653884315678157, 4.7549203502633235], [-1.4505445072542829, -1.750734550971452], [-3.325205488466108, 3.6129256436876318], [5.1057999921520265, 0.013183708055623633], [7.2416258106456475, 9.2332285733111927]], [[-7.0608780553981179, 1.9827653068104008], [1.4903580382508856, -6.3408709744074736], [6.9762603698655656, 8.4061909828391954], [6.9922616988561677, 2.2930395827443375], [-2.9170098102694801, -3.4546471830555339]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_array_rank3(self):  
       arg0=Data(numpy.array([[2.9942323206677433, -3.9361938290250964, 3.9294687258775838, -2.9646435823954786, 0.090114578773836662], [3.7727446831260654, 2.168357306571508, 4.3636325292464235, -0.92992508298779164, 1.421653026831339], [2.6799491096713703, -2.728823112071753, 3.7489907271912735, -1.997074560904244, 3.2665741130708241], [-4.0204364907759036, 4.6270269592530902, 1.1874854226035865, 3.0210586900968437, -4.5354402220426895]]),self.functionspace)  
       arg1=numpy.array([[[2.7361648989608955, 4.0719609374878836], [-4.4062694767228301, -1.9081236495058729], [0.62652576857205666, -4.9925151314536205], [-2.5851056582428331, 3.9473210696163097], [-3.3409316617197682, -4.0946067355157432]], [[0.75754583038537859, 4.1387930360739702], [-1.2718884050135104, -3.2890492695566955], [-4.3411744888532278, -0.18675977479497696], [-2.4484851446103759, 2.1943881740643505], [0.8891932702130152, 2.1333712433365832]], [[1.7077087403314959, -3.5514718480409391], [-2.2410250186346623, -0.18983036158680022], [4.6944431976494005, 3.9864401334998174], [4.1057256565884277, 3.3963075102956068], [0.2834226372389379, 3.2324102396505801]], [[-4.4511829715766034, 4.2541988661768855], [-4.7054436149644712, -4.211727931283578], [-0.87491301478121208, -0.97197301298026151], [-3.9609391127354998, 2.159773567684832], [0.34165179728378181, -3.9622176706265511]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[5.7303972196286388, 7.0661932581556268], [-8.3424633057479269, -5.8443174785309697], [4.5559944944496404, -1.0630464055760367], [-5.5497492406383113, 0.98267748722083104], [-3.2508170829459315, -4.0044921567419065]], [[4.530290513511444, 7.9115377192000356], [0.89646890155799763, -1.1206919629851875], [0.022458040393195766, 4.1768727544514466], [-3.3784102275981676, 1.2644630910765589], [2.3108462970443542, 3.5550242701679222]], [[4.3876578500028662, -0.87152273836956873], [-4.9698481307064153, -2.9186534736585532], [8.443433924840674, 7.7354308606910909], [2.1086510956841837, 1.3992329493913629], [3.549996750309762, 6.4989843527214042]], [[-8.471619462352507, 0.23376237540098188], [-0.078416655711381011, 0.41529902796951212], [0.31257240782237439, 0.21551240962332496], [-0.93988042263865612, 5.1808322577816757], [-4.1937884247589077, -8.4976578926692401]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_array_rank2(self):  
       arg0=Data(numpy.array([[[[-4.9700547658814873, 2.0649778799688914, 2.9037937430448926, -1.2134605192031831, -3.5889224974269194], [-4.4154605462626453, 4.3407879469328385, 4.0385234118122728, -4.191705308028574, -2.1585389723174506], [1.7817299494911589, 4.6838072988233836, 0.47023565600587602, 1.9056725665499616, 4.8375076935135866], [2.8629876230000164, 4.2079005505555678, -4.456909125062305, 1.8232891075985407, -4.454048071998927]], [[-3.4446986023441339, -3.9284119578890375, 1.1386885121356052, 3.1657409324313335, 4.6276820833974082], [1.6948363924602852, 1.1734041003965432, -0.088895512855994951, 3.5240231369525095, -0.097026330424192508], [0.35550902238360127, 1.3199051697839899, -2.9671836923728678, -3.5758477420917201, -0.95695633780500344], [-1.0510196268021521, 2.9487822048406684, 1.0166378255922845, -1.4384827782177947, -0.55312525368082976]], [[-2.571988651492533, 4.7882843391676353, 2.8476061351992676, 4.5361542188742341, 1.1465727389974898], [1.9434882228501849, 3.2178911155908381, -2.0497414813210266, 1.8789073169638257, -2.1735302983587337], [3.8670804549015827, 4.9949483090535853, -2.300325686539435, 3.038470276509635, 4.3874580667430259], [0.95267166853862406, 4.5335197262149176, -4.9299417478935057, -3.5875750417439543, 3.2083640689417479]], [[-1.5905689083328864, -3.8082562682552412, 4.5370843089568407, 1.0670390818283799, 2.4164747351821632], [0.48919324552301013, 2.5258249170139173, -1.4753487371021121, 0.97466892734755284, 1.1654213925887857], [-0.41286040512113242, -1.6365527766047485, -2.474126479109402, 3.4797313598352169, -4.4583367550778794], [1.7908873655156139, 0.19540862144721061, -2.64790968897859, 2.4788497001001346, 3.2993882090749693]], [[4.84176140143658, -4.1431361827631621, 2.6332594661683837, -1.5234744097847077, 4.8617408841591647], [-3.174922324531785, 2.6608455692370256, 4.65357847972572, 2.361412317841415, 1.380793743171628], [3.8168831982438896, 0.65253507236860209, 2.0016878171900974, -1.5234039001017816, -2.840863246889108], [1.6616364089625097, -1.728234369200278, 4.7051214899017921, 2.155021881341824, -0.8919303104584797]]], [[[-3.4771525942253332, -4.189980268674983, -2.7005671276683474, -1.5992591428873082, -4.6517702027649648], [-1.1423967599882823, -2.0357273980435711, 4.6364502620704826, 1.199656918371435, -1.0155704872533544], [-2.6431756087702416, -3.2250265795609847, -3.8502843444289878, 2.9973012848743092, 4.5512544230787544], [4.6220866347659761, 2.1566504122687489, -4.0775668340269515, 4.1098987625734882, 4.1305422136766961]], [[-0.37261691368824579, -0.25327933960644522, 4.5326822867287184, -3.164546394177945, -2.5451433621236683], [-2.0775395225017301, -3.1647792853302636, -0.57852400789835201, 3.081604900667875, -3.4475454570844963], [-0.8259758367668848, 3.9132865311166523, 1.4881753443263754, -4.7241474860316215, -4.2682971113224184], [4.1131373192696827, -0.11795334878177943, -1.0929021264306407, 2.3170101964717418, 1.5169545020936939]], [[2.507919214149064, 4.2202843656340523, -3.5638946020598694, 2.5059391919146892, -2.1165421969758769], [-3.510806449018089, 0.22977752395416395, 0.92315394818643526, 2.9283054391412389, -0.4301942222081081], [4.969678596150306, -0.53070374387100383, -3.7461930772074292, -1.2121507980198909, 1.3521444228531259], [-0.72769219179613653, 2.5095537402174548, 2.463327876618516, -1.3527349935897046, 0.39371397630214933]], [[0.73644486219530592, -1.5806764329786671, -0.56799704503439052, -2.5023911510522865, 3.7080716368426359], [0.075892458480261382, 1.360778866831021, -1.5785832739407688, 1.7289477341333184, 1.9362452117676119], [-0.48481449737081928, -3.6920363393643374, -2.5505978587349687, -3.4310158638014068, 1.1237420114265584], [4.7066306155892228, 3.8731683372092345, 2.9219209257903014, 3.5907376925216088, 0.79797133286244915]], [[0.84737315658806711, -1.4194308349546461, 4.4316799837175012, 4.591549091825101, 0.76067883615131571], [-2.7056511957607743, -0.94403490342980945, 3.2860215424770107, 4.2981061190802627, 1.1388610341314473], [4.1920456079900763, -3.1373509775827504, 2.8089305872184749, -3.3566587967915904, -4.7951747822844002], [3.2410663439568541, -2.0940076733844393, -2.3438039890792051, -1.9898210650219084, -1.0922037793148673]]], [[[0.33004528257826315, 3.5425884890443786, -4.3912893970923115, 0.34723618423067748, -1.6979461936208318], [-0.13594097777508374, -1.3467920820529988, 2.4143429691153981, 3.7542072103210948, 1.6280572827506647], [-1.8555051693462641, -1.5512967286780888, -1.7154912167034073, 0.4371164460354473, -0.77273796463010935], [2.1220389510952318, 2.5814295633062105, 4.7685465718745803, 3.8119227851267006, -1.1696123563265468]], [[-0.30774019438682565, 2.9839485891920141, 0.40953410492603393, 1.0528630303200961, -4.9531582741475289], [-3.3389668869047351, 3.3352701090136652, 0.3660072982926792, -2.4612278453667038, 2.1574302208995828], [-3.3630998534958998, -4.1807675029755496, -4.9556196790876239, 0.81199919938800846, -3.067836963030274], [-0.14607817003201884, 3.2964211313233065, 4.3138513127565687, 2.7856683012606016, -0.063939812877231716]], [[3.5731769583204187, -1.5222004180299376, 3.4531895571741487, 3.5532511225215764, -3.9761433809212923], [2.9496535113162778, -2.6112684335169636, 0.6306912049635276, 1.9268583779771662, -2.4412408906982241], [-2.3506444529372192, 3.4687419019043233, -4.0242539877513899, -4.5510817126131453, -2.5056516088099281], [-0.5884526330254749, 3.5343599057203594, 1.7855590311803784, 4.3493757372868949, 1.739383371281181]], [[0.84159773870790566, 0.68954426577173855, 2.3075318499203199, 2.3438818920892999, 3.0413496751403652], [-2.7351716564199791, -0.003455061334015852, -2.1230729198641098, 0.37022319730896314, -0.50578314180592532], [-2.1647842005545592, -1.0042347704699059, 4.5937684683896389, 2.2558548672563417, 4.4945206389030119], [-3.494265389970054, 3.4726326497517768, 4.6041885097947439, -0.21106350269618446, -3.4527352257173605]], [[-2.0789456089854186, -1.9028773133586596, -2.4332902775468956, -4.8637073402165694, 2.5489091696788204], [-2.946479420316761, -0.37562357769046528, 2.1861268449379736, 0.83545879198728912, -2.8945839958477348], [0.92100123689378677, -0.86142738044056877, -3.4231797091871483, -0.80634221756806923, -3.6477994853292692], [-1.1725506659426035, 3.8704086160253652, -1.2917190685303881, -2.6196302075895117, -2.0094902577410223]]], [[[1.2330889669130629, -1.8742672788824222, 2.2753960318544566, -3.1864800296044726, 1.3384711820935387], [-3.0755907286926121, 0.99898788227850055, 3.5985619019125146, -1.3665837125597768, -0.66094101020231388], [-1.6358790410703317, 2.2279206975540378, 4.6407849724645303, -0.34169255823628308, 3.8446157804234637], [1.1149587606442415, 3.5071776770446839, -3.7307751391989088, 3.4623697957005408, -2.9076955723521838]], [[-2.159140416154596, -2.4949580066921948, 0.076191446421361775, 1.2356653342824551, 3.5260154963591024], [-4.0244124983817748, 0.74117061812666485, -1.4835834204065823, -4.6963833134970816, -4.0100835935128973], [2.0596244410264468, -4.4295446318395095, 3.6729529481064382, 2.6988246738359525, 0.69873962461121231], [0.17762031203197459, 4.1986052753977994, -1.2632165582546193, 0.62317776334872121, -4.4143058296643209]], [[-4.8039034163505221, -0.60143720755880636, 2.4089294533276862, -4.7643509334687852, 4.81424238331177], [0.66428319418270299, -4.300536755643404, -3.7284072361701517, 4.5666434629000836, -3.9874022457922429], [0.50418472316138541, -4.7888980976232443, -0.023909497678681113, 2.1610278949335369, 1.929540783437246], [2.1402766305007273, 1.1935989538200662, 4.1550037646877964, 3.404308694115679, 2.5329835899257489]], [[1.4888191745333028, 0.69636848487035241, -1.2706164573715908, -2.8779276991197023, 1.6464904279836476], [-4.384924849368951, -1.8327911943222155, -3.4440610353243342, -2.1762046104831922, -1.7383154151160927], [1.7782234750411785, -0.91193978272442422, -2.5298582869681105, 4.5559250749876377, -3.8340356641385478], [-3.5962949574957737, 0.09474979987928922, -3.8808830787944713, -3.5764255757578023, -2.7738103125204217]], [[3.1977021831978849, -1.342966071142043, 0.76478258539704047, -1.478528307182787, 1.5722864746862513], [4.7115774175607523, -4.4819293565046214, -1.5938225727928987, -4.6782758254700543, 0.61357617044959767], [1.745687039507259, -2.031451905403292, -3.129256947973623, 3.9824488166276311, 0.87300337082483725], [-1.2448555739466158, 1.1695783435891016, -3.6492369280759061, -0.73464086808373708, -4.1610125312137107]]]]),self.functionspace)  
       arg1=numpy.array([[2.6402833506061025, 2.8969333613995953, -1.4180991289538158, 3.5513150826638107, -2.224728916286919], [-1.7461750333946702, 4.3200172502112544, 0.44036380286962551, 0.94918011809502634, 1.2328009032672913], [-0.81331161868630808, -1.8703542459569578, 1.0110179844198699, 3.8295780508473172, 1.6986359124668136], [-1.7135909616363509, 4.3264216269546747, 3.0777761514756499, -4.1596719668267212, -0.92290081916796041]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-2.3297714152753848, 4.7052612305749939, 5.5440770936509951, 1.4268228314029194, -0.94863914682081685], [-1.7751771956565428, 6.9810712975389411, 6.6788067624183753, -1.5514219574224715, 0.48174437828865191], [4.4220133000972615, 7.3240906494294862, 3.1105190066119786, 4.5459559171560642, 7.4777910441196891], [5.5032709736061189, 6.8481839011616703, -1.8166257744562024, 4.4635724582046432, -1.8137647213928245]], [[-0.5477652409445386, -1.0314785964894422, 4.0356218735352005, 6.0626742938309288, 7.5246154447970035], [4.5917697538598805, 4.0703374617961385, 2.8080378485436004, 6.4209564983521048, 2.7999070309754028], [3.2524423837831966, 4.2168385311835852, -0.07025033097327249, -0.67891438069212473, 1.9399770235945919], [1.8459137345974432, 5.8457155662402638, 3.9135711869918799, 1.4584505831818007, 2.3438081077187656]], [[-3.9900877804463488, 3.3701852102138194, 1.4295070062454518, 3.1180550899204182, -0.27152638995632605], [0.52538909389636901, 1.7997919866370222, -3.4678406102748425, 0.46080818801000989, -3.5916294273125495], [2.4489813259477669, 3.5768491800997695, -3.7184248154932509, 1.6203711475558191, 2.96935893778921], [-0.46542746041519178, 3.1154205972611018, -6.3480408768473211, -5.0056741706977697, 1.790264939987932]], [[1.9607461743309242, -0.25694118559143053, 8.0883993916206514, 4.6183541644921906, 5.9677898178459738], [4.0405083281868208, 6.077139999677728, 2.0759663455616986, 4.5259840100113635, 4.7167364752525964], [3.1384546775426783, 1.9147623060590622, 1.0771886035544087, 7.0310464424990275, -0.90702167241406872], [5.3422024481794246, 3.7467237041110213, 0.90340539368522066, 6.0301647827639453, 6.85070329173878]], [[2.6170324851496609, -6.3678650990500811, 0.40853054988146464, -3.7482033260716268, 2.6370119678722457], [-5.3996512408187041, 0.4361166529501066, 2.428849563438801, 0.13668340155449599, -0.84393517311529109], [1.5921542819569705, -1.572193843918317, -0.22304109909682168, -3.7481328163887007, -5.065592163176027], [-0.5630925073244093, -3.952963285487197, 2.4803925736148731, -0.069707034945095003, -3.1166592267453987]]], [[[-5.2233276276200034, -5.9361553020696531, -4.4467421610630176, -3.3454341762819784, -6.397945236159635], [-2.8885717933829524, -3.7819024314382412, 2.8902752286758124, -0.54651811502323522, -2.7617455206480246], [-4.3893506421649118, -4.9712016129556549, -5.596459377823658, 1.2511262514796391, 2.8050793896840842], [2.875911601371306, 0.4104753788740787, -5.8237418674216217, 2.363723729178818, 2.3843671802820259]], [[3.9474003365230086, 4.0667379106048092, 8.8526995369399728, 1.1554708560333093, 1.7748738880875861], [2.2424777277095242, 1.1552379648809907, 3.7414932423129024, 7.4016221508791293, 0.87247179312675804], [3.4940414134443696, 8.2333037813279066, 5.8081925945376298, -0.40413023582036711, 0.051720138888835976], [8.4331545694809371, 4.2020639014294749, 3.2271151237806137, 6.6370274466829962, 5.8369717523049482]], [[2.9482830170186896, 4.6606481685036778, -3.1235307991902439, 2.9463029947843147, -1.6761783941062514], [-3.0704426461484635, 0.67014132682378946, 1.3635177510560608, 3.3686692420108644, 0.010169580661517408], [5.4100423990199316, -0.090339941001378321, -3.3058292743378037, -0.77178699515026539, 1.7925082257227514], [-0.28732838892651102, 2.9499175430870803, 2.9036916794881416, -0.91237119072007911, 0.83407777917177484]], [[1.6856249802903323, -0.63149631488364077, 0.38118307306063581, -1.5532110329572602, 4.6572517549376622], [1.0250725765752877, 2.3099589849260473, -0.62940315584574247, 2.6781278522283447, 2.8854253298626382], [0.46436562072420706, -2.7428562212693111, -1.6014177406399424, -2.4818357457063804, 2.0729221295215847], [5.6558107336842491, 4.8223484553042608, 3.8711010438853277, 4.5399178106166351, 1.7471514509574755]], [[2.0801740598553584, -0.18662993168735476, 5.6644808869847925, 5.8243499950923923, 1.993479739418607], [-1.472850292493483, 0.28876599983748186, 4.518822445744302, 5.530907022347554, 2.3716619373987387], [5.4248465112573676, -1.9045500743154591, 4.0417314904857662, -2.1238578935242991, -3.5623738790171089], [4.4738672472241454, -0.86120677011714797, -1.1110030858119138, -0.75702016175461706, 0.14059712395242396]]], [[[-0.48326633610804492, 2.7292768703580705, -5.2046010157786196, -0.4660754344556306, -2.5112578123071398], [-0.94925259646139182, -2.1601037007393069, 1.6010313504290901, 2.9408955916347868, 0.81474566406435667], [-2.6688167880325722, -2.3646083473643968, -2.5288028353897154, -0.37619517265086078, -1.5860495833164174], [1.3087273324089237, 1.7681179446199025, 3.9552349531882722, 2.9986111664403925, -1.9829239750128549]], [[-2.1780944403437834, 1.1135943432350563, -1.4608201410309238, -0.81749121563686167, -6.8235125201044866], [-5.2093211328616924, 1.4649158630567074, -1.5043469476642786, -4.3315820913236616, 0.28707597494262505], [-5.2334540994528576, -6.0511217489325073, -6.8259739250445817, -1.0583550465689493, -4.9381912089872317], [-2.0164324159889766, 1.4260668853663487, 2.443497066799611, 0.91531405530364385, -1.9342940588341895]], [[4.5841949427402886, -0.51118243361006765, 4.4642075415940186, 4.5642691069414463, -2.9651253965014224], [3.9606714957361477, -1.6002504490970937, 1.6417091893833975, 2.9378763623970361, -1.4302229062783542], [-1.3396264685173493, 4.4797598863241932, -3.01323600333152, -3.5400637281932754, -1.4946336243900582], [0.42256535139439499, 4.5453778901402293, 2.7965770156002483, 5.3603937217067648, 2.7504013557010509]], [[4.6711757895552228, 4.5191223166190557, 6.1371099007676371, 6.173459942936617, 6.8709277259876824], [1.0944063944273381, 3.8261229895133013, 1.7065051309832073, 4.1998012481562803, 3.3237949090413919], [1.6647938502927579, 2.8253432803774112, 8.4233465192369561, 6.0854329181036588, 8.3240986897503291], [0.33531266087726319, 7.3022107005990939, 8.4337665606420611, 3.6185145481511327, 0.3768428251299567]], [[-0.38030969651860502, -0.20424140089184606, -0.73465436508008208, -3.1650714277497558, 4.247545082145634], [-1.2478435078499475, 1.3230123347763483, 3.8847627574047872, 2.5340947044541027, -1.1959480833809213], [2.6196371493606003, 0.83720853202624479, -1.7245437967203348, 0.89229369489874433, -1.9491635728624557], [0.52608524652421007, 5.5690445284921788, 0.40691684393642547, -0.92099429512269815, -0.31085434527420874]]], [[[-0.48050199472328803, -3.5878582405187731, 0.56180507021810566, -4.900070991240824, -0.37511977954281228], [-4.789181690328963, -0.71460307935785039, 1.8849709402761636, -3.0801746741961278, -2.3745319718386648], [-3.3494700027066826, 0.51432973591768683, 2.9271940108281793, -2.055283519872634, 2.1310248187871128], [-0.59863220099210945, 1.7935867154083329, -5.4443661008352597, 1.7487788340641899, -4.6212865339885347]], [[2.1672812108000787, 1.8314636202624799, 4.4026130733760365, 5.5620869612371298, 7.8524371233137771], [0.30200912857289985, 5.0675922450813395, 2.8428382065480924, -0.36996168654240691, 0.31633803344177736], [6.3860460679811215, -0.10312300488483483, 7.9993745750611129, 7.0252463007906272, 5.025161251565887], [4.5040419389866493, 8.5250269023524741, 3.0632050687000554, 4.9495993903033959, -0.087884202709646253]], [[-1.7261272648748722, 2.4763389439168435, 5.486705604803336, -1.6865747819931354, 7.8920185347874199], [3.7420593456583529, -1.2227606041677541, -0.65063108469450182, 7.6444196143757335, -0.90962609431659303], [3.5819608746370353, -1.7111219461475944, 3.0538666537969688, 5.2388040464091867, 5.0073169349128959], [5.2180527819763771, 4.2713751052957161, 7.2327799161634463, 6.4820848455913289, 5.6107597414013988]], [[-2.6708527922934184, -3.4633034819563688, -5.430288424198312, -7.0375996659464235, -2.5131815388430736], [-8.5445968161956714, -5.9924631611489367, -7.6037330021510554, -6.3358765773099135, -5.8979873819428139], [-2.3814484917855427, -5.0716117495511455, -6.6895302537948318, 0.39625310816091641, -7.993707630965269], [-7.7559669243224949, -4.064922166947432, -8.0405550456211934, -7.736097542584524, -6.9334822793471425]], [[2.2748013640299245, -2.2658668903100034, -0.15811823377091994, -2.4014291263507475, 0.64938565551829086], [3.7886765983927919, -5.4048301756725818, -2.5167233919608591, -5.6011766446380147, -0.30932464871836274], [0.8227862203392986, -2.9543527245712524, -4.0521577671415834, 3.0595479974596707, -0.049897448343123152], [-2.1677563931145762, 0.24667752442114121, -4.5721377472438665, -1.6575416872516975, -5.0839133503816711]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_array_rank4(self):  
       arg0=Data(numpy.array([[-1.8504406608823598, -2.8363327414069204, -4.8271502388533065, 2.0111747761759391, -4.0554142996533518], [2.7194235016753847, 3.1409085428898145, 2.0876404107112432, 0.34391250234105364, -4.920458281762297], [-3.3365000946098231, 0.11826104196156528, -3.1914542970517932, 3.0849123451699096, 2.6047062761915249], [-3.7385123819818276, 1.373147195583627, -2.1370572651830431, -1.2741422717312401, 2.624735104927427]]),self.functionspace)  
       arg1=numpy.array([[[[3.6532793056013197, 3.8382702051462161, -3.5503938291348449, 0.083905514649425861, 3.316790547727944], [2.9237825900302141, 0.19988725779366412, -4.5823644935603616, 0.60077748258611052, 4.9988117884803742], [-4.1230597195519181, 3.4874572793548495, 3.5772119965223599, -3.0094089513739561, -4.5871865964944138], [0.30524411685735231, -2.0754188961813638, -3.5020985683924675, 3.365292335025087, -4.2475223503071193]], [[-1.4992521616159959, -3.0059706833702338, 2.5087008545936147, 1.2763998192186774, 4.4702955954579888], [-4.3389435603686577, -2.6485174515735266, 2.8808715048718492, 4.2680612491810841, 3.1487164140207007], [-0.19384150927883326, -3.4379017048238012, -0.58990566756911189, 4.0729395187399469, 4.259871636121618], [0.062555814536718657, 2.7711315102343601, 1.5341515622724513, -0.91162217409097668, 3.6067563895408465]], [[2.856903853056072, 1.6084638151521808, 0.30641971826199743, -3.4432231636783572, 0.56143054426989192], [-0.75960384296481287, 2.3736482868079358, 2.5206474563138883, 3.0579923679184944, 2.2679133349993643], [-2.72747998343121, -4.9741542795110982, -2.9122379025019187, -3.4861407979045902, -2.3652196545092541], [1.5946994512476653, 0.73716163306312588, 1.0724634269307707, 0.011255128560408778, 4.3695327571017124]], [[1.6819522299678047, 2.7571336524381316, -0.22598958865249941, 2.3696792575171752, 4.2036332736270197], [-3.8104935067461643, -1.7462864648897058, -3.2986795334798211, -0.24071075683630117, 2.6412544076065103], [1.4228964615913569, -3.4018272968441696, -1.9877569157967621, 2.3023603976009959, 1.9233400049575824], [2.4866839963386846, 4.7458882713670132, 2.7531286361989746, 1.2335784261870808, 1.4465688364867226]], [[-2.0198280153224681, 4.9312252312567111, -3.3489469629804178, 2.4259619499712413, -4.4060084222352636], [-2.6973818224560899, 4.3002428764981602, -0.022350001053212054, -1.5247590122521815, -2.9338325689197453], [-1.078607792509171, 4.1736967241560698, -1.3956467380782236, 2.9763983361055484, 4.6419226328684093], [1.8120382150969334, 1.6290491361555777, 3.7391612073189968, 0.26318894148691641, 2.1557947058275868]]], [[[-2.6006896854403418, 2.7089703137484591, 2.1724704939008541, -1.3765002257421068, 3.582941097466195], [-0.20404488578883306, 3.2438863176879096, 0.96203466227754397, 1.4991400309840959, -0.053623381430732309], [-0.7341249607060174, -3.3632135940653987, -2.2100806955459342, -0.15796390094655255, -1.4427083353290717], [1.6158813481389878, -2.8931105660242826, 3.3986681784655488, 0.95029107529536283, 0.63940307873799807]], [[-3.3657127201946615, 1.1246731941417689, 4.1302650492343442, -2.2155312451097431, 0.67339743761309201], [1.0022816774707373, -0.56838976781985018, -0.20105363771409124, 2.9423249707294623, -3.1195474542001076], [4.548585789844843, -2.300523504658083, -1.9674434091704951, -4.6012074221631138, 0.43086135992619745], [-4.2472000776891807, -3.478573792852131, -4.3926793243192801, 2.5988338233703629, 3.3255925707170242]], [[1.1449528977706516, -3.6028448482792195, 0.91968154551955905, -0.41670627833488894, -4.9482955281205552], [-2.7930349678062436, 0.98187241800066349, 3.1381411133229129, 2.9169404795123803, -2.5191197000825785], [3.888415827342385, 2.5299182788116532, -2.5345808595950361, 1.9509543921497823, -1.9550476260596472], [0.87284133286654519, 0.43918978461349045, 3.9198239317452614, 0.38345186616903426, -0.91928061127495386]], [[3.7265249427676537, 0.61510295953765759, -0.61529338239021758, -4.9567948648034621, -0.8208991583212546], [-1.3122118736108135, 3.8844339360550464, 0.52606331943843454, -3.7633809061749348, -1.0095651521588311], [-1.6068920873982053, 1.5164776916552274, 3.8586774819726504, 0.1100814617070629, -4.3849973175014139], [-4.0539617427999364, 4.3004043736240423, -3.8415271946714427, 4.3670323481811586, -4.1713876212871526]], [[-4.5476404677056967, -4.5545341682252811, -2.3130112573377968, -3.8778118209940682, 1.3543289027729983], [0.38354150343953197, 0.19758029326423276, 1.0005924330496576, 3.5206829083086451, 4.6617208553415939], [2.5109613092816305, 0.81648239702776948, -0.69444223437013441, 2.3214356086729824, -4.5851599463358426], [0.92532589909704033, 0.6995085921621591, -0.92525701037154295, 1.4200875939615507, -4.581712026223971]]], [[[-4.744010226658375, -3.1281153299631272, 0.098080927921980532, -3.9990370888629414, 1.0064914562456906], [-4.0661193806249063, 4.1744921146548926, 0.55804142532373291, -1.2169872662313983, 4.5951708724984854], [-3.1641306471921538, -1.547250055824092, 2.8357478724562126, -3.1858311727081743, -0.57876811738590295], [-0.77679340312770151, -0.01940866776820549, 1.5364897352991029, -1.6463877426326947, -2.763646357552374]], [[-0.16299047467600403, -1.9749218138973514, 2.7084700663560524, 4.7804281465562841, -1.5094520190795424], [0.64842178524310601, 4.5226523482003564, 0.27217403703919629, 0.11013097469305588, -0.55785486152657437], [4.734396062098039, -2.4324095256745473, -0.34551662964918606, -1.6986059109685692, -4.1607847826828603], [-1.2965245610745635, -2.4304311895302, -2.5756475408192356, 4.4177501697215842, -2.4567671741888453]], [[0.5724991371397703, 0.84817652200181115, -4.7473093380079137, 1.9006963988863426, -4.6673390545532687], [-4.9672478159667302, -1.934999995073702, 3.2024463743762794, 1.4806382648816099, 1.7979107277106499], [2.515540098589879, -0.78371540682911878, 2.4450049354257821, 0.71535082226472824, 4.0736346927234699], [1.7979884852863757, 3.2848842411243986, -3.4637678392130722, 4.4652998287947661, -4.8421326807835383]], [[-0.492295108256946, 3.2142156120066652, 0.7253366300514017, 0.95028598873630088, -4.1307250106488684], [-1.3765317833992166, 1.1854249102068524, -2.2784336330295982, -1.5300129687574482, -1.2532345825674374], [0.96111203643523346, 0.39711306721492257, -0.37874555645027641, 1.1121650564930938, -4.5130331107714312], [-1.4473481036588822, 2.9839997737475423, 0.96592674961505764, 1.7697493371554351, -2.2229560136976891]], [[4.6038494861542443, 3.5680709870550356, -0.33729108910015793, -0.034874041608912165, 0.79777161100426408], [0.91128818829224389, -2.59372004914739, 4.9176082964769918, 4.3303917263798972, 4.2962102621833171], [-1.1024023662408933, 1.485853488123869, -1.9324756524126876, -0.27782504774569716, -4.3744262051191507], [0.22966590447020963, -1.0940159056705667, -4.7713651711497533, -0.69063287560011144, 4.727180555671918]]], [[[3.2915447259678547, -1.3153037841087292, 2.7018148095282228, 2.4620363164311252, 3.165850773767735], [-3.944651495211895, 2.8112955351478996, -4.9501401658879116, -1.3151766756977725, 1.9698299283384424], [-0.91762080014117586, 4.8902684882315306, -4.4137618355065591, -3.2762852145976087, 2.5938229138134181], [2.5903845338480957, 2.2832948541419293, -1.1213411022171851, -2.3488275528209068, -4.115599669585511]], [[4.4329770121103849, -4.144134187831872, 2.5010611951499193, -0.46174132721717687, 2.9544355509010316], [-1.1552382826327658, -2.165536264710588, -1.4243178654063904, 3.6508452594997376, -2.616603762896188], [3.2991752767987652, -2.3090875900557628, -3.7698140913654941, 4.8638116113284653, 0.30515872686834111], [-4.175866722833713, -1.3780554867310055, -2.3887162698745712, -4.2818132532152937, -3.4300702319577603]], [[3.5074374109130506, -4.6592513610273869, 0.1620875192520117, 0.89504270582155154, 4.3996642453542094], [0.7023221008754934, 3.446117838748826, 3.4521288165791493, 1.3755620476184127, -4.4620533881212072], [-2.4786127898680208, 1.2007579229376066, -2.2585807112717027, 1.3575171112082014, -1.4382997316804169], [-2.8067445338171138, 0.74067079981306527, -1.8080837963182517, 0.54530654769651576, 3.498773003793044]], [[-3.1549000974647514, 4.6626661976750441, -3.6352646867645966, -1.2930491929809627, 3.2949005340813393], [-4.8205063476101842, 1.5024321780493146, -0.55194997523220479, -2.2903458659744738, 4.4611321783202502], [-2.2485338833883084, 1.7912950425386232, 1.5484325602305038, -2.269161005690691, -1.5714035193695377], [-1.7532378707847105, 1.0881684644122629, -0.47714655123338545, 2.3713910206525703, 1.3932594153403244]], [[-4.6364108993728967, -4.9939702778762651, 1.0691956671758964, 1.6306568851169096, 4.6704907586278299], [3.0452538207147999, -2.2980867560748974, 1.3355499155003177, 1.3502486310699826, 3.0670212357859441], [2.7991817030423549, -2.8481594998495319, -1.4843886373465853, 2.5025521491700076, -4.3742869078691946], [-3.2518661606781452, -2.2101167820569714, -1.5589223736378557, 2.5440302015391802, -2.8349688499274284]]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[1.8028386447189599, 1.9878295442638563, -5.4008344900172052, -1.766535146232934, 1.4663498868455842], [1.0733419291478543, -1.6505534030886957, -6.4328051544427218, -1.2496631782962493, 3.1483711275980144], [-5.9735003804342774, 1.6370166184724897, 1.7267713356400001, -4.8598496122563155, -6.4376272573767732], [-1.5451965440250075, -3.9258595570637236, -5.3525392292748268, 1.5148516741427271, -6.0979630111894796]], [[-4.3355849030229159, -5.8423034247771541, -0.32763188681330568, -1.559932922188243, 1.6339628540510684], [-7.1752763017755781, -5.4848501929804474, 0.044538763464928799, 1.4317285077741637, 0.31238367261378031], [-3.0301742506857536, -6.2742344462307216, -3.4262384089760323, 1.2366067773330265, 1.4235388947146976], [-2.7737769268702017, -0.06520123117256027, -1.3021811791344691, -3.7479549154978971, 0.77042364813392616]], [[-1.9702463857972345, -3.2186864237011257, -4.5207305205913091, -8.2703734025316642, -4.2657196945834146], [-5.5867540818181194, -2.4535019520453707, -2.3065027825394182, -1.7691578709348121, -2.5592369038539422], [-7.5546302222845165, -9.8013045183644039, -7.7393881413552252, -8.3132910367578958, -7.1923698933625602], [-3.2324507876056412, -4.0899886057901806, -3.7546868119225358, -4.8158951102928977, -0.45761748175159411]], [[3.6931270061437438, 4.7683084286140707, 1.7851851875234397, 4.3808540336931143, 6.2148080498029588], [-1.7993187305702252, 0.26488831128623325, -1.287504757303882, 1.7704640193396379, 4.6524291837824494], [3.4340712377672959, -1.3906525206682305, 0.023417860379177036, 4.313535173776935, 3.9345147811335215], [4.4978587725146237, 6.7570630475429523, 4.7643034123749137, 3.2447532023630199, 3.4577436126626617]], [[-6.0752423149758199, 0.87581093160335932, -7.4043612626337696, -1.6294523496821105, -8.4614227218886153], [-6.7527961221094417, 0.24482857684480841, -4.0777643007065638, -5.5801733119055328, -6.9892468685730975], [-5.1340220921625228, 0.11828242450271809, -5.4510610377315754, -1.0790159635478034, 0.58650833321505758], [-2.2433760845564183, -2.4263651634977741, -0.31625309233435495, -3.7922253581664354, -1.899619593825765]]], [[[0.11873381623504287, 5.4283938154238438, 4.8918939955762388, 1.3429232759332779, 6.3023645991415798], [2.5153786158865516, 5.9633098193632943, 3.6814581639529287, 4.2185635326594806, 2.6658001202446524], [1.9852985409693673, -0.64379009239001395, 0.50934280612945049, 2.5614596007288322, 1.276715166346313], [4.3353048498143725, -0.17368706434889791, 6.1180916801409335, 3.6697145769707475, 3.3588265804133828]], [[-0.22480417730484703, 4.2655817370315834, 7.2711735921241587, 0.92537729778007138, 3.8143059805029065], [4.1431902203605517, 2.5725187750699643, 2.9398549051757232, 6.0832335136192768, 0.021361088689706875], [7.6894943327346574, 0.8403850382317315, 1.1734651337193194, -1.4602988792732994, 3.5717699028160119], [-1.1062915347993663, -0.3376652499623165, -1.2517707814294656, 5.7397423662601774, 6.4665011136068387]], [[3.2325933084818947, -1.5152044375679763, 3.0073219562308022, 1.6709341323763542, -2.860655117409312], [-0.70539455709500043, 3.0695128287119067, 5.2257815240341561, 5.0045808902236235, -0.43147928937133528], [5.9760562380536282, 4.6175586895228964, -0.44694044888379292, 4.0385948028610255, 0.13259278465159596], [2.9604817435777884, 2.5268301953247336, 6.0074643424565046, 2.4710922768802774, 1.1683597994362893]], [[4.0704374451087073, 0.95901546187871123, -0.27138088004916394, -4.6128823624624085, -0.47698665598020096], [-0.96829937126975985, 4.2283464383961, 0.86997582177948818, -3.4194684038338812, -0.6656526498177775], [-1.2629795850571517, 1.860390193996281, 4.202589984313704, 0.45399396404811654, -4.0410848151603602], [-3.7100492404588827, 4.6443168759650959, -3.497614692330389, 4.7109448505222122, -3.8274751189460989]], [[-9.4680987494679947, -9.4749924499875782, -7.2334695391000938, -8.7982701027563657, -3.5661293789892987], [-4.5369167783227651, -4.7228779884980643, -3.9198658487126394, -1.399775373453652, -0.25873742642070319], [-2.4094969724806665, -4.1039758847345276, -5.6149005161324315, -2.5990226730893147, -9.5056182280981396], [-3.9951323826652567, -4.2209496896001379, -5.84571529213384, -3.5003706878007463, -9.5021703079862689]]], [[[-8.0805103212681981, -6.4646154245729504, -3.2384191666878426, -7.3355371834727645, -2.3300086383641325], [-7.4026194752347294, 0.83799202004506945, -2.7784586692860902, -4.5534873608412214, 1.2586707778886623], [-6.5006307418019773, -4.8837501504339151, -0.50075222215361048, -6.5223312673179974, -3.9152682119957261], [-4.1132934977375246, -3.3559087623780286, -1.8000103593107202, -4.9828878372425178, -6.1001464521621971]], [[-0.044729432714438744, -1.8566607719357862, 2.8267311083176176, 4.8986891885178494, -1.3911909771179771], [0.76668282720467129, 4.6409133901619217, 0.39043507900076158, 0.22839201665462117, -0.43959381956500909], [4.8526571040596043, -2.314148483712982, -0.22725558768762077, -1.5803448690070039, -4.0425237407212951], [-1.1782635191129982, -2.3121701475686347, -2.4573864988576704, 4.5360112116831495, -2.33850613222728]], [[-2.6189551599120229, -2.343277775049982, -7.9387636350597068, -1.2907578981654506, -7.8587933516050619], [-8.1587021130185242, -5.1264542921254952, 0.01099207732448626, -1.7108160321701833, -1.3935435693411433], [-0.67591419846191414, -3.975169703880912, -0.74644936162601105, -2.4761034747870649, 0.88218039567167672], [-1.3934658117654175, 0.093429944072605409, -6.6552221362648654, 1.2738455317429729, -8.0335869778353306]], [[2.5926172369129636, 6.2991279571765748, 3.8102489752213113, 4.0351983339062105, -1.0458126654789588], [1.7083805617706931, 4.270337255376762, 0.80647871214031142, 1.5548993764124615, 1.8316777626024723], [4.0460243816051431, 3.4820254123848322, 2.7061667887196332, 4.1970774016630035, -1.4281207656015216], [1.6375642415110274, 6.068912118917452, 4.0508390947849673, 4.8546616823253448, 0.8619563314722205]], [[7.2085557623457692, 6.1727772632465605, 2.267415187091367, 2.5698322345826128, 3.402477887195789], [3.5159944644837688, 0.010986227044134989, 7.5223145726685168, 6.9350980025714222, 6.9009165383748421], [1.5023039099506317, 4.0905597643153939, 0.67223062377883736, 2.3268812284458278, -1.7697199289276258], [2.8343721806617346, 1.5106903705209582, -2.1666588949582284, 1.9140734005914135, 7.3318868318634429]]], [[[-0.44696765601397281, -5.0538161660905567, -1.0366975724536047, -1.2764760655507024, -0.57266160821409251], [-7.6831638771937225, -0.92721684683392791, -8.6886525478697401, -5.0536890576796001, -1.7686824536433852], [-4.6561331821230034, 1.151756106249703, -8.1522742174883867, -7.0147975965794362, -1.1446894681684094], [-1.1481278481337318, -1.4552175278398982, -4.8598534841990126, -6.0873399348027348, -7.8541120515673386]], [[5.8061242076940118, -2.7709869922482451, 3.8742083907335463, 0.9114058683664501, 4.3275827464846586], [0.21790891295086112, -0.79238906912696105, -0.051170669822763415, 5.0239924550833646, -1.243456567312561], [4.6723224723823922, -0.93594039447213584, -2.3966668957818671, 6.2369588069120923, 1.6783059224519681], [-2.802719527250086, -0.0049082911473785629, -1.0155690742909442, -2.9086660576316667, -2.0569230363741333]], [[1.3703801457300075, -6.79630862621043, -1.9749697459310314, -1.2420145593614915, 2.2626069801711663], [-1.4347351643075497, 1.309060573565783, 1.3150715513961062, -0.76149521756463034, -6.5991106533042503], [-4.6156700550510639, -0.93629934224543643, -4.3956379764547453, -0.77954015397484167, -3.57535699686346], [-4.9438017990001573, -1.3963864653699778, -3.9451410615012947, -1.5917507174865273, 1.3617157386100009]], [[-4.4290423691959919, 3.388523925943804, -4.9094069584958362, -2.5671914647122027, 2.0207582623500993], [-6.0946486193414238, 0.22828990631807455, -1.8260922469634449, -3.5644881377057138, 3.1869899065890102], [-3.5226761551195485, 0.51715277080738309, 0.27429028849926373, -3.5433032774219311, -2.8455457911007778], [-3.0273801425159506, -0.18597380731897717, -1.7512888229646255, 1.0972487489213303, 0.11911714360908432]], [[-2.0116757944454697, -2.3692351729488381, 3.6939307721033234, 4.2553919900443367, 7.2952258635552569], [5.6699889256422269, 0.32664834885252958, 3.9602850204277447, 3.9749837359974096, 5.6917563407133711], [5.4239168079697819, -0.22342439492210486, 1.1403464675808417, 5.1272872540974346, -1.7495518029417676], [-0.62713105575071815, 0.41461832287045564, 1.0658127312895713, 5.1687653064666073, -0.21023374500000136]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_array_rank3(self):  
       arg0=Data(numpy.array([[[2.9295934407975333, -0.022953977101789036], [3.8426148511765046, -2.0541619110840283]], [[0.49914405954185259, 1.262535784013453], [-0.67379065793777748, -2.8556140197531068]], [[-4.0340293357317716, -2.6924249007230525], [-1.2670314098871041, -3.9797951932072406]], [[3.9586914937153299, 4.1908074865794518], [-1.3451155928593304, 4.2845253843202915]], [[-3.904255067699347, -2.098649915297738], [-2.1142335986987471, -3.1401481209624285]], [[-2.8356637680848786, -4.154142925604873], [-3.4759311065004193, 0.035527190383055185]]]),self.functionspace)  
       arg1=numpy.array([[[4.5960706695683697, 4.7364947830420832], [2.5494422462953015, 2.4444081208934056]], [[2.2905526869981312, 2.4522743919313843], [-4.0593090173433124, -4.0847951687678998]], [[-2.5947808103875749, 4.5126837193697398], [-0.20988593962329638, 0.37118169755922548]], [[-3.2380114636465507, 3.0225940737337513], [2.8345369387574806, 4.1690032199862443]], [[-3.6839830104566182, 2.7091607111134586], [0.37838314659913852, 2.0201744591960225]], [[4.0974245059860941, 3.7051657536319453], [-1.3884338676082066, -0.36606888037739971]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[7.525664110365903, 4.7135408059402941], [6.3920570974718061, 0.3902462098093773]], [[2.7896967465399838, 3.7148101759448373], [-4.7330996752810899, -6.9404091885210066]], [[-6.6288101461193465, 1.8202588186466873], [-1.4769173495104004, -3.6086134956480151]], [[0.72068003006877923, 7.2134015603132031], [1.4894213458981502, 8.4535286043065359]], [[-7.5882380781559657, 0.61051079581572054], [-1.7358504520996085, -1.119973661766406]], [[1.2617607379012155, -0.44897717197292764], [-4.8643649741086259, -0.33054168999434452]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_array_rank3(self):  
       arg0=Data(numpy.array([[[[-1.1105618428722597, 1.8898357521019697], [1.7060585672749546, -3.543932953039203]], [[-2.9810973234580338, -0.56909485651525493], [3.6453701062293788, 2.2785764915447952]]], [[[4.8808849061801443, -4.4558048797668537], [-2.4702346510924378, 4.3299748951875738]], [[-3.3433064246320408, -2.4392685742087918], [-4.8036026108101098, 0.08934050248499581]]], [[[-3.5642298467477707, -4.2584223883556396], [2.0113358494981846, -4.9858920374356401]], [[0.47243677050237576, -2.9044945680973813], [4.8054115813574008, 1.3269541144092925]]], [[[-2.7757017735555167, -3.3743344962517008], [4.4937832137968829, 1.0401437725019234]], [[0.28377296192499646, 0.081357790660399942], [-4.049194432772528, -4.2240182444480903]]], [[[-0.072581817229327328, -2.3675588684202831], [-2.2676776339716054, 1.0173933471558758]], [[-3.2366983391624951, 0.33864896215610063], [-2.2086625320955133, -0.83323130239046783]]], [[[-3.2071402775939961, 1.865831552201124], [-4.8473600622222257, -4.1002954699214946]], [[1.8857157027729174, 0.46239747728970126], [-2.9837460204809751, 1.1827796500804624]]]]),self.functionspace)  
       arg1=numpy.array([[[-3.4279773964888296, -1.7544458302707113], [1.1195313615761684, 3.1507196820727241]], [[-3.4020743873280734, 3.2487466348095246], [-2.9007384295017036, -4.0934777664462789]], [[1.4950620430640438, 0.47885512750264425], [4.5206513564772823, -0.26704042814054141]], [[2.1112502036665077, -2.7765208737794165], [2.72130261888387, 1.2191359671176727]], [[-0.59171662844424056, 1.5222712759577064], [-1.7057791542085021, -2.5707114680235685]], [[-1.8961702313037145, -1.5862226961739259], [-2.8807040697993602, 4.5415883030730253]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-4.5385392393610893, -1.5381416443868599], [-0.048387262995756686, -5.2983787833099143]], [[-1.8615659618818654, 0.55043650506091346], [6.796089788302103, 5.4292961736175194]]], [[[1.4788105188520708, -7.8578792670949271], [0.77851198371708685, 7.5787215299970985]], [[-6.2440448541337439, -5.340007003710495], [-8.8970803772563887, -4.0041372639612831]]], [[[-2.0691678036837269, -2.7633603452915958], [2.4901909770008288, -4.5070369099329959]], [[4.9930881269796581, 1.6161567883799011], [4.5383711532168594, 1.059913686268751]]], [[[-0.664451569889009, -1.2630842925851931], [1.7172623400174665, -1.7363771012774931]], [[3.0050755808088665, 2.80266040954427], [-2.8300584656548553, -3.0048822773304176]]], [[[-0.66429844567356788, -2.9592754968645236], [-0.74540635801389898, 2.5396646231135822]], [[-4.9424774933709976, -1.3671301920524015], [-4.7793740001190823, -3.4039427704140364]]], [[[-5.1033105088977102, -0.030338679102590582], [-6.4335827583961516, -5.6865181660954205]], [[-0.99498836702644278, -2.418306592509659], [1.5578422825920502, 5.7243679531534877]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_array_rank4(self):  
       arg0=Data(numpy.array([[[-1.0022509017152572, -0.97128347719572794], [3.8291120514057404, -2.6073780136790581]], [[-4.6442543334396618, 0.49326194151392322], [-4.0329153901290562, 1.6475753105371904]], [[1.3052716594646885, -2.0322876948774193], [2.285086931979901, 4.1512735010060648]], [[2.9300304777155528, -1.8272573859124961], [4.877225352571017, 4.0371637665467794]], [[-0.92077005533962275, 1.5749312333814656], [-3.5569374686891244, 1.6177494832372421]], [[-1.999043313723301, -2.0717938251991197], [-2.7731880510579709, 0.90676393818851864]]]),self.functionspace)  
       arg1=numpy.array([[[[3.3601294900683438, -1.1438245311706288], [4.9582493984582801, -1.3186579004159906]], [[-1.4112280196684699, -3.1151589401352577], [2.2813067292958253, 4.8744031542502668]]], [[[-2.154125122291497, -1.6889414514857828], [2.0081756542723088, -0.37210652919471787]], [[-3.2096157563042294, -1.0354966160527592], [4.0455395197222614, -1.640548194464416]]], [[[-2.9856845940018442, 0.24781208838427471], [-2.6171906421502689, 2.1444639180345728]], [[-0.83325135838088649, 4.633949857390828], [2.6421749179535103, -2.1505747502187731]]], [[[-2.3404990457858563, 4.9363772102492671], [-0.080060660225039548, -4.0666522440475319]], [[-2.4285776997370356, 0.31860620926353533], [2.7943619457320708, -1.7574186159953795]]], [[[3.9161849145367036, 1.4130795586554434], [0.20865653033566112, -0.36471362569950561]], [[0.40669720481564831, -3.6604401243137117], [3.0247930776975824, -2.8004984755145799]]], [[[0.37737898292344418, -1.0730633840604509], [2.0616097325652563, 4.0499349246826579]], [[2.6407091657000077, -3.5076407714004509], [0.81405656236420576, -1.5870442656990891]]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[2.3578785883530866, -2.146075432885886], [3.9869659212625521, -2.2899413776117186]], [[2.4178840317372705, 0.71395311127048267], [-0.32607128438323274, 2.2670251405712087]]], [[[-6.7983794557311583, -6.3331957849254445], [2.501437595786232, 0.12115541231920535]], [[-7.2425311464332855, -5.0684120061818154], [5.6931148302594519, 0.0070271160727743975]]], [[[-1.6804129345371557, 1.5530837478489632], [-4.6494783370276878, 0.11217622315715348]], [[1.4518355735990145, 6.919036789370729], [6.7934484189595752, 2.0006987507872918]]], [[[0.58953143192969648, 7.8664076879648199], [-1.9073180461375356, -5.893909629960028]], [[2.4486476528339813, 5.1958315618345523], [6.8315257122788502, 2.2797451505513999]]], [[[2.9954148591970808, 0.49230950331582068], [1.7835877637171267, 1.21021760768196]], [[-3.1502402638734761, -7.2173775930028361], [4.6425425609348245, -1.1827489922773378]]], [[[-1.6216643307998568, -3.0721066977837519], [-0.01018409263386344, 1.9781410994835382]], [[-0.13247888535796326, -6.2808288224584219], [1.7208205005527244, -0.68028032751057044]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_array_rank4(self):  
       arg0=Data(numpy.array([[[[-3.481847182847396, -2.3876539612529668, -2.3828202286545999, -4.7530618084668514], [4.1744287704076548, -2.0577081812541644, 4.2720140368084962, -0.1074184962800846], [-3.5427177874600635, -0.49081441349427024, 1.3340666910124419, -1.7567626592076904]], [[3.0524677847303217, 2.8198300664586116, -3.6049073663164153, 2.1718193692331766], [2.0471442522902796, -2.3573446349203309, -3.5858279121157111, -3.2552265294638536], [-4.281228619661074, 4.7482811318359168, -1.0265319422051111, -0.96529227243463289]]], [[[2.7143953228094251, 0.70464726394083677, 1.4895836907594218, -4.5699498342776437], [-3.4624268263897684, -3.9808272265120417, -2.4523465205068593, 1.6353192501639118], [4.4569186592514338, -4.0126816683807496, -0.84064331824644434, 4.1047716291729461]], [[3.0861492852406087, -1.7061680368120156, 2.1825786414243176, -3.3179710316397548], [1.8385238994267521, 1.2984914416810618, -2.8409661688329866, 2.7507430812620406], [1.6162731839591711, -3.5486304441573879, -2.9094525130097058, -0.29095404088268406]]], [[[4.7148645371006825, 1.3498595803407518, -0.76977757187106732, -0.3327965905983028], [-3.1848813108916052, 3.4837846351433388, -0.66253916996538909, -0.36722583999284808], [1.2301758515399204, -1.2525086124431728, 2.0369128265708447, 2.7322490337187073]], [[1.5115100858340957, 0.19785731942984075, -0.45924599980360892, -2.7658732651547044], [4.9841568544822952, 4.9533858239330257, 4.8288305386579182, 0.61515989945531757], [0.20791920467341818, 4.8615502153984131, -3.1571293141749313, 0.82633102932093649]]]]),self.functionspace)  
       arg1=numpy.array([[[[1.1458749053760329, -2.788847986131632, 4.9715326740858519, -4.1651337118816389], [-3.3414009732994208, -0.62556652143260472, 0.013303843956538053, -0.29194770692027472], [-2.2365692092134304, -3.6546967722010759, 2.338299344909335, 1.7621180182876737]], [[-2.2022824874186675, -3.953833999385826, 0.38120453554165756, 1.5155675692913304], [3.9115956838790407, 2.1244382879606789, 3.2796088949420685, -0.73195256864863811], [-2.5475454573896195, 3.5453561503213944, -2.8917437810687496, 2.6976913317627291]]], [[[0.50057587352964372, -0.64580117566214312, 0.048013546018085052, -3.5320352476761863], [-2.9367576753893609, 1.3881963913797239, -1.7086000338958982, -0.95108012692120791], [1.477128269683087, 3.2814160685338472, 3.8539496074237523, -0.73080478516992109]], [[4.3647246802462885, 2.9131621741231957, 3.9216827392446394, 0.41282755478774913], [3.3843080482743755, 1.5324071661313576, -1.038277511760338, 3.7593508175006978], [3.6720350944394795, 1.4379879811713874, -0.90335001977796647, -4.6471060924493592]]], [[[-3.799780189992914, -0.14688681692678962, -0.94193192663695768, 3.3624709251990996], [0.722649943499313, -1.479028839496328, 4.1720786335214157, -2.7342862871806171], [3.9751023967772667, -4.5749480840170031, 4.7602711306347167, 0.87693716039519476]], [[4.2725044473243496, -0.29808884947164405, 2.6438399247585185, -2.7612425065835531], [-4.7525492609572071, -2.975439327009497, -4.3896040685255091, -3.3682985092808035], [-4.8468966687554795, 4.8910452366278943, -1.1618382484700462, -2.8934265173744791]]]])  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-2.3359722774713632, -5.1765019473845992, 2.588712445431252, -8.9181955203484904], [0.83302779710823405, -2.6832747026867692, 4.2853178807650343, -0.39936620320035932], [-5.7792869966734939, -4.1455111856953462, 3.6723660359217769, 0.0053553590799833017]], [[0.85018529731165415, -1.1340039329272145, -3.2237028307747577, 3.6873869385245071], [5.9587399361693203, -0.23290634695965196, -0.30621901717364253, -3.9871790981124917], [-6.8287740770506939, 8.2936372821573112, -3.9182757232738608, 1.7323990593280962]]], [[[3.2149711963390688, 0.058846088278693642, 1.5375972367775068, -8.1019850819538295], [-6.3991845017791293, -2.5926308351323177, -4.1609465544027575, 0.68423912324270386], [5.9340469289345208, -0.73126559984690243, 3.0133062891773079, 3.373966844003025]], [[7.4508739654868972, 1.2069941373111801, 6.104261380668957, -2.9051434768520057], [5.2228319477011276, 2.8308986078124194, -3.8792436805933246, 6.5100938987627384], [5.2883082783986506, -2.1106424629860006, -3.8128025327876722, -4.9380601333320433]]], [[[0.91508434710776854, 1.2029727634139622, -1.711709498508025, 3.0296743346007968], [-2.4622313673922922, 2.0047557956470108, 3.5095394635560266, -3.1015121271734651], [5.2052782483171871, -5.8274566964601764, 6.7971839572055615, 3.6091861941139021]], [[5.7840145331584454, -0.1002315300418033, 2.1845939249549096, -5.5271157717382575], [0.23160759352508808, 1.9779464969235288, 0.43922647013240912, -2.753138609825486], [-4.6389774640820614, 9.7525954520263074, -4.3189675626449775, -2.0670954880535426]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_constData_rank0(self):  
       arg0=Data(2.81669635066,self.functionspace)  
       arg1=Data(-4.27193197955,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(-1.45523562889,self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_constData_rank0(self):  
       arg0=Data(numpy.array([-1.2722838660544209, -0.078341567137614199]),self.functionspace)  
       arg1=Data(0.553001768536,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-0.71928209751885941, 0.47466020139794729]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_constData_rank1(self):  
       arg0=Data(-3.13805793854,self.functionspace)  
       arg1=Data(numpy.array([-1.8598756348282897, -1.8834652997833814]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([-4.9979335733691226, -5.0215232383242148]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_constData_rank0(self):  
       arg0=Data(numpy.array([[-0.011486191128216028, -0.73565714997192533, 4.9702597169280356, -4.3417019877044876, -2.647529511335609], [2.0797200047707696, 4.6827166184896178, 3.3840050815718801, -4.6553890653573937, 0.95008709285794612], [-2.1804613977495366, 4.4198127772394642, 0.021280988110524035, -3.3318906430130255, -3.3975091766699119], [-4.6533392277318173, 4.3790958978854064, 4.0188314478768259, -4.0695990098103429, -2.2330709456770172]]),self.functionspace)  
       arg1=Data(3.55539857675,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[3.5439123856236998, 2.8197414267799905, 8.5256582936799514, -0.78630341095257172, 0.90786906541630685], [5.6351185815226854, 8.2381151952415337, 6.9394036583237959, -1.0999904886054779, 4.505485669609862], [1.3749371790023792, 7.97521135399138, 3.5766795648624399, 0.22350793373889033, 0.15788940008200392], [-1.0979406509799015, 7.9344944746373223, 7.5742300246287417, -0.51420043305842711, 1.3223276310748986]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_constData_rank2(self):  
       arg0=Data(4.17163555199,self.functionspace)  
       arg1=Data(numpy.array([[4.9202090367916522, -0.40302305677359662, 0.36282212633141064, -2.6500183676328124, 2.5806192909344405], [0.24516597948315066, 3.1942460000463448, 3.3510150152258831, 0.17740275660391713, 4.844785779047653], [3.009594084360776, -4.9041097114533212, -2.7372562637989395, -2.4691558668981193, -0.35305372922915979], [2.062835158903578, 3.0301117309054337, 0.18723338012349444, -0.68202285070412838, 3.8530680792077874]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[9.0918445887769881, 3.7686124952117392, 4.5344576783167465, 1.5216171843525235, 6.7522548429197764], [4.4168015314684865, 7.3658815520316807, 7.5226505672112189, 4.349038308589253, 9.0164213310329888], [7.1812296363461119, -0.73247415946798533, 1.4343792881863964, 1.7024796850872166, 3.8185818227561761], [6.2344707108889139, 7.2017472828907696, 4.3588689321088303, 3.4896127012812075, 8.0247036311931232]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_constData_rank0(self):  
       arg0=Data(numpy.array([[[-4.2070769921368614, -2.6138515088084247], [4.0366489478150918, 0.41618369888741125]], [[-3.6114513002930293, -3.2171687348097278], [-4.2145055520141579, -4.1689731884983363]], [[2.1280722139699897, 2.4356821828016253], [-2.8270883787736514, 1.2148858783645275]], [[-0.59334119285139053, -1.8064816132489678], [2.2181017752329621, -2.1763373917055984]], [[-4.2326665284923806, 0.11744935332349371], [3.7441434175829116, 4.0824420862185029]], [[4.8958883066125818, -3.8834618906485985], [-4.286798694212365, 3.9829487469590408]]]),self.functionspace)  
       arg1=Data(1.90754577472,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-2.299531217421678, -0.70630573409324127], [5.9441947225302751, 2.3237294736025946]], [[-1.7039055255778459, -1.3096229600945444], [-2.3069597772989745, -2.2614274137831529]], [[4.0356179886851731, 4.3432279575168087], [-0.91954260405846799, 3.1224316530797109]], [[1.3142045818637929, 0.10106416146621555], [4.1256475499481455, -0.26879161699041498]], [[-2.3251207537771972, 2.0249951280386771], [5.651689192298095, 5.9899878609336863]], [[6.8034340813277652, -1.9759161159334151], [-2.3792529194971817, 5.8904945216742242]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_constData_rank3(self):  
       arg0=Data(-2.9257829744,self.functionspace)  
       arg1=Data(numpy.array([[[2.155825346374078, -2.2355272705888574], [-2.4982912749978468, 1.5147028414039196]], [[0.62264304246157387, -3.9930594754023394], [-3.220345685333259, 4.4815747684583052]], [[0.36650265335908561, 2.4151162213861763], [-0.32249450620113151, 0.44691173009491081]], [[-2.6608761054019769, -3.5835263077609336], [-0.327157737885722, 4.9299655477775044]], [[-1.9254493101904337, -0.13666080338197606], [-2.2881714380247251, -3.394043293186022]], [[1.8360050689679426, 3.8448243083356886], [-0.52373729401489655, -1.4423727681113894]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-0.76995762802761591, -5.1613102449905508], [-5.4240742493995402, -1.4110801329977742]], [[-2.30313993194012, -6.9188424498040337], [-6.1461286597349529, 1.5557917940566113]], [[-2.5592803210426083, -0.51066675301551756], [-3.2482774806028254, -2.4788712443067831]], [[-5.5866590798036704, -6.5093092821626275], [-3.2529407122874159, 2.0041825733758105]], [[-4.8512322845921272, -3.0624437777836699], [-5.2139544124264194, -6.3198262675877164]], [[-1.0897779054337513, 0.91904133393399468], [-3.4495202684165904, -4.3681557425130837]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_constData_rank0(self):  
       arg0=Data(numpy.array([[[[0.052461366809564147, -4.110553750932981, -3.2046082146170929, -0.31754260721337424], [4.0718393409836686, -3.8415723202774785, -4.6814600197970515, 3.0212401690620787], [-1.886251777821105, 2.2933065015486562, 1.7904320415762083, 3.4176886607381576]], [[-0.308518660376639, -1.2762490732849594, -3.9525746553103467, -2.7136066969327888], [0.015874401754583545, 2.4872917665120173, -0.09920490899863843, 2.9236384580342909], [-3.9635529278954085, 1.6125649798675834, -0.57829975570831049, -3.8637274097805232]]], [[[4.3008813023538988, -0.19799601601000383, 2.6335304037413394, 3.0390289084656068], [4.2857319183800158, 1.8253667067908044, 2.0658566027637786, 4.5382029592533577], [-0.10270297234483028, -0.55666074466669802, 0.26779088616885893, -3.2063809336359239]], [[3.6022521053950065, -4.7973124074982776, -4.596256829313587, -2.1713860334569546], [-1.2986618824491405, -3.8085756433063866, 3.2139711781225433, -0.17023631110438942], [3.35954025645451, 1.4179758565321068, 4.6733191443893656, 1.8169543465856801]]], [[[-2.9981539477088734, 2.5985034269690788, -4.004282578189633, 3.1067868096416547], [3.8001015457698255, 3.8900971908968192, 0.91367740982576606, -4.9343855721000072], [-1.7126115698597322, -1.0273396330819464, -2.2720615258718437, 4.5107733167636699]], [[3.2568786389269846, 2.0846778758482207, -2.4570017108968214, 4.4523565141609325], [-2.8246967018982505, -0.01712939581611117, -2.3268237863899257, -0.27024352919098771], [-3.9880311513268154, 3.6714790796125882, 3.2057486410962639, -3.330089253357571]]]]),self.functionspace)  
       arg1=Data(2.38178018512,self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[2.4342415519300289, -1.7287735658125163, -0.82282802949662814, 2.0642375779070905], [6.4536195261041334, -1.4597921351570138, -2.2996798346765868, 5.4030203541825434], [0.49552840729935976, 4.675086686669121, 4.172212226696673, 5.7994688458586223]], [[2.0732615247438257, 1.1055311118355053, -1.5707944701898819, -0.33182651181232403], [2.3976545868750483, 4.8690719516324821, 2.2825752761218263, 5.3054186431547556], [-1.5817727427749437, 3.9943451649880481, 1.8034804294121543, -1.4819472246600585]]], [[[6.6826614874743635, 2.1837841691104609, 5.0153105888618041, 5.4208090935860715], [6.6675121035004805, 4.2071468919112691, 4.4476367878842433, 6.9199831443738224], [2.2790772127756345, 1.8251194404537667, 2.6495710712893237, -0.82460074851545917]], [[5.9840322905154713, -2.4155322223778128, -2.2144766441931223, 0.21039415166351016], [1.0831183026713243, -1.4267954581859219, 5.595751363243008, 2.2115438740160753], [5.7413204415749748, 3.7997560416525715, 7.0550993295098303, 4.1987345317061449]]], [[[-0.6163737625884087, 4.9802836120895435, -1.6225023930691682, 5.4885669947621194], [6.1818817308902902, 6.2718773760172839, 3.2954575949462308, -2.5526053869795424], [0.66916861526073257, 1.3544405520385183, 0.10971865924862101, 6.8925535018841346]], [[5.6386588240474493, 4.4664580609686855, -0.075221525776356657, 6.8341366992813972], [-0.44291651677778576, 2.3646507893043536, 0.054956398730539036, 2.111536655929477], [-1.6062509662063507, 6.053259264733053, 5.5875288262167286, -0.94830906823710626]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_constData_rank4(self):  
       arg0=Data(-3.20842764987,self.functionspace)  
       arg1=Data(numpy.array([[[[-2.6234399586702208, 4.4311514687043978, -4.1008252477232352, -1.3147052024613046], [4.9417375611190231, 0.81212262599414409, 2.3358326896790551, -2.6539674158911275], [-3.6670874257361419, -4.0291010349188339, 1.9198897647511579, 2.1717602657506578]], [[3.3572962081249642, -0.81791901556249247, -4.4504291471148392, -4.9051770232190171], [-4.0497112295561202, 0.41916455305765865, 3.2229547635965421, 3.8937672784913087], [4.9940003879544808, 4.793451832168186, -1.8584165519098206, 4.647519522972658]]], [[[-0.53503299352415379, 2.0839176647235256, 0.91595403246686491, -1.3052923755698673], [-4.8161034219702747, 1.6364293051155032, 0.1202588614480371, 1.2653242168794634], [2.1981991015387887, 2.6912042994544496, 4.9336834100442353, 4.5549397131944325]], [[-0.57007354496107787, 0.81122008331773099, 4.5482557709239764, -1.2552063267967362], [-4.8538477617493756, -0.12120537723704317, 1.5183899774558949, 4.4446127174634213], [1.5420996270270937, 2.2436300496068675, 1.8816760632759184, -1.6900292906933756]]], [[[3.7771946156899396, 3.0542987269866746, 4.5772441625908762, 0.24426189023640354], [0.3003955873159434, -4.9355096381515704, 1.7262057045408543, 0.70648633617220469], [3.2668356789151183, 4.2115560403883183, 1.6165846839993065, -1.2570952197266805]], [[-1.9628267755299911, 3.3971351326531725, 4.3018214716481769, 1.4851927271492453], [-4.8399518148951257, -0.63664374038129701, 3.6958883149380952, -0.35046359027050134], [0.93113060163432682, -4.1929337674612626, 1.4022206543037878, -3.8552741088192422]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-5.8318676085420256, 1.2227238188325931, -7.3092528975950399, -4.5231328523331094], [1.7333099112472183, -2.3963050238776606, -0.87259496019274962, -5.8623950657629322], [-6.8755150756079466, -7.2375286847906386, -1.2885378851206468, -1.0366673841211469]], [[0.14886855825315948, -4.0263466654342972, -7.6588567969866439, -8.1136046730908227], [-7.2581388794279249, -2.7892630968141461, 0.014527113724737362, 0.68533962861950393], [1.785572738082676, 1.5850241822963813, -5.0668442017816258, 1.4390918731008533]]], [[[-3.7434606433959585, -1.1245099851482792, -2.2924736174049398, -4.5137200254416721], [-8.0245310718420804, -1.5719983447563015, -3.0881687884237676, -1.9431034329923413], [-1.010228548333016, -0.51722335041735512, 1.7252557601724305, 1.3465120633226277]], [[-3.7785011948328826, -2.3972075665540737, 1.3398281210521716, -4.4636339766685413], [-8.0622754116211794, -3.3296330271088479, -1.6900376724159099, 1.2361850675916166], [-1.666328022844711, -0.96479760026493722, -1.3267515865958863, -4.8984569405651808]]], [[[0.56876696581813491, -0.15412892288513014, 1.3688165127190715, -2.9641657596354012], [-2.9080320625558613, -8.1439372880233751, -1.4822219453309504, -2.5019413136996], [0.058408029043313547, 1.0031283905165136, -1.5918429658724982, -4.4655228695984857]], [[-5.1712544254017958, 0.18870748278136773, 1.0933938217763721, -1.7232349227225594], [-8.0483794647669313, -3.8450713902531017, 0.48746066506629049, -3.5588912401423061], [-2.2772970482374779, -7.4013614173330673, -1.8062069955680169, -7.0637017586910469]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_constData_rank1(self):  
       arg0=Data(numpy.array([4.1540633027139418, 4.2691688992684149]),self.functionspace)  
       arg1=Data(numpy.array([-0.9921097979965694, -0.24578558349860025]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([3.1619535047173724, 4.0233833157698147]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_constData_rank1(self):  
       arg0=Data(numpy.array([[4.9487620724261578, -2.3502803754916748], [1.4120618353455585, 2.3414005910700908]]),self.functionspace)  
       arg1=Data(numpy.array([-2.0286253623582273, 0.80373338429263619]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[2.9201367100679305, -4.3789057378499017], [2.2157952196381947, 3.145133975362727]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_constData_rank2(self):  
       arg0=Data(numpy.array([-3.8189678633302861, -3.8242095995628866]),self.functionspace)  
       arg1=Data(numpy.array([[-4.2988704710551753, 0.42327775185501881], [0.74563612720694117, -0.26201836966069436]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-8.1178383343854605, -3.3956901114752673], [-3.0785734723559455, -4.0862279692235806]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_constData_rank1(self):  
       arg0=Data(numpy.array([[[2.4306253984613493, 0.27097597915067606, 4.8407087992044424, -4.2002700623033986, -3.2242044806962298], [-4.7570173975127759, 0.77582079398612702, -3.1524257112778153, -4.4903111744985322, -2.5590460647575175], [-2.888447150803628, -0.7234157156219867, -3.7421740328688657, -3.8487280099265373, -1.2994605035139051], [-3.5538166157110709, 3.9189814647204795, 0.55884092119966056, -0.80385864509695448, -0.49097482321832953]], [[-3.4910898871069405, 0.68773031701308796, -2.544148654646964, -2.1169147222883655, -0.69322156951080061], [2.0076858043290198, -4.7573943340009599, -3.6476864198115821, 4.0853265391235833, 1.0903557907924375], [-3.0455570664553844, -2.5768634875431209, 0.082845699573152132, 0.94709746958400487, 2.9440828420913601], [2.511045052815513, 4.1147994884681864, 2.5767140945094624, -4.3348115222476649, -2.1991212934934543]]]),self.functionspace)  
       arg1=Data(numpy.array([0.97083789363730055, -2.8382489158913393]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[3.4014632920986498, 1.2418138727879766, 5.811546692841743, -3.2294321686660981, -2.2533665870589292], [-3.7861795038754753, 1.7466586876234276, -2.1815878176405148, -3.5194732808612317, -1.5882081711202169], [-1.9176092571663275, 0.24742217801531385, -2.7713361392315652, -2.8778901162892367, -0.32862260987660452], [-2.5829787220737703, 4.88981935835778, 1.5296788148369611, 0.16697924854034607, 0.47986307041897103]], [[-6.3293388029982793, -2.1505185988782514, -5.3823975705383038, -4.9551636381797053, -3.5314704854021399], [-0.83056311156231954, -7.5956432498922997, -6.485935335702921, 1.247077623232244, -1.7478931250989018], [-5.8838059823467237, -5.4151124034344598, -2.7554032163181872, -1.8911514463073344, 0.10583392620002074], [-0.32720386307582627, 1.2765505725768471, -0.26153482138187689, -7.1730604381390037, -5.0373702093847932]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_constData_rank3(self):  
       arg0=Data(numpy.array([-4.2277988748051794, 4.7490099852319041]),self.functionspace)  
       arg1=Data(numpy.array([[[-1.8361616647506143, -4.4264769953087066, 3.1437669893888422, -4.2474799542916273, 0.73212514668399109], [2.0808940518005601, -3.0326664375048349, 1.9218309743531767, -2.2955342043323022, -1.814855399043358], [-2.1412546055908752, -1.0903919266485307, 4.5118182239016171, -1.9724890331900902, 2.0313748118631931], [4.7865019147759433, -4.4747325427745448, 3.3604016107879211, 1.5910878211972159, 0.63928194555016127]], [[-4.742869500144236, 4.3109346241811846, -2.6181040699977807, 3.4190373817932667, -3.5482889281507237], [-0.95708619606326195, -3.7474732005303943, -2.5906433726806402, 1.7251608585489686, 2.6446952098070211], [3.6838843256791947, 1.2261090016170106, -1.6103279577600214, -0.022640873636357028, -3.7576014048720774], [4.2809717169894288, 3.1459851201529396, 0.68211387830240078, 0.86272432592548398, -1.6239375485261665]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-6.0639605395557936, -8.6542758701138851, -1.0840318854163371, -8.4752788290968066, -3.4956737281211883], [-2.1469048230046193, -7.2604653123100142, -2.3059679004520026, -6.5233330791374815, -6.0426542738485374], [-6.3690534803960546, -5.31819080145371, 0.28401934909643778, -6.2002879079952695, -2.1964240629419862], [0.55870303997076398, -8.7025314175797241, -0.86739726401725825, -2.6367110536079634, -3.5885169292550181]], [[0.0061404850876680683, 9.0599446094130887, 2.1309059152341234, 8.1680473670251708, 1.2007210570811804], [3.7919237891686421, 1.0015367847015098, 2.1583666125512639, 6.4741708437808727, 7.3937051950389252], [8.4328943109110988, 5.9751189868489147, 3.1386820274718827, 4.7263691115955471, 0.99140858035982671], [9.0299817022213329, 7.8949951053848437, 5.4311238635343049, 5.6117343111573881, 3.1250724367057376]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_constData_rank1(self):  
       arg0=Data(numpy.array([[[[1.1294111756348348, -3.4461371106010308], [-2.8769732409095763, -4.8251222640695595]], [[-0.36528972331886678, -1.1286710704303058], [2.5041999427595059, -4.4167449960694665]], [[-4.2882549981523148, 0.3408258965951072], [0.78872492869125033, -1.0862658609239983]], [[-2.5667353676117477, -3.5060283756867672], [1.5432507219046396, -4.7310937093245107]], [[0.17867076986635233, -0.9644716006399392], [3.377323976909457, -2.1788544245021866]], [[2.0749175150340911, 1.251521376145682], [3.1916969005573055, -1.166563016395016]]], [[[4.6855290503185678, 4.5095376828768803], [1.4116728420145455, -2.6958130453295914]], [[4.353448313867931, 4.3650848170085723], [1.4790184266111304, -4.0150664208852671]], [[3.1619609804200586, -2.6150967062514385], [-3.0134454072632213, 1.1573123664739882]], [[-3.9667033170398955, 0.1165789264743724], [0.04273399038036807, -3.1166565565193736]], [[-4.7315042506188734, -1.0209064540753121], [3.6195508316056539, 2.3271191429686517]], [[4.8978593945116273, -1.6140364518650485], [4.702912634844056, 4.2601382046839493]]]]),self.functionspace)  
       arg1=Data(numpy.array([2.5761660498240966, -0.74855059446050287]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[3.7055772254589314, -0.8699710607769342], [-0.30080719108547971, -2.2489562142454629]], [[2.2108763265052298, 1.4474949793937908], [5.0803659925836024, -1.8405789462453699]], [[-1.7120889483282182, 2.9169919464192038], [3.3648909785153469, 1.4899001889000982]], [[0.0094306822123488843, -0.92986232586267059], [4.1194167717287362, -2.1549276595004141]], [[2.7548368196904489, 1.6116944491841574], [5.9534900267335535, 0.39731162532191]], [[4.6510835648581876, 3.8276874259697786], [5.7678629503814021, 1.4096030334290806]]], [[[3.9369784558580649, 3.7609870884163774], [0.66312224755404259, -3.4443636397900943]], [[3.6048977194074281, 3.6165342225480694], [0.73046783215062749, -4.76361701534577]], [[2.4134103859595557, -3.3636473007119414], [-3.7619960017237242, 0.40876177201348529]], [[-4.7152539115003984, -0.63197166798613047], [-0.7058166040801348, -3.8652071509798764]], [[-5.4800548450793762, -1.769457048535815], [2.8710002371451511, 1.5785685485081489]], [[4.1493088000511245, -2.3625870463255514], [3.9543620403835531, 3.5115876102234465]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_constData_rank4(self):  
       arg0=Data(numpy.array([-4.5013539608915112, 0.095390805681432767]),self.functionspace)  
       arg1=Data(numpy.array([[[[0.45812811904893369, -0.1795815215759875], [4.0641974845930342, -2.6333542301377677]], [[-2.8815098170696682, -1.9699856937307905], [-3.400456811613032, 3.0805436496194201]], [[0.89198723369701405, 1.2750132072619529], [-3.5591781427892268, 0.55980682442331364]], [[0.7748897826823411, 3.0903824892197829], [-1.0171368574269213, -3.3834916240350008]], [[1.8738767468841466, 4.2992152605381158], [4.1089741418971535, -2.2464766541110714]], [[4.3706104374494679, -2.598181790979214], [-3.3954009168715595, -3.1880876942790159]]], [[[3.3626426996079211, 3.3972123546159878], [-0.50688914736552704, 1.4637217220424867]], [[2.5889018045139478, -3.2065662185980068], [3.4248098780691372, 1.5703032980879819]], [[-2.0101404032795491, -3.9045885786321155], [-2.3103461720953633, -1.3787461066182258]], [[1.1697792784851107, -3.7066853028641256], [-2.3859428944013938, -0.34388257800046773]], [[-3.4912245491345848, 4.1535676332405949], [-1.506135420636936, -0.30874210987715855]], [[-4.9600735218914203, -3.4657214465763211], [-4.3884052335200856, 4.4062234086598995]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-4.0432258418425775, -4.6809354824674987], [-0.43715647629847698, -7.1347081910292793]], [[-7.3828637779611794, -6.4713396546223017], [-7.9018107725045432, -1.4208103112720911]], [[-3.6093667271944971, -3.2263407536295583], [-8.0605321036807389, -3.9415471364681975]], [[-3.7264641782091701, -1.4109714716717283], [-5.5184908183184325, -7.884845584926512]], [[-2.6274772140073646, -0.20213870035339543], [-0.3923798189943577, -6.7478306150025826]], [[-0.13074352344204332, -7.0995357518707252], [-7.8967548777630707, -7.6894416551705271]]], [[[3.4580335052893538, 3.4926031602974206], [-0.41149834168409427, 1.5591125277239195]], [[2.6842926101953806, -3.1111754129165741], [3.5202006837505699, 1.6656941037694146]], [[-1.9147495975981164, -3.8091977729506827], [-2.2149553664139305, -1.2833553009367931]], [[1.2651700841665434, -3.6112944971826928], [-2.2905520887199611, -0.24849177231903496]], [[-3.395833743453152, 4.2489584389220276], [-1.4107446149555032, -0.21335130419572579]], [[-4.8646827162099875, -3.3703306408948883], [-4.2930144278386528, 4.5016142143413322]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_constData_rank2(self):  
       arg0=Data(numpy.array([[-4.5201375548133083, 3.4686404543077227, -1.4190006125197252, 0.10788635630039067, 1.5264239890140283], [-3.0095165044013084, 4.3421971282997838, -2.2533213461584953, 2.2591257650630991, 0.64038408415410686], [4.2661436440725318, 2.9104789293227391, 1.1063730014072064, -3.1918618619884729, 0.45680118313031137], [0.21278793265339324, -1.7351642599572559, -3.0745923735800851, -0.65810004688862378, -1.1393812276483342]]),self.functionspace)  
       arg1=Data(numpy.array([[-1.884607406512544, -1.8964479873639317, -1.5025983471646742, 2.9057722396792531, 4.6475192744848197], [2.1961346411170437, 1.9344713424166384, -4.4118453746641029, -4.6959831302833068, -0.2125036869337551], [-3.7639689371588902, 4.536802771170894, -0.10579375814487069, 2.979750104145249, 1.8632955556898265], [0.69830575155958208, 2.6747646125700975, -3.2111802794315789, -0.72010020705642575, 3.1274120928165825]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[-6.4047449613258518, 1.572192466943791, -2.9215989596843994, 3.0136585959796438, 6.173943263498848], [-0.81338186328426465, 6.2766684707164222, -6.6651667208225982, -2.4368573652202077, 0.42788039722035176], [0.50217470691364152, 7.4472817004936331, 1.0005792432623357, -0.21211175784322389, 2.3200967388201379], [0.91109368421297532, 0.93960035261284158, -6.285772653011664, -1.3782002539450495, 1.9880308651682483]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_constData_rank2(self):  
       arg0=Data(numpy.array([[[0.78487162261268928, 2.4787277670874053], [-3.7345326998281059, 3.8954520101389463], [1.0672607803191045, 4.1915506751059048], [-2.777861828652938, 1.25275478944166], [-2.5490684734166136, -3.8673608645739499]], [[3.2896130461842112, 0.87537151162145133], [-0.037619387125969794, 2.215695630633066], [-2.7141857007680126, -1.0577480182535872], [1.0668799425811883, -1.9879046800379383], [-3.9414830821555569, 1.1609955211587604]], [[-2.6756996798136443, 1.1130158230460676], [1.4505675357228256, -3.523579445209525], [4.9746077441323688, 0.65233325162230216], [-0.51780438304200427, 0.59057858467027469], [4.4171676304321394, 0.12032553851702943]], [[-3.8563421453545841, 1.5114530860612359], [-4.0196672925720565, -4.8837644045033937], [1.8391887508219043, 1.3642341980883028], [-4.6496157578360098, 3.3912801615448949], [2.8881209125256149, 1.3552890757626983]]]),self.functionspace)  
       arg1=Data(numpy.array([[0.83572997220838019, -0.23712528980153724, 1.2481965628282365, 0.29227280553381441, -0.41367318836786282], [-3.8602409717111987, -2.622225887109404, -1.0294352665640205, 1.6056077835169988, -1.5886272676700464], [-0.17099540636022237, 4.7264567976665255, -1.2854852914065473, -0.42390331791514058, -4.8500466219402476], [-4.8437187680939093, -3.7168829061701238, -4.9305678750121773, 0.79334613932304521, -2.378953092004191]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[1.6206015948210695, 3.3144577392957855], [-3.9716579896296431, 3.658326720337409], [2.3154573431473411, 5.4397472379341414], [-2.4855890231191236, 1.5450275949754744], [-2.9627416617844764, -4.2810340529418127]], [[-0.57062792552698749, -2.9848694600897474], [-2.6598452742353738, -0.406530256476338], [-3.7436209673320331, -2.0871832848176077], [2.6724877260981872, -0.38229689652093946], [-5.5301103498256037, -0.42763174651128599]], [[-2.8466950861738667, 0.94202041668584524], [6.1770243333893511, 1.2028773524570004], [3.6891224527258215, -0.63315203978424517], [-0.94170770095714484, 0.16667526675513411], [-0.43287899150810816, -4.7297210834232182]], [[-8.7000609134484925, -3.3322656820326735], [-7.7365501987421803, -8.6006473106735175], [-3.0913791241902731, -3.5663336769238745], [-3.8562696185129646, 4.1846263008679401], [0.50916782052142384, -1.0236640162414927]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_constData_rank3(self):  
       arg0=Data(numpy.array([[-3.7062206036944456, 1.9637519057844477, 1.5654303792067701, -1.1334611694253427, 1.609137529009903], [1.8863203324437441, -3.85305266354362, -0.62717774028177775, 1.2941258092318053, -0.69693635534929399], [0.73993932543087038, 3.3359686635339614, 0.73428854696678236, -1.5214519424524617, 4.9012701661166229], [-3.7245209480150399, 1.6436409114090855, -0.80420125699546219, 4.0135847324117009, 1.3645404180378531]]),self.functionspace)  
       arg1=Data(numpy.array([[[4.2514269937958922, 2.3228939348875599], [3.759403620094572, 2.4881009665079983], [0.30957239752430343, 3.7052468190615944], [1.9886516297580501, -2.4199383954086304], [-2.6041764050498415, 3.6295983675198595]], [[-3.3759385388209919, -1.9405075817558739], [-4.5030638823131417, -4.1009880648649677], [-3.7853549761628127, 3.8896399629240346], [-0.97899345116184122, 0.093623116615474622], [4.2580408200329583, -2.8559882899888613]], [[3.9329859331801682, 0.41129562373807271], [-4.1827549088343199, 2.7892952942565508], [-0.8615481422024196, 0.31123638444155688], [-4.0273599360920418, -1.8387691853504484], [-1.2417219867498019, 3.2501354869381469]], [[2.6402026884392242, 1.10339030700138], [-2.6458478316297809, -0.80222844329025467], [-3.9382353273647519, -0.98281702269850779], [2.4539732885152414, -2.5920511582767078], [0.35059546095792182, -3.9766173050900444]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[0.54520639010144656, -1.3833266688068857], [5.7231555258790197, 4.451852872292446], [1.8750027767310735, 5.2706771982683644], [0.8551904603327074, -3.5533995648339731], [-0.99503887603993846, 5.2387358965297626]], [[-1.4896182063772478, -0.054187249312129815], [-8.3561165458567608, -7.9540407284085877], [-4.4125327164445904, 3.2624622226422568], [0.31513235806996409, 1.3877489258472799], [3.5611044646836643, -3.5529246453381553]], [[4.6729252586110386, 1.1512349491689431], [-0.84678624530035851, 6.1252639577905121], [-0.12725959523563724, 1.0455249314083392], [-5.5488118785445035, -3.3602211278029102], [3.659548179366821, 8.1514056530547698]], [[-1.0843182595758156, -2.6211306410136599], [-1.0022069202206954, 0.84141246811883086], [-4.7424365843602141, -1.78701827969397], [6.4675580209269423, 1.421533574134993], [1.7151358789957749, -2.6120768870521913]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_constData_rank2(self):  
       arg0=Data(numpy.array([[[[-1.5497044459822105, -2.027188677825269, 0.86912636964369483, 2.1170895369208234, -3.3425988196343424], [-4.3359036001933484, -0.99041995619279888, 0.61138361513824435, -3.1038514851410004, -0.79451577691362818], [-3.1585098709974266, 4.2587307738654996, -2.1940753331605531, -2.7272034000118275, -1.9065236896099091], [-0.21533995538831796, -0.019421947936256956, 3.3716175233097232, -4.5395877227950727, -2.4406943611679557]], [[3.0111079737027957, -1.1635740656811433, -3.783490440795565, -3.167514308156949, 4.0900956645140703], [3.488360500332373, -4.5498373915691337, 3.0016626309953605, -3.375192754469265, -1.6944334877971299], [-0.82983667770281855, 1.7463236035234431, 0.88050434780317577, 1.7883877132265784, 3.8993848496885413], [-1.6482873914800091, -1.5802574469440178, -0.064856443199400537, 3.8489962545187559, -4.5819790804727738]], [[1.6584810581168732, -4.766882627258715, 4.0000337243626873, 1.7581048828931536, 2.0052193888809384], [1.8640232966415891, -3.57833198267548, 0.20453401018374606, -2.357665232514814, 1.0233989109233175], [-3.1763561064337944, -1.2221111818048378, 2.2614170755049479, -1.236683485575143, 3.5487036785034523], [-1.600132280864166, 2.2490041891490629, -2.2888931606334229, -3.6723685633001479, -2.0808436827062993]], [[4.7892927727314252, -2.5865201294198616, -4.7286051542454732, 3.2245766781087255, -0.19244053373016712], [-1.0768205293131219, -2.1378288094481546, 4.8055283314790369, -2.2400607031310829, 3.1697057036867093], [4.6291229424617182, -0.14311884897468374, -3.8207340371118992, 2.6399115005900855, 2.7616622264428612], [1.0516409144223884, -4.9327877589098517, -4.7951542419861735, -0.25343595503386052, 3.328157514347609]], [[-2.9112823791650788, 2.7965208038267271, -4.0072292845930271, -4.8847484166147384, -1.1618807027052434], [4.4363838151419497, -0.49158362750483597, -2.774179336794933, -1.7185275031171532, -0.90755011384058015], [4.7165233875288806, -1.5722244552633526, 2.6592832427840083, -1.6917815270199044, -3.8553429200135989], [-1.076678881831834, -4.9539343792132149, -1.7729486364956681, 3.2330562272831092, 3.0262531007811617]]], [[[2.6076309899575438, 2.6968357200295383, 0.88768018664046089, 0.092909142766299802, 0.9033052116073117], [1.9523739616542706, -0.73148498148165153, -4.6204064469567276, -3.8523485436037666, 1.3344091615315126], [3.2276758676637165, 1.1211967752207261, 2.1494827400855261, -2.4834633596247113, 3.1950142271664497], [3.9788338466924564, 2.4412420576378091, 1.6235190579745709, 3.8693747027748451, -1.5004914595719732]], [[2.9515350686541817, 4.3440853490822633, 3.5008845497277843, -0.9642928279835159, 4.2379821111593472], [0.60984362399053449, 1.6859642604082108, 1.5146714476095848, 2.2876446357211595, -4.785535411012054], [2.6730903079845083, -3.3416777184185298, -2.1211589220781635, -0.53282349968731957, 0.47509045837893105], [3.869192081818694, 1.6120274514378679, 1.1865554629685269, -2.0617598581480201, -1.3455643040445988]], [[4.6177425621617179, 1.2470674281499221, -3.2845605276710952, -3.1743569712588648, -1.1482969875132367], [3.1695524989391046, 1.1708653130571705, -2.2956059450191981, -4.1430936860377008, -3.5896774649696681], [2.2338959260634015, 1.9254278060935084, -2.4591542858135651, -3.4192234297122415, 2.2410312575721845], [4.3759064894400215, -3.0679713571873588, -3.5622297740850062, -0.86922063600588473, 0.09888948575572698]], [[-4.9338277230185117, -3.8013921118302854, -4.6231017116141837, 4.5715991083214966, -0.55360573991459638], [1.5891353032055422, 0.81863872473341015, 0.62934735025278155, 1.6241263203256562, 4.8879450454781832], [-4.9254640848827655, 0.3149444815009268, 4.5082415712194415, -4.1696641458138641, -4.5404065509668632], [1.0865846730321316, -4.8916029438123445, 3.8020434591351595, -1.9817058988683067, 2.6614763246251307]], [[-4.0295890904205152, -2.9456950420661929, 2.4285077395251218, -1.5537930307676131, 2.9582995731982127], [2.6607885247651595, -1.1450572001604034, 4.3646226261772085, 3.0532354801169923, -4.9391763269166482], [3.8561432495696284, -1.3363344274780244, 3.0041246903591521, 0.75766934871637304, -1.2060474281982514], [-0.332936961889434, -1.9557859653206124, 0.16388140931057116, -2.3802797741542356, 4.4269629664357097]]], [[[2.4297444861296604, -3.8213249767960846, 4.780207915281224, 4.9176992301701112, -2.5917713812928787], [1.6364476155954648, 4.9545039873800167, 1.0337923469398733, 2.6009319330922889, 3.7294680620659744], [-0.77570735640436794, 2.7179859242238011, 2.3271507584757583, -1.8461658136731405, -0.27328048478772082], [0.62622372685162819, 3.8530107413177834, 3.4733108096729772, -4.7650615378817314, 0.59182485869611234]], [[-1.2838088908492926, 2.3441806804026548, 2.3413315438124416, -1.0110159802505123, -3.6694002022319285], [4.4904678011019215, 0.48484234513985225, 0.90320833383015131, -4.5573696022155072, -1.408342296017624], [-1.1135058365386277, 2.8621526507726056, -1.4044839425641706, 3.6741493920518629, -4.9070785645932959], [3.4205965179578932, -0.42332771708990968, -3.9125699564238436, 4.5731390302789876, 2.5392252299759086]], [[3.1977773283208162, -4.4998206683880948, 2.8985846500754642, -3.953499757497152, -1.4583678653075727], [-1.9250541879334939, -2.2946272915345514, -3.9015194307768351, 4.6387456150434669, 2.1202362175346874], [3.1625677527517642, 4.862106126286049, 2.6456865761457662, 2.570125801848353, 4.8212379723219492], [2.0757479082821853, -1.0914654590848327, -0.54744398759417301, -0.84867919269904224, 2.9782036963408887]], [[-2.1520872509350673, -4.4994588209447652, 2.4688613096582284, -3.0327847017630916, -0.66186379195716771], [4.0687227664974888, 3.4577907253679854, 0.41577586124560995, 2.4965648133204574, 1.774300531754025], [-2.4848938430399992, -2.2426543731968063, -4.9310453157349663, 0.71806966223737945, 1.3023132168548868], [-0.86521234105613054, -4.7946285214600017, 3.2758961205027006, -3.6159299095261996, -0.039431415226406585]], [[4.3713075540210546, 3.377197772775137, -2.0125539343288077, 1.0071447579009902, -1.8207866585917931], [-1.3718270009797449, 3.807489528356891, -3.3178467182131213, -2.0608609243678777, -3.0500660598531768], [1.8088672225882041, -3.3871325258873854, 4.3650024171674104, 4.3658892478997231, 4.0196108418963679], [-0.95230076413198184, 4.6799062604433832, -4.2988378819075272, 0.48940863646122157, -2.6607418814909467]]], [[[-2.9355064202070871, 4.5042667209686034, -3.9393952721934902, -0.83185216502723769, -3.5247393767403281], [-2.3156866286665845, 4.444474013302445, -2.6829193539729976, -0.45424845364179589, -2.6285162057078559], [-4.5863201373889604, 2.7591604353140875, -3.4397351778749985, 0.72345293393704679, 0.90489116297050831], [-2.1803551123377831, -2.5470400348919209, -0.51734718876427976, -1.8448365594929008, -4.7757166275652292]], [[-4.3488069990600708, -0.85247471577836986, 2.7192465853296675, -0.11813549685769953, -0.6771102303259946], [4.7699145402724206, -3.0399522995911465, 1.1064303209701798, -2.6346817309522264, 2.2552237136889994], [-1.5695662771565786, 4.2940674048794101, 1.9809783154646565, 0.52323314201158411, -1.3018943399540071], [-1.0868659301294836, -3.6419901089926032, 3.2990719551965491, 4.0880320518536237, 1.1614785151693567]], [[1.3787183187727345, -0.53838609659959236, 1.8180947895546042, -1.4815026096502448, -2.4882504086954471], [-2.1655943367570862, -4.2954712016347365, 4.6437221515477756, -2.0262555430101692, -4.1332694551395752], [4.9880975962135885, 1.9378828833603965, 2.4839346602898047, 3.8320572911106847, 3.38593769478544], [-3.7156676530710362, -1.5998948007095826, -0.78293026336379512, -4.5397871667512577, 3.2435768234036608]], [[0.38600037873220039, -0.88812583386855959, -4.4008580140998079, 0.39583259743714994, -2.2448329557545934], [-3.0337372661907414, -2.5805672413083114, -2.6809113110733618, -0.73853230088966448, 1.7692571519454283], [4.4097136943328579, -1.8529036868722839, -1.5533859015004881, -4.0951656775823864, -0.42341509659941856], [-0.36140859192607344, -2.2392551384944359, 0.98384409425118946, -3.0155147861310185, 4.4393011580949988]], [[-4.1524354337969562, 3.554639411442885, -3.6063933247722026, -4.6355058362077939, 3.5062424274551169], [-2.5800018363873836, 3.8848713244361104, -3.3061303099209782, 4.9214471982203314, 3.9426576414042316], [3.8403752269159384, 3.0316020229789959, -4.1295808250222077, -0.48105907939425929, 2.4778457561129708], [-1.1267185823582002, 3.1310338201633705, 1.1483516916839145, -2.215992786922599, 3.6318633589376219]]]]),self.functionspace)  
       arg1=Data(numpy.array([[4.3486967934627803, -4.1911769600147517, 4.7483656534106462, 2.2846810218071116, -0.95177200432936981], [-3.0093529178472256, -0.55669545067556925, 3.1373567035340368, -3.2714040728185321, 0.71891694650373061], [-0.57272895604335439, -1.6976353393137278, 4.5965571634355982, -2.8796571851712729, -0.97422361881305974], [-1.3313210697748081, -1.3276191347873221, -4.954731231991528, 4.8472377053335887, 1.4909553877361406]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[2.7989923474805698, 2.3215081156375112, 5.2178231631064751, 6.4657863303836036, 1.0060979738284379], [0.012793193269431846, 3.3582768372699814, 4.9600804086010246, 1.2448453083217799, 3.5541810165491521], [1.1901869224653536, 8.6074275673282798, 2.1546214603022271, 1.6214933934509528, 2.4421731038528711], [4.1333568380744623, 4.3292748455265233, 7.7203143167725035, -0.19089092933229246, 1.9080024322948246]], [[-1.180068986311956, -5.3547510256958954, -7.9746674008103167, -7.3586912681717003, -0.10108129550068146], [-0.70281645968237871, -8.7410143515838854, -1.1895143290193912, -7.5663697144840167, -5.8856104478118816], [-5.0210136377175703, -2.4448533564913086, -3.3106726122115759, -2.4027892467881733, -0.29179211032621044], [-5.8394643514947608, -5.77143440695877, -4.2560334032141522, -0.34218070549599577, -8.7731560404875246]], [[6.4068467115275194, -0.01851697384806883, 8.7483993777733335, 6.5064705363037998, 6.7535850422915846], [6.6123889500522353, 1.1700336707351662, 4.9528996635943923, 2.3907004208958322, 5.7717645643339637], [1.5720095469768518, 3.5262544716058084, 7.0097827289155941, 3.5116821678355032, 8.2970693319140985], [3.1482333725464802, 6.9973698425597091, 2.4594724927772234, 1.0759970901104983, 2.6675219707043469]], [[7.0739737945385368, -0.30183910761275001, -2.4439241324383616, 5.5092576999158371, 2.0922404880769445], [1.2078604924939897, 0.14685221235895707, 7.0902093532861485, 0.044620318676028781, 5.454386725493821], [6.9138039642688298, 2.1415621728324279, -1.5360530153047876, 4.9245925223971971, 5.0463432482499728], [3.3363219362295, -2.64810673710274, -2.5104732201790618, 2.0312450667732511, 5.6128385361547206]], [[-3.8630543834944486, 1.8447487994973573, -4.9590012889223969, -5.8365204209441082, -2.1136527070346132], [3.4846118108125799, -1.4433556318342058, -3.7259513411243028, -2.670299507446523, -1.85932211816995], [3.7647513831995107, -2.5239964595927225, 1.7075112384546385, -2.6435535313492742, -4.8071149243429687], [-2.0284508861612038, -5.9057063835425847, -2.724720640825038, 2.2812842229537393, 2.0744810964517919]]], [[[-0.40172192788968175, -0.31251719781768728, -2.1216727312067647, -2.9164437750809258, -2.1060477062399139], [-1.056978956192955, -3.7408378993288771, -7.6297593648039532, -6.8617014614509921, -1.674943756315713], [0.21832294981649092, -1.8881561426264994, -0.85987017776169949, -5.4928162774719365, 0.18566130931922409], [0.96948092884523085, -0.56811086020941648, -1.3858338598726547, 0.86002178492761949, -4.5098443774191992]], [[2.3948396179786124, 3.787389898406694, 2.944189099052215, -1.5209882786590851, 3.681286660483778], [0.053148173314965241, 1.1292688097326415, 0.95797599693401558, 1.7309491850455903, -5.3422308616876233], [2.1163948573089391, -3.898373169094099, -2.6778543727537327, -1.0895189503628888, -0.081604992296638201], [3.3124966311431248, 1.0553320007622986, 0.62986001229295763, -2.6184553088235893, -1.9022597547201681]], [[7.7550992656957547, 4.3844241316839589, -0.14720382413705835, -0.037000267724828007, 1.9890597160208001], [6.3069092024731415, 4.3082220165912073, 0.84175075851483872, -1.0057369825036639, -0.45232076143563127], [5.3712526295974383, 5.0627845096275452, 0.67820241772047174, -0.28186672617820463, 5.3783879611062213], [7.5132631929740583, 0.069385346346678034, -0.42487307055096935, 2.2681360675281521, 3.2362461892897638]], [[-8.2052317958370438, -7.0727961846488174, -7.8945057844327158, 1.3001950355029646, -3.8250098127331285], [-1.6822687696129899, -2.4527653480851219, -2.6420567225657505, -1.6472777524928759, 1.6165409726596511], [-8.1968681577012976, -2.9564595913176053, 1.2368374984009094, -7.4410682186323962, -7.8118106237853953], [-2.1848193997864005, -8.1630070166308766, 0.53063938631662744, -5.2531099716868388, -0.60992774819340134]], [[-3.3106721439167845, -2.2267780955624623, 3.1474246860288524, -0.83487608426388249, 3.6772165197019433], [3.3797054712688901, -0.42614025365667274, 5.0835395726809391, 3.7721524266207229, -4.2202593804129176], [4.575060196073359, -0.61741748097429383, 3.7230416368628827, 1.4765862952201037, -0.48713048169452078], [0.38597998461429661, -1.2368690188168818, 0.88279835581430177, -1.661362827650505, 5.1458799129394404]]], [[[1.857015530086306, -4.394053932839439, 4.2074789592378696, 4.3449702741267568, -3.164500337336233], [1.0637186595521104, 4.3817750313366624, 0.46106339089651893, 2.0282029770489345, 3.15673910602262], [-1.3484363124477223, 2.1452569681804468, 1.7544218024324039, -2.4188947697164949, -0.84600944083107521], [0.053494770808273806, 3.280281785274429, 2.9005818536296228, -5.3377904939250858, 0.019095902652757957]], [[-2.9814442301630204, 0.64654534108892703, 0.64369620449871379, -2.7086513195642401, -5.3670355415456559], [2.7928324617881937, -1.2127929941738755, -0.79442700548357648, -6.2550049415292346, -3.1059776353313517], [-2.8111411758523555, 1.1645173114588778, -3.1021192818778984, 1.9765140527381351, -6.6047139039070242], [1.7229611786441654, -2.1209630564036375, -5.6102052957375719, 2.8755036909652598, 0.84158989066218082]], [[7.7943344917564144, 0.096736495047503368, 7.4951418135110623, 0.64305740593844618, 3.1381892981280255], [2.6715029755021042, 2.3019298719010468, 0.69503773265876312, 9.2353027784790651, 6.7167933809702856], [7.7591249161873623, 9.4586632897216472, 7.2422437395813644, 7.1666829652839512, 9.4177951357575473], [6.6723050717177834, 3.5050917043507654, 4.0491131758414252, 3.7478779707365559, 7.5747608597764868]], [[-5.0317444361063401, -7.3791160061160381, -0.41079587551304453, -5.9124418869343645, -3.5415209771284406], [1.1890655813262159, 0.57813354019671248, -2.4638813239256629, -0.38309237185081546, -1.1053566534172479], [-5.3645510282112721, -5.1223115583680787, -7.8107025009062392, -2.1615875229338934, -1.5773439683163861], [-3.7448695262274034, -7.6742857066312746, 0.39623893533142773, -6.4955870946974725, -2.9190886003976795]], [[3.3970839352079949, 2.4029741539620773, -2.9867775531418674, 0.032921139087930484, -2.7950102774048529], [-2.3460506197928046, 2.8332659095438313, -4.292070337026181, -3.0350845431809375, -4.0242896786662365], [0.83464360377514435, -4.3613561447004452, 3.3907787983543507, 3.3916656290866634, 3.0453872230833081], [-1.9265243829450416, 3.7056826416303235, -5.273061500720587, -0.48481498235183818, -3.6349655003040064]]], [[[-4.2668274899818952, 3.1729456511937952, -5.2707163419682983, -2.1631732348020458, -4.8560604465151362], [-3.6470076984413926, 3.1131529435276368, -4.0142404237478058, -1.785569523416604, -3.9598372754826641], [-5.9176412071637685, 1.4278393655392794, -4.7710562476498062, -0.60786813583776134, -0.42642990680429982], [-3.5116761821125912, -3.878361104666729, -1.8486682585390879, -3.1761576292677089, -6.1070376973400373]], [[-5.6764261338473929, -2.1800938505656919, 1.3916274505423454, -1.4457546316450216, -2.0047293651133167], [3.4422954054850985, -4.3675714343784691, -0.22118881381714228, -3.9623008657395484, 0.92760457890167736], [-2.8971854119439007, 2.966448270092088, 0.65335918067733445, -0.80438599277573797, -2.6295134747413291], [-2.4144850649168057, -4.9696092437799253, 1.971452820409227, 2.7604129170663017, -0.16614061961796533]], [[-3.5760129132187934, -5.4931173285911203, -3.1366364424369237, -6.4362338416417728, -7.4429816406869751], [-7.1203255687486138, -9.2502024336262636, -0.31100908044375242, -6.9809867750016972, -9.0880006871311032], [0.033366364222060518, -3.0168483486311315, -2.4707965717017233, -1.1226739408808433, -1.5687935372060879], [-8.6703988850625642, -6.5546260327011101, -5.7376614953553231, -9.4945183987427857, -1.7111544085878672]], [[5.2332380840657891, 3.9591118714650291, 0.44637969123378074, 5.2430703027707386, 2.6024047495789953], [1.8135004391428473, 2.2666704640252773, 2.1663263942602269, 4.1087054044439242, 6.616494857279017], [9.2569513996664465, 2.9943340184613048, 3.2938518038331006, 0.7520720277512023, 4.4238226087341701], [4.4858291134075152, 2.6079825668391527, 5.8310817995847781, 1.8317229192025701, 9.2865388634285875]], [[-2.6614800460608157, 5.0455947991790255, -2.1154379370360621, -3.1445504484716533, 4.9971978151912575], [-1.089046448651243, 5.3758267121722509, -1.8151749221848377, 6.4124025859564719, 5.4336130291403721], [5.3313306146520789, 4.5225574107151365, -2.6386254372860671, 1.0098963083418813, 3.9688011438491113], [0.36423680537794034, 4.6219892078995111, 2.639307079420055, -0.72503739918645849, 5.1228187466737625]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_constData_rank4(self):  
       arg0=Data(numpy.array([[-0.71489104262041359, -4.9417504800090288, -0.022246783233022427, -2.319374383024877, 3.8694749133365587], [-2.0608525516829568, -4.1762827312561326, 2.593539920776208, 3.9044109802932976, -0.81799011465572136], [2.4692999152044903, -0.8405808980057472, -3.3504652517438869, 3.7214989166689119, -1.1814247604613226], [-0.20224642365354573, -1.2779692173950998, 0.3028140061884379, -3.2932192929949675, -4.4095065457881333]]),self.functionspace)  
       arg1=Data(numpy.array([[[[2.4365833674491917, 4.0204922014950863, -4.1958520139379942, 1.5498931201188615, -4.4777209139973024], [-4.4604455185736995, -3.8047923912039652, 0.35786357232293486, -1.7049361028226517, 4.4447809814336345], [0.41158640175037231, 3.3768261261839019, 1.594253692929442, 2.1704364148855584, -4.846970310737337], [-1.7846432253657198, -0.50340631844522399, -3.7625334149263621, 4.1393041651441145, -2.040685288562234]], [[-2.376961027056387, -1.935131364456403, -3.4895122226694975, 4.8854376626440281, -1.244454329069089], [-2.7042057516096207, 0.17113300689884881, -4.1239626628728532, -1.9745921712090766, -4.4134511571109254], [1.7503760334038345, 4.4208316397405998, -0.77311081339752619, 1.5981132325207872, 1.1713245685586715], [1.1509384418982211, -0.26227351227875495, -1.5831765495306782, -4.8181407624380679, -0.24266377136707895]], [[1.1493020280168835, 4.6396458692025746, -3.2264956252649304, -0.28901150771702167, 2.107228944734489], [0.95876568649723293, 1.5766366224150588, -1.7955443694847562, 4.7415263874020042, 3.3678141279191909], [-0.1655288068636267, 4.2646829063017133, 4.1010805176686524, 3.4010917634836666, 4.8571447810169701], [-1.8821132152625584, 1.6123258502647895, 1.8702365675432153, -2.1573878758280109, -4.4144218284068515]], [[0.034046770062752252, 1.7908297809483207, -2.6918649593606272, -4.7390255858271289, 0.84091269579824068], [-3.6915362198275989, 2.3100538496330936, 4.3982055354266887, -4.6828058266010526, 3.0685643808763992], [-0.6983167414139011, 0.93932667759090815, 2.9004456265181124, -2.4859609551694408, -0.71311300056353844], [-0.97198969971904958, -2.6540090558864637, -1.1473230589580363, -2.2399163456976199, 3.906833874612456]], [[-1.2831897582389562, -4.9064178798025129, 0.9439181463405335, -2.3750858055669677, -2.5130846285762187], [2.9489050679556943, -3.63250788918171, 0.030112982611226968, 1.1548874750639824, 3.0072113659859099], [-3.041610631703354, -3.5122633679812134, 0.89319870514042599, -3.8147115265721911, 4.460612395832003], [-0.84328260701206403, 3.2430369297413471, 0.91070748602971641, 2.4723493590160084, -2.9555112195899169]]], [[[4.7639001713168661, -2.5752213421050998, -1.4022720734883976, 4.8745125222122585, -2.6111349539092741], [-3.2921994686146583, -2.1381629360624221, -2.7434536625268069, -3.2172343577964204, -3.8879338114368531], [4.8063879468843389, 2.3290593393810557, -4.4107052444028225, -2.6016975235647077, -4.3672579690014492], [0.33751373138550456, 0.07095158431944526, 1.801943744872327, 2.3542032353668656, 4.5530486000634269]], [[-4.6124318097287116, -3.9204841243332975, -2.9434137858367104, -3.9349543227895678, -2.2978109994404052], [3.6900837581419257, -1.2820643130780418, -3.0240174874088366, 1.5852923358596263, 1.33173018210538], [-0.91598966343181676, -4.8344325972865834, 0.37072120083562066, 1.0639618377986579, -1.3788472649884396], [4.8118627210264631, -2.9638858939873391, 4.0460260844113112, -3.2880708604909668, 1.6084316896244211]], [[2.139014527579878, 3.9041291822165558, -2.6849441534249161, -3.0964279958714549, -3.4272788120942277], [-4.5073025004470724, -2.3159072062543675, 1.5071165767949815, -3.969094334553418, -2.4422587941131644], [2.136439301844586, 0.23390577067845619, 3.5862502569241865, 4.1012715989304027, 3.5105889374603549], [-1.5338425580118518, 1.1627045538723104, -2.1297296018895286, -3.5638427526970973, -2.7041039867356131]], [[-1.2136007390665151, -1.8459989346839056, -2.5842128283008394, 1.8972974652610635, -1.3084990891313231], [2.8165557915480042, -3.243957527982122, -2.4649094362007729, -2.1604971430244868, -0.37468588224656063], [0.84503231684493141, -0.12776239709251414, 3.3356987080488185, -3.4308361516468411, -2.2062381412682996], [3.4169309459717283, 2.1281043221791895, -3.0669173660389761, 2.3252736013622455, -0.09213293197894501]], [[3.2860667761381137, 4.5355087829694458, -1.9490695065949581, -2.1347011460851451, -4.549618387662079], [-4.4750605744858865, 0.78012724050392812, 0.91192907623122377, -1.5504508235772096, 0.24565080440512865], [-3.3415316211643287, -3.5910721811801913, -3.3942185587981291, 3.708890015951269, 0.54595398275345453], [4.1705770937996025, 0.1151344329874231, 0.97758752003569782, 2.3249802918452271, -0.30628450049263733]]], [[[2.8345291685706, 4.296287896869682, -3.3821257201348387, 1.4983024221078081, -2.4580101037232627], [-2.0265429370357513, 4.7820110641380502, 2.9843809532611747, 1.1296985950076808, 1.0942252757245701], [0.48483739463293229, -3.7270230718418063, -3.8532669589515756, 2.5591726077783132, 4.6566291856448441], [3.8165161183140324, 3.931551979723185, 0.40222203033031256, 1.6681235561079699, 0.21102439064319967]], [[4.542319521589155, -1.8701544116122615, -1.2351752252009538, -1.1024907215377833, 4.6958801472101346], [3.6838306842487665, -4.0691407047208594, -4.1251700651420773, -2.7957358357578399, -1.6686103240301851], [0.06530346006042631, 3.1513286773545293, -4.3587973447482309, -4.6024872770063521, -4.3807188098557157], [1.0102334696684974, -4.4561834328970491, -4.2880208096644932, -0.1415774070778566, 1.3325125298464737]], [[-1.3810350709319175, 2.5966935165396787, 3.2105894048291503, -3.0703849780480996, -3.4461635221275353], [0.74873203743639571, -1.861293998965492, -0.12456275072731149, 2.1470179548621466, 1.7569348854378566], [-1.607793407954492, -1.6890092092306439, 2.3880307988593987, -0.70592498867460662, 1.7796784843383335], [4.663345753129315, -2.602351253770141, -1.1494765297368748, 1.9064433096365816, 4.3584749246808396]], [[-1.419201543482882, 2.7762137709001298, -2.6179924350879391, 4.4895440444684134, -3.491256858131444], [2.396160560369256, 3.303302274828523, 0.95173996653481119, 2.9402917081912072, 4.0964055526450611], [0.15054058385607227, -1.4158091987707278, -2.3852694697918251, 0.83323173644369142, -0.37841819475290617], [2.6110001577829314, 3.3668394030514541, -1.5971642631843963, -4.3407019783619845, -2.1300855740747227]], [[-1.8282829736787254, -2.622123800038799, -1.7899523826567245, -3.9639802114790381, 2.2613053962119114], [-1.985905334973169, -4.8565219327506535, -3.634355340225448, 2.6454481957223663, -4.7717507817264888], [2.5982041221386973, 0.36062188369028725, 1.8632625137137984, -2.495317959396802, -1.0911403280921963], [-2.9223387862639791, 0.43109706014966065, 3.2473877859206617, -3.0704910567544497, 3.1271581216398179]]], [[[2.2594231948290862, 3.9342362151873118, -3.2220567321882787, -0.49534299991912523, -4.9338313029002077], [-1.2813261076471969, -3.9840393491247825, 3.7285682506689923, -3.6469665347626035, -1.6238172663699215], [3.307401183738758, 2.5790565291112273, 0.10953322030740065, 2.540785526162793, 0.37119153546039385], [-0.42764344424658951, 3.5269269831459873, -3.4247690124908092, -4.8561742112919104, -3.3168953918152866]], [[-1.9387150048357258, 3.8813835010838407, 0.64401777200117305, -3.5705853450860845, 3.6493684144035168], [-4.867899653644379, -0.91996199898330389, -2.6947807339522614, 1.9641201966934947, -0.40774221776783648], [-2.9349350995300014, 3.7419417237895356, 4.6858472874108177, -0.83244196086740718, 2.4650909608362879], [-3.1122242485640794, -0.037505069920127809, -4.9154672741042926, 2.548218900246245, 0.12651168622218911]], [[0.38059900584441309, 2.5109578267273278, -4.8010850390269875, 0.69820877782674629, -3.7126905752512354], [0.60723637127424368, -0.54707619799983398, -0.29945167926485627, -1.0048161496557038, -3.508603509616063], [-3.5760536265190113, -1.8555527667429326, 4.4811905495016422, 4.3381402415994312, -2.7971537793896193], [-4.4038415832617392, -3.1623564563667173, -1.5827116510546779, -2.8064602295652152, -2.3716449472310375]], [[3.0142599834189969, 0.92965454723651852, 4.9662784231985011, -4.5248765508974262, -4.4107612939186414], [3.8218987186865174, -2.4757181085004132, -2.4505038129456382, 0.45081122737500401, 2.7887933056387109], [-0.76242716452737547, 3.8914778065214968, -3.6701150556343007, -4.9509721357976773, 2.9447678346920423], [-1.1526794544718633, -2.2964257892460074, 4.1725287032470977, -2.9584361808341928, -2.8880253583243554]], [[-1.9349349957858242, 0.96931594008982547, 0.61593356451131598, -2.032249630267863, 1.8002365435200662], [2.1874765293503255, 0.10871728756739429, 0.41668722021961635, -3.3068234224534434, -0.82855625829458468], [-0.38199036073580217, 4.0791909041544159, -1.3928257830937252, 4.6142340581995178, 2.4346047890233971], [4.2923752739348018, -2.2488654097596203, -1.2777441955427973, -4.6398939297591664, -4.9317629321173717]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[1.7216923248287781, 3.3056011588746728, -4.9107430565584078, 0.8350020774984479, -5.192611956617716], [-5.1753365611941131, -4.5196834338243788, -0.35702747029747872, -2.4198271454430653, 3.729889938813221], [-0.30330464087004128, 2.6619350835634883, 0.87936265030902838, 1.4555453722651448, -5.5618613533577506], [-2.4995342679861334, -1.2182973610656376, -4.4774244575467756, 3.4244131225237009, -2.7555763311826476]], [[-7.3187115070654158, -6.8768818444654318, -8.4312627026785272, -0.056312817365000711, -6.1862048090781183], [-7.6459562316186496, -4.77061747311018, -9.0657131428818829, -6.9163426512181054, -9.3552016371199542], [-3.1913744466051943, -0.52091884026842905, -5.714861293406555, -3.3436372474882416, -3.7704259114503573], [-3.7908120381108077, -5.2040239922877838, -6.5249270295397075, -9.7598912424470967, -5.1844142513761078]], [[1.1270552447838611, 4.6173990859695522, -3.2487424084979528, -0.31125829095004409, 2.0849821615014665], [0.9365189032642105, 1.5543898391820363, -1.8177911527177786, 4.7192796041689817, 3.3455673446861685], [-0.18777559009664913, 4.2424361230686909, 4.07883373443563, 3.3788449802506442, 4.8348979977839477], [-1.9043599984955808, 1.590079067031767, 1.8479897843101929, -2.1796346590610334, -4.4366686116398739]], [[-2.2853276129621247, -0.52854460207655629, -5.0112393423855046, -7.0583999688520063, -1.4784616872266363], [-6.0109106028524764, -0.0093205333917834032, 2.0788311524018117, -7.00218020962593, 0.74918999785152218], [-3.0176911244387781, -1.3800477054339688, 0.58107124349323547, -4.8053353381943182, -3.0324873835884154], [-3.2913640827439266, -4.9733834389113412, -3.4666974419829133, -4.5592907287224964, 1.587459491587579]], [[2.5862851550976025, -1.0369429664659542, 4.8133930596770922, 1.494389107769591, 1.35639028476034], [6.818379981292253, 0.23696702415484872, 3.8995878959477857, 5.0243623884005411, 6.8766862793224686], [0.82786428163320469, 0.35721154535534527, 4.7626736184769847, 0.054763386764367539, 8.3300873091685617], [3.0261923063244947, 7.1125118430779057, 4.7801823993662751, 6.3418242723525671, 0.91396369374664177]]], [[[2.7030476196339093, -4.6360738937880566, -3.4631246251713543, 2.8136599705293017, -4.6719875055922309], [-5.3530520202976151, -4.1990154877453794, -4.8043062142097632, -5.2780869094793772, -5.9487863631198099], [2.7455353952013821, 0.26820678769809891, -6.4715577960857793, -4.6625500752476645, -6.428110520684406], [-1.7233388202974522, -1.9899009673635115, -0.25890880681062978, 0.29335068368390882, 2.4921960483804702]], [[-8.7887145409848451, -8.0967668555894292, -7.1196965170928426, -8.1112370540457004, -6.4740937306965378], [-0.4861989731142069, -5.4583470443341744, -7.2003002186649692, -2.5909903953965063, -2.8445525491507526], [-5.0922723946879493, -9.010715328542716, -3.8055615304205119, -3.1123208934574746, -5.5551299962445722], [0.63557998977033048, -7.1401686252434722, -0.13025664684482141, -7.4643535917470993, -2.5678510416317115]], [[4.732554448356086, 6.4976691029927638, -0.091404232648708117, -0.50288807509524691, -0.8337388913180197], [-1.9137625796708644, 0.27763271452184046, 4.1006564975711894, -1.37555441377721, 0.15128112666304361], [4.729979222620794, 2.8274456914546642, 6.1797901777003945, 6.6948115197066107, 6.1041288582365629], [1.0596973627643562, 3.7562444746485184, 0.46381031888667934, -0.97030283192088929, -0.11056406595940516]], [[2.6908102412267825, 2.0584120456093919, 1.3201981519924582, 5.801708445554361, 2.5959118911619745], [6.7209667718413018, 0.66045345231117558, 1.4395015440925247, 1.7439138372688108, 3.529725098046737], [4.749443297138229, 3.7766485832007834, 7.2401096883421161, 0.4735748286464565, 1.6981728390249979], [7.3213419262650259, 6.0325153024724871, 0.83749361425432145, 6.2296845816555431, 3.8122780483143526]], [[2.4680766614823924, 3.7175186683137245, -2.7670596212506795, -2.9526912607408664, -5.3676085023178004], [-5.2930506891416078, -0.037862874151793235, 0.093938961575502411, -2.368440938232931, -0.5723393102505927], [-4.15952173582005, -4.4090622958359127, -4.2122086734538504, 2.8908999012955476, -0.27203613190226683], [3.3525869791438812, -0.70285568166829826, 0.15959740537997646, 1.5069901771895058, -1.1242746151483587]]], [[[5.3038290837750903, 6.7655878120741724, -0.91282580493034837, 3.9676023373122984, 0.011289811481227652], [0.44275697816873905, 7.2513109793425405, 5.453680868465665, 3.5989985102121711, 3.5635251909290604], [2.9541373098374226, -1.2577231566373159, -1.3839670437470852, 5.0284725229828036, 7.1259291008493344], [6.2858160335185227, 6.4008518949276754, 2.8715219455348029, 4.1374234713124602, 2.68032430584769]], [[3.7017386235834078, -2.7107353096180087, -2.075756123206701, -1.9430716195435305, 3.8552992492043874], [2.8432497862430193, -4.9097216027266066, -4.9657509631478245, -3.6363167337635871, -2.5091912220359323], [-0.77527743794532089, 2.3107477793487821, -5.1993782427539781, -5.4430681750120993, -5.2212997078614629], [0.16965257166275016, -5.2967643309027963, -5.1286017076702404, -0.9821583050836038, 0.49193163184072652]], [[-4.7315003226758048, -0.75377173520420815, -0.13987584691473653, -6.4208502297919861, -6.7966287738714222], [-2.6017332143074912, -5.2117592507093793, -3.4750280024711984, -1.2034472968817402, -1.5935303663060303], [-4.9582586596983784, -5.0394744609745308, -0.96243445288448815, -4.0563902404184935, -1.5707867674055533], [1.3128805013854281, -5.9528165055140274, -4.4999417814807616, -1.4440219421073053, 1.0080096729369528]], [[2.3022973731860299, 6.4977126875690416, 1.1035064815809728, 8.2110429611373252, 0.23024205853746782], [6.1176594770381678, 7.0248011914974349, 4.673238883203723, 6.6617906248601191, 7.817904469313973], [3.8720395005249841, 2.3056897178981841, 1.3362294468770868, 4.5547306531126033, 3.3430807219160057], [6.3324990744518432, 7.088338319720366, 2.1243346534845156, -0.6192030616930726, 1.5914133425941892]], [[-3.009707734140048, -3.8035485605001216, -2.9713771431180471, -5.1454049719403603, 1.0798806357505888], [-3.1673300954344916, -6.0379466932119765, -4.8157801006867711, 1.4640234352610437, -5.953175542187811], [1.4167793616773747, -0.82080287677103536, 0.68183775325247575, -3.6767427198581246, -2.2725650885535189], [-4.1037635467253022, -0.75032770031166196, 2.0659630254593391, -4.2519158172157727, 1.9457333611784953]]], [[[2.0571767711755404, 3.7319897915337661, -3.4243031558418244, -0.69758942357267095, -5.1360777265537534], [-1.4835725313007426, -4.1862857727783283, 3.5263218270154466, -3.8492129584161492, -1.8260636900234672], [3.1051547600852123, 2.3768101054576816, -0.092713203346145079, 2.3385391025092472, 0.16894511180684813], [-0.62988986790013524, 3.3246805594924416, -3.627015436144355, -5.0584206349454561, -3.5191418154688323]], [[-3.2166842222308256, 2.6034142836887408, -0.63395144539392678, -4.8485545624811843, 2.3713991970084169], [-6.1458688710394789, -2.1979312163784037, -3.9727499513473612, 0.68615097929839486, -1.6857114351629363], [-4.2129043169251013, 2.4639725063944358, 3.4078780700157179, -2.110411178262507, 1.187121743441188], [-4.3901934659591788, -1.3154742873152276, -6.1934364914993925, 1.2702496828511451, -1.1514575311729107]], [[0.68341301203285099, 2.8137718329157657, -4.4982710328385496, 1.0010227840151842, -3.4098765690627975], [0.91005037746268158, -0.24426219181139608, 0.0033623269235816267, -0.70200214346726586, -3.2057895034276251], [-3.2732396203305734, -1.5527387605544947, 4.7840045556900801, 4.6409542477878691, -2.4943397732011814], [-4.1010275770733013, -2.8595424501782793, -1.27989764486624, -2.5036462233767773, -2.0688309410425996]], [[-0.27895930957597059, -2.363564745758449, 1.6730591302035336, -7.8180958438923938, -7.7039805869136089], [0.52867942569154991, -5.7689374014953803, -5.7437231059406058, -2.8424080656199635, -0.50442598735625666], [-4.055646457522343, 0.59825851352652926, -6.9633343486292683, -8.2441914287926448, -0.34845145830292523], [-4.4458987474668312, -5.5896450822409749, 0.87930941025213016, -6.2516554738291603, -6.1812446513193233]], [[-6.344441541573957, -3.4401906056983078, -3.7935729812768173, -6.4417561760559963, -2.609270002268067], [-2.2220300164378077, -4.300789258220739, -3.9928193255685169, -7.7163299682415767, -5.238062804082718], [-4.7914969065239355, -0.33031564163371741, -5.8023323288818585, 0.20472751241138454, -1.9749017567647362], [-0.1171312718533315, -6.6583719555477536, -5.6872507413309306, -9.0494004755472996, -9.3412694779055059]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_constData_rank3(self):  
       arg0=Data(numpy.array([[[-3.9680332630804527, -1.2485343614520037], [2.8517544931675722, -2.4145010521873109]], [[1.6336300233618068, -0.57383267508517122], [0.92454530530968615, -1.9971184261253869]], [[0.9708965338441331, 0.62434821608296431], [-1.6107401479994032, 4.6865540792218709]], [[-4.5671624458684068, 2.8641254866605204], [3.4426059768942281, -4.6973649898604712]], [[3.7097216056290705, 4.8028529380777361], [3.0423175949895978, 0.74130152679527139]], [[1.9834007722289506, -0.7460511005782724], [0.57691219936794358, -0.29060054777219868]]]),self.functionspace)  
       arg1=Data(numpy.array([[[-3.7692764133737544, -3.438832582164105], [-4.3264432497535044, 3.3119277926202155]], [[-3.1189099396535616, -3.1780923878495226], [3.7022558842819411, -3.5447709793948521]], [[4.1409915998582605, 4.4042545622567655], [3.4092701218443917, -1.4695577318215349]], [[-0.93954316739612587, -2.5991638395584147], [3.48043368803779, -1.9968652923457553]], [[-0.91554553914499603, 1.2905708750478073], [-0.30517746990303074, -3.6511793348658905]], [[1.8371004554183523, -1.9718295508763086], [-1.7700190461390717, -1.3130957974969535]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[-7.7373096764542071, -4.6873669436161087], [-1.4746887565859321, 0.8974267404329046]], [[-1.4852799162917547, -3.7519250629346939], [4.6268011895916272, -5.541889405520239]], [[5.1118881337023936, 5.0286027783397298], [1.7985299738449885, 3.216996347400336]], [[-5.5067056132645327, 0.26496164710210568], [6.9230396649320181, -6.6942302822062265]], [[2.7941760664840745, 6.0934238131255434], [2.737140125086567, -2.9098778080706191]], [[3.8205012276473029, -2.717880651454581], [-1.1931068467711281, -1.6036963452691522]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_constData_rank3(self):  
       arg0=Data(numpy.array([[[[2.6825074184223823, -3.0157462900311871], [-2.8454903494271511, -2.517386331074225]], [[4.2527421348024941, 2.2228604456200305], [-3.4793534756338595, 2.2032572280626344]]], [[[-3.4097003149047467, 0.27337836441595176], [-3.2404704835409315, -2.4197675003761243]], [[-2.5236803427603438, 4.6379917789100649], [-3.5617600312080642, 3.4200890236071491]]], [[[-3.8362676469468315, -4.0784822260953977], [0.66757475629508178, -2.8517155505674099]], [[0.53239355649368925, 2.483307015539018], [4.7533550224549117, 4.7991881259082607]]], [[[0.14593140014915917, 0.088888563351343208], [4.1161914660748877, 3.1273580173351316]], [[-2.5284393064765842, -3.8441081734517155], [-2.2575520955920911, -1.3919006416117874]]], [[[-4.82929515382415, 0.032998325319702815], [2.6733567450850684, -3.952618791804301]], [[4.9022528143356716, -2.2686318406936645], [-3.3965639866430397, -2.8359856725229635]]], [[[3.3728068618592921, 3.5012617223570484], [1.2629129259444793, 4.7410732018537747]], [[-1.5610213842146403, -3.3342873576937961], [0.67890542341597637, 1.3969652323323558]]]]),self.functionspace)  
       arg1=Data(numpy.array([[[2.7688528058351469, -0.65766424887270958], [-1.6318904322806063, -1.4152138661856184]], [[-2.780458011071465, 1.5767167809656337], [2.5476624669742804, 2.4379122704803109]], [[0.75327280607937031, -1.2101480314861379], [-2.0699693033028819, 0.1861683103975551]], [[0.0027477260092965139, 1.9812269618966605], [2.7388881019783202, 0.66434965224064246]], [[1.525342179241056, 1.7413043684897769], [-0.96655441671190978, -1.0235663872769338]], [[3.5949965218149593, -0.58356772508187049], [2.3799966095826131, 2.9319998875994715]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[5.4513602242575292, -0.24689348419604018], [-3.5031545982998606, -3.1750505799469346]], [[2.6208517025218878, 0.59097001333942423], [-4.8945673418194779, 0.78804336187701596]]], [[[-6.1901583259762116, -2.5070796466555132], [-1.6637537025752978, -0.84305071941049059]], [[0.02398212421393664, 7.1856542458843453], [-1.1238477607277533, 5.85800129408746]]], [[[-3.0829948408674612, -3.3252094200160274], [-0.54257327519105614, -4.0618635820535474]], [[-1.5375757468091926, 0.41333771223613613], [4.9395233328524668, 4.9853564363058158]]], [[[0.14867912615845569, 0.091636289360639722], [6.0974184279715482, 5.1085849792317921]], [[0.21044879550173601, -1.1052200714733953], [-1.5932024433514487, -0.72755098937114493]]], [[[-3.303952974583094, 1.5583405045607588], [4.4146611135748453, -2.2113144233145241]], [[3.9356983976237618, -3.2351862574055743], [-4.4201303739199735, -3.8595520597998973]]], [[[6.9678033836742514, 7.0962582441720077], [0.67934520086260886, 4.1575054767719042]], [[0.81897522536797274, -0.95429074811118308], [3.6109053110154479, 4.3289651199318273]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_constData_rank4(self):  
       arg0=Data(numpy.array([[[-2.2723599708749864, -4.2613431270805915], [-2.2574810873126836, 3.1556428815518274]], [[0.6077149250896996, 2.5715055053322642], [-4.0857771539279328, 2.9872138903608576]], [[-0.42530217221002253, 0.40611649047273168], [-0.26115587645103666, 2.4072979756174906]], [[4.6492401037274682, -3.0987512952372995], [4.0086783960346022, 4.8410679636603788]], [[0.0089533698531347738, 1.4167295806670213], [1.6315206147386574, 1.3343787004278331]], [[1.689704356191422, -1.846829035751627], [1.4086535050733211, 1.1968904747692903]]]),self.functionspace)  
       arg1=Data(numpy.array([[[[-3.3154211527675459, 1.7228456091673632], [0.89538842748558611, -0.2837940548494462]], [[2.2051002184740334, -2.0963415657203823], [2.2352894778238666, 1.3204182076706701]]], [[[-3.8809253311347511, -4.452408079497328], [3.8361663283139205, 4.8076893456149197]], [[1.5062772597337695, -1.6200176163166926], [0.075567794005886313, -4.190760003754205]]], [[[0.95090400854861912, 0.45613720660888557], [4.6826997075424899, 2.7615982192328392]], [[-1.3681780583753467, 2.0372894657460758], [0.30703789218638278, -1.2255359502101193]]], [[[3.7928721139020922, 1.5153311335206805], [1.8634628888805516, 3.0642251123219655]], [[2.8320270878621461, -4.1746907070018233], [-2.3960611349703842, 2.3870733882857404]]], [[[3.1537245908636251, 3.7445298084777292], [4.2798581138256004, -3.6141260301868128]], [[1.0698708835436737, -0.77506526682680743], [3.7370544690260328, 2.5246341699541475]]], [[[-1.1050961293324746, 3.6938876432256382], [2.8377428557101334, -0.031094142238678124]], [[0.0086073429928781309, 3.9232125603177153], [0.33252920072858494, -0.066404310491892993]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-5.5877811236425323, -0.54951436170762324], [-3.3659546995950054, -4.5451371819300377]], [[-0.05238086883865023, -4.3538226530330659], [5.3909323593756939, 4.4760610892224975]]], [[[-3.2732104060450515, -3.8446931544076284], [6.4076718336461846, 7.3791948509471839]], [[-2.5794998941941634, -5.7057947702446254], [3.0627816843667439, -1.2035461133933474]]], [[[0.52560183633859658, 0.030835034398863037], [5.0888161980152216, 3.1677147097055709]], [[-1.6293339348263833, 1.7761335892950392], [2.7143358678038734, 1.1817620254073713]]], [[[8.4421122176295604, 6.1645712372481487], [-1.235288406356748, -0.034526182915334047]], [[6.8407054838967483, -0.16601231096722113], [2.4450068286899946, 7.2281413519461193]]], [[[3.1626779607167599, 3.753483178330864], [5.6965876944926217, -2.1973964495197915]], [[2.701391498282331, 0.85645534791184996], [5.0714331694538659, 3.8590128703819806]]], [[[0.58460822685894742, 5.3835919994170602], [0.99091381995850636, -1.8779231779903052]], [[1.4172608480661992, 5.3318660653910364], [1.5294196754978753, 1.1304861642773973]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_constData_rank4(self):  
       arg0=Data(numpy.array([[[[-0.18900486011293438, 3.5051205998454833, -2.3665317560023871, -1.9877279666163608], [-1.3314190755777524, -0.78410763139626205, 3.7224857326170184, -1.4604085607170472], [1.7179883058514314, -1.1618244243885387, -1.61982037717042, 0.79638926206268046]], [[-1.8205499673306669, -2.4520364941311081, -3.6831284099031283, 0.93089158267828509], [3.9769205046672091, 3.4476169249358897, 1.4847750829480555, 0.14575112002029211], [-3.5590851304584428, 0.043879438094119649, -2.7755781552266079, -3.313156602765023]]], [[[-1.1583013392858641, -3.2038429092406409, -2.7953468091469444, 2.329088965766303], [2.4911085752436772, -2.8666411395339719, 2.1940184434471801, -4.5685570237453996], [-2.7004484464461429, 0.55004174389856431, 0.64045224639739118, -1.0501669938935967]], [[-2.0034727722237609, -4.1176582341777559, -1.9040645647993881, 2.9488079170042614], [3.7029139395536337, 1.3727989652370711, 4.5625430386861883, 2.065216274058125], [-0.36651079453525615, 4.0385559984800032, 2.3646661729072243, -2.1433904510578285]]], [[[3.4247436971243186, -4.8861996915611714, 3.5550238018793738, -0.90555034261471157], [-3.1137889734429458, -4.1845532595067532, 1.0728359452185918, 3.1006240634498781], [-1.1853704023834402, 1.4494267033365738, -2.3248122923890389, -0.88742162200548957]], [[-2.3117799715215579, -2.0823351463836115, 0.0038152630643049079, -2.8717110478630223], [0.36906071975967425, -1.0749563905308515, -0.5447207830429317, -4.6961022668789143], [1.0214821515140704, -3.4229847461361973, 0.69864243637614187, -2.0392152464047673]]]]),self.functionspace)  
       arg1=Data(numpy.array([[[[-3.5652452186040007, -4.0830850205911959, 3.7961733887869631, 4.8971760050636917], [-4.3159312428542185, 2.6367803186145728, 0.85017213134359437, 2.0183603441217119], [-0.68203105048388668, -4.5609596389478284, -2.1906837723079331, -2.5194366329356068]], [[-1.5911855418882945, -0.58316677642110815, 1.7979331916075934, -3.5081684238373745], [-1.33012294517179, -4.3545285329540429, -4.8593050597315859, -1.008532530509779], [-3.5689679792968221, -3.4941949812022322, 4.3163173339981853, -4.5588200095161593]]], [[[1.6095479434305524, 1.9548813413225643, -0.99269102320892788, 2.9016743863621217], [3.7032130908872123, 4.2624276411722537, -4.240103138484967, 1.424007137682346], [-0.9402847644456731, 2.7939904772678563, -1.6505593098436822, 1.707432302305901]], [[-4.8797470909384542, 4.2554500994680389, -3.1170340061686028, 2.6264074296601354], [-0.41293529296971698, 0.97680549651253656, 4.8961259018085421, -3.5913934137355707], [0.31009539138460518, 1.2139474396677059, 4.6105788044448701, -0.41488794945627205]]], [[[-3.4148222180747814, -2.7934679104141513, -2.2220965044295591, -0.38191170011071751], [-2.2328478684463891, -2.928337335707385, -1.8841221588904555, 1.4774922011945577], [-2.3158827282417405, -0.95289615594278132, -0.71656886191542135, 4.6215975971208838]], [[-2.4197542293103655, -0.64820175295205651, -4.148349705376396, -3.230931179386519], [4.9728993132407346, -3.44399640159059, -1.8898661555816831, -1.7393681012689735], [2.120102975153797, 0.69474579714023132, -3.352732261210539, 0.66238822032283284]]]]),self.functionspace)  
       res=add(arg0,arg1)  
       ref=Data(numpy.array([[[[-3.7542500787169351, -0.57796442074571264, 1.429641632784576, 2.9094480384473309], [-5.6473503184319709, 1.8526726872183108, 4.5726578639606128, 0.55795178340466478], [1.0359572553675447, -5.7227840633363671, -3.8105041494783531, -1.7230473708729264]], [[-3.4117355092189614, -3.0352032705522163, -1.8851952182955349, -2.5772768411590894], [2.6467975594954192, -0.90691160801815318, -3.3745299767835304, -0.86278141048948687], [-7.1280531097552648, -3.4503155431081125, 1.5407391787715774, -7.8719766122811823]]], [[[0.45124660414468831, -1.2489615679180766, -3.7880378323558723, 5.2307633521284247], [6.1943216661308895, 1.3957865016382818, -2.0460846950377869, -3.1445498860630536], [-3.640733210891816, 3.3440322211664206, -1.010107063446291, 0.65726530841230435]], [[-6.883219863162215, 0.13779186529028298, -5.0210985709679914, 5.5752153466643968], [3.2899786465839167, 2.3496044617496077, 9.4586689404947304, -1.5261771396774457], [-0.056415403150650967, 5.2525034381477091, 6.9752449773520944, -2.5582784005141006]]], [[[0.0099214790495372185, -7.6796676019753232, 1.3329272974498148, -1.2874620427254291], [-5.3466368418893353, -7.1128905952141377, -0.81128621367186371, 4.5781162646444358], [-3.5012531306251806, 0.49653054739379243, -3.0413811543044602, 3.7341759751153942]], [[-4.7315342008319234, -2.730536899335668, -4.1445344423120911, -6.1026422272495413], [5.3419600330004089, -4.518952792121441, -2.4345869386246148, -6.4354703681478878], [3.1415851266678674, -2.728238948995966, -2.6540898248343971, -1.3768270260819344]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_expandedData_rank0(self):  
       arg0=Data(-0.451776787022,self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-4.96078854564)+(1.-msk_arg1)*(1.70956953022)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*(-5.41256533266)+(1.-msk_ref)*(1.2577927432)  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_expandedData_rank0(self):  
       arg0=Data(numpy.array([1.9555630648437621, -3.2249859024626515]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(3.13052028704)+(1.-msk_arg1)*(1.14803753784)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([5.0860833518787718, -0.094465615427641758])+(1.-msk_ref)*numpy.array([3.1036006026835139, -2.0769483646228997])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_expandedData_rank1(self):  
       arg0=Data(-3.96044087015,self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([4.2984367334696163, 3.6190852378059226])+(1.-msk_arg1)*numpy.array([0.89827816647682113, -1.3906353778124467])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([0.33799586332112597, -0.34135563234256772])+(1.-msk_ref)*numpy.array([-3.0621627036716692, -5.3510762479609371])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_expandedData_rank0(self):  
       arg0=Data(numpy.array([[-4.5310047516305554, 3.7515460562109144, -4.2323827824999327, 0.30132212847309425, -2.670490672932412], [-0.40913386129173634, 1.8833967151441708, 1.2746569384179205, -1.4014413002853088, 2.1764246971634682], [4.3830263611207787, 3.3385727384441584, 2.7734524640624105, -2.8559216965993284, -4.4878405988670895], [3.0031577208462608, -1.7085845437004887, -0.03643431346888093, -0.73677701520750816, 4.3232630744323846]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(1.72400476769)+(1.-msk_arg1)*(-3.29800426409)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[-2.8069999839445279, 5.4755508238969419, -2.5083780148139052, 2.0253268961591218, -0.94648590524638454], [1.3148709063942912, 3.6074014828301983, 2.998661706103948, 0.32256346740071873, 3.9004294648494957], [6.1070311288068062, 5.0625775061301859, 4.497457231748438, -1.1319169289133009, -2.763835831181062], [4.7271624885322883, 0.015420223985538772, 1.6875704542171466, 0.98722775247851935, 6.0472678421184121]])+(1.-msk_ref)*numpy.array([[-7.8290090157189525, 0.45354179212251777, -7.5303870465883289, -2.9966821356153024, -5.9684949370208091], [-3.707138125380133, -1.4146075489442258, -2.0233473256704761, -4.6994455643737059, -1.1215795669249284], [1.0850220970323821, 0.040568474355761719, -0.52455180002598611, -6.153925960687725, -7.7858448629554857], [-0.29484654324213588, -5.0065888077888854, -3.3344385775572776, -4.0347812792959044, 1.0252588103439879]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_expandedData_rank2(self):  
       arg0=Data(2.26906278137,self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[3.8232535555521547, 3.7424594098872923, 3.8573198153508379, 1.5311105182557725, 1.9911345273872794], [4.1557910980765964, -0.81347233295562571, -4.4178214020746314, 1.2456211769588377, -0.22486552409758431], [-3.118504714357023, -4.3577823763867674, -4.4156663396951785, 3.3159403785831216, -2.2841625677417401], [1.9470304127781626, -0.057370199782358355, 3.0528927197366187, 0.7650108448021502, -3.4673328675115189]])+(1.-msk_arg1)*numpy.array([[1.6948805056484417, 2.7284358484814675, -1.5204131252236373, 4.4890755940426157, 2.8668580160850663], [3.5938943599175168, 4.9348600026174338, 4.5975336890663669, 0.45006989166663836, 4.6568401336398644], [-1.541036343313078, 4.5884783989788005, -0.39469955051333727, -2.6280355972649194, -3.9294049024644471], [0.43192581753708126, -1.9263123882624411, -3.1408470411303293, -1.8406327472048556, -4.8145064922329066]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[6.0923163369228446, 6.0115221912579822, 6.1263825967215277, 3.8001732996264623, 4.2601973087579692], [6.4248538794472863, 1.4555904484150641, -2.1487586207039415, 3.5146839583295275, 2.0441972572731055], [-0.84944193298633319, -2.0887195950160775, -2.1466035583244887, 5.5850031599538115, -0.01509978637105025], [4.2160931941488524, 2.2116925815883315, 5.3219555011073085, 3.03407362617284, -1.1982700861408291]])+(1.-msk_ref)*numpy.array([[3.9639432870191316, 4.9974986298521573, 0.74864965614705259, 6.7581383754133055, 5.1359207974557561], [5.8629571412882067, 7.2039227839881237, 6.8665964704370568, 2.7191326730373282, 6.9259029150105542], [0.7280264380576118, 6.8575411803494903, 1.8743632308573526, -0.35897281589422958, -1.6603421210937572], [2.7009885989077711, 0.34275039310824873, -0.87178425975963947, 0.42843003416583425, -2.5454437108622168]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_expandedData_rank0(self):  
       arg0=Data(numpy.array([[[-2.930290660204653, -0.48655137804373183], [-0.39068047272594963, -0.39207940842227451]], [[0.83692578357283853, -4.2738070576671383], [2.0051973033495525, 3.2336724425395627]], [[1.9793853315447318, -4.0861229491394333], [2.7194962720690876, -2.196650454292369]], [[4.2005299438629358, -1.3006253862553354], [-2.1150812322174293, -2.0035354665174698]], [[1.9531576344551151, -1.1617647986077451], [-4.1504729498977389, 1.9100667217339726]], [[-0.94877919512908004, -2.640532289504105], [2.5154864806493924, -4.1996201363458283]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(2.25429239274)+(1.-msk_arg1)*(2.2340153796)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-0.67599826746626146, 1.7677410146946597], [1.8636119200124419, 1.862212984316117]], [[3.0912181763112301, -2.0195146649287468], [4.259489696087944, 5.4879648352779542]], [[4.2336777242831234, -1.8318305564010418], [4.9737886648074792, 0.0576419384460225]], [[6.4548223366013273, 0.95366700648305613], [0.13921116052096227, 0.25075692622092172]], [[4.2074500271935067, 1.0925275941306465], [-1.8961805571593473, 4.1643591144723642]], [[1.3055131976093115, -0.38623989676571346], [4.7697788733877839, -1.9453277436074368]]])+(1.-msk_ref)*numpy.array([[[-0.69627528060186794, 1.7474640015590532], [1.8433349068768354, 1.8419359711805106]], [[3.0709411631756236, -2.0397916780643532], [4.2392126829523376, 5.4676878221423477]], [[4.2134007111475169, -1.8521075695366482], [4.9535116516718727, 0.037364925310416019]], [[6.4345453234657208, 0.93338999334744965], [0.11893414738535579, 0.23047991308531524]], [[4.1871730140579002, 1.07225058099504], [-1.9164575702949538, 4.1440821013367577]], [[1.285236184473705, -0.40651690990131994], [4.7495018602521775, -1.9656047567430432]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_expandedData_rank3(self):  
       arg0=Data(4.02536028787,self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-1.5314948986680141, -0.49437473619891126], [-2.1047094631868091, -0.0022098127579370797]], [[-3.3333741303562614, 2.3662067338534589], [-2.8361110268467336, 2.3907451165171718]], [[4.839601039895955, 1.9408613064419677], [2.3384222765821105, -3.1395212220980384]], [[-0.58362627152187585, -1.8185104336381439], [0.88129497078717378, 4.2122033721277052]], [[-0.21362442430003181, -1.0751792421450954], [0.13527118171099328, 4.4120964573868484]], [[-2.4945956630506707, 4.7263072078786763], [2.9166689825985559, 2.013283610116047]]])+(1.-msk_arg1)*numpy.array([[[-3.7331277599586796, -3.4995258519736994], [0.38793447982448193, 0.29398352580243525]], [[4.329217060940481, -2.5385271533870735], [2.2724832866000781, -1.9852848411174415]], [[-0.80971108975812722, 3.5998227589311718], [-4.8756782977053987, -2.0233161283684211]], [[-1.7640291680052678, -0.95955001527843109], [1.8156562289993348, -2.8368515611362612]], [[4.4672168411732773, -4.3285368933238786], [2.6282568394211827, 0.26920387247327326]], [[0.85446555158889748, 3.6211167683752539], [-2.431396285480576, 1.241130404335296]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[2.4938653891985458, 3.5309855516676487], [1.9206508246797509, 4.0231504751086229]], [[0.69198615751029857, 6.3915670217200189], [1.1892492610198264, 6.4161054043837318]], [[8.864961327762515, 5.9662215943085277], [6.3637825644486705, 0.88583906576852156]], [[3.4417340163446841, 2.2068498542284161], [4.9066552586537338, 8.2375636599942652]], [[3.8117358635665282, 2.9501810457214646], [4.1606314695775533, 8.4374567452534084]], [[1.5307646248158893, 8.7516674957452363], [6.9420292704651159, 6.0386438979826069]]])+(1.-msk_ref)*numpy.array([[[0.29223252790788035, 0.52583443589286061], [4.4132947676910419, 4.3193438136689952]], [[8.3545773488070409, 1.4868331344794865], [6.2978435744666381, 2.0400754467491184]], [[3.2156491981084327, 7.6251830467977317], [-0.85031800983883876, 2.0020441594981389]], [[2.2613311198612922, 3.0658102725881289], [5.8410165168658947, 1.1885087267302987]], [[8.4925771290398373, -0.30317660545731862], [6.6536171272877427, 4.2945641603398332]], [[4.8798258394554574, 7.6464770562418138], [1.593964002385984, 5.2664906922018559]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_expandedData_rank0(self):  
       arg0=Data(numpy.array([[[[-1.8081102459147615, 1.4169695807085834, -2.9645942113266708, -2.3294748414293274], [2.7735480744811909, -3.9058454979582189, 2.3226242643185664, 4.5359163572994561], [-0.17442063632607141, 2.8177903053666657, -4.9217808370455938, -0.43652983019232039]], [[4.8865356889101648, 3.13145192590747, -0.45513914770353381, 2.1709158448528765], [-1.9899313103031355, 1.7980050621915318, -2.9405655207226413, 1.8732240212545568], [2.6902440941304215, -1.7663048638546606, 1.108047737694581, -3.6643558743188342]]], [[[-0.81741182604882745, -3.6083253400912465, -2.0171916215717891, 3.9245230485673979], [-1.2381317287384954, 4.6709035409240851, -0.34295773722119005, -4.0645180031161301], [0.31396060956700023, 4.5676451355602623, 4.8074976829744749, -3.2718981934902294]], [[0.63799590866927236, 4.178635002427681, -0.54332910047796279, 1.2288012270194795], [-3.0234857783165658, -0.48299290514749327, 0.042626872818264161, 4.562854827163866], [2.0287828988529064, -4.9628389663356653, 4.5597708522033891, -2.1496649465505513]]], [[[-0.90814282121353962, -4.8510374471624784, -1.4669688459928878, -1.4754653302266152], [-3.1250645738223537, 4.1343334242546828, 2.0616451419449415, 4.6027950860849849], [-1.7953487634796241, -4.161000887031391, -1.8522501013299983, 1.4554300553616271]], [[3.697510529953945, 3.1467350490869688, -4.8740286387568315, -4.6603805254519592], [1.6992446071101988, -1.701737477176045, -4.1479703736600761, -3.6377802591709552], [-4.5639822402489036, 2.7191039849803325, 0.68720121943543599, -2.2263152325026105]]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*(-0.864999420079)+(1.-msk_arg1)*(-4.29068662691)  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-2.6731096659936497, 0.55197016062969517, -3.829593631405559, -3.1944742615082156], [1.9085486544023027, -4.7708449180371071, 1.4576248442396782, 3.6709169372205679], [-1.0394200564049596, 1.9527908852877776, -5.786780257124482, -1.3015292502712086]], [[4.0215362688312766, 2.2664525058285818, -1.320138567782422, 1.3059164247739883], [-2.8549307303820237, 0.93300564211264359, -3.8055649408015295, 1.0082246011756686], [1.8252446740515333, -2.6313042839335488, 0.24304831761569279, -4.5293552943977229]]], [[[-1.6824112461277156, -4.4733247601701347, -2.8821910416506773, 3.0595236284885097], [-2.1031311488173836, 3.8059041208451969, -1.2079571573000782, -4.9295174231950183], [-0.55103881051188797, 3.7026457154813741, 3.9424982628955867, -4.1368976135691176]], [[-0.22700351140961583, 3.3136355823487929, -1.408328520556851, 0.36380180694059128], [-3.888485198395454, -1.3479923252263815, -0.82237254726062403, 3.6978554070849778], [1.1637834787740182, -5.8278383864145535, 3.6947714321245009, -3.0146643666294395]]], [[[-1.7731422412924278, -5.7160368672413666, -2.331968266071776, -2.3404647503055034], [-3.9900639939012419, 3.2693340041757946, 1.1966457218660533, 3.7377956660060967], [-2.6603481835585123, -5.0260003071102792, -2.7172495214088865, 0.59043063528273887]], [[2.8325111098750568, 2.2817356290080806, -5.7390280588357196, -5.5253799455308474], [0.83424518703131056, -2.5667368972549331, -5.0129697937389643, -4.5027796792498433], [-5.4289816603277918, 1.8541045649014443, -0.1777982006434522, -3.0913146525814987]]]])+(1.-msk_ref)*numpy.array([[[[-6.0987968728202571, -2.8737170461969122, -7.2552808382321663, -6.6201614683348229], [-1.5171385524243046, -8.1965321248637153, -1.9680623625869291, 0.24522973039396057], [-4.4651072632315669, -1.4728963215388298, -9.2124674639510893, -4.7272164570978159]], [[0.59584906200466925, -1.1592347009980255, -4.7458257746090293, -2.119770782052619], [-6.280617937208631, -2.4926815647139637, -7.2312521476281368, -2.4174626056509387], [-1.600442532775074, -6.0569914907601561, -3.1826388892109145, -7.9550425012243302]]], [[[-5.108098452954323, -7.899011966996742, -6.3078782484772846, -0.36616357833809765], [-5.5288183556439909, 0.38021691401858959, -4.6336443641266856, -8.3552046300216247], [-3.9767260173384953, 0.27695850865476679, 0.51681105606897937, -7.5625848203957249]], [[-3.6526907182362232, -0.11205162447781447, -4.8340157273834583, -3.061885399886016], [-7.3141724052220614, -4.7736795320529888, -4.2480597540872314, 0.27216820025837052], [-2.2619037280525891, -9.2535255932411609, 0.26908422529789355, -6.4403515734560468]]], [[[-5.1988294481190351, -9.141724074067973, -5.7576554728983833, -5.7661519571321111], [-7.4157512007278488, -0.15635320265081276, -2.229041484960554, 0.31210845917948937], [-6.0860353903851196, -8.4516875139368857, -6.1429367282354939, -2.8352565715438685]], [[-0.59317609695155049, -1.1439515778185267, -9.164715265662327, -8.9510671523574548], [-2.5914420197952968, -5.9924241040815405, -8.4386570005655717, -7.9284668860764507], [-8.8546688671543983, -1.5715826419251631, -3.6034854074700595, -6.5170018594081061]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_expandedData_rank4(self):  
       arg0=Data(0.415968380946,self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[1.9964026660550802, -1.2022763821935314, 1.545946841641296, 3.8122491184020291], [3.2149717525039971, 2.1196386310086126, 0.98289658780072475, -3.4559431647536076], [1.7157176943432226, -0.66122615198877721, 3.8022856664539422, -3.5174852693756264]], [[2.5293460436501096, -3.4655420173723006, 1.9851632694614594, 0.20781744440155592], [3.4680347478770237, 2.4516896969838511, 1.6601943818676537, -4.7945969199913936], [-1.7333507460988553, -1.1400482422571545, -4.6017950241425067, 1.0300125286472035]]], [[[-3.0659746747983418, 3.4989669224003901, -1.0507461565034326, -3.7038317807458254], [-1.2869029047441338, -0.89469225970853739, 4.1405040965090674, -0.94718236382694876], [1.4772349468377124, 4.578751221081383, 1.4109854462924041, 4.0618672614760989]], [[-2.9359066927930666, -2.0491850439033565, -2.0852899693679872, 3.1594313265598242], [1.9205641925346413, 0.6584080965725061, -2.7621978826946325, 1.2129580095349741], [-1.1820958426193364, 0.049217224264106463, 4.1826407196243327, 3.8330108984719597]]], [[[0.78472962467066765, 0.53542958900314019, -2.2076587650436954, -4.7520601953064725], [-3.0657725623014009, -2.0124762735748005, -4.8714470422287368, 2.7031042190986021], [-3.258938383196984, 3.185967368791502, -4.0481100832481687, -4.2030532605314983]], [[-4.2884201699701707, 2.3351805122475122, 2.6087190850434947, 4.599365625378887], [0.020766454726183881, 1.1359029456929504, -4.7009987865137512, -4.9794648846702128], [4.6822913249284639, -3.3116932851939893, 4.7317567030701984, 2.6254308810497475]]]])+(1.-msk_arg1)*numpy.array([[[[-1.3137937672133395, -3.2324297199922238, -4.4471528972116934, 4.5341764966635143], [-0.18754144217855462, 4.5591600668637646, -4.3014023812432995, -0.98879941636628832], [-3.3993859166083009, 1.2633488831698294, 3.6579652717762094, -0.68480213827680991]], [[-2.4568311118250366, 2.9207816161706379, 1.161356465287648, 3.5338437496319255], [1.0501351261863778, -2.8633448814279694, -3.2215357471569717, 2.8462985569607007], [-4.277275926983549, -0.81725857082627762, 1.8744790794634181, -1.1140725006434216]]], [[[1.8189647232816455, -2.9847698247307064, 4.6173104884199176, 0.7317013739431335], [-0.48711006594614226, -2.7607059017846836, 0.90391469350081444, -1.2570788617925821], [-4.8349601646450413, -3.8221826283572922, -2.9386399840069579, 1.1719042725156505]], [[-2.7744162008348958, 4.0110398745871532, -2.7008906644472495, 0.76092781345011407], [4.6213311965499528, -2.3918389804425253, -4.6282061843973841, 1.6592633889294532], [-0.18043959258599696, -2.2509001761785195, 0.95235379931659914, -2.0142097235351084]]], [[[-1.9056591515355583, 3.0516395110536081, 3.1217461614967199, -2.1175028587404423], [-2.305285182928726, 0.059210007683994981, -2.9351869183181845, 4.046020449147651], [-2.0088796896123293, 3.3591822589807254, -3.6942653889874331, 1.5385671989961045]], [[2.628324515126927, 4.7873650889026305, 0.61612930036002744, -1.4650827757393223], [4.1659955089672067, 1.2828055319888652, -4.0252742250597677, 4.1898126797223689], [3.5162503415337003, 0.24173200359571823, -3.0214765856999737, 3.5623920797706852]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[2.4123710470012023, -0.78630800124740929, 1.9619152225874181, 4.2282174993481512], [3.6309401334501192, 2.5356070119547347, 1.3988649687468468, -3.0399747838074855], [2.1316860752893447, -0.24525777104265511, 4.2182540474000643, -3.1015168884295043]], [[2.9453144245962317, -3.0495736364261785, 2.4011316504075815, 0.62378582534767801], [3.8840031288231458, 2.8676580779299732, 2.0761627628137758, -4.3786285390452715], [-1.3173823651527332, -0.72407986131103241, -4.1858266431963846, 1.4459809095933256]]], [[[-2.6500062938522198, 3.9149353033465122, -0.63477777555731052, -3.2878633997997033], [-0.87093452379801173, -0.47872387876241529, 4.5564724774551895, -0.53121398288082666], [1.8932033277838345, 4.9947196020275051, 1.8269538272385262, 4.477835642422221]], [[-2.5199383118469445, -1.6332166629572344, -1.6693215884218651, 3.5753997075059463], [2.3365325734807634, 1.0743764775186282, -2.3462295017485104, 1.6289263904810962], [-0.76612746167321433, 0.46518560521022856, 4.5986091005704548, 4.2489792794180818]]], [[[1.2006980056167897, 0.95139796994926229, -1.7916903840975733, -4.3360918143603504], [-2.6498041813552788, -1.5965078926286784, -4.4554786612826147, 3.1190726000447242], [-2.8429700022508619, 3.6019357497376241, -3.6321417023020466, -3.7870848795853762]], [[-3.8724517890240486, 2.7511488931936343, 3.0246874659896168, 5.0153340063250091], [0.43673483567230598, 1.5518713266390725, -4.2850304055676292, -4.5634965037240907], [5.098259705874586, -2.8957249042478672, 5.1477250840163205, 3.0413992619958696]]]])+(1.-msk_ref)*numpy.array([[[[-0.89782538626721742, -2.8164613390461017, -4.0311845162655713, 4.9501448776096364], [0.22842693876756748, 4.9751284478098867, -3.8854340002971774, -0.57283103542016622], [-2.9834175356621788, 1.6793172641159515, 4.0739336527223315, -0.26883375733068782]], [[-2.0408627308789145, 3.33674999711676, 1.5773248462337701, 3.9498121305780476], [1.4661035071324999, -2.4473765004818473, -2.8055673662108496, 3.2622669379068228], [-3.8613075460374269, -0.40129018988015552, 2.2904474604095402, -0.69810411969729946]]], [[[2.2349331042277676, -2.5688014437845843, 5.0332788693660397, 1.1476697548892556], [-0.071141685000020161, -2.3447375208385615, 1.3198830744469365, -0.84111048084646001], [-4.4189917836989192, -3.4062142474111701, -2.5226716030608358, 1.5878726534617726]], [[-2.3584478198887737, 4.4270082555332753, -2.2849222835011274, 1.1768961943962362], [5.0372995774960749, -1.9758705994964032, -4.212237803451262, 2.0752317698755753], [0.23552878836012514, -1.8349317952323974, 1.3683221802627212, -1.5982413425889863]]], [[[-1.4896907705894362, 3.4676078919997302, 3.537714542442842, -1.7015344777943202], [-1.8893168019826039, 0.47517838863011708, -2.5192185373720624, 4.4619888300937731], [-1.5929113086662072, 3.7751506399268475, -3.278297008041311, 1.9545355799422266]], [[3.0442928960730491, 5.2033334698487526, 1.0320976813061495, -1.0491143947932002], [4.5819638899133288, 1.6987739129349873, -3.6093058441136456, 4.605781060668491], [3.9322187224798224, 0.65770038454184032, -2.6055082047538516, 3.9783604607168073]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_expandedData_rank1(self):  
       arg0=Data(numpy.array([0.84291169795825294, -4.43886052191076]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([0.39506944581459447, -2.5328861481719587])+(1.-msk_arg1)*numpy.array([-1.8223930281899623, -4.1615944648247538])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([1.2379811437728474, -6.9717466700827186])+(1.-msk_ref)*numpy.array([-0.97948133023170936, -8.6004549867355138])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_expandedData_rank1(self):  
       arg0=Data(numpy.array([[-1.6987213243826216, -4.9524820723633383], [1.9893144857688485, 2.5940532524890303]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([3.4051017881673857, -2.1982345723526207])+(1.-msk_arg1)*numpy.array([4.7932974309830918, 3.8198296520449055])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[1.7063804637847642, -1.5473802841959525], [-0.20892008658377215, 0.39581868013640964]])+(1.-msk_ref)*numpy.array([[3.0945761066004702, -0.15918464138024646], [5.809144137813754, 6.4138829045339358]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_expandedData_rank2(self):  
       arg0=Data(numpy.array([4.962257964796553, 1.8211444989744496]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[4.1594481475735243, -0.76599838133660114], [-3.7516120261471295, -2.0819476755349631]])+(1.-msk_arg1)*numpy.array([[1.9888409152530615, 2.9111132485764113], [3.9184272791769494, -4.5265147600015823]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[9.1217061123700773, 4.1962595834599519], [-1.9304675271726799, -0.26080317656051344]])+(1.-msk_ref)*numpy.array([[6.9510988800496145, 7.8733712133729643], [5.7395717781513991, -2.7053702610271326]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_expandedData_rank1(self):  
       arg0=Data(numpy.array([[[2.2248625691681854, 2.6877904582958392, 2.5532324552806287, 4.2614710362223125, -0.89130093345420658], [3.2394361162783465, 0.34661650658164866, -0.62647144597096993, 0.73635454552851876, -4.7878393843448697], [-4.4708876296400115, 2.1767301103807259, 1.9636795357681569, 3.0834871855956116, -2.2997094709207655], [3.6716585306609257, 0.65180282842876025, -3.3980909865503417, -3.7179049383459875, 1.4721365984601897]], [[-3.1203865840371114, -1.5406493347618753, 4.4743678297491218, 4.6997237442676916, -0.12171037513669969], [0.52485938641883934, 1.2179068165473241, -2.883451214910985, -0.4840224530052728, -1.616375461637547], [-0.58420498980954427, -0.018529987737986531, -4.7415278174532443, 0.43385392866445738, 2.9038039778527374], [-1.1197693042165913, -1.5699430596887289, -2.9769596310539779, 4.7703123480346257, -4.8217082003296952]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([-4.9378130968959173, -2.0607483634174573])+(1.-msk_arg1)*numpy.array([1.2944351940602994, -3.5158921964958978])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-2.7129505277277319, -2.2500226386000781, -2.3845806416152886, -0.67634206067360481, -5.8291140303501239], [-1.6983769806175708, -4.5911965903142686, -5.5642845428668872, -4.2014585513673985, -9.7256524812407861], [-9.4087007265359297, -2.7610829865151914, -2.9741335611277604, -1.8543259113003057, -7.2375225678166828], [-1.2661545662349916, -4.286010268467157, -8.335904083446259, -8.6557180352419039, -3.4656764984357276]], [[-5.1811349474545683, -3.6013976981793325, 2.4136194663316646, 2.6389753808502343, -2.182458738554157], [-1.5358889769986179, -0.84284154687013313, -4.9441995783284423, -2.5447708164227301, -3.6771238250550042], [-2.6449533532270015, -2.0792783511554438, -6.8022761808707015, -1.6268944347529999, 0.8430556144352801], [-3.1805176676340485, -3.6306914231061862, -5.0377079944714351, 2.7095639846171684, -6.8824565637471524]]])+(1.-msk_ref)*numpy.array([[[3.5192977632284848, 3.9822256523561386, 3.8476676493409281, 5.5559062302826119, 0.40313426060609281], [4.5338713103386459, 1.6410517006419481, 0.66796374808932946, 2.0307897395888181, -3.4934041902845703], [-3.1764524355797121, 3.4711653044410253, 3.2581147298284563, 4.377922379655911, -1.0052742768604661], [4.9660937247212251, 1.9462380224890596, -2.1036557924900423, -2.4234697442856881, 2.7665717925204891]], [[-6.6362787805330097, -5.0565415312577731, 0.95847563325322405, 1.1838315477717938, -3.6376025716325975], [-2.9910328100770585, -2.2979853799485737, -6.3993434114068828, -3.9999146495011706, -5.1322676581334452], [-4.1000971863054421, -3.5344221842338843, -8.257420013949142, -3.0820382678314404, -0.61208821864316043], [-4.6356615007124891, -5.0858352561846267, -6.4928518275498757, 1.2544201515387279, -8.337600396825593]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_expandedData_rank3(self):  
       arg0=Data(numpy.array([-2.1935945602208395, 1.7147700303254094]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-2.2024475785390218, 2.5610222647149801, 2.3271028126393407, 2.0308415504838422, 3.8441817997061829], [-2.5061610996974046, -1.9020698204253295, 1.9174330777662618, -1.9420580898737407, -0.86052190569161802], [-4.3840328286826269, 1.6471758826374838, 3.1004282436159656, -4.4437946584435748, 2.596389227325087], [3.1942739720033249, -0.65654114237955596, 4.9826562208871863, -4.8809501002191524, 1.1346566038270254]], [[-0.56394090498475258, 4.3313845139702458, -0.52683720719014815, -3.8066937070092131, -1.0707749785726639], [-0.74642402535781827, 1.3569230252694116, 4.7829823362765431, 3.8826385013740623, -0.52752280070457847], [-2.3404340855398251, -1.2857942520984169, 2.1176657703384203, 4.623589458269544, -2.4281030265489854], [0.71386209088054819, -1.0908021391635137, -0.57779696344688602, -2.8303705237693979, 1.3138212770791382]]])+(1.-msk_arg1)*numpy.array([[[0.42525515061633268, 2.1526997460704331, -3.6765876038335419, 0.42161875114507286, -1.6244767212086595], [-1.5998466145488432, -0.090659335928614304, -3.0631481553074669, 4.2800765705908042, 2.9943852430138662], [-2.2629714183040237, -4.5796764605250431, 2.9308687826707933, 3.2691686909169508, -4.8081984182165316], [1.0807873947574889, -1.1689545216093133, 2.381918387949538, -0.80628167725222966, -4.0415194757964787]], [[-4.418129982513844, 3.0877841641543906, -2.2596726003005241, -0.39544320928664867, -3.9271357355754799], [-4.4982180120349096, 3.1570857294978971, -2.8071213764534231, -4.8360438993728199, -4.4587650888834158], [-3.6159151752016361, 1.4289622120286447, -0.18357173815825245, 2.6201257621426608, -1.985583462334668], [0.075751773046511595, -4.9394807964852436, -3.6799881196344177, -3.6014060748953867, -3.7452699067595443]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-4.3960421387598618, 0.36742770449414053, 0.13350825241850117, -0.16275300973699736, 1.6505872394853434], [-4.6997556599182442, -4.095664380646169, -0.27616148245457772, -4.1356526500945803, -3.0541164659124576], [-6.5776273889034664, -0.54641867758335572, 0.90683368339512604, -6.6373892186644143, 0.40279466710424749], [1.0006794117824853, -2.8501357026003955, 2.7890616606663468, -7.074544660439992, -1.0589379563938142]], [[1.1508291253406568, 6.0461545442956552, 1.1879328231352613, -2.0919236766838036, 0.64399505175274552], [0.96834600496759116, 3.071693055594821, 6.4977523666019525, 5.5974085316994717, 1.187247229620831], [-0.6256640552144157, 0.42897577822699251, 3.8324358006638297, 6.3383594885949535, -0.71333299622357593], [2.4286321212059576, 0.62396789116189577, 1.1369730668785234, -1.1156004934439885, 3.0285913074045476]]])+(1.-msk_ref)*numpy.array([[[-1.7683394096045069, -0.040894814150406411, -5.8701821640543814, -1.7719758090757667, -3.818071281429499], [-3.7934411747696828, -2.2842538961494538, -5.256742715528306, 2.0864820103699646, 0.80079068279302668], [-4.4565659785248632, -6.7732710207458826, 0.73727422244995378, 1.0755741306961113, -7.0017929784373711], [-1.1128071654633507, -3.3625490818301529, 0.18832382772869849, -2.9998762374730692, -6.2351140360173183]], [[-2.7033599521884346, 4.8025541944798, -0.54490256997511466, 1.3193268210387608, -2.2123657052500705], [-2.7834479817095001, 4.8718557598233065, -1.0923513461280137, -3.1212738690474104, -2.7439950585580064], [-1.9011451448762267, 3.1437322423540541, 1.531198292167157, 4.3348957924680702, -0.27081343200925856], [1.790521803371921, -3.2247107661598342, -1.9652180893090083, -1.8866360445699772, -2.0304998764341349]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_expandedData_rank1(self):  
       arg0=Data(numpy.array([[[[-2.0937165342865893, -0.33111430784524476], [-3.2729057335377556, -2.3944667335344305]], [[4.290394032135195, 3.362534346913737], [0.89317014280877061, -1.7135019951945187]], [[2.3408143470276821, -2.1813328496229047], [0.62635895108586226, -0.70579122497101299]], [[-3.6263089431982989, -3.7319859006483824], [0.95470253863147114, 4.5787412602859838]], [[-1.5944289739315529, 4.326568728402254], [1.4467586973773496, -4.0693043482991067]], [[-3.5856078971487082, 0.15921194784014325], [1.3059560626152331, 0.86038155483471623]]], [[[2.4486811529884296, 2.0418102630794079], [-4.4181043737972399, 4.2717968817782186]], [[1.0013467499913178, 0.50031365674488271], [-1.7497703046173485, 2.9788283554622863]], [[1.3964233524270657, -2.5675319638469918], [3.8396926199312915, 2.9992405158812439]], [[-0.68837010468136128, -0.7617999611827333], [4.1599915367826537, 4.4056171519334235]], [[2.7835909141195589, 4.8900774529919353], [2.790250208568084, -2.5236870318812201]], [[4.2326099877422667, 2.265859690507992], [1.7732266606085361, -1.2190739660426586]]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([2.8486151259440673, 3.3718602448727779])+(1.-msk_arg1)*numpy.array([-2.1429011085511274, -0.88583017745675097])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[0.75489859165747797, 2.5175008180988225], [-0.42429060759368831, 0.45414839240963678]], [[7.1390091580792623, 6.2111494728578043], [3.7417852687528379, 1.1351131307495486]], [[5.1894294729717494, 0.66728227632116255], [3.4749740770299296, 2.1428239009730543]], [[-0.77769381725423159, -0.88337077470431513], [3.8033176645755384, 7.4273563862300511]], [[1.2541861520125144, 7.1751838543463213], [4.2953738233214169, -1.2206892223550394]], [[-0.73699277120464091, 3.0078270737842105], [4.1545711885593004, 3.7089966807787835]]], [[[5.8205413978612075, 5.4136705079521859], [-1.0462441289244619, 7.6436571266509965]], [[4.3732069948640957, 3.8721739016176606], [1.6220899402554294, 6.3506886003350642]], [[4.7682835972998436, 0.80432828102578613], [7.2115528648040694, 6.3711007607540218]], [[2.6834901401914166, 2.6100602836900446], [7.5318517816554316, 7.7774773968062014]], [[6.1554511589923369, 8.2619376978647132], [6.1621104534408619, 0.84817321299155779]], [[7.6044702326150446, 5.6377199353807699], [5.145086905481314, 2.1527862788301193]]]])+(1.-msk_ref)*numpy.array([[[[-4.2366176428377162, -2.4740154163963721], [-5.415806842088883, -4.5373678420855583]], [[2.1474929235840676, 1.2196332383626096], [-1.2497309657423568, -3.8564031037456461]], [[0.19791323847655473, -4.3242339581740321], [-1.5165421574652651, -2.8486923335221404]], [[-5.7692100517494262, -5.8748870091995098], [-1.1881985699196562, 2.4358401517348565]], [[-3.7373300824826803, 2.1836676198511267], [-0.69614241117377773, -6.2122054568502341]], [[-5.728509005699836, -1.9836891607109841], [-0.83694504593589425, -1.2825195537164111]]], [[[1.5628509755316786, 1.155980085622657], [-5.3039345512539908, 3.3859667043214676]], [[0.11551657253456682, -0.38551652071186826], [-2.6356004820740995, 2.0929981780055353]], [[0.51059317497031476, -3.4533621413037427], [2.9538624424745406, 2.1134103384244929]], [[-1.5742002821381123, -1.6476301386394843], [3.2741613593259027, 3.5197869744766725]], [[1.897760736662808, 4.0042472755351843], [1.9044200311113331, -3.4095172093379711]], [[3.3467798102855157, 1.380029513051241], [0.8873964831517851, -2.1049041434994096]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_expandedData_rank4(self):  
       arg0=Data(numpy.array([3.5475410081497589, 1.730414418282848]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-2.0721075157890692, -4.0117248464296367], [-1.8954974523383408, 1.8885008056348855]], [[2.5766517990646758, -1.1410118499720987], [1.3933562462994118, -1.3541074214516335]], [[1.7654421727919516, 1.9099543529001757], [4.0311922822647457, -0.69623418218951905]], [[4.0578970644278982, -0.42363761257665011], [-2.2923270746673419, -4.5031789771736639]], [[3.550564350098055, 0.11910378085073692], [-3.4913406825393931, 2.9523804318336957]], [[-0.30051171273249189, 0.17743769132861686], [-2.414725365254331, -0.36801705537685869]]], [[[-4.4097829805502675, -3.8624299056883604], [-1.8790831365171536, 4.456876055629909]], [[0.40518175201934525, -0.058100792313963368], [4.2560701213859407, 2.6281815528278551]], [[4.4033686863869548, -2.9726324936983541], [3.5364063589998338, -2.4422498464932429]], [[4.0782591884424555, 2.8586186361004904], [4.5909379781073518, 0.94073183807237548]], [[3.6350241060966244, -1.0498402850976882], [4.9417356502914256, 3.5710047250219858]], [[-2.929231014907745, -2.8711479246064808], [3.4776019663301856, -4.3386628036185861]]]])+(1.-msk_arg1)*numpy.array([[[[3.063064525464366, 1.6774678918917028], [2.8468917416264024, 3.8113549341821447]], [[1.3161934867406364, -4.0379294109835397], [-2.5333593480857672, 0.22938355842376268]], [[-2.6959577778784025, 2.1479189090871103], [4.434580979102023, 0.80150088525819108]], [[0.43586748353274096, -0.28502660884471975], [4.1827752149693858, 0.64924348864483417]], [[2.6054531191529096, 3.2224786723469485], [-0.11478320770106887, 4.1108524602674503]], [[4.7109258102884262, -4.1848108224211691], [0.46152675969147161, 2.8742897634042084]]], [[[-1.450247598787584, -4.0515262795398543], [-1.8738754800846911, 1.3054770817450931]], [[-2.058422762576285, -0.10008053954813256], [0.56881461279261458, 1.6063712260871155]], [[3.1126521726395033, 0.63457379493545041], [-0.10915175736730642, -3.3879870057429882]], [[-2.2859852890217658, 1.8564061554028974], [0.79523955776231947, 2.0372328827321589]], [[4.456114288168866, 2.1089459820534469], [-4.792830770973957, -3.9951825149010931]], [[0.8232362576331127, 0.14903473512062337], [-4.3825341853884625, -2.8862044366588044]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[1.4754334923606898, -0.46418383827987775], [1.6520435558114182, 5.4360418137846445]], [[6.1241928072144347, 2.4065291581776602], [4.9408972544491707, 2.1934335866981254]], [[5.3129831809417105, 5.4574953610499346], [7.5787332904145046, 2.8513068259602399]], [[7.6054380725776571, 3.1239033955731088], [1.2552139334824171, -0.95563796902390497]], [[7.098105358247814, 3.6666447890004958], [0.056200325610365809, 6.4999214399834546]], [[3.247029295417267, 3.7249786994783758], [1.1328156428954279, 3.1795239527729002]]], [[[-2.6793685622674195, -2.1320154874055124], [-0.14866871823430561, 6.187290473912757]], [[2.1355961703021933, 1.6723136259688847], [5.9864845396687887, 4.3585959711107032]], [[6.1337831046698028, -1.2422180754155061], [5.2668207772826818, -0.71183542821039492]], [[5.8086736067253035, 4.5890330543833384], [6.3213523963901999, 2.6711462563552235]], [[5.3654385243794724, 0.6805741331851598], [6.6721500685742736, 5.3014191433048339]], [[-1.1988165966248969, -1.1407335063236328], [5.2080163846130336, -2.6082483853357381]]]])+(1.-msk_ref)*numpy.array([[[[6.610605533614125, 5.2250089000414617], [6.3944327497761613, 7.3588959423319036]], [[4.8637344948903953, -0.49038840283378082], [1.0141816600639917, 3.7769245665735216]], [[0.85158323027135641, 5.6954599172368692], [7.9821219872517819, 4.34904189340795]], [[3.9834084916824999, 3.2625143993050392], [7.7303162231191447, 4.1967844967945931]], [[6.1529941273026685, 6.7700196804967074], [3.4327578004486901, 7.6583934684172092]], [[8.2584668184381851, -0.63726981427141016], [4.0090677678412305, 6.4218307715539673]]], [[[0.28016681949526401, -2.3211118612570063], [-0.14346106180184304, 3.0358915000279412]], [[-0.32800834429343695, 1.6303338787347155], [2.2992290310754626, 3.3367856443699635]], [[4.8430665909223514, 2.3649882132182984], [1.6212626609155416, -1.6575725874601401]], [[-0.55557087073891775, 3.5868205736857455], [2.5256539760451675, 3.7676473010150069]], [[6.186528706451714, 3.8393604003362949], [-3.062416352691109, -2.2647680966182451]], [[2.5536506759159607, 1.8794491534034714], [-2.6521197671056145, -1.1557900183759564]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_expandedData_rank2(self):  
       arg0=Data(numpy.array([[4.1329057756774574, 4.0701583553914471, -1.6551918053535433, 3.5452278195057865, -0.81711703873437713], [0.43287624072826958, -2.224161939263638, 3.318494240278083, 2.9277637469060753, 2.0309132572042898], [-3.2194917465092923, 4.885155409643513, 3.8404971044297032, 3.2494234893725977, 0.92177459452624877], [-2.6891802447121291, -0.019611528316614724, 4.0610318831816805, 3.6417336913883798, -1.4599648619768413]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[1.5865765625632289, -0.40420440699923876, -0.74752541155132857, 0.49922579954561375, 1.8245279904561995], [4.6780371104690861, 4.050276637073571, 1.2066331660452327, 0.86561495119116483, -3.2975780361736975], [-2.9716682541278781, -0.66596325450460814, 3.4540699844781528, -0.88159348810738081, -4.5111687055412961], [-2.0728768436175371, -0.21180958595824606, 4.734184852158851, -4.6868091610061118, -3.1456233536711462]])+(1.-msk_arg1)*numpy.array([[-1.1785559519189492, 4.8985426939361592, -0.27508538418688389, 0.76096531801282197, 3.7263510116395455], [3.701737985231242, -0.66105774307792586, -2.6103252726723367, -1.8818964288267761, 4.3603335483809538], [0.11891487600750406, 4.8657322774255825, 3.0041213612182656, 0.011742090264823091, -3.5959686156877071], [2.1889080393294442, -4.3281723811195469, -1.1018364496368314, 1.961425633823036, -4.0620205444827837]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[5.7194823382406863, 3.6659539483922083, -2.4027172169048718, 4.0444536190514002, 1.0074109517218224], [5.1109133511973557, 1.826114697809933, 4.5251274063233158, 3.7933786980972402, -1.2666647789694077], [-6.1911600006371703, 4.2191921551389049, 7.294567088907856, 2.3678300012652169, -3.5893941110150474], [-4.7620570883296658, -0.23142111427486078, 8.7952167353405315, -1.045075469617732, -4.6055882156479875]])+(1.-msk_ref)*numpy.array([[2.9543498237585082, 8.9687010493276063, -1.9302771895404272, 4.3061931375186084, 2.9092339729051684], [4.1346142259595116, -2.8852196823415639, 0.70816896760574632, 1.0458673180792992, 6.3912468055852436], [-3.1005768705017882, 9.7508876870690955, 6.8446184656479687, 3.2611655796374208, -2.6741940211614583], [-0.50027220538268491, -4.3477839094361617, 2.9591954335448492, 5.6031593252114158, -5.521985406459625]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_expandedData_rank2(self):  
       arg0=Data(numpy.array([[[3.5960456065370465, -2.1532015554469783], [-1.3273699161108263, -1.6973774528495467], [-1.5719201662304161, 3.7108233010333418], [-1.7923550371451569, 4.9658889932869936], [-2.501144420104561, -4.7188648552391275]], [[3.5068046587622916, -4.4548993092593623], [0.84507176905898973, 0.01779194397316175], [-2.3758099998905724, -4.7621746519946306], [4.7474371366552877, -0.7335124213437938], [-4.9358404302765848, -4.0880653643148648]], [[-4.931350533368918, 0.11222121306730504], [-0.50947672648910203, -3.5118930064644394], [-0.46138421033869559, 3.6519205808066371], [-2.5656362399086308, -3.9164220131378391], [0.53686765492575006, 4.5962282453226919]], [[-2.1367408398185939, 3.9322438086638698], [0.38732752910637913, 2.2708724050331259], [-4.1488051078539279, 3.3286644235872718], [-3.3740239790477222, -1.5691786638703329], [-3.0735110533763654, -4.3298194759067989]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[0.30981890868200335, -2.0144861567728398, -1.6443371453205726, -4.2788805133482093, -0.68400054356648887], [4.6602223119530137, 2.8313118003533786, 1.6517600525170586, 2.1624976467833079, 3.3836703182393126], [-1.6445492321184654, -4.3702685364459093, 3.2152473286879975, 1.9123432100965729, 1.6139810757505844], [1.1481683133793554, 3.5118836950194456, 3.5582081306965581, 1.869087639927228, -2.6933526051251455]])+(1.-msk_arg1)*numpy.array([[4.7484768087884337, 0.98805894359706414, -1.5432184282524961, -4.7752519640729698, 1.3775461772947661], [3.2319582412102257, -0.27629192352770104, 2.8088195784409091, -2.9252872069734104, -2.6063533062128652], [-0.042019966566845923, 4.288661299180152, -2.3338508537423976, 3.9624041263385763, -1.786380632466452], [3.3685954819366408, 3.0839255532613858, -0.42622886280117811, 3.5217683858671354, 4.2690676075170035]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[3.9058645152190499, -1.843382646764975], [-3.3418560728836662, -3.7118636096223865], [-3.2162573115509887, 2.0664861557127692], [-6.0712355504933662, 0.68700847993878433], [-3.1851449636710498, -5.4028653988056163]], [[8.1670269707153054, 0.20532300269365145], [3.6763835694123683, 2.8491037443265403], [-0.7240499473735138, -3.110414599477572], [6.9099347834385956, 1.4289852254395141], [-1.5521701120372722, -0.70439504607555214]], [[-6.5758997654873834, -1.5323280190511603], [-4.8797452629350113, -7.8821615429103487], [2.7538631183493019, 6.8671679094946345], [-0.65329302981205783, -2.0040788030412662], [2.1508487306763344, 6.2102093210732763]], [[-0.98857252643923843, 5.0804121220432252], [3.8992112241258248, 5.7827561000525716], [-0.59059697715736981, 6.8868725542838298], [-1.5049363391204942, 0.29990897605689515], [-5.7668636585015109, -7.0231720810319445]]])+(1.-msk_ref)*numpy.array([[[8.3445224153254802, 2.5952752533414554], [-0.33931097251376219, -0.70931850925248252], [-3.1151385944829122, 2.1676048727808457], [-6.5676070012181267, 0.19063702921402381], [-1.1235982428097948, -3.3413186779443613]], [[6.7387628999725173, -1.2229410680491366], [0.56877984553128869, -0.25849997955453929], [0.43300957855033673, -1.9533550735537215], [1.8221499296818773, -3.6587996283172042], [-7.54219373648945, -6.69441867052773]], [[-4.973370499935764, 0.070201246500459114], [3.77918457269105, 0.77676829271571268], [-2.7952350640810932, 1.3180697270642394], [1.3967678864299455, 0.045982113200737196], [-1.2495129775407019, 2.80984761285624]], [[1.231854642118047, 7.3008392906005106], [3.471253082367765, 5.3547979582945118], [-4.575033970655106, 2.9024355607860937], [0.14774440681941314, 1.9525897219968025], [1.1955565541406381, -0.060751868389795405]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_expandedData_rank3(self):  
       arg0=Data(numpy.array([[1.3349662800906543, -0.39326994699494389, 2.8498513460902872, 0.92973603484183709, 1.8943506681593769], [0.83627302799376935, -3.2825121866120455, 2.8993816639634389, 3.4395893755857951, 4.1993289408176686], [0.19018081612045634, -4.612322992130081, -4.2285187446759487, 1.5951104111625565, -2.9010065327157983], [-3.1611595372358678, -2.625882918798478, 1.1804846028459064, -1.0291848735198328, -4.8008044261475789]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-4.2111341801558746, 3.7858228179626341], [3.5041496459992061, -1.2768473976880945], [1.3628262548053023, -0.5527707488291389], [2.1138205420525233, 3.9794063945017637], [-0.70044666647691223, -3.82876344105473]], [[-3.2288475128131999, 1.767221347801744], [0.81366069351352355, -1.7737750176240619], [-2.5817540956950671, 1.3155179398243355], [1.8139770929230368, 3.6725591623868645], [2.2895602709932694, 3.568305128651776]], [[4.470978880327106, 1.4811893639802989], [-4.4984779617677537, 4.7531108730444043], [-1.5246821634258847, 1.2216121464682317], [3.5154426993810262, -4.6472876883790271], [1.9498776052174964, -3.8168116802778398]], [[-3.1715846727066985, 2.7530386617208222], [-3.0909298077110572, 4.4134226102206711], [-2.2479415972130177, 3.7771625803232318], [-2.1056046891453617, -0.77879429033322722], [1.260816043279311, 2.0560114880346836]]])+(1.-msk_arg1)*numpy.array([[[0.85490727134320643, 3.839051080272295], [0.47804094894286919, 4.5100731315614819], [0.37612272198905927, -1.696284025897282], [-2.0100706771975032, -4.3604371624481351], [-0.017406332153411697, -4.7930674459305074]], [[4.9126684377069338, 0.17708203657585564], [3.8534762107381333, 3.2937277341797575], [-2.634193260027148, -1.0592269495186732], [3.6641126673491655, 0.68699206914377164], [2.8855255412202387, 3.0891742656584249]], [[-0.5782501612025488, 2.5281499757884509], [-1.2847906424709779, -4.978582704676664], [1.7402650530298356, 4.1190589988733866], [4.1150750302457197, -2.8777852179729537], [-4.7742478543646341, -1.6009194349134304]], [[3.9381724249561696, -3.6051648478119835], [-0.3461275465207283, 4.0245136503557273], [-4.4710308940248975, -0.61762733931834646], [-2.6012305624677543, 3.6747769193186137], [1.5455556711790566, -4.9765498952214147]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-2.8761679000652203, 5.1207890980532884], [3.1108796990042622, -1.6701173446830384], [4.2126776008955895, 2.2970805972611483], [3.0435565768943604, 4.9091424293436008], [1.1939040016824647, -1.9344127728953531]], [[-2.3925744848194306, 2.6034943757955133], [-2.4688514930985219, -5.0562872042361073], [0.3176275682683718, 4.2148996037877744], [5.2535664685088319, 7.1121485379726597], [6.488889211810938, 7.7676340694694446]], [[4.6611596964475623, 1.6713701801007552], [-9.1108009538978347, 0.14078788091432326], [-5.7532009081018334, -3.006906598207717], [5.1105531105435826, -3.0521772772164706], [-0.95112892749830191, -6.7178182129936381]], [[-6.3327442099425664, -0.40812087551504561], [-5.7168127265095352, 1.787539691422193], [-1.0674569943671113, 4.9576471831691382], [-3.1347895626651945, -1.80797916385306], [-3.5399883828682679, -2.7447929381128953]]])+(1.-msk_ref)*numpy.array([[[2.1898735514338608, 5.1740173603629493], [0.084771001947925306, 4.116803184566538], [3.2259740680793465, 1.1535673201930052], [-1.0803346423556661, -3.430701127606298], [1.8769443360059652, -2.8987167777711305]], [[5.7489414657007032, 1.013355064569625], [0.57096402412608782, 0.011215547567712036], [0.26518840393629084, 1.8401547144447656], [7.1037020429349607, 4.1265814447295668], [7.0848544820379074, 7.2885032064760935]], [[-0.38806934508209245, 2.7183307919089073], [-5.8971136346010589, -9.590905696806745], [-2.4882536916461131, -0.10945974580256213], [5.7101854414082762, -1.2826748068103972], [-7.6752543870804324, -4.5019259676292283]], [[0.77701288772030175, -6.7663243850478514], [-2.9720104653192063, 1.3986307315572493], [-3.2905462911789911, 0.56285726352755994], [-3.6304154359875871, 2.6455920457987809], [-3.2552487549685223, -9.7773543213689926]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_expandedData_rank2(self):  
       arg0=Data(numpy.array([[[[0.79347549641551041, 1.5211595989756974, -4.4198616574172087, -4.1824513538790544, -1.2684505285444105], [-0.48336922527371762, 1.2609757753162381, 2.1509492868836482, 0.9829182877979159, -0.50875236407627611], [0.70689426671651123, 1.5291015734365523, 4.6462035377929194, -4.7788150280978501, 1.9838069751063294], [0.82005805698654033, -4.3381846942356548, 0.82751209475797705, -2.0011567430860469, 0.56494159634899965]], [[4.6102210220141497, -1.1914939354749468, -2.0374374322941815, 3.2666969468532212, -0.45293566263705465], [3.7035286381079739, 4.059095985026639, -4.5261424066539524, 4.3903646769871685, -0.57663719680138481], [3.9939857084143284, -3.6983216572033681, -2.8367162827291481, -1.6381351855216888, 3.9324443510173559], [3.7178097106933841, -1.7786627796511514, 2.5925208265122999, -0.73930554563764517, -2.8944218030468027]], [[1.4819943958367681, 2.6886614115544472, -2.3146071063413585, 4.9814821301869827, -4.3697014248653367], [-1.7953428848757289, -2.8632822025533757, 3.8882003857020262, 4.4789889813110992, -2.0075772911941057], [2.1346412979892939, -4.2100481338999529, -4.5382284221448854, 2.1936420572066231, 4.6112684721352579], [-4.2397874859165716, 0.5283558881791981, 3.5275961985936064, -3.8054383309946713, 0.30770345364579832]], [[1.798062041088933, 3.3793133939664415, -0.047875909830970897, -4.6318200095799522, 3.7620024081177341], [2.9450549343914751, 4.2572991742293631, -0.6898379542286257, -1.4197287178303188, -1.3876176744522786], [-4.1482974346556123, -3.8615894362326331, -4.7335392665858684, 0.09935276252952896, -1.5479521137389507], [3.8850353578153012, -1.4104744405505567, 0.20914587736594648, 0.85839330646218315, -0.086097471407086346]], [[4.5923495844645217, 4.3184390604250353, 3.4025013683864831, 2.3043182398864523, -3.9394067864900348], [3.3397343852214316, -1.332000653278663, -2.9538451591986514, -0.3174694660151145, -3.4347297355953499], [-3.2554665687758422, -2.8926389835273691, -4.2219028383995738, 4.8512843270388242, 3.9195805936099433], [0.00067150444002095355, -4.5573173666188165, -4.1164934157887236, 3.5838252166150788, 2.0352919494990118]]], [[[-2.559666047366651, 3.9021908116642798, -1.8661307473130249, 1.8963175882412466, -1.7278712346267309], [2.5223081040725726, -0.65874811258017285, 0.18293855457303998, -3.1822120527662632, -3.8349339851134365], [-2.1933184965442831, 4.7431967293134107, -0.052687520872646942, 0.59193403442002968, 3.1591236530359446], [2.9108871308500088, -2.6941561244941603, 1.3710026836989178, -2.4586824715812048, -1.7144555370479333]], [[0.5324543578881924, -1.244636726161227, 1.9719496829628005, 1.624412446212431, 4.3955747679263659], [-4.9294086894682421, -3.7150467244102092, -0.88204796221499748, -1.1275871509880386, -4.1573336134689685], [-0.25651830461853109, -2.5402871973067462, 4.7495174566946758, -0.87542369350969906, 3.4531274960951137], [-1.0327262850621253, -0.9778300078432629, 0.41760931489642772, 2.0273579794551564, -0.49818633550147506]], [[-2.4977398082593929, 3.279190883245203, -1.1622458892577536, -1.0807006239507078, -0.40659922956876127], [2.4810372799862268, -2.5817589231354332, -0.73980579488813447, 0.43708696126013535, -3.392304273933374], [0.037988913047588113, 3.5340101470340617, 4.2309746780733484, -3.4122318475277433, -0.57298510147382231], [2.5961049466595378, -4.1515970177843649, 3.4727973187294943, 4.770744903120594, 4.0412272123348796]], [[-4.4352780108640077, 1.2077686723508929, 0.10028837659595879, 1.6401667501373876, -2.5020615930719292], [1.259992951734179, -2.3266950077807613, 0.63444207798979235, 3.5968645093659291, 2.5468401481306291], [2.9920949923809905, 1.539756887637572, -2.1038810444866818, 4.6614132038977445, 1.3500967780580257], [3.2416075055157414, 0.74651141275529209, 0.98438094661545783, 0.68859899442760586, -3.4748963243345443]], [[1.8733839631190472, 0.1771698240284465, -1.6190931814396237, 4.4693991422972736, 3.1005743813224118], [1.6964568961122186, 2.2484722477750152, 2.9479174963438739, 2.5316247755090497, 3.5552813355949109], [1.8294141495493923, -1.372278115128144, 0.50599522431729849, 0.50012361483696921, -1.059368802028092], [-4.1156863070471159, -0.0016121316050377033, 4.4657982315033511, 0.040138822230014526, 3.9448638970540255]]], [[[3.1655911956947147, 2.6295535032675952, -0.16169382935809473, 1.6620978081174425, -1.8786985564118694], [2.484118920451496, -3.6165417810678777, -2.9347906327003792, -1.4102049323225341, -0.79525908029617209], [-3.486365929082138, 3.6647256281276341, 1.9210336672363271, 0.70404330580251173, -2.6247081136789663], [-0.88127530370231266, -2.2075717048326093, 3.6477131244952101, -0.62138128801079873, 2.0415402891381076]], [[0.41634846763525424, 2.7867786811799231, 2.5181947796327364, 4.4441300868277871, -2.1235239593414756], [-1.718420514748459, 3.4886663289527018, -3.1427778262660535, 4.8557384711937353, -2.0480611453896502], [2.0794527230180213, 4.8583248493981834, -4.3322626135485365, 0.58903070012960512, -2.3822689487101512], [4.8120122912637164, -1.3601464175403311, 1.0820197374403993, 4.552637348302401, 2.2077341595807463]], [[-2.1831125630523518, -0.61256306488055934, -3.1059698757227161, 2.1942948983891064, -1.1978178244999627], [-4.2711072609603491, -2.3155852045938943, -0.021354001045094329, 3.9278559824819901, -2.8792567455765719], [1.4630215225252563, 2.1288431059241741, 3.6546627609945332, 3.8554294643280755, 0.67723759005693651], [-2.1661562890158992, 4.4189066853704979, 4.9541981250705511, 2.2878275390221248, -2.8751138409709376]], [[-2.4940267860086509, -3.4801431524283233, 0.8478163184139822, -0.68643014321944218, -4.7998047357675757], [0.91135568517433185, -4.3137732368145709, 3.8542350777370764, 0.24842938954420468, -0.87462786319373542], [2.3528257667488965, 2.4387615903747841, 1.9612201881357709, 4.6026580619078263, 0.39757486074580317], [0.12227738108456698, 2.4524168585113149, 1.9997681277525814, 1.0921951637797092, -3.342431166821803]], [[-0.30910246306559053, 0.098805138229934641, -1.788160791743163, -3.0433510132684649, -0.12246127235540616], [-1.2144887882383379, 4.2247186895091158, 0.59572135486643241, 0.19254174873438945, 2.8052881775986291], [-2.4062139007957839, 4.4488343711376803, 0.0071173975337490702, 3.6928074227351022, 0.21168674401426024], [-1.3299282899734144, -3.2009716097901397, -4.0363531285296865, -1.9688078443803505, -3.4293020856547853]]], [[[-4.820971790337742, -2.2547059223014729, -2.6307820886212485, 2.7293807555651384, 0.79361226823488984], [-3.3660678150773227, -0.013967141475101919, -4.0485797959334269, -2.9638928497575403, -2.9501727579983128], [4.4226183421574916, -3.9294880565892134, -3.6479314651158323, 3.3971321580209981, 4.8892167592598152], [-4.6127763427010917, -0.58647685869319321, 2.574220889041273, -2.1523867384628459, -0.21962238283989777]], [[-4.3658614897278305, -2.3412886057383622, -0.89866031726614715, -0.033356015721782484, 3.545609997414056], [-4.9859553114909092, 3.1127874876936588, -3.6669718986758593, 0.15091250216826335, 0.56084194193857151], [3.0932803472617092, -3.5954649472506639, -3.8198581428582514, 1.7990949077357747, -4.9883509081541133], [3.0670045855791894, -2.5242693662918847, 1.7988578459680982, 0.52112746563841483, -0.58859881007912129]], [[-3.3142174710695049, 4.8952706030221211, -0.14104408724726447, 3.4607420238242845, 4.8044107990795446], [-3.4223091344704359, 0.80908973587392019, -3.0283765025471423, -0.072188006261285409, 2.7397174190324627], [4.070635082785838, 1.6112169295721577, 1.3965902793136529, 2.641505420695399, 4.7098115685496218], [3.4635449749298157, -4.9866927378393484, -4.2591000392412433, -4.5714774563105474, 1.7282588185736314]], [[2.4506938786201227, 4.9381615025509227, -2.4238855916826285, 3.4626589320364101, 1.3549858437246067], [1.4556903068583606, 3.0251739768871069, 3.607516118923165, 3.706123157473769, 3.4758845150417148], [-0.54588047340551338, -1.291887403058646, -2.0775877099470152, -2.6978609823438617, -3.2573191321439898], [-2.6205473299984714, -1.7123196869875725, 4.2891080402844199, 0.88106421548358149, 4.2017027837047163]], [[1.3999727723283328, 0.057629832193605068, 2.5100586546083479, 0.24599733322030115, -0.38860884805696916], [-0.31741080562815505, -4.2109084074581311, -4.8260863175306064, -3.5518342308849538, -1.7989034657803913], [-4.7637761077394192, -4.8141998867830251, -4.8055303105411529, -0.87682577364442338, -4.4829109791368342], [2.0387155145506668, -3.5890121700912903, -4.8760649095085036, 4.7711925759856229, -2.1693665502800008]]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[2.6578247835259017, 3.2778805853131843, 1.253091029286467, 1.1558351736939869, 2.5924118286215823], [-3.812309632472819, 1.0737499315984032, -0.78563261583126653, -0.8192398152215139, 2.2816575758546787], [0.50285429802626425, 1.8494594120600727, -1.6451017011871794, 1.9732613010405391, -2.010316534333926], [-4.1288729979902241, -0.62484079769356349, 3.1800885285359914, -4.9210514019485716, -1.4007782827566695]])+(1.-msk_arg1)*numpy.array([[4.7841873573585811, 3.4604311294713792, -0.99155307371202017, 0.34294283591110197, 3.8877614161167813], [-1.6527637007247109, 4.7773527722745417, -1.6931934659987524, -1.3519147902215867, -1.0910498608354544], [4.1043547087746681, 4.1317436254642743, 2.6167075889461922, 0.44789308478869216, -4.1250207560138064], [-1.2276096906985998, -0.79967243543482613, -2.2936217777593129, -4.4813770673792526, -3.8187942640931305]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[3.4513002799414121, 4.1789843825015991, -1.762036873891307, -1.5246265703531527, 1.3893742549814911], [2.1744555582521841, 3.9188005588421397, 4.8087740704095499, 3.6407430713238176, 2.1490724194496256], [3.3647190502424129, 4.186926356962454, 7.3040283213188211, -2.1209902445719484, 4.6416317586322311], [3.477882840512442, -1.6803599107097531, 3.4853368782838787, 0.65666804043985483, 3.2227663798749013]], [[7.888101607327334, 2.0863866498382375, 1.2404431530190028, 6.5445775321664055, 2.8249449226761296], [6.9814092234211582, 7.3369765703398233, -1.2482618213407681, 7.6682452623003527, 2.7012433885117995], [7.2718662937275127, -0.42044107189018387, 0.44116430258403616, 1.6397453997914955, 7.2103249363305402], [6.9956902960065683, 1.4992178056620329, 5.8704014118254841, 2.5385750396755391, 0.38345878226638153]], [[2.735085425123235, 3.9417524408409141, -1.0615160770548915, 6.2345731594734497, -3.1166103955788698], [-0.54225185558926192, -1.6101911732669087, 5.1412914149884932, 5.7320800105975662, -0.75448626190763868], [3.3877323272757609, -2.9569571046134859, -3.2851373928584184, 3.4467330864930901, 5.8643595014217249], [-2.9866964566301046, 1.7814469174656651, 4.7806872278800734, -2.5523473017082043, 1.5607944829322653]], [[2.9538972147829199, 4.5351485676604284, 1.107959263863016, -3.4759848358859653, 4.917837581811721], [4.1008901080854621, 5.41313434792335, 0.46599721946536121, -0.26389354413633193, -0.23178250075829165], [-2.9924622609616254, -2.7057542625386461, -3.5777040928918815, 1.2551879362235159, -0.39211694004496378], [5.0408705315092881, -0.25463926685656979, 1.3649810510599334, 2.0142284801561701, 1.0697377022869006]], [[7.1847614130861039, 6.9108508890466176, 5.9949131970080654, 4.8967300685080346, -1.3469949578684526], [5.9321462138430139, 1.2604111753429192, -0.36143333057706917, 2.2749423626064678, -0.84231790697376763], [-0.66305474015425991, -0.30022715490578689, -1.6294910097779916, 7.4436961556604064, 6.5119924222315255], [2.5930833330616032, -1.9649055379972342, -1.5240815871671414, 6.1762370452366611, 4.6277037781205941]]], [[[-6.37197567983947, 0.08988117919146088, -5.6784403797858438, -1.9159920442315723, -5.5401808670995498], [-1.2900015284002464, -4.4710577450529918, -3.629371077899779, -6.9945216852390821, -7.6472436175862555], [-6.0056281290171025, 0.93088709684059179, -3.8649971533454659, -3.2203755980527893, -0.6531859794368744], [-0.90142250162281012, -6.5064657569669793, -2.4413069487739012, -6.2709921040540237, -5.5267651695207523]], [[1.6062042894865955, -0.17088679456282385, 3.0456996145612036, 2.6981623778108341, 5.4693246995247691], [-3.8556587578698389, -2.6412967928118061, 0.19170196938340567, -0.053837219389635482, -3.0835836818705653], [0.81723162697987206, -1.4665372657083431, 5.823267388293079, 0.19832623808870409, 4.5268774276935169], [0.04102364653627788, 0.095919923755140246, 1.4913592464948309, 3.1011079110535595, 0.57556359609692809]], [[-3.2833724240906594, 2.4935582674139365, -1.9478785050890202, -1.8663332397819743, -1.1922318454000278], [1.6954046641549603, -3.3673915389666997, -1.525438410719401, -0.34854565457113118, -4.1779368897646405], [-0.74764370278367842, 2.7483775312027952, 3.4453420622420818, -4.1978644633590099, -1.3586177173050888], [1.8104723308282713, -4.9372296336156314, 2.6871647028982277, 3.9851122872893274, 3.255594596503613]], [[-5.2545178260855216, 0.38852885712937901, -0.71895143862555511, 0.82092693491587365, -3.3213014082934431], [0.44075313651266512, -3.1459348230022752, -0.18479773723172155, 2.7776246941444152, 1.7276003329091152], [2.1728551771594766, 0.72051707241605811, -2.9231208597081957, 3.8421733886762306, 0.53085696283651185], [2.4223676902942275, -0.072728402466221809, 0.16514113139394393, -0.13064082079390804, -4.2941361395560582]], [[4.1550415389737259, 2.4588273998831252, 0.66256439441505499, 6.7510567181519523, 5.3822319571770905], [3.9781144719668973, 4.5301298236296939, 5.2295750721985526, 4.8132823513637284, 5.8369389114495895], [4.111071725404071, 0.90937946072653464, 2.7876528001719771, 2.7817811906916479, 1.2222887738265866], [-1.8340287311924373, 2.280045444249641, 6.7474558073580297, 2.3217963980846932, 6.2265214729087042]]], [[[3.6684454937209789, 3.1324078012938594, 0.34116046866816951, 2.1649521061437067, -1.3758442583856052], [2.9869732184777602, -3.1136874830416135, -2.431936334674115, -0.90735063429626983, -0.29240478226990785], [-2.9835116310558738, 4.1675799261538984, 2.4238879652625913, 1.206897603828776, -2.121853815652702], [-0.37842100567604842, -1.7047174068063451, 4.1505674225214744, -0.11852698998453448, 2.5443945871643718]], [[2.2658078796953269, 4.6362380932399958, 4.3676541916928091, 6.2935894988878598, -0.27406454728140295], [0.13103889731161367, 5.3381257410127745, -1.2933184142059808, 6.7051978832538079, -0.19860173332957753], [3.928912135078094, 6.7077842614582561, -2.4828032014884638, 2.4384901121896778, -0.53280953665007846], [6.6614717033237891, 0.48931299451974164, 2.9314791495004719, 6.4020967603624737, 4.057193571640819]], [[-3.8282142642395312, -2.2576647660677387, -4.7510715769098955, 0.54919319720192705, -2.842919525687142], [-5.9162089621475289, -3.9606869057810736, -1.6664557022322737, 2.2827542812948107, -4.5243584467637508], [-0.18208017866192305, 0.48374140473699478, 2.0095610598073539, 2.2103277631408962, -0.96786411113024284], [-3.8112579902030785, 2.7738049841833186, 3.3090964238833718, 0.64272583783494541, -4.5202155421581169]], [[-0.52076548496811181, -1.5068818513877842, 2.8210776194545213, 1.2868311578210969, -2.8265434347270366], [2.8846169862148709, -2.3405119357740318, 5.8274963787776155, 2.2216906905847438, 1.0986334378468037], [4.3260870677894356, 4.4120228914153232, 3.93448148917631, 6.5759193629483654, 2.3708361617863423], [2.0955386821251061, 4.425678159551854, 3.9730294287931205, 3.0654564648202483, -1.3691698657812639]], [[-2.3194189973995165, -1.9115113961039913, -3.798477326077089, -5.0536675476023909, -2.1327778066893321], [-3.2248053225722639, 2.2144021551751898, -1.4145951794674936, -1.8177747855995365, 0.79497164326470315], [-4.4165304351297099, 2.4385178368037543, -2.0031991368001769, 1.6824908884011762, -1.7986297903196657], [-3.3402448243073404, -5.2112881441240653, -6.0466696628636125, -3.9791243787142765, -5.4396186199887113]]], [[[-8.9498447883279653, -6.383578920291697, -6.7596550866114722, -1.3994922424250857, -3.3352607297553343], [-7.4949408130675472, -4.142840139465326, -8.177452793923651, -7.0927658477477644, -7.0790457559885365], [0.2937453441672675, -8.0583610545794375, -7.7768044631060569, -0.73174083996922601, 0.76034376126959113], [-8.7416493406913158, -4.7153498566834173, -1.5546521089489511, -6.2812597364530696, -4.3484953808301219]], [[-4.990702287421394, -2.9661294034319257, -1.5235011149597106, -0.65819681341534597, 2.9207691997204925], [-5.6107961091844727, 2.4879466900000953, -4.2918126963694228, -0.47392829552530014, -0.063998855754991979], [2.4684395495681457, -4.2203057449442269, -4.4446989405518149, 1.1742541100422113, -5.6131917058476768], [2.4421637878856259, -3.1491101639854482, 1.1740170482745347, -0.10371333205514865, -1.2134396077726848]], [[-0.13412894253351348, 8.0753591315581126, 3.039044441288727, 6.640830552360276, 7.984499327615536], [-0.2422206059344445, 3.9891782644099116, 0.15171202598884914, 3.107900522274706, 5.9198059475684541], [7.2507236113218294, 4.7913054581081491, 4.5766788078496443, 5.8215939492313904, 7.8899000970856132], [6.6436335034658072, -1.806604209303357, -1.0790115107052518, -1.3913889277745559, 4.9083473471096228]], [[-2.4703575233284489, 0.017110100602351075, -7.3449369936312001, -1.4583924699121615, -3.5660655582239649], [-3.465361095090211, -1.8958774250614647, -1.3135352830254066, -1.2149282444748026, -1.4451668869068568], [-5.466931875354085, -6.2129388050072176, -6.9986391118955869, -7.6189123842924333, -8.1783705340925614], [-7.541598731947043, -6.6333710889361441, -0.63194336166415166, -4.0399871864649901, -0.71934861824385532]], [[-0.00080551042833665321, -1.3431484505630644, 1.1092803718516784, -1.1547809495363683, -1.7893871308136386], [-1.7181890883848245, -5.6116866902148006, -6.2268646002872758, -4.9526125136416237, -3.1996817485370608], [-6.1645543904960887, -6.2149781695396946, -6.2063085932978224, -2.2776040564010929, -5.8836892618935037], [0.63793723179399731, -4.9897904528479593, -6.2768431922651731, 3.3704142932289534, -3.5701448330366703]]]])+(1.-msk_ref)*numpy.array([[[[5.5776628537740915, 6.3053469563342786, 0.36432569994137243, 0.60173600347952672, 3.5157368288141706], [4.3008181320848635, 6.0451631326748192, 6.9351366442422293, 5.767105645156497, 4.275434993282305], [5.4910816240750924, 6.3132889307951334, 9.4303908951515005, 0.0053723292607310569, 6.7679943324649106], [5.6042454143451215, 0.44600266312292636, 5.6116994521165582, 2.7830306142725343, 5.3491289537075808]], [[8.0706521514855289, 2.2689371939964325, 1.4229936971771977, 6.7271280763246004, 3.0074954668343246], [7.1639597675793532, 7.5195271144980182, -1.0657112771825732, 7.8507958064585477, 2.8837939326699944], [7.4544168378857076, -0.23789052773198893, 0.6237148467422311, 1.8222959439496904, 7.3928754804887351], [7.1782408401647633, 1.6817683498202278, 6.0529519559836791, 2.721125583833734, 0.56600932642457646]], [[0.49044132212474789, 1.697108337842427, -3.3061601800533786, 3.9899290564749625, -5.3612544985773569], [-2.7868959585877491, -3.8548352762653959, 2.896647311990006, 3.4874359075990791, -2.9991303649061258], [1.1430882242772737, -5.2016012076119731, -5.5297814958569056, 1.2020889834946029, 3.6197153984232378], [-5.2313405596285918, -0.46319718553282208, 2.5360431248815862, -4.7969914047066915, -0.68384962006622185]], [[2.1410048770000349, 3.7222562298775435, 0.29506692608013108, -4.2888771736688502, 4.1049452440288361], [3.2879977703025771, 4.6002420101404651, -0.34689511831752373, -1.0767858819192169, -1.0446748385411766], [-3.8053545987445103, -3.5186466003215311, -4.3905964306747665, 0.44229559844063093, -1.2050092778278487], [4.2279781937264032, -1.0675316046394547, 0.55208871327704845, 1.2013361423732851, 0.25684536450401563]], [[8.480111000581303, 8.2062004765418166, 7.2902627845032644, 6.1920796560032336, -0.051645370373253563], [7.2274958013382129, 2.5557607628381183, 0.93391625691812985, 3.5702919501016668, 0.45303168052143139], [0.6322948473409391, 0.99512243258941213, -0.33414142228279253, 8.7390457431556055, 7.8073420097267245], [3.8884329205568022, -0.6695559505020352, -0.22873199967194235, 7.4715866327318601, 5.9230533656157931]]], [[[-4.2124297480913615, 2.2494271109395689, -3.5188944480377358, 0.24355388751653573, -3.3806349353514418], [0.86954440334786165, -2.3115118133048838, -1.4698251461516709, -4.8349757534909745, -5.4876976858381479], [-3.846082197268994, 3.0904330285886998, -1.7054512215973578, -1.0608296663046812, 1.5063599523112337], [1.2581234301252979, -4.3469198252188708, -0.28176101702579315, -4.1114461723059161, -3.3672192377726442]], [[5.3098071301627341, 3.5327160461133147, 6.7493024552373422, 6.4017652184869727, 9.1729275402009076], [-0.15205591719370037, 1.0623060478643325, 3.8953048100595442, 3.6497656212865031, 0.62001915880557323], [4.5208344676560106, 2.2370655749677955, 9.5268702289692175, 3.9019290787648426, 8.2304802683696554], [3.7446264872124164, 3.7995227644312788, 5.1949620871709694, 6.8047107517296981, 4.2791664367730666]], [[-4.1909332742581453, 1.5859974172464506, -2.8554393552565061, -2.7738940899494602, -2.0997926955675137], [0.78784381398747438, -4.2749523891341852, -2.4329992608868869, -1.2561065047386171, -5.0854977399321264], [-1.6552045529511643, 1.8408166810353093, 2.5377812120745959, -5.1054253135264958, -2.2661785674725747], [0.90291148066078541, -5.8447904837831173, 1.7796038527307418, 3.0775514371218415, 2.3480337463361272]], [[-5.7871928010855944, -0.14414611787069376, -1.2516264136256279, 0.28825195991580088, -3.8539763832935159], [-0.091921838487407648, -3.678609798002348, -0.71747271223179432, 2.2449497191443424, 1.1949253579090424], [1.6401802021594039, 0.18784209741598534, -3.4557958347082685, 3.3094984136761578, -0.0018180121635609225], [1.8896927152941547, -0.60540337746629458, -0.36753384360612884, -0.66331579579398081, -4.826811114556131]], [[0.78233410228359279, -0.91388003680700791, -2.7101430422750781, 3.3783492814618192, 2.0095245204869574], [0.6054070352767642, 1.1574223869395608, 1.8568676355084195, 1.4405749146735953, 2.4642314747594565], [0.73836428871393789, -2.4633279759635984, -0.58505463651815592, -0.5909262459984852, -2.1504186628635464], [-5.2067361678825703, -1.0926619924404921, 3.3747483706678967, -1.0509110386054399, 2.8538140362185711]]], [[[7.2699459044693828, 6.7339082120422633, 3.9426608794165734, 5.7664525168921106, 2.2256561523627987], [6.5884736292261641, 0.48781292770679041, 1.1695640760742889, 2.694149776452134, 3.309095628478496], [0.61798877969253008, 7.7690803369023023, 6.0253883760109952, 4.8083980145771799, 1.4796465950957018], [3.2230794050723555, 1.8967830039420588, 7.7520678332698782, 3.4829734207638694, 6.1458949979127757]], [[4.5480920930995286, 6.9185223066441974, 6.6499384050970107, 8.5758737122920614, 2.0082196661227987], [2.4133231107158153, 7.6204099544169761, 0.98896579919822081, 8.9874820966580096, 2.0836824800746241], [6.2111963484822956, 8.9900684748624577, -0.20051898808426216, 4.7207743255938794, 1.7494746767541232], [8.9437559167279908, 2.7715972079239433, 5.2137633629046736, 8.6843809737666753, 6.3394777850450206]], [[0.43359502589384036, 2.0041445240656328, -0.48926228677652395, 4.8110024873352986, 1.4188897644462295], [-1.6543996720141569, 0.30112238435229788, 2.5953535879010978, 6.5445635714281822, -0.2625491566303797], [4.0797291114714485, 4.7455506948703663, 6.2713703499407254, 6.4721370532742677, 3.2939451790031287], [0.45055129993029297, 7.0356142743166901, 7.5709057140167433, 4.9045351279683169, -0.25840625202474543]], [[-2.0461337012199587, -3.0322500676396311, 1.2957094032026744, -0.23853705843075002, -4.3519116509788836], [1.359248769963024, -3.8658801520258788, 4.3021281625257686, 0.69632247433289685, -0.42673477840504326], [2.8007188515375887, 2.8866546751634763, 2.4091132729244631, 5.0505511466965185, 0.84546794553449534], [0.57017046587325915, 2.900309943300007, 2.4476612125412736, 1.5400882485684013, -2.8945380820331108]], [[-4.4341232190793969, -4.0262156177838717, -5.9131815477569694, -7.1683717692822713, -4.2474820283692125], [-5.3395095442521443, 0.099697933495309421, -3.5292994011473739, -3.9324790072794169, -1.3197325784151772], [-6.5312346568095903, 0.32381361512387397, -4.1179033584800573, -0.43221333327870415, -3.9133340119995461], [-5.4549490459872203, -7.3259923658039465, -8.1613738845434938, -6.0938286003941569, -7.5543228416685917]]], [[[-6.0485814810363419, -3.4823156130000728, -3.8583917793198483, 1.5017710648665386, -0.43399742246370998], [-4.593677505775922, -1.2415768321737017, -5.2761894866320267, -4.1915025404561401, -4.1777824486969131], [3.1950086514588918, -5.1570977472878132, -4.8755411558144317, 2.1695224673223983, 3.6616070685612154], [-5.8403860333996915, -1.814086549391793, 1.3466111983426732, -3.3799964291614457, -1.4472320735384976]], [[-5.1655339251626566, -3.1409610411731883, -1.6983327527009733, -0.83302845115660862, 2.7459375619792299], [-5.7856277469257353, 2.3131150522588326, -4.4666443341106854, -0.64875993326656278, -0.23883049349625463], [2.2936079118268831, -4.3951373826854905, -4.6195305782930776, 0.99942247230094861, -5.7880233435889394], [2.2673321501443633, -3.3239418017267108, 0.99918541053327203, -0.2785449697964113, -1.3882712455139474]], [[-5.6078392488288173, 2.6016488252628083, -2.4346658650065773, 1.1671202460649717, 2.5107890213202317], [-5.7159309122297488, -1.4845320418853927, -5.3219982803064552, -2.3658097840205983, 0.44609564127314982], [1.7770133050265251, -0.68240484818715519, -0.89703149844565999, 0.34788364293608609, 2.4161897907903089], [1.1699231971705029, -7.2803145155986613, -6.5527218170005561, -6.8650992340698602, -0.56536295918568147]], [[-2.0306831887591299, 0.45678443517167011, -6.9052626590618811, -1.0187181353428425, -3.1263912236546458], [-3.0256867605208919, -1.4562030904921457, -0.87386094845608753, -0.7752539099054836, -1.0054925523375378], [-5.0272575407847659, -5.7732644704378986, -6.5589647773262678, -7.1792380497231143, -7.7386961995232424], [-7.101924397377724, -6.1936967543668251, -0.19226902709483262, -3.6003128518956711, -0.27967428367453628]], [[-2.4188214917647977, -3.7611644318995254, -1.3087356094847826, -3.5727969308728293, -4.2074031121501001], [-4.1362050697212851, -8.0297026715512612, -8.6448805816237364, -7.3706284949780843, -5.6176977298735213], [-8.5825703718325492, -8.6329941508761561, -8.6243245746342829, -4.6956200377375534, -8.3017052432299643], [-1.7800787495424637, -7.4078064341844208, -8.6948591736016336, 0.95239831189249236, -5.9881608143731313]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_expandedData_rank4(self):  
       arg0=Data(numpy.array([[4.6025970830087441, 1.3203932183935088, 0.79145012376977331, -3.1833712315075391, 0.73499399687808165], [-3.9921799203249897, -1.7068368354741481, 2.6110174920884841, -1.6212329991350307, -3.5309732741885069], [-1.1395288117243876, 0.24623775719366847, -3.8731898698307763, 3.3474520163765078, 1.754702487398113], [-0.53361607304726366, 1.7964197892362179, 3.4622353857662489, -3.9714809098536508, 3.3691945195611623]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[1.7286590036674774, -1.8292471502840293, -0.77215100560519545, 1.3893785767555658, -1.9496677891066172], [3.503106089830176, 0.015834463094730467, 2.4758069315777576, 3.992829871236049, -3.0851589772234234], [-3.6866102575000079, -1.220864093259586, 0.82344578311444749, 1.6019570331708373, 2.741849086658549], [2.643334099316319, 2.171285364320009, -2.8810655018469311, 3.7820641797276124, -3.7750698615228382]], [[-2.4867913834808961, 3.276495059988358, -1.6021073317560774, -0.46980215920735979, -2.0459709276278648], [0.34995386767001513, 1.1518794072056355, 2.0979799381633146, -4.4757375202143725, -1.1719098430117314], [-0.31714181901118899, 0.69844682459347585, -0.18897639263738242, -4.2489099357339546, -3.5382129192162126], [3.1665090985504101, -3.0040766865123256, -2.0585995800571775, 1.5364990263326108, 2.1802950312082618]], [[1.2977450579419294, 4.5948429511555524, 4.3622026275012065, 1.4474519251017455, -3.7684882047916659], [-2.835284260047902, 3.5550432122924285, 4.0926047905332599, -3.8772859779677282, 1.2498787327468879], [0.98660700962635239, -2.9890703792583775, 3.9531028845141254, -2.3571644710344364, -1.4421271340175377], [-3.6611807821463538, 1.6153640723951179, 0.42415483673309051, 4.3967792184329362, -1.5851227136999357]], [[2.1337982004179681, 2.1194484793492672, -4.0262855239115583, 1.3873833478405784, 0.46791455304336171], [0.16299187133590376, 0.754135002266203, 4.0151366560508563, 1.0575243181051039, 1.7169515511301672], [4.5150813510885452, 3.6623958297320662, 0.47945331049707285, -1.9185728795350743, 4.6584612941406007], [-2.1570776490295418, -0.031200976676565517, 1.5543330411397704, -1.9100989509366864, 2.3676753181761629]], [[-4.0372668984297277, -4.9798154587364589, 3.2059905525226853, -0.097487473795863977, -3.4734761345057463], [2.5623087031310101, 3.8809721752381936, -0.25601178201203201, 3.1954214338107949, 3.5408629891160288], [3.045350182985052, 3.5921709145116267, 4.3278573819592374, 2.1778744383589252, -1.0800520483401197], [3.2166810710672458, -0.55592458495610941, -2.2140663684581074, 0.37939919447151382, -0.59243242574929855]]], [[[4.7574297421923255, -4.0929830135595395, -0.4903383691591916, 0.08476588437606658, 0.21540445154031396], [-0.6936222934297529, 4.7564425282021254, 2.9501298088176195, -4.1592191583414619, 0.17509375816786932], [3.679453246463428, -2.1992276329437388, -0.5243955332040553, -4.2765427416716673, -3.1153908973007018], [1.6188135256976963, 0.5568124281730622, 2.6131806667437028, -0.76470582851924096, -4.2556109458714122]], [[4.6436744928370004, -4.6571409242976536, -1.534800039732962, 1.4061301052897734, 2.0134044863706313], [-3.2148075063890413, -1.3762078643097677, -4.4554870899327481, -2.0688490206596724, 3.3679725773242541], [4.0883619316292865, 2.9141814228442753, 2.8698410883860683, -4.51108993986049, -0.49301614307363195], [2.484730874650257, 3.8840851478212564, 1.075672327910727, -2.9231039262753331, 3.8828139834073543]], [[2.7582779578239967, 3.8488023896577861, 0.54780564492073403, 0.076714033883283683, -3.3831843799313255], [1.5548821394735111, 3.8105581042715606, -3.0023353643212292, 2.4982929472026596, 0.0087829972909663212], [1.2412948852208761, -4.3305219348813919, -4.4620073639238083, -4.4260435176467672, 0.30780314221749538], [1.7117546814132645, 1.4407517357558355, 1.1208777586398941, 0.44185793937113615, 0.72343866086734643]], [[-0.89631284760883112, -1.2632496906828594, -3.581285945369256, 1.9660927786647537, 1.5981325191449001], [-0.95380487183015816, -3.9758411044348563, 4.4103337293161218, 1.1531826326342856, -1.9113898222960177], [-0.6718711087582161, 1.0160847102916195, 4.1685341181442421, 0.30853391279753506, 0.72375087667243321], [0.64096456090063558, 1.5615358692990897, 1.7549940104257047, -0.69858551358497323, -0.49591921544026807]], [[-4.2080241362381869, -0.89280695698304413, -0.70040634004215541, -1.809054028720011, -1.8372411270545719], [4.5279334642786431, -1.0712866832882462, 3.1976403846936243, 0.92846601581690713, -3.5284425686581744], [-3.1521719066100831, 2.5379803869583597, -0.59901260747099272, -0.47713917121250926, 1.2586047506161382], [1.3971227849670331, -2.7000144699503359, 2.1189760188624129, -3.5498854511167099, 2.4819712444802535]]], [[[-1.3446464959892026, 2.5778371621903222, -2.5500526985075842, 1.9929831575383883, 2.9527535044203681], [0.75605368085789681, 1.3997855324787594, 1.3417628615640877, -4.0599441810449228, 0.39063654320784735], [-3.8536707898866629, -1.7069521542787847, -0.77434054279329523, 3.4389667613846822, 2.728543813197934], [4.6991307214330522, -0.28946673518890709, -1.8765420056336124, 0.88508546123390541, 1.8603356181842523]], [[-2.3947268858389004, 0.87267638452802032, -3.3006484454912388, 4.6660530695835085, -4.7912908889330508], [-0.96372850240283103, -1.8151711488939029, 3.9461165287305615, -4.4797693342664937, -4.772945995676201], [2.8897677157250072, -3.0950017840516098, -0.74192034765194848, 3.7382768558342629, -0.023270439122466513], [1.7341092449856719, -1.585540401282306, 4.6665996695264269, -0.77288829742570098, 3.7069377891350648]], [[-1.6811957348917939, 1.9515724303579525, -1.2986955385438259, 0.36910858052777407, 0.021183469260121157], [-4.7857414452876004, -4.0883455814235079, 2.7343476483031024, -3.3078423504545782, -3.8029742805857625], [1.5662052392721746, 0.2869261494112525, -3.8372653321059813, -0.53891516953722451, -3.2769672496633264], [-3.477855679240661, 4.7692442217477176, -3.7542576208122869, 0.23518425813214527, -3.7672298411551042]], [[0.2872057926882432, 1.8755919085459976, -0.070772956304820056, 4.6117304510316917, 4.9607057748462893], [2.9651279309291469, 1.987870182142192, -0.81454607625117159, -2.6668300998550709, 4.8810281914475357], [0.35049360035884725, 4.6922234246314058, 2.4259698293540497, 3.4718942456369373, -2.4003322930777662], [0.63778780265297996, 3.3651216880362114, 1.0375098538286984, 4.0728568577264266, -3.3944231721149887]], [[-4.2247598570669318, -4.1839496351273606, -4.4683012030214018, 4.1580131873407709, 0.51902621698887952], [-4.2646362713129502, 3.9936350234794329, -1.3705045060718222, 1.6251976108310719, 3.1228124100920134], [1.4444529691744004, -3.3876163280390403, 2.5355052685306756, -4.4559347697300611, 3.3002328321215444], [-4.2725775265977379, -0.071232814575603598, -1.1978559504117969, 4.8970503608376941, 2.0285564768901772]]], [[[2.3940877773969742, -2.0439847021001354, 1.27175572859589, 4.0479734109688774, 2.3424320881568743], [3.1588774981173113, 3.8181162214716693, -3.8108776856714641, 1.6810270678415407, 1.2107919785746057], [-0.22522223512704809, 0.66804285972888344, 1.5950796469701469, -1.3280846582787307, -3.4513500398176511], [4.0631135093768442, -1.166728930170259, -3.6234635696273845, 4.25778455390647, 4.5212593052058949]], [[4.4890144691694758, 0.18274080627423928, 4.4634974480401617, -0.79608668979374553, 4.0276892653065204], [1.8689926175944755, 3.7756585573126724, -2.5167983458011491, 4.0548374953517765, 2.1470404801560203], [0.2157115480621048, -3.2914167386596107, 2.5414304801295309, -0.30246713487589361, 4.079634845242726], [2.7304468381113312, -0.52149423055391964, -1.6320820321129084, -0.37168137902640197, 4.8502663744980854]], [[2.1971315649408254, 3.7018514728424918, -0.12670858635731275, 3.0808611151560505, -3.9504061124948189], [2.9203516520337471, -2.1029102694442203, 0.39535172916092431, -0.47653131483951672, 0.89806883362573942], [2.7173856565263925, -4.0040303967763311, -3.4889813532588665, -4.6144561538016795, 1.8748946254037255], [2.9899925558022256, -3.2557559030512593, 1.3596219527562354, 3.8339927552638535, -2.4515203485221848]], [[0.34963966945851865, 4.4242276552481457, 0.28655677089161458, -4.9501772972080609, -1.41369541723672], [-2.0653692303694915, -4.1455982356087064, 1.9660951880742275, 3.0567519982198554, -2.9281501167297885], [0.33965479490218442, -3.4674563586437666, -3.4368695229856447, 3.5557130953420444, 1.2502342112526712], [0.20976243193375232, -3.7775146068749654, -0.048994630398725647, -0.55355304726238952, 2.5123547199126062]], [[2.2788843250201598, 0.96337842702498033, -2.5040732266392194, -1.1256623338553862, -1.7855885799084934], [-4.1375823281246813, 2.6256917198951193, 2.8676253985861866, 3.2158706503465808, 0.38205380384818177], [-3.0359515537673767, 1.9244599743543631, 1.3417423310868219, 1.1442419868790621, 0.37162390665875034], [-1.8076536127876128, 4.5324552214381271, -1.197261211131484, 2.2242413859352546, -3.5244985602130718]]]])+(1.-msk_arg1)*numpy.array([[[[-2.7933620830229691, -2.9011833673278176, -1.8713469791810144, 0.450177323741487, 0.53110589688597365], [0.35334780746251848, -3.1689287584567549, 0.99800572350918859, 0.65272146114691765, 1.044046759630227], [-2.6815799267984985, 1.8016364366834567, 1.7635301912816645, -3.5579344370267627, -4.7745497263952892], [-0.471207228811382, -0.97849006998505406, 3.9256448273707409, -1.2917020412854097, -2.9262633836437999]], [[1.9213872908583109, -1.0084613819943335, -3.5845660066069462, -3.7064490510752943, -3.4756903922802063], [-2.3263632319144345, 0.21149208228304062, -1.0143566119986058, -0.3227135189562782, 4.7296680194917418], [-4.8843658786156929, 3.2131141206643647, 2.6135384684212379, -0.75873333795373643, 1.0818647048610996], [-1.6560062025718136, 1.186356659610782, -1.0395158947015357, -1.9926735345880475, 0.78349666958670028]], [[4.3101364589952702, 4.4476553702439343, 1.1312376682504652, -3.920830184053373, -1.2338201259842005], [-1.6397329000197001, -4.1025011683967545, -4.227730343495157, 1.319102516880152, 3.8690447523267135], [4.6808500491251657, -0.73227973309942485, -0.5094239450872271, 2.3952958863163634, -2.1515870843895533], [-3.0010838908473159, 3.2255447343410832, 0.045844834679043878, -3.6894877780804136, 4.4697780646757543]], [[2.3706815890743194, -1.5414947925754721, -0.90843893325129521, 4.9590958151900359, -0.7646496454955285], [-0.86259757844249574, 3.3003360275303084, -0.83820239063151636, -3.1133438552006822, 3.9847409116564751], [2.3041439475515162, -2.7376519011268741, 0.93284184375008206, -1.7755009055949222, -3.8312353239805761], [-3.7016282136626955, 1.833034500186117, -3.962770619636701, -0.28199259839567858, -1.8637800807879188]], [[-3.8551470761519102, 0.25931949914696251, -2.3174358377207147, 1.8062360726050128, 1.410466879739019], [-3.3825563829387773, -1.3194182157758139, -3.1166120123408936, 3.0508264905192419, 2.7448884895787824], [4.2529954653282083, -3.8449040052592522, 1.4041429690151563, -2.1061930208620785, 2.1594778496415135], [-3.2489142379974609, -2.6701648942836567, -0.14364751641609974, 1.8436525493448253, 1.5175456490410379]]], [[[-3.0461632909607061, 4.4930814141068165, 2.0872069709540924, 0.99752396990543613, -1.4520061255372152], [-4.1825714469429069, -0.59329848028208865, 4.0045398987451648, -1.3476250083940808, 3.6811321235202286], [-1.6762850227938522, 4.2281042031774838, -0.42673143006401038, 2.5406518757740812, 3.8092693752487126], [1.0078134487893031, 3.2103176528020292, -1.4178203681573001, 1.1832793903156515, -4.0754191149664321]], [[3.2300342190512321, 3.8306338751656028, -4.7981764855035127, -0.66050771765838423, 0.18184119181797431], [-1.94559973000315, 2.7559650642307503, 4.9402847928019007, -2.0479798873617208, -2.3235631498618412], [4.6205240279094291, 1.2282675442297011, -1.2125594814673866, 3.2196167705871552, 2.4396827342377225], [-1.9476431448074258, 1.2364652385115305, 1.7595564593904633, -2.8355630596058576, 1.581848196229986]], [[-1.102208380335993, -0.67883392317559199, -0.64564379866414257, 1.0458653573979575, -4.2982178198691674], [-2.1966155891718597, -4.2827765554174233, -2.7270804316279387, 1.3017533956102678, -4.8336995797375835], [3.4090499186793419, 2.2884609080599327, -1.3744459058797931, -2.6776108504700336, -0.44920205500347787], [2.081885357013407, 1.9600501223887417, 2.106901458620035, -1.8713133649524227, 2.175866937915627]], [[3.4725186245888935, -1.9626253354897552, 1.2382807302542691, 4.0797645866253323, -3.2255010843813468], [3.7001579010080761, -3.167381810144736, -0.64146681749265788, -1.253828093723933, 0.1302486626315762], [-0.46119523488547998, -4.5896479973300082, 2.2928758598694348, 4.4131560760070485, 4.8492226583377711], [-0.85614165439597834, -1.3291360299904564, -1.1871297208599687, 3.8235973667632361, -3.1925942699912513]], [[1.2486027509163975, 2.4440818749032616, 1.268778006794804, 0.20608758207253697, -1.5399124153938026], [-2.4121111621956559, 1.3946001322880086, 1.5786488587508529, 4.3296822173470879, -4.1502771458059922], [-2.2490910210846526, -3.7258658662519153, 2.0812867775051576, -3.5392944597380005, 0.2557358308339408], [-0.63766568911426624, 4.2326720246884015, -2.5117307667405111, 0.84993908188565293, -3.0746987880887957]]], [[[4.1174498940188116, 3.9965751171384305, -2.2618298755883046, -4.4503702324100836, 2.9657893893340184], [-0.56789373377671293, 3.0264900011839106, 0.7386952772425337, -3.0812764795640812, -3.7160323563858189], [0.64968892031264325, 0.78235929846438257, -3.7614976466377446, -1.233452999950797, -0.47488930271135121], [-2.0065517267040911, 3.8666458467128635, -0.032998923612430175, -0.53925510555041267, -4.0258716646948898]], [[4.4467750000930284, 3.1021529308528546, -1.8972304337174095, 2.2672799719247383, 1.7334577320222948], [-4.7336776914346057, -4.0933821787383993, -3.9609741968909273, -2.9652860317307264, -3.2984924191454281], [2.3967080380663317, -3.4535825099190784, 0.18706265620374385, 4.5577173663520778, -2.5305862623282218], [-3.5469207737351791, 1.3909078404537114, -2.0467331221130722, 3.2965069958054158, -4.988420638502542]], [[-1.3652656336458859, -0.40122267927501909, 0.59351723470480433, -0.48515982596659946, 2.7433631819095403], [-1.7009038267680232, 3.022095158513574, -2.968777995213089, 0.85580174807008191, 2.4278531996915307], [1.9447130055125523, -0.71364637545128229, 3.195032697469312, -0.52763235592785307, -3.1099622164200613], [-1.6583638330872894, 4.5119951311462554, -2.6774257748787891, -3.2184951016792551, 1.1137954681491999]], [[-0.20517330332497785, 4.4858890750095402, -3.0698220194336057, -2.126971790285638, -2.3881442888461999], [-3.6084670095384186, 1.5078601315889308, -1.7710656127319546, 4.9012462541650184, 3.0647861619416599], [-0.74376525252465697, -1.5651104358020804, -0.17584436844610174, 3.2946849745643352, -0.5031400719021768], [0.69801882812870986, -3.1230067168320885, 0.061472949345670713, 4.0198311752410607, -0.1389449485882075]], [[-3.7040242712818272, -2.6955110921583145, 4.0867710802282371, 2.7887558626399258, -3.4972585489005983], [2.7447732541548948, -4.4579563601971444, 3.8672013260705747, -0.21279570981964824, -1.1941253437381083], [2.1890021686599512, -2.3155275174650161, 4.9165359095830183, -4.5867597093742294, 1.6318686858660918], [-2.5511198513066158, -3.6170954443670822, 0.71622562900127562, -1.7590700098504319, -0.34324782335479931]]], [[[-1.433407510323371, 0.12482593668786102, 2.4157377265184898, 3.9970690059236382, -0.7840953144185665], [-2.9360499035009093, 1.0168399950549869, 4.5579973025095022, -2.8652940000218443, 4.6130163784689806], [2.3945239316156712, 3.5663029349214685, -1.1581372781732635, -2.4446812819964792, 0.51985327959768934], [-0.77087273301280046, 3.4175180174412212, -2.0855791700087223, 0.44384784798642851, 2.799073841594419]], [[4.6651251931692723, 1.0142657106881021, 1.2452461231206202, 2.0384470433110753, 2.2733992652300739], [4.2925984028375712, -4.9042924207540315, 4.182304680956701, 2.5030592170668706, -2.2511075741953537], [4.1421054883674273, 1.2194824242944033, -0.25520299255283074, 0.90034991934677766, -3.6324556337866043], [2.3223541078098853, 2.307700090411271, 3.7008767393014956, 2.1460906665584423, -1.5320964345315358]], [[-4.2217772428551692, 0.68811654135845313, 2.9688803439517848, -1.846360409998995, -2.9143032545744774], [-1.521798792732223, -2.7293300682450305, 2.7993133466230251, -1.8687313257706686, -4.3243620691923903], [1.5445725024995651, -2.3032138724276194, -3.686213458966817, 3.8603468713558424, 1.1413179833466645], [2.4054085470890696, -3.0857058378182667, 3.7158926280518507, -2.3657134385823362, -0.85194550478241915]], [[4.1881785460937486, 4.2536761763445305, -0.063487355470090101, -4.0514269372128418, -0.61295089468644548], [-0.137972847141973, 0.59385706565508656, 3.3234950049211047, 2.9756175599103649, 0.84358126094511743], [2.275279395879596, -1.7426621006604437, 4.9649536688450464, 1.8563380916458341, -1.1496932623617706], [3.5077000618428045, 4.6968305990009025, -0.42447146349364218, 2.3003695982998797, -2.8052324771014936]], [[1.3595765650608023, 0.65125018043651828, 3.9217898640745759, -4.3992619601138871, -3.863148061970775], [3.6556526824375357, -4.4923239382243985, 3.2918561546851528, -4.6489009401223882, 1.2808286482002575], [-0.11109743152879226, 4.9230003566302791, 4.8571730668163955, -4.440486803342286, -2.91495115210616], [1.7416266531681401, -3.9925187869476773, -4.4850744836140466, 0.92728961768815843, 2.6737897263509502]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[6.3312560866762215, 2.7733499327247149, 3.8304460774035487, 5.9919756597643099, 2.652929293902127], [8.1057031728389202, 4.6184315461034746, 7.0784040145865017, 8.5954269542447932, 1.5174381057853208], [0.91598682550873622, 3.3817329897491581, 5.4260428661231916, 6.2045541161795814, 7.3444461696672931], [7.2459311823250632, 6.7738824473287531, 1.721531581161813, 8.3846612627363566, 0.82752722148590596]], [[-1.1663981650873874, 4.5968882783818668, -0.28171411336256869, 0.85059105918614897, -0.72557770923435605], [1.6703470860635239, 2.4722726255991443, 3.4183731565568234, -3.1553443018208638, 0.14848337538177736], [1.0032513993823198, 2.0188400429869846, 1.1314168257561263, -2.9285167173404458, -2.2178197008227039], [4.4869023169439188, -1.6836834681188169, -0.73820636166366871, 2.8568922447261196, 3.5006882496017706]], [[2.0891951817117027, 5.3862930749253257, 5.1536527512709798, 2.2389020488715188, -2.9770380810218926], [-2.0438341362781287, 4.3464933360622018, 4.8840549143030332, -3.0858358541979549, 2.0413288565166612], [1.7780571333961257, -2.1976202554886042, 4.7445530082838987, -1.5657143472646631, -0.65067701024776436], [-2.8697306583765805, 2.4068141961648912, 1.2156049605028638, 5.1882293422027095, -0.79367258993016243]], [[-1.049573031089571, -1.0639227521582719, -7.2096567554190969, -1.7959878836669607, -2.7154566784641774], [-3.0203793601716353, -2.4292362292413361, 0.83176542454331726, -2.1258469134024351, -1.4664196803773719], [1.3317101195810062, 0.47902459822452714, -2.7039179210104662, -5.1019441110426129, 1.4750900626330616], [-5.3404488805370809, -3.2145722081841046, -1.6290381903677686, -5.093470182444225, -0.81569591333137614]], [[-3.3022729015516461, -4.2448214618583773, 3.9409845494007669, 0.63750652308221767, -2.7384821376276647], [3.2973027000090918, 4.6159661721162752, 0.47898221486604964, 3.9304154306888766, 4.2758569859941105], [3.7803441798631336, 4.3271649113897084, 5.0628513788373191, 2.9128684352370069, -0.34505805146203805], [3.9516750679453274, 0.17906941192197223, -1.4790723715800258, 1.1143931913495955, 0.14256157112878309]]], [[[0.76524982186733581, -8.0851629338845292, -4.4825182894841813, -3.9074140359489231, -3.7767754687846757], [-4.6858022137547426, 0.76426260787713574, -1.0420501115073701, -8.1513990786664507, -3.8170861621571204], [-0.31272667386156172, -6.1914075532687285, -4.516575453529045, -8.268722661996657, -7.1075708176256915], [-2.3733663946272934, -3.4353674921519275, -1.3789992535812869, -4.7568857488442307, -8.2477908661964019]], [[2.9368376573628523, -6.3639777597718012, -3.2416368752071101, -0.30070673018437466, 0.30656765089648319], [-4.921644341863189, -3.0830446997839158, -6.1623239254068967, -3.7756858561338205, 1.661135741850106], [2.3815250961551384, 1.2073445873701272, 1.1630042529119202, -6.2179267753346377, -2.1998529785477801], [0.77789403917610889, 2.1772483123471083, -0.63116450756342113, -4.6299407617494808, 2.1759771479332062]], [[5.3692954499124808, 6.4598198817462702, 3.1588231370092181, 2.6877315259717678, -0.77216688784284138], [4.1658996315619952, 6.4215755963600447, -0.39131787223274506, 5.1093104392911437, 2.6198004893794504], [3.8523123773093602, -1.7195044427929078, -1.8509898718353242, -1.8150260255582831, 2.9188206343059795], [4.3227721735017486, 4.0517692278443196, 3.7318952507283782, 3.0528754314596203, 3.3344561529558305]], [[-2.5175458467438618, -2.8844826898178901, -5.2025189445042868, 0.34485977952972302, -0.023100479990130651], [-2.5750378709651889, -5.597074103569887, 2.7891007301810911, -0.46805036650074516, -3.5326228214310484], [-2.2931041078932468, -0.60514828884341121, 2.5473011190092114, -1.3126990863374957, -0.89748212246259751], [-0.98026843823439513, -0.059697129835940999, 0.13376101129067397, -2.3198185127200039, -2.1171522145752988]], [[-7.7389974104266939, -4.4237802311715511, -4.2313796142306623, -5.3400273029085179, -5.3682144012430788], [0.99696019009013614, -4.6022599574767531, -0.3333328894948826, -2.6025072583715998, -7.0594158428466809], [-6.68314518079859, -0.99299288723014723, -4.1299858816594996, -4.0081124454010162, -2.2723685235723687], [-2.1338504892214738, -6.2309877441388428, -1.411997255326094, -7.0808587253052169, -1.0490020297082534]]], [[[-2.4841753077135902, 1.4383083504659346, -3.6895815102319718, 0.8534543458140007, 1.8132246926959805], [-0.38347513086649077, 0.26025672075437178, 0.20223404983970017, -5.1994729927693104, -0.74889226851654023], [-4.9931996016110505, -2.8464809660031722, -1.9138693545176828, 2.2994379496602946, 1.5890150014735465], [3.5596019097086646, -1.4289955469132947, -3.016070817358, -0.25444335049048217, 0.72080680645986472]], [[-2.1484891286452319, 1.1189141417216888, -3.0544106882975703, 4.912290826777177, -4.5450531317393823], [-0.71749074520916256, -1.5689333917002344, 4.19235428592423, -4.2335315770728252, -4.5267082384825326], [3.1360054729186757, -2.8487640268579413, -0.49568259045828, 3.9845146130279314, 0.22296731807120196], [1.9803470021793403, -1.3393026440886375, 4.9128374267200954, -0.5266505402320325, 3.9531755463287332]], [[-5.5543856047225706, -1.9216174394728238, -5.1718854083746022, -3.5040812893030022, -3.8520064005706551], [-8.6589313151183767, -7.9615354512542842, -1.1388422215276739, -7.1810322202853545, -7.6761641504165388], [-2.3069846305586017, -3.5862637204195238, -7.7104552019367576, -4.4121050393680008, -7.1501571194941027], [-7.3510455490714373, 0.89605435191694127, -7.6274474906430632, -3.638005611698631, -7.6404197109858805]], [[3.634657809064751, 5.2230439249225054, 3.2766790600716877, 7.9591824674081995, 8.3081577912227971], [6.3125799473056547, 5.3353221985186998, 2.5329059401253362, 0.68062191652143689, 8.2284802078240435], [3.697945616735355, 8.0396754410079136, 5.7734218457305575, 6.8193462620134451, 0.94711972329874161], [3.9852398190294878, 6.7125737044127192, 4.3849618702052062, 7.4203088741029344, -0.046971155738480874]], [[-2.4700573696688188, -2.4292471477292477, -2.7135987156232888, 5.9127156747388838, 2.2737287043869925], [-2.5099337839148372, 5.7483375108775459, 0.38419798132629079, 3.3799000982291849, 4.8775148974901263], [3.1991554565725133, -1.6329138406409274, 4.2902077559287886, -2.7012322823319481, 5.0549353195196574], [-2.517875039199625, 1.6834696728225094, 0.55684653698631603, 6.651752848235807, 3.7832589642882901]]], [[[1.8604717043497105, -2.577600775147399, 0.73813965554862637, 3.5143573379216138, 1.8088160151096107], [2.6252614250700477, 3.2845001484244056, -4.3444937587187278, 1.147410994794277, 0.67717590552734208], [-0.75883830817431175, 0.13442678668161978, 1.0614635739228833, -1.8617007313259943, -3.9849661128649148], [3.5294974363295806, -1.7003450032175227, -4.1570796426746481, 3.7241684808592064, 3.9876432321586313]], [[6.2854342584056937, 1.9791605955104572, 6.2599172372763796, 1.0003330994424724, 5.8241090545427383], [3.6654124068306935, 5.5720783465488903, -0.72037855656493122, 5.8512572845879944, 3.9434602693922383], [2.0121313372983227, -1.4949969494233928, 4.3378502693657488, 1.4939526543603243, 5.8760546344789439], [4.5268666273475491, 1.2749255586822983, 0.16433775712330956, 1.424738410209816, 6.6466861637343033]], [[5.6593669507070743, 7.1640868586087407, 3.3355267994089361, 6.5430965009222994, -0.48817072672856998], [6.382587037799996, 1.3593251163220286, 3.8575871149271732, 2.9857040709267322, 4.3603042193919883], [6.1796210422926414, -0.54179501101008221, -0.026745967492617595, -1.1522207680354306, 5.3371300111699744], [6.4522279415684745, 0.20647948271498962, 4.8218573385224843, 7.2962281410301024, 1.0107150372440641]], [[-3.6218412403951321, 0.45274674539449489, -3.6849241389620362, -8.9216582070617108, -5.3851763270903703], [-6.0368501402231427, -8.1170791454623572, -2.0053857217794233, -0.91472891163379533, -6.8996310265834389], [-3.6318261149514663, -7.4389372684974173, -7.4083504328392955, -0.41576781451160638, -2.7212466986009796], [-3.7617184779198984, -7.7489955167286162, -4.0204755402523764, -4.5250339571160403, -1.4591261899410446]], [[5.6480788445813221, 4.3325729465861427, 0.86512129292194295, 2.2435321857057762, 1.5836059396526689], [-0.76838780856351896, 5.9948862394562816, 6.2368199181473489, 6.5850651699077432, 3.7512483234093441], [0.33324296579378565, 5.2936544939155254, 4.7109368506479843, 4.5134365064402244, 3.7408184262199127], [1.5615409067735495, 7.9016497409992894, 2.1719333084296784, 5.5934359054964169, -0.1553040406519095]]]])+(1.-msk_ref)*numpy.array([[[[1.8092349999857751, 1.7014137156809266, 2.7312501038277297, 5.0527744067502312, 5.1337029798947178], [4.9559448904712626, 1.4336683245519892, 5.6006028065179327, 5.2553185441556618, 5.6466438426389711], [1.9210171562102456, 6.4042335196922009, 6.3661272742904087, 1.0446626459819814, -0.17195264338654503], [4.1313898541973622, 3.6241070130236901, 8.5282419103794851, 3.3108950417233345, 1.6763336993649443]], [[3.2417805092518197, 0.31193183639917521, -2.2641727882134375, -2.3860558326817856, -2.1552971738866975], [-1.0059700135209257, 1.5318853006765494, 0.30603660639490293, 0.99767969943723056, 6.0500612378852505], [-3.5639726602221842, 4.5335073390578735, 3.9339316868147467, 0.56165988043977233, 2.4022579232546084], [-0.33561298417830487, 2.5067498780042907, 0.28087732369197305, -0.67228031619453876, 2.103889887980209]], [[5.1015865827650435, 5.2391054940137076, 1.9226877920202385, -3.1293800602835997, -0.44237000221442724], [-0.84828277624992676, -3.3110510446269812, -3.4362802197253837, 2.1105526406499253, 4.6604948760964868], [5.472300172894939, 0.059170390670348461, 0.2820261786825462, 3.1867460100861367, -1.36013696061978], [-2.2096337670775426, 4.0169948581108565, 0.83729495844881718, -2.8980376543106403, 5.2612281884455276]], [[-0.81268964243321973, -4.7248660240830116, -4.0918101647588347, 1.7757245836824969, -3.9480208770030676], [-4.0459688099500344, 0.11696479602276932, -4.021573622139055, -6.2967150867082218, 0.80136968014893606], [-0.8792272839560229, -5.9210231326344136, -2.250529387757457, -4.9588721371024613, -7.0146065554881147], [-6.8849994451702345, -1.3503367313214221, -7.1461418511442396, -3.4653638299032177, -5.0471513122954583]], [[-3.1201530792738286, 0.99431349602504415, -1.5824418408426331, 2.5412300694830945, 2.1454608766171006], [-2.6475623860606956, -0.58442421889773222, -2.3816180154628119, 3.7858204873973236, 3.479882486456864], [4.9879894622062899, -3.1099100083811706, 2.139136965893238, -1.3711990239839968, 2.8944718465195951], [-2.5139202411193793, -1.935170897405575, 0.5913464804619819, 2.5786465462229069, 2.2525396459191196]]], [[[-7.0383432112856958, 0.5009014937818268, -1.9049729493708973, -2.9946559504195536, -5.4441860458622049], [-8.1747513672678966, -4.5854784006070783, 0.012359978420175111, -5.3398049287190705, -0.31104779680476113], [-5.6684649431188419, 0.23592428285249412, -4.4189113503890001, -1.4515280445509084, -0.18291054507627713], [-2.9843664715356866, -0.78186226752296051, -5.4100002884822898, -2.8089005300093381, -8.0675990352914226]], [[1.523197383577084, 2.1237970396914547, -6.5050133209776604, -2.3673445531325323, -1.5249956436561738], [-3.6524365654772981, 1.0491282287566022, 3.2334479573277526, -3.7548167228358689, -4.0303999853359898], [2.913687192435281, -0.47856929124444703, -2.9193963169415347, 1.5127799351130071, 0.73284589876357442], [-3.6544799802815739, -0.47037159696261766, 0.052719623916315239, -4.5423998950800062, -0.12498863924416215]], [[1.5088091117524911, 1.9321835689128921, 1.9653736934243415, 3.6568828494864416, -1.6872003277806833], [0.41440190291662438, -1.6717590633289392, -0.11606293953945457, 3.9127708876987519, -2.2226820876490994], [6.020067410767826, 4.8994784001484168, 1.236571586208691, -0.06659335838154945, 2.1618154370850062], [4.6929028491018911, 4.5710676144772258, 4.7179189507085191, 0.73970412713606137, 4.7868844300041111]], [[1.8512856254538628, -3.5838583346247859, -0.38295226888076161, 2.4585315874903015, -4.8467340835163775], [2.0789249018730453, -4.7886148092797667, -2.2626998166276886, -2.8750610928589637, -1.4909843365034545], [-2.0824282340205107, -6.2108809964650389, 0.67164286073440405, 2.7919230768720178, 3.2279896592027404], [-2.4773746535310091, -2.9503690291254872, -2.8083627199949994, 2.2023643676282054, -4.813827269126282]], [[-2.2823705232721094, -1.0868913992852454, -2.2621952673937029, -3.32488569211597, -5.07088568958231], [-5.9430844363841633, -2.1363731419004983, -1.952324415437654, 0.79870894315858099, -7.6812504199944991], [-5.78006429527316, -7.2568391404404222, -1.4496864966833494, -7.0702677339265074, -3.2752374433545661], [-4.1686389633027732, 0.70169875049989461, -6.042704040929018, -2.681034192302854, -6.6056720622773026]]], [[[2.977921082294424, 2.8570463054140429, -3.4013586873126922, -5.5898990441344711, 1.8262605776096308], [-1.7074225455011005, 1.8869611894595231, -0.40083353448185388, -4.2208052912884693, -4.8555611681102064], [-0.48983989141174433, -0.35716951326000501, -4.9010264583621321, -2.3729818116751846, -1.6144181144357388], [-3.1460805384284787, 2.7271170349884759, -1.1725277353368178, -1.6787839172748003, -5.1654004764192774]], [[4.6930127572866969, 3.3483906880465231, -1.650992676523741, 2.5135177291184068, 1.9796954892159633], [-4.4874399342409372, -3.8471444215447308, -3.7147364396972589, -2.7190482745370579, -3.0522546619517597], [2.6429457952600002, -3.20734475272541, 0.43330041339741232, 4.8039551235457463, -2.2843485051345533], [-3.3006830165415106, 1.6371455976473799, -1.8004953649194038, 3.5427447529990843, -4.7421828813088736]], [[-5.2384555034766622, -4.2744125491057954, -3.279672635125972, -4.3583496957973757, -1.129826687921236], [-5.5740936965987995, -0.85109471131720227, -6.8419678650438653, -3.0173881217606944, -1.4453366701392456], [-1.928476864318224, -4.5868362452820586, -0.67815717236146433, -4.4008222257586294, -6.9831520862508381], [-5.5315537029180657, 0.6388052613154791, -6.5506156447095654, -7.0916849715100314, -2.7593944016815763]], [[3.1422787130515299, 7.8333410913860479, 0.27762999694290214, 1.2204802260908698, 0.95930772753030791], [-0.26101499316191079, 4.8553121479654386, 1.5763864036445532, 8.2486982705415262, 6.4122381783181677], [2.6036867638518508, 1.7823415805744274, 3.1716076479304061, 6.642136990940843, 2.844311944474331], [4.0454708445052177, 0.22444529954441927, 3.4089249657221785, 7.3672831916175685, 3.2085070677883003]], [[-1.9493217838837142, -0.94080860476020156, 5.8414735676263501, 4.5434583500380388, -1.7425560615024853], [4.4994757415530078, -2.7032538727990314, 5.6219038134686876, 1.5419067775784647, 0.56057714366000466], [3.9437046560580642, -0.5608250300669031, 6.6712383969811313, -2.8320572219761164, 3.3865711732642048], [-0.79641736390850282, -1.8623929569689692, 2.4709281163993886, -0.0043675224523189726, 1.4114546640433137]]], [[[-1.9670235833706347, -0.40879013635940264, 1.8821216534712262, 3.4634529328763746, -1.3177113874658302], [-3.469665976548173, 0.48322392200772324, 4.0243812294622385, -3.398910073069108, 4.0794003054217169], [1.8609078585684076, 3.0326868618742049, -1.6917533512205272, -2.9782973550437428, -0.013762793449574318], [-1.3044888060600641, 2.8839019443939575, -2.6191952430559859, -0.08976822506083515, 2.2654577685471553]], [[6.4615449824054902, 2.81068549992432, 3.0416659123568381, 3.8348668325472932, 4.0698190544662918], [6.0890181920737891, -3.1078726315178136, 5.978724470192919, 4.2994790063030885, -0.45468778495913575], [5.9385252776036452, 3.0159022135306213, 1.5412167966833872, 2.6967697085829956, -1.8360358445503864], [4.1187738970461032, 4.1041198796474889, 5.4972965285377136, 3.9425104557946602, 0.26432335470468216]], [[-0.7595418570889203, 4.150351927124702, 6.4311157297180337, 1.6158749757672539, 0.54793213119177153], [1.9404365930340259, 0.73290531752121835, 6.261548732389274, 1.5935040599955803, -0.8621266834261414], [5.006807888265814, 1.1590215133386295, -0.22397807320056806, 7.3225822571220913, 4.6035533691129134], [5.8676439328553185, 0.37652954794798221, 7.1781280138180996, 1.0965219471839127, 2.6102898809838297]], [[0.21669763624009786, 0.28219526649087978, -4.0349682653237409, -8.0229078470664916, -4.5844318045400962], [-4.1094537569956238, -3.3776238441985642, -0.64798590493254604, -0.99586334994328585, -3.1278996489085333], [-1.6962015139740547, -5.7141430105140945, 0.99347275899139564, -2.1151428182078167, -5.1211741722154214], [-0.46378084801084629, 0.72534968914725173, -4.3959523733472929, -1.671111311553771, -6.7767133869551444]], [[4.7287710846219646, 4.0204446999976806, 7.2909843836357382, -1.0300674405527248, -0.49395354240961264], [7.0248472019986981, -1.1231294186632361, 6.6610506742463151, -1.2797064205612259, 4.6500231677614199], [3.2580970880323701, 8.2921948761914415, 8.2263675863775578, -1.0712922837811236, 0.45424336745500238], [5.1108211727293025, -0.62332426738651492, -1.1158799640528843, 4.2964841372493208, 6.0429842459121126]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_expandedData_rank3(self):  
       arg0=Data(numpy.array([[[-0.33580497990791436, 3.3118418875514806], [3.9535752895971203, 4.3396272888596528]], [[-2.9279747471563109, -2.2804955564137019], [1.3014155979506858, 3.8449143191665627]], [[-0.80984099681663935, -2.092225884015785], [-4.571044476680922, 2.3777961596996491]], [[2.2008046678919948, 1.559000593205031], [1.0891279330380392, -2.4240577486015349]], [[-1.7585762100468072, 4.288058550220704], [4.6839624033289198, -1.047285210579826]], [[-4.9822922648146664, -0.58118991047564883], [-4.3260395373367082, -2.8933761886995391]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[-2.3284472679722903, 3.8817783246853406], [2.7663920616637334, -2.69955038298452]], [[0.72937242108648803, -1.624838586325601], [-2.8859155449927885, 3.6541219113553929]], [[0.42151497124054771, 2.095507523084966], [3.8829091390419492, -2.7123088855381541]], [[3.1475490774784944, 4.2626531435574702], [-0.75562502113725039, 1.5974276273387051]], [[0.34136613990677134, 4.45594158416365], [3.4145151226625341, -1.6623865831742632]], [[1.5725825482777971, 3.4553094240419959], [1.7590326450188476, -1.1640613537790037]]])+(1.-msk_arg1)*numpy.array([[[4.9116581425260026, -1.6857355787822681], [2.4747507163571676, 3.177298041503855]], [[-2.6553273682429737, -4.751000883459648], [4.2292833874606544, 0.60362957765049785]], [[-2.8961420141112795, 3.6873678446562099], [-4.1154272069873512, -0.92478556282234692]], [[2.0984497945338489, -4.3878269345012804], [-3.5317478459180487, -0.17493265929025448]], [[-3.8365243636935298, -0.71950120942087725], [1.6287209393629585, 2.3400603023831756]], [[3.1785921582280903, -0.74281019833495066], [-3.6377586053734379, 1.8345364813123606]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[-2.6642522478802046, 7.1936202122368211], [6.7199673512608538, 1.6400769058751328]], [[-2.1986023260698229, -3.9053341427393029], [-1.5844999470421026, 7.4990362305219556]], [[-0.38832602557609164, 0.0032816390691809971], [-0.68813533763897272, -0.334512725838505]], [[5.3483537453704892, 5.8216537367625012], [0.33350291190078885, -0.82663012126282975]], [[-1.4172100701400359, 8.7440001343843541], [8.0984775259914539, -2.7096717937540893]], [[-3.4097097165368693, 2.8741195135663471], [-2.5670068923178606, -4.0574375424785423]]])+(1.-msk_ref)*numpy.array([[[4.5758531626180883, 1.6261063087692125], [6.4283260059542879, 7.5169253303635077]], [[-5.5833021153992846, -7.0314964398733499], [5.5306989854113402, 4.4485438968170605]], [[-3.7059830109279188, 1.5951419606404249], [-8.6864716836682732, 1.4530105968773022]], [[4.2992544624258437, -2.8288263412962493], [-2.4426199128800095, -2.5989904078917894]], [[-5.5951005737403374, 3.5685573407998268], [6.3126833426918783, 1.2927750918033496]], [[-1.8037001065865761, -1.3240001088105995], [-7.9637981427101465, -1.0588397073871785]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_expandedData_rank3(self):  
       arg0=Data(numpy.array([[[[-0.92741387926905716, -1.1963022751234287], [1.05521953972488, 3.3459931896930968]], [[-4.4634540391171118, 1.5473237382729526], [4.2838676735241634, 0.46082307744147766]]], [[[1.3896023524560412, -2.9529489045213109], [-4.1483706502264255, 1.9389745469931032]], [[-0.38225485788896041, -1.220953927674274], [2.3090447974652717, -3.0182685235693016]]], [[[2.6609285156123716, 0.61708055690885555], [3.0516643983079472, 1.2863656863794004]], [[-3.0072642881613088, 3.8563248998804873], [-3.251759852132178, -0.18817495641686133]]], [[[0.30440371461111315, -1.6200415440988634], [0.75385725681026283, 4.2571027777699495]], [[-3.6233558585631997, 2.9777255131821043], [2.0999248480952071, 1.1065341188121742]]], [[[-0.14005348653535243, -4.7895322486250773], [-2.397727078838241, -3.0708584283819151]], [[-1.8447913731691914, 4.9126276898259764], [-3.0837149796206664, 3.9210957025264044]]], [[[-3.6847355615400801, -3.3805007620183525], [-0.25229886731645479, -4.9611897660580349]], [[-2.7940310667497323, 4.5653587168826633], [0.20820899635344503, -2.9250796098190044]]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[2.3926068210043532, 2.3572330640206847], [2.8873139514143435, 3.2693251810041488]], [[-2.3215380633456362, 1.4515485719343113], [-1.7214514255586657, -3.3215533128010053]], [[-3.8698341450774754, 4.6863185544146031], [-0.49421873293667673, 2.019021292095168]], [[1.7494795717427367, 4.7394947197867925], [2.9325545618229771, 4.1906144509026646]], [[-3.7687456352215962, 3.3643116225425516], [-0.43805974943670112, -2.3266760632993155]], [[-2.9270827358887219, 1.1365256376027055], [4.9844859170566753, 2.1457026486463615]]])+(1.-msk_arg1)*numpy.array([[[3.5733752660479485, 4.76233742838523], [4.127722989671625, 0.80436507349339248]], [[4.4122263260924441, 4.2165390409312469], [-4.5687195838427694, -3.0425367017233018]], [[4.2558774171972118, 4.413787678089049], [-1.8186137138154956, 4.6476706416570686]], [[0.16669923701945955, -0.6810245814126219], [-3.9280468606407637, 3.9594542007530382]], [[4.7682934591064647, 2.9747216391069475], [4.6371046493795749, -3.6632063460063691]], [[4.2366877516168238, -3.1994922955229468], [2.8615373866115457, -0.73909470099084995]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[1.465192941735296, 1.1963045458809245], [3.4124526037455647, 5.7032262537137814]], [[-1.5761400877027683, 4.4346376896872961], [7.5531928545283122, 3.7301482584456265]]], [[[-0.93193571088959493, -5.274486967866947], [-2.6968220782921142, 3.3905231189274145]], [[-2.1037062834476261, -2.9424053532329397], [-1.0125085153357336, -6.3398218363703069]]], [[[-1.2089056294651037, -3.2527535881686198], [7.7379829527225503, 5.9726842407940035]], [[-3.5014830210979855, 3.3621061669438106], [-1.23273856003701, 1.8308463356783067]]], [[[2.0538832863538499, 0.12943802764387335], [5.4933519765970553, 8.996597497556742]], [[-0.69080129674022261, 5.9102800750050815], [6.2905392989978717, 5.2971485697148388]]], [[[-3.9087991217569487, -8.5582778838466744], [0.96658454370431057, 0.29345319416063642]], [[-2.2828511226058925, 4.4745679403892753], [-5.410391042919982, 1.5944196392270888]]], [[[-6.611818297428802, -6.3075834979070748], [0.88422677028625074, -3.8246641284553293]], [[2.190454850306943, 9.5498446339393386], [2.3539116449998065, -0.77937696117264288]]]])+(1.-msk_ref)*numpy.array([[[[2.6459613867788914, 2.3770729909245198], [5.81755696811011, 8.1083306180783268]], [[-0.33573104944548682, 5.6750467279445775], [5.0882327470175559, 1.2651881509348701]]], [[[5.8018286785484854, 1.4592774215711333], [0.068168390704821391, 6.1555135879243501]], [[-4.9509744417317298, -5.7896735115170435], [-0.73349190425803013, -6.0608052252926035]]], [[[6.9168059328095834, 4.8729579741060673], [7.4654520763969963, 5.7001533644684494]], [[-4.8258780019768039, 2.0377111860649917], [1.3959107895248906, 4.4594956852402072]]], [[[0.4711029516305727, -1.4533423070794038], [0.072832675397640934, 3.5760781963573276]], [[-7.5514027192039634, -0.95032134745865937], [6.0593790488482453, 5.0659883195652124]]], [[[4.6282399725711123, -0.021238789518612577], [0.57699456026870655, -0.096136789274967605]], [[2.7923132762103835, 9.5497323392055513], [-6.7469213256270351, 0.25788935652003531]]], [[[0.55195219007674368, 0.85618698959847128], [-3.4517911628394016, -8.1606820615809816]], [[0.067506319861813324, 7.4268961034942089], [-0.53088570463740492, -3.6641743108098543]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_expandedData_rank4(self):  
       arg0=Data(numpy.array([[[1.9849114148705631, 3.2211439512578561], [-4.1364507198131744, 4.5113993555715641]], [[1.4136330069746172, 3.3004856367073838], [-1.5713668246232357, 3.231586660100584]], [[4.4601484816354429, -1.2402487437931287], [0.24617763250851787, -1.7389192899256578]], [[0.41804879390227434, 4.0881261614384989], [-2.9235347734300312, 4.1155073674320555]], [[-2.6566447299190141, -2.4337416268703893], [-4.9733171928257827, 3.5492603853695783]], [[0.94828652502450073, 4.5520871107981069], [4.6387821375992093, 0.65063186568594311]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[2.0749925446210815, 1.825957719562048], [-2.0560365860495544, 4.9543038408546831]], [[0.36633943388951451, -4.5938726208198286], [2.895296113575804, -1.5393724248336991]]], [[[-3.489691156325275, 2.7022910859268983], [1.8652567475177486, 4.4127744479823576]], [[-2.2798384170752053, 1.8633141829395239], [-2.4601283819421571, -1.7755346792660509]]], [[[-3.0204590082297167, 3.3813286220524841], [3.6934424750621879, 1.3775607460617341]], [[-0.46330560723288983, 4.0232536598010213], [1.6764563682141649, 0.15133977470293747]]], [[[3.7304680931471008, -4.8196848469669558], [-1.5465912348672894, 2.3313639949605047]], [[2.4133794732766889, 3.3677315881377048], [-4.4216538604642883, -4.8518065727437607]]], [[[4.4017972765815454, -4.7435195423897625], [3.6882723804103215, -1.4510060429265992]], [[3.4046952655777911, 4.2263295349449397], [-4.1727248353560009, -4.808639707620344]]], [[[3.5455146789060539, 4.6147264393745484], [0.77127235639938796, -0.099614341383713167]], [[2.1377486792093237, 1.0391551551958678], [1.9520389982751771, -2.247564265760996]]]])+(1.-msk_arg1)*numpy.array([[[[3.3006456205282113, -2.2717423528035652], [-0.48768991167429476, -0.69050422680197254]], [[0.45186375408439616, -1.5791506391458499], [-4.4394667823272185, 0.7866459153808627]]], [[[-4.3982496767169774, 4.7943853962394769], [1.9368030012687374, -2.6979740451936229]], [[-1.0186890143445302, -4.9081257707917256], [2.23240248347249, -3.3067708633967841]]], [[[1.7639759765311078, -4.2295831744771997], [3.8745320880113372, 0.66772966762037989]], [[4.6674521003426737, 1.4950853046343315], [0.41004958621908827, -3.6213904373715944]]], [[[2.4561605918296987, -3.0345796381955861], [2.471044208221044, -4.5201819630384055]], [[3.6000842340742096, -0.55145176146563735], [-3.1202410785803316, -1.0446509367154242]]], [[[-1.8721290856553519, 3.8332321881474059], [0.40342581308881442, 0.89154357808448559]], [[-4.6648538114550666, 2.1257406365806739], [3.9031944877884683, -0.091555436602233087]]], [[[-3.0930165720359359, -2.8404092815168447], [-1.3952160548895023, 3.7286651365014247]], [[-1.0217551933525604, 3.5657937665891684], [-1.2543114396205981, -2.9621898637555253]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[4.0599039594916446, 3.8108691344326111], [1.1651073652083017, 8.1754477921125392]], [[-3.7701112859236598, -8.730323340633003], [7.4066954691473681, 2.9720269307378651]]], [[[-2.0760581493506578, 4.1159240929015155], [5.1657423842251324, 7.7132600846897414]], [[-3.851205241698441, 0.29194735831628815], [0.77145827815842694, 1.4560519808345331]]], [[[1.4396894734057262, 7.8414771036879269], [2.4531937312690593, 0.1373120022686054]], [[-0.21712797472437195, 4.2694312923095392], [-0.062462921711492925, -1.5875795152227203]]], [[[4.1485168870493752, -4.4016360530646814], [2.5415349265712095, 6.4194901563990037]], [[-0.51015530015334232, 0.44419681470767358], [-0.30614649303223285, -0.73629920531170523]]], [[[1.7451525466625313, -7.4001642723087766], [1.2545307535399322, -3.8847476697969885]], [[-1.5686219272479915, -0.74698765788084298], [-0.62346444998642259, -1.2593793222507657]]], [[[4.4938012039305546, 5.5630129643990491], [5.3233594671974949, 4.4524727694143937]], [[6.776530816808533, 5.6779372927950771], [2.6026708639611202, -1.5969324000750529]]]])+(1.-msk_ref)*numpy.array([[[[5.2855570353987744, -0.28683093793300207], [2.7334540395835614, 2.5306397244558836]], [[-3.6845869657287782, -5.7156013589590238], [0.071932573244345654, 5.2980452709524268]]], [[[-2.9846166697423602, 6.2080184032140941], [5.2372886379761212, 0.60251159151376088]], [[-2.5900558389677659, -6.4794925954149614], [5.4639891435730741, -0.075184203296200014]]], [[[6.2241244581665507, 0.23056530715824319], [2.6342833442182085, -0.57251907617274878]], [[4.9136297328511915, 1.7412629371428494], [-1.3288697037065695, -5.3603097272972526]]], [[[2.874209385731973, -2.6165308442933117], [6.5591703696595429, -0.43205580159990653]], [[0.67654946064417842, -3.4749865348956686], [0.99526628885172386, 3.0708564307166313]]], [[[-4.5287738155743664, 1.1765874582283917], [-2.0303158137815749, -1.5421980487859037]], [[-9.6381710042808493, -2.8475765562451087], [7.4524548731580467, 3.4577049487673452]]], [[[-2.1447300470114352, -1.892122756492344], [3.1568710559086046, 8.2807522472995316]], [[3.6170269442466489, 8.2045759041883777], [-0.60367957393465499, -2.3115579980695822]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_expandedData_rank4(self):  
       arg0=Data(numpy.array([[[[-4.2653882745269307, -0.19011807242889134, 1.7181025750165198, 1.190085633858871], [2.9451920543803647, 1.7980173142431477, 0.29364166549559023, -0.97262568287803042], [1.4959845864044672, 3.7415840055586767, -0.21359289577701013, -0.65663469970851018]], [[-4.2157698474192955, 3.6743973172740105, -1.1849564734741449, 2.6280628766173884], [-0.31430090209559403, 4.8259413432266971, 2.0483088223179537, 3.5540514043328013], [0.38325049961345492, 2.5443350928199617, 4.7026415860071342, -0.77892386463710306]]], [[[1.5134536466964352, -2.1728145263404262, 3.0929361260530257, 1.7615866362567889], [2.7387971496669286, -2.6806622949642813, 2.0842644065225304, 1.1686015692018472], [-2.7691507908861466, -0.60888186198191274, 3.7499875619920164, 0.72576490137006111]], [[-3.0735664229766413, -0.50392379176395163, -0.95548159680480182, 1.0219723944244654], [-4.0444359548181268, -0.028762125369997449, -2.370573972625265, 1.6849280247602705], [-1.8337039900006413, 3.721578659627836, -1.4092470448957704, -1.8420560676723263]]], [[[-3.701307260432376, -0.0085047182274955446, 1.8151830067985575, -4.6094934493293858], [4.9307973426903757, 0.85706451514586668, 0.1100366180238801, -4.5040782430415929], [-0.7687084543578262, -1.4053962945383236, 3.2535659052537049, 2.4513015713480799]], [[-1.2999899910003343, -0.67669251520088913, 2.6469755978751071, 3.1221672072433595], [-4.487819173561082, 0.52427374215247902, 4.8528008379550407, 3.3600023234710115], [-4.3886238524809169, 3.5242623813659062, -2.3969907383482325, -0.29289074674398652]]]]),self.functionspace)  
       msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)  
       arg1=msk_arg1*numpy.array([[[[-3.9696633990847863, 0.59286943569009765, -3.2396697618622703, -2.1551854563641095], [-2.7049731707604394, -0.081510110363971933, -1.0481443671920596, 1.419212944484423], [-1.4656471096438528, 4.0752922915106087, 2.5427224084127111, -3.5661286909447263]], [[-3.2714515031318445, 2.9455201268810507, -4.4208628524478009, 4.1309682545994733], [-1.1001232566461008, -3.2783998740236209, 3.3743583002420454, -2.1317765385113807], [-1.0826604627524716, 4.2240761622633087, -4.5188151627227722, -0.52065606278516618]]], [[[2.082334875204408, -3.273523489233753, -1.2288997060541726, -2.6415852542701677], [3.8856879451795194, 0.36608244406822621, -2.4204497477212206, 3.0303079985039574], [0.69908938604403925, -2.4342224868217963, -0.47152994845851115, 4.7298014462018205]], [[1.4363666516036275, -4.1543375042037542, -3.1551663406423316, -1.2064217603986451], [-0.86464907940327329, -4.5342303064682223, 3.3116186555759182, 3.6953273316026163], [-1.3884950107369196, -3.7131504751341451, -4.0364878066784895, -1.9730213148382383]]], [[[-1.9719808325923505, 3.8216457440242309, -1.8470402316730752, 1.9567280347513663], [-4.7284601271979687, -0.61461733065966495, 3.522712699348272, 3.752062693334075], [1.1821706325958568, 4.4600040857045862, -1.6359853484573961, -2.5120356400728938]], [[2.3351676579882081, -0.32965065690538786, 3.9299765247363752, 3.0453269854915774], [0.89967038581911751, -2.7020614794477771, 1.1611911786563969, 2.2639288529628141], [4.2826774566151347, 3.7464854005897212, -2.9121900053455607, -0.30057896525704919]]]])+(1.-msk_arg1)*numpy.array([[[[1.7582791887663518, 0.70034159343434244, 4.2376684983729636, -4.5574371105273359], [-3.2415329473603016, 0.12255597997259304, 4.6600830556204524, 4.5588735022177609], [1.1695078641847632, -2.1645631082103476, -1.3230294116783439, 2.3443530307228624]], [[3.1168754593295738, -4.7420733565988833, -0.015666678234051545, 0.18762282220759374], [3.6138650330933171, 2.5519814280360738, 2.7005539930058067, -3.4543049633429668], [-4.1443237870262379, -4.749022727489141, 1.7832840178041174, 4.8425254173334018]]], [[[2.6256516430612269, -3.4877246611623605, -0.43980528086948656, -4.650367572388542], [1.984748609418105, 3.6684678818115461, -3.262158655380599, 3.9191481247479665], [1.8330120281421411, -1.7986720202990805, -4.0852188627181327, 4.5205498284869563]], [[1.5988538624550586, 4.567130813087557, -3.047740155807086, -0.13724264515684936], [2.2650675790626549, -0.20893350313470549, 4.6519598803749158, 0.10569637298671175], [3.8853764287117798, 4.3805665900396775, -4.4178515171260324, -1.7589444283395972]]], [[[0.3091369485459694, 1.4077048823903588, 2.4900168710608757, 1.7850083823370113], [2.5009675100219955, 3.4854677924338553, 0.37768193945753392, 1.4870837156822958], [4.686476030869775, 1.1734715538208205, 4.7310952908500798, -0.99897315131515452]], [[4.3782034608621636, 0.35015608567962264, -0.31799328361873602, -0.80652505097382221], [-3.9566730663053407, -1.4897888404088686, 2.2698355421838814, 2.3805889944094076], [1.3203932308274187, -3.0575897472922819, 3.6551780215617384, -2.6853978492624875]]]])  
       res=add(arg0,arg1)  
       msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)  
       ref=msk_ref*numpy.array([[[[-8.2350516736117179, 0.40275136326120631, -1.5215671868457505, -0.96509982250523851], [0.24021888361992527, 1.7165072038791758, -0.75450270169646938, 0.44658726160639262], [0.030337476760614379, 7.8168762970692853, 2.329129512635701, -4.2227633906532365]], [[-7.48722135055114, 6.6199174441550612, -5.6058193259219458, 6.7590311312168616], [-1.4144241587416948, 1.5475414692030762, 5.4226671225599992, 1.4222748658214206], [-0.69940996313901671, 6.7684112550832705, 0.18382642328436205, -1.2995799274222692]]], [[[3.5957885219008432, -5.4463380155741792, 1.8640364199988531, -0.87999861801337875], [6.624485094846448, -2.3145798508960551, -0.33618534119869015, 4.1989095677058046], [-2.0700614048421073, -3.0431043488037091, 3.2784576135335053, 5.4555663475718816]], [[-1.6371997713730138, -4.6582612959677059, -4.1106479374471334, -0.18444936597417971], [-4.9090850342214001, -4.5629924318382198, 0.94104468295065313, 5.3802553563628868], [-3.2221990007375609, 0.0084281844936908712, -5.4457348515742598, -3.8150773825105646]]], [[[-5.6732880930247269, 3.8131410257967353, -0.031857224874517698, -2.6527654145780195], [0.20233721549240702, 0.24244718448620173, 3.6327493173721521, -0.75201554970751783], [0.41346217823803055, 3.0546077911662626, 1.6175805567963089, -0.060734068724813906]], [[1.0351776669878738, -1.006343172106277, 6.5769521226114822, 6.1674941927349369], [-3.5881487877419644, -2.1777877372952981, 6.0139920166114376, 5.6239311764338256], [-0.10594639586578225, 7.2707477819556274, -5.3091807436937932, -0.59346971200103571]]]])+(1.-msk_ref)*numpy.array([[[[-2.5071090857605789, 0.5102235210054511, 5.9557710733894833, -3.3673514766684649], [-0.29634089297993693, 1.9205732942157407, 4.9537247211160427, 3.5862478193397305], [2.6654924505892303, 1.5770208973483291, -1.536622307455354, 1.6877183310143522]], [[-1.0988943880897217, -1.0676760393248728, -1.2006231517081964, 2.8156856988249821], [3.2995641309977231, 7.3779227712627709, 4.7488628153237604, 0.099746440989834539], [-3.761073287412783, -2.2046876346691793, 6.4859256038112516, 4.0636015526962987]]], [[[4.1391052897576621, -5.6605391875027866, 2.6531308451835391, -2.8887809361317531], [4.7235457590850336, 0.98780558684726483, -1.1778942488580686, 5.0877496939498137], [-0.93613876274400543, -2.4075538822809932, -0.33523130072611629, 5.2463147298570174]], [[-1.4747125605215827, 4.0632070213236053, -4.0032217526118874, 0.88472974926761605], [-1.7793683757554719, -0.23769562850470294, 2.2813859077496508, 1.7906243977469822], [2.0516724387111385, 8.1021452496675135, -5.8270985620218028, -3.6010004960119235]]], [[[-3.3921703118864066, 1.3992001641628633, 4.3051998778594331, -2.8244850669923744], [7.4317648527123712, 4.342532307579722, 0.48771855748141402, -3.0169945273592971], [3.9177675765119488, -0.23192474071750313, 7.9846611961037848, 1.4523284200329254]], [[3.0782134698618293, -0.32653642952126649, 2.328982314256371, 2.3156421562695373], [-8.4444922398664222, -0.96551509825638959, 7.1226363801389221, 5.7405913178804191], [-3.0682306216534982, 0.46667263407362425, 1.2581872832135059, -2.978288596006474]]]])  
       self.assertTrue(isinstance(res,Data),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_Symbol_rank0(self):  
       arg0=Data(1.62619089341,self.functionspace)  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(4.34797816823)  
       sub=res.substitute({arg1:s1})  
       ref=Data(5.97416906164,self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_Symbol_rank0(self):  
       arg0=Data(numpy.array([-3.5848273506017589, 0.85989344766652387]),self.functionspace)  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(3.45697731442)  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([-0.1278500361805337, 4.3168707620877491]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_Symbol_rank1(self):  
       arg0=Data(-2.11378848297,self.functionspace)  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([-2.704831030888176, -2.2554365860385905])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([-4.8186195138598338, -4.3692250690102483]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_Symbol_rank0(self):  
       arg0=Data(numpy.array([[0.81735249053982884, 2.4896184060170565, -0.10950513571852749, 0.94358638259397498, 3.6350983686696665], [-0.24797872080596495, -1.4106667551946925, 2.0325224103703103, 0.51270581889091993, 0.63190662859406022], [-1.349830253251195, -2.7063165798604318, -3.6975921644604002, 2.6828626290325186, -4.3712323245075204], [1.4755522392546698, -4.9291272749473789, -3.750767913166694, 0.5053512300569194, -0.75722031032456982]]),self.functionspace)  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(-2.65318265295)  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[-1.8358301624103754, -0.16356424693314775, -2.7626877886687318, -1.7095962703562293, 0.98191571571946223], [-2.9011613737561692, -4.0638494081448968, -0.62066024257989394, -2.1404768340592844, -2.0212760243561441], [-4.0030129062013993, -5.3594992328106361, -6.3507748174106045, 0.029679976082314319, -7.0244149774577247], [-1.1776304136955345, -7.5823099278975832, -6.4039505661168983, -2.1478314228932849, -3.4104029632747741]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_Symbol_rank2(self):  
       arg0=Data(-3.97348778979,self.functionspace)  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[1.5057496840251279, 1.9643994884719094, -2.6434571269600893, 4.7532444475166091, 4.2167426537651487], [-1.3471403452648878, -0.25168328769878912, -1.6753257876994585, 0.99420607057040655, -0.045495636807503459], [-1.9858368859776676, -1.1095958367462067, -1.5859745792383553, -1.1641495835967963, -1.3565684626521834], [-4.5413421297681387, 4.3498784079675676, -0.69739334847258672, 0.62103386372269398, 2.6311450934584943]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[-2.467738105765072, -2.0090883013182905, -6.6169449167502892, 0.77975665772640923, 0.24325486397494878], [-5.3206281350550881, -4.225171077488989, -5.6488135774896584, -2.9792817192197933, -4.0189834265977034], [-5.9593246757678671, -5.083083626536407, -5.5594623690285552, -5.1376373733869958, -5.3300562524423833], [-8.5148299195583377, 0.37639061817736774, -4.6708811382627866, -3.3524539260675059, -1.3423426963317056]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_Symbol_rank0(self):  
       arg0=Data(numpy.array([[[-3.619537570779868, 0.95317613980372329], [2.7186652392889279, -1.8533409577282347]], [[-1.8815597462125289, -2.5336397016946313], [-2.0649654407284501, 3.2732556558843733]], [[-2.1238739201728585, -1.29366030684956], [-1.2534338391973132, 1.8900475196591726]], [[-0.83227930922824545, -2.2819201021438449], [3.4821218091036936, 1.3931490911848856]], [[-3.5545816552232457, 1.7309960005136009], [-3.8174132329513477, 0.44978087383837906]], [[4.3885344863591342, -4.9073478485850961], [-4.4016358046881994, -2.7116054218088959]]]),self.functionspace)  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(2.26840824113)  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[-1.3511293296474189, 3.2215843809361724], [4.987073480421377, 0.41506728340421439]], [[0.38684849491992024, -0.26523146056218216], [0.20344280040399898, 5.5416638970168224]], [[0.14453432095959062, 0.97474793428288908], [1.0149744019351359, 4.1584557607916217]], [[1.4361289319042037, -0.013511861011395787], [5.7505300502361427, 3.6615573323173347]], [[-1.2861734140907966, 3.99940424164605], [-1.5490049918188986, 2.7181891149708282]], [[6.6569427274915833, -2.638939607452647], [-2.1332275635557503, -0.44319718067644676]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_Symbol_rank3(self):  
       arg0=Data(3.43954827945,self.functionspace)  
       arg1=Symbol(shape=(6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[0.744924266256759, 3.747599273119242], [2.3406925602745785, -4.4790099863506452]], [[-4.0520813328214764, -0.12612302545489928], [3.5667926288170193, 1.8261568871814067]], [[3.8830346074491935, 2.8449298232984663], [-4.1986869695342941, 3.8062354245590022]], [[-0.91303386700839617, -2.0602438003866688], [-2.956524222865732, -3.5310096117817533]], [[4.2880245630717209, -2.086211935800264], [3.2905946681758422, -2.1019763630992108]], [[4.4994748457257785, -3.8664492368900607], [3.9526054186791377, 3.3699420037550976]]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[4.1844725457059821, 7.1871475525684652], [5.7802408397238016, -1.039461706901422]], [[-0.61253305337225328, 3.3134252539943239], [7.0063409082662425, 5.2657051666306298]], [[7.3225828868984166, 6.2844781027476895], [-0.75913869008507096, 7.2457837040082254]], [[2.526514412440827, 1.3793044790625544], [0.48302405658349112, -0.091461332332530176]], [[7.727572842520944, 1.3533363436489592], [6.7301429476250654, 1.3375719163500124]], [[7.9390231251750016, -0.42690095744083756], [7.3921536981283609, 6.8094902832043207]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_Symbol_rank0(self):  
       arg0=Data(numpy.array([[[[1.5480537598602817, 2.6989905732859665, 4.9862866505355132, -2.4648848731236903], [-4.9180662797474195, 3.1749435641310626, -4.1588701391061029, -1.169501977908082], [-2.6688813345787543, -4.3458177384346994, -3.5883534144224516, 0.92007194934034686]], [[-1.1466722577611774, 3.3768167806014535, -3.8571249698522561, -4.4940494515788467], [2.5747333313577982, -4.9259402900971967, -3.3456945798318003, 1.223041849342728], [-1.4508925920527371, 2.0201320119898636, 1.4170771820495878, -3.4263741108612211]]], [[[-1.1200927687276918, 4.6568647576039233, -3.9344650330915645, 0.50896625677001062], [1.0803240832262162, 4.204677978575674, -2.9207923097315804, 3.3367276563764143], [1.4418170405561126, -0.29143865299786409, 1.8779646581615728, 0.24755398559099806]], [[-1.1689679196079261, 4.9510975183997363, -1.9911929627082579, 0.98203672205364434], [-3.613744133365282, 0.39213748953285776, 1.8719656511219371, 3.147865318892709], [-1.6313600840387856, 3.7406217554314143, 0.88857408382621728, -4.6155653639791083]]], [[[4.3150198820227903, -1.9520743303462993, 0.65437407376151757, -3.2253090075772795], [-2.8171763370771519, 3.9453999811658811, -1.6879139811151123, 2.8969442654915998], [-1.0957612362058775, -1.3023130372892333, -2.2866429004504196, 2.9807915404231569]], [[2.4288925030801343, -3.1248919610324299, -2.5718850730062148, 2.4034395838326814], [-0.84100000170375822, 1.1813631335138064, 0.19176213517463214, -2.7296580481279986], [0.76444851917345957, -0.047396779753933416, -0.75755175802965002, -1.4619910798393621]]]]),self.functionspace)  
       arg1=Symbol(shape=())  
       res=add(arg0,arg1)  
       s1=numpy.array(0.358101549443)  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[[1.9061553093031725, 3.0570921227288572, 5.344388199978404, -2.1067833236807996], [-4.5599647303045288, 3.5330451135739533, -3.8007685896632122, -0.81140042846519123], [-2.3107797851358636, -3.9877161889918087, -3.2302518649795608, 1.2781734987832376]], [[-0.78857070831828668, 3.7349183300443443, -3.4990234204093653, -4.135947902135956], [2.932834880800689, -4.567838740654306, -2.9875930303889096, 1.5811433987856187], [-1.0927910426098464, 2.3782335614327543, 1.7751787314924785, -3.0682725614183304]]], [[[-0.76199121928480107, 5.014966307046814, -3.5763634836486737, 0.86706780621290136], [1.4384256326691069, 4.5627795280185648, -2.5626907602886897, 3.6948292058193051], [1.7999185899990033, 0.066662896445026654, 2.2360662076044635, 0.6056555350338888]], [[-0.81086637016503538, 5.3091990678426271, -1.6330914132653671, 1.3401382714965351], [-3.2556425839223913, 0.75023903897574851, 2.2300672005648279, 3.5059668683355998], [-1.2732585345958949, 4.098723304874305, 1.246675633269108, -4.2574638145362176]]], [[[4.673121431465681, -1.5939727809034085, 1.0124756232044083, -2.8672074581343887], [-2.4590747876342611, 4.3035015306087718, -1.3298124316722215, 3.2550458149344905], [-0.73765968676298677, -0.94421148784634257, -1.9285413510075289, 3.3388930898660476]], [[2.786994052523025, -2.7667904115895392, -2.2137835235633241, 2.7615411332755722], [-0.48289845226086747, 1.5394646829566971, 0.54986368461752289, -2.3715564986851079], [1.1225500686163503, 0.31070476968895733, -0.39945020858675928, -1.1038895303964713]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank0_Symbol_rank4(self):  
       arg0=Data(4.87397662763,self.functionspace)  
       arg1=Symbol(shape=(3, 2, 3, 4))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[0.08071953612048155, -1.0855878180733516, -1.0976892535422165, -4.258343844184644], [2.4530993180964824, -3.7011278538188686, -1.2458179740356998, -3.5733048245392851], [-4.7231696210181129, 2.1261672930405862, 3.771482151522946, -3.7307862027304206]], [[-1.6001041770645963, 2.3585967403133345, 3.9613599059000038, -4.766021890493696], [3.9713034496223916, 0.23951304934830109, 3.0965508833747037, 1.5791963743882578], [1.5159122835560801, -0.58979393589073759, -0.52663804903033107, -0.47334834064147735]]], [[[-2.7718982620481492, 4.8774508864412205, 1.7302787883489259, -4.5386290512185532], [-2.657576466292082, -4.0280559938488816, -4.7803645997117226, -3.1279575266969442], [0.12984150743368517, 2.4053926531451744, -0.64553900758624128, -1.8359997019933196]], [[4.8727825989857827, -4.965663919524788, 0.60321899821623415, -0.043444696145964912], [-0.76953095067224631, 4.4667608506802132, -4.1585814157263226, -4.8195816233915698], [1.8879519185229601, -1.6511340795408955, -0.72388446592755074, 4.3319327799060385]]], [[[4.4110151197367458, -0.77121941212784595, -2.9694715015876669, -4.8761503682104088], [-0.85090516028799801, 4.6173892198426429, -1.4768799355442761, 0.82594922288101635], [-2.4479146973250399, 0.89837393905236951, -4.2136386742650211, -4.653750482238209]], [[4.3678615306243724, 1.7444360887692429, -1.6605403763313831, 3.7200563990904651], [2.0754494842071747, -4.4403351818252288, -1.4750670246299826, 3.9928743947720768], [3.6947147686934638, -4.8390397698859866, 3.4542032831630536, -1.2940072964662774]]]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[[4.9546961637504889, 3.7883888095566558, 3.7762873740877909, 0.61563278344536343], [7.3270759457264898, 1.1728487738111388, 3.6281586535943076, 1.3006718030907223], [0.1508070066118945, 7.0001439206705935, 8.6454587791529534, 1.1431904248995868]], [[3.2738724505654111, 7.2325733679433419, 8.8353365335300111, 0.10795473713631143], [8.845280077252399, 5.1134896769783085, 7.9705275110047111, 6.4531730020182652], [6.3898889111860875, 4.2841826917392698, 4.3473385785996763, 4.40062828698853]]], [[[2.1020783655818582, 9.7514275140712279, 6.6042554159789333, 0.33534757641145418], [2.2164001613379254, 0.84592063378112581, 0.093612027918284824, 1.7460191009330632], [5.0038181350636926, 7.2793692807751817, 4.2284376200437661, 3.0379769256366878]], [[9.7467592266157901, -0.091687291894780643, 5.4771956258462415, 4.8305319314840425], [4.1044456769577611, 9.3407374783102206, 0.71539521190368482, 0.054395004238437572], [6.7619285461529675, 3.2228425480891119, 4.1500921617024567, 9.2059094075360459]]], [[[9.2849917473667531, 4.1027572155021614, 1.9045051260423405, -0.0021737405804014287], [4.0230714673420094, 9.4913658474726503, 3.3970966920857313, 5.6999258505110237], [2.4260619303049675, 5.7723505666823769, 0.66033795336498624, 0.22022614539179841]], [[9.2418381582543798, 6.6184127163992503, 3.2134362512986243, 8.5940330267204725], [6.9494261118371821, 0.43364144580477859, 3.3989096030000248, 8.8668510224020842], [8.5686913963234712, 0.034936857744020777, 8.328179910793061, 3.57996933116373]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_Symbol_rank1(self):  
       arg0=Data(numpy.array([4.6509931813330248, -2.2336788465051916]),self.functionspace)  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([1.3862941764500114, -4.7154351860489623])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([6.0372873577830362, -6.9491140325541538]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_Symbol_rank1(self):  
       arg0=Data(numpy.array([[-3.6524345055019247, 1.4505464052958148], [1.7822938898485994, -3.9247060741816475]]),self.functionspace)  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([2.2514633020653481, -0.53096594853848078])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[-1.4009712034365767, 3.7020097073611629], [1.2513279413101186, -4.4556720227201279]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_Symbol_rank2(self):  
       arg0=Data(numpy.array([4.6805387455600194, 0.59265699129202609]),self.functionspace)  
       arg1=Symbol(shape=(2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[-1.2662518698296688, 1.1239519355583223], [0.43027058471475055, 2.625095192013398]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[3.4142868757303506, 5.8044906811183417], [1.0229275760067766, 3.2177521833054241]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_Symbol_rank1(self):  
       arg0=Data(numpy.array([[[4.2810206466522214, -4.9278848954509211, -4.2957989878314065, 4.2258416850511544, -1.820252865783849], [-0.45883878898724451, 0.47839968241574748, 0.10929960633506575, -1.436443011509013, 0.28506133035292702], [3.6833176707220332, 0.19691034363947946, 3.1318023633859546, -1.4674028728273592, -4.0207801243537773], [4.4123203806468894, 2.9716512896656262, -4.0039176845315714, -2.4792243226910013, 1.0362783500189607]], [[4.1695039189180676, 0.70866690422756928, -2.3003238376056956, -2.7830205657000349, -1.2862344601918552], [0.49740787276060594, -0.79693313500593188, 2.3074558814932029, 1.8681539567152727, 1.8004047036354267], [1.9935216163056966, 1.3872884796929714, 1.210385126765356, 2.4403504328199581, 0.97462651967085279], [-3.6188761177267379, -4.7566935696844617, 4.1346182247342504, 3.9930209523833415, 4.3183741393032946]]]),self.functionspace)  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([3.2819707018145508, 1.9652777538173538])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[7.5629913484667721, -1.6459141936363704, -1.0138282860168557, 7.5078123868657052, 1.4617178360307017], [2.8231319128273062, 3.7603703842302982, 3.3912703081496165, 1.8455276903055378, 3.5670320321674778], [6.9652883725365839, 3.4788810454540302, 6.4137730652005054, 1.8145678289871916, -0.73880942253922655], [7.6942910824614401, 6.2536219914801769, -0.72194698271702062, 0.8027463791235494, 4.3182490518335115]], [[6.1347816727354214, 2.6739446580449231, -0.33504608378834178, -0.81774281188268105, 0.67904329362549865], [2.4626856265779598, 1.1683446188114219, 4.2727336353105567, 3.8334317105326265, 3.7656824574527805], [3.9587993701230504, 3.3525662335103252, 3.1756628805827098, 4.4056281866373119, 2.9399042734882066], [-1.6535983639093841, -2.7914158158671079, 6.0998959785516043, 5.9582987062006953, 6.2836518931206484]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_Symbol_rank3(self):  
       arg0=Data(numpy.array([1.7211967657765959, 3.5362408080433703]),self.functionspace)  
       arg1=Symbol(shape=(2, 4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[-1.0623100294506549, 0.8591936944799059, -1.1518778636079672, -3.5685693747904246, -0.22149736258070085], [0.61671208546062761, -3.144144739030954, 3.6757264127360685, -1.1957513251207064, 0.57293562527112307], [-1.8605763439593748, -3.1786347150017447, 0.93203314894504175, -4.9738861401663312, -0.036562596456245267], [-3.8984663260348573, 4.6282116976601984, -4.5423764334247396, -2.6376631705551401, 1.0488971375249099]], [[-2.5644962284320605, 2.5768061731493352, -4.4669916324057226, -1.0464058806294672, 4.0874472958347283], [1.1911237138076594, -2.7760899315755028, -0.64238759089541464, -1.0624788344377869, -3.6679709783650596], [-0.67248349090046844, 2.3143655272348216, -4.6803213604335836, 1.5633559658340301, 2.8129521829502702], [-0.95815623844799358, 2.8691353680524267, -0.27732766010563736, 0.51090286228464166, -4.4798664709164946]]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[0.65888673632594097, 2.5803904602565018, 0.56931890216862868, -1.8473726090138287, 1.499699403195895], [2.3379088512372235, -1.4229479732543582, 5.3969231785126643, 0.5254454406558895, 2.2941323910477189], [-0.13937957818277891, -1.4574379492251488, 2.6532299147216376, -3.2526893743897354, 1.6846341693203506], [-2.1772695602582615, 6.3494084634367942, -2.8211796676481438, -0.91646640477854424, 2.7700939033015057]], [[0.97174457961130978, 6.1130469811927055, -0.93075082436235235, 2.4898349274139031, 7.6236881038780986], [4.7273645218510296, 0.7601508764678675, 2.8938532171479556, 2.4737619736055834, -0.13173017032168932], [2.8637573171429018, 5.8506063352781918, -1.1440805523902133, 5.0995967738774004, 6.3491929909936404], [2.5780845695953767, 6.405376176095797, 3.2589131479377329, 4.0471436703280119, -0.94362566287312433]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank4_Symbol_rank1(self):  
       arg0=Data(numpy.array([[[[3.2213523520847236, -0.0056960112065551627], [-3.1239827258309463, -4.3401409055949074]], [[1.6712963986792593, 3.443735247248874], [0.37974868338618784, 2.9403696445447967]], [[2.6976506537104408, -2.3825758661671923], [1.5164627367063224, -3.2879402860115214]], [[2.6730820986574964, 2.1069036664861418], [-2.4328402728483578, 0.030268947291274273]], [[1.3250591502919731, -2.3981466931921624], [0.25985202489557135, -0.18493761924186369]], [[2.4332774038261693, -1.1445604522596051], [0.34437902937516274, -3.0944966454978564]]], [[[-0.85945093471792866, 3.6356568432397456], [4.2533117220990917, 3.5678894105664689]], [[-2.5708624105178144, -3.8753853366054014], [-1.545715966362462, -1.4891457876043992]], [[-4.1764701333583298, 4.9193595455176933], [-1.9465380194405757, -2.4459724854556306]], [[1.3546555978155626, -4.9899775886840638], [4.8275235932443366, 1.4652510460378902]], [[1.5736815482611712, 0.26246122164938335], [2.5182484443127535, -0.65141083199738503]], [[-2.7314484212512635, -0.0606080935343698], [2.8975222742630571, 4.3590971001051759]]]]),self.functionspace)  
       arg1=Symbol(shape=(2,))  
       res=add(arg0,arg1)  
       s1=numpy.array([-0.67931280944646666, -4.7809929342462993])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[[2.5420395426382569, -0.68500882065302182], [-3.8032955352774129, -5.0194537150413741]], [[0.99198358923279262, 2.7644224378024074], [-0.29956412606027882, 2.26105683509833]], [[2.0183378442639741, -3.061888675613659], [0.83714992725985571, -3.9672530954579881]], [[1.9937692892110297, 1.4275908570396751], [-3.1121530822948245, -0.64904386215519239]], [[0.64574634084550642, -3.0774595026386291], [-0.4194607845508953, -0.86425042868833035]], [[1.7539645943797026, -1.8238732617060718], [-0.33493378007130392, -3.7738094549443231]]], [[[-5.640443868964228, -1.1453360910065538], [-0.52768121214720765, -1.2131035236798304]], [[-7.3518553447641137, -8.6563782708517003], [-6.3267089006087609, -6.2701387218506985]], [[-8.9574630676046283, 0.13836661127139394], [-6.727530953686875, -7.22696541970193]], [[-3.4263373364307368, -9.7709705229303623], [0.046530658998037211, -3.3157418882084091]], [[-3.2073113859851281, -4.518531712596916], [-2.2627444899335458, -5.4324037662436844]], [[-7.5124413554975629, -4.8416010277806691], [-1.8834706599832423, -0.42189583414112342]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank1_Symbol_rank4(self):  
       arg0=Data(numpy.array([2.0373577555211266, -0.51903859192019652]),self.functionspace)  
       arg1=Symbol(shape=(2, 6, 2, 2))  
       res=add(arg0,arg1)  
       s1=numpy.array([[[[1.4628504821471253, 1.072140955741169], [3.8302000831787808, 2.8965064449369642]], [[2.6839878531520212, -1.684755339127916], [-1.2167127005326051, 4.141703453242453]], [[-3.2614239069920101, -3.3928730826535181], [4.7679614741027105, -4.5020567291606985]], [[4.7054432520457095, 0.1095025862789587], [1.766896662275288, 1.5769138170307997]], [[-3.5101148845064936, -3.5221386049097267], [-4.8499258085220021, 3.323597225895444]], [[2.0599146432649018, -4.6020818632685572], [1.5793256539812948, -4.0132757478755288]]], [[[-4.7491947482813774, 1.4634275949158049], [2.8923616805741297, 4.837962369129901]], [[-4.818571285988364, 0.16409996572068763], [-2.9690519393090877, 0.98184958415790469]], [[1.0781926773950019, -4.5873533288824309], [1.8563798152322075, -4.7958441014892443]], [[-4.5207295582161056, 2.4252982172595825], [-4.1056417195999177, -3.7932637965687297]], [[-2.7301831025293954, -3.9641752650174986], [-2.7548324758685903, 1.1391632523102482]], [[3.5072393165274942, -0.29245799815967732], [4.1350639219803416, 1.3429246884634241]]]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[[[3.500208237668252, 3.1094987112622956], [5.8675578386999074, 4.9338642004580908]], [[4.7213456086731478, 0.35260241639321066], [0.82064505498852158, 6.1790612087635797]], [[-1.2240661514708835, -1.3555153271323914], [6.8053192296238372, -2.4646989736395719]], [[6.7428010075668361, 2.1468603418000853], [3.8042544177964146, 3.6142715725519263]], [[-1.4727571289853669, -1.4847808493886001], [-2.8125680530008754, 5.3609549814165707]], [[4.0972723987860284, -2.5647241077474305], [3.6166834095024214, -1.9759179923544021]]], [[[-5.268233340201574, 0.94438900299560835], [2.3733230886539332, 4.3189237772097044]], [[-5.3376098779085606, -0.35493862619950889], [-3.4880905312292843, 0.46281099223770816]], [[0.55915408547480538, -5.1063919208026274], [1.337341223312011, -5.3148826934094409]], [[-5.0397681501363021, 1.906259625339386], [-4.6246803115201143, -4.3123023884889262]], [[-3.249221694449592, -4.4832138569376951], [-3.2738710677887868, 0.62012466039005165]], [[2.9882007246072977, -0.81149659007987385], [3.616025330060145, 0.82388609654322753]]]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank2_Symbol_rank2(self):  
       arg0=Data(numpy.array([[-0.014492981508123393, 2.4495755941947719, -4.984431977391532, -3.3371924573143339, 4.353958398896383], [1.1449186045537676, 3.617728829751572, 0.69365768897813496, -4.8062105568668878, 2.6349940429096383], [3.9194004644035658, -3.0647400150964477, 2.4974501511771212, 3.5500020472847034, 4.3864640323370878], [1.6782622548501882, 3.5798429069585946, 2.7157306307637601, 1.9637631306829659, -4.0653382326693581]]),self.functionspace)  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[4.4853381873973461, 1.9057323142665918, -4.179111702493187, 3.5242010025280983, 1.3959082116478356], [-1.952678890031978, 2.3268678197543871, -3.0269120701836414, -1.8520941308414973, 3.1734117343725892], [2.6830871626453412, -3.6590203748383776, -0.36193606538996814, 4.6473164657037298, 0.94930729353167731], [-0.43786928725542484, -4.7509128620199013, -4.7051239265000069, 2.6726446783444713, -3.9828755203971991]])  
       sub=res.substitute({arg1:s1})  
       ref=Data(numpy.array([[4.4708452058892227, 4.3553079084613637, -9.1635436798847181, 0.18700854521376442, 5.7498666105442187], [-0.80776028547821044, 5.944596649505959, -2.3332543812055064, -6.6583046877083856, 5.8084057772822275], [6.602487627048907, -6.7237603899348253, 2.1355140857871531, 8.1973185129884332, 5.3357713258687651], [1.2403929675947634, -1.1710699550613066, -1.9893932957362468, 4.6364078090274372, -8.0482137530665572]]),self.functionspace)  
       self.assertTrue(isinstance(res,Symbol),"wrong type of result.")  
       self.assertEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.assertTrue(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_add_constData_rank3_Symbol_rank2(self):  
       arg0=Data(numpy.array([[[2.4984466531793217, 3.1107617407304602], [-1.4312607626063456, 4.5462004973198074], [-1.5192372726813108, -4.3875826371952762], [4.7428596950673167, 4.0550486969250699], [-3.1172072749161259, 4.2693539655965544]], [[3.274910222132922, -4.0549253121138964], [-1.3584782541574016, 2.6969541604002059], [-0.94376317435489732, 0.33485874956040274], [-3.1807635049840677, -0.27300808958485501], [0.42407485966910574, -1.2117399946955665]], [[0.022966306130513203, 4.5044429613175652], [1.9662922464112285, -2.7416745701375556], [-1.5700627644190401, -2.6513391590145408], [-2.6062099929407259, 1.4976124872838845], [2.9308368606827635, -1.0658765269480028]], [[4.8140946079298637, 2.0736523508182838], [0.19398360817708493, 0.66858660219814681], [-2.1303142491492153, 0.11763322623920569], [-2.8856198990764015, -4.1061918797515933], [2.5120804788129503, -2.5367603575605422]]]),self.functionspace)  
       arg1=Symbol(shape=(4, 5))  
       res=add(arg0,arg1)  
       s1=numpy.array([[-0.31693368463895