From 879a71cc07c40a52617a29bfef0744cb43a2f1f2 Mon Sep 17 00:00:00 2001
From: Anna Wellmann <a.wellmann@tu-bs.de>
Date: Wed, 6 Jul 2022 11:35:27 +0000
Subject: [PATCH] Change the order of the distributions (D3Q27)

https://git.rz.tu-bs.de/irmb/VirtualFluids_dev/-/issues/14

Cherry-Picked from 25b77799ae954ba1512106b12dd296d70a67851a
---
 .../GridGenerator/grid/distributions/D3Q27.h  | 24 +++++---
 src/gpu/VirtualFluids_GPU/LBM/D3Q27.h         | 61 +++++++++----------
 2 files changed, 44 insertions(+), 41 deletions(-)

diff --git a/src/gpu/GridGenerator/grid/distributions/D3Q27.h b/src/gpu/GridGenerator/grid/distributions/D3Q27.h
index 680fa8830..df29fd7e2 100644
--- a/src/gpu/GridGenerator/grid/distributions/D3Q27.h
+++ b/src/gpu/GridGenerator/grid/distributions/D3Q27.h
@@ -52,22 +52,23 @@
 #define DIR_27_BS   15
 #define DIR_27_BN   16
 #define DIR_27_TS   17
-#define DIR_27_ZERO 18
 
-#define DIR_27_TNE  19
-#define DIR_27_BNE  20
-#define DIR_27_TSE  21
-#define DIR_27_BSE  22
+#define DIR_27_TNE   18
+#define DIR_27_TNW   19
+#define DIR_27_TSE   20
+#define DIR_27_TSW   21
+#define DIR_27_BNE   22
+#define DIR_27_BNW   23
+#define DIR_27_BSE   24
+#define DIR_27_BSW   25
 
-#define DIR_27_TNW  23
-#define DIR_27_BNW  24
-#define DIR_27_TSW  25
-#define DIR_27_BSW  26
+#define DIR_27_ZERO  26
 
 #define DIR_27_START  0
 #define DIR_27_END   26
 
 
+
 #define DIR_27_E_X  1
 #define DIR_27_E_Y  0
 #define DIR_27_E_Z  0
@@ -159,7 +160,6 @@
 #define DIR_27_BSE_Y  -1
 #define DIR_27_BSE_Z  -1
 
-
 #define DIR_27_TNW_X  -1
 #define DIR_27_TNW_Y  1
 #define DIR_27_TNW_Z  1
@@ -176,4 +176,8 @@
 #define DIR_27_BSW_Y  -1
 #define DIR_27_BSW_Z  -1
 
+#define DIR_27_ZERO_X  0
+#define DIR_27_ZERO_Y  0
+#define DIR_27_ZERO_Z  0
+
 #endif
diff --git a/src/gpu/VirtualFluids_GPU/LBM/D3Q27.h b/src/gpu/VirtualFluids_GPU/LBM/D3Q27.h
index ac0f4b2ae..dd2e73680 100644
--- a/src/gpu/VirtualFluids_GPU/LBM/D3Q27.h
+++ b/src/gpu/VirtualFluids_GPU/LBM/D3Q27.h
@@ -33,40 +33,39 @@
 #ifndef _LB_D3Q27_H_
 #define _LB_D3Q27_H_
 
-//! \brief definitions of the 27 speeds (D3Q27)
-#define dirE    0
-#define dirW    1
-#define dirN    2
-#define dirS    3
-#define dirT    4
-#define dirB    5
-#define dirNE   6
-#define dirSW   7
-#define dirSE   8
-#define dirNW   9
-#define dirTE   10
-#define dirBW   11
-#define dirBE   12
-#define dirTW   13
-#define dirTN   14
-#define dirBS   15
-#define dirBN   16
-#define dirTS   17
-#define dirREST 18
+#define dirSTART  0
+#define dirEND   26
 
-#define dirTNE  19
-#define dirBNE  20
-#define dirTSE  21
-#define dirBSE  22
+#define dirE    /*f1 */  0
+#define dirW    /*f2 */  1
+#define dirN    /*f3 */  2
+#define dirS    /*f4 */  3
+#define dirT    /*f5 */  4
+#define dirB    /*f6 */  5
+#define dirNE   /*f7 */  6
+#define dirSW   /*f8 */  7
+#define dirSE   /*f9 */  8
+#define dirNW   /*f10*/  9
+#define dirTE   /*f11*/  10
+#define dirBW   /*f12*/  11
+#define dirBE   /*f13*/  12
+#define dirTW   /*f14*/  13
+#define dirTN   /*f15*/  14
+#define dirBS   /*f16*/  15
+#define dirBN   /*f17*/  16
+#define dirTS   /*f18*/  17
 
-#define dirTNW  23
-#define dirBNW  24
-#define dirTSW  25
-#define dirBSW  26
+#define dirTNE    /*f */  18
+#define dirTNW    /*f */  19
+#define dirTSE    /*f */  20
+#define dirTSW    /*f */  21
+#define dirBNE    /*f */  22
+#define dirBNW    /*f */  23
+#define dirBSE    /*f */  24
+#define dirBSW    /*f */  25
 
-//! \brief definitions of start and end value (useful for loops)
-#define dirSTART  0
-#define dirEND   26
+#define dirZERO /*f0 */  26
+#define dirREST /*f0 */  26
 
 #endif
 
-- 
GitLab