/[escript]/trunk/escript/py_src/test_util_unary_with_tagged_data.py
ViewVC logotype

Contents of /trunk/escript/py_src/test_util_unary_with_tagged_data.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 395 - (show annotations)
Wed Dec 21 02:41:59 2005 UTC (13 years, 8 months ago) by gross
File MIME type: text/x-python
File size: 307046 byte(s)
test is splitted to reduce memory demand during compilation
1 # $Id:$
2 """
3 test for util operations for unary operations without tagged data
4
5 @remark: use see L{test_util}
6 @var __author__: name of author
7 @var __licence__: licence agreement
8 @var __url__: url entry point on documentation
9 @var __version__: version
10 @var __date__: date of the version
11 """
12
13 __author__="Lutz Gross, l.gross@uq.edu.au"
14 __licence__="contact: esys@access.uq.edu.au"
15 __url__="http://www.iservo.edu.au/esys/escript"
16 __version__="$Revision:$"
17 __date__="$Date:$"
18
19 import unittest
20 import numarray
21 from esys.escript import *
22 from esys.escript.test_util_base import Test_util_base
23
24 class Test_util_unary_with_tagged_data(Test_util_base):
25 """
26 test for unary operations. only tagged data are tested.
27 """
28 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 def test_log10_taggedData_rank0(self):
30 arg=Data(55.1652630602,self.functionspace)
31 arg.setTaggedValue(1,10.5828519405)
32 res=log10(arg)
33 ref=Data(1.74166569349,self.functionspace)
34 ref.setTaggedValue(1,1.02460272017)
35 self.failUnless(isinstance(res,Data),"wrong type of result.")
36 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
37 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
38 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39 def test_log10_taggedData_rank1(self):
40 arg=Data(numarray.array([72.282406932431243, 35.729324148665768]),self.functionspace)
41 arg.setTaggedValue(1,numarray.array([23.804409029158563, 82.472345107833661]))
42 res=log10(arg)
43 ref=Data(numarray.array([1.8590326057050119, 1.5530248012211607]),self.functionspace)
44 ref.setTaggedValue(1,numarray.array([1.3766574041024322, 1.916308343937587]))
45 self.failUnless(isinstance(res,Data),"wrong type of result.")
46 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
47 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
48 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
49 def test_log10_taggedData_rank2(self):
50 arg=Data(numarray.array([[51.453194171526192, 13.570707659190413, 60.521549437302234, 31.599538694833306, 14.891175253445139], [98.173449179193497, 5.0087678798438278, 52.481382734493792, 29.128158011918146, 98.064075237764598], [36.407550507350827, 89.884167676960288, 39.308304837547745, 75.538185852569995, 33.601340111371606], [63.889377928887228, 4.6186118848356488, 69.136277385337451, 2.6710200091532696, 63.918258275478514]]),self.functionspace)
51 arg.setTaggedValue(1,numarray.array([[3.7796743359003022, 13.180984629177244, 59.461828020927761, 20.406986279454642, 72.171015597628937], [1.9587215571356407, 17.280986015551932, 84.05693756007831, 45.547880329201142, 32.870521541704392], [26.737813837799116, 37.531132826532321, 51.180765330858762, 78.2056706013324, 52.489986316281318], [63.141114740929247, 23.684128984789403, 81.88613234855724, 36.918777925154153, 19.245705222936365]]))
52 res=log10(arg)
53 ref=Data(numarray.array([[1.7114123405757837, 1.1326024950044853, 1.7819100380467305, 1.4996807426262928, 1.1729289748471519], [1.9919940495580575, 0.69973090574844821, 1.7200052689371468, 1.464313021855508, 1.991509937212202], [1.5611914606717532, 1.9536832012319965, 1.5944843153649138, 1.8781665504719267, 1.5263565985615033], [1.8054286595616771, 0.66451146877260103, 1.8397059914266514, 0.4266771414217112, 1.8056249322687863]]),self.functionspace)
54 ref.setTaggedValue(1,numarray.array([[0.57745438179108843, 1.1199478535847189, 1.7742382564867842, 1.309778872484638, 1.8583628167754329], [0.29197270307270162, 1.2375685187503027, 1.9245735633402872, 1.6584681709302851, 1.516806594890489], [1.4271258951849872, 1.5743916732030367, 1.7091067758161855, 1.8932382443844189, 1.7200764595510651], [1.8003122449866822, 1.3744574176029094, 1.9132103589710923, 1.5672473166998622, 1.2843338296326507]]))
55 self.failUnless(isinstance(res,Data),"wrong type of result.")
56 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
57 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
58 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
59 def test_log10_taggedData_rank3(self):
60 arg=Data(numarray.array([[[90.690037899671296, 23.785411821546496], [91.533710749831201, 35.110847145935921]], [[31.790987742717761, 80.73086172262245], [76.879402834581697, 85.744103669605451]], [[8.1269631331611549, 52.871037837294452], [9.1059277056430368, 62.81826904111756]], [[91.343888112038101, 42.790045009836057], [98.923113540366373, 76.508459842843422]], [[75.511345908209677, 53.05029465716877], [21.756665086458423, 84.34627478690912]], [[20.881744462723443, 21.498514780242811], [94.039541086706947, 63.040386118170531]]]),self.functionspace)
61 arg.setTaggedValue(1,numarray.array([[[49.039591873498914, 47.203472254904376], [13.39618662616329, 80.407751980277737]], [[94.740716086709412, 71.680553195598819], [22.063626045323556, 78.003840393051846]], [[32.738459746566498, 34.410070237534583], [90.599810283330726, 38.951280733947229]], [[97.583590849819274, 21.088714492740912], [60.799357198434329, 9.2997265651169414]], [[92.165943907973187, 12.913360305242884], [89.764291870306224, 11.704176719145334]], [[33.563051881776232, 10.411945777444954], [23.411376390403166, 48.768282109713994]]]))
62 res=log10(arg)
63 ref=Data(numarray.array([[[1.9575595833906394, 1.3763106752125882], [1.9615810688900812, 1.5454413081428469]], [[1.50230402160926, 1.9070395881750126], [1.885810001264896, 1.9332042647871273]], [[0.90992828964073624, 1.7232178355155006], [0.95932419800764912, 1.7980859652326844]], [[1.9606794936916605, 1.6313427433082643], [1.9952977770394453, 1.8837094594664194]], [[1.8780122111672353, 1.7246878004452211], [1.3375923264330749, 1.9260659064246666]], [[1.3197667768440355, 1.3324084578214161], [1.9733105010994656, 1.7996188645144506]]]),self.functionspace)
64 ref.setTaggedValue(1,numarray.array([[[1.6905468471583012, 1.6739739462120611], [1.1269811891924277, 1.9052979203898317]], [[1.9765366629687919, 1.855401348340298], [1.3436768880708625, 1.8921159850039784]], [[1.5150582432096382, 1.5366855590999351], [1.9571272882619251, 1.59052174202249]], [[1.9893767950999692, 1.3240501072063162], [1.7838989877160136, 0.96847017941343561]], [[1.964570475228363, 1.1110392687676565], [1.9531036091864897, 1.0683408704968049]], [[1.5258614442649203, 1.0175318977566594], [1.3694269472799274, 1.6881374575925516]]]))
65 self.failUnless(isinstance(res,Data),"wrong type of result.")
66 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
67 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
68 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
69 def test_log10_taggedData_rank4(self):
70 arg=Data(numarray.array([[[[90.916803177883821, 54.525338275396493, 13.364424356447465, 51.314413977784419], [80.231561588327807, 82.162456273997748, 8.3566662162590539, 94.730819165987], [77.473176646131762, 20.972609574388059, 74.896335161378119, 88.10387415596874]], [[11.595133878605829, 29.493110939671826, 31.490679142790391, 39.161104201178077], [32.61379799879397, 58.334287443171277, 88.246072805422187, 35.746693154753984], [88.031724708015759, 42.086782575753446, 76.30576562684233, 41.664454917294485]]], [[[73.805732338880929, 29.722157924518495, 11.979308129040467, 56.678829139293917], [6.1110346378486105, 61.420099159473246, 24.460988572874975, 9.9837108208795708], [29.304214355701266, 69.239538294798919, 43.726703031386528, 96.453481611027584]], [[83.748022272324235, 32.953465755838039, 34.11675054427031, 16.642877884588994], [64.574790966313543, 42.938611636354324, 46.810954363884647, 91.97971646326387], [96.485547539718311, 42.855584051837369, 73.227470310618529, 73.565844556183777]]], [[[88.201355962594207, 41.836289548798113, 69.197678273827108, 31.32522051118902], [44.933739003053383, 82.304262181531868, 46.662125485783939, 25.216812874514684], [37.715123702749331, 0.33654002188789439, 77.616411403471773, 19.152072401340583]], [[92.715182555824981, 51.479018971675195, 58.389552448640487, 11.079825716836668], [66.120381536086015, 54.696122559623113, 74.602124135737157, 46.764404847359458], [92.441508878592927, 49.13843332363826, 84.277334637691311, 61.375020008040991]]]]),self.functionspace)
71 arg.setTaggedValue(1,numarray.array([[[[62.928329908936867, 78.142232594489769, 23.694870846158736, 77.379623356172573], [11.343774294284144, 5.0141456599208922, 65.791042346980248, 72.904521530203226], [46.165649854154751, 46.031503262450066, 64.12361229840144, 51.813579296266198]], [[22.679300826571335, 62.977332064943198, 13.771125130940399, 59.844651806488763], [14.177003870203592, 30.872939480711043, 76.89257820864357, 21.359624412764553], [64.357528521726167, 45.754541308463061, 86.917154454162898, 62.525134832715636]]], [[[75.962390497323355, 70.145694672660483, 76.932538896196164, 61.719435975622567], [77.812655042655194, 15.285729007526603, 50.390239206343267, 62.704163646191077], [49.67778501460851, 46.415926037609047, 56.588556029575471, 27.934863117344474]], [[76.060984285811514, 81.295553924710816, 69.918265989518105, 83.458206572989525], [63.469111974419398, 69.954750106734039, 31.380947651740421, 19.198733624736676], [64.480248540295207, 13.727409292553201, 31.845984674993723, 65.803516596296177]]], [[[99.122756107881074, 86.808131124216828, 1.4321294301423275, 8.3438957972984138], [34.503440819741336, 35.67099265092223, 48.831668912254365, 14.139212054299726], [98.020513665211695, 25.954655701381547, 1.3758192696653002, 95.607029783574006]], [[49.7055983523964, 12.62977930442664, 26.742962982817151, 83.708869974268808], [40.504846807543508, 68.747127993174473, 99.752608339104768, 95.244092191429729], [53.238233591188212, 34.920347644790411, 10.5293904374393, 9.2580418923770118]]]]))
72 res=log10(arg)
73 ref=Data(numarray.array([[[[1.958644156632638, 1.7365983686236373, 1.1259502572038609, 1.7102393735278381], [1.9043452451825991, 1.9146734141614923, 0.92203305583094985, 1.9764912927969005], [1.8891513637839643, 1.3216524721079508, 1.8744605672571355, 1.9449950058872605]], [[1.0642757674116168, 1.4697205844431256, 1.4981820269365049, 1.5928549288337999], [1.5134013769682526, 1.7659238973023306, 1.9456953871829765, 1.5532358724009305], [1.9446392105900805, 1.6241457263418644, 1.8825573542762462, 1.6197657044633726]]], [[[1.8680900938889471, 1.4730803374132002, 1.0784317358816056, 1.7534208700934903], [0.78611474534376435, 1.7883105132528869, 1.3884740047472364, 0.99929199314012029], [1.4669300824636733, 1.8403541632373015, 1.640746733021623, 1.9843179086742269]], [[1.9229745598717729, 1.5179010966078323, 1.5329676600131747, 1.2212284266018456], [1.8100630090021725, 1.6328479979852315, 1.670347495447966, 1.9636920664836188], [1.9844622657395339, 1.6320074182054687, 1.8646740314178081, 1.8666762251564302]]], [[[1.9454752618046733, 1.6215531600863007, 1.8400915232171524, 1.4958941368555099], [1.652572558384511, 1.9154223260262504, 1.6689645172636371, 1.4016901956994581], [1.5765155365073076, -0.47296328136118848, 1.8899535592530265, 1.2822157748461316]], [[1.9671508577724528, 1.7116302620231869, 1.766335146430758, 1.0445329290917416], [1.8203353509269165, 1.7379565400327668, 1.8727511932541194, 1.6699154116173478], [1.9658670256463047, 1.6914213057918996, 1.9257107921182273, 1.787991646709524]]]]),self.functionspace)
74 ref.setTaggedValue(1,numarray.array([[[[1.7988462059099257, 1.8928858152534429, 1.3746543458291129, 1.8886266114703387], [1.0547575768197655, 0.70019694597262339, 1.8181667671078665, 1.8627544640480471], [1.6643189533177833, 1.6630551579903574, 1.8070179796377215, 1.7144435945053167]], [[1.355629661691661, 1.7991842584914508, 1.1389694245123259, 1.7770253444715181], [1.1515844579186774, 1.4895779815869408, 1.8858844230448231, 1.329593611797627], [1.808599357832434, 1.660434205884993, 1.9391054996884767, 1.7960546369405848]]], [[[1.8805986233038012, 1.8460010205206747, 1.886110065083187, 1.7904219485998918], [1.8910502341136941, 1.1842861559437698, 1.7023464199899885, 1.7972963795632348], [1.6961622236947298, 1.6666670194238626, 1.7527286121825749, 1.4461465476300437]], [[1.8811619412061271, 1.9100667945637591, 1.8445906490239146, 1.9214690479550947], [1.8025624219423253, 1.8448172095369506, 1.4966660544104895, 1.2832725829781746], [1.8094267027962698, 1.1375885826765326, 1.5030546817757668, 1.8182491033032764]]], [[[1.9961733690924155, 1.9385604064782116, 0.15598226954758712, 0.92136887176784188], [1.5378624067983235, 1.5523151950355665, 1.6887015673518488, 1.1504252079046915], [1.9913169740527836, 1.4142152721675985, 0.1385613878659461, 1.9804898262088639]], [[1.6964053061705062, 1.1013957616632397, 1.4272095231877091, 1.9227714792212125], [1.6075069939758382, 1.8372545596256498, 1.9989242604737723, 1.9788380467284004], [1.7262236374426407, 1.5430785586149354, 1.0224032299396042, 0.96651914162145247]]]]))
75 self.failUnless(isinstance(res,Data),"wrong type of result.")
76 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
77 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
78 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
79 def test_wherePositive_taggedData_rank0(self):
80 arg=Data(-77.2124777804,self.functionspace)
81 arg.setTaggedValue(1,-76.5223591123)
82 res=wherePositive(arg)
83 ref=Data(0.0,self.functionspace)
84 ref.setTaggedValue(1,0.0)
85 self.failUnless(isinstance(res,Data),"wrong type of result.")
86 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
87 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
88 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
89 def test_wherePositive_taggedData_rank1(self):
90 arg=Data(numarray.array([95.507404522977254, 85.699228977736311]),self.functionspace)
91 arg.setTaggedValue(1,numarray.array([22.570768490261898, -91.124851922506281]))
92 res=wherePositive(arg)
93 ref=Data(numarray.array([1.0, 1.0]),self.functionspace)
94 ref.setTaggedValue(1,numarray.array([1.0, 0.0]))
95 self.failUnless(isinstance(res,Data),"wrong type of result.")
96 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
97 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
98 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
99 def test_wherePositive_taggedData_rank2(self):
100 arg=Data(numarray.array([[-76.258485344070493, -13.031569421642786, 56.331314317015853, 76.297860126066155, 88.130561052243763], [-6.1668191468469757, 54.331037054715466, -81.929096086646751, 11.266746882647325, 48.963064080280049], [60.302120288359191, -98.222376211103324, 24.902263686516406, 76.321693298041907, -15.612529577369273], [-89.36373926383007, -99.797095905565556, 55.669412249479365, 73.050408854136265, 58.641360635396893]]),self.functionspace)
101 arg.setTaggedValue(1,numarray.array([[84.521756116539905, -21.50523951337766, -71.758529828844189, -31.116527593639944, 73.480533241007663], [61.356497085608538, 87.01679183964643, 73.718163356212273, 65.825276106677222, -67.838266379557695], [94.900878893099161, 6.6085152597015195, -16.431260589637816, -60.728182658412621, -20.252278299611689], [16.99540909074102, -92.327824606679144, -84.194337061595093, -99.086577441520987, 1.4609814172980435]]))
102 res=wherePositive(arg)
103 ref=Data(numarray.array([[0.0, 0.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 1.0, 0.0], [0.0, 0.0, 1.0, 1.0, 1.0]]),self.functionspace)
104 ref.setTaggedValue(1,numarray.array([[1.0, 0.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 1.0, 0.0], [1.0, 1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0, 1.0]]))
105 self.failUnless(isinstance(res,Data),"wrong type of result.")
106 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
107 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
108 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
109 def test_wherePositive_taggedData_rank3(self):
110 arg=Data(numarray.array([[[80.508473585546227, -73.527464319061067], [-63.562066924370612, -27.980541518495002]], [[-41.335157425780203, -43.662467900732139], [19.157012696460683, -20.184083339906508]], [[35.870058595838856, 72.278036946039947], [75.339493834805268, -9.1707737241088836]], [[-68.38683588297539, -47.88605412318423], [-20.399875642984753, -29.241844531878812]], [[-67.76044429517556, 55.107326245665774], [59.476906111528308, 65.132080499441145]], [[39.011636203343926, 68.793212772548998], [-5.2117301620619116, -37.964739068093408]]]),self.functionspace)
111 arg.setTaggedValue(1,numarray.array([[[-43.212061592928961, 66.640597663557344], [-43.214739911125989, 71.228530019395464]], [[86.72455453389685, 0.070521918497504998], [18.131949004592585, 67.642647170226724]], [[-20.485683043230935, -76.185964145658346], [1.5005108312435596, 24.688848573063282]], [[86.368146458112335, 12.287053770624041], [65.053528607732602, -40.176824870036555]], [[67.412368199122028, 93.02485737256805], [2.3354688446274565, -77.333138418682523]], [[68.799317717343797, 50.656492146642165], [-11.239017823949453, -0.61920809407223487]]]))
112 res=wherePositive(arg)
113 ref=Data(numarray.array([[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [1.0, 0.0]], [[1.0, 1.0], [1.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [0.0, 0.0]]]),self.functionspace)
114 ref.setTaggedValue(1,numarray.array([[[0.0, 1.0], [0.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[0.0, 0.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 0.0]], [[1.0, 1.0], [1.0, 0.0]], [[1.0, 1.0], [0.0, 0.0]]]))
115 self.failUnless(isinstance(res,Data),"wrong type of result.")
116 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
117 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
118 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
119 def test_wherePositive_taggedData_rank4(self):
120 arg=Data(numarray.array([[[[88.580956068056565, 14.00279382125251, 99.108011223826338, 45.511681652958828], [82.854668978990787, -71.320284703817521, -47.231688078520051, -87.449857804724985], [93.257616694753921, 52.060412772871643, 18.537844019590111, 53.497901549669848]], [[-46.91724689666372, -75.312992998386903, 24.379946633037505, 3.6136809288494618], [55.419075241203274, 64.655875544211057, 5.6929661553654682, -80.668713367017716], [9.6958327067133041, -69.61412534721569, -39.445219790469352, 87.567956888590658]]], [[[-73.321457711307843, 10.82305253374048, -40.400284930212905, -92.490874982007981], [-79.425928971727643, -75.222388693443605, 89.503284861115134, 83.502961391303643], [-88.448173270777147, -50.193426055655976, -70.923108466792598, -25.976738197547292]], [[-8.5488119421924864, -1.9838167877165915, -56.838230691876412, -35.192343099118673], [-14.387471763442306, -65.661449017261418, 75.22011478664038, -84.87320516882086], [98.450531686197365, -81.019483890591289, -94.982842703436916, -49.156850403858819]]], [[[75.118284154717031, -51.311615796136792, -89.182477325683962, 55.44041573353897], [-80.77776129565197, -34.097004704596088, 75.361574051712552, -16.248241864062635], [84.169901667127789, 74.398090927221261, 86.145123497406473, 88.071402053067715]], [[93.648624647556488, 1.6348597078223719, 6.0244027607641755, 19.383999786570769], [-41.76041050584827, 10.228798270020405, -47.174639917060254, -7.0250102695790275], [-48.870699185907625, -19.365332607009293, 51.663276846691986, -68.319951789687167]]]]),self.functionspace)
121 arg.setTaggedValue(1,numarray.array([[[[43.072392507789715, 25.44897255914222, -92.365292140693199, -72.28679201432702], [-35.283625661883562, 51.080784351734991, 94.294048609912153, -48.875639845246745], [54.267354274548921, -77.595839033594572, 13.255608540993677, -79.509755448949591]], [[76.273739615561396, -51.362336359893511, -85.195354636261797, -4.4124416020654849], [-97.854643345235729, -10.568395289402361, -79.904773298276851, -37.753686446232606], [64.250602682004057, -79.115735111510105, -32.503923559859047, 90.214123166503839]]], [[[39.304515721103343, 85.49840367909664, 60.966173887100808, 4.4734960523447711], [53.114809276601221, -14.423789459082229, -13.61152991089152, -96.486812903270419], [-52.378017052068572, -0.16685024940963444, 2.2217407671002007, 2.7128133952607953]], [[58.208300545381121, -23.46308457904766, -67.68416120310016, -35.150913017323049], [-18.407699905877124, 1.6451869874854879, -1.401899624666143, -87.412868064712512], [-65.336170807327917, 68.755684784091613, 85.913136752325443, 27.997231935596872]]], [[[-66.686788600040472, 6.9245385685220668, -75.689596750307246, -73.922470171071836], [-56.830071118701973, -87.957208168819264, 15.670539647819766, -25.0926801353923], [-9.3946841261667942, 81.217979881426032, 31.881116652908219, -94.330057102451676]], [[-13.101408221863963, 5.3815053309403993, -42.53780805955558, -33.796637768394746], [72.590706488145599, -33.171908847280093, 38.102432612245622, -71.169285857339815], [-54.513514454446252, -15.087111212827736, 68.23763859582499, -73.63388136632733]]]]))
122 res=wherePositive(arg)
123 ref=Data(numarray.array([[[[1.0, 1.0, 1.0, 1.0], [1.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]], [[0.0, 0.0, 1.0, 1.0], [1.0, 1.0, 1.0, 0.0], [1.0, 0.0, 0.0, 1.0]]], [[[0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [1.0, 0.0, 0.0, 0.0]]], [[[1.0, 0.0, 0.0, 1.0], [0.0, 0.0, 1.0, 0.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0]]]]),self.functionspace)
124 ref.setTaggedValue(1,numarray.array([[[[1.0, 1.0, 0.0, 0.0], [0.0, 1.0, 1.0, 0.0], [1.0, 0.0, 1.0, 0.0]], [[1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0]], [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0]]], [[[0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 1.0, 1.0, 0.0]], [[0.0, 1.0, 0.0, 0.0], [1.0, 0.0, 1.0, 0.0], [0.0, 0.0, 1.0, 0.0]]]]))
125 self.failUnless(isinstance(res,Data),"wrong type of result.")
126 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
127 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
128 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
129 def test_whereNegative_taggedData_rank0(self):
130 arg=Data(-19.2850342868,self.functionspace)
131 arg.setTaggedValue(1,-31.7600922133)
132 res=whereNegative(arg)
133 ref=Data(1.0,self.functionspace)
134 ref.setTaggedValue(1,1.0)
135 self.failUnless(isinstance(res,Data),"wrong type of result.")
136 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
137 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
138 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
139 def test_whereNegative_taggedData_rank1(self):
140 arg=Data(numarray.array([-69.991852168228164, -51.135726516141467]),self.functionspace)
141 arg.setTaggedValue(1,numarray.array([64.371955068626278, 56.155825493201263]))
142 res=whereNegative(arg)
143 ref=Data(numarray.array([1.0, 1.0]),self.functionspace)
144 ref.setTaggedValue(1,numarray.array([0.0, 0.0]))
145 self.failUnless(isinstance(res,Data),"wrong type of result.")
146 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
147 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
148 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
149 def test_whereNegative_taggedData_rank2(self):
150 arg=Data(numarray.array([[48.844728607913282, -72.785354714899881, 53.3081372120038, 18.65599332913655, -46.488345451249288], [-82.483069621758148, -33.022373579278181, -62.408982644197899, -30.801150776046654, -3.1747181449523367], [68.051986644816708, -10.324492516248156, -35.538799676186628, -76.221649010357453, -10.365176815811154], [12.925649512488647, -69.48406607854993, -14.171821915240514, 66.552057082826508, -98.385243996883332]]),self.functionspace)
151 arg.setTaggedValue(1,numarray.array([[63.457797271160132, 61.751200439630537, 75.390084871615102, -50.818227552321105, 64.870767673506009], [-37.606099936006679, -75.587774814583128, -30.927974509536099, -95.537626302784801, 85.46249790652584], [-78.74170463945444, -96.246956122658901, 26.26558952019225, -96.296602166810459, 28.778665120929929], [13.299637195309444, 63.658102616485678, 86.796794951252622, 49.68308177081957, -86.280121323311391]]))
152 res=whereNegative(arg)
153 ref=Data(numarray.array([[0.0, 1.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 1.0, 0.0, 1.0]]),self.functionspace)
154 ref.setTaggedValue(1,numarray.array([[0.0, 0.0, 0.0, 1.0, 0.0], [1.0, 1.0, 1.0, 1.0, 0.0], [1.0, 1.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 1.0]]))
155 self.failUnless(isinstance(res,Data),"wrong type of result.")
156 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
157 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
158 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
159 def test_whereNegative_taggedData_rank3(self):
160 arg=Data(numarray.array([[[69.353620509386616, -74.080076314847517], [-30.249703014852415, -95.672525613399003]], [[-8.5039415761560377, 60.253313051648774], [-13.801342152251323, 40.764779434191979]], [[-36.581197219625516, 75.047667541458054], [-77.793778451165309, -72.594277712095419]], [[-72.619314204148793, -14.806208252588647], [87.915581023315411, 95.105365322376201]], [[15.147306304672597, 14.666885700887903], [81.180471023319853, 85.165436080616928]], [[43.823915191016482, -49.98290658400564], [-72.588576349996117, 96.137982642309737]]]),self.functionspace)
161 arg.setTaggedValue(1,numarray.array([[[-1.2728722356096398, -60.492198430412984], [24.24667632089907, 27.091663987424013]], [[-32.679381620480711, -97.47865445886741], [-56.075348674988426, 38.715773862053993]], [[16.009087713355214, -68.066576558113326], [25.559656695696759, -9.5774290533191078]], [[-52.544021441893761, 47.869839568114628], [-72.606586250159438, 18.849506685859737]], [[-73.113930006549779, 4.602906873284013], [-56.38605187693679, -27.367675802071062]], [[70.16996004059547, 60.366327688828079], [15.101213546349101, 72.59226569598178]]]))
162 res=whereNegative(arg)
163 ref=Data(numarray.array([[[0.0, 1.0], [1.0, 1.0]], [[1.0, 0.0], [1.0, 0.0]], [[1.0, 0.0], [1.0, 1.0]], [[1.0, 1.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 1.0], [1.0, 0.0]]]),self.functionspace)
164 ref.setTaggedValue(1,numarray.array([[[1.0, 1.0], [0.0, 0.0]], [[1.0, 1.0], [1.0, 0.0]], [[0.0, 1.0], [0.0, 1.0]], [[1.0, 0.0], [1.0, 0.0]], [[1.0, 0.0], [1.0, 1.0]], [[0.0, 0.0], [0.0, 0.0]]]))
165 self.failUnless(isinstance(res,Data),"wrong type of result.")
166 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
167 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
168 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
169 def test_whereNegative_taggedData_rank4(self):
170 arg=Data(numarray.array([[[[78.567215316552364, 73.624001898494328, 6.6089006903017093, -16.066074308908668], [4.6493463096686014, 90.440517625816341, -39.347037075742385, -33.297969929859519], [64.699949994741132, 29.115653652245214, 37.822018084896769, 40.128249957713678]], [[-55.450069727212096, 81.466719888892953, -14.393705514447504, 50.041870644315622], [-26.112384871019117, 91.0126228352174, -89.730765921875076, 49.059538764459973], [38.483838119837088, -96.69931018125024, 20.572376725250095, -19.453405707808002]]], [[[13.464674311866403, -63.957052627899927, 27.769891567982711, -33.550495063440906], [43.131655313012601, 4.7880717355257048, 11.709216606284343, -73.375330948322741], [24.471638138818889, -70.587099709547374, 42.297065361106633, -34.039431318624949]], [[21.857294994809905, -19.704682667449276, -86.108666845333829, -75.436492450552578], [87.94303965840291, 97.530458057774098, 25.97064557505557, -36.945527429857819], [90.911480668328323, 6.1671903724853223, 25.709485934911285, -21.355346056419705]]], [[[67.782998886788846, 70.917380141486149, 13.823579458254926, 18.402548374224679], [-15.060657679519679, 82.09963819729029, -31.92180428664399, -97.536671374116139], [37.669076925828392, -75.58771930699335, 45.895049803831114, 35.48815045691137]], [[12.714019161158106, -57.944653564941675, 62.430334339808155, -66.857496337271897], [-6.4429554795663648, -8.3994486590568158, -80.192945429058966, -93.438462560326158], [34.875330751872951, 69.588212740586386, -70.503265404744013, 35.080768936736405]]]]),self.functionspace)
171 arg.setTaggedValue(1,numarray.array([[[[89.523458495532452, 6.8140581760945906, 52.278561982811112, 1.9103504285077975], [-31.826956501731047, 58.297165172424911, 29.759024667767875, 0.92087730333993534], [28.957424646854918, 94.135111344573943, -32.433995320712384, 67.081234380844705]], [[11.644557903097066, 56.050511369559786, -11.185754045196305, -94.014631510042364], [-89.421458369162281, -27.806019206551923, 42.132488895560329, 37.020232240255524], [43.230885088291984, -83.189373937963836, -74.094138681022528, -14.531760465098415]]], [[[-26.981360981714403, 24.064730821609444, -21.105581216059704, -97.174757209589899], [33.300290491855606, 10.01590267931401, 51.489118545402135, -96.912506834915362], [47.653206939723475, 64.688747326811637, 94.943693671280016, 47.03846492475401]], [[-35.473632387755515, 72.503085095886973, 4.845984081191105, 64.852159504672017], [-19.964052254250646, 84.483169362896547, 73.78740822181058, 45.240727131786315], [-13.995221221821026, -34.521569172453638, 98.500596615631622, 66.324330733855049]]], [[[-16.964585323232882, 26.406760086703088, 20.25984200782429, -62.287754490513514], [-2.4701333556092777, -77.61548111631889, 86.671403323307715, 50.284535309177016], [-39.214050892482689, -36.902295671557624, 26.750130444414737, 91.76317471624742]], [[50.615056318343221, -90.898178535525375, 94.958720223937036, -93.80724680506188], [4.8266070012118405, 10.075720310299204, 42.099211642413536, 10.006938668548315], [55.032904164362009, 11.263981513981918, -63.130755368899848, 81.657868184177858]]]]))
172 res=whereNegative(arg)
173 ref=Data(numarray.array([[[[0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]], [[1.0, 0.0, 1.0, 0.0], [1.0, 0.0, 1.0, 0.0], [0.0, 1.0, 0.0, 1.0]]], [[[0.0, 1.0, 0.0, 1.0], [0.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 1.0]], [[0.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 1.0]]], [[[0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0]], [[0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0]]]]),self.functionspace)
174 ref.setTaggedValue(1,numarray.array([[[[0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0]], [[0.0, 0.0, 1.0, 1.0], [1.0, 1.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0]]], [[[1.0, 0.0, 1.0, 1.0], [0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 0.0]], [[1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0], [1.0, 1.0, 0.0, 0.0]]], [[[1.0, 0.0, 0.0, 1.0], [1.0, 1.0, 0.0, 0.0], [1.0, 1.0, 0.0, 0.0]], [[0.0, 1.0, 0.0, 1.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0]]]]))
175 self.failUnless(isinstance(res,Data),"wrong type of result.")
176 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
177 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
178 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
179 def test_whereNonNegative_taggedData_rank0(self):
180 arg=Data(-78.1544615646,self.functionspace)
181 arg.setTaggedValue(1,-78.4151851666)
182 res=whereNonNegative(arg)
183 ref=Data(0.0,self.functionspace)
184 ref.setTaggedValue(1,0.0)
185 self.failUnless(isinstance(res,Data),"wrong type of result.")
186 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
187 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
188 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
189 def test_whereNonNegative_taggedData_rank1(self):
190 arg=Data(numarray.array([17.602013218893518, 29.547786128150307]),self.functionspace)
191 arg.setTaggedValue(1,numarray.array([0.26203337714731845, 57.479799350895149]))
192 res=whereNonNegative(arg)
193 ref=Data(numarray.array([1.0, 1.0]),self.functionspace)
194 ref.setTaggedValue(1,numarray.array([1.0, 1.0]))
195 self.failUnless(isinstance(res,Data),"wrong type of result.")
196 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
197 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
198 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
199 def test_whereNonNegative_taggedData_rank2(self):
200 arg=Data(numarray.array([[-0.38327384036398371, -34.645139490102878, 65.429233454558641, 95.235253228502785, 29.097950082051085], [-43.855663256862009, 55.686325731330783, -67.824366444401477, 16.702344987904212, 22.218041380401374], [78.969508595512451, -60.305312026473089, -59.523292190062982, 74.808651981782504, 79.872897022513683], [63.606277951467064, -76.462470884188775, -72.691576180524351, -49.079190521880697, 45.394053081951711]]),self.functionspace)
201 arg.setTaggedValue(1,numarray.array([[-55.552381227989599, -54.271211889675719, -12.582403003252466, 8.5917236679262601, -22.455892824367908], [-16.776071759898258, -19.553013266124879, -21.813530512599172, 9.6881948240011582, 98.11892272389133], [-4.3416722922198403, 38.725023582219706, 1.4757500981863529, -39.708613920267013, -80.375084634623164], [-99.616497105650254, -57.007203450971453, 22.87724914844766, 83.97051539516184, 37.346070066579273]]))
202 res=whereNonNegative(arg)
203 ref=Data(numarray.array([[0.0, 0.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 1.0, 1.0], [1.0, 0.0, 0.0, 1.0, 1.0], [1.0, 0.0, 0.0, 0.0, 1.0]]),self.functionspace)
204 ref.setTaggedValue(1,numarray.array([[0.0, 0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0, 1.0]]))
205 self.failUnless(isinstance(res,Data),"wrong type of result.")
206 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
207 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
208 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
209 def test_whereNonNegative_taggedData_rank3(self):
210 arg=Data(numarray.array([[[-13.892573110308774, 43.478804863362512], [-36.040457512639264, -51.981819940572649]], [[-62.169201833468925, 57.986370401331953], [-4.1036429741114802, 48.023435568940073]], [[-80.645707040180412, -10.141695439237907], [-4.8056301100563417, 48.75486098147897]], [[-91.963242822660888, 88.059478204857612], [43.320911501208769, -22.30145015628095]], [[-86.786948436003428, 31.120205822215894], [34.433146395475489, 87.18740518030657]], [[-9.4220225035139435, -20.184163123649284], [-19.921535324926339, 25.857031424846014]]]),self.functionspace)
211 arg.setTaggedValue(1,numarray.array([[[41.114617505053531, 77.617269604848303], [-73.085362575419381, -7.1084361894678381]], [[43.213365294039818, 70.52545134609511], [99.082934876352368, -17.971939602273878]], [[33.829613730905436, 30.404114402478598], [-57.246747638382956, 34.541916089376258]], [[42.317171529871842, -54.768491746554183], [-23.879054879709557, -50.383761075240805]], [[-57.28165027876075, -45.225575620770144], [-31.710104697280144, -75.917892701858989]], [[19.07744929226061, -71.495870306203571], [-10.602129940209977, 68.760350259599107]]]))
212 res=whereNonNegative(arg)
213 ref=Data(numarray.array([[[0.0, 1.0], [0.0, 0.0]], [[0.0, 1.0], [0.0, 1.0]], [[0.0, 0.0], [0.0, 1.0]], [[0.0, 1.0], [1.0, 0.0]], [[0.0, 1.0], [1.0, 1.0]], [[0.0, 0.0], [0.0, 1.0]]]),self.functionspace)
214 ref.setTaggedValue(1,numarray.array([[[1.0, 1.0], [0.0, 0.0]], [[1.0, 1.0], [1.0, 0.0]], [[1.0, 1.0], [0.0, 1.0]], [[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[1.0, 0.0], [0.0, 1.0]]]))
215 self.failUnless(isinstance(res,Data),"wrong type of result.")
216 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
217 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
218 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
219 def test_whereNonNegative_taggedData_rank4(self):
220 arg=Data(numarray.array([[[[31.064058622394185, -23.221839301023678, 68.763472697005085, 59.65832614821349], [-40.149807242440751, 55.03145271535027, -64.4959578656334, -2.1518498706666946], [55.404104858000437, 49.396652662387567, -49.624666695838648, -62.848812119970042]], [[-91.389556659029211, 72.332633311747458, -52.32546838722876, -38.634885477981307], [-71.603348675002792, -2.4791274164933697, 24.130510966659983, -5.0112124293864042], [-25.546226826848041, 27.236363562768304, -61.886267845384936, -60.880197873757623]]], [[[27.658384194987519, 84.510658257152215, -58.927887590834139, 49.108023674331434], [-70.267015166041148, -79.457401602686048, 56.127202277200126, 25.839278403805395], [26.875154742009613, 1.4487959347651866, -88.070139902975072, -38.510490284412093]], [[-47.959868897350646, -5.7819206338316036, -56.800386597248306, -55.237835036677076], [28.516757929967042, 90.778719180512979, 15.739130130788766, -74.040382579111679], [-71.111296754698344, 12.107778742152561, -79.104526891456999, -41.005699875297388]]], [[[18.567303332583634, -73.676314650547354, -97.749794073567415, 59.159591299795522], [29.97705193558275, 90.413624368349787, 24.306766472883965, -69.797371947362393], [-39.289453466471549, -40.65110745107021, -59.028684721855718, -20.270569577803272]], [[83.125187150431088, 27.563776588259614, -9.5176832989115212, -90.5959013499223], [-69.524801083902418, -31.838028445081164, 14.626332705121882, 38.303372039757761], [-9.2077846008452156, -84.558594581494532, -15.169395910120073, 39.522809676227837]]]]),self.functionspace)
221 arg.setTaggedValue(1,numarray.array([[[[-69.876802801564537, -5.9375511403534773, 37.812297768315801, 17.556587568915376], [53.958312857432333, -19.376205062615014, -22.920706818379031, 68.341061958106707], [49.048432585399325, -25.760395137889574, -82.684148984451667, 70.938532287692567]], [[79.604355123625282, 28.576654650134685, 50.589177240580227, 31.904425649228699], [49.30738620973429, 22.581941862820869, 70.638562695750181, 65.557713647175206], [58.121816082877899, -69.657739078881974, 57.259334058428038, 37.031029061370617]]], [[[-57.067719073541355, -83.590170196214359, -87.889020994197423, 77.03678490031848], [23.421242774091994, -64.962452658702915, 43.744442519067377, 67.095949407897251], [-9.97401351270058, -84.15959986185959, 46.118179052522692, -52.922820472672541]], [[52.186352698780212, -8.0958035404479176, -33.331663389002927, -76.607138954123229], [-20.87488584894281, -63.126524249384097, 8.0428232453640902, 52.19000132579842], [-60.91173907515013, 18.081845081324616, -44.231668576405255, -37.550260961693603]]], [[[-27.309398591668639, -5.5219138202315321, -87.956648017701525, 10.89423659338236], [32.139714674893639, -17.347998935818666, -41.884445570079933, -22.512510804223936], [45.623599790055323, -34.102558427374177, 87.032277901218464, -25.231126136650801]], [[-82.687583433642246, 10.301272646701861, -80.557394277641677, 58.389873199971959], [61.375478497215084, 78.589623746356949, -90.675956160020263, -73.180287451090507], [-60.580572035442451, 60.154646880978504, 59.209979266176958, 79.32948990654927]]]]))
222 res=whereNonNegative(arg)
223 ref=Data(numarray.array([[[[1.0, 0.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0], [1.0, 1.0, 0.0, 0.0]], [[0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 1.0, 0.0, 0.0]]], [[[1.0, 1.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0], [1.0, 1.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 0.0, 0.0]]], [[[1.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 0.0, 1.0]]]]),self.functionspace)
224 ref.setTaggedValue(1,numarray.array([[[[0.0, 0.0, 1.0, 1.0], [1.0, 0.0, 0.0, 1.0], [1.0, 0.0, 0.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 0.0, 1.0, 1.0]]], [[[0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0]], [[1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 0.0, 0.0], [1.0, 0.0, 1.0, 0.0]], [[0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0]]]]))
225 self.failUnless(isinstance(res,Data),"wrong type of result.")
226 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
227 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
228 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
229 def test_whereNonPositive_taggedData_rank0(self):
230 arg=Data(59.5300640359,self.functionspace)
231 arg.setTaggedValue(1,-2.15432794908)
232 res=whereNonPositive(arg)
233 ref=Data(0.0,self.functionspace)
234 ref.setTaggedValue(1,1.0)
235 self.failUnless(isinstance(res,Data),"wrong type of result.")
236 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
237 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
238 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
239 def test_whereNonPositive_taggedData_rank1(self):
240 arg=Data(numarray.array([-35.653771579383431, -57.809515571795679]),self.functionspace)
241 arg.setTaggedValue(1,numarray.array([-58.726261256725685, -4.9867937639187971]))
242 res=whereNonPositive(arg)
243 ref=Data(numarray.array([1.0, 1.0]),self.functionspace)
244 ref.setTaggedValue(1,numarray.array([1.0, 1.0]))
245 self.failUnless(isinstance(res,Data),"wrong type of result.")
246 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
247 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
248 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
249 def test_whereNonPositive_taggedData_rank2(self):
250 arg=Data(numarray.array([[66.312754795349093, 82.034605718677227, -46.821806782974143, -87.117091329676626, 79.995435394657591], [23.928044089256971, 37.587150540719591, 8.7201565013642579, 16.527262198522521, 43.468010592942164], [-58.095116913299293, 29.439827568578721, -0.091616442994578051, -54.761434852877166, -11.808816784702444], [-69.299763869285897, -13.113050785108982, -5.1976088703165289, 21.099974177713761, 6.0733045244008679]]),self.functionspace)
251 arg.setTaggedValue(1,numarray.array([[73.896405389024125, -46.001844583629413, 98.809723817761267, 30.537291415620416, 40.574672076255666], [55.468937066548705, 11.801387698915406, 20.974309113460365, 77.660614559427415, 28.161039265035498], [70.623954948137481, -37.457034114261312, -40.898398662139201, 26.109057449542121, 10.398162551919015], [-63.730141883353532, 62.137449485782696, -90.96748737577029, -20.908383264888286, -70.74195335323418]]))
252 res=whereNonPositive(arg)
253 ref=Data(numarray.array([[0.0, 0.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 0.0, 0.0]]),self.functionspace)
254 ref.setTaggedValue(1,numarray.array([[0.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 0.0, 0.0], [1.0, 0.0, 1.0, 1.0, 1.0]]))
255 self.failUnless(isinstance(res,Data),"wrong type of result.")
256 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
257 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
258 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
259 def test_whereNonPositive_taggedData_rank3(self):
260 arg=Data(numarray.array([[[25.436500051631739, -52.748846289150244], [41.085054249733929, 37.28010897113333]], [[99.576478076717791, -9.9679696571838718], [-61.344641894951302, -3.7437435600148774]], [[-50.906089775590772, 64.943203676394404], [42.050588774194182, 63.118383844777753]], [[-35.778055648047726, -63.920957612224157], [15.37985889218254, -68.424348417967053]], [[-56.55550570286416, 42.304324718922885], [70.622324649491162, -12.596055870540511]], [[34.100758417960179, 8.1628573265152085], [-32.962482469141108, 81.284708270077232]]]),self.functionspace)
261 arg.setTaggedValue(1,numarray.array([[[-43.479659251216304, 54.528183443358017], [-57.05484443799638, -63.991441300924265]], [[-26.9579882337963, 26.355076456251851], [-46.233015073952679, 36.53708746210657]], [[-24.786797130371284, 18.160754379725191], [34.747212955275302, 87.480335155520635]], [[28.625134809911913, -60.971379031499382], [-88.66690636480152, -2.9400365936678128]], [[-51.567858740292259, 4.1984826727889129], [-31.243781268304645, -95.989957539907223]], [[-17.551752211418361, -80.268436137583237], [75.208631120335241, 46.121751987400842]]]))
262 res=whereNonPositive(arg)
263 ref=Data(numarray.array([[[0.0, 1.0], [0.0, 0.0]], [[0.0, 1.0], [1.0, 1.0]], [[1.0, 0.0], [0.0, 0.0]], [[1.0, 1.0], [0.0, 1.0]], [[1.0, 0.0], [0.0, 1.0]], [[0.0, 0.0], [1.0, 0.0]]]),self.functionspace)
264 ref.setTaggedValue(1,numarray.array([[[1.0, 0.0], [1.0, 1.0]], [[1.0, 0.0], [1.0, 0.0]], [[1.0, 0.0], [0.0, 0.0]], [[0.0, 1.0], [1.0, 1.0]], [[1.0, 0.0], [1.0, 1.0]], [[1.0, 1.0], [0.0, 0.0]]]))
265 self.failUnless(isinstance(res,Data),"wrong type of result.")
266 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
267 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
268 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
269 def test_whereNonPositive_taggedData_rank4(self):
270 arg=Data(numarray.array([[[[-97.589886785634022, 75.704136798826028, 72.570441980077703, 41.142807006068949], [52.186886198585341, -81.13583733115226, 19.645361321685243, 25.969196500252664], [90.98310621636935, 91.207424784752419, 32.52582221573229, -46.376838969725199]], [[-24.243208827988809, 20.526435158270147, 46.439239753806106, -33.65061411585431], [-50.041229640131604, -49.061380582231109, -39.874744210873516, -36.550968632191804], [32.736481368599613, -75.040028568765322, 46.201877528037613, 66.414419319197265]]], [[[2.5037656480006802, -29.171488642086899, 37.367016013632622, -70.265534203155468], [-5.0615104556033259, -75.110477824991989, 7.1287630039422965, -17.239036014080057], [-28.096242015816813, -7.528715826985021, -85.497229220965764, 22.546758335502105]], [[74.817640632876163, 40.267037402027995, 10.981140051252439, -15.739056364934243], [-11.202000266050078, 76.223681897029763, -17.41622944432541, -3.2765461050635594], [-25.659541213077148, 80.506749270081087, -1.000794733449311, 98.399202561993803]]], [[[-46.153348025882913, 64.301872580934884, 67.551433419371364, 86.776352830516998], [28.558361132430576, 78.958726721940224, -35.553376040555037, -17.553520543738372], [11.165619248232318, -97.969411066483929, 50.903682207966739, -10.289318584097984]], [[22.570215658384171, 75.89748134306177, -89.388639375388706, -54.6472406344094], [-33.869164257400811, 38.645420950299723, -3.8841219051897156, 28.668559253094486], [-82.413441576756185, -78.700513819287238, -75.50816982500163, -52.061106946967861]]]]),self.functionspace)
271 arg.setTaggedValue(1,numarray.array([[[[36.219375399209952, -17.824472494521174, 82.058503767107737, -71.379484930391683], [13.550225541993569, -67.628807348691709, 20.055125227804993, -29.234664858312229], [-18.292530127300381, -39.897170713739548, -39.328945564903783, 2.857031958593808]], [[49.335977298056065, 80.508916415103982, -18.493351689982831, 51.621759203569923], [33.973864190922626, -7.4031669533306257, 11.727041061390153, 64.639807865470686], [42.573651614588044, 41.852110298728377, -64.065734918246676, -6.9916640699874506]]], [[[41.50002565593519, 87.840585919409989, 2.0581894170644546, -3.9639341014441811], [8.7028087633685089, 69.156286173220167, -83.153991217442822, 14.406484280025737], [-34.420051853304614, 94.578630567732802, -48.230261021352902, 53.242310400679315]], [[-84.442282958911122, -99.822594295799561, -39.959520090517287, -90.546856339981431], [20.518433145652864, -98.471982254610907, 22.178227167774111, 71.388198500404911], [69.127077441526353, 43.428513943743894, -71.615864538073225, 20.113448559972809]]], [[[89.953272044597895, 43.16167804611743, 53.919371581222919, 1.3311125255161187], [-95.465237294020739, 67.804004576510494, -14.742900384283658, -27.263059934517742], [69.754390418730139, 79.35923926098971, -51.386888599874567, 51.913251831821356]], [[16.947530613873013, -39.040428548927153, -46.681825859807603, -77.418328228167098], [62.579502644870047, 54.635165987247035, 10.68424789801503, 66.321201110893043], [78.476241287880896, -29.449312093617081, -59.013155676678885, 6.6196016328634357]]]]))
272 res=whereNonPositive(arg)
273 ref=Data(numarray.array([[[[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0]], [[1.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0]]], [[[0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0]], [[0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 0.0]]], [[[1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 0.0, 1.0]], [[0.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 0.0], [1.0, 1.0, 1.0, 1.0]]]]),self.functionspace)
274 ref.setTaggedValue(1,numarray.array([[[[0.0, 1.0, 0.0, 1.0], [0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0]], [[0.0, 0.0, 1.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0]]], [[[0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 1.0, 0.0], [1.0, 0.0, 1.0, 0.0]], [[1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [1.0, 0.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0]], [[0.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 0.0]]]]))
275 self.failUnless(isinstance(res,Data),"wrong type of result.")
276 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
277 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
278 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
279 def test_whereZero_taggedData_rank0(self):
280 arg=Data(-60.3073206028,self.functionspace)
281 arg.setTaggedValue(1,-63.6162748199)
282 res=whereZero(arg)
283 ref=Data(0.0,self.functionspace)
284 ref.setTaggedValue(1,0.0)
285 self.failUnless(isinstance(res,Data),"wrong type of result.")
286 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
287 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
288 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
289 def test_whereZero_taggedData_rank1(self):
290 arg=Data(numarray.array([57.478569368864356, 25.206882696210428]),self.functionspace)
291 arg.setTaggedValue(1,numarray.array([26.231910549413783, -27.085991237832573]))
292 res=whereZero(arg)
293 ref=Data(numarray.array([0.0, 0.0]),self.functionspace)
294 ref.setTaggedValue(1,numarray.array([0.0, 0.0]))
295 self.failUnless(isinstance(res,Data),"wrong type of result.")
296 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
297 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
298 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
299 def test_whereZero_taggedData_rank2(self):
300 arg=Data(numarray.array([[23.125617746775646, -41.981698421134659, 88.634083806667888, 85.022668924224405, 35.388273276293091], [-85.767444923711466, 47.859030088870099, -69.395187041220851, 35.5734575739055, 24.859215630808464], [45.04844052116951, -95.695008500839691, -94.766369979921919, -29.956871512177429, -11.074586010585591], [-20.148312524898017, -79.433644676490502, -19.87738780106119, 58.95117313559922, 50.971789815159298]]),self.functionspace)
301 arg.setTaggedValue(1,numarray.array([[-81.469429807666714, 11.07859262128126, 33.849563441706891, 14.848734531164027, -42.320200232359248], [37.962288693888382, -43.238362945841821, -64.391556397361285, -7.8460700293939283, -20.730397433363208], [97.393519560018603, -94.167885954290782, 94.002103086540188, 51.422088904276251, 63.729022355064359], [95.391379833296668, 62.703543794846581, -70.921738135430985, 70.232187871319354, 86.806722655888649]]))
302 res=whereZero(arg)
303 ref=Data(numarray.array([[0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]]),self.functionspace)
304 ref.setTaggedValue(1,numarray.array([[0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]]))
305 self.failUnless(isinstance(res,Data),"wrong type of result.")
306 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
307 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
308 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
309 def test_whereZero_taggedData_rank3(self):
310 arg=Data(numarray.array([[[3.4027245130060919, -61.09284878347885], [-57.399713635858582, -71.643573213948272]], [[-11.523234389426221, -44.578343090400388], [83.731526181974061, -65.104529547136394]], [[-12.081015577295332, -4.172878078793758], [-89.292376152335635, -25.743293720522729]], [[53.199172477134539, 60.186513433215026], [67.767250940092424, 89.139480682860551]], [[17.059488076066813, 37.190593835102874], [-19.912772973905007, -65.497513416201755]], [[-25.360470411847373, 43.142714268731936], [21.199116504341944, 37.635585100309612]]]),self.functionspace)
311 arg.setTaggedValue(1,numarray.array([[[-11.26010310706846, 34.128222291421537], [-68.434470407451215, 70.638428466633115]], [[-77.544908385112606, 29.23464957312018], [-3.0407974101420763, -31.841776259248377]], [[-4.4176903627463133, 37.991200497907613], [-9.6402073259949077, -9.0856737835734833]], [[26.730099650557975, -65.247161722597966], [-46.62552821590311, -56.733831760674391]], [[-36.874008752740004, -2.7797064670085092], [-64.175546396086474, -99.28541091199989]], [[-5.5337745528672997, -45.378676661048623], [-90.349005740211496, 97.078047761501324]]]))
312 res=whereZero(arg)
313 ref=Data(numarray.array([[[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]]),self.functionspace)
314 ref.setTaggedValue(1,numarray.array([[[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]]))
315 self.failUnless(isinstance(res,Data),"wrong type of result.")
316 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
317 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
318 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
319 def test_whereZero_taggedData_rank4(self):
320 arg=Data(numarray.array([[[[93.831260447485874, 7.7407513574382989, 78.739371854572369, -68.363475865430772], [72.824139460523099, 69.006620095233416, -67.000181405109601, 95.691658959713436], [-46.580816493258205, -19.62723037000471, 7.1964131702848562, -94.003505042058904]], [[85.06939733259054, -12.729485711394545, -95.590773804649672, 66.129455034149544], [52.5485700301343, 1.8469556361458359, 59.238187186745563, 0.89938435519005111], [50.763202555174757, 38.515989700998915, 14.509412952688436, 19.098524401100889]]], [[[15.441947994447844, -87.547935450574357, -15.093661946970599, -34.577822306130841], [47.655788884739167, -13.593073478163831, 73.901883902793401, 50.766658802389429], [93.106292386838589, -26.449736171409441, -32.523468497737113, -36.825111629796645]], [[-71.149835259772914, -77.966052917274098, -40.594142361637765, -93.497294871292127], [-37.049924286179639, -49.307577406565684, 68.805856372840026, -83.077598973248371], [-35.950769604858124, 53.444154742123146, -29.736934427716307, -0.43882835811794507]]], [[[-28.804291026424494, 36.420207954120713, 44.975880956788671, -18.160405554758484], [-15.015205668084675, -36.844405430803782, -55.648827533689385, -63.666847070332658], [-38.323848308813055, -86.094993931559884, -47.504890814498715, 75.386260617980327]], [[-49.43361721674431, -48.467520039782322, -13.393183500735859, 33.478259837688171], [-46.591630982573548, -15.732761279461855, 55.398884354877111, 42.656388373806152], [20.973563827725044, -83.810921836893868, 37.036944354976555, 95.055268401462797]]]]),self.functionspace)
321 arg.setTaggedValue(1,numarray.array([[[[-72.44920515300953, -5.1325597489963855, -70.544555413458653, -21.868457284041369], [28.059209379223262, -97.012837923502218, 17.364646849616733, 69.883388876193692], [-88.768250111578212, -49.421061117246538, 33.314147890655022, -43.967461259845294]], [[35.724082924424522, 21.20468417199848, 5.277992247636206, 77.828098329437609], [83.375548593581215, 72.566063535932898, -39.58180677719443, 85.382749592078113], [72.093057622870248, -28.938840377791905, -22.476983470220873, -96.655105739800831]]], [[[-95.917035925462301, -0.3656737198951987, 78.260689518762831, -26.841902628320639], [69.925254995666364, 62.325571622342864, 47.660763937485541, 32.260139442261902], [-2.2726094824157173, 8.5002090466555558, -41.642153397299793, 33.220453104115677]], [[22.661303145423545, -52.489538131795044, -89.151747983141831, 18.242363722336137], [-25.178052459037687, -20.34523575497515, 25.391874579437612, -58.809820165710214], [-60.790728856888791, 37.195293760072531, -41.479538487050348, -21.114525244725101]]], [[[-49.820373222887085, -49.810943103539486, -24.582970051099622, -22.599787936123761], [76.777056975485948, -58.811863993488878, 77.842740611399165, 18.640966616664173], [-19.158614872609775, -72.976807090542167, -86.531194215051471, 48.429555859657114]], [[85.258816970664725, -15.780961333046449, 49.948813051783191, 53.155720106784031], [-85.9905021073629, -0.23998617994342908, 82.190464755424955, 63.007615196139739], [-23.037986153437245, -37.536769208240784, 75.375056084992167, -10.052811879961808]]]]))
322 res=whereZero(arg)
323 ref=Data(numarray.array([[[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]]]),self.functionspace)
324 ref.setTaggedValue(1,numarray.array([[[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]]]))
325 self.failUnless(isinstance(res,Data),"wrong type of result.")
326 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
327 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
328 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
329 def test_whereNonZero_taggedData_rank0(self):
330 arg=Data(-1.9710533403,self.functionspace)
331 arg.setTaggedValue(1,99.5842297151)
332 res=whereNonZero(arg)
333 ref=Data(1.0,self.functionspace)
334 ref.setTaggedValue(1,1.0)
335 self.failUnless(isinstance(res,Data),"wrong type of result.")
336 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
337 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
338 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
339 def test_whereNonZero_taggedData_rank1(self):
340 arg=Data(numarray.array([-59.49925191560812, 86.042241301467669]),self.functionspace)
341 arg.setTaggedValue(1,numarray.array([42.554874917129013, -64.6377412204602]))
342 res=whereNonZero(arg)
343 ref=Data(numarray.array([1.0, 1.0]),self.functionspace)
344 ref.setTaggedValue(1,numarray.array([1.0, 1.0]))
345 self.failUnless(isinstance(res,Data),"wrong type of result.")
346 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
347 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
348 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
349 def test_whereNonZero_taggedData_rank2(self):
350 arg=Data(numarray.array([[-6.8281814038072071, -59.600553597455487, -83.253618903284348, -55.555714436842266, -58.64125306605785], [-54.669636874026729, -40.668963536281467, 48.151126090125331, -82.810118365697718, -2.0625309958108886], [-50.145961443418784, 33.196540210116666, 18.939660902081542, -35.312472223501246, 45.025825447182569], [-91.787750952036063, -19.219817615082405, 30.739339723723532, 46.808225524785058, -53.347997111730059]]),self.functionspace)
351 arg.setTaggedValue(1,numarray.array([[-6.1766328777260071, 12.353983207929858, 87.643004443775652, 0.1054506713352481, -49.898039891751097], [-6.464367133652658, -99.376428379787214, 81.830552974282909, 3.3503835694606181, 99.424767953367194], [-23.667088793561319, 65.145198516233364, -10.00780177932495, -69.125279379621645, -70.19911439214637], [-56.661848212973823, -78.777508065420989, -44.257423096893753, 23.610690037963238, 52.764627315898679]]))
352 res=whereNonZero(arg)
353 ref=Data(numarray.array([[1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0]]),self.functionspace)
354 ref.setTaggedValue(1,numarray.array([[1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0]]))
355 self.failUnless(isinstance(res,Data),"wrong type of result.")
356 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
357 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
358 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
359 def test_whereNonZero_taggedData_rank3(self):
360 arg=Data(numarray.array([[[-77.400629617637264, -7.8585991909028223], [79.37731461196492, -78.311221968888802]], [[-2.2871031341482109, 61.613282578413418], [14.239083629293276, -86.60455578579527]], [[32.648402678335373, 67.120663891666482], [-16.40250641841989, -45.441109646024543]], [[-88.814372300408252, 96.863741115845073], [-53.568931159701449, 61.772732453745817]], [[12.78118059732283, 61.665805717605537], [81.736967250564334, -79.838957222371846]], [[-45.746992316765287, -50.359908369594095], [67.084057007701773, -77.367125763337725]]]),self.functionspace)
361 arg.setTaggedValue(1,numarray.array([[[20.916835852467159, 98.359772976470907], [-65.641953951612976, 48.35339386982011]], [[72.394336553366969, 0.15850039108870817], [-37.64849616557904, -37.7540766591151]], [[4.7508355327704663, 31.008319102711397], [-54.917295021552114, -24.534459964429843]], [[19.525286161344553, 63.669539108570319], [-1.0431050089863732, -17.966268638209357]], [[-79.076564771286044, -45.063188127277719], [-57.520467509927364, -69.399848959156472]], [[74.966631181955592, -21.675113256460349], [47.3018877491821, -95.419016191439553]]]))
362 res=whereNonZero(arg)
363 ref=Data(numarray.array([[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]]),self.functionspace)
364 ref.setTaggedValue(1,numarray.array([[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]]))
365 self.failUnless(isinstance(res,Data),"wrong type of result.")
366 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
367 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
368 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
369 def test_whereNonZero_taggedData_rank4(self):
370 arg=Data(numarray.array([[[[-56.530041249956064, -75.595773656477377, 57.930726925789344, -35.064711718518922], [89.927579325782204, -71.292052004298981, 74.426753570770302, 9.9254833972331795], [66.426699960830888, -79.419436482993362, 70.191990839107291, 25.664966939851837]], [[91.588972225813166, 75.24780363003768, 22.708376398136238, 79.829437424982274], [78.426467246737957, 34.311496583740819, -45.051218540773853, 21.126634987063937], [0.93545608150542137, -64.07783608516722, 50.0880392185164, 3.0383401979216416]]], [[[33.521385232890651, 65.495547288295967, -36.26432133678432, 43.817943477527393], [25.622359237391734, 46.879767530213655, 44.264770652047645, -82.611848465548164], [8.6931324018650855, 98.705476157468638, -69.064996470241397, -82.140570519506227]], [[50.341676972542217, -57.113225217844878, 23.496128915773994, -84.4500434098574], [-42.826308284507533, -40.068614099685277, -64.107129980786979, -64.752370052337284], [-68.77258294388686, -65.093744454055411, -2.0441147238691144, 38.710454571834248]]], [[[23.964849311323277, -9.8504539937835318, -24.01385095241659, -65.609734597116542], [-34.482955634964824, -55.357317162052141, -29.891659032054235, -59.722077669432629], [24.465604000129801, -3.1488488615906647, 90.185493485946637, -9.9469471059439201]], [[47.887647758738581, -18.650373829652906, -88.084195156027434, -50.216336238949744], [84.137883656735909, -12.149905093038768, 96.23351445652429, -70.450849093320912], [79.18622708472455, 93.448904090150648, 15.570836279018437, -91.458357264821544]]]]),self.functionspace)
371 arg.setTaggedValue(1,numarray.array([[[[-12.894979773801623, 48.187305922131372, -22.228691774958477, 71.32250925591336], [88.198575928561297, -82.879750265641363, 6.0047803940490638, -75.104784095705114], [95.651210249923281, 99.227840476768279, 38.201888712638237, -85.338045871397298]], [[61.890764559936457, -99.084864794308373, 19.908026187604563, 76.48683075285868], [15.244819962785968, 81.134443755015496, 91.695315009752335, 53.656684202280047], [-13.910795126783682, 62.546356367686997, 57.939671348548501, -16.711735701291104]]], [[[-17.647299335238117, 75.459048312325109, -41.034997451013353, 22.776483937861556], [-97.792781150657731, -89.213116628864611, -36.170629374287323, 76.170885998109583], [51.302094246614928, 73.764119678021643, 2.9931334740095537, -6.7949120092559525]], [[-81.233259812949598, 86.178813783813297, -0.82062800096618105, 95.276937599720668], [25.56603608019212, -69.150407154520252, -97.002071851697821, -38.857149391397485], [86.964544699076953, -44.217066849378782, -92.21466310897317, -30.366338991012668]]], [[[66.127428481144136, 84.702864167161209, 53.320435341942385, 34.341339969042622], [75.475890485661608, 6.568751254456501, -32.661380753798539, 73.048056732159722], [8.3932556720025104, 86.553622630163773, -96.143353218643952, -12.061654127884765]], [[53.325736920559024, 24.80213757617615, -70.674103395487791, -11.797716418097565], [-39.44141732563584, -42.670437444648911, 79.49977026651581, 79.898615913406843], [-32.436244300917423, 63.389192944364225, 48.691557489453828, 91.496017284059604]]]]))
372 res=whereNonZero(arg)
373 ref=Data(numarray.array([[[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]]]),self.functionspace)
374 ref.setTaggedValue(1,numarray.array([[[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]]]))
375 self.failUnless(isinstance(res,Data),"wrong type of result.")
376 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
377 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
378 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
379 def test_sin_taggedData_rank0(self):
380 arg=Data(-24.7105931613,self.functionspace)
381 arg.setTaggedValue(1,-37.638505349)
382 res=sin(arg)
383 ref=Data(0.40972088744,self.functionspace)
384 ref.setTaggedValue(1,0.0605693981609)
385 self.failUnless(isinstance(res,Data),"wrong type of result.")
386 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
387 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
388 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
389 def test_sin_taggedData_rank1(self):
390 arg=Data(numarray.array([19.860974255803598, 48.899013130941427]),self.functionspace)
391 arg.setTaggedValue(1,numarray.array([14.319017737469665, -59.326252904429587]))
392 res=sin(arg)
393 ref=Data(numarray.array([0.84758534887649317, -0.97919776342443343]),self.functionspace)
394 ref.setTaggedValue(1,numarray.array([0.98351066065067827, -0.3560220138624291]))
395 self.failUnless(isinstance(res,Data),"wrong type of result.")
396 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
397 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
398 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
399 def test_sin_taggedData_rank2(self):
400 arg=Data(numarray.array([[37.890743553866486, -52.175642782800914, 61.917008025503975, -8.538416676807941, -94.304749798245496], [-17.787570828089727, -19.048274463511873, -8.2634570563295142, -56.253500812466228, 87.627404284894396], [-14.454217499387354, 73.713310630128319, -52.818033941567855, 90.807246316901796, 59.632923220807299], [2.3430650859352511, 56.726750975618302, -69.98474018040875, -30.128841460819984, 0.11683572211893534]]),self.functionspace)
401 arg.setTaggedValue(1,numarray.array([[-60.059131288860598, -78.931098378024842, -99.522738887570867, -9.6007074071729619, -66.250286193785655], [15.651568400631106, 57.654505938017678, -21.858524591969015, -92.849176312405305, -45.214082756051297], [-85.045751900057368, 10.170104148330267, 85.540180625403167, 34.743740334373229, 27.680023474288177], [72.313181060961483, -93.451973592336017, 68.715544032783157, -57.013152797460179, 69.395677045629242]]))
402 res=sin(arg)
403 ref=Data(numarray.array([[0.19046098975424755, -0.94296657311066345, -0.7924680880494267, -0.77477635663664268, -0.056939378452443026], [0.87332421967504115, -0.1974132538348578, -0.91732979816211846, 0.29089958624583467, -0.33083665313437571], [-0.95015908369497537, -0.99349574918962724, -0.55556403598677151, 0.29450799309098907, 0.057305786038470398], [0.71632946014175625, 0.17714342493014262, -0.76413661669322097, 0.96002319680218495, 0.11657009080686483]]),self.functionspace)
404 ref.setTaggedValue(1,numarray.array([[0.36056248350542847, 0.38137387117559401, 0.84588700623357704, 0.17502331279847, 0.2733177892111176], [0.056364979209719938, 0.89384032979663164, -0.13223553506078178, 0.98521137495670197, -0.94308411592712293], [0.22091275938263169, -0.67821155091384655, -0.65726119089937152, -0.18514670365491534, 0.5599375367095778], [-0.056519892938693105, 0.7144278132655969, -0.38895255454538685, -0.44796245325739548, 0.2769693862212248]]))
405 self.failUnless(isinstance(res,Data),"wrong type of result.")
406 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
407 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
408 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
409 def test_sin_taggedData_rank3(self):
410 arg=Data(numarray.array([[[-55.804968616645148, 58.560992915206214], [42.652192703056301, -91.42882116095241]], [[39.310441995226739, 33.870993341596233], [80.401033234710297, 73.000828209637689]], [[5.7360515152169285, 82.330874482727353], [-75.426134234758621, 7.5453684113771118]], [[-19.895965390103115, -88.950469683568315], [31.355932404642459, 36.487846363447858]], [[67.666456279782437, 58.020389340319895], [-37.89476101041673, -42.399630457776482]], [[-23.830782444196501, 6.0849055767691738], [91.294861085921525, -52.847710860098182]]]),self.functionspace)
411 arg.setTaggedValue(1,numarray.array([[[-18.125779887526264, -95.420123122001257], [-8.1568796731757516, 32.219735537825017]], [[26.245851241680057, 96.102520961925848], [14.02431043315147, -9.9572364002324321]], [[17.181359346351925, 47.963801042849468], [-95.527667200507665, -64.204019349910141]], [[-98.658267090216341, -7.0939733146426107], [-41.783037015039959, -46.517744129299096]], [[-57.202627940362859, 79.223818560607498], [-70.017222005175654, 23.987327490175844]], [[71.375583584624991, 89.788775552486129], [98.882752617270086, 21.455679838723768]]]))
412 res=sin(arg)
413 ref=Data(numarray.array([[[0.67701499649890673, 0.90409941974537544], [-0.97117328078000487, 0.31706594876811195]], [[0.99917861697072197, 0.63385392022976472], [-0.95812352836612924, -0.67738144661254696]], [[-0.52024157266400017, 0.60476080407034305], [-0.027906925031102141, 0.95275570243286156]], [[-0.8656310935760867, -0.83375573809919057], [-0.059958148294456545, -0.93606199112953326]], [[-0.99254113222478446, 0.99509611012034227], [-0.19440335819459723, 0.99992954803650558]], [[0.96408030914008547, -0.19698305893325982], [-0.18755672118757361, -0.53064744896026339]]]),self.functionspace)
414 ref.setTaggedValue(1,numarray.array([[[0.66221880833880609, -0.92166239454618104], [-0.95447604942411934, 0.72000463780845769]], [[0.89707725485516432, 0.95995773196345946], [0.9936384606300962, 0.50765297031738676]], [[-0.99526034460150747, -0.74458387237142676], [-0.95798362538691173, -0.98033782538997782]], [[0.95477283132130442, -0.72483027934968591], [0.80893159374577939, -0.56970402250150143]], [[-0.6083342836862955, -0.63189999754289639], [-0.78468240482370322, -0.9108809171944825]], [[0.77140583862359613, 0.96806942866170043], [-0.99700488005111876, 0.51024422262880564]]]))
415 self.failUnless(isinstance(res,Data),"wrong type of result.")
416 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
417 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
418 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
419 def test_sin_taggedData_rank4(self):
420 arg=Data(numarray.array([[[[95.057014858860498, -50.023546676067944, -19.520550887074563, -14.915416158905259], [-72.276262048791182, -57.778697211921127, -10.589425732964969, 25.789691603835237], [71.432158308304565, 83.59773672148529, 32.062292384526415, -22.527648292677569]], [[-39.074624167039062, 92.303231204531414, -1.4192851682411742, -68.883629510294497], [46.825962360174429, 85.58307574133471, 83.176640836526758, -93.888543574320394], [59.195891546840528, -43.884372920271829, 46.885208516026694, -24.330067940056807]]], [[[-85.391419005371418, -52.993590690134319, 41.1653245235631, 70.963880995127738], [-6.8099927112965162, 14.755258748362692, -77.400445539133742, -3.6276152651411877], [-88.775588041032492, 89.080955577757038, 0.97522108268380236, 11.904044693769748]], [[28.114564123404421, 17.406751514150216, -90.824155259332073, 66.590378374684491], [-23.314357242078572, 66.459924224373196, 1.190010463508969, -19.129294185825657], [12.759163310131783, 94.16098679455763, -80.470912052594556, -87.769040453881502]]], [[[-68.103901459227245, 96.524362598603318, -3.2834594710336376, -25.520289808877067], [56.393892750276962, 17.548302326605253, 15.721717465663659, 76.20380788007958], [-65.13810360798314, -4.9406764890286041, 65.373960553505867, -11.670204391287569]], [[54.171569268655503, 53.359368061868707, -46.012260984758143, -78.151318891542985], [20.615711960999178, 40.160242458140658, -80.640118059335776, -94.602105820605374], [58.356391780158305, -78.074396086921837, 69.50163735189372, -68.547938015025153]]]]),self.functionspace)
421 arg.setTaggedValue(1,numarray.array([[[[1.279534719127895, 77.967895548901566, 56.093855457217416, 55.241022797731574], [-99.18622666243968, -10.886097986772711, 44.708474069781573, -26.616286906326849], [-92.350922530980355, 54.858168650538886, 51.906834850649233, 77.865437338097109]], [[24.233171382130436, -49.713594059906626, 75.407909417958365, 86.691179170294532], [96.871157363423322, 23.148017134014822, -29.421912304159292, -58.976308318504977], [-5.4545343262298189, -89.036199846063681, -83.742519983327739, 35.372319522991887]]], [[[-95.511576008994936, -83.10806319229718, 63.825192259702391, 92.80910275607684], [44.426319323500707, 88.815074429332554, -18.021325932633019, -69.917789857742505], [-84.319087816871672, -30.317627038327316, -38.345827346198959, -81.91833965828738]], [[11.186751110650022, -54.257619696250828, 84.729270493118236, -8.0244377640246114], [77.805655721275429, -14.229050163525699, 32.671007471850089, -96.882778316793122], [-56.456065533953058, -25.01675593935984, 65.68053871510449, -14.266571167222295]]], [[[-39.965547886942353, 19.317802794261738, 80.566440631464729, 43.745566353754214], [28.366421988006579, 68.970448204763755, -64.475182800936267, 20.331319130101249], [-87.117125888478327, 91.992851667866603, 30.281916963531046, -39.27414258485895]], [[93.364522015716602, 78.717156004724472, 61.222491284093536, 86.104631528043967], [29.395392816847448, 16.532063410538484, 10.319065205651995, 10.917748038478663], [-92.263775558488874, 50.00911791017316, -6.6661922286034354, -51.536766809586055]]]]))
422 res=sin(arg)
423 ref=Data(numarray.array([[[[0.72375966950305115, 0.23958247784190015, -0.62176555507714748, -0.71214373694684574], [0.019629755360536964, -0.94249864392330207, 0.9186492389762253, 0.61070482468498899], [0.73418989352805997, 0.9408956015682427, 0.60228932671485913, 0.51113062555018463]], [[-0.98099259974089892, -0.93096397739276848, -0.98854412433116323, 0.22934906491349744], [0.29353958469160507, -0.68897514951619387, 0.99714636265035372, 0.35155913660386867], [0.47447618324952018, 0.097767803237166412, 0.23642150489763264, 0.71921602354647907]]], [[[0.53829894600069828, -0.4018025366804851, -0.31894868102661073, 0.96159352277239407], [-0.50277617521839357, 0.8149857013480003, -0.90837056606621547, 0.46711279434815001], [-0.7249719991634016, 0.89850915924785046, 0.82782593247756842, -0.61495265106171171]], [[0.15909090210144514, -0.99182021016560207, -0.27830764816239967, -0.57853598042401821], [0.96950642440138313, -0.46751584043254807, 0.92837285606475217, -0.27610409657055596], [0.19160059401890014, -0.086683885904533534, 0.93579131574343599, 0.19430985516438759]]], [[[0.84743598014352139, 0.76110153119788515, 0.14139142291111614, -0.37791993461054291], [-0.15415780695875661, -0.96389276338977681, -0.013753764053628931, 0.72123543134514545], [-0.74152608990617153, 0.97405537665333219, 0.56421749260196419, 0.78093804490852481]], [[-0.69217200421492153, 0.04768895464089825, -0.89642177035913229, -0.37879826270669459], [0.98097790580385125, 0.62915222544178329, 0.86305700540000696, -0.34695851228481017], [0.97206368588434766, -0.44879839287225581, 0.37704058161193998, 0.53718857715535373]]]]),self.functionspace)
424 ref.setTaggedValue(1,numarray.array([[[[0.9578823534926072, 0.54124816795457964, -0.43929370911716231, -0.96557502749159507], [0.97455749834004068, 0.99401345246169626, 0.66401590677623057, -0.99619607619697281], [0.94731148656605035, -0.99284417199371577, 0.99751195316042607, 0.62441237853622522]], [[-0.78305944951663353, 0.52429620121273146, 0.0096855803621312825, -0.95610712166060408], [0.49533020111560083, -0.9155481075478985, 0.91177208072521287, -0.65482579444370448], [0.73702027966623906, -0.8779702346494217, -0.88218472628424938, -0.72758863915572014]]], [[[-0.95324448144023388, -0.9896294977803074, 0.83785349282853971, -0.99128491043904499], [0.42957507779222781, 0.75159719546211767, 0.73673567820434016, -0.71927034677937474], [-0.48285656690859402, 0.89043473057109679, -0.60256841133763539, -0.23472014974367561]], [[-0.98178130166608535, 0.75163971078732728, 0.093593967784617274, -0.98550749523114423], [0.66996424044290459, -0.99578170573160452, 0.95057449576530817, -0.48520180467023327], [0.092469940703161432, 0.11572541384732027, 0.2887366377307638, -0.99163895037731464]]], [[[-0.7676438791646546, 0.45132255753166978, -0.89789686094785226, -0.23452586033429529], [-0.091958006320412053, -0.14408689254970225, -0.99737060586631121, 0.99603916939064607], [0.74960719408299126, -0.77496816002780011, -0.9061156382123059, -0.99999103487825647]], [[-0.77281036418314564, -0.17641158915267149, -0.99925644477650222, -0.95848189929893357], [-0.90056129662048501, -0.73393688041745886, -0.77976304128985197, -0.99697306576558797], [0.91583747858958031, -0.25356559568768045, -0.37371120994166129, -0.95548059670784435]]]]))
425 self.failUnless(isinstance(res,Data),"wrong type of result.")
426 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
427 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
428 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
429 def test_cos_taggedData_rank0(self):
430 arg=Data(52.3923651613,self.functionspace)
431 arg.setTaggedValue(1,92.6499316384)
432 res=cos(arg)
433 ref=Data(-0.527866301451,self.functionspace)
434 ref.setTaggedValue(1,-0.0270483432209)
435 self.failUnless(isinstance(res,Data),"wrong type of result.")
436 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
437 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
438 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
439 def test_cos_taggedData_rank1(self):
440 arg=Data(numarray.array([-74.897126998165533, 76.673400450800756]),self.functionspace)
441 arg.setTaggedValue(1,numarray.array([99.065445380314515, -86.748306948983256]))
442 res=cos(arg)
443 ref=Data(numarray.array([0.87705625402072684, 0.29133259267605394]),self.functionspace)
444 ref.setTaggedValue(1,numarray.array([0.10508243263067833, 0.34712991573165969]))
445 self.failUnless(isinstance(res,Data),"wrong type of result.")
446 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
447 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
448 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
449 def test_cos_taggedData_rank2(self):
450 arg=Data(numarray.array([[40.593544538866865, -8.8839015039393558, -49.468879573084436, -24.708042838510465, 20.413703995745891], [-79.108713409558405, -68.647136982462371, -80.858963259372672, -43.373193372132903, -19.507573187625411], [64.214585816318845, -78.826300537435486, 57.661889712775803, 95.493641862455291, -48.386749127960769], [67.334847000926004, -34.70671409523483, -36.873199353443709, 3.6386929918643176, 35.181153901083945]]),self.functionspace)
451 arg.setTaggedValue(1,numarray.array([[-30.787970015064928, 82.074060959202797, 25.479756845345577, 10.895119259966464, 63.74412167304564], [-60.035262414428935, 54.332578347635263, 18.293985264200202, -9.7571535510820695, -70.419305661969503], [-66.629926110044835, -43.57208065884415, 57.437026616340574, 20.73240225691022, -80.496461940478952], [19.883318148806438, -98.729450313914597, 73.172600335425471, -53.114967436072469, 41.781624603862156]]))
452 res=cos(arg)
453 ref=Data(numarray.array([[-0.96961115090719441, -0.85725773398423355, 0.69913962613000602, 0.91116305149951837, 0.0066482036132297587], [-0.84249563945044104, 0.8925167529418252, 0.68043098049226469, 0.82016110495020733, 0.79120632545455827], [0.18695697167168232, -0.95924330257900359, 0.44177331900046657, 0.3192463084776716, -0.3030933270774539], [-0.20786820316301155, -0.98889106925546555, 0.67788641598410604, -0.87896904245554386, -0.81176118995632829]]),self.functionspace)
454 ref.setTaggedValue(1,numarray.array([[0.80922972543055438, 0.92389756193357364, 0.9403918665642913, -0.10028616065108438, 0.6119531025181365], [-0.9410747774886985, -0.60143262098807782, 0.8495995978399381, -0.94526988131298229, 0.26338463011163266], [-0.79214526943475394, 0.91703450582859369, 0.63068646834096875, -0.30701028605243086, 0.3763461069696134], [0.5115898554852758, -0.22867682408200724, -0.60902205590663616, -0.95763905321643927, -0.5890447354610614]]))
455 self.failUnless(isinstance(res,Data),"wrong type of result.")
456 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
457 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
458 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
459 def test_cos_taggedData_rank3(self):
460 arg=Data(numarray.array([[[-36.309518950317376, 0.93081070250144649], [31.019427711604664, -74.09863093545404]], [[-38.496677203305893, -85.824133574935331], [95.203836891504238, 22.838846451350705]], [[60.75609230931488, 6.003670139700219], [-31.49567872236139, -63.206983059929222]], [[-9.6812822737183666, 0.078728886948780996], [66.900652835446493, -94.869473621923703]], [[-6.6770163744116076, 22.876520146740972], [-55.737787303088737, 6.2425399184533319]], [[-81.429470177177521, -81.6116687923749], [-97.082967034525325, -67.37269287178016]]]),self.functionspace)
461 arg.setTaggedValue(1,numarray.array([[[-76.097111647315714, 55.656786197463788], [11.140883121429439, 54.147885791873421]], [[-24.180524234728694, -45.703945118544723], [42.10979532559989, -22.79785029244421]], [[67.322737034238003, 18.304852118006011], [7.015704936158869, -94.401853589660817]], [[35.279952362677818, -7.8217175297602637], [-81.23891082515344, 54.069639284286751]], [[4.2395499199061106, -11.974337349322099], [-77.095389819359994, 26.711493864407473]], [[-66.565935528207518, 41.011773246282445], [-62.114425668075299, -64.456999774045073]]]))
462 res=cos(arg)
463 ref=Data(numarray.array([[[0.18021343448473101, 0.59718391060744369], [0.92241876797360978, 0.26789121482669265]], [[0.69845114643777229, -0.53934947535935607], [0.57674535988171327, -0.66171093596184249]], [[-0.48377631503826568, 0.96118931155712628], [0.99682147963778267, 0.93046000296873854]], [[-0.967282744906935, 0.99690248160545425], [-0.60007048402362761, 0.81289300751647198]], [[0.92344574856902162, -0.63300189293768494], [0.68886045878833047, 0.99917408990060674]], [[0.96843093014337922, 0.99756913767256539], [-0.95342403093885042, -0.17070899404470352]]]),self.functionspace)
464 ref.setTaggedValue(1,numarray.array([[[0.76555810931252977, 0.62794880060935965], [0.14479801574845574, -0.73792168383216183]], [[0.57987832415218665, -0.15028015665535041], [-0.29714910041836201, -0.69188358205701828]], [[-0.21969811854411034, 0.85528080687409014], [0.74349177468513394, 0.98815406589512933]], [[-0.75019910814961466, 0.032258506831785543], [0.90368477270236081, -0.78841749829099372]], [[-0.45541567307928488, 0.82980773284067688], [-0.12603373471688831, -0.0079562249516561077]], [[-0.82955287573817371, -0.9854033904934385], [0.75349957000523238, -0.054323621236985108]]]))
465 self.failUnless(isinstance(res,Data),"wrong type of result.")
466 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
467 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
468 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
469 def test_cos_taggedData_rank4(self):
470 arg=Data(numarray.array([[[[37.610264246462435, -85.560668463311075, 92.790982866326573, -21.753674410293172], [-23.164181244709354, 64.496397223384463, 69.277186049494105, 6.3927475799028457], [67.583896168477764, 36.111360823700437, 30.266912701944563, -54.963319263159384]], [[-58.145969583496672, -97.225443498755453, -56.934313916342269, 35.421162068171839], [65.866615855863898, -57.072034755161027, -95.488754117534285, 81.149953518095799], [-18.30949886526929, -89.680457620572071, -73.87886392983259, 81.259366551703209]]], [[[1.8677491996480029, 36.828382975770609, -80.40672114911041, -49.292595896369647], [-37.983864569797767, 35.583525872048824, -42.451157688857613, 33.755615612774108], [32.674252940671579, 90.058275023987306, -96.26155980692819, -90.500098763836021]], [[90.079955965660446, -70.687430685137031, -51.111371179982747, -74.109677346578138], [-32.896920002886091, 62.26499948195692, -59.833741060334056, 11.794198300820895], [43.437452546746755, 97.455115222231768, 87.354131572829402, 3.2818247457694412]]], [[[78.306182680183269, -64.892175839143391, -55.104588214315342, -96.744717049677931], [-38.337933398739985, -72.796076467431135, 60.379171901212146, -81.927733276050247], [63.885059436029167, -31.980639093805863, -57.261994523508044, 17.357515328643643]], [[77.429908518363192, 9.5882415367278355, 72.484182388500756, 63.089077313098954], [84.07047179403375, -21.092477779767819, 41.614178023999727, -98.204118862286279], [-71.275012546567766, 78.730240012789466, -11.573247145900382, 33.098945113087012]]]]),self.functionspace)
471 arg.setTaggedValue(1,numarray.array([[[[-40.533710954365063, -21.161469670738327, -69.120302774135837, -14.38267699844107], [-91.158843533364944, -85.491074434980831, 87.152587959079909, -33.044835488961624], [-68.672525163755367, -1.8217843916724235, -33.6594071845862, -94.719797609019921]], [[5.7039466733317994, 69.091962753216535, 42.000508648719546, 63.142145355765422], [79.524244986771464, 62.133683756888729, -63.061242691543782, 51.048740976244147], [-88.653022332832293, -81.214225577010723, 35.550248226917518, 76.160743630564809]]], [[[-63.524226576744191, -56.896009941669014, 63.19522201987138, 66.388629592533931], [-56.646135485855687, 8.9406032636504307, 89.111063185551444, 12.201705041404125], [64.844923341968638, 93.705153189621086, 42.451679671109446, 55.611996897559266]], [[-50.4500969589295, -56.48304920853591, -43.397487648713806, 24.970484957830536], [10.247946263340424, 53.164372653170489, 20.567237785266812, 9.4104989925598801], [-56.157152366568909, 42.552761052044843, 56.078516299029076, 18.940543407164128]]], [[[-33.632224346804193, -69.405810068119834, 44.225943185591831, 95.213025790079087], [-38.509288601106675, -62.938695142627999, 82.460256045254965, -40.372955049612315], [71.091785922673608, -67.332900637102753, 99.968681344820283, 87.597127665814384]], [[-15.352405373769315, 13.607690117097107, -27.035258608117374, -88.065123343235953], [46.351984421658017, 40.175457656434133, 90.498104230403385, -29.926375524616702], [89.955509906700911, 75.738059235642481, 92.170833583735543, 28.373336853066405]]]]))
472 res=cos(arg)
473 ref=Data(numarray.array([[[[0.99605564800414159, -0.74003978479165422, 0.11375282452021319, -0.97193527337579688], [-0.38735756213150352, -0.09361056558100582, 0.98688284383678593, 0.99400405568827155], [0.039643724768732305, -0.016953880290015939, 0.40938737891293392, -0.014551661058647967]], [[-0.026502388661538694, -0.98659374258249288, 0.92655557103089836, -0.6496724166496719], [-0.99429911442146879, 0.86614127304686683, 0.32387445454567942, 0.86207036562540851], [0.85767934528605649, -0.14455871961558475, 0.051413892338749011, 0.91225420946081004]]], [[[-0.29260780746660703, 0.64426928163414932, 0.29180026978390428, 0.56291609637951678], [0.95973114604298926, -0.51823819807950822, 0.039646471705651949, -0.69533990552752001], [0.3074098932007972, -0.49938120217558235, -0.42863722843891311, -0.82188268941215192]], [[-0.51804635050563663, -0.0015959786891496938, 0.66306628166652848, 0.27851730967463495], [0.089682205138485488, 0.84359470875913611, -0.98972429938704287, 0.71639675290673688], [0.85520784080680545, -0.99783970980023062, 0.81938284847117593, -0.9901835826774219]]], [[[-0.9728315762339087, -0.47020799835491661, 0.12637793045273601, -0.79930700568503443], [0.80279896236009785, -0.85799367135344373, -0.77193843948759455, 0.96981526124126383], [0.49478722014669613, 0.84474246657231211, 0.75618918968201176, 0.078674345855532332]], [[-0.4447440791197817, -0.98666955220849251, -0.97422171127622192, 0.96709984785995873], [-0.7299620834657633, -0.62265062060091214, -0.71548829876243725, -0.68605277637160145], [-0.55567766942870023, -0.98192413256230948, 0.54607588753058456, -0.11198684728536197]]]]),self.functionspace)
474 ref.setTaggedValue(1,numarray.array([[[[-0.9532464104225401, -0.67511267180012213, 0.99998614310380007, -0.24305111882757385], [-0.99861396263192814, -0.78501698113748208, 0.68804387880332429, -0.058079923319158462], [0.90367832948274707, -0.24836118666524837, -0.62308777688597838, 0.89065254831191276]], [[0.8368796543112903, 0.99973376956186366, -0.39951907575386714, 0.95224436545888613], [-0.55333911666953939, 0.76602026469360152, 0.97380536659847572, 0.70861811863632929], [0.77224567755776974, 0.89284034215998742, -0.54640627400327102, 0.72309766743732995]]], [[[0.76973301984773468, 0.94028075556243462, 0.93470472120159609, -0.91504217164360968], [0.99525378084999272, -0.8850594108800458, 0.4117079619272091, 0.93424308242332088], [-0.42799571611881249, 0.85635538858959426, 0.040168038134317727, 0.59247321999590674]], [[0.98300708870591891, 0.99784787493267124, 0.83381726388896149, 0.9868653057824498], [-0.67990129583749026, -0.97069204733006775, -0.14635792168284548, -0.9998980572655366], [0.92433186130108524, 0.14079090200582819, 0.89149968128133894, 0.99586349366046734]]], [[[-0.60159909873717321, 0.9580229239875917, 0.97046484832780555, 0.56921448509653549], [0.68937039860779081, 0.99429781336097167, 0.71172390998364865, -0.89258527400759391], [-0.39489284771819805, -0.20977165731745406, 0.84603990208711677, 0.93324045680470225]], [[-0.93745242426842468, 0.5050818721371243, -0.32567073631884641, 0.99495120989406094], [-0.71658296354855922, -0.78676444613630847, -0.82074485588505508, 0.081155964310960879], [-0.40786936285205416, 0.94280949490341759, -0.48481330596382211, -0.99510320754671833]]]]))
475 self.failUnless(isinstance(res,Data),"wrong type of result.")
476 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
477 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
478 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
479 def test_tan_taggedData_rank0(self):
480 arg=Data(81.2949649872,self.functionspace)
481 arg.setTaggedValue(1,12.3613553191)
482 res=tan(arg)
483 ref=Data(-0.406904128478,self.functionspace)
484 ref.setTaggedValue(1,-0.207936773642)
485 self.failUnless(isinstance(res,Data),"wrong type of result.")
486 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
487 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
488 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
489 def test_tan_taggedData_rank1(self):
490 arg=Data(numarray.array([-95.851047486395899, -87.804262570020512]),self.functionspace)
491 arg.setTaggedValue(1,numarray.array([35.849126399037175, 13.927401673303507]))
492 res=tan(arg)
493 ref=Data(numarray.array([30.785362859177258, 0.16171984883073159]),self.functionspace)
494 ref.setTaggedValue(1,numarray.array([3.4882512502950971, 4.6971057126849036]))
495 self.failUnless(isinstance(res,Data),"wrong type of result.")
496 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
497 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
498 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
499 def test_tan_taggedData_rank2(self):
500 arg=Data(numarray.array([[-6.2123974990845596, 78.448990575809376, -99.326922204393099, 34.466953331401896, 75.081637288912191], [43.152743095243096, -23.515299958653429, -45.139362755422809, 37.555578473020233, 83.674961808589416], [-20.329004079626117, -89.68698187313413, 63.797873117120815, -97.852830452441481, -20.352637389791738], [73.846890877324569, 34.650839207487195, 41.531549740281122, 42.117481567836307, -14.893287864506703]]),self.functionspace)
501 arg.setTaggedValue(1,numarray.array([[32.462416722884939, -48.149844207496905, -56.126695807148465, 60.69249745488338, -88.519356123058287], [-77.612992699512802, -82.951630694447118, 41.156303211277162, 76.793150351335555, -72.585387811636906], [91.644542807801855, 51.947395321575783, -56.950928573202873, 18.806113794978117, -2.4791441058101356], [13.946361780608797, -89.75004089425245, -7.8270132480697612, -75.115117512127185, -17.025098103456472]]))
502 res=tan(arg)
503 ref=Data(numarray.array([[0.07090628276813575, -0.091076341049522724, 2.6032644546506951, -0.090814285504178624, -0.32760519036327246], [-1.0924542795462242, -21.423000533021405, -2.2775209371153795, -0.14452724439561776, -2.2228009589039441], [-10.916660613554196, 6.5460789983613727, 1.4468186297845727, -0.49976325011584999, -14.745229039106976], [-51.371685347992141, 0.093591861362473022, 0.82675810400212302, 3.3025618500686895, 1.0603382585364733]]),self.functionspace)
504 ref.setTaggedValue(1,numarray.array([[1.7292248126420149, -1.6500818693323478, 0.44893985316262996, 1.5650975398719362, -0.61967622915013898], [1.3320242181202921, -3.2261605736834746, 0.32651185794691795, 5.6272845624900736, -0.3411363783892129], [0.59719690743737996, -8.962491127283629, -0.42546071042084166, -0.043469475465786209, 0.78003579386887978], [5.1771917698562682, 4.5869701687908737, -37.07146436191114, 0.29092035884983614, -3.8573430010424579]]))
505 self.failUnless(isinstance(res,Data),"wrong type of result.")
506 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
507 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
508 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
509 def test_tan_taggedData_rank3(self):
510 arg=Data(numarray.array([[[-31.363348163296223, -63.428729589813429], [-96.507312106299665, 31.782542686119456]], [[-34.681083479682911, 94.077182149079221], [15.294827923512429, -2.7318887141934312]], [[40.882434195822839, -64.18724581426693], [11.572828840371855, 90.497867255100772]], [[-28.641061694503762, -87.171931801575766], [-11.020127312733962, -30.967479102653854]], [[-7.3186224758889296, -50.786266134306011], [27.048134010190211, 2.5490774473318112]], [[61.949209649501199, 85.202746332031268], [-96.092429938290053, -18.405433004645062]]]),self.functionspace)
511 arg.setTaggedValue(1,numarray.array([[[-56.051822909334504, 24.794825821519993], [-0.67715445796852691, 83.973745178864789]], [[-67.137455945524025, -23.605845271936829], [-50.37296104694218, 61.52765962606091]], [[89.358776831997943, -14.338540458285891], [-29.266662560421409, -3.8651288601611213]], [[34.695285195870127, 90.166487346465175], [-10.666151183063903, 29.826418400042996]], [[35.897311083718819, -5.6908691923045893], [81.788877267557382, -28.486351983044273]], [[-10.244239444046215, 61.596990071263548], [9.0672269007921784, 5.6119735254265208]]]))
512 res=tan(arg)
513 ref=Data(numarray.array([[[0.052626876950351224, -0.67956116470517647], [1.2147515603304766, 0.38397534066424899]], [[-0.12419702009054982, -0.17227194869809437], [-0.43836392791494461, 0.43427926215657442]], [[0.041753938290720764, -4.5704240024751872], [-1.5355049455338108, -0.69642068661122147]], [[-0.38410347124596128, 1.0146352438416113], [40.719994162243026, 0.48114165299842049]], [[-1.6859462819034383, -0.57360288493474976], [-2.7861599010747122, -0.67320458364148295]], [[-1.2161965333027973, 0.39911670622190515], [3.5598363671486943, 0.47582704782624802]]]),self.functionspace)
514 ref.setTaggedValue(1,numarray.array([[[0.54221273929241065, -0.35139316545369953], [-0.80396583079821793, -1.1366271548317615]], [[-2.3211791986595185, 22.764215950312941], [-0.10789436233823439, -3.6616056049070829]], [[5.6030778046056575, 4.8985896068181933], [-1.5314392133091446, -0.88334381751181845]], [[0.13864424980142789, -1.3683712672276451], [-2.9249993656191324, 53.435949643775317]], [[4.2516444503647923, 0.6729153019338332], [0.10788392698491613, -0.2152531375981952]], [[-1.0705573488747255, -2.8639517816691598], [-0.37360951726234692, -0.79422844785382163]]]))
515 self.failUnless(isinstance(res,Data),"wrong type of result.")
516 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
517 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
518 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
519 def test_tan_taggedData_rank4(self):
520 arg=Data(numarray.array([[[[-97.656975158803732, 86.62989131986555, -77.554231481640841, 3.8669983308735141], [-46.038298726138535, 40.067291705031494, -98.270364197569336, -94.6969458479483], [87.514637704319199, -92.077863733525263, -3.2419643949078676, -63.397042107941658]], [[-78.795717243110204, -15.279620056917338, 80.460981482647753, 58.412764427127541], [78.818186435655377, 37.682189940374087, 44.849206889045604, 44.848625721891608], [-35.5574347957388, -12.199741839763533, 97.654780429841566, -80.88961765682032]]], [[[-22.652246910060853, -67.38886650009394, -23.477307930487527, -10.646755410960651], [28.156205936499333, 61.620904094908099, -68.627816293502761, 67.122379266164245], [-98.867312915684863, -67.45476737752476, -25.299310914293784, 37.934440895232058]], [[49.380808935348227, -39.408417085726846, -20.541815407391638, 83.649278193509474], [-87.485520624890597, 58.270434291856475, 94.943963892353963, -72.626165639298705], [76.160653617847743, -56.169631642306463, -99.798183422398054, -90.426229350215536]]], [[[88.117152264551066, 52.841153774969399, 66.022106559130634, 40.622509829181638], [-4.2428278873716465, -39.006278992668378, 25.439473540797223, 61.543987328178218], [-15.166974840542792, -90.535188054136981, 84.651661558032657, -16.693664047828548]], [[74.767862181117096, -78.437587118526309, -79.957730051825251, -82.440913401255031], [13.979534083611483, 37.832449897143647, -41.090148981970032, -8.6289016011243689], [41.053492503522762, 8.9183240359808309, -66.578380761411694, 66.20182099550621]]]]),self.functionspace)
521 arg.setTaggedValue(1,numarray.array([[[[-65.426437737609433, -42.513342752929837, -61.194113194155307, -64.800952933449537], [-99.624865579613584, -3.2191662753780008, -52.527343047996354, -63.282633267519969], [39.453397429286866, -27.130144978241091, -56.965824807007913, 74.720174006700404]], [[-8.9359752895985025, -12.273022000155564, 79.215464783067716, 54.215640736250037], [-10.545731014079962, 39.462823926104164, 40.564010266889511, 92.013499250506641], [20.430731908343816, -93.73852236295572, 38.616446665550825, 16.303457902544551]]], [[[-8.6131335963080886, 91.666532748276779, 67.718239380865299, -24.067799387278825], [2.6235650197201892, 84.44637358608324, 55.396761917366206, 30.029168851594335], [3.7411742822091298, 7.2609312887790338, -64.032694520213113, 71.454721297104697]], [[63.195820999024335, 10.691306316136078, 70.801143686977696, 34.146817443572871], [-81.881989121896652, 39.550920228819763, 4.1371918628010178, 93.50590280236878], [97.927125099631667, 64.442557162542499, 81.251825689023093, -72.766391730318389]]], [[[-99.988258264364134, 6.3957796419498578, -83.783069257657814, -42.282613168159912], [36.226072219705117, 53.514293085963089, 55.242986060328917, 30.924108560738716], [48.213793181692523, 33.583178486196687, -17.776417123041654, -79.70940504468291]], [[-26.186562848112317, 35.053508602494276, -74.15973561349287, -8.998608974101586], [72.625731679153461, -45.763185712759238, 96.157419130429048, 82.60958774405006], [28.466122898236932, 13.661431663776554, -64.305636252969435, 78.126668760850237]]]]))
522 res=tan(arg)
523 ref=Data(numarray.array([[[[-0.27417913318913278, -4.1566210200104123, 1.5091093500762029, 0.88667753844569219], [1.8966516810504024, -0.97631203132464983, -1.2121104814243526, -0.48202716829016767], [-0.48300153499471354, -1.4644610945344889, -0.10071016976344437, -0.63420186225059838]], [[-0.26163711886038371, 0.45661727740971819, -2.7363785710173922, -3.3111423421076758], [0.2857904741045893, -0.016923518088534008, 1.1779198979973127, 1.1765333132126685], [-1.5571186702709128, 0.38398982640921775, 0.27182083255769302, 1.0128687939892587]]], [[[-0.77786631973260933, -6.3841435669149291, -11.786941762312257, -2.749590141226586], [-0.11868049092962783, -2.6579585972745292, 0.52982517743967028, 2.2281208753465154], [-10.738431613965821, -11.146506047949773, -0.16812749423430426, 0.23977164577867416]], [[-1.2212418866506991, 7.1735230424816061, 8.192421452643833, -2.3846593272264083], [0.51943402007653894, -6.5734237237147752, 0.83578647210017276, -0.38732785222465582], [0.95508720601143937, 0.39829550561729016, 0.89993916898678605, 0.80859125720920677]]], [[[0.15375262833206235, -0.63522917927167522, 0.048699277776481524, -0.22172457509128218], [-1.9707778487603462, -3.7049205779162753, 0.3167282752575496, -3.4396185005903077], [0.60077400519944801, 0.64237874378765658, -0.17303671645831173, -1.5094893398587974]], [[-0.72966855935529684, 0.10258684244697755, -6.4899256428743657, -0.94950861550679122], [6.2912235198952393, 0.13413392183447914, -0.25475027110751947, 1.0211790862248971], [0.21605885016652787, -0.55471233347047222, -0.69140625670162514, 0.23243020992993024]]]]),self.functionspace)
524 ref.setTaggedValue(1,numarray.array([[[[0.60899603533502777, 9.7851675904442956, -14.915637546865332, 2.3764544607985711], [1.2760657540936704, -0.077729601321507483, 1.2090043292697605, -0.48401767690643016], [-5.3886094617159346, 2.200117216306007, -0.44316694059504153, -0.80544075052469299]], [[0.53185115511734737, 0.30206325695557501, 0.80148938350550525, 1.047442535039711], [-2.0709860162340474, -5.1191444088641491, -0.28397859569936534, 1.2792587767882238], [-96.338809394137982, 0.55838397029774967, 1.3060273034426464, 0.67754301675915884]]], [[[1.0539199784527833, 0.62743135353607671, -5.6890981603187942, 1.8052864811134648], [-0.56994582002442928, -0.39550809900908157, -2.2459675092850895, -5.3721562872445512], [0.68352279680128936, 1.4837179824840887, -2.5785739645551788, -1.033580665481149]], [[0.38093975110296807, 3.1845224145186783, -8.6338809194109842, -0.43546576800373976], [-0.20331407344276023, -3.4643985918583193, 1.5424352550195062, -0.91653700413563366], [0.59637912459294451, -25.044476766299347, -0.45811677917613758, -0.55904458203375451]]], [[[0.60311480417088692, 0.11307256431662512, 1.7033508050940664, -7.7156847407432672], [-10.196871172372907, 0.1076307213120567, -3.6831649770066708, -0.53572561021033649], [1.9166401734031362, -1.4728710216778025, 1.8407229850668281, -2.3572817040493903]], [[-1.758855002901736, 0.54110631448591939, 2.8976606059699086, 0.45399233058581712], [0.38682887197477689, 4.6895764808665765, -2.8373957569747743, 1.3357904861442966], [0.19417566417476489, 1.9409854797509967, -10.275523383878257, -0.43837851346057438]]]]))
525 self.failUnless(isinstance(res,Data),"wrong type of result.")
526 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
527 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
528 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
529 def test_asin_taggedData_rank0(self):
530 arg=Data(0.989657679547,self.functionspace)
531 arg.setTaggedValue(1,-0.473489993439)
532 res=asin(arg)
533 ref=Data(1.42685052415,self.functionspace)
534 ref.setTaggedValue(1,-0.49324888058)
535 self.failUnless(isinstance(res,Data),"wrong type of result.")
536 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
537 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
538 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
539 def test_asin_taggedData_rank1(self):
540 arg=Data(numarray.array([-0.60614764750793948, -0.76269603799552499]),self.functionspace)
541 arg.setTaggedValue(1,numarray.array([-0.074431252427650141, 0.46633079704255254]))
542 res=asin(arg)
543 ref=Data(numarray.array([-0.65120801803032125, -0.86747147905375954]),self.functionspace)
544 ref.setTaggedValue(1,numarray.array([-0.074500149323603215, 0.48513840344368775]))
545 self.failUnless(isinstance(res,Data),"wrong type of result.")
546 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
547 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
548 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
549 def test_asin_taggedData_rank2(self):
550 arg=Data(numarray.array([[-0.38725529068582309, -0.035002566048380368, 0.29215359547572062, -0.74047728151511116, 0.86375088045015236], [-0.32624879922924277, 0.2147493204278017, 0.69593358057302734, -0.67043661608803573, -0.36870988653065229], [0.47510384739864087, -0.76918433519434637, -0.34537195722060143, 0.011183356922037646, -0.11541581215659935], [0.27260362912724068, 0.61437603398068741, -0.25663483045732682, -0.041872856264680069, -0.91618191033723884]]),self.functionspace)
551 arg.setTaggedValue(1,numarray.array([[0.41390194006847647, 0.47906669770750199, -0.65223346998753673, -0.15143835662945238, -0.33784007340735844], [-0.70843138277904028, -0.54438594011729147, 0.034207507853760921, -0.32612382903828285, 0.70186023759432148], [0.46194569999679191, 0.20862219804974647, 0.43258225592841981, 0.89408040795536747, -0.21133552002226552], [0.47668525800656281, -0.98272511924427908, 0.12392756171121211, -0.74247467351461138, -0.70926856758101375]]))
552 res=asin(arg)
553 ref=Data(numarray.array([[-0.39765272784734212, -0.035009717396994572, 0.29647790574666982, -0.8337802351353637, 1.0426662706606511], [-0.33233251116675155, 0.21643515475826403, 0.76971914249277162, -0.73479708883031969, -0.37762073948486119], [0.49508204578845194, -0.87756375238241691, -0.35263510222938133, 0.011183590047521475, -0.1156735991133048], [0.27609811766175707, 0.66159490472202953, -0.25953880511997846, -0.04188510212750262, -1.1584472025690309]]),self.functionspace)
554 ref.setTaggedValue(1,numarray.array([[0.42673623857902859, 0.49959114862575316, -0.71052717518368491, -0.1520232503062508, -0.3446210935366435], [-0.78727319189839995, -0.57565690165345518, 0.034214182708838151, -0.33220031031626085, 0.77800568719018426], [0.4801877492089463, 0.21016594677352965, 0.44735491475086192, 1.1063738876172791, -0.21294114010121065], [0.49688012059430242, -1.3846520382811431, 0.12424698835488085, -0.83675707078112471, -0.78846008349356012]]))
555 self.failUnless(isinstance(res,Data),"wrong type of result.")
556 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
557 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
558 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
559 def test_asin_taggedData_rank3(self):
560 arg=Data(numarray.array([[[-0.27078670807121452, -0.6521353392582292], [-0.98935156671000035, 0.71924091352997421]], [[-0.596001253659459, 0.61191364730020958], [0.66651667689067051, 0.90368733535070822]], [[0.73399023574476341, 0.70767255658646566], [-0.13936321871982982, -0.62987342971179183]], [[-0.4948738057441634, 0.49128944743073721], [-0.88331247766967902, -0.86621949805759135]], [[0.14384806329256028, 0.095935576215879115], [-0.69504930628562311, -0.41646976607569797]], [[-0.39226444326380583, 0.2452138366202059], [-0.1518719139549316, 0.93521490540250141]]]),self.functionspace)
561 arg.setTaggedValue(1,numarray.array([[[-0.22465455750635011, -0.64081370087964307], [0.6605109979083339, -0.54615750594210355]], [[0.56019147828484561, -0.67363253611107687], [-0.26666555499697531, 0.5822337693194235]], [[0.96028563934974787, -0.53648605635740176], [0.016439994710971462, 0.30498182045115629]], [[-0.27256730376760929, 0.25969816117226885], [-0.64645590181357815, -0.097098197456417124]], [[0.090976011478984375, 0.61837879336933055], [-0.69346965532985538, -0.27865603672245576]], [[-0.18099305537471033, -0.21217824413547803], [-0.24741889558471541, -0.10075712603260512]]]))
562 res=asin(arg)
563 ref=Data(numarray.array([[[-0.27421017834129852, -0.71039772542571444], [-1.4247320578861771, 0.80270911325546157]], [[-0.63851198939279763, 0.65847783965152196], [0.72952644193099725, 1.1283041433740428]], [[0.82417870001472116, 0.78619861108497946], [-0.13981832890670637, -0.68139024128778247]], [[-0.51768960196670843, 0.51356956389655972], [-1.0828819297210799, -1.0475858703421546]], [[0.1443488307389203, 0.096083348390609224], [-0.76848847834177259, -0.42955884388247545]], [[-0.4030920504517207, 0.2477402572487051], [-0.15246188107240444, 1.2088655180324399]]]),self.functionspace)
564 ref.setTaggedValue(1,numarray.array([[[-0.22658851752026385, -0.69555772267891613], [0.72149914702634521, -0.57777028882908332]], [[0.59461693452585995, -0.73911287993369601], [-0.26993164239658068, 0.62147348780168055]], [[1.2880241486013853, -0.56626768327750376], [0.016440735350003028, 0.30991934023703022]], [[-0.27606036257642469, 0.26270962685432236], [-0.7029299940282141, -0.097251423034157833]], [[0.091101977070680226, 0.66667810639918901], [-0.76629367807938997, -0.28239443270507703]], [[-0.1819960893458433, -0.21380341867513972], [-0.25001541559304535, -0.1009283906282767]]]))
565 self.failUnless(isinstance(res,Data),"wrong type of result.")
566 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
567 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
568 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
569 def test_asin_taggedData_rank4(self):
570 arg=Data(numarray.array([[[[0.17667641262684564, -0.20528415608852835, -0.86377896580752189, -0.5808064056077008], [-0.53575131452410674, -0.94973341635526076, -0.94934619991031122, -0.36012502776308042], [0.30866069414823993, -0.22625586744343318, 0.89172233386738275, 0.041379170795829534]], [[-0.74767149169546465, 0.50300329169060554, -0.77484404377979366, -0.8352964117129088], [-0.30013599718442951, -0.10886586640435891, 0.2730681338127674, -0.1615077727930434], [-0.41658644426176838, 0.87939475296716063, -0.86922788571063614, -0.69906009036185479]]], [[[0.12016629383182509, -0.70534585776132253, -0.87839274516803956, 0.2480882290553843], [0.31790318495990477, 0.03461698975366434, -0.027498912345320314, -0.66291073124981814], [0.50626012778834562, 0.77210638834559853, 0.32650848757464579, 0.9203611453694176]], [[-0.47360390489237758, 0.85676222423230053, -0.015787865739628981, -0.37070260942360855], [-0.72961058537924894, -0.14494860353517136, -0.52932600855417877, 0.88281683601885486], [-0.6909459206541444, 0.69160226630289623, -0.54290210856405896, 0.34524619417902236]]], [[[0.36542406478716893, -0.96793946499057182, 0.38442480479198515, -0.57435150997595197], [0.12545758270235607, 0.96934407264412958, -0.24044762690293819, -0.340989156148089], [-0.44460870104468952, 0.88803936519219207, 0.55053765965557822, -0.5546454459624317]], [[0.83841967081685675, 0.50019773286874503, 0.22967486065013221, 0.56354640088505747], [-0.65856710498790327, -0.90765207375799539, -0.58747426169848049, -0.53180638195873375], [-0.83276666060509819, -0.68616293259457728, -0.17418580748690327, -0.62859194512462024]]]]),self.functionspace)
571 arg.setTaggedValue(1,numarray.array([[[[-0.45006916215173465, -0.92518399158900699, -0.04783796036863075, -0.19626369399103549], [0.09169070885520969, -0.87029170445041015, -0.0045652336502262081, -0.32329394607483464], [0.55866492213457741, -0.22397258908984941, 0.052303570015150402, -0.7530677681629222]], [[0.54997830254931301, 0.35346830466133805, -0.40403225037158907, -0.04482659680963097], [-0.11974859579133346, 0.94132610730205091, -0.66324538714156511, -0.22519453019335234], [-0.70728958122137842, 0.92386346743545333, -0.6458871899721651, -0.4609281078649099]]], [[[0.12930111020374491, -0.98520462255645291, -0.40152660242615856, 0.010632521180307775], [0.031150770980220788, 0.55887463503362822, -0.54295081925718014, 0.050402433196199858], [0.013662223054701439, 0.40718009215619322, -0.71883819418052053, -0.96296533562944775]], [[-0.1927124007905795, -0.68855068933515107, 0.6316010981181337, -0.041869003739051891], [-0.046326825303942165, 0.92598846850093763, -0.72356399590221465, 0.25634295052044487], [0.22051227192098355, 0.90166643600746443, -0.06859211365531892, -0.045149621190890721]]], [[[0.39410312014393267, -0.044987876742481614, 0.8979457783429603, 0.72166466731038081], [-0.83729280796152195, -0.97851172484586679, 0.17112070485897912, 0.2107396926071694], [-0.22810606176169324, -0.92777597337878248, 0.58581791765258862, -0.57511066270834021]], [[-0.30425553857922449, 0.63784070657640024, 0.76802042170834328, 0.56358714499635787], [0.76594910306777875, 0.85231338535685475, -0.94636186542722056, 0.77240089163366621], [0.31982221170560687, -0.32750948889637299, -0.034744253720429996, -0.50257821297680039]]]]))
572 res=asin(arg)
573 ref=Data(numarray.array([[[[0.17760871448276636, -0.20675403804646908, -1.0427220071893906, -0.61971896050972197], [-0.56539728309730153, -1.2523832523933589, -1.2511486870629975, -0.36840190993020011], [0.31378465192018662, -0.2282321452737586, 1.1011365828156379, 0.041390988386389355]], [[-0.84454869639849361, 0.52707016378896132, -0.8864683510196445, -0.98867169122207821], [-0.30483522099816734, -0.10908206377238625, 0.27658094036046738, -0.16221829359885875], [-0.42968718537947675, 1.0745894259046815, -1.0536384870903868, -0.7740822073469662]]], [[[0.12045738832689482, -0.78291093220064634, -1.072488853750152, 0.25070628836034903], [0.32351712207393363, 0.034623907281987255, -0.027502379259771104, -0.72469982402898492], [0.53084255928695823, 0.88214908246269863, 0.33260724413419246, 1.1690029652625629]], [[-0.4933782124574862, 1.0289582745627337, -0.015788521685103963, -0.3797654160853966], [-0.8177523437209665, -0.14546102725991955, -0.55780595912809805, 1.0818256899500005], [-0.76279673253995905, 0.76370505307109449, -0.57388899520112124, 0.35250109635513183]]], [[[0.37408833395292318, -1.3168934796373459, 0.39458466710266937, -0.61181174217240464], [0.12578904459759122, 1.3225470507143868, -0.24282698097084726, -0.34796891551730025], [-0.46073736173792446, 1.0930630422580974, 0.58300815127146821, -0.58793680336412102]], [[0.99437717008195303, 0.52382711290120032, 0.23174359978487752, 0.59867256987095474], [-0.71891304682557911, -1.137655796129406, -0.6279341788586954, -0.56073216019431915], [-0.98408642456901807, -0.75620114331540811, -0.17507887513122425, -0.67974142884518618]]]]),self.functionspace)
574 ref.setTaggedValue(1,numarray.array([[[[-0.46684278730023371, -1.1815201100750479, -0.047856225143968707, -0.19754604320899144], [0.091819674168062873, -1.0557942602491508, -0.0045652495079866228, -0.32920830092822206], [0.59277522179959163, -0.22588871606051758, 0.052327446914480526, -0.85271238565039864]], [[0.58233825824309027, 0.36127616478278501, -0.41592063812310764, -0.044841623005844253], [-0.12003665216187458, 1.2265382433727618, -0.72514689608315608, -0.22714269023447864], [-0.78565671511328383, 1.1780552671570363, -0.70218481885046757, -0.47904074383403694]]], [[[0.12966414087424233, -1.3985638911620022, -0.41318311251144624, 0.010632721525817797], [0.031155811146442221, 0.59302809425903769, -0.57394699929636273, 0.050423798063665655], [0.013662648113827933, 0.41936448841432711, -0.8021296351981142, -1.2977925042003347]], [[-0.19392561536532552, -0.75948862127879602, 0.68361662963146053, -0.041881246220352109], [-0.046343412238644396, 1.1836453452376237, -0.80895172981266905, 0.25923682302888701], [0.22233963948715654, 1.1236078001339596, -0.06864601410630812, -0.045164974774920652]]], [[[0.40509178676205976, -0.045003065808640254, 1.1150794983658745, 0.80620405929955008], [-0.99231290343135414, -1.3631154327855153, 0.17196703968158128, 0.2123315842232695], [-0.23013201668885772, -1.1884076378143387, 0.62588891338210939, -0.6127394135964227]], [[-0.30915681905645181, 0.69169133505319369, 0.87574435958173658, 0.59872189267169562], [0.87251631631408044, 1.0203925151294579, -1.2417837981042867, 0.88261263771725229], [0.32554183754839172, -0.33366648106510866, -0.034751247851029093, -0.52657840683397406]]]]))
575 self.failUnless(isinstance(res,Data),"wrong type of result.")
576 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
577 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
578 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
579 def test_acos_taggedData_rank0(self):
580 arg=Data(-0.291587772644,self.functionspace)
581 arg.setTaggedValue(1,0.0219832082111)
582 res=acos(arg)
583 ref=Data(1.86668265093,self.functionspace)
584 ref.setTaggedValue(1,1.54881134759)
585 self.failUnless(isinstance(res,Data),"wrong type of result.")
586 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
587 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
588 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
589 def test_acos_taggedData_rank1(self):
590 arg=Data(numarray.array([0.12826451971761799, 0.33491528109011126]),self.functionspace)
591 arg.setTaggedValue(1,numarray.array([0.22031555171954387, 0.13047651014043127]))
592 res=acos(arg)
593 ref=Data(numarray.array([1.4421774808126324, 1.2292810095841651]),self.functionspace)
594 ref.setTaggedValue(1,numarray.array([1.3486583675462354, 1.4399467435143751]))
595 self.failUnless(isinstance(res,Data),"wrong type of result.")
596 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
597 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
598 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
599 def test_acos_taggedData_rank2(self):
600 arg=Data(numarray.array([[-0.41152758157568659, 0.50648377704044156, 0.004765718148047382, -0.19506763365502267, 0.27315738992922611], [0.33882351517959264, -0.029041529921664644, 0.28655425515791988, -0.58345582451173839, -0.95744850153173044], [0.32067870881780935, -0.59696574288858684, 0.80001515403024226, 0.20766175365526407, -0.92537824876724606], [-0.62608849117550203, 0.49584899163835461, -0.91012458136569108, -0.28964137555570646, -0.019645711019819267]]),self.functionspace)
601 arg.setTaggedValue(1,numarray.array([[0.30161380606367949, 0.47771896537569658, -0.4069706892444982, 0.36563120333238408, 0.34635703099859194], [0.77283471581548135, 0.39085192259836066, -0.91464145652686901, -0.5785113219336232, -0.55834836602534121], [-0.89226447891919258, -0.005420603335181351, -0.23047363216965455, -0.31627282725938288, 0.24708083627782318], [-0.36674157132228213, 0.84284509604242497, -0.55735470644132779, 0.28132905259474161, -0.54756243112029979]]))
602 res=acos(arg)
603 ref=Data(numarray.array([[1.9949258434411383, 1.0396944084450979, 1.566030590606778, 1.7671227348451009, 1.2941226028750279], [1.2251301602101246, 1.5998419405884083, 1.2801680039289014, 2.1937737283320473, 2.8488240011834036], [1.2443503750305041, 2.2105099844323077, 0.64347585165092913, 1.3616123305271102, 2.7528286077860806], [2.2473230240603672, 1.0519841271516832, 2.7143809675072594, 1.8646484580550975, 1.5904433017575812]]),self.functionspace)
604 ref.setTaggedValue(1,numarray.array([[1.2644114932860036, 1.0727399259992247, 1.9899315573166447, 1.196485454770198, 1.2171113576324784], [0.68750036295992678, 1.1692393692469043, 2.7254164558807252, 2.1876987449669811, 2.1631899258148524], [2.6731322180353185, 1.5762169566759732, 1.8033607174166493, 1.8925943802877971, 1.3211298029884102], [1.9463004481873596, 0.56824804065117174, 2.1619926599703043, 1.2856175077339616, 2.1502446915093585]]))
605 self.failUnless(isinstance(res,Data),"wrong type of result.")
606 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
607 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
608 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
609 def test_acos_taggedData_rank3(self):
610 arg=Data(numarray.array([[[-0.0018967734613412057, 0.59300273345453158], [-0.81381641137830263, 0.11977023446026669]], [[-0.037555176051128791, 0.021140469012053797], [0.19984949833653998, -0.11442177154206457]], [[0.34269780843852971, -0.29360044358101034], [0.53220357878081814, -0.36059448682460116]], [[-0.78355112918456538, -0.083700661501167062], [0.32350069086320987, -0.38066114197452472]], [[-0.97705826933358608, 0.40808141278379839], [-0.42109501987534292, 0.38704401675830336]], [[-0.38925229608360801, -0.94561123734124619], [0.38734879630697328, -0.84315118092500463]]]),self.functionspace)
611 arg.setTaggedValue(1,numarray.array([[[0.81502930234987203, 0.0050248424447604245], [-0.39601071676781818, 0.78146079161187321]], [[-0.40269237311187456, 0.59630968314412591], [0.43146464177692678, 0.28202596494731069]], [[-0.88345581362782388, -0.40846927031376268], [-0.65907710124008867, -0.51535297922329859]], [[0.3791891533095284, -0.1878703433573069], [-0.550755371929043, 0.00053164521361281913]], [[-0.67703943464546334, -0.71143279160208883], [0.1862121811026225, -0.84162834520638197]], [[-0.77834727203948528, -0.40520983099715968], [-0.82342473982088238, 0.50868059221882711]]]))
612 res=acos(arg)
613 ref=Data(numarray.array([[[1.5726931013935923, 0.93601340923207366], [2.5214858775304476, 1.4507378791003851]], [[1.6083603363688714, 1.5496542827850082], [1.3695920087141873, 1.6854692556999198]], [[1.2210092255140392, 1.8687874345506976], [1.009595077794389, 1.9397015089412193]], [[2.4711571166083619, 1.654595029389675], [1.2413695403820464, 1.9613074868225726]], [[2.9269767557006974, 1.1504447893795458], [2.0054485856592787, 1.1733727421774625]], [[1.970616056541908, 2.8102648289377887], [1.1730421776900686, 2.5739136323477916]]]),self.functionspace)
614 ref.setTaggedValue(1,numarray.array([[[0.61801656176645547, 1.5657714632044866], [1.9779646207779984, 0.67379274631597552]], [[1.9852526825543613, 0.93190017823864835], [1.1246806413386898, 1.2848911859657939]], [[2.6539841054134725, 1.9915727464827593], [2.2903872908337721, 2.1122158133671496]], [[1.1818764764700775, 1.7597897566840754], [2.1540652930004773, 1.5702646815562391]], [[2.3145286806652781, 2.3623312612316218], [1.3834908482456931, 2.5710876379804022]], [[2.4628254031317334, 1.9880046639617615], [2.5382167551116179, 1.0371447242973137]]]))
615 self.failUnless(isinstance(res,Data),"wrong type of result.")
616 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
617 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
618 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
619 def test_acos_taggedData_rank4(self):
620 arg=Data(numarray.array([[[[0.17419378414794906, 0.20877755349477622, -0.9560863974612771, -0.14865727072192525], [-0.17733095703209234, -0.075638384984418994, -0.95407857695419507, 0.6554653414860343], [-0.61341371635489927, -0.52092549325400384, 0.56479500388669734, 0.6212897490792797]], [[0.62874023072485619, 0.23625020456583901, -0.16020531855055364, 0.55591840537558723], [-0.79872077551867249, 0.04557168403173395, 0.3613949288270315, -0.95572639016521221], [0.79815227797346733, 0.17234806171331019, 0.26868955082890489, 0.98424717569008591]]], [[[-0.54543833436541767, 0.13415007696775616, 0.13534722231297658, -0.72252620207541485], [0.72328095946739612, -0.13862718470167823, 0.044552606563023067, -0.69905432254503375], [-0.085225036679073551, 0.98164131149719402, 0.76464095979981717, -0.86551052241781756]], [[0.62239954920343643, -0.70181949407386546, -0.8168814556558559, -0.13547995725989515], [0.82528036114158154, 0.87633827050160984, -0.080143289194266831, 0.83348769953227908], [0.32539673255685431, 0.93803075579628348, -0.27823622244460522, -0.39447875543393573]]], [[[-0.59356695628956446, 0.42068072139579571, -0.2966816048473806, -0.7687956041808558], [-0.71878760019674037, 0.97463077881539117, -0.31728131209986821, -0.73484475981245589], [-0.12727988625513686, -0.94231248176633886, -0.77734468240253696, -0.90444340163288839]], [[-0.18269489759149571, 0.29439735776753762, -0.27185087948144659, -0.62048852806225785], [-0.98053876278297158, -0.26218270695695034, -0.68261964802157793, -0.019759295107996899], [-0.089430250213055507, 0.74948889896974036, -0.75852786166420638, 0.35370400678788205]]]]),self.functionspace)
621 arg.setTaggedValue(1,numarray.array([[[[-0.1619684522755932, -0.10284993380175211, 0.25821458903539396, -0.82364767575665576], [-0.36584913630709737, -0.72676741961971969, -0.97076126343096136, 0.91364000367151532], [-0.77168739033605294, 0.39113009993279912, 0.48535347425417696, -0.52215067436842233]], [[-0.84535167107707998, -0.87641054599151036, -0.4118154689589868, -0.72256509448603845], [-0.81670007180109772, -0.19694267578855462, -0.27574844635108997, 0.95030776906209558], [0.76565743374572093, 0.46912480629116415, 0.50374256986893307, 0.093162354426354455]]], [[[-0.73310899789237172, 0.2875723021943497, -0.81245888640465547, 0.58799309157190205], [-0.90714187533421775, -0.073098886394030282, 0.67818356310455719, 0.26455797708589723], [-0.66652933651616353, -0.23032652509234064, 0.22892282028568234, 0.44787613065694942]], [[-0.44317080986172785, 0.31925123670093725, -0.18287302844160769, 0.89497686805988264], [-0.30669668515287685, -0.75162807334334503, 0.61189143325364581, 0.053990654942066563], [-0.11090521653913066, -0.24677109143944231, -0.70304586767346078, 0.54736846949774476]]], [[[-0.59873211647357749, -0.31774376245292935, 0.43070766306328645, -0.016079803275450555], [0.5261614333552953, 0.6797542937501353, -0.68473148542300333, -0.41052525916288962], [0.68024025081334183, -0.40577339681915869, 0.4087295894868801, 0.61958252572202288]], [[-0.72011815326102413, -0.10455144248350179, 0.75334594465757676, -0.56149938171962099], [0.16913646946275085, -0.45034525250556334, -0.36739372725079256, -0.041181300029745849], [-0.64556849960251772, -0.040795848776974841, 0.85515343427832669, 0.6096018411341606]]]]))
622 res=acos(arg)
623 ref=Data(numarray.array([[[[1.3957093511629617, 1.360471526581287, 2.8441407383080222, 1.7200066442732735], [1.7490700866368647, 1.6465070213809823, 2.8373649283858922, 0.85599770843850642], [2.2311721630105854, 2.1187311401011293, 0.97061150484655345, 0.90040872753615897]], [[0.89086421992331588, 1.3322913334783058, 1.7316949814428857, 0.9813289023048628], [2.495962524203899, 1.5252088542888533, 1.2010328242314052, 2.8429148515570239], [0.64657435379029982, 1.3975834206961624, 1.2987640322677911, 0.1777321440297753]]], [[[2.1477083304186579, 1.4362405897686086, 1.4350324256625075, 2.3782457505851391], [0.76225455373160755, 1.7098714069908214, 1.5262289680482763, 2.3448704680068988], [1.6561248714124477, 0.19191216072142248, 0.70031230156130786, 2.616965031785782]], [[0.89899161244489156, 2.3487448168313412, 2.5267798820772609, 1.7066941968405251], [0.60009784920496412, 0.50258924678280592, 1.6510256575906948, 0.5854062256837147], [1.2393650626053583, 0.3538928296356465, 1.8527536586887519, 1.9762968634509979]]], [[[2.2062801487665875, 1.136600790119608, 1.8720122511782569, 2.4477519846112199], [2.3728531862116133, 0.22573089755729248, 1.8936576221249246, 2.3962340910120021], [1.6984224020679184, 2.8002691893334375, 2.4612300776159772, 2.7008694873643462]], [[1.7545231138284718, 1.2719714573571184, 1.8461121498570447, 2.2401618278670212], [2.9439834930659066, 1.8360796668105717, 2.3221377460874395, 1.5905569078982662], [1.6603462151776323, 0.72350662179783332, 2.4318473355004873, 1.2092681825027514]]]]),self.functionspace)
624 ref.setTaggedValue(1,numarray.array([[[[1.7334814462425481, 1.673828455510769, 1.3096226655494099, 2.5386097574192203], [1.9453413548263998, 2.3844003298346768, 2.8991783717530111, 0.41864650952806914], [2.4522863458860922, 1.1689371321766686, 1.0640289187834875, 2.1201670767225766]], [[2.5780194523086384, 2.6391534710101032, 1.9952417407117879, 2.3783020085117652], [2.526465489342848, 1.7690348671872353, 1.8501645764491155, 0.31657329697684766], [0.69873356468677461, 1.0824968212721804, 1.0428705855020852, 1.4774986804685288]]], [[[2.3936783941171464, 1.279105226241779, 2.5191536430590338, 0.94222086861618171], [2.7072381573266595, 1.6439604702314694, 0.82550822412311597, 1.3030507874849933], [2.3003397504688494, 1.8032095431448985, 1.3398253531931346, 1.1064078436784477]], [[2.0299290447557947, 1.2458570544086836, 1.7547042970540918, 0.46241697896834122], [1.8825168384735331, 2.4213232683150521, 0.91234657301380784, 1.5167794070081579], [1.6819301661171466, 1.8201432078142425, 2.3504678570451745, 0.99157974394862303]]], [[[2.2127135213118359, 1.8941453082545316, 1.125519574857567, 1.5868768230835029], [1.0167160158190489, 0.82336874945488769, 2.3250315257063354, 1.9938263516346553], [0.82270597341644369, 1.9886211901601889, 1.149734692650326, 0.90258559607088251]], [[2.3747689167871977, 1.6755391877344084, 0.71766104149909937, 2.1669930068530197], [1.4008428772515369, 2.0379483121019257, 1.9470015447043691, 1.6119892756074885], [2.2725637754510268, 1.6116035001525102, 0.54494956853218945, 0.91523810991933396]]]]))
625 self.failUnless(isinstance(res,Data),"wrong type of result.")
626 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
627 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
628 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
629 def test_atan_taggedData_rank0(self):
630 arg=Data(-14.7254534244,self.functionspace)
631 arg.setTaggedValue(1,-30.821724654)
632 res=atan(arg)
633 ref=Data(-1.50299080856,self.functionspace)
634 ref.setTaggedValue(1,-1.53836305618)
635 self.failUnless(isinstance(res,Data),"wrong type of result.")
636 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
637 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
638 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
639 def test_atan_taggedData_rank1(self):
640 arg=Data(numarray.array([79.645526314923757, 31.251712111300833]),self.functionspace)
641 arg.setTaggedValue(1,numarray.array([17.802002898972049, -11.766456436013172]))
642 res=atan(arg)
643 ref=Data(numarray.array([1.5582413534867612, 1.5388089940682592]),self.functionspace)
644 ref.setTaggedValue(1,numarray.array([1.5146818449820139, -1.4860127074426057]))
645 self.failUnless(isinstance(res,Data),"wrong type of result.")
646 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
647 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
648 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
649 def test_atan_taggedData_rank2(self):
650 arg=Data(numarray.array([[-51.014136430165856, -10.355356517133202, 28.251309295456821, 13.133655639607198, -4.4836594247888968], [67.588862677322936, -35.526211499854085, 57.141721412265554, 3.5594116807501166, 24.644697631626315], [-59.211703959261456, -72.046541293224493, -68.738506813922058, 36.183945043854038, 40.813283481240802], [-84.224967550292789, 2.382009962300117, -97.667999664168718, -17.641085801592737, -0.094387632167098445]]),self.functionspace)
651 arg.setTaggedValue(1,numarray.array([[71.722254489170183, -77.163739464663479, -62.935449615094207, 71.421618282216969, -92.086755719577582], [86.1279234487221, -75.927119138293932, -53.426711624869739, 78.243007256108257, -93.228905473462987], [51.146224478610861, 18.135315836848292, 25.055391871257115, -63.299860388548915, 43.155037911250076], [82.260960323640546, -59.034950659315768, 43.419415178367842, -96.721347394404589, 69.939661568517351]]))
652 res=atan(arg)
653 ref=Data(numarray.array([[-1.5511964273421315, -1.4745264598757113, 1.5354145091343874, 1.494802690678932, -1.3513557426844944], [1.5560020692406058, -1.542655526646358, 1.553297765207124, 1.2969112580541855, 1.5302418945935552], [-1.5539093791983924, -1.5569173012079685, -1.5562494664061093, 1.5431667932509703, 1.5462994014411897], [-1.5589239207380323, 1.1733268586785741, -1.5605579164505456, -1.5141710727583415, -0.094108820426104287]]),self.functionspace)
654 ref.setTaggedValue(1,numarray.array([[1.5568545563458982, -1.5578375973438927, -1.55490836758775, 1.5567958786717648, -1.5599374287193295], [1.5591862121193236, -1.5576265635211364, -1.5520812830291499, 1.5580163277677324, -1.5600704510968921], [1.5512470322905925, 1.5157110808099072, 1.5309059297790453, -1.5549998176728896, 1.5476282073492109], [1.5586404907725899, -1.5538588285718626, 1.5477692261183333, -1.5604577159532746, 1.5564992621352502]]))
655 self.failUnless(isinstance(res,Data),"wrong type of result.")
656 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
657 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
658 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
659 def test_atan_taggedData_rank3(self):
660 arg=Data(numarray.array([[[-51.439521199073958, -42.19343667612452], [-57.017857592051982, 42.357194430644654]], [[-94.668069377568997, -97.267849956585323], [95.97751393208145, 72.083118529080309]], [[13.931243087317895, 48.314113039294057], [16.667854995256334, 7.2354641537036457]], [[-35.24080770006239, 6.1151782689095882], [7.2809362943481659, -47.744411262592919]], [[-20.3055738368638, 38.892625438958902], [13.233199681154034, -53.915986490531978]], [[-94.858405410928896, 99.82234948258116], [48.503882060032311, 30.917187302988793]]]),self.functionspace)
661 arg.setTaggedValue(1,numarray.array([[[91.878551047153621, -29.510183345226608], [-83.224925312144791, 83.845227550590039]], [[88.225493436926286, 11.532409624377109], [2.5458204819547916, -60.296569325231573]], [[54.038333175852074, -4.1384279748112789], [23.760565206323776, 21.555672180440922]], [[-33.836072987446173, -77.826802360528504], [42.386301929980959, -28.853499934767314]], [[-92.851208362115315, 51.187485401450829], [-17.065728694813885, 53.278176745218417]], [[-99.442133011258861, -62.662157473770883], [-58.469826126068639, 17.824111168192687]]]))
662 res=atan(arg)
663 ref=Data(numarray.array([[[-1.5513584698690774, -1.5471003942988308], [-1.5532597596608479, 1.5471919713913882]], [[-1.5602334958935613, -1.5605157996684915], [1.5603775966626152, 1.5569243429573056]], [[1.4991381283805512, 1.5501013957909033], [1.5108724340083037, 1.433458236465541]], [[-1.5424277452541746, 1.4087034902352189], [1.4343053177252822, -1.5498545289386529]], [[-1.5215885210143809, 1.5450901753003594], [1.4953721636022326, -1.5522510785229557]], [[-1.5602546889363347, 1.5607788652232746], [1.5501823406963127, 1.5384631301370586]]]),self.functionspace)
664 ref.setTaggedValue(1,numarray.array([[[1.559912823466391, -1.5369226810631742], [-1.5587812739091436, 1.5588701549951265]], [[1.5594622198376147, 1.4843005338925794], [1.1965116310113704, -1.554213155607542]], [[1.5522930567093209, -1.3337034661793217], [1.5287346084657718, 1.5244380631272727]], [[-1.5412506699602671, -1.5579479899433375], [1.547208174948046, -1.5361523528598342]], [[-1.5600268240968616, 1.5512627864671464], [-1.5122662848001094, 1.5520291193633591]], [[-1.5607405660888007, -1.5548390862365009], [-1.5536951554558593, 1.5147513012507214]]]))
665 self.failUnless(isinstance(res,Data),"wrong type of result.")
666 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
667 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
668 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
669 def test_atan_taggedData_rank4(self):
670 arg=Data(numarray.array([[[[-60.786516054960018, -97.443926672116945, -59.730786105649635, -60.552672183608202], [0.067178496327429116, 76.097886671263439, -10.611506241697001, 62.520570069561273], [98.734673799525353, 84.863778955168158, 38.252515267672806, -5.1350082880344985]], [[77.589460335333513, 84.577328211722374, 67.229876917205758, -27.884169005126182], [-55.428762309397705, -42.909045438315019, 5.4478832792561178, 98.719071343277363], [50.041890457414098, -61.217337389541605, -31.625752675276402, 68.601618873426759]]], [[[-25.801223779222397, -29.445798766093745, -44.798995576077047, -13.060782989795968], [-24.868508822871931, 54.456897228862431, -69.005823306352426, -38.013099364990332], [52.520288283056431, 75.090539051454812, 88.11571157196164, 29.940468771848515]], [[-69.126425092990985, 78.527356119425946, -53.114343044690806, 83.848543031621091], [-33.685382028364685, 20.306687112361828, 32.650151957007466, -81.059070647169236], [83.469680236467951, 97.861914954668038, -43.032363052419306, 45.804898833159399]]], [[[72.4991519048626, -92.751679859513942, 26.266552717005069, 26.556036707565454], [-65.853696462593632, 49.53468229171304, -4.1588537709789364, -98.080606358862553], [-75.680355306374167, 28.449553815517618, -86.195746809070101, -79.665759321116923]], [[-3.0262101017673757, -86.441575573369178, -58.423640738004678, 16.659518568604952], [61.02394512053786, -82.308850756533687, -63.48331127418183, 77.928338187268736], [13.711361913844101, -40.319664743955784, -20.625042794109746, -40.404672515921902]]]]),self.functionspace)
671 arg.setTaggedValue(1,numarray.array([[[[34.440676365049114, -8.928215565852156, 82.549857592202045, -23.402816990850781], [81.444943705518057, 24.836590977242707, 12.529228281117838, -30.233298854898962], [-27.744182872849407, 52.425228768719734, 61.267860951786759, -33.849170571356012]], [[-31.944123108883531, -77.558579126251928, -86.569996998801585, -22.877811832681274], [-68.796333830065777, 38.3887156141069, 55.836989989650135, -88.366850454930685], [30.300995863327671, 4.9007881921832848, -27.507754163421041, 76.045942075681637]]], [[[64.072551296634714, 74.888616072380785, -33.075348532233932, -32.445757899913886], [42.326950917626533, 85.004838459602013, -52.797797801406674, 61.710543752406068], [95.848068180331182, -60.15064788445914, 16.670945317241291, -65.666197079729741]], [[76.675531866034845, -46.804170258023724, -79.050686910748411, 20.250281649863666], [44.623682968710199, -23.035506964204686, -54.724272963446111, 40.878243061765005], [53.368726075681678, -99.662799699787371, -0.39118677248215761, 29.872163016238545]]], [[[23.227160380259122, -40.824445575015567, 9.9914772245777641, -70.767759555201451], [43.089621482280933, -84.683624327833257, -72.192063858769018, 55.872440414467803], [-58.127478581268498, 34.87567327109511, 10.580861885981534, -58.73857948325918]], [[77.723769033663018, -18.880641278910758, -80.850165897272433, -58.112001436928253], [53.595081958851097, 5.6247875895140282, -29.124774133157288, -98.409076696537625], [46.599025926989782, -63.970578322466842, -22.107674051037463, 45.27636423071533]]]]))
672 res=atan(arg)
673 ref=Data(numarray.array([[[[-1.554346793780754, -1.5605343748051601, -1.5540561053483741, -1.5542832800750914], [0.06707771134963493, 1.5576561137349634, -1.4768364848555173, 1.5548029547769511], [1.5606685188986997, 1.5590132818747466, 1.5446602078043219, -1.3784619450341296]], [[1.5579086919105407, 1.5589733781788726, 1.5559230843172502, -1.5349490465472442], [-1.5527571087994305, -1.5474954351984298, 1.3892596545420326, 1.560666918317682], [1.5508157282893953, -1.5544625378689159, -1.5391870576196998, 1.5562204436506224]]], [[[-1.53205786478674, -1.5368486716248135, -1.5484781040920352, -1.4943803282798005], [-1.5306064810252038, 1.5524352435915465, -1.5563058104960985, -1.5444956717247109], [1.5517583661301895, 1.5574798570707853, 1.5594481000782767, 1.5374091272945045]], [[-1.5563310879232202, 1.5580625993455297, -1.5519712446798413, 1.5588706265268419], [-1.5411185754107688, 1.5215912143863453, 1.540178169450183, -1.5584602703189787], [1.5588165018096578, 1.5605782026465265, -1.547562184377139, 1.5489680683305043]]], [[[1.5570039366370194, -1.5600152686245654, 1.5327434733828007, 1.5331578889109807], [-1.5556123173747718, 1.550611193130053, -1.3348250771073642, -1.5606009845295099], [-1.5575836270993995, 1.5356608560533649, -1.559195346750025, -1.5582445417846158]], [[-1.2516463284150974, -1.5592283355033394, -1.5536816391795429, 1.5108425198654833], [1.5544107833647154, -1.5586475628061378, -1.5550454580714337, 1.5579647286965086], [1.4979930117462867, -1.5459996168270638, -1.5223495175888366, -1.5460517655438717]]]]),self.functionspace)
674 ref.setTaggedValue(1,numarray.array([[[[1.541769047752825, -1.4592567339075215, 1.5586830280198429, -1.5280924056594469], [1.5585187106853997, 1.5305548882051436, 1.4911517816513042, -1.5377322682685537], [-1.5347683314855143, 1.5517238541043337, 1.5544760048742774, -1.5412620956961551]], [[-1.539501884061409, -1.5579035610577179, -1.5592454944007521, -1.527113658719671], [-1.5562616921013832, 1.544752894838392, 1.5528889663387913, -1.5594803490192568], [1.5378060847306976, 1.3695107286356141, -1.5344589427920325, 1.5576471391021702]]], [[[1.5551902865231184, 1.5574439559923015, -1.5405715366363946, -1.5399854101404904], [1.5471751118445947, 1.5590328331973433, -1.5518584072127872, 1.5545930587248358], [1.5603635268687615, -1.5541729333474901, 1.5108835156383955, -1.5555689685427048]], [[1.5577550959903859, -1.5494339594471369, -1.5581468900546853, 1.5214543797077005], [1.5483904520035858, -1.5274123226048211, -1.5525249334605411, 1.5463383139491345], [1.5520609537393462, -1.5607628293839917, -0.37288575485185699, 1.5373328409638529]]], [[[1.5277698519717662, -1.5463060966366591, 1.4710432191222749, -1.5566665386668717], [1.5475930473251533, -1.5589882171355174, -1.5569452745436581, 1.552900325927786], [-1.5535944562222297, 1.5421308993211618, 1.4765659635152497, -1.5537733852560058]], [[1.5579309596200162, -1.5178814663571647, -1.5584283990382004, -1.5535898757003221], [1.552140063159527, 1.3948501935545574, -1.5364747794967917, -1.5606350122506203], [1.5493399440355367, -1.5551654135988773, -1.5255939766631132, 1.5487133380455611]]]]))
675 self.failUnless(isinstance(res,Data),"wrong type of result.")
676 self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
677 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
678 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
679 def test_sinh_taggedData_rank0(self):
680 arg=Data(1.99198759591,self.functionspace)
681 arg.setTaggedValue(1,2.30052765476)
682 res=sinh(arg)
683 ref=Data(3.59683227352,self.functionspace)
684 ref.setTaggedValue(1,4.93962040641)
685 self.failUnless(isinstance(res,Data),"wrong type of result.")
686 self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
687 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
688 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
689 def test_sinh_taggedData_rank1(self):
690 arg=Data(numarray.array([3.7121592231366236, -4.5205237974298704]),self.functionspace)
691 arg.setTaggedValue(1,numarray.array([0.30788026299313653, 2.5568342424834434]))
692 res=sinh(arg)
693 ref=Data(numarray.array([20.45884479360328, -45.93641525360411]),self.functionspace)
694 ref.setTaggedValue(1,numarray.array([0.31276737629464152, 6.408690275759203]))
695 self.failUnless(isinstance(res,Data),"wrong type of result.")
696 self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
697 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
698 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
699 def test_sinh_taggedData_rank2(self):
700 arg=Data(numarray.array([[-4.8144899441545528, 0.78267245526398277, -3.9902900754326529, 3.5628490203251033, 2.1183518970045636], [-2.5070220439451694, 2.22072356217594, -2.3873817066715231, -3.8412251092257801, -4.7972608158325922], [-3.1935509834404807, -4.3564582503990001, -2.9952608734330868, 2.2478968274432152, -3.5759483501851563], [-1.3426146737839293, 4.3069146426030791, -4.4619207942108039, -0.17652673360272075, -3.3503263854852361]]),self.functionspace)
701 arg.setTaggedValue(1,numarray.array([[-1.0103477084057824, -1.4588465915190465, 2.8809504601572611, 2.3288760653961047, 2.2303693881343687], [1.0183167542036395, 1.93447626412806, 3.7104269993832428, 4.3335802861769874, 4.3921380450277265], [-1.3774340986519782, 0.92228142402738822, -2.5941241432249171, -3.3237064911008796, 4.6346105466494585], [1.0666499877056488, -0.89076238705677468, 4.5302531678878104, 4.5060336794272828, 2.0384873019197407]]))
702 res=sinh(arg)
703 ref=Data(numarray.array([[-61.637901615656197, 0.86506368613794438, -27.026038642285407, 17.617581367615905, 4.0985943037096586], [-6.093415206821609, 4.5527324006135492, -5.3965433394599067, -23.280520435716621, -60.584890612216782], [-12.166901315420557, -38.983816886070187, -9.9702753219255733, 4.6810906645722357, -17.850249501178922], [-1.7839401011571518, 37.098846158833695, -43.321126637656903, -0.17744497495638895, -14.238482567850086]]),self.functionspace)
704 ref.setTaggedValue(1,numarray.array([[-1.1912317449878338, -2.0342457843344053, 8.8875657756020434, 5.0844955627700941, 4.5979066282350889], [1.2036641503921339, 3.3879593528934069, 20.423393864250595, 38.101777842909016, 40.400321013863852], [-1.8562452941244159, 1.0587053970421214, -6.6550738613616067, -13.863522278520332, 51.489045675912898], [1.2807348782797063, -1.0133220385263433, 46.385634798441771, 45.275432746886217, 3.7743794349039121]]))
705 self.failUnless(isinstance(res,Data),"wrong type of result.")
706 self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
707 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
708 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
709 def test_sinh_taggedData_rank3(self):
710 arg=Data(numarray.array([[[-1.6699752087038435, -0.2455134886023238], [-2.1687245044555992, -1.5692632008931549]], [[4.5726976745572561, -2.7279776977250503], [-2.2847357293147286, 2.6373859093927754]], [[-0.73793065293643068, 0.38302358868877739], [-3.6068322119333249, -2.7337954547102572]], [[-0.45348176104555638, -2.6490340460279951], [-4.3886113896165462, 1.8804425676698937]], [[-2.8375230103816538, 1.111346967580932], [4.1139208151096955, -0.49572589111884202]], [[-2.3299326190666081, -0.62551236912490715], [1.3632704432597551, -2.2917130664840233]]]),self.functionspace)
711 arg.setTaggedValue(1,numarray.array([[[-2.0562165096337282, 0.35936888959956814], [-3.6372329621674284, -2.4786029292995906]], [[0.65206578693234096, 4.2616217865668187], [1.5056871818097299, -4.3212094251499877]], [[4.4704679225004966, -4.3597404599188021], [-0.87623360805733697, -4.4308201122339383]], [[-0.9558721806683721, 0.017485009222809822], [-0.5985209090958632, -3.281153953325652]], [[2.6733102681464143, 0.58838863251234308], [-3.4875728007909155, -2.8625086273204059]], [[-1.538276838516841, -4.4373864115838035], [-3.3984080066326641, -2.2757928405839403]]]))
712 res=sinh(arg)
713 ref=Data(numarray.array([[[-2.5618921853515806, -0.24798739704939532], [-4.3163983334752745, -2.2974547188559029]], [[48.39728795997064, -7.6182796518722613], [-4.8606444823509278, 6.9525358015487786]], [[-0.80675026447437204, 0.39245790554232302], [-18.410999897933262, -7.6631103274115127]], [[-0.4691851238549285, -7.0348268024411853], [-40.258050303704749, 3.2019416421082258]], [[-8.5074259309283864, 1.3546664880209558], [30.584901942778352, -0.51628045436067105]], [[-5.0899733579461612, -0.66710809345606392], [1.8265668432775661, -4.8953877347643511]]]),self.functionspace)
714 ref.setTaggedValue(1,numarray.array([[[-3.8442018204801496, 0.36715416750958968], [-18.98012788845724, -5.9203664863683336]], [[0.69926678187260138, 35.455407944451679], [2.1426925432268189, -37.633167256872468]], [[43.693083396997459, -39.11202224549578], [-0.99274414975503578, -41.99418680140694]], [[-1.1082307083479541, 0.017485900172098688], [-0.63490086709424287, -13.284436370815889]], [[7.2094126025166956, 0.62293131907508703], [-16.337945591940521, -8.7241305581397839]], [[-2.2209042584132921, -42.27091867492458], [-14.941504453786477, -4.816459660325112]]]))
715 self.failUnless(isinstance(res,Data),"wrong type of result.")
716 self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
717 self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
718 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
719 def test_sinh_taggedData_rank4(self):
720 arg=Data(numarray.array([[[[-3.261368733617156, -1.7097421056887061, 2.4770674176220533, 2.6184686144257991], [4.2685570141508649, 0.26471561412312994, 1.8677744659878321, 1.2974082786792565], [-3.1644599226939727, -0.98342184660922349, -1.5818484011953915, 1.7453818193010404]], [[-3.1409423348480905, -1.503135136465966, -4.1317701664086295, -2.6487331291018479], [-2.9344044174187998, -3.9794616897516244, -1.0636935004548986, 2.4681705131671574], [1.7248384820876259, -0.61623840444111444, -3.182398118986538, 1.8412600667009382]]], [[[-1.2967881315097731, -3.2351451577555101, 4.2939167700693446, 4.8638089405008476], [2.9825316536154167, 2.5020908411933496, -4.341334514919474, -4.8611901904936659], [2.5682832345839106, 3.1020556388946119, 4.0616444500999389, 0.58287106482411755]], [[-0.92122010658250453, 3.6178485248091157, 4.1247030396785007, -1.7719429245102813], [-4.2954747345288151, -2.1268789753154813, -2.0943498166080774, -3.5016915119012504], [4.0796282018855194, -0.70150021612442082, 3.9968340640276256, -2.8002455053291451]]], [[[2.7768169172372295, 3.5354672331727777, -4.9833519421308301, -2.7281177342220486], [-3.6388062639788132, -0.24005900416176473, -3.9369129849748861, -2.7620876149297002], [3.7327362822865435, 1.1752019535122198, -4.968172850646587, 0.45185628083386664]], [[0.78465593645643406, -4.8933212754874553, -3.887154034060468, -2.5322616232125039], [-1.0742963974782302, 3.3289574703031288, 1.1899668301054973, -2.9336209382110057], [-2.4653189902719017, 1.4461862760456876, 2.7436930808359143, 4.5571819794183686]]]]),self.functionspace)
721 arg.setTaggedValue(1,numarray.array([[[[2.1332145838014913, 1.2177971547397419, -1.9450668430632225, -3.8915509651360161], [0.34984554597693851, -3.5724187380684516, -0.36417739374160707, -1.4056767503527468], [3.6886009926451795, -2.3524969636932003, -4.5102454679585238, 4.3770785828462468]], [[2.4748540247021777, -3.1040806961176317, 4.3318809570689503, 4.7424354863417442], [4.4482502719559776, -3.5813275761400054, 1.6790719518347696, 3.3826258086123921], [0.41668209832613634, 3.5649415125773416, 1.6284709294696516, 0.46697670447318185]]], [[[2.4215260841968869, 4.4326478509045142, -4.4189346955673434, -3.159517367887986], [0.77984444249549512, 0.52106214096843129, 2.2959783381073375, 2.8620825221995148], [-0.83928142017985685, 2.3961087684562008, -1.5912632794131518, -2.6327788717179725]], [[3.9275031010752279, 0.31923128079452301, -2.2762341712323044, 2.3868873445961158], [4.1180987252889008, 0.58883415948539231, -3.5287883781020488, 2.7441939267749778], [4.0184160311880355, -4.6753857407642982, -0.90603684893730918, 1.3999807565920435]]], [[[3.9197722873955865, 0.8568499678692918, 3.7086105728287162, -0.21167328998860668], [-1.8846910022439625, 4.0109184386500658, -3.7641561030274531, -0.47027664746013542], [-1.5388852245439333, 2.3534855378811139, 4.2231499372068146, -3.2804922592029619]], [[-0.05624724006019477, -2.8226259374957232, 2.7214574181168203, -1.3648584776772541], [1.458452045981061, 4.3818228672288857, -1.779611092507988, -4.0543356587838], [-1.3735137487486937, 4.7330680902546227, 2.3550068942781071, -3.9075745779532935]]]]))
722 res=sinh(arg)
723 ref=Data(numarray.array([[[[-13.023440270699259, -2.6733116654343072, 5.9111539019062862, 6.8208952782641425], [35.7022516817728, 0.26781809379022642, 3.1597027400448123, 1.6932800751791159], [-11.816858393542429, -1.1497800913986027, -2.329171645463961, 2.7767549168418548]], [[-11.541203334322933, -2.1366650567825722, -31.136015622546896, -7.0326889417647314], [-9.3785671704044926, -26.734768755711737, -1.2759364890266949, 5.858048933103599], [2.7167063739913448, -0.65598843191103351, -12.031501841254393, 3.072929944227814]]], [[[-1.6920608694436352, -12.685352743257289, 36.619585226109336, 64.754431865133057], [9.8435290579275119, 6.0630393584281839, -38.398477943694964, -64.585057821227878], [6.4833728384402045, 11.099336246706669, 29.026252346926242, 0.61644023180207441]], [[-1.0571603791351021, 18.615241481692724, 30.916635699137355, -2.856134354291088], [-36.67670297233353, -4.1347179890900154, -3.998504686318193, -16.570684097163284], [29.553285005086391, -0.7604675809797572, 27.20359770161199, -8.1939446899377977]]], [[[8.0027790235537211, 17.140948545266145, -72.977985228256998, -7.6193557153388518], [-19.010054278242894, -0.24237135670329799, -25.620303855164558, -7.8848508059247102], [20.884691434092481, 1.4650201726547696, -71.878506579845961, 0.46739024222723913]], [[0.86768804011917233, -66.69419356195327, -24.375691040284792, -6.2512252509030963], [-1.2931970487315634, 13.936699944900679, 1.4913704109166104, -9.3711804841265494], [-5.841126728603502, 2.0057102769093333, 7.7399766017332157, 47.652005601622172]]]]),self.functionspace)
724 ref.setTaggedValue(1,numarray.array([[[[4.161752367783798, 1.541926632612777, -3.4255608402399025, -24.483195400361897], [0.3570257223960186, -17.787257314136472, -0.37228079161732119, -1.9165423642645187], [19.981928064707756, -5.2083266003894222, -45.466571941208194, 39.796285782641952]], [[5.8978987635397626, -11.121926851445268, 38.037063069187369, 57.352263445220188], [42.732776058437857, -17.946679307528704, 2.5870158831439984, 14.707018154821265], [0.42884487385080838, 17.654543955312313, 2.4499235521097709, 0.48413477435416613]]], [[[5.5871242630376541, 42.071033145542899, -41.497881296562845, -11.758388262639029], [0.86132781108094103, 0.54496286536137339, 4.9167436772901087, 8.7203896119493791