diff --git a/cli.py b/cli.py index 63e6be1c13dac091b013f90c4147a95af03a053f..10243eb30b76bd6625f29510e031d27e76d7491f 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 b80a5d2d21ee0970005d33d6b96a6d3d66dca71d..ef4cc96867dc427a38e28d6b7f9db4bbba77c67e 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: