1 |
|
2 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
3 |
http://www.access.edu.au |
4 |
Primary Business: Queensland, Australia""" |
5 |
__license__="""Licensed under the Open Software License version 3.0 |
6 |
http://www.opensource.org/licenses/osl-3.0.php""" |
7 |
|
8 |
|
9 |
import sys |
10 |
import unittest |
11 |
import os |
12 |
|
13 |
from esys.escript import * |
14 |
from esys import finley |
15 |
|
16 |
class MeshTestCase(unittest.TestCase): |
17 |
|
18 |
def testMeshIO(self): |
19 |
"""Test reading and writing finley meshes.""" |
20 |
print |
21 |
mesh=finley.Brick(1,1,1,1,1.,1.,1.,1,1,1,1,1) |
22 |
fileName='Junk.msh' |
23 |
mesh.write(fileName) |
24 |
mesh2=finley.ReadMesh(fileName) |
25 |
|
26 |
def testNonExistantMeshRead(self): |
27 |
"""Test exception generated for attempt to read non existant file.""" |
28 |
print |
29 |
try: |
30 |
mesh2=finley.ReadMesh("NonExistantFilename.msh") |
31 |
self.failIf(False,'Failed non existant mesh file exception test.') |
32 |
except Exception, e: |
33 |
print e |
34 |
|
35 |
def testSystemMatrix(self): |
36 |
"""Test System Matrix.""" |
37 |
print |
38 |
mesh=finley.Brick() |
39 |
systemMatrix=finley.MeshAdapter(mesh) |
40 |
|
41 |
suite=unittest.TestSuite() |
42 |
suite.addTest(unittest.makeSuite(MeshTestCase)) |
43 |
unittest.TextTestRunner(verbosity=2).run(suite) |