From 7d8041169ec2c231f3e305b0b32b83d20a04863e Mon Sep 17 00:00:00 2001
From: MischaD <mischa.dombrowski@gmail.com>
Date: Tue, 10 Sep 2019 19:42:06 +0200
Subject: [PATCH] c_s_sq property

---
 cli.py                | 5 ++---
 lbmweights/lattice.py | 6 ++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/cli.py b/cli.py
index 63e6be1..10243eb 100644
--- a/cli.py
+++ b/cli.py
@@ -30,14 +30,13 @@ def benchmark(x=10):
 )
 @click.option("--seed", type=int, help="Random number to be used as seed")
 def lbmweights(dimension, order, shells, seed):
-
     #shell_list = [int(x) for x in re.findall(u"\d+", shells)]
     #lattice = Lattice(
     #    dimension=dimension, order=order, shell_list=shell_list, seed=seed
     #)
+
     lattice = Lattice.from_name("D2Q9")
-    # benchmark(10)
-    print(lattice.velocity_set())
+
 
 
 if __name__ == "__main__":
diff --git a/lbmweights/lattice.py b/lbmweights/lattice.py
index b80a5d2..ef4cc96 100644
--- a/lbmweights/lattice.py
+++ b/lbmweights/lattice.py
@@ -176,6 +176,12 @@ class Lattice:
             return self._weights
         return self.calculate_weights()
 
+    @property
+    def c_s_sq(self):
+        if self._c_s_sq:
+            return self._c_s_sq
+        return self.velocity_set()[0]
+
     def shell_from_type(self, type):
         for shell in self._shells:
             if shell.type == type:
-- 
GitLab