aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-07-02 21:14:14 +0200
committerAdrian Kummerlaender2019-07-02 21:14:14 +0200
commit2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4 (patch)
treedd619c6a592a8caa0640296e45a107fd90ff3b94
parent55fb5b62ab3381327d4b04cf1c5ab095874d29cc (diff)
downloadsymlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.tar
symlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.tar.gz
symlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.tar.bz2
symlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.tar.lz
symlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.tar.xz
symlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.tar.zst
symlbm_playground-2f4794a0ddc0ff472ad3f0be20d7a15de72cfae4.zip
Determine discrete velocities of D2Q9 and D3Q27
-rw-r--r--symbolic/D2Q9.py7
-rw-r--r--symbolic/D3Q19.py4
-rw-r--r--symbolic/D3Q27.py11
3 files changed, 10 insertions, 12 deletions
diff --git a/symbolic/D2Q9.py b/symbolic/D2Q9.py
index 9693477..e3ac9de 100644
--- a/symbolic/D2Q9.py
+++ b/symbolic/D2Q9.py
@@ -1,6 +1,7 @@
-from sympy import *
+from sympy import Matrix
+from itertools import product
-q = 9
d = 2
+q = 9
-c = [ Matrix(x) for x in [(-1, 1), ( 0, 1), ( 1, 1), (-1, 0), ( 0, 0), ( 1, 0), (-1,-1), ( 0, -1), ( 1, -1)] ]
+c = [ Matrix(x) for x in product([-1,0,1], repeat=d) ]
diff --git a/symbolic/D3Q19.py b/symbolic/D3Q19.py
index 4e84908..e9e6eec 100644
--- a/symbolic/D3Q19.py
+++ b/symbolic/D3Q19.py
@@ -1,7 +1,7 @@
-from sympy import *
+from sympy import Matrix, Rational, sqrt
-q = 19
d = 3
+q = 19
c = [ Matrix(x) for x in [
( 0, 1, 1), (-1, 0, 1), ( 0, 0, 1), ( 1, 0, 1), ( 0, -1, 1),
diff --git a/symbolic/D3Q27.py b/symbolic/D3Q27.py
index d63aad8..6fb1f80 100644
--- a/symbolic/D3Q27.py
+++ b/symbolic/D3Q27.py
@@ -1,10 +1,7 @@
-from sympy import *
+from sympy import Matrix
+from itertools import product
-q = 27
d = 3
+q = 27
-c = [ Matrix(x) for x in [
- (-1, 1, 1), ( 0, 1, 1), ( 1, 1, 1), (-1, 0, 1), ( 0, 0, 1), ( 1, 0, 1), (-1,-1, 1), ( 0, -1, 1), ( 1, -1, 1),
- (-1, 1, 0), ( 0, 1, 0), ( 1, 1, 0), (-1, 0, 0), ( 0, 0, 0), ( 1, 0, 0), (-1,-1, 0), ( 0, -1, 0), ( 1, -1, 0),
- (-1, 1,-1), ( 0, 1,-1), ( 1, 1,-1), (-1, 0,-1), ( 0, 0,-1), ( 1, 0,-1), (-1,-1,-1), ( 0, -1,-1), ( 1, -1,-1)
-]]
+c = [ Matrix(x) for x in product([-1,0,1], repeat=d) ]