Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mischa Dombrowski
lbmweights
Commits
c6566fe4
Commit
c6566fe4
authored
Sep 08, 2019
by
MischaD
Browse files
Integer Velocities
parent
c94e09fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
cli.py
View file @
c6566fe4
...
...
@@ -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
())
...
...
lbmweights/lattice.py
View file @
c6566fe4
...
...
@@ -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
:
...
...
lbmweights/shell.py
View file @
c6566fe4
...
...
@@ -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
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment