source: anuga_core/source/anuga/pyvolution/test_ghost.py @ 3512

Last change on this file since 3512 was 2813, checked in by steve, 19 years ago

Moving ghosts into domain.py

File size: 1.2 KB
Line 
1#!/usr/bin/env python
2
3import unittest
4from math import sqrt
5
6from domain import *
7from config import epsilon
8from Numeric import allclose, array, ones, Float
9
10
11
12
13class Test_Domain(unittest.TestCase):
14    def setUp(self):
15        pass
16
17
18    def tearDown(self):
19        pass
20
21
22    def test_simple(self):
23        a = [0.0, 0.0]
24        b = [0.0, 2.0]
25        c = [2.0,0.0]
26        d = [0.0, 4.0]
27        e = [2.0, 2.0]
28        f = [4.0,0.0]
29
30        points = [a, b, c, d, e, f]
31        #bac, bce, ecf, dbe, daf, dae
32        vertices = [ [1,0,2], [1,2,4], [4,2,5], [3,1,4]]
33
34        conserved_quantities = ['stage', 'xmomentum', 'ymomentum']
35        other_quantities = ['elevation', 'friction']
36
37        domain = Domain(points, vertices, None,
38                        conserved_quantities, other_quantities)
39        domain.check_integrity()
40
41        for name in conserved_quantities + other_quantities:
42            assert domain.quantities.has_key(name)
43
44
45        assert domain.get_conserved_quantities(0, edge=1) == 0.
46
47
48
49
50#-------------------------------------------------------------
51if __name__ == "__main__":
52    suite = unittest.makeSuite(Test_Domain,'test')
53    runner = unittest.TextTestRunner()
54    runner.run(suite)
Note: See TracBrowser for help on using the repository browser.