4 |
import unittest |
import unittest |
5 |
import os |
import os |
6 |
|
|
7 |
from esys.escript import * |
from escript.escript import * |
8 |
from esys import finley |
from finley import finley |
9 |
|
|
10 |
import numarray |
import numarray |
11 |
|
|
12 |
class escriptTestCase(unittest.TestCase): |
class escriptTestCase(unittest.TestCase): |
13 |
|
|
14 |
def testPow(self): |
def testPow(self): |
15 |
"""Test the pow function.""" |
"""Test the pow function.""" |
16 |
myFuncSpac=escript.FunctionSpace() |
myFuncSpac=escript.FunctionSpace() |
17 |
myVector=numarray.array([[1,2],[3,4]]) |
myVector=numarray.array([[1,2],[3,4]]) |
18 |
myData=escript.Data(myVector,myFuncSpac,True) |
myData=escript.Data(myVector,myFuncSpac,True) |
19 |
print myData**3 |
print myData**3 |
20 |
|
|
21 |
def testFunctionSpace(self): |
def testFunctionSpace(self): |
22 |
"""Test the creation of FunctionSpace objects.""" |
"""Test the creation of FunctionSpace objects.""" |
23 |
print |
mesh=finley.Brick(1,1,1,1,1.,1.,1.,1,1,1,1,1) |
24 |
mesh=finley.Brick(1,1,1,1,1.,1.,1.,1,1,1,1,1) |
cFunc=escript.ContinuousFunction(mesh) |
25 |
cFunc=escript.ContinuousFunction(mesh) |
|
26 |
def testDataOperations(self): |
def testDataOperations(self): |
27 |
"""Test the operations that may be performed on Data.""" |
"""Test the operations that may be performed on Data.""" |
28 |
myFuncSpac=escript.FunctionSpace() |
myFuncSpac=escript.FunctionSpace() |
67 |
suite.addTest(unittest.makeSuite(escriptTestCase)) |
suite.addTest(unittest.makeSuite(escriptTestCase)) |
68 |
unittest.TextTestRunner(verbosity=2).run(suite) |
unittest.TextTestRunner(verbosity=2).run(suite) |
69 |
|
|
70 |
|
sys.exit(0) |
|
|
|
|
|
|