Commit 903c2b98 authored by MischaD's avatar MischaD
Browse files

Updated TestCases

parent 89051627
......@@ -18,9 +18,7 @@ def lbmweights(dimension, order, shells, seed):
shell_list = [int(x) for x in re.findall(u"\d+", shells)]
l = Lattice(dimension=dimension, order=order, shell_list=shell_list, seed=seed)
weights = l.calculate_weights()
import sympy as sp
print(weights)
# TODO sp.N(weights[0]) etc
if __name__ == "__main__":
main()
......
......@@ -12,6 +12,9 @@ class TestQ9(unittest.TestCase):
def testOutput(self):
weights = self.lattice.calculate_weights()
self.assertEqual(len(weights), 4)
interval = self.lattice._interval
self.assertAlmostEqual(sp.N(interval.inf), 1/3, places=6)
self.assertAlmostEqual(sp.N(interval.sup), 2/3, places=6)
class TestV17(unittest.TestCase):
......@@ -19,9 +22,13 @@ class TestV17(unittest.TestCase):
self.seed = 44
self.lattice = Lattice(dimension=2, order=6, shell_list=[1,2,4,8,9], seed=self.seed)
def testOutput(self):
weights = self.lattice.calculate_weights()
self.assertEqual(len(weights), 6)
interval = self.lattice._interval
self.assertAlmostEqual(sp.N(interval.inf), 0.3702519, places=6)
self.assertAlmostEqual(sp.N(interval.sup), 1.148412, places=6)
class Test3D(unittest.TestCase):
......@@ -32,6 +39,9 @@ class Test3D(unittest.TestCase):
def testOutput(self):
weights = self.lattice.calculate_weights()
self.assertEqual(len(weights), 7)
interval = self.lattice._interval
self.assertAlmostEqual(sp.N(interval.inf), 0.3510760, places=6)
self.assertAlmostEqual(sp.N(interval.sup), 4/9, places=6)
class TestV37(unittest.TestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment