source: anuga_core/source/anuga/abstract_2d_finite_volumes/test_ghost.py @ 5897

Last change on this file since 5897 was 5897, checked in by ole, 15 years ago

Reverted numpy changes to the trunk that should have been made to the branch.
The command was svn merge -r 5895:5890 .

File size: 1.3 KB
Line 
1#!/usr/bin/env python
2
3import unittest
4from math import sqrt
5
6from domain import *
7from anuga.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.