1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | import unittest |
---|
4 | from math import sqrt, pi |
---|
5 | |
---|
6 | |
---|
7 | from quantity import * |
---|
8 | from config import epsilon |
---|
9 | from Numeric import allclose, array, ones, Float |
---|
10 | |
---|
11 | |
---|
12 | class TestCase(unittest.TestCase): |
---|
13 | def setUp(self): |
---|
14 | pass |
---|
15 | |
---|
16 | def tearDown(self): |
---|
17 | pass |
---|
18 | |
---|
19 | def test_getting_some_vertex_values(self): |
---|
20 | """ |
---|
21 | set values based on triangle lists. |
---|
22 | """ |
---|
23 | from mesh_factory import rectangular |
---|
24 | from shallow_water import Domain |
---|
25 | from Numeric import zeros, Float |
---|
26 | |
---|
27 | #Create basic mesh |
---|
28 | points, vertices, boundary = rectangular(1, 3) |
---|
29 | domain = Domain(points, vertices, boundary) |
---|
30 | quantity = Quantity(domain,[[1,1,1],[2,2,2],[3,3,3], |
---|
31 | [4,4,4],[5,5,5],[6,6,6]]) |
---|
32 | value = [7] |
---|
33 | indexes = [1] |
---|
34 | assert domain.get_vertices() == domain.triangles |
---|
35 | assert domain.get_vertices([0,4]) == [domain.triangles[0], |
---|
36 | domain.triangles[4]] |
---|
37 | |
---|
38 | #------------------------------------------------------------- |
---|
39 | if __name__ == "__main__": |
---|
40 | suite = unittest.makeSuite(TestCase,'test') |
---|
41 | runner = unittest.TextTestRunner() |
---|
42 | runner.run(suite) |
---|
43 | |
---|
44 | |
---|