summaryrefslogtreecommitdiff
path: root/tangle/LLBM/kernel/collect_shear_layer_normal.h
blob: 13e839a996cfd8c5dffaa4206d669805c50f11b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#pragma once
#include <LLBM/call_tag.h>

struct CollectShearLayerNormalsF {

using call_tag = tag::call_by_cell_id;

template <typename T, typename S>
__device__ static void apply(
    descriptor::D3Q19
  , S f_curr[19]
  , std::size_t gid
  , T* cell_rho 
  , T* cell_u
  , T* cell_shear_normal
) {
  T x0 = f_curr[10] + f_curr[13] + f_curr[17];
  T x1 = f_curr[14] + f_curr[5] + f_curr[6];
  T x2 = f_curr[1] + f_curr[2] + f_curr[4];
  T x3 = x0 + x1 + x2 + f_curr[0] + f_curr[11] + f_curr[12] + f_curr[15] + f_curr[16] + f_curr[18] + f_curr[3] + f_curr[7] + f_curr[8] + f_curr[9];
  T x4 = -f_curr[11] + f_curr[7];
  T x5 = -f_curr[15] + f_curr[3];
  T x6 = T{1} / (x3);
  T x7 = f_curr[0] - f_curr[18];
  T x13 = T{72.0000000000000}*f_curr[5];
  T x14 = T{72.0000000000000}*f_curr[13];
  T x37 = T{72.0000000000000}*f_curr[1];
  T x38 = T{72.0000000000000}*f_curr[17];
  T x58 = T{72.0000000000000}*f_curr[4];
  T x59 = T{72.0000000000000}*f_curr[14];
  T rho = x3;
  T x53 = T{2.00000000000000}*rho;
  T u_0 = x6*(x0 + x4 + x5 - f_curr[1] - f_curr[5] - f_curr[8]);
  T x8 = u_0*u_0;
  T x15 = -u_0;
  T x17 = -T{3.00000000000000}*x8;
  T x20 = T{6.00000000000000}*u_0;
  T x21 = -x20;
  T u_1 = x6*(x1 + x4 + x7 - f_curr[12] - f_curr[13] - f_curr[4]);
  T x9 = u_1*u_1;
  T x16 = x15 + u_1;
  T x18 = T{6.00000000000000}*u_1;
  T x19 = x17 + x18;
  T x22 = -T{3.00000000000000}*x9;
  T x27 = -u_1;
  T x28 = x27 + u_0;
  T x29 = x17 - x18;
  T x32 = u_0 + u_1;
  T x33 = T{9.00000000000000}*(x32*x32);
  T u_2 = x6*(x2 + x5 + x7 - f_curr[14] - f_curr[16] - f_curr[17]);
  T x10 = u_2*u_2;
  T x11 = x10 + x8 + x9;
  T x12 = pow(x11, T{-0.500000000000000});
  T x23 = T{2.00000000000000} - T{3.00000000000000}*x10;
  T x24 = x22 + x23;
  T x25 = x21 + x24;
  T x26 = rho*(x19 + x25 + T{9.00000000000000}*(x16*x16));
  T x30 = x20 + x24;
  T x31 = rho*(x29 + x30 + T{9.00000000000000}*(x28*x28));
  T x34 = rho*(x19 + x30 + x33) + rho*(x25 + x29 + x33) - T{72.0000000000000}*f_curr[11] - T{72.0000000000000}*f_curr[7];
  T x35 = x13 + x14 - x26 - x31 + x34;
  T x36 = x12*x35;
  T x39 = x15 + u_2;
  T x40 = T{6.00000000000000}*u_2;
  T x41 = x17 + x40;
  T x42 = rho*(x25 + x41 + T{9.00000000000000}*(x39*x39));
  T x43 = -u_2;
  T x44 = x43 + u_0;
  T x45 = -x40;
  T x46 = x17 + x45;
  T x47 = rho*(x30 + x46 + T{9.00000000000000}*(x44*x44));
  T x48 = u_0 + u_2;
  T x49 = T{9.00000000000000}*(x48*x48);
  T x50 = rho*(x25 + x46 + x49) + rho*(x30 + x41 + x49) - T{72.0000000000000}*f_curr[15] - T{72.0000000000000}*f_curr[3];
  T x51 = x37 + x38 - x42 - x47 + x50;
  T x52 = x12*x51;
  T x54 = x24 + T{6.00000000000000}*x8;
  T x55 = -x13 - x14 + x26 + x31 + x34;
  T x56 = -x37 - x38 + x42 + x47 + x50;
  T x57 = x53*(x20 + x54) + x53*(x21 + x54) + x55 + x56 - T{72.0000000000000}*f_curr[10] - T{72.0000000000000}*f_curr[8];
  T x60 = x27 + u_2;
  T x61 = x24 + x29;
  T x62 = rho*(x40 + x61 + T{9.00000000000000}*(x60*x60));
  T x63 = x43 + u_1;
  T x64 = x19 + x24;
  T x65 = rho*(x45 + x64 + T{9.00000000000000}*(x63*x63));
  T x66 = u_1 + u_2;
  T x67 = T{9.00000000000000}*(x66*x66);
  T x68 = rho*(x40 + x64 + x67) + rho*(x45 + x61 + x67) - T{72.0000000000000}*f_curr[0] - T{72.0000000000000}*f_curr[18];
  T x69 = x58 + x59 - x62 - x65 + x68;
  T x70 = x23 + T{6.00000000000000}*x9;
  T x71 = -x58 - x59 + x62 + x65 + x68;
  T x72 = x53*(x19 + x70) + x53*(x29 + x70) + x55 + x71 - T{72.0000000000000}*f_curr[12] - T{72.0000000000000}*f_curr[6];
  T x73 = T{6.00000000000000}*x10 + x22 + T{2.00000000000000};
  T x74 = x53*(x41 + x73) + x53*(x46 + x73) + x56 + x71 - T{72.0000000000000}*f_curr[16] - T{72.0000000000000}*f_curr[2];
  T x75 = ((x35*u_0 + x69*u_2 + x72*u_1)*u_1 + (x35*u_1 + x51*u_2 + x57*u_0)*u_0 + (x51*u_0 + x69*u_1 + x74*u_2)*u_2)/x11;
  T x76 = x12*x69;
  T n_0 = -T{0.0277777777777778}*x12*x57*u_0 - T{0.0277777777777778}*x36*u_1 - T{0.0277777777777778}*x52*u_2 + T{0.0277777777777778}*x75*u_0;
  T n_1 = -T{0.0277777777777778}*x12*x72*u_1 - T{0.0277777777777778}*x36*u_0 + T{0.0277777777777778}*x75*u_1 - T{0.0277777777777778}*x76*u_2;
  T n_2 = -T{0.0277777777777778}*x12*x74*u_2 - T{0.0277777777777778}*x52*u_0 + T{0.0277777777777778}*x75*u_2 - T{0.0277777777777778}*x76*u_1;

  cell_rho[gid] = rho;

  cell_u[3*gid+0] = u_0;
  cell_u[3*gid+1