source: branches/Numeric_anuga_source/anuga/abstract_2d_finite_volumes/test_ghost.py @ 7258

Last change on this file since 7258 was 6195, checked in by ole, 16 years ago

Reinstated test for subclassing of Domain in quantity.
All tests pass.

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