Commit c6566fe4 authored by MischaD's avatar MischaD
Browse files

Integer Velocities

parent c94e09fe
......@@ -31,11 +31,11 @@ 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
)
#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())
......
......@@ -444,7 +444,7 @@ class Lattice:
if shell.weight == 0:
continue
weights += [shell.weight] * shell.size
velocities = np.zeros((self._dimension, len(weights)))
velocities = np.zeros((self._dimension, len(weights)), dtype=np.int32)
i = 0
for shell in self.shells:
if shell.weight == 0:
......
......@@ -11,7 +11,7 @@ class Shell:
[str(int(x)) for x in sorted(abs(velocities[0]), reverse=True)]
)
self.size = len(velocities)
self.velocities = velocities
self.velocities = [vel.astype(int) for vel in velocities]
def __repr__(self):
repr_string = "Shell: {} - Type: {} - Amount of velocities: {}".format(
......
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