1 |
import sys |
2 |
import unittest |
3 |
import os |
4 |
|
5 |
from esys.escript import * |
6 |
from esys import finley |
7 |
|
8 |
class MeshTestCase(unittest.TestCase): |
9 |
|
10 |
def testMeshIO(self): |
11 |
"""Test reading and writing finley meshes.""" |
12 |
print |
13 |
mesh=finley.Brick(1,1,1,1,1.,1.,1.,1,1,1,1,1) |
14 |
fileName='Junk.msh' |
15 |
mesh.write(fileName) |
16 |
mesh2=finley.ReadMesh(fileName) |
17 |
|
18 |
def testNonExistantMeshRead(self): |
19 |
"""Test exception generated for attempt to read non existant file.""" |
20 |
print |
21 |
try: |
22 |
mesh2=finley.ReadMesh("NonExistantFilename.msh") |
23 |
self.failIf(False,'Failed non existant mesh file exception test.') |
24 |
except Exception, e: |
25 |
print e |
26 |
|
27 |
def testSystemMatrix(self): |
28 |
"""Test System Matrix.""" |
29 |
print |
30 |
mesh=finley.Brick() |
31 |
systemMatrix=finley.MeshAdapter(mesh) |
32 |
|
33 |
suite=unittest.TestSuite() |
34 |
suite.addTest(unittest.makeSuite(MeshTestCase)) |
35 |
unittest.TextTestRunner(verbosity=2).run(suite) |