Last change
on this file since 2197 was
2115,
checked in by jack, 19 years ago
|
Moved test_metis.py to pymetis.
Minor Makefile and documentation corrections.
|
File size:
1.3 KB
|
Line | |
---|
1 | from os import sep |
---|
2 | from sys import path |
---|
3 | |
---|
4 | from Numeric import array |
---|
5 | |
---|
6 | import unittest |
---|
7 | |
---|
8 | path.append('..' + sep + 'pymetis') |
---|
9 | |
---|
10 | import metis |
---|
11 | |
---|
12 | class TestMetis(unittest.TestCase): |
---|
13 | def setUp(self): |
---|
14 | pass |
---|
15 | |
---|
16 | def testHexmesh(self): |
---|
17 | # Hexagonal mesh |
---|
18 | # |
---|
19 | # 1---2 |
---|
20 | # / \ / \ |
---|
21 | # 6---0---3 |
---|
22 | # \ / \ / |
---|
23 | # 5---4 |
---|
24 | # |
---|
25 | # Divided 3 ways |
---|
26 | # Calling order is: elements, verticies, edge list |
---|
27 | # element type, number parts |
---|
28 | edgecut, epart, npart = metis.partMeshNodal(6, 7,\ |
---|
29 | [0, 1, 2,\ |
---|
30 | 0, 2, 3,\ |
---|
31 | 0, 3, 4,\ |
---|
32 | 0, 4, 5,\ |
---|
33 | 0, 5, 6,\ |
---|
34 | 0, 6, 1],\ |
---|
35 | 1,\ |
---|
36 | 3,) |
---|
37 | #print edgecut |
---|
38 | #print epart |
---|
39 | #print npart |
---|
40 | self.assert_(edgecut == 5) |
---|
41 | self.assert_(epart == array([2, 2, 0, 0, 0, 0], 'i')) |
---|
42 | self.assert_(npart == array([0, 2, 2, 2, 0, 0, 0], 'i')) |
---|
43 | |
---|
44 | if __name__ == '__main__': |
---|
45 | unittest.main() |
---|
46 | |
---|
Note: See
TracBrowser
for help on using the repository browser.