40 |
|
|
41 |
def testAlina1(self): |
def testAlina1(self): |
42 |
P1 = 10.0 |
P1 = 10.0 |
43 |
assert log(P1) == math.log10(10.0) |
assert log10(P1) == math.log10(10.0) |
44 |
assert ln(P1) == math.log(10.0,math.e) |
assert log(P1) == math.log(10.0,math.e) |
45 |
|
|
46 |
def testAlina2(self): |
def testAlina2(self): |
47 |
P = 10.0*Scalar(1.0, ContinuousFunction(self.msh)) |
P = 10.0*Scalar(1.0, ContinuousFunction(self.msh)) |
48 |
assert log(P).convertToNumArray()[0] == math.log10(10.0) |
assert log10(P).convertToNumArray()[0] == math.log10(10.0) |
49 |
assert ln(P).convertToNumArray()[0] == math.log(10.0,math.e) |
assert log(P).convertToNumArray()[0] == math.log(10.0,math.e) |
50 |
|
|
51 |
def testLog(self): |
def testLog(self): |
52 |
for wh in [ContinuousFunction(self.msh),Function(self.msh)]: |
for wh in [ContinuousFunction(self.msh),Function(self.msh)]: |
55 |
#print "\n", ex, a, "==>" |
#print "\n", ex, a, "==>" |
56 |
arg=self.prepareArg(a,ex,wh) |
arg=self.prepareArg(a,ex,wh) |
57 |
#print "\nlog" |
#print "\nlog" |
58 |
result = arg.log() |
result = arg._log10() |
59 |
|
|
60 |
def testLn(self): |
def testLn(self): |
61 |
for wh in [ContinuousFunction(self.msh),Function(self.msh)]: |
for wh in [ContinuousFunction(self.msh),Function(self.msh)]: |
64 |
#print "\n", ex, a, "==>" |
#print "\n", ex, a, "==>" |
65 |
arg=self.prepareArg(a,ex,wh) |
arg=self.prepareArg(a,ex,wh) |
66 |
#print "\nln" |
#print "\nln" |
67 |
result = arg.ln() |
result = arg._log() |
68 |
|
|
69 |
if __name__ == '__main__': |
if __name__ == '__main__': |
70 |
suite=unittest.TestSuite() |
suite=unittest.TestSuite() |