OpenLB 1.7
Loading...
Searching...
No Matches
lbm.cse.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2021 Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef DYNAMICS_LBM_CSE_H
25#define DYNAMICS_LBM_CSE_H
26
27
28#ifndef DISABLE_CSE
29
30#include "lbm.h"
31#include "latticeDescriptors.h"
32
33namespace olb {
34
35
36template <typename... FIELDS>
37struct lbm<descriptors::D2Q5<FIELDS...>> {
38
39template <typename CELL, typename V=typename CELL::value_t>
40static auto computeRho(CELL& cell) any_platform
41{
42
43return cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + V{1};
44}
45
46template <typename CELL, typename J, typename V=typename CELL::value_t>
47static void computeJ(CELL& cell, J& j) any_platform
48{
49j[0] = -V{1}*cell[1] + V{1}*cell[3];
50j[1] = -V{1}*cell[2] + V{1}*cell[4];
51
52}
53
54template <typename CELL, typename RHO, typename U, typename V=typename CELL::value_t>
55static void computeRhoU(CELL& cell, RHO& rho, U& u) any_platform
56{
57auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + V{1};
58auto x1 = V{1}/x0;
59rho = x0;
60u[0] = -x1*(cell[1] - cell[3]);
61u[1] = -x1*(cell[2] - cell[4]);
62
63}
64
65template <typename CELL, typename RHO, typename J, typename V=typename CELL::value_t>
66static void computeRhoJ(CELL& cell, RHO& rho, J& j) any_platform
67{
68rho = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + V{1};
69j[0] = -V{1}*cell[1] + V{1}*cell[3];
70j[1] = -V{1}*cell[2] + V{1}*cell[4];
71
72}
73
74template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
75static void computeStress(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
76{
77auto x0 = V{0.333333333333333} - V{0.333333333333333}*rho;
78pi[0] = -rho*u[0]*u[0] + x0 + V{1}*cell[1] + V{1}*cell[3];
79pi[1] = -rho*u[0]*u[1];
80pi[2] = -rho*u[1]*u[1] + x0 + V{1}*cell[2] + V{1}*cell[4];
81
82}
83
84template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
85static void computeAllMomenta(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
86{
87auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + V{1};
88auto x1 = cell[1] - cell[3];
89auto x2 = V{1}/x0;
90auto x3 = x1*x2;
91auto x4 = cell[2] - cell[4];
92auto x5 = V{0.333333333333333}*cell[0];
93rho = x0;
94u[0] = -x3;
95u[1] = -x2*x4;
96pi[0] = -x2*x1*x1 - x5 + V{0.666666666666667}*cell[1] - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[3] - V{0.333333333333333}*cell[4];
97pi[1] = -x3*x4;
98pi[2] = -x2*x4*x4 - x5 - V{0.333333333333333}*cell[1] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[3] + V{0.666666666666667}*cell[4];
99
100}
101
102template <typename CELL, typename FEQ, typename V=typename CELL::value_t>
103static void computeFeq(CELL& cell, FEQ& fEq) any_platform
104{
105auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4];
106auto x1 = x0 + V{1};
107auto x2 = x0 + V{1};
108auto x3 = V{1} / ((x2)*(x2));
109auto x4 = V{1.5}*x3;
110auto x5 = cell[2] - cell[4];
111auto x6 = -x5;
112auto x12 = x6*x6;
113auto x13 = cell[1] - cell[3];
114auto x14 = -x13;
115auto x15 = x4*(x14*x14) + V{-1};
116auto x16 = V{1} / (x2);
117auto x17 = x16*(V{3}*cell[1] - V{3}*cell[3]);
118auto x18 = V{3}*x3;
119auto x19 = x13*x13;
120auto x20 = x5*x5;
121auto x21 = x20*x4;
122auto x22 = V{3}*cell[2] - V{3}*cell[4];
123fEq[0] = -V{0.333333333333333}*x1*(x12*x4 + x15) + V{-0.333333333333333};
124fEq[1] = V{0.166666666666667}*x1*(x17 + x18*x19 - x21 + V{1}) + V{-0.166666666666667};
125fEq[2] = -V{0.166666666666667}*x1*(-x12*x18 + x15 - x16*x22) + V{-0.166666666666667};
126fEq[3] = V{0.166666666666667}*x1*(-x17 + V{3}*x19*x3 - x21 + V{1}) + V{-0.166666666666667};
127fEq[4] = -V{0.166666666666667}*x1*(x16*x22 - x18*x20 + x19*x4 + V{-1}) + V{-0.166666666666667};
128
129}
130
131template <typename CELL, typename FNEQ, typename RHO, typename U, typename V=typename CELL::value_t>
132static void computeFneq(CELL& cell, FNEQ& fNeq, RHO& rho, U& u) any_platform
133{
134auto x0 = u[0]*u[0];
135auto x1 = V{1.5}*x0;
136auto x2 = u[1]*u[1];
137auto x3 = V{1.5}*x2;
138auto x4 = x3 + V{-1};
139auto x5 = V{0.166666666666667}*rho;
140auto x6 = V{3}*u[0];
141auto x12 = V{3}*u[1];
142auto x13 = V{3}*x2;
143fNeq[0] = V{0.333333333333333}*rho*(x1 + x4) + cell[0] + V{0.333333333333333};
144fNeq[1] = -x5*(V{3}*x0 - x4 - x6) + cell[1] + V{0.166666666666667};
145fNeq[2] = x5*(x1 + x12 - x13 + V{-1}) + cell[2] + V{0.166666666666667};
146fNeq[3] = -x5*(V{3}*x0 - x3 + x6 + V{1}) + cell[3] + V{0.166666666666667};
147fNeq[4] = -x5*(-x1 + x12 + x13 + V{1}) + cell[4] + V{0.166666666666667};
148
149}
150
151template <typename CELL, typename FNEQ, typename V=typename CELL::value_t>
152static void computeFneq(CELL& cell, FNEQ& fNeq) any_platform
153{
154auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + V{1};
155auto x1 = V{1} / ((x0)*(x0));
156auto x2 = V{1.5}*x1;
157auto x3 = cell[1] - cell[3];
158auto x4 = x3*x3;
159auto x5 = x2*x4;
160auto x6 = cell[2] - cell[4];
161auto x12 = x6*x6;
162auto x13 = x12*x2;
163auto x14 = x13 + V{-1};
164auto x15 = V{0.166666666666667}*cell[0] + V{0.166666666666667}*cell[1] + V{0.166666666666667}*cell[2] + V{0.166666666666667}*cell[3] + V{0.166666666666667}*cell[4] + V{0.166666666666667};
165auto x16 = V{1} / (x0);
166auto x17 = x16*(V{3}*cell[1] - V{3}*cell[3]);
167auto x18 = V{3}*x1;
168auto x19 = x16*(V{3}*cell[2] - V{3}*cell[4]);
169auto x20 = x12*x18;
170fNeq[0] = (x14 + x5)*(V{0.333333333333333}*cell[0] + V{0.333333333333333}*cell[1] + V{0.333333333333333}*cell[2] + V{0.333333333333333}*cell[3] + V{0.333333333333333}*cell[4] + V{0.333333333333333}) + cell[0] + V{0.333333333333333};
171fNeq[1] = -x15*(-x13 + x17 + x18*x4 + V{1}) + cell[1] + V{0.166666666666667};
172fNeq[2] = x15*(V{1.5}*x1*x4 - x19 - x20 + V{-1}) + cell[2] + V{0.166666666666667};
173fNeq[3] = -x15*(V{3}*x1*x4 - x14 - x17) + cell[3] + V{0.166666666666667};
174fNeq[4] = x15*(x19 - x20 + x5 + V{-1}) + cell[4] + V{0.166666666666667};
175
176}
177
178template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
179static auto bgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
180{
181auto x5 = omega + V{-1};
182auto x6 = u[0]*u[0];
183auto x7 = V{1.5}*x6;
184auto x8 = u[1]*u[1];
185auto x9 = V{1.5}*x8;
186auto x10 = x9 + V{-1};
187auto x11 = V{0.166666666666667}*omega;
188auto x12 = V{3}*u[0];
189auto x13 = V{3}*u[1];
190auto x14 = V{3}*x8;
191cell[0] = -V{0.333333333333333}*omega*(rho*(x10 + x7) + V{1}) - x5*cell[0];
192cell[1] = x11*(rho*(-x10 - x12 + V{3}*x6) + V{-1}) - x5*cell[1];
193cell[2] = -x11*(rho*(x13 - x14 + x7 + V{-1}) + V{1}) - x5*cell[2];
194cell[3] = x11*(rho*(x12 + V{3}*x6 - x9 + V{1}) + V{-1}) - x5*cell[3];
195cell[4] = x11*(rho*(x13 + x14 - x7 + V{1}) + V{-1}) - x5*cell[4];
196return x6 + x8;
197}
198
199template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
200static auto adeBgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
201{
202auto x5 = omega + V{-1};
203auto x6 = V{3}*u[0];
204auto x7 = V{0.166666666666667}*omega;
205auto x8 = V{3}*u[1];
206cell[0] = V{0.333333333333333}*omega*(rho + V{-1}) - x5*cell[0];
207cell[1] = -x5*cell[1] - x7*(rho*(x6 + V{-1}) + V{1});
208cell[2] = -x5*cell[2] - x7*(rho*(x8 + V{-1}) + V{1});
209cell[3] = -x5*cell[3] + x7*(rho*(x6 + V{1}) + V{-1});
210cell[4] = -x5*cell[4] + x7*(rho*(x8 + V{1}) + V{-1});
211return u[0]*u[0] + u[1]*u[1];
212}
213
214template <typename CELL, typename PRESSURE, typename J, typename OMEGA, typename V=typename CELL::value_t>
215static auto incBgkCollision(CELL& cell, PRESSURE& pressure, J& j, OMEGA& omega) any_platform
216{
217auto x5 = j[0]*j[0];
218auto x6 = V{0.5}*x5;
219auto x7 = j[1]*j[1];
220auto x8 = V{0.5}*x7;
221auto x9 = omega + V{-1};
222auto x10 = V{0.25}*x7;
223auto x11 = V{0.5}*j[0];
224auto x12 = V{0.5}*pressure;
225auto x13 = V{0.166666666666667} - x12;
226auto x14 = V{0.25}*x5;
227auto x15 = V{0.5}*j[1];
228auto x16 = x12 + V{-0.166666666666667};
229cell[0] = -omega*(-V{1}*pressure + x6 + x8 + V{0.333333333333333}) - x9*cell[0];
230cell[1] = -omega*(x10 + x11 + x13 - x6) - x9*cell[1];
231cell[2] = -omega*(x13 + x14 + x15 - x8) - x9*cell[2];
232cell[3] = omega*(-x10 + x11 + x16 + x6) - x9*cell[3];
233cell[4] = omega*(-x14 + x15 + x16 + x8) - x9*cell[4];
234return x5 + x7;
235}
236
237template <typename CELL, typename RHO, typename U, typename RATIORHO, typename OMEGA, typename V=typename CELL::value_t>
238static auto constRhoBgkCollision(CELL& cell, RHO& rho, U& u, RATIORHO& ratioRho, OMEGA& omega) any_platform
239{
240auto x5 = omega + V{-1};
241auto x6 = V{0.333333333333333}*rho;
242auto x7 = u[0]*u[0];
243auto x8 = V{1.5}*x7;
244auto x9 = u[1]*u[1];
245auto x10 = V{1.5}*x9;
246auto x11 = x10 + V{-1};
247auto x12 = x11 + x8;
248auto x13 = V{0.166666666666667}*rho;
249auto x14 = V{3}*u[0];
250auto x15 = -x11 - x14 + V{3}*x7;
251auto x16 = V{3}*u[1];
252auto x17 = V{3}*x9;
253auto x18 = x16 - x17 + x8 + V{-1};
254auto x19 = -x10 + x14 + V{3}*x7 + V{1};
255auto x20 = x16 + x17 - x8 + V{1};
256cell[0] = -ratioRho*x12*x6 - x5*(x12*x6 + cell[0] + V{0.333333333333333}) + V{-0.333333333333333};
257cell[1] = V{0.166666666666667}*ratioRho*rho*x15 - x5*(-x13*x15 + cell[1] + V{0.166666666666667}) + V{-0.166666666666667};
258cell[2] = -ratioRho*x13*x18 - x5*(x13*x18 + cell[2] + V{0.166666666666667}) + V{-0.166666666666667};
259cell[3] = V{0.166666666666667}*ratioRho*rho*x19 - x5*(-x13*x19 + cell[3] + V{0.166666666666667}) + V{-0.166666666666667};
260cell[4] = V{0.166666666666667}*ratioRho*rho*x20 - x5*(-x13*x20 + cell[4] + V{0.166666666666667}) + V{-0.166666666666667};
261return x7 + x9;
262}
263
264template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
265static auto rlbCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
266{
267auto x5 = omega + V{-1};
268auto x6 = V{0.5}*cell[1];
269auto x7 = V{3}*u[0];
270auto x8 = x7 + V{-1};
271auto x9 = V{0.0833333333333333}*rho;
272auto x10 = x7 + V{1};
273auto x11 = x10*x9;
274auto x12 = V{0.166666666666667}*rho;
275auto x13 = V{0.5}*cell[2];
276auto x14 = V{3}*u[1];
277auto x15 = x14 + V{-1};
278auto x16 = x14 + V{1};
279auto x17 = x16*x9;
280cell[0] = V{0.333333333333333}*rho + V{-0.333333333333333};
281cell[1] = -x12*x8 + x5*(-x11 - x6 - x8*x9 + V{0.5}*cell[3]) + V{-0.166666666666667};
282cell[2] = -x12*x15 + x5*(-x13 - x15*x9 - x17 + V{0.5}*cell[4]) + V{-0.166666666666667};
283cell[3] = V{0.166666666666667}*rho*x10 - x5*(-x11 - x6 - x8*x9 + V{0.5}*cell[3]) + V{-0.166666666666667};
284cell[4] = V{0.166666666666667}*rho*x16 - x5*(-x13 - x15*x9 - x17 + V{0.5}*cell[4]) + V{-0.166666666666667};
285return u[0]*u[0] + u[1]*u[1];
286}
287
288template <typename CELL, typename RHO, typename U, typename PI, typename OMEGA, typename V=typename CELL::value_t>
289static auto rlbCollision(CELL& cell, RHO& rho, U& u, PI& pi, OMEGA& omega) any_platform
290{
291auto x5 = u[0]*u[0];
292auto x6 = V{1.5}*x5;
293auto x7 = u[1]*u[1];
294auto x8 = V{1.5}*x7;
295auto x9 = x8 + V{-1};
296auto x10 = omega + V{-1};
297auto x11 = V{3}*u[0];
298auto x12 = x10*(V{0.5}*pi[0] - V{0.25}*pi[2]) + V{0.166666666666667};
299auto x13 = V{0.25}*pi[0] - V{0.5}*pi[2];
300auto x14 = V{0.166666666666667}*rho;
301auto x15 = V{3}*u[1];
302auto x16 = V{3}*x7;
303cell[0] = -V{0.333333333333333}*rho*(x6 + x9) + V{0.5}*x10*(pi[0] + pi[2]) + V{-0.333333333333333};
304cell[1] = V{0.166666666666667}*rho*(-x11 + V{3}*x5 - x9) - x12;
305cell[2] = x10*x13 - x14*(x15 - x16 + x6 + V{-1}) + V{-0.166666666666667};
306cell[3] = V{0.166666666666667}*rho*(x11 + V{3}*x5 - x8 + V{1}) - x12;
307cell[4] = x10*x13 + x14*(x15 + x16 - x6 + V{1}) + V{-0.166666666666667};
308return x5 + x7;
309}
310
311template <typename CELL, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
312static void defineEqFirstOrder(CELL& cell, NEWRHO& newRho, NEWU& newU) any_platform
313{
314auto x5 = V{3}*newU[0];
315auto x6 = V{3}*newU[1];
316cell[0] = V{0.333333333333333}*newRho + V{-0.333333333333333};
317cell[1] = -V{0.166666666666667}*newRho*(x5 + V{-1}) + V{-0.166666666666667};
318cell[2] = -V{0.166666666666667}*newRho*(x6 + V{-1}) + V{-0.166666666666667};
319cell[3] = V{0.166666666666667}*newRho*(x5 + V{1}) + V{-0.166666666666667};
320cell[4] = V{0.166666666666667}*newRho*(x6 + V{1}) + V{-0.166666666666667};
321
322}
323
324template <typename CELL, typename OLDRHO, typename OLDU, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
325static void defineNEq(CELL& cell, OLDRHO& oldRho, OLDU& oldU, NEWRHO& newRho, NEWU& newU) any_platform
326{
327auto x5 = oldU[0]*oldU[0];
328auto x6 = V{1.5}*x5;
329auto x7 = oldU[1]*oldU[1];
330auto x8 = V{1.5}*x7;
331auto x9 = x8 + V{-1};
332auto x10 = newU[0]*newU[0];
333auto x11 = V{1.5}*x10;
334auto x12 = newU[1]*newU[1];
335auto x13 = V{1.5}*x12;
336auto x14 = x13 + V{-1};
337auto x15 = V{0.166666666666667}*newRho;
338auto x16 = V{3}*newU[0];
339auto x17 = V{0.166666666666667}*oldRho;
340auto x18 = V{3}*oldU[0];
341auto x19 = V{3}*oldU[1];
342auto x20 = V{3}*x7;
343auto x21 = V{3}*newU[1];
344auto x22 = V{3}*x12;
345cell[0] = -V{0.333333333333333}*newRho*(x11 + x14) + V{0.333333333333333}*oldRho*(x6 + x9) + cell[0];
346cell[1] = x15*(V{3}*x10 - x14 - x16) - x17*(-x18 + V{3}*x5 - x9) + cell[1];
347cell[2] = -x15*(x11 + x21 - x22 + V{-1}) + x17*(x19 - x20 + x6 + V{-1}) + cell[2];
348cell[3] = x15*(V{3}*x10 - x13 + x16 + V{1}) - x17*(x18 + V{3}*x5 - x8 + V{1}) + cell[3];
349cell[4] = x15*(-x11 + x21 + x22 + V{1}) - x17*(x19 + x20 - x6 + V{1}) + cell[4];
350
351}
352
353template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
354static void defineNEqFromPi(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
355{
356auto x5 = V{0.5}*pi[0];
357auto x6 = V{0.5}*pi[2];
358auto x7 = u[0]*u[0];
359auto x8 = V{1.5}*x7;
360auto x9 = u[1]*u[1];
361auto x10 = V{1.5}*x9;
362auto x11 = x10 + V{-1};
363auto x12 = V{0.166666666666667}*rho;
364auto x13 = V{3}*u[0];
365auto x14 = x5 - V{0.25}*pi[2] + V{-0.166666666666667};
366auto x15 = V{0.25}*pi[0];
367auto x16 = V{3}*u[1];
368auto x17 = V{3}*x9;
369cell[0] = -V{0.333333333333333}*rho*(x11 + x8) - x5 - x6 + V{-0.333333333333333};
370cell[1] = x12*(-x11 - x13 + V{3}*x7) + x14;
371cell[2] = -x12*(x16 - x17 + x8 + V{-1}) - x15 + V{0.5}*pi[2] + V{-0.166666666666667};
372cell[3] = x12*(-x10 + x13 + V{3}*x7 + V{1}) + x14;
373cell[4] = x12*(x16 + x17 - x8 + V{1}) - x15 + x6 + V{-0.166666666666667};
374
375}
376
377template <typename CELL, typename FORCE, typename V=typename CELL::value_t>
378static auto computePiNeqNormSqr(CELL& cell, FORCE& force) any_platform
379{
380auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4];
381auto x1 = x0 + V{1};
382auto x2 = cell[1] - cell[3];
383auto x3 = cell[2] - cell[4];
384auto x4 = x0 + V{1};
385auto x5 = x4*(x2*force[1] + x3*force[0]);
386auto x6 = x2*x3;
387auto x7 = V{0.333333333333333}*cell[0];
388auto x8 = V{1} / (x1);
389auto x9 = x4*x8;
390auto x10 = x3*x9*force[1] + x7 + x8*(x3*x3) + V{0.333333333333333}*cell[1] - V{0.666666666666667}*cell[2] + V{0.333333333333333}*cell[3] - V{0.666666666666667}*cell[4];
391auto x11 = x2*x9*force[0] + x7 + x8*(x2*x2) - V{0.666666666666667}*cell[1] + V{0.333333333333333}*cell[2] - V{0.666666666666667}*cell[3] + V{0.333333333333333}*cell[4];
392return x10*x10 + x11*x11 + (V{0.5}*x5 + V{1}*x6)*(V{1}*x5 + V{2}*x6)/((x1)*(x1));
393}
394
395template <typename CELL, typename V=typename CELL::value_t>
396static auto computePiNeqNormSqr(CELL& cell) any_platform
397{
398auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + V{1};
399auto x1 = cell[1] - cell[3];
400auto x2 = x1*x1;
401auto x3 = cell[2] - cell[4];
402auto x4 = x3*x3;
403auto x5 = V{0.333333333333333}*cell[0];
404auto x6 = V{1}/x0;
405auto x7 = x4*x6 + x5 + V{0.333333333333333}*cell[1] - V{0.666666666666667}*cell[2] + V{0.333333333333333}*cell[3] - V{0.666666666666667}*cell[4];
406auto x8 = x2*x6 + x5 - V{0.666666666666667}*cell[1] + V{0.333333333333333}*cell[2] - V{0.666666666666667}*cell[3] + V{0.333333333333333}*cell[4];
407return x7*x7 + x8*x8 + V{2}*x2*x4/((x0)*(x0));
408}
409
410template <typename CELL, typename RHO, typename U, typename OMEGA, typename FORCE, typename V=typename CELL::value_t>
411static void addExternalForce(CELL& cell, RHO& rho, U& u, OMEGA& omega, FORCE& force) any_platform
412{
413auto x5 = force[0]*u[0];
414auto x6 = force[1]*u[1];
415auto x7 = rho*(V{0.5}*omega + V{-1});
416auto x8 = V{6}*u[0];
417auto x9 = V{0.166666666666667}*force[0];
418auto x10 = -V{0.5}*x6;
419auto x11 = V{6}*u[1];
420auto x12 = V{0.166666666666667}*force[1];
421auto x13 = -V{0.5}*x5;
422cell[0] = V{1}*x7*(x5 + x6) + cell[0];
423cell[1] = -x7*(x10 + x9*(x8 + V{-3})) + cell[1];
424cell[2] = -x7*(x12*(x11 + V{-3}) + x13) + cell[2];
425cell[3] = -x7*(x10 + x9*(x8 + V{3})) + cell[3];
426cell[4] = -x7*(x12*(x11 + V{3}) + x13) + cell[4];
427
428}
429
430};
431
432template <typename... FIELDS>
433struct lbm<descriptors::D2Q9<FIELDS...>> {
434
435template <typename CELL, typename V=typename CELL::value_t>
436static auto computeRho(CELL& cell) any_platform
437{
438
439return cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7] + cell[8] + V{1};
440}
441
442template <typename CELL, typename J, typename V=typename CELL::value_t>
443static void computeJ(CELL& cell, J& j) any_platform
444{
445auto x0 = cell[1] - cell[5];
446j[0] = -V{1}*x0 - V{1}*cell[2] - V{1}*cell[3] + V{1}*cell[6] + V{1}*cell[7];
447j[1] = V{1}*x0 - V{1}*cell[3] - V{1}*cell[4] + V{1}*cell[7] + V{1}*cell[8];
448
449}
450
451template <typename CELL, typename RHO, typename U, typename V=typename CELL::value_t>
452static void computeRhoU(CELL& cell, RHO& rho, U& u) any_platform
453{
454auto x0 = cell[2] + cell[3];
455auto x1 = cell[7] + cell[8];
456auto x2 = x0 + x1 + cell[0] + cell[1] + cell[4] + cell[5] + cell[6] + V{1};
457auto x3 = cell[1] - cell[5];
458auto x4 = V{1}/x2;
459rho = x2;
460u[0] = -x4*(x0 + x3 - cell[6] - cell[7]);
461u[1] = x4*(x1 + x3 - cell[3] - cell[4]);
462
463}
464
465template <typename CELL, typename RHO, typename J, typename V=typename CELL::value_t>
466static void computeRhoJ(CELL& cell, RHO& rho, J& j) any_platform
467{
468auto x0 = cell[2] + cell[3];
469auto x1 = cell[7] + cell[8];
470auto x2 = cell[1] - cell[5];
471rho = x0 + x1 + cell[0] + cell[1] + cell[4] + cell[5] + cell[6] + V{1};
472j[0] = -V{1}*x0 - V{1}*x2 + V{1}*cell[6] + V{1}*cell[7];
473j[1] = V{1}*x1 + V{1}*x2 - V{1}*cell[3] - V{1}*cell[4];
474
475}
476
477template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
478static void computeStress(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
479{
480auto x0 = V{1}*cell[1] + V{1}*cell[5];
481auto x1 = -V{0.333333333333333}*rho + x0 + V{1}*cell[3] + V{1}*cell[7] + V{0.333333333333333};
482pi[0] = -rho*u[0]*u[0] + x1 + V{1}*cell[2] + V{1}*cell[6];
483pi[1] = -rho*u[0]*u[1] - x0 + V{1}*cell[3] + V{1}*cell[7];
484pi[2] = -rho*u[1]*u[1] + x1 + V{1}*cell[4] + V{1}*cell[8];
485
486}
487
488template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
489static void computeAllMomenta(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
490{
491auto x0 = cell[1] + cell[2];
492auto x1 = cell[7] + cell[8];
493auto x2 = x0 + x1 + cell[0] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
494auto x3 = -cell[5];
495auto x4 = x3 + cell[3];
496auto x5 = x0 + x4 - cell[6] - cell[7];
497auto x6 = V{1} / (x2);
498auto x7 = V{1}*x6;
499auto x8 = x1 + x3 + cell[1] - cell[3] - cell[4];
500auto x9 = -V{0.333333333333333}*cell[0] + V{0.666666666666667}*cell[1] + V{0.666666666666667}*cell[3] + V{0.666666666666667}*cell[5] + V{0.666666666666667}*cell[7];
501rho = x2;
502u[0] = -x5*x7;
503u[1] = x7*x8;
504pi[0] = -x7*x5*x5 + x9 + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[4] + V{0.666666666666667}*cell[6] - V{0.333333333333333}*cell[8];
505pi[1] = V{1}*x4 + V{1}*x5*x6*x8 - V{1}*cell[1] + V{1}*cell[7];
506pi[2] = -x7*x8*x8 + x9 - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[4] - V{0.333333333333333}*cell[6] + V{0.666666666666667}*cell[8];
507
508}
509
510template <typename CELL, typename FEQ, typename V=typename CELL::value_t>
511static void computeFeq(CELL& cell, FEQ& fEq) any_platform
512{
513auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7] + cell[8];
514auto x1 = x0 + V{1};
515auto x2 = x0 + V{1};
516auto x3 = V{1} / ((x2)*(x2));
517auto x4 = V{1.5}*x3;
518auto x5 = cell[1] - cell[5];
519auto x6 = -cell[4] + cell[8];
520auto x7 = x5 + x6 - cell[3] + cell[7];
521auto x8 = x7*x7;
522auto x9 = x4*x8;
523auto x10 = cell[2] - cell[6];
524auto x20 = x10 + x5 + cell[3] - cell[7];
525auto x21 = -x20;
526auto x22 = x4*(x21*x21) + V{-1};
527auto x23 = x22 + x9;
528auto x24 = V{4.5}*x3;
529auto x25 = x10 + x6 + V{2}*cell[1] - V{2}*cell[5];
530auto x26 = x24*(x25*x25);
531auto x27 = V{1} / (x2);
532auto x28 = V{3}*cell[3];
533auto x29 = V{3}*cell[7];
534auto x30 = V{3}*cell[1] - V{3}*cell[5];
535auto x31 = x28 - x29 + x30 + V{3}*cell[2] - V{3}*cell[6];
536auto x32 = x27*x31;
537auto x33 = x32 - x9 + V{1};
538auto x34 = -x28 + x29 + x30 - V{3}*cell[4] + V{3}*cell[8];
539auto x35 = x27*x34;
540auto x36 = x20*x20;
541auto x37 = x36*x4;
542auto x38 = x35 - x37;
543auto x39 = V{3}*x3;
544auto x40 = x10 + V{2}*cell[3] + cell[4] - V{2}*cell[7] - cell[8];
545auto x41 = -x40;
546auto x42 = x39*x8;
547auto x43 = x32 + x9 + V{-1};
548auto x44 = x37 + x43;
549fEq[0] = -V{0.444444444444444}*x1*x23 + V{-0.444444444444444};
550fEq[1] = V{0.0277777777777778}*x1*(x26 + x33 + x38) + V{-0.0277777777777778};
551fEq[2] = V{0.111111111111111}*x1*(x33 + x36*x39) + V{-0.111111111111111};
552fEq[3] = -V{0.0277777777777778}*(x1*(x23 - x24*x41*x41 - x27*x31 + x35) + V{1});
553fEq[4] = -V{0.111111111111111}*x1*(x22 + x35 - x42) + V{-0.111111111111111};
554fEq[5] = -V{0.0277777777777778}*x1*(-x26 + x35 + x44) + V{-0.0277777777777778};
555fEq[6] = V{0.111111111111111}*x1*(V{3}*x3*x36 - x43) + V{-0.111111111111111};
556fEq[7] = V{0.0277777777777778}*(-x1*(-x27*x34 - V{4.5}*x3*x40*x40 + x44) + V{-1});
557fEq[8] = V{0.111111111111111}*x1*(x38 + x42 + V{1}) + V{-0.111111111111111};
558
559}
560
561template <typename CELL, typename FNEQ, typename RHO, typename U, typename V=typename CELL::value_t>
562static void computeFneq(CELL& cell, FNEQ& fNeq, RHO& rho, U& u) any_platform
563{
564auto x0 = u[0]*u[0];
565auto x1 = V{1.5}*x0;
566auto x2 = u[1]*u[1];
567auto x3 = V{1.5}*x2;
568auto x4 = x3 + V{-1};
569auto x5 = x1 + x4;
570auto x6 = V{0.0277777777777778}*rho;
571auto x7 = V{3}*u[1];
572auto x8 = -x7;
573auto x9 = u[0] - u[1];
574auto x10 = x9*x9;
575auto x20 = V{3}*u[0];
576auto x21 = x20 + x5;
577auto x22 = V{0.111111111111111}*rho;
578auto x23 = u[0] + u[1];
579auto x24 = V{4.5}*(x23*x23);
580auto x25 = V{3}*x2;
581auto x26 = -x1;
582auto x27 = x20 - x3 + V{1};
583auto x28 = x26 + x7;
584fNeq[0] = V{0.444444444444444}*rho*x5 + cell[0] + V{0.444444444444444};
585fNeq[1] = -x6*(V{4.5}*x10 - x21 - x8) + cell[1] + V{0.0277777777777778};
586fNeq[2] = -x22*(V{3}*x0 - x20 - x4) + cell[2] + V{0.111111111111111};
587fNeq[3] = x6*(x21 - x24 + x7) + cell[3] + V{0.0277777777777778};
588fNeq[4] = x22*(x1 - x25 + x7 + V{-1}) + cell[4] + V{0.111111111111111};
589fNeq[5] = -x6*(V{4.5}*x10 + x26 + x27 + x8) + cell[5] + V{0.0277777777777778};
590fNeq[6] = -x22*(V{3}*x0 + x27) + cell[6] + V{0.111111111111111};
591fNeq[7] = -x6*(x24 + x27 + x28) + cell[7] + V{0.0277777777777778};
592fNeq[8] = -x22*(x25 + x28 + V{1}) + cell[8] + V{0.111111111111111};
593
594}
595
596template <typename CELL, typename FNEQ, typename V=typename CELL::value_t>
597static void computeFneq(CELL& cell, FNEQ& fNeq) any_platform
598{
599auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7] + cell[8] + V{1};
600auto x1 = V{1} / ((x0)*(x0));
601auto x2 = V{1.5}*x1;
602auto x3 = cell[1] - cell[5];
603auto x4 = -cell[4] + cell[8];
604auto x5 = x3 + x4 - cell[3] + cell[7];
605auto x6 = x5*x5;
606auto x7 = x2*x6;
607auto x8 = cell[2] - cell[6];
608auto x9 = x3 + x8 + cell[3] - cell[7];
609auto x10 = x9*x9;
610auto x20 = x10*x2;
611auto x21 = x20 + V{-1};
612auto x22 = x21 + x7;
613auto x23 = V{0.0277777777777778}*cell[0] + V{0.0277777777777778}*cell[1] + V{0.0277777777777778}*cell[2] + V{0.0277777777777778}*cell[3] + V{0.0277777777777778}*cell[4] + V{0.0277777777777778}*cell[5] + V{0.0277777777777778}*cell[6] + V{0.0277777777777778}*cell[7] + V{0.0277777777777778}*cell[8] + V{0.0277777777777778};
614auto x24 = V{4.5}*x1;
615auto x25 = x4 + x8 + V{2}*cell[1] - V{2}*cell[5];
616auto x26 = x24*(x25*x25);
617auto x27 = V{1} / (x0);
618auto x28 = V{3}*cell[3];
619auto x29 = V{3}*cell[7];
620auto x30 = V{3}*cell[1] - V{3}*cell[5];
621auto x31 = x27*(x28 - x29 + x30 + V{3}*cell[2] - V{3}*cell[6]);
622auto x32 = x31 - x7 + V{1};
623auto x33 = -x28 + x29 + x30 - V{3}*cell[4] + V{3}*cell[8];
624auto x34 = x27*x33;
625auto x35 = -x20;
626auto x36 = x34 + x35;
627auto x37 = V{0.111111111111111}*cell[0] + V{0.111111111111111}*cell[1] + V{0.111111111111111}*cell[2] + V{0.111111111111111}*cell[3] + V{0.111111111111111}*cell[4] + V{0.111111111111111}*cell[5] + V{0.111111111111111}*cell[6] + V{0.111111111111111}*cell[7] + V{0.111111111111111}*cell[8] + V{0.111111111111111};
628auto x38 = V{3}*x1;
629auto x39 = -x27*x33;
630auto x40 = x8 + V{2}*cell[3] + cell[4] - V{2}*cell[7] - cell[8];
631auto x41 = -x40;
632auto x42 = x38*x6;
633auto x43 = x22 + x31;
634fNeq[0] = x22*(V{0.444444444444444}*cell[0] + V{0.444444444444444}*cell[1] + V{0.444444444444444}*cell[2] + V{0.444444444444444}*cell[3] + V{0.444444444444444}*cell[4] + V{0.444444444444444}*cell[5] + V{0.444444444444444}*cell[6] + V{0.444444444444444}*cell[7] + V{0.444444444444444}*cell[8] + V{0.444444444444444}) + cell[0] + V{0.444444444444444};
635fNeq[1] = -x23*(x26 + x32 + x36) + cell[1] + V{0.0277777777777778};
636fNeq[2] = -x37*(x10*x38 + x32) + cell[2] + V{0.111111111111111};
637fNeq[3] = -x23*(x24*(x41*x41) + x32 + x35 + x39) + cell[3] + V{0.0277777777777778};
638fNeq[4] = x37*(x21 + x34 - x42) + cell[4] + V{0.111111111111111};
639fNeq[5] = x23*(-x26 + x34 + x43) + cell[5] + V{0.0277777777777778};
640fNeq[6] = -x37*(V{3}*x1*x10 - x31 - x7 + V{1}) + cell[6] + V{0.111111111111111};
641fNeq[7] = x23*(-V{4.5}*x1*x40*x40 + x39 + x43) + cell[7] + V{0.0277777777777778};
642fNeq[8] = -x37*(x36 + x42 + V{1}) + cell[8] + V{0.111111111111111};
643
644}
645
646template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
647static auto bgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
648{
649auto x9 = omega + V{-1};
650auto x10 = u[0]*u[0];
651auto x11 = V{1.5}*x10;
652auto x12 = u[1]*u[1];
653auto x13 = V{1.5}*x12;
654auto x14 = x13 + V{-1};
655auto x15 = x11 + x14;
656auto x16 = V{0.0277777777777778}*omega;
657auto x17 = V{3}*u[1];
658auto x18 = -x17;
659auto x19 = u[0] - u[1];
660auto x20 = x19*x19;
661auto x21 = V{3}*u[0];
662auto x22 = x15 + x21;
663auto x23 = V{0.111111111111111}*omega;
664auto x24 = u[0] + u[1];
665auto x25 = V{4.5}*(x24*x24);
666auto x26 = V{3}*x12;
667auto x27 = -x11;
668auto x28 = -x13 + x21 + V{1};
669auto x29 = x17 + x27;
670cell[0] = -V{0.444444444444444}*omega*(rho*x15 + V{1}) - x9*cell[0];
671cell[1] = x16*(rho*(-x18 + V{4.5}*x20 - x22) + V{-1}) - x9*cell[1];
672cell[2] = x23*(rho*(V{3}*x10 - x14 - x21) + V{-1}) - x9*cell[2];
673cell[3] = -x16*(rho*(x17 + x22 - x25) + V{1}) - x9*cell[3];
674cell[4] = -x23*(rho*(x11 + x17 - x26 + V{-1}) + V{1}) - x9*cell[4];
675cell[5] = x16*(rho*(x18 + V{4.5}*x20 + x27 + x28) + V{-1}) - x9*cell[5];
676cell[6] = x23*(rho*(V{3}*x10 + x28) + V{-1}) - x9*cell[6];
677cell[7] = x16*(rho*(x25 + x28 + x29) + V{-1}) - x9*cell[7];
678cell[8] = x23*(rho*(x26 + x29 + V{1}) + V{-1}) - x9*cell[8];
679return x10 + x12;
680}
681
682template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
683static auto adeBgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
684{
685auto x9 = omega + V{-1};
686auto x10 = V{3}*u[0];
687auto x11 = V{3}*u[1];
688auto x12 = x11 + V{1};
689auto x13 = V{0.0277777777777778}*omega;
690auto x14 = x10 + V{-1};
691auto x15 = V{0.111111111111111}*omega;
692auto x16 = x10 + V{1};
693cell[0] = V{0.444444444444444}*omega*(rho + V{-1}) - x9*cell[0];
694cell[1] = x13*(rho*(-x10 + x12) + V{-1}) - x9*cell[1];
695cell[2] = -x15*(rho*x14 + V{1}) - x9*cell[2];
696cell[3] = -x13*(rho*(x11 + x14) + V{1}) - x9*cell[3];
697cell[4] = -x15*(rho*(x11 + V{-1}) + V{1}) - x9*cell[4];
698cell[5] = x13*(rho*(-x11 + x16) + V{-1}) - x9*cell[5];
699cell[6] = x15*(rho*x16 + V{-1}) - x9*cell[6];
700cell[7] = x13*(rho*(x11 + x16) + V{-1}) - x9*cell[7];
701cell[8] = x15*(rho*x12 + V{-1}) - x9*cell[8];
702return u[0]*u[0] + u[1]*u[1];
703}
704
705template <typename CELL, typename PRESSURE, typename J, typename OMEGA, typename V=typename CELL::value_t>
706static auto incBgkCollision(CELL& cell, PRESSURE& pressure, J& j, OMEGA& omega) any_platform
707{
708auto x9 = j[0]*j[0];
709auto x10 = j[1]*j[1];
710auto x11 = omega + V{-1};
711auto x12 = j[0] - j[1];
712auto x13 = -x12;
713auto x14 = V{0.0833333333333333}*j[1];
714auto x15 = V{0.0833333333333333}*j[0];
715auto x16 = V{0.0416666666666667}*x9;
716auto x17 = V{0.0416666666666667}*x10;
717auto x18 = V{0.0833333333333333}*pressure;
718auto x19 = x16 + x17 - x18 + V{0.0277777777777778};
719auto x20 = x15 + x19;
720auto x21 = V{0.166666666666667}*x10;
721auto x22 = V{0.333333333333333}*j[0];
722auto x23 = V{0.333333333333333}*x9;
723auto x24 = V{0.333333333333333}*pressure;
724auto x25 = V{0.111111111111111} - x24;
725auto x26 = j[0] + j[1];
726auto x27 = V{0.125}*(x26*x26);
727auto x28 = V{0.166666666666667}*x9;
728auto x29 = V{0.333333333333333}*j[1];
729auto x30 = V{0.333333333333333}*x10;
730auto x31 = x24 + V{-0.111111111111111};
731cell[0] = -omega*(-V{1.33333333333333}*pressure + V{0.666666666666667}*x10 + V{0.666666666666667}*x9 + V{0.444444444444444}) - x11*cell[0];
732cell[1] = -omega*(-x14 + x20 - V{0.125}*x13*x13) - x11*cell[1];
733cell[2] = -omega*(x21 + x22 - x23 + x25) - x11*cell[2];
734cell[3] = -omega*(x14 + x20 - x27) - x11*cell[3];
735cell[4] = -omega*(x25 + x28 + x29 - x30) - x11*cell[4];
736cell[5] = -omega*(x14 - x15 + x19 - V{0.125}*x12*x12) - x11*cell[5];
737cell[6] = omega*(-x21 + x22 + x23 + x31) - x11*cell[6];
738cell[7] = omega*(x14 + x15 - x16 - x17 + x18 + x27 + V{-0.0277777777777778}) - x11*cell[7];
739cell[8] = omega*(-x28 + x29 + x30 + x31) - x11*cell[8];
740return x10 + x9;
741}
742
743template <typename CELL, typename RHO, typename U, typename RATIORHO, typename OMEGA, typename V=typename CELL::value_t>
744static auto constRhoBgkCollision(CELL& cell, RHO& rho, U& u, RATIORHO& ratioRho, OMEGA& omega) any_platform
745{
746auto x9 = omega + V{-1};
747auto x10 = V{0.444444444444444}*rho;
748auto x11 = u[0]*u[0];
749auto x12 = V{1.5}*x11;
750auto x13 = u[1]*u[1];
751auto x14 = V{1.5}*x13;
752auto x15 = x14 + V{-1};
753auto x16 = x12 + x15;
754auto x17 = V{0.0277777777777778}*rho;
755auto x18 = V{3}*u[1];
756auto x19 = -x18;
757auto x20 = u[0] - u[1];
758auto x21 = x20*x20;
759auto x22 = V{3}*u[0];
760auto x23 = x16 + x22;
761auto x24 = -x19 + V{4.5}*x21 - x23;
762auto x25 = V{0.111111111111111}*rho;
763auto x26 = V{3}*x11 - x15 - x22;
764auto x27 = u[0] + u[1];
765auto x28 = V{4.5}*(x27*x27);
766auto x29 = x18 + x23 - x28;
767auto x30 = V{3}*x13;
768auto x31 = x12 + x18 - x30 + V{-1};
769auto x32 = -x12;
770auto x33 = -x14 + x22 + V{1};
771auto x34 = x19 + V{4.5}*x21 + x32 + x33;
772auto x35 = V{3}*x11 + x33;
773auto x36 = x18 + x32;
774auto x37 = x28 + x33 + x36;
775auto x38 = x30 + x36 + V{1};
776cell[0] = -ratioRho*x10*x16 - x9*(x10*x16 + cell[0] + V{0.444444444444444}) + V{-0.444444444444444};
777cell[1] = V{0.0277777777777778}*ratioRho*rho*x24 - x9*(-x17*x24 + cell[1] + V{0.0277777777777778}) + V{-0.0277777777777778};
778cell[2] = V{0.111111111111111}*ratioRho*rho*x26 - x9*(-x25*x26 + cell[2] + V{0.111111111111111}) + V{-0.111111111111111};
779cell[3] = -ratioRho*x17*x29 - x9*(x17*x29 + cell[3] + V{0.0277777777777778}) + V{-0.0277777777777778};
780cell[4] = -ratioRho*x25*x31 - x9*(x25*x31 + cell[4] + V{0.111111111111111}) + V{-0.111111111111111};
781cell[5] = V{0.0277777777777778}*ratioRho*rho*x34 - x9*(-x17*x34 + cell[5] + V{0.0277777777777778}) + V{-0.0277777777777778};
782cell[6] = V{0.111111111111111}*ratioRho*rho*x35 - x9*(-x25*x35 + cell[6] + V{0.111111111111111}) + V{-0.111111111111111};
783cell[7] = V{0.0277777777777778}*ratioRho*rho*x37 - x9*(-x17*x37 + cell[7] + V{0.0277777777777778}) + V{-0.0277777777777778};
784cell[8] = V{0.111111111111111}*ratioRho*rho*x38 - x9*(-x25*x38 + cell[8] + V{0.111111111111111}) + V{-0.111111111111111};
785return x11 + x13;
786}
787
788template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
789static auto rlbCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
790{
791auto x9 = omega + V{-1};
792auto x10 = V{0.0833333333333333}*cell[8];
793auto x11 = V{3}*u[1];
794auto x12 = V{3}*u[0];
795auto x13 = x12 + V{1};
796auto x14 = -x11 + x13;
797auto x15 = V{0.00462962962962963}*rho;
798auto x16 = x11 + V{1};
799auto x17 = -x12 + x16;
800auto x18 = x11 + V{-1};
801auto x19 = V{0.00925925925925926}*rho;
802auto x20 = x12 + V{-1};
803auto x21 = x13*x19 + x19*x20 + V{0.0833333333333333}*cell[2] - V{0.0833333333333333}*cell[6];
804auto x22 = x9*(V{0.00925925925925926}*rho*x16 + V{0.00462962962962963}*rho*x17 + V{0.00925925925925926}*rho*x18 - x10 - x14*x15 - x21 - V{0.166666666666667}*cell[1] + V{0.0833333333333333}*cell[4] + V{0.166666666666667}*cell[5]);
805auto x23 = V{0.0277777777777778}*rho;
806auto x24 = V{0.333333333333333}*cell[1];
807auto x25 = V{0.333333333333333}*cell[5];
808auto x26 = x14*x19;
809auto x27 = V{0.037037037037037}*rho;
810auto x28 = x17*x19;
811auto x29 = x12 + x16;
812auto x30 = x12 + x18;
813auto x31 = x19*x29 + x19*x30 + V{0.333333333333333}*cell[3] - V{0.333333333333333}*cell[7] + V{4.62592926927149e-18};
814auto x32 = x9*(x13*x27 + x20*x27 + x24 - x25 + x26 - x28 + x31 + V{0.333333333333333}*cell[2] - V{0.333333333333333}*cell[6]);
815auto x33 = V{0.111111111111111}*rho;
816auto x34 = x9*(-x10 + x15*x29 + x15*x30 + x16*x19 + x18*x19 + x21 + V{0.166666666666667}*cell[3] + V{0.0833333333333333}*cell[4] - V{0.166666666666667}*cell[7] + V{2.31296463463574e-18});
817auto x35 = x9*(x16*x27 + x18*x27 - x24 + x25 - x26 + x28 + x31 + V{0.333333333333333}*cell[4] - V{0.333333333333333}*cell[8]);
818cell[0] = V{0.444444444444444}*rho + V{-0.444444444444444};
819cell[1] = x17*x23 + x22 + V{-0.0277777777777778};
820cell[2] = -x20*x33 - x32 + V{-0.111111111111111};
821cell[3] = -x23*x30 - x34 + V{-0.0277777777777778};
822cell[4] = -x18*x33 - x35 + V{-0.111111111111111};
823cell[5] = V{0.0277777777777778}*rho*x14 - x22 + V{-0.0277777777777778};
824cell[6] = x13*x33 + x32 + V{-0.111111111111111};
825cell[7] = x23*x29 + x34 + V{-0.0277777777777778};
826cell[8] = x16*x33 + x35 + V{-0.111111111111111};
827return u[0]*u[0] + u[1]*u[1];
828}
829
830template <typename CELL, typename RHO, typename U, typename PI, typename OMEGA, typename V=typename CELL::value_t>
831static auto rlbCollision(CELL& cell, RHO& rho, U& u, PI& pi, OMEGA& omega) any_platform
832{
833auto x9 = u[0]*u[0];
834auto x10 = V{1.5}*x9;
835auto x11 = u[1]*u[1];
836auto x12 = V{1.5}*x11;
837auto x13 = x12 + V{-1};
838auto x14 = x10 + x13;
839auto x15 = omega + V{-1};
840auto x16 = V{3}*u[1];
841auto x17 = -x16;
842auto x18 = u[0] - u[1];
843auto x19 = x18*x18;
844auto x20 = V{3}*u[0];
845auto x21 = x14 + x20;
846auto x22 = V{0.25}*pi[1];
847auto x23 = V{0.0833333333333333}*pi[0] + V{0.0833333333333333}*pi[2];
848auto x24 = x15*(-x22 + x23) + V{0.0277777777777778};
849auto x25 = x15*(V{0.333333333333333}*pi[0] - V{0.166666666666667}*pi[2]) + V{0.111111111111111};
850auto x26 = u[0] + u[1];
851auto x27 = V{4.5}*(x26*x26);
852auto x28 = x15*(x22 + x23) + V{0.0277777777777778};
853auto x29 = V{0.166666666666667}*pi[0] - V{0.333333333333333}*pi[2];
854auto x30 = V{0.111111111111111}*rho;
855auto x31 = V{3}*x11;
856auto x32 = -x10;
857auto x33 = -x12 + x20 + V{1};
858auto x34 = x16 + x32;
859cell[0] = -V{0.444444444444444}*rho*x14 + V{0.666666666666667}*x15*(pi[0] + pi[2]) + V{-0.444444444444444};
860cell[1] = V{0.0277777777777778}*rho*(-x17 + V{4.5}*x19 - x21) - x24;
861cell[2] = V{0.111111111111111}*rho*(-x13 - x20 + V{3}*x9) - x25;
862cell[3] = -V{0.0277777777777778}*rho*(x16 + x21 - x27) - x28;
863cell[4] = x15*x29 - x30*(x10 + x16 - x31 + V{-1}) + V{-0.111111111111111};
864cell[5] = V{0.0277777777777778}*rho*(x17 + V{4.5}*x19 + x32 + x33) - x24;
865cell[6] = V{0.111111111111111}*rho*(x33 + V{3}*x9) - x25;
866cell[7] = V{0.0277777777777778}*rho*(x27 + x33 + x34) - x28;
867cell[8] = x15*x29 + x30*(x31 + x34 + V{1}) + V{-0.111111111111111};
868return x11 + x9;
869}
870
871template <typename CELL, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
872static void defineEqFirstOrder(CELL& cell, NEWRHO& newRho, NEWU& newU) any_platform
873{
874auto x9 = V{3}*newU[0];
875auto x10 = V{3}*newU[1];
876auto x11 = x10 + V{1};
877auto x12 = x9 + V{-1};
878auto x13 = x9 + V{1};
879cell[0] = V{0.444444444444444}*newRho + V{-0.444444444444444};
880cell[1] = V{0.0277777777777778}*newRho*(x11 - x9) + V{-0.0277777777777778};
881cell[2] = -V{0.111111111111111}*newRho*x12 + V{-0.111111111111111};
882cell[3] = -V{0.0277777777777778}*newRho*(x10 + x12) + V{-0.0277777777777778};
883cell[4] = -V{0.111111111111111}*newRho*(x10 + V{-1}) + V{-0.111111111111111};
884cell[5] = V{0.0277777777777778}*newRho*(-x10 + x13) + V{-0.0277777777777778};
885cell[6] = V{0.111111111111111}*newRho*x13 + V{-0.111111111111111};
886cell[7] = V{0.0277777777777778}*newRho*(x10 + x13) + V{-0.0277777777777778};
887cell[8] = V{0.111111111111111}*newRho*x11 + V{-0.111111111111111};
888
889}
890
891template <typename CELL, typename OLDRHO, typename OLDU, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
892static void defineNEq(CELL& cell, OLDRHO& oldRho, OLDU& oldU, NEWRHO& newRho, NEWU& newU) any_platform
893{
894auto x9 = oldU[0]*oldU[0];
895auto x10 = V{1.5}*x9;
896auto x11 = oldU[1]*oldU[1];
897auto x12 = V{1.5}*x11;
898auto x13 = x12 + V{-1};
899auto x14 = x10 + x13;
900auto x15 = newU[0]*newU[0];
901auto x16 = V{1.5}*x15;
902auto x17 = newU[1]*newU[1];
903auto x18 = V{1.5}*x17;
904auto x19 = x18 + V{-1};
905auto x20 = x16 + x19;
906auto x21 = V{0.0277777777777778}*newRho;
907auto x22 = V{3}*newU[1];
908auto x23 = -x22;
909auto x24 = newU[0] - newU[1];
910auto x25 = x24*x24;
911auto x26 = V{3}*newU[0];
912auto x27 = x20 + x26;
913auto x28 = V{0.0277777777777778}*oldRho;
914auto x29 = V{3}*oldU[1];
915auto x30 = -x29;
916auto x31 = oldU[0] - oldU[1];
917auto x32 = x31*x31;
918auto x33 = V{3}*oldU[0];
919auto x34 = x14 + x33;
920auto x35 = V{0.111111111111111}*newRho;
921auto x36 = V{0.111111111111111}*oldRho;
922auto x37 = oldU[0] + oldU[1];
923auto x38 = V{4.5}*(x37*x37);
924auto x39 = newU[0] + newU[1];
925auto x40 = V{4.5}*(x39*x39);
926auto x41 = V{3}*x11;
927auto x42 = V{3}*x17;
928auto x43 = -x16;
929auto x44 = -x18 + x26 + V{1};
930auto x45 = -x10;
931auto x46 = -x12 + x33 + V{1};
932auto x47 = x22 + x43;
933auto x48 = x29 + x45;
934cell[0] = -V{0.444444444444444}*newRho*x20 + V{0.444444444444444}*oldRho*x14 + cell[0];
935cell[1] = x21*(-x23 + V{4.5}*x25 - x27) - x28*(-x30 + V{4.5}*x32 - x34) + cell[1];
936cell[2] = x35*(V{3}*x15 - x19 - x26) - x36*(-x13 - x33 + V{3}*x9) + cell[2];
937cell[3] = -x21*(x22 + x27 - x40) + x28*(x29 + x34 - x38) + cell[3];
938cell[4] = -x35*(x16 + x22 - x42 + V{-1}) + x36*(x10 + x29 - x41 + V{-1}) + cell[4];
939cell[5] = x21*(x23 + V{4.5}*x25 + x43 + x44) - x28*(x30 + V{4.5}*x32 + x45 + x46) + cell[5];
940cell[6] = x35*(V{3}*x15 + x44) - x36*(x46 + V{3}*x9) + cell[6];
941cell[7] = x21*(x40 + x44 + x47) - x28*(x38 + x46 + x48) + cell[7];
942cell[8] = x35*(x42 + x47 + V{1}) - x36*(x41 + x48 + V{1}) + cell[8];
943
944}
945
946template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
947static void defineNEqFromPi(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
948{
949auto x9 = u[0]*u[0];
950auto x10 = V{1.5}*x9;
951auto x11 = u[1]*u[1];
952auto x12 = V{1.5}*x11;
953auto x13 = x12 + V{-1};
954auto x14 = x10 + x13;
955auto x15 = V{0.0277777777777778}*rho;
956auto x16 = V{3}*u[1];
957auto x17 = -x16;
958auto x18 = u[0] - u[1];
959auto x19 = x18*x18;
960auto x20 = V{3}*u[0];
961auto x21 = x14 + x20;
962auto x22 = V{0.25}*pi[1];
963auto x23 = V{0.0833333333333333}*pi[0] + V{0.0833333333333333}*pi[2] + V{-0.0277777777777778};
964auto x24 = -x22 + x23;
965auto x25 = V{0.111111111111111}*rho;
966auto x26 = V{0.333333333333333}*pi[0] - V{0.166666666666667}*pi[2] + V{-0.111111111111111};
967auto x27 = u[0] + u[1];
968auto x28 = V{4.5}*(x27*x27);
969auto x29 = x22 + x23;
970auto x30 = V{0.166666666666667}*pi[0];
971auto x31 = V{3}*x11;
972auto x32 = -x10;
973auto x33 = -x12 + x20 + V{1};
974auto x34 = x16 + x32;
975cell[0] = -V{0.444444444444444}*rho*x14 - V{0.666666666666667}*pi[0] - V{0.666666666666667}*pi[2] + V{-0.444444444444444};
976cell[1] = x15*(-x17 + V{4.5}*x19 - x21) + x24;
977cell[2] = x25*(-x13 - x20 + V{3}*x9) + x26;
978cell[3] = -x15*(x16 + x21 - x28) + x29;
979cell[4] = -x25*(x10 + x16 - x31 + V{-1}) - x30 + V{0.333333333333333}*pi[2] + V{-0.111111111111111};
980cell[5] = x15*(x17 + V{4.5}*x19 + x32 + x33) + x24;
981cell[6] = x25*(x33 + V{3}*x9) + x26;
982cell[7] = x15*(x28 + x33 + x34) + x29;
983cell[8] = x25*(x31 + x34 + V{1}) - x30 + V{0.333333333333333}*pi[2] + V{-0.111111111111111};
984
985}
986
987template <typename CELL, typename FORCE, typename V=typename CELL::value_t>
988static auto computePiNeqNormSqr(CELL& cell, FORCE& force) any_platform
989{
990auto x0 = cell[7] + cell[8];
991auto x1 = cell[2] + cell[3];
992auto x2 = x0 + x1 + cell[0] + cell[1] + cell[4] + cell[5] + cell[6];
993auto x3 = V{1} / (x2 + V{1});
994auto x4 = cell[1] - cell[5];
995auto x5 = x1 + x4 - cell[6] - cell[7];
996auto x6 = x0 + x4 - cell[3] - cell[4];
997auto x7 = x2 + V{1};
998auto x8 = x7*(x5*force[1] - x6*force[0]);
999auto x9 = x3*x7;
1000auto x10 = -V{0.333333333333333}*cell[0] + V{0.666666666666667}*cell[1] + V{0.666666666666667}*cell[3] + V{0.666666666666667}*cell[5] + V{0.666666666666667}*cell[7];
1001auto x11 = x10 - x3*x5*x5 - x5*x9*force[0] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[4] + V{0.666666666666667}*cell[6] - V{0.333333333333333}*cell[8];
1002auto x12 = x10 - x3*x6*x6 + x6*x9*force[1] - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[4] - V{0.333333333333333}*cell[6] + V{0.666666666666667}*cell[8];
1003return (V{1}*x3*x5*x6 - V{0.5}*x3*x8 - V{1}*cell[1] + V{1}*cell[3] - V{1}*cell[5] + V{1}*cell[7])*(V{2}*x3*x5*x6 - V{1}*x3*x8 - V{2}*cell[1] + V{2}*cell[3] - V{2}*cell[5] + V{2}*cell[7]) + x11*x11 + x12*x12;
1004}
1005
1006template <typename CELL, typename V=typename CELL::value_t>
1007static auto computePiNeqNormSqr(CELL& cell) any_platform
1008{
1009auto x0 = cell[1] + cell[8];
1010auto x1 = cell[2] + cell[3];
1011auto x2 = V{1} / (x0 + x1 + cell[0] + cell[4] + cell[5] + cell[6] + cell[7] + V{1});
1012auto x3 = -cell[5];
1013auto x4 = x3 + cell[7];
1014auto x5 = x0 + x4 - cell[3] - cell[4];
1015auto x6 = x1 + x3 + cell[1] - cell[6] - cell[7];
1016auto x7 = -x2*x5*x6 - x4 + cell[1] - cell[3];
1017auto x8 = V{1}*x2;
1018auto x9 = -V{0.333333333333333}*cell[0] + V{0.666666666666667}*cell[1] + V{0.666666666666667}*cell[3] + V{0.666666666666667}*cell[5] + V{0.666666666666667}*cell[7];
1019auto x10 = -x8*x6*x6 + x9 + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[4] + V{0.666666666666667}*cell[6] - V{0.333333333333333}*cell[8];
1020auto x11 = -x8*x5*x5 + x9 - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[4] - V{0.333333333333333}*cell[6] + V{0.666666666666667}*cell[8];
1021return x10*x10 + x11*x11 + V{2}*(x7*x7);
1022}
1023
1024template <typename CELL, typename RHO, typename U, typename OMEGA, typename FORCE, typename V=typename CELL::value_t>
1025static void addExternalForce(CELL& cell, RHO& rho, U& u, OMEGA& omega, FORCE& force) any_platform
1026{
1027auto x9 = force[0]*u[0];
1028auto x10 = force[1]*u[1];
1029auto x11 = rho*(V{0.5}*omega + V{-1});
1030auto x12 = V{9}*u[0];
1031auto x13 = V{6}*u[1];
1032auto x14 = x13 + V{3};
1033auto x15 = V{9}*u[1];
1034auto x16 = V{6}*u[0];
1035auto x17 = V{0.0277777777777778}*x11;
1036auto x18 = x16 + V{-3};
1037auto x19 = V{0.111111111111111}*force[0];
1038auto x20 = -V{0.333333333333333}*x10;
1039auto x21 = x13 + V{-3};
1040auto x22 = V{0.111111111111111}*force[1];
1041auto x23 = -V{0.333333333333333}*x9;
1042auto x24 = x16 + V{3};
1043cell[0] = V{1.33333333333333}*x11*(x10 + x9) + cell[0];
1044cell[1] = -x17*((-x12 + x14)*force[1] - (x15 - x16 + V{3})*force[0]) + cell[1];
1045cell[2] = -x11*(x18*x19 + x20) + cell[2];
1046cell[3] = -x17*((x12 + x21)*force[1] + (x15 + x18)*force[0]) + cell[3];
1047cell[4] = -x11*(x21*x22 + x23) + cell[4];
1048cell[5] = -x17*((-x15 + x24)*force[0] - (x12 - x13 + V{3})*force[1]) + cell[5];
1049cell[6] = -x11*(x19*x24 + x20) + cell[6];
1050cell[7] = -x17*((x12 + x14)*force[1] + (x15 + x24)*force[0]) + cell[7];
1051cell[8] = -x11*(x14*x22 + x23) + cell[8];
1052
1053}
1054
1055};
1056
1057template <typename... FIELDS>
1058struct lbm<descriptors::D3Q7<FIELDS...>> {
1059
1060template <typename CELL, typename V=typename CELL::value_t>
1061static auto computeRho(CELL& cell) any_platform
1062{
1063
1064return cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
1065}
1066
1067template <typename CELL, typename J, typename V=typename CELL::value_t>
1068static void computeJ(CELL& cell, J& j) any_platform
1069{
1070j[0] = -V{1}*cell[1] + V{1}*cell[4];
1071j[1] = -V{1}*cell[2] + V{1}*cell[5];
1072j[2] = -V{1}*cell[3] + V{1}*cell[6];
1073
1074}
1075
1076template <typename CELL, typename RHO, typename U, typename V=typename CELL::value_t>
1077static void computeRhoU(CELL& cell, RHO& rho, U& u) any_platform
1078{
1079auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
1080auto x1 = V{1}/x0;
1081rho = x0;
1082u[0] = -x1*(cell[1] - cell[4]);
1083u[1] = -x1*(cell[2] - cell[5]);
1084u[2] = -x1*(cell[3] - cell[6]);
1085
1086}
1087
1088template <typename CELL, typename RHO, typename J, typename V=typename CELL::value_t>
1089static void computeRhoJ(CELL& cell, RHO& rho, J& j) any_platform
1090{
1091rho = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
1092j[0] = -V{1}*cell[1] + V{1}*cell[4];
1093j[1] = -V{1}*cell[2] + V{1}*cell[5];
1094j[2] = -V{1}*cell[3] + V{1}*cell[6];
1095
1096}
1097
1098template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
1099static void computeStress(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
1100{
1101auto x0 = V{0.25} - V{0.25}*rho;
1102auto x1 = rho*u[0];
1103pi[0] = -rho*u[0]*u[0] + x0 + V{1}*cell[1] + V{1}*cell[4];
1104pi[1] = -x1*u[1];
1105pi[2] = -x1*u[2];
1106pi[3] = -rho*u[1]*u[1] + x0 + V{1}*cell[2] + V{1}*cell[5];
1107pi[4] = -rho*u[1]*u[2];
1108pi[5] = -rho*u[2]*u[2] + x0 + V{1}*cell[3] + V{1}*cell[6];
1109
1110}
1111
1112template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
1113static void computeAllMomenta(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
1114{
1115auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
1116auto x1 = cell[1] - cell[4];
1117auto x2 = V{1}/x0;
1118auto x3 = x1*x2;
1119auto x4 = cell[2] - cell[5];
1120auto x5 = x2*x4;
1121auto x6 = cell[3] - cell[6];
1122auto x7 = V{0.25}*cell[0];
1123auto x8 = x7 + V{0.25}*cell[3] + V{0.25}*cell[6];
1124auto x9 = V{0.25}*cell[2] + V{0.25}*cell[5];
1125auto x20 = V{0.25}*cell[1] + V{0.25}*cell[4];
1126rho = x0;
1127u[0] = -x3;
1128u[1] = -x5;
1129u[2] = -x2*x6;
1130pi[0] = -x2*x1*x1 - x8 - x9 + V{0.75}*cell[1] + V{0.75}*cell[4];
1131pi[1] = -x3*x4;
1132pi[2] = -x3*x6;
1133pi[3] = -x2*x4*x4 - x20 - x8 + V{0.75}*cell[2] + V{0.75}*cell[5];
1134pi[4] = -x5*x6;
1135pi[5] = -x2*x6*x6 - x20 - x7 - x9 + V{0.75}*cell[3] + V{0.75}*cell[6];
1136
1137}
1138
1139template <typename CELL, typename FEQ, typename V=typename CELL::value_t>
1140static void computeFeq(CELL& cell, FEQ& fEq) any_platform
1141{
1142auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6];
1143auto x1 = x0 + V{1};
1144auto x2 = x0 + V{1};
1145auto x3 = V{1} / ((x2)*(x2));
1146auto x4 = V{2}*x3;
1147auto x5 = cell[1] - cell[4];
1148auto x6 = -x5;
1149auto x7 = x6*x6;
1150auto x8 = x4*x7;
1151auto x9 = cell[2] - cell[5];
1152auto x17 = -x9;
1153auto x18 = x17*x17;
1154auto x19 = x18*x4;
1155auto x20 = cell[3] - cell[6];
1156auto x21 = -x20;
1157auto x22 = x21*x21;
1158auto x23 = x22*x4;
1159auto x24 = x19 + x23 + V{-1};
1160auto x25 = V{1} / (x2);
1161auto x26 = V{4}*cell[1] - V{4}*cell[4];
1162auto x27 = V{6}*x3;
1163auto x28 = V{4}*cell[2] - V{4}*cell[5];
1164auto x29 = x8 + V{-1};
1165auto x30 = V{4}*cell[3] - V{4}*cell[6];
1166auto x31 = x9*x9;
1167auto x32 = x31*x4;
1168auto x33 = x5*x5;
1169auto x34 = x20*x20;
1170auto x35 = x34*x4 + V{-1};
1171auto x36 = x33*x4;
1172fEq[0] = -V{0.25}*x1*(x24 + x8) + V{-0.25};
1173fEq[1] = -V{0.125}*x1*(x24 - x25*x26 - x27*x7) + V{-0.125};
1174fEq[2] = -V{0.125}*x1*(-x18*x27 + x23 - x25*x28 + x29) + V{-0.125};
1175fEq[3] = -V{0.125}*x1*(x19 - x22*x27 - x25*x30 + x29) + V{-0.125};
1176fEq[4] = -V{0.125}*x1*(x25*x26 - x27*x33 + x32 + x35) + V{-0.125};
1177fEq[5] = -V{0.125}*x1*(x25*x28 - x27*x31 + x35 + x36) + V{-0.125};
1178fEq[6] = -V{0.125}*x1*(x25*x30 - x27*x34 + x32 + x36 + V{-1}) + V{-0.125};
1179
1180}
1181
1182template <typename CELL, typename FNEQ, typename RHO, typename U, typename V=typename CELL::value_t>
1183static void computeFneq(CELL& cell, FNEQ& fNeq, RHO& rho, U& u) any_platform
1184{
1185auto x0 = u[0]*u[0];
1186auto x1 = V{2}*x0;
1187auto x2 = u[1]*u[1];
1188auto x3 = V{2}*x2;
1189auto x4 = u[2]*u[2];
1190auto x5 = V{2}*x4;
1191auto x6 = x3 + x5 + V{-1};
1192auto x7 = V{0.125}*rho;
1193auto x8 = V{4}*u[0];
1194auto x9 = V{6}*x0;
1195auto x17 = V{4}*u[1];
1196auto x18 = V{6}*x2;
1197auto x19 = x1 + V{-1};
1198auto x20 = V{4}*u[2];
1199auto x21 = V{6}*x4;
1200auto x22 = -x3;
1201auto x23 = V{1} - x5;
1202auto x24 = -x1;
1203fNeq[0] = V{0.25}*rho*(x1 + x6) + cell[0] + V{0.25};
1204fNeq[1] = x7*(x6 + x8 - x9) + cell[1] + V{0.125};
1205fNeq[2] = x7*(x17 - x18 + x19 + x5) + cell[2] + V{0.125};
1206fNeq[3] = x7*(x19 + x20 - x21 + x3) + cell[3] + V{0.125};
1207fNeq[4] = -x7*(x22 + x23 + x8 + x9) + cell[4] + V{0.125};
1208fNeq[5] = -x7*(x17 + x18 + x23 + x24) + cell[5] + V{0.125};
1209fNeq[6] = -x7*(x20 + x21 + x22 + x24 + V{1}) + cell[6] + V{0.125};
1210
1211}
1212
1213template <typename CELL, typename FNEQ, typename V=typename CELL::value_t>
1214static void computeFneq(CELL& cell, FNEQ& fNeq) any_platform
1215{
1216auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
1217auto x1 = V{1} / ((x0)*(x0));
1218auto x2 = V{2}*x1;
1219auto x3 = cell[1] - cell[4];
1220auto x4 = x3*x3;
1221auto x5 = x2*x4;
1222auto x6 = cell[2] - cell[5];
1223auto x7 = x6*x6;
1224auto x8 = x2*x7;
1225auto x9 = cell[3] - cell[6];
1226auto x17 = x9*x9;
1227auto x18 = x17*x2;
1228auto x19 = x18 + x8 + V{-1};
1229auto x20 = V{0.125}*cell[0] + V{0.125}*cell[1] + V{0.125}*cell[2] + V{0.125}*cell[3] + V{0.125}*cell[4] + V{0.125}*cell[5] + V{0.125}*cell[6] + V{0.125};
1230auto x21 = V{1} / (x0);
1231auto x22 = x21*(V{4}*cell[1] - V{4}*cell[4]);
1232auto x23 = V{6}*x1;
1233auto x24 = x23*x4;
1234auto x25 = -V{2}*x1*x7;
1235auto x26 = -V{2}*x1*x17 + V{1};
1236auto x27 = x21*(V{4}*cell[2] - V{4}*cell[5]);
1237auto x28 = x23*x7;
1238auto x29 = -V{2}*x1*x4;
1239auto x30 = x21*(V{4}*cell[3] - V{4}*cell[6]);
1240auto x31 = x17*x23;
1241auto x32 = x5 + V{-1};
1242fNeq[0] = (x19 + x5)*(V{0.25}*cell[0] + V{0.25}*cell[1] + V{0.25}*cell[2] + V{0.25}*cell[3] + V{0.25}*cell[4] + V{0.25}*cell[5] + V{0.25}*cell[6] + V{0.25}) + cell[0] + V{0.25};
1243fNeq[1] = x20*(-x22 - x24 - x25 - x26) + cell[1] + V{0.125};
1244fNeq[2] = x20*(-x26 - x27 - x28 - x29) + cell[2] + V{0.125};
1245fNeq[3] = x20*(-x25 - x29 - x30 - x31 + V{-1}) + cell[3] + V{0.125};
1246fNeq[4] = x20*(x19 + x22 - x24) + cell[4] + V{0.125};
1247fNeq[5] = x20*(x18 + x27 - x28 + x32) + cell[5] + V{0.125};
1248fNeq[6] = x20*(x30 - x31 + x32 + x8) + cell[6] + V{0.125};
1249
1250}
1251
1252template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
1253static auto bgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
1254{
1255auto x7 = omega + V{-1};
1256auto x8 = u[0]*u[0];
1257auto x9 = V{2}*x8;
1258auto x10 = u[1]*u[1];
1259auto x11 = V{2}*x10;
1260auto x12 = u[2]*u[2];
1261auto x13 = V{2}*x12;
1262auto x14 = x11 + x13 + V{-1};
1263auto x15 = V{0.125}*omega;
1264auto x16 = V{4}*u[0];
1265auto x17 = V{6}*x8;
1266auto x18 = V{4}*u[1];
1267auto x19 = V{6}*x10;
1268auto x20 = x9 + V{-1};
1269auto x21 = V{4}*u[2];
1270auto x22 = V{6}*x12;
1271auto x23 = -x11;
1272auto x24 = V{1} - x13;
1273auto x25 = -x9;
1274cell[0] = -V{0.25}*omega*(rho*(x14 + x9) + V{1}) - x7*cell[0];
1275cell[1] = -x15*(rho*(x14 + x16 - x17) + V{1}) - x7*cell[1];
1276cell[2] = -x15*(rho*(x13 + x18 - x19 + x20) + V{1}) - x7*cell[2];
1277cell[3] = -x15*(rho*(x11 + x20 + x21 - x22) + V{1}) - x7*cell[3];
1278cell[4] = x15*(rho*(x16 + x17 + x23 + x24) + V{-1}) - x7*cell[4];
1279cell[5] = x15*(rho*(x18 + x19 + x24 + x25) + V{-1}) - x7*cell[5];
1280cell[6] = x15*(rho*(x21 + x22 + x23 + x25 + V{1}) + V{-1}) - x7*cell[6];
1281return x10 + x12 + x8;
1282}
1283
1284template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
1285static auto adeBgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
1286{
1287auto x7 = omega + V{-1};
1288auto x8 = V{4}*u[0];
1289auto x9 = V{0.125}*omega;
1290auto x10 = V{4}*u[1];
1291auto x11 = V{4}*u[2];
1292cell[0] = V{0.25}*omega*(rho + V{-1}) - x7*cell[0];
1293cell[1] = -x7*cell[1] - x9*(rho*(x8 + V{-1}) + V{1});
1294cell[2] = -x7*cell[2] - x9*(rho*(x10 + V{-1}) + V{1});
1295cell[3] = -x7*cell[3] - x9*(rho*(x11 + V{-1}) + V{1});
1296cell[4] = -x7*cell[4] + x9*(rho*(x8 + V{1}) + V{-1});
1297cell[5] = -x7*cell[5] + x9*(rho*(x10 + V{1}) + V{-1});
1298cell[6] = -x7*cell[6] + x9*(rho*(x11 + V{1}) + V{-1});
1299return u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
1300}
1301
1302template <typename CELL, typename PRESSURE, typename J, typename OMEGA, typename V=typename CELL::value_t>
1303static auto incBgkCollision(CELL& cell, PRESSURE& pressure, J& j, OMEGA& omega) any_platform
1304{
1305auto x7 = j[0]*j[0];
1306auto x8 = j[1]*j[1];
1307auto x9 = j[2]*j[2];
1308auto x10 = omega + V{-1};
1309auto x11 = V{0.25}*x8;
1310auto x12 = V{0.5}*j[0];
1311auto x13 = V{0.75}*x7;
1312auto x14 = V{0.25}*x9;
1313auto x15 = V{0.5}*pressure;
1314auto x16 = -x15;
1315auto x17 = x14 + x16 + V{0.125};
1316auto x18 = V{0.25}*x7;
1317auto x19 = V{0.5}*j[1];
1318auto x20 = V{0.75}*x8;
1319auto x21 = V{0.5}*j[2];
1320auto x22 = V{0.75}*x9;
1321auto x23 = -x11;
1322auto x24 = -x14 + x15 + V{-0.125};
1323auto x25 = -x18;
1324cell[0] = -omega*(-V{1}*pressure + V{0.5}*x7 + V{0.5}*x8 + V{0.5}*x9 + V{0.25}) - x10*cell[0];
1325cell[1] = -omega*(x11 + x12 - x13 + x17) - x10*cell[1];
1326cell[2] = -omega*(x17 + x18 + x19 - x20) - x10*cell[2];
1327cell[3] = -omega*(x11 + x16 + x18 + x21 - x22 + V{0.125}) - x10*cell[3];
1328cell[4] = omega*(x12 + x13 + x23 + x24) - x10*cell[4];
1329cell[5] = omega*(x19 + x20 + x24 + x25) - x10*cell[5];
1330cell[6] = omega*(x15 + x21 + x22 + x23 + x25 + V{-0.125}) - x10*cell[6];
1331return x7 + x8 + x9;
1332}
1333
1334template <typename CELL, typename RHO, typename U, typename RATIORHO, typename OMEGA, typename V=typename CELL::value_t>
1335static auto constRhoBgkCollision(CELL& cell, RHO& rho, U& u, RATIORHO& ratioRho, OMEGA& omega) any_platform
1336{
1337auto x7 = omega + V{-1};
1338auto x8 = V{0.25}*rho;
1339auto x9 = u[0]*u[0];
1340auto x10 = V{2}*x9;
1341auto x11 = u[1]*u[1];
1342auto x12 = V{2}*x11;
1343auto x13 = u[2]*u[2];
1344auto x14 = V{2}*x13;
1345auto x15 = x12 + x14 + V{-1};
1346auto x16 = x10 + x15;
1347auto x17 = V{0.125}*rho;
1348auto x18 = V{4}*u[0];
1349auto x19 = V{6}*x9;
1350auto x20 = x15 + x18 - x19;
1351auto x21 = ratioRho*x17;
1352auto x22 = V{4}*u[1];
1353auto x23 = V{6}*x11;
1354auto x24 = x10 + V{-1};
1355auto x25 = x14 + x22 - x23 + x24;
1356auto x26 = V{4}*u[2];
1357auto x27 = V{6}*x13;
1358auto x28 = x12 + x24 + x26 - x27;
1359auto x29 = -x12;
1360auto x30 = V{1} - x14;
1361auto x31 = x18 + x19 + x29 + x30;
1362auto x32 = -x10;
1363auto x33 = x22 + x23 + x30 + x32;
1364auto x34 = x26 + x27 + x29 + x32 + V{1};
1365cell[0] = -ratioRho*x16*x8 - x7*(x16*x8 + cell[0] + V{0.25}) + V{-0.25};
1366cell[1] = -x20*x21 - x7*(x17*x20 + cell[1] + V{0.125}) + V{-0.125};
1367cell[2] = -x21*x25 - x7*(x17*x25 + cell[2] + V{0.125}) + V{-0.125};
1368cell[3] = -x21*x28 - x7*(x17*x28 + cell[3] + V{0.125}) + V{-0.125};
1369cell[4] = V{0.125}*ratioRho*rho*x31 - x7*(-x17*x31 + cell[4] + V{0.125}) + V{-0.125};
1370cell[5] = V{0.125}*ratioRho*rho*x33 - x7*(-x17*x33 + cell[5] + V{0.125}) + V{-0.125};
1371cell[6] = V{0.125}*ratioRho*rho*x34 - x7*(-x17*x34 + cell[6] + V{0.125}) + V{-0.125};
1372return x11 + x13 + x9;
1373}
1374
1375template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
1376static auto rlbCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
1377{
1378auto x7 = omega + V{-1};
1379auto x8 = V{0.5}*cell[1];
1380auto x9 = V{4}*u[0];
1381auto x10 = x9 + V{-1};
1382auto x11 = V{0.0625}*rho;
1383auto x12 = x9 + V{1};
1384auto x13 = x11*x12;
1385auto x14 = V{0.125}*rho;
1386auto x15 = V{0.5}*cell[2];
1387auto x16 = V{4}*u[1];
1388auto x17 = x16 + V{-1};
1389auto x18 = x16 + V{1};
1390auto x19 = x11*x18;
1391auto x20 = V{0.5}*cell[3];
1392auto x21 = V{4}*u[2];
1393auto x22 = x21 + V{-1};
1394auto x23 = x21 + V{1};
1395auto x24 = x11*x23;
1396cell[0] = V{0.25}*rho + V{-0.25};
1397cell[1] = -x10*x14 + x7*(-x10*x11 - x13 - x8 + V{0.5}*cell[4]) + V{-0.125};
1398cell[2] = -x14*x17 + x7*(-x11*x17 - x15 - x19 + V{0.5}*cell[5]) + V{-0.125};
1399cell[3] = -x14*x22 + x7*(-x11*x22 - x20 - x24 + V{0.5}*cell[6]) + V{-0.125};
1400cell[4] = V{0.125}*rho*x12 - x7*(-x10*x11 - x13 - x8 + V{0.5}*cell[4]) + V{-0.125};
1401cell[5] = V{0.125}*rho*x18 - x7*(-x11*x17 - x15 - x19 + V{0.5}*cell[5]) + V{-0.125};
1402cell[6] = V{0.125}*rho*x23 - x7*(-x11*x22 - x20 - x24 + V{0.5}*cell[6]) + V{-0.125};
1403return u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
1404}
1405
1406template <typename CELL, typename RHO, typename U, typename PI, typename OMEGA, typename V=typename CELL::value_t>
1407static auto rlbCollision(CELL& cell, RHO& rho, U& u, PI& pi, OMEGA& omega) any_platform
1408{
1409auto x7 = u[0]*u[0];
1410auto x8 = V{2}*x7;
1411auto x9 = u[1]*u[1];
1412auto x10 = V{2}*x9;
1413auto x11 = u[2]*u[2];
1414auto x12 = V{2}*x11;
1415auto x13 = x10 + x12 + V{-1};
1416auto x14 = omega + V{-1};
1417auto x15 = V{0.25}*pi[3];
1418auto x16 = V{0.25}*pi[5];
1419auto x17 = x15 + x16 - V{0.75}*pi[0];
1420auto x18 = V{0.125}*rho;
1421auto x19 = V{4}*u[0];
1422auto x20 = V{6}*x7;
1423auto x21 = V{0.25}*pi[0];
1424auto x22 = x16 + x21 - V{0.75}*pi[3];
1425auto x23 = V{4}*u[1];
1426auto x24 = V{6}*x9;
1427auto x25 = x8 + V{-1};
1428auto x26 = x15 + x21 - V{0.75}*pi[5];
1429auto x27 = V{4}*u[2];
1430auto x28 = V{6}*x11;
1431auto x29 = -x10;
1432auto x30 = V{1} - x12;
1433auto x31 = -x8;
1434cell[0] = -V{0.25}*rho*(x13 + x8) + V{0.5}*x14*(pi[0] + pi[3] + pi[5]) + V{-0.25};
1435cell[1] = x14*x17 - x18*(x13 + x19 - x20) + V{-0.125};
1436cell[2] = x14*x22 - x18*(x12 + x23 - x24 + x25) + V{-0.125};
1437cell[3] = x14*x26 - x18*(x10 + x25 + x27 - x28) + V{-0.125};
1438cell[4] = x14*x17 + x18*(x19 + x20 + x29 + x30) + V{-0.125};
1439cell[5] = x14*x22 + x18*(x23 + x24 + x30 + x31) + V{-0.125};
1440cell[6] = x14*x26 + x18*(x27 + x28 + x29 + x31 + V{1}) + V{-0.125};
1441return x11 + x7 + x9;
1442}
1443
1444template <typename CELL, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
1445static void defineEqFirstOrder(CELL& cell, NEWRHO& newRho, NEWU& newU) any_platform
1446{
1447auto x7 = V{4}*newU[0];
1448auto x8 = V{4}*newU[1];
1449auto x9 = V{4}*newU[2];
1450cell[0] = V{0.25}*newRho + V{-0.25};
1451cell[1] = -V{0.125}*newRho*(x7 + V{-1}) + V{-0.125};
1452cell[2] = -V{0.125}*newRho*(x8 + V{-1}) + V{-0.125};
1453cell[3] = -V{0.125}*newRho*(x9 + V{-1}) + V{-0.125};
1454cell[4] = V{0.125}*newRho*(x7 + V{1}) + V{-0.125};
1455cell[5] = V{0.125}*newRho*(x8 + V{1}) + V{-0.125};
1456cell[6] = V{0.125}*newRho*(x9 + V{1}) + V{-0.125};
1457
1458}
1459
1460template <typename CELL, typename OLDRHO, typename OLDU, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
1461static void defineNEq(CELL& cell, OLDRHO& oldRho, OLDU& oldU, NEWRHO& newRho, NEWU& newU) any_platform
1462{
1463auto x7 = oldU[0]*oldU[0];
1464auto x8 = V{2}*x7;
1465auto x9 = oldU[1]*oldU[1];
1466auto x10 = V{2}*x9;
1467auto x11 = oldU[2]*oldU[2];
1468auto x12 = V{2}*x11;
1469auto x13 = x10 + x12 + V{-1};
1470auto x14 = newU[0]*newU[0];
1471auto x15 = V{2}*x14;
1472auto x16 = newU[1]*newU[1];
1473auto x17 = V{2}*x16;
1474auto x18 = newU[2]*newU[2];
1475auto x19 = V{2}*x18;
1476auto x20 = x17 + x19 + V{-1};
1477auto x21 = V{0.125}*oldRho;
1478auto x22 = V{4}*oldU[0];
1479auto x23 = V{6}*x7;
1480auto x24 = V{0.125}*newRho;
1481auto x25 = V{4}*newU[0];
1482auto x26 = V{6}*x14;
1483auto x27 = V{4}*oldU[1];
1484auto x28 = V{6}*x9;
1485auto x29 = x8 + V{-1};
1486auto x30 = V{4}*newU[1];
1487auto x31 = V{6}*x16;
1488auto x32 = x15 + V{-1};
1489auto x33 = V{4}*oldU[2];
1490auto x34 = V{6}*x11;
1491auto x35 = V{4}*newU[2];
1492auto x36 = V{6}*x18;
1493auto x37 = -x17;
1494auto x38 = V{1} - x19;
1495auto x39 = -x10;
1496auto x40 = V{1} - x12;
1497auto x41 = -x15;
1498auto x42 = -x8;
1499cell[0] = -V{0.25}*newRho*(x15 + x20) + V{0.25}*oldRho*(x13 + x8) + cell[0];
1500cell[1] = x21*(x13 + x22 - x23) - x24*(x20 + x25 - x26) + cell[1];
1501cell[2] = x21*(x12 + x27 - x28 + x29) - x24*(x19 + x30 - x31 + x32) + cell[2];
1502cell[3] = x21*(x10 + x29 + x33 - x34) - x24*(x17 + x32 + x35 - x36) + cell[3];
1503cell[4] = -x21*(x22 + x23 + x39 + x40) + x24*(x25 + x26 + x37 + x38) + cell[4];
1504cell[5] = -x21*(x27 + x28 + x40 + x42) + x24*(x30 + x31 + x38 + x41) + cell[5];
1505cell[6] = -x21*(x33 + x34 + x39 + x42 + V{1}) + x24*(x35 + x36 + x37 + x41 + V{1}) + cell[6];
1506
1507}
1508
1509template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
1510static void defineNEqFromPi(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
1511{
1512auto x7 = u[0]*u[0];
1513auto x8 = V{2}*x7;
1514auto x9 = u[1]*u[1];
1515auto x10 = V{2}*x9;
1516auto x11 = u[2]*u[2];
1517auto x12 = V{2}*x11;
1518auto x13 = x10 + x12 + V{-1};
1519auto x14 = V{0.125}*rho;
1520auto x15 = V{4}*u[0];
1521auto x16 = V{6}*x7;
1522auto x17 = V{0.25}*pi[3];
1523auto x18 = V{0.25}*pi[5] + V{0.125};
1524auto x19 = x17 + x18 - V{0.75}*pi[0];
1525auto x20 = V{4}*u[1];
1526auto x21 = V{6}*x9;
1527auto x22 = x8 + V{-1};
1528auto x23 = V{0.25}*pi[0];
1529auto x24 = x18 + x23 - V{0.75}*pi[3];
1530auto x25 = V{4}*u[2];
1531auto x26 = V{6}*x11;
1532auto x27 = x17 + x23 - V{0.75}*pi[5] + V{0.125};
1533auto x28 = -x10;
1534auto x29 = V{1} - x12;
1535auto x30 = -x8;
1536cell[0] = -V{0.25}*rho*(x13 + x8) - V{0.5}*pi[0] - V{0.5}*pi[3] - V{0.5}*pi[5] + V{-0.25};
1537cell[1] = -x14*(x13 + x15 - x16) - x19;
1538cell[2] = -x14*(x12 + x20 - x21 + x22) - x24;
1539cell[3] = -x14*(x10 + x22 + x25 - x26) - x27;
1540cell[4] = V{0.125}*rho*(x15 + x16 + x28 + x29) - x19;
1541cell[5] = V{0.125}*rho*(x20 + x21 + x29 + x30) - x24;
1542cell[6] = V{0.125}*rho*(x25 + x26 + x28 + x30 + V{1}) - x27;
1543
1544}
1545
1546template <typename CELL, typename FORCE, typename V=typename CELL::value_t>
1547static auto computePiNeqNormSqr(CELL& cell, FORCE& force) any_platform
1548{
1549auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6];
1550auto x1 = x0 + V{1};
1551auto x2 = V{1} / ((x1)*(x1));
1552auto x3 = cell[1] - cell[4];
1553auto x4 = cell[3] - cell[6];
1554auto x5 = x0 + V{1};
1555auto x6 = V{0.5}*x5;
1556auto x7 = V{1}*x3;
1557auto x8 = x4*x7 + x6*(x3*force[2] + x4*force[0]);
1558auto x9 = cell[2] - cell[5];
1559auto x10 = x3*force[1] + x9*force[0];
1560auto x11 = V{1}*x5;
1561auto x12 = V{2}*x9;
1562auto x13 = x4*force[1] + x9*force[2];
1563auto x14 = V{1} / (x1);
1564auto x15 = x14*x5;
1565auto x16 = V{0.25}*cell[0];
1566auto x17 = x16 + V{0.25}*cell[1] + V{0.25}*cell[4];
1567auto x18 = V{0.25}*cell[2] + V{0.25}*cell[5];
1568auto x19 = x14*(x4*x4) + x15*x4*force[2] + x17 + x18 - V{0.75}*cell[3] - V{0.75}*cell[6];
1569auto x20 = V{0.25}*cell[3] + V{0.25}*cell[6];
1570auto x21 = x14*(x9*x9) + x15*x9*force[1] + x17 + x20 - V{0.75}*cell[2] - V{0.75}*cell[5];
1571auto x22 = x14*(x3*x3) + x15*x3*force[0] + x16 + x18 + x20 - V{0.75}*cell[1] - V{0.75}*cell[4];
1572return x2*(x10*x11 + x12*x3)*(x10*x6 + x7*x9) + x2*(x11*x13 + x12*x4)*(x13*x6 + V{1}*x4*x9) + 2*x2*(x8*x8) + x19*x19 + x21*x21 + x22*x22;
1573}
1574
1575template <typename CELL, typename V=typename CELL::value_t>
1576static auto computePiNeqNormSqr(CELL& cell) any_platform
1577{
1578auto x0 = cell[0] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + V{1};
1579auto x1 = V{2}/((x0)*(x0));
1580auto x2 = cell[1] - cell[4];
1581auto x3 = x2*x2;
1582auto x4 = cell[2] - cell[5];
1583auto x5 = x4*x4;
1584auto x6 = cell[3] - cell[6];
1585auto x7 = x6*x6;
1586auto x8 = V{1}/x0;
1587auto x9 = V{0.25}*cell[0];
1588auto x10 = x9 + V{0.25}*cell[1] + V{0.25}*cell[4];
1589auto x11 = V{0.25}*cell[2] + V{0.25}*cell[5];
1590auto x12 = x10 + x11 + x7*x8 - V{0.75}*cell[3] - V{0.75}*cell[6];
1591auto x13 = V{0.25}*cell[3] + V{0.25}*cell[6];
1592auto x14 = x10 + x13 + x5*x8 - V{0.75}*cell[2] - V{0.75}*cell[5];
1593auto x15 = x11 + x13 + x3*x8 + x9 - V{0.75}*cell[1] - V{0.75}*cell[4];
1594return x1*x3*x5 + x1*x3*x7 + x1*x5*x7 + x12*x12 + x14*x14 + x15*x15;
1595}
1596
1597template <typename CELL, typename RHO, typename U, typename OMEGA, typename FORCE, typename V=typename CELL::value_t>
1598static void addExternalForce(CELL& cell, RHO& rho, U& u, OMEGA& omega, FORCE& force) any_platform
1599{
1600auto x7 = force[0]*u[0];
1601auto x8 = force[1]*u[1];
1602auto x9 = force[2]*u[2];
1603auto x10 = rho*(V{0.5}*omega + V{-1});
1604auto x11 = V{12}*u[0];
1605auto x12 = V{0.125}*force[0];
1606auto x13 = V{0.5}*x8;
1607auto x14 = V{0.5}*x9;
1608auto x15 = x13 + x14;
1609auto x16 = V{12}*u[1];
1610auto x17 = V{0.125}*force[1];
1611auto x18 = V{0.5}*x7;
1612auto x19 = x14 + x18;
1613auto x20 = V{12}*u[2];
1614auto x21 = V{0.125}*force[2];
1615auto x22 = x13 + x18;
1616cell[0] = V{1}*x10*(x7 + x8 + x9) + cell[0];
1617cell[1] = x10*(-x12*(x11 + V{-4}) + x15) + cell[1];
1618cell[2] = x10*(-x17*(x16 + V{-4}) + x19) + cell[2];
1619cell[3] = x10*(-x21*(x20 + V{-4}) + x22) + cell[3];
1620cell[4] = x10*(-x12*(x11 + V{4}) + x15) + cell[4];
1621cell[5] = x10*(-x17*(x16 + V{4}) + x19) + cell[5];
1622cell[6] = x10*(-x21*(x20 + V{4}) + x22) + cell[6];
1623
1624}
1625
1626};
1627
1628template <typename... FIELDS>
1629struct lbm<descriptors::D3Q19<FIELDS...>> {
1630
1631template <typename CELL, typename V=typename CELL::value_t>
1632static auto computeRho(CELL& cell) any_platform
1633{
1634
1635return cell[0] + cell[10] + cell[11] + cell[12] + cell[13] + cell[14] + cell[15] + cell[16] + cell[17] + cell[18] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7] + cell[8] + cell[9] + V{1};
1636}
1637
1638template <typename CELL, typename J, typename V=typename CELL::value_t>
1639static void computeJ(CELL& cell, J& j) any_platform
1640{
1641auto x0 = cell[13] - cell[4];
1642auto x1 = cell[15] - cell[6];
1643auto x2 = cell[17] - cell[8];
1644j[0] = V{1}*x0 + V{1}*x1 + V{1}*cell[10] + V{1}*cell[14] + V{1}*cell[16] - V{1}*cell[1] - V{1}*cell[5] - V{1}*cell[7];
1645j[1] = V{1}*x0 + V{1}*x2 + V{1}*cell[11] - V{1}*cell[14] + V{1}*cell[18] - V{1}*cell[2] + V{1}*cell[5] - V{1}*cell[9];
1646j[2] = V{1}*x1 + V{1}*x2 + V{1}*cell[12] - V{1}*cell[16] - V{1}*cell[18] - V{1}*cell[3] + V{1}*cell[7] + V{1}*cell[9];
1647
1648}
1649
1650template <typename CELL, typename RHO, typename U, typename V=typename CELL::value_t>
1651static void computeRhoU(CELL& cell, RHO& rho, U& u) any_platform
1652{
1653auto x0 = cell[10] + cell[14] + cell[16];
1654auto x1 = cell[11] + cell[18] + cell[5];
1655auto x2 = cell[12] + cell[7] + cell[9];
1656auto x3 = x0 + x1 + x2 + cell[0] + cell[13] + cell[15] + cell[17] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[8] + V{1};
1657auto x4 = cell[13] - cell[4];
1658auto x5 = cell[15] - cell[6];
1659auto x6 = V{1}/x3;
1660auto x7 = cell[17] - cell[8];
1661rho = x3;
1662u[0] = x6*(x0 + x4 + x5 - cell[1] - cell[5] - cell[7]);
1663u[1] = x6*(x1 + x4 + x7 - cell[14] - cell[2] - cell[9]);
1664u[2] = x6*(x2 + x5 + x7 - cell[16] - cell[18] - cell[3]);
1665
1666}
1667
1668template <typename CELL, typename RHO, typename J, typename V=typename CELL::value_t>
1669static void computeRhoJ(CELL& cell, RHO& rho, J& j) any_platform
1670{
1671auto x0 = cell[10] + cell[14] + cell[16];
1672auto x1 = cell[11] + cell[18] + cell[5];
1673auto x2 = cell[12] + cell[7] + cell[9];
1674auto x3 = cell[13] - cell[4];
1675auto x4 = cell[15] - cell[6];
1676auto x5 = cell[17] - cell[8];
1677rho = x0 + x1 + x2 + cell[0] + cell[13] + cell[15] + cell[17] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[8] + V{1};
1678j[0] = V{1}*x0 + V{1}*x3 + V{1}*x4 - V{1}*cell[1] - V{1}*cell[5] - V{1}*cell[7];
1679j[1] = V{1}*x1 + V{1}*x3 + V{1}*x5 - V{1}*cell[14] - V{1}*cell[2] - V{1}*cell[9];
1680j[2] = V{1}*x2 + V{1}*x4 + V{1}*x5 - V{1}*cell[16] - V{1}*cell[18] - V{1}*cell[3];
1681
1682}
1683
1684template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
1685static void computeStress(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
1686{
1687auto x0 = -V{0.333333333333333}*rho;
1688auto x1 = V{1}*cell[14] + V{1}*cell[5];
1689auto x2 = x0 + x1 + V{1}*cell[13] + V{1}*cell[4] + V{0.333333333333333};
1690auto x3 = V{1}*cell[16] + V{1}*cell[7];
1691auto x4 = x3 + V{1}*cell[15] + V{1}*cell[6];
1692auto x5 = rho*u[0];
1693auto x6 = V{1}*cell[18] + V{1}*cell[9];
1694auto x7 = x6 + V{1}*cell[17] + V{1}*cell[8];
1695pi[0] = -rho*u[0]*u[0] + x2 + x4 + V{1}*cell[10] + V{1}*cell[1];
1696pi[1] = -x1 - x5*u[1] + V{1}*cell[13] + V{1}*cell[4];
1697pi[2] = -x3 - x5*u[2] + V{1}*cell[15] + V{1}*cell[6];
1698pi[3] = -rho*u[1]*u[1] + x2 + x7 + V{1}*cell[11] + V{1}*cell[2];
1699pi[4] = -rho*u[1]*u[2] - x6 + V{1}*cell[17] + V{1}*cell[8];
1700pi[5] = -rho*u[2]*u[2] + x0 + x4 + x7 + V{1}*cell[12] + V{1}*cell[3] + V{0.333333333333333};
1701
1702}
1703
1704template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
1705static void computeAllMomenta(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
1706{
1707auto x0 = cell[10] + cell[13] + cell[15];
1708auto x1 = cell[11] + cell[17] + cell[5];
1709auto x2 = cell[12] + cell[7] + cell[9];
1710auto x3 = x0 + x1 + x2 + cell[0] + cell[14] + cell[16] + cell[18] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[8] + V{1};
1711auto x4 = -cell[4];
1712auto x5 = x4 + cell[14];
1713auto x6 = -cell[6];
1714auto x7 = x6 + cell[16];
1715auto x8 = x0 + x5 + x7 - cell[1] - cell[5] - cell[7];
1716auto x9 = V{1} / (x3);
1717auto x10 = V{1}*x9;
1718auto x11 = -cell[8];
1719auto x12 = x11 + cell[18];
1720auto x13 = x1 + x12 + x4 + cell[13] - cell[14] - cell[2] - cell[9];
1721auto x14 = x11 + x2 + x6 + cell[15] - cell[16] + cell[17] - cell[18] - cell[3];
1722auto x15 = V{0.333333333333333}*cell[0];
1723auto x16 = x15 + V{0.333333333333333}*cell[12] - V{0.666666666666667}*cell[13] - V{0.666666666666667}*cell[14] + V{0.333333333333333}*cell[3] - V{0.666666666666667}*cell[4] - V{0.666666666666667}*cell[5];
1724auto x17 = V{0.333333333333333}*cell[11] - V{0.666666666666667}*cell[15] - V{0.666666666666667}*cell[16] + V{0.333333333333333}*cell[2] - V{0.666666666666667}*cell[6] - V{0.666666666666667}*cell[7];
1725auto x18 = x8*x9;
1726auto x19 = V{0.333333333333333}*cell[10] - V{0.666666666666667}*cell[17] - V{0.666666666666667}*cell[18] + V{0.333333333333333}*cell[1] - V{0.666666666666667}*cell[8] - V{0.666666666666667}*cell[9];
1727rho = x3;
1728u[0] = x10*x8;
1729u[1] = x10*x13;
1730u[2] = x10*x14;
1731pi[0] = -x10*x8*x8 - x16 - x17 + V{0.666666666666667}*cell[10] - V{0.333333333333333}*cell[17] - V{0.333333333333333}*cell[18] + V{0.666666666666667}*cell[1] - V{0.333333333333333}*cell[8] - V{0.333333333333333}*cell[9];
1732pi[1] = -V{1}*x13*x18 - V{1}*x5 + V{1}*cell[13] - V{1}*cell[5];
1733pi[2] = -V{1}*x14*x18 - V{1}*x7 + V{1}*cell[15] - V{1}*cell[7];
1734pi[3] = -x10*x13*x13 - x16 - x19 + V{0.666666666666667}*cell[11] - V{0.333333333333333}*cell[15] - V{0.333333333333333}*cell[16] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[6] - V{0.333333333333333}*cell[7];
1735pi[4] = -V{1}*x12 - V{1}*x13*x14*x9 + V{1}*cell[17] - V{1}*cell[9];
1736pi[5] = -x10*x14*x14 - x15 - x17 - x19 + V{0.666666666666667}*cell[12] - V{0.333333333333333}*cell[13] - V{0.333333333333333}*cell[14] + V{0.666666666666667}*cell[3] - V{0.333333333333333}*cell[4] - V{0.333333333333333}*cell[5];
1737
1738}
1739
1740template <typename CELL, typename FEQ, typename V=typename CELL::value_t>
1741static void computeFeq(CELL& cell, FEQ& fEq) any_platform
1742{
1743auto x0 = cell[10] + cell[14];
1744auto x1 = cell[12] + cell[7];
1745auto x2 = x0 + x1 + cell[0] + cell[11] + cell[13] + cell[15] + cell[16] + cell[17] + cell[18] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[8] + cell[9];
1746auto x3 = x2 + V{1};
1747auto x4 = x2 + V{1};
1748auto x5 = V{1} / ((x4)*(x4));
1749auto x6 = V{1.5}*x5;
1750auto x7 = cell[13] - cell[4];
1751auto x8 = cell[15] - cell[6];
1752auto x9 = x7 + x8;
1753auto x10 = -cell[1];
1754auto x11 = cell[16] - cell[7];
1755auto x12 = x10 + x11;
1756auto x13 = x0 - cell[5];
1757auto x14 = x12 + x13 + x9;
1758auto x15 = x14*x14;
1759auto x16 = x15*x6;
1760auto x17 = cell[17] - cell[8];
1761auto x18 = x17 + x7;
1762auto x19 = cell[18] - cell[9];
1763auto x20 = -cell[2];
1764auto x21 = x20 + cell[11] - cell[14] + cell[5];
1765auto x41 = x18 + x19 + x21;
1766auto x42 = x41*x41;
1767auto x43 = x42*x6;
1768auto x44 = x17 + x8;
1769auto x45 = -cell[3];
1770auto x46 = -cell[18] + cell[9];
1771auto x47 = x45 + x46;
1772auto x48 = x1 - cell[16];
1773auto x49 = x44 + x47 + x48;
1774auto x50 = x49*x49;
1775auto x51 = x50*x6;
1776auto x52 = x43 + x51 + V{-1};
1777auto x53 = x16 + x52;
1778auto x54 = V{1} / (x4);
1779auto x55 = V{3}*cell[14];
1780auto x56 = V{3}*cell[16];
1781auto x57 = V{3}*cell[5];
1782auto x58 = V{3}*cell[7];
1783auto x59 = V{3}*cell[13] - V{3}*cell[4];
1784auto x60 = V{3}*cell[15] - V{3}*cell[6];
1785auto x61 = x54*(x55 + x56 - x57 - x58 + x59 + x60 + V{3}*cell[10] - V{3}*cell[1]);
1786auto x62 = V{3}*x5;
1787auto x63 = x15*x62;
1788auto x64 = V{3}*cell[18];
1789auto x65 = V{3}*cell[9];
1790auto x66 = V{3}*cell[17] - V{3}*cell[8];
1791auto x67 = x54*(-x55 + x57 + x59 + x64 - x65 + x66 + V{3}*cell[11] - V{3}*cell[2]);
1792auto x68 = x42*x62;
1793auto x69 = x16 + V{-1};
1794auto x70 = x54*(-x56 + x58 + x60 - x64 + x65 + x66 + V{3}*cell[12] - V{3}*cell[3]);
1795auto x71 = x50*x62;
1796auto x72 = V{4.5}*x5;
1797auto x73 = x12 + cell[10];
1798auto x74 = x19 + x20 + x44 + x73 + cell[11] + V{2}*cell[13] - V{2}*cell[4];
1799auto x75 = x72*(x74*x74);
1800auto x76 = x53 + x61;
1801auto x77 = -x67;
1802auto x78 = -cell[17] + cell[8];
1803auto x79 = x46 + x73 + x78 + x8 - cell[11] + V{2}*cell[14] + cell[2] - V{2}*cell[5];
1804auto x80 = -x79;
1805auto x81 = x10 + x13;
1806auto x82 = x18 + x47 + x81 + cell[12] + V{2}*cell[15] - V{2}*cell[6];
1807auto x83 = x72*(x82*x82);
1808auto x84 = -x70;
1809auto x85 = x7 - cell[12] + cell[3];
1810auto x86 = x19 + x78 + x81 + x85 + V{2}*cell[16] - V{2}*cell[7];
1811auto x87 = -x86;
1812auto x88 = x21 + x45 + x48 + x9 + V{2}*cell[17] - V{2}*cell[8];
1813auto x89 = x72*(x88*x88);
1814auto x90 = x53 + x67;
1815auto x91 = x11 + x21 + x85 - cell[15] + V{2}*cell[18] + cell[6] - V{2}*cell[9];
1816auto x92 = -x91;
1817auto x93 = -x43;
1818auto x94 = V{1} - x51;
1819auto x95 = x93 + x94;
1820auto x96 = x61 + x95;
1821auto x97 = -x16;
1822auto x98 = x67 + x97;
1823auto x99 = x70 + x97;
1824auto x100 = -x61;
1825auto x101 = x53 + x70;
1826fEq[0] = -V{0.333333333333333}*x3*x53 + V{-0.333333333333333};
1827fEq[1] = -V{0.0555555555555556}*x3*(x52 + x61 - x63) + V{-0.0555555555555556};
1828fEq[2] = -V{0.0555555555555556}*x3*(x51 + x67 - x68 + x69) + V{-0.0555555555555556};
1829fEq[3] = -V{0.0555555555555556}*x3*(x43 + x69 + x70 - x71) + V{-0.0555555555555556};
1830fEq[4] = -V{0.0277777777777778}*x3*(x67 - x75 + x76) + V{-0.0277777777777778};
1831fEq[5] = -V{0.0277777777777778}*(x3*(-x72*x80*x80 + x76 + x77) + V{1});
1832fEq[6] = -V{0.0277777777777778}*x3*(x70 + x76 - x83) + V{-0.0277777777777778};
1833fEq[7] = -V{0.0277777777777778}*(x3*(-x72*x87*x87 + x76 + x84) + V{1});
1834fEq[8] = -V{0.0277777777777778}*x3*(x70 - x89 + x90) + V{-0.0277777777777778};
1835fEq[9] = -V{0.0277777777777778}*(x3*(-x72*x92*x92 + x84 + x90) + V{1});
1836fEq[10] = V{0.0555555555555556}*x3*(x63 + x96) + V{-0.0555555555555556};
1837fEq[11] = V{0.0555555555555556}*x3*(x68 + x94 + x98) + V{-0.0555555555555556};
1838fEq[12] = V{0.0555555555555556}*x3*(x71 + x93 + x99 + V{1}) + V{-0.0555555555555556};
1839fEq[13] = V{0.0277777777777778}*x3*(x75 + x96 + x98) + V{-0.0277777777777778};
1840fEq[14] = -V{0.0277777777777778}*(x3*(x100 - x72*x79*x79 + x90) + V{1});
1841fEq[15] = V{0.0277777777777778}*x3*(x83 + x96 + x99) + V{-0.0277777777777778};
1842fEq[16] = -V{0.0277777777777778}*(x3*(x100 + x101 - x72*x86*x86) + V{1});
1843fEq[17] = V{0.0277777777777778}*x3*(x70 + x89 + x95 + x98) + V{-0.0277777777777778};
1844fEq[18] = -V{0.0277777777777778}*(x3*(x101 - x72*x91*x91 + x77) + V{1});
1845
1846}
1847
1848template <typename CELL, typename FNEQ, typename RHO, typename U, typename V=typename CELL::value_t>
1849static void computeFneq(CELL& cell, FNEQ& fNeq, RHO& rho, U& u) any_platform
1850{
1851auto x0 = u[0]*u[0];
1852auto x1 = V{1.5}*x0;
1853auto x2 = u[1]*u[1];
1854auto x3 = V{1.5}*x2;
1855auto x4 = u[2]*u[2];
1856auto x5 = V{1.5}*x4;
1857auto x6 = x3 + x5 + V{-1};
1858auto x7 = x1 + x6;
1859auto x8 = V{0.0555555555555556}*rho;
1860auto x9 = V{3}*u[0];
1861auto x10 = V{3}*x0;
1862auto x11 = V{3}*u[1];
1863auto x12 = V{3}*x2;
1864auto x13 = x1 + V{-1};
1865auto x14 = V{3}*u[2];
1866auto x15 = V{3}*x4;
1867auto x16 = V{0.0277777777777778}*rho;
1868auto x17 = u[0] + u[1];
1869auto x18 = V{4.5}*(x17*x17);
1870auto x19 = x7 + x9;
1871auto x20 = -x11;
1872auto x21 = u[0] - u[1];
1873auto x41 = -V{4.5}*x21*x21;
1874auto x42 = u[0] + u[2];
1875auto x43 = V{4.5}*(x42*x42);
1876auto x44 = -x14;
1877auto x45 = -u[2];
1878auto x46 = x45 + u[0];
1879auto x47 = -V{4.5}*x46*x46;
1880auto x48 = u[1] + u[2];
1881auto x49 = V{4.5}*(x48*x48);
1882auto x50 = x11 + x7;
1883auto x51 = x45 + u[1];
1884auto x52 = -V{4.5}*x51*x51;
1885auto x53 = -x3;
1886auto x54 = V{1} - x5;
1887auto x55 = x53 + x54;
1888auto x56 = x55 + x9;
1889auto x57 = -x1;
1890auto x58 = x11 + x57;
1891auto x59 = x14 + x57;
1892auto x60 = -x9;
1893auto x61 = x14 + x7;
1894fNeq[0] = V{0.333333333333333}*rho*x7 + cell[0] + V{0.333333333333333};
1895fNeq[1] = x8*(-x10 + x6 + x9) + cell[1] + V{0.0555555555555556};
1896fNeq[2] = x8*(x11 - x12 + x13 + x5) + cell[2] + V{0.0555555555555556};
1897fNeq[3] = x8*(x13 + x14 - x15 + x3) + cell[3] + V{0.0555555555555556};
1898fNeq[4] = x16*(x11 - x18 + x19) + cell[4] + V{0.0277777777777778};
1899fNeq[5] = x16*(x19 + x20 + x41) + cell[5] + V{0.0277777777777778};
1900fNeq[6] = x16*(x14 + x19 - x43) + cell[6] + V{0.0277777777777778};
1901fNeq[7] = x16*(x19 + x44 + x47) + cell[7] + V{0.0277777777777778};
1902fNeq[8] = x16*(x14 - x49 + x50) + cell[8] + V{0.0277777777777778};
1903fNeq[9] = x16*(x44 + x50 + x52) + cell[9] + V{0.0277777777777778};
1904fNeq[10] = -x8*(x10 + x56) + cell[10] + V{0.0555555555555556};
1905fNeq[11] = -x8*(x12 + x54 + x58) + cell[11] + V{0.0555555555555556};
1906fNeq[12] = -x8*(x15 + x53 + x59 + V{1}) + cell[12] + V{0.0555555555555556};
1907fNeq[13] = -x16*(x18 + x56 + x58) + cell[13] + V{0.0277777777777778};
1908fNeq[14] = x16*(x41 + x50 + x60) + cell[14] + V{0.0277777777777778};
1909fNeq[15] = -x16*(x43 + x56 + x59) + cell[15] + V{0.0277777777777778};
1910fNeq[16] = x16*(x47 + x60 + x61) + cell[16] + V{0.0277777777777778};
1911fNeq[17] = -x16*(x14 + x49 + x55 + x58) + cell[17] + V{0.0277777777777778};
1912fNeq[18] = x16*(x20 + x52 + x61) + cell[18] + V{0.0277777777777778};
1913
1914}
1915
1916template <typename CELL, typename FNEQ, typename V=typename CELL::value_t>
1917static void computeFneq(CELL& cell, FNEQ& fNeq) any_platform
1918{
1919auto x0 = cell[10] + cell[14];
1920auto x1 = cell[12] + cell[7];
1921auto x2 = x0 + x1 + cell[0] + cell[11] + cell[13] + cell[15] + cell[16] + cell[17] + cell[18] + cell[1] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[8] + cell[9] + V{1};
1922auto x3 = V{1} / ((x2)*(x2));
1923auto x4 = V{1.5}*x3;
1924auto x5 = cell[13] - cell[4];
1925auto x6 = cell[15] - cell[6];
1926auto x7 = x5 + x6;
1927auto x8 = -cell[1];
1928auto x9 = cell[16] - cell[7];
1929auto x10 = x8 + x9;
1930auto x11 = x0 - cell[5];
1931auto x12 = x10 + x11 + x7;
1932auto x13 = x12*x12;
1933auto x14 = x13*x4;
1934auto x15 = cell[17] - cell[8];
1935auto x16 = x15 + x5;
1936auto x17 = cell[18] - cell[9];
1937auto x18 = -cell[2];
1938auto x19 = x18 + cell[11] - cell[14] + cell[5];
1939auto x20 = x16 + x17 + x19;
1940auto x21 = x20*x20;
1941auto x41 = x21*x4;
1942auto x42 = x15 + x6;
1943auto x43 = -cell[3];
1944auto x44 = -cell[18] + cell[9];
1945auto x45 = x43 + x44;
1946auto x46 = x1 - cell[16];
1947auto x47 = x42 + x45 + x46;
1948auto x48 = x47*x47;
1949auto x49 = x4*x48;
1950auto x50 = x41 + x49 + V{-1};
1951auto x51 = x14 + x50;
1952auto x52 = V{0.0555555555555556}*cell[0] + V{0.0555555555555556}*cell[10] + V{0.0555555555555556}*cell[11] + V{0.0555555555555556}*cell[12] + V{0.0555555555555556}*cell[13] + V{0.0555555555555556}*cell[14] + V{0.0555555555555556}*cell[15] + V{0.0555555555555556}*cell[16] + V{0.0555555555555556}*cell[17] + V{0.0555555555555556}*cell[18] + V{0.0555555555555556}*cell[1] + V{0.0555555555555556}*cell[2] + V{0.0555555555555556}*cell[3] + V{0.0555555555555556}*cell[4] + V{0.0555555555555556}*cell[5] + V{0.0555555555555556}*cell[6] + V{0.0555555555555556}*cell[7] + V{0.0555555555555556}*cell[8] + V{0.0555555555555556}*cell[9] + V{0.0555555555555556};
1953auto x53 = V{1} / (x2);
1954auto x54 = V{3}*cell[14];
1955auto x55 = V{3}*cell[16];
1956auto x56 = V{3}*cell[5];
1957auto x57 = V{3}*cell[7];
1958auto x58 = V{3}*cell[13] - V{3}*cell[4];
1959auto x59 = V{3}*cell[15] - V{3}*cell[6];
1960auto x60 = x53*(x54 + x55 - x56 - x57 + x58 + x59 + V{3}*cell[10] - V{3}*cell[1]);
1961auto x61 = V{3}*x3;
1962auto x62 = x13*x61;
1963auto x63 = V{3}*cell[18];
1964auto x64 = V{3}*cell[9];
1965auto x65 = V{3}*cell[17] - V{3}*cell[8];
1966auto x66 = x53*(-x54 + x56 + x58 + x63 - x64 + x65 + V{3}*cell[11] - V{3}*cell[2]);
1967auto x67 = x21*x61;
1968auto x68 = x14 + V{-1};
1969auto x69 = x53*(-x55 + x57 + x59 - x63 + x64 + x65 + V{3}*cell[12] - V{3}*cell[3]);
1970auto x70 = x48*x61;
1971auto x71 = V{0.0277777777777778}*cell[0] + V{0.0277777777777778}*cell[10] + V{0.0277777777777778}*cell[11] + V{0.0277777777777778}*cell[12] + V{0.0277777777777778}*cell[13] + V{0.0277777777777778}*cell[14] + V{0.0277777777777778}*cell[15] + V{0.0277777777777778}*cell[16] + V{0.0277777777777778}*cell[17] + V{0.0277777777777778}*cell[18] + V{0.0277777777777778}*cell[1] + V{0.0277777777777778}*cell[2] + V{0.0277777777777778}*cell[3] + V{0.0277777777777778}*cell[4] + V{0.0277777777777778}*cell[5] + V{0.0277777777777778}*cell[6] + V{0.0277777777777778}*cell[7] + V{0.0277777777777778}*cell[8] + V{0.0277777777777778}*cell[9] + V{0.0277777777777778};
1972auto x72 = V{4.5}*x3;
1973auto x73 = x10 + cell[10];
1974auto x74 = x17 + x18 + x42 + x73 + cell[11] + V{2}*cell[13] - V{2}*cell[4];
1975auto x75 = x72*(x74*x74);
1976auto x76 = x51 + x60;
1977auto x77 = -x66;
1978auto x78 = -cell[17] + cell[8];
1979auto x79 = x44 + x6 + x73 + x78 - cell[11] + V{2}*cell[14] + cell[2] - V{2}*cell[5];
1980auto x80 = -x72*x79*x79;
1981auto x81 = x11 + x8;
1982auto x82 = x16 + x45 + x81 + cell[12] + V{2}*cell[15] - V{2}*cell[6];
1983auto x83 = x72*(x82*x82);
1984auto x84 = -x69;
1985auto x85 = x5 - cell[12] + cell[3];
1986auto x86 = x17 + x78 + x81 + x85 + V{2}*cell[16] - V{2}*cell[7];
1987auto x87 = -x72*x86*x86;
1988auto x88 = x19 + x43 + x46 + x7 + V{2}*cell[17] - V{2}*cell[8];
1989auto x89 = x72*(x88*x88);
1990auto x90 = x51 + x66;
1991auto x91 = x19 + x85 + x9 - cell[15] + V{2}*cell[18] + cell[6] - V{2}*cell[9];
1992auto x92 = -x72*x91*x91;
1993auto x93 = -x41;
1994auto x94 = V{1} - x49;
1995auto x95 = x93 + x94;
1996auto x96 = x60 + x95;
1997auto x97 = -x14;
1998auto x98 = x66 + x97;
1999auto x99 = x69 + x97;
2000auto x100 = -x60;
2001auto x101 = x51 + x69;
2002fNeq[0] = x51*(V{0.333333333333333}*cell[0] + V{0.333333333333333}*cell[10] + V{0.333333333333333}*cell[11] + V{0.333333333333333}*cell[12] + V{0.333333333333333}*cell[13] + V{0.333333333333333}*cell[14] + V{0.333333333333333}*cell[15] + V{0.333333333333333}*cell[16] + V{0.333333333333333}*cell[17] + V{0.333333333333333}*cell[18] + V{0.333333333333333}*cell[1] + V{0.333333333333333}*cell[2] + V{0.333333333333333}*cell[3] + V{0.333333333333333}*cell[4] + V{0.333333333333333}*cell[5] + V{0.333333333333333}*cell[6] + V{0.333333333333333}*cell[7] + V{0.333333333333333}*cell[8] + V{0.333333333333333}*cell[9] + V{0.333333333333333}) + cell[0] + V{0.333333333333333};
2003fNeq[1] = x52*(x50 + x60 - x62) + cell[1] + V{0.0555555555555556};
2004fNeq[2] = x52*(x49 + x66 - x67 + x68) + cell[2] + V{0.0555555555555556};
2005fNeq[3] = x52*(x41 + x68 + x69 - x70) + cell[3] + V{0.0555555555555556};
2006fNeq[4] = x71*(x66 - x75 + x76) + cell[4] + V{0.0277777777777778};
2007fNeq[5] = x71*(x76 + x77 + x80) + cell[5] + V{0.0277777777777778};
2008fNeq[6] = x71*(x69 + x76 - x83) + cell[6] + V{0.0277777777777778};
2009fNeq[7] = x71*(x76 + x84 + x87) + cell[7] + V{0.0277777777777778};
2010fNeq[8] = x71*(x69 - x89 + x90) + cell[8] + V{0.0277777777777778};
2011fNeq[9] = x71*(x84 + x90 + x92) + cell[9] + V{0.0277777777777778};
2012fNeq[10] = -x52*(x62 + x96) + cell[10] + V{0.0555555555555556};
2013fNeq[11] = -x52*(x67 + x94 + x98) + cell[11] + V{0.0555555555555556};
2014fNeq[12] = -x52*(x70 + x93 + x99 + V{1}) + cell[12] + V{0.0555555555555556};
2015fNeq[13] = -x71*(x75 + x96 + x98) + cell[13] + V{0.0277777777777778};
2016fNeq[14] = x71*(x100 + x80 + x90) + cell[14] + V{0.0277777777777778};
2017fNeq[15] = -x71*(x83 + x96 + x99) + cell[15] + V{0.0277777777777778};
2018fNeq[16] = x71*(x100 + x101 + x87) + cell[16] + V{0.0277777777777778};
2019fNeq[17] = -x71*(x69 + x89 + x95 + x98) + cell[17] + V{0.0277777777777778};
2020fNeq[18] = x71*(x101 + x77 + x92) + cell[18] + V{0.0277777777777778};
2021
2022}
2023
2024template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
2025static auto bgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
2026{
2027auto x19 = omega + V{-1};
2028auto x20 = u[0]*u[0];
2029auto x21 = V{1.5}*x20;
2030auto x22 = u[1]*u[1];
2031auto x23 = V{1.5}*x22;
2032auto x24 = u[2]*u[2];
2033auto x25 = V{1.5}*x24;
2034auto x26 = x23 + x25 + V{-1};
2035auto x27 = x21 + x26;
2036auto x28 = V{0.0555555555555556}*omega;
2037auto x29 = V{3}*u[0];
2038auto x30 = V{3}*x20;
2039auto x31 = V{3}*u[1];
2040auto x32 = V{3}*x22;
2041auto x33 = x21 + V{-1};
2042auto x34 = V{3}*u[2];
2043auto x35 = V{3}*x24;
2044auto x36 = V{0.0277777777777778}*omega;
2045auto x37 = u[0] + u[1];
2046auto x38 = V{4.5}*(x37*x37);
2047auto x39 = x27 + x29;
2048auto x40 = -x31;
2049auto x41 = u[0] - u[1];
2050auto x42 = -x41;
2051auto x43 = u[0] + u[2];
2052auto x44 = V{4.5}*(x43*x43);
2053auto x45 = -x34;
2054auto x46 = -u[2];
2055auto x47 = x46 + u[0];
2056auto x48 = -x47;
2057auto x49 = u[1] + u[2];
2058auto x50 = V{4.5}*(x49*x49);
2059auto x51 = x27 + x31;
2060auto x52 = x46 + u[1];
2061auto x53 = -x52;
2062auto x54 = -x23;
2063auto x55 = V{1} - x25;
2064auto x56 = x54 + x55;
2065auto x57 = x29 + x56;
2066auto x58 = -x21;
2067auto x59 = x31 + x58;
2068auto x60 = x34 + x58;
2069auto x61 = -x29;
2070auto x62 = x27 + x34;
2071cell[0] = -V{0.333333333333333}*omega*(rho*x27 + V{1}) - x19*cell[0];
2072cell[1] = -x19*cell[1] - x28*(rho*(x26 + x29 - x30) + V{1});
2073cell[2] = -x19*cell[2] - x28*(rho*(x25 + x31 - x32 + x33) + V{1});
2074cell[3] = -x19*cell[3] - x28*(rho*(x23 + x33 + x34 - x35) + V{1});
2075cell[4] = -x19*cell[4] - x36*(rho*(x31 - x38 + x39) + V{1});
2076cell[5] = -x19*cell[5] - x36*(rho*(x39 + x40 - V{4.5}*x42*x42) + V{1});
2077cell[6] = -x19*cell[6] - x36*(rho*(x34 + x39 - x44) + V{1});
2078cell[7] = -x19*cell[7] - x36*(rho*(x39 + x45 - V{4.5}*x48*x48) + V{1});
2079cell[8] = -x19*cell[8] - x36*(rho*(x34 - x50 + x51) + V{1});
2080cell[9] = -x19*cell[9] - x36*(rho*(x45 + x51 - V{4.5}*x53*x53) + V{1});
2081cell[10] = -x19*cell[10] + x28*(rho*(x30 + x57) + V{-1});
2082cell[11] = -x19*cell[11] + x28*(rho*(x32 + x55 + x59) + V{-1});
2083cell[12] = -x19*cell[12] + x28*(rho*(x35 + x54 + x60 + V{1}) + V{-1});
2084cell[13] = -x19*cell[13] + x36*(rho*(x38 + x57 + x59) + V{-1});
2085cell[14] = -x19*cell[14] - x36*(rho*(x51 + x61 - V{4.5}*x41*x41) + V{1});
2086cell[15] = -x19*cell[15] + x36*(rho*(x44 + x57 + x60) + V{-1});
2087cell[16] = -x19*cell[16] - x36*(rho*(x61 + x62 - V{4.5}*x47*x47) + V{1});
2088cell[17] = -x19*cell[17] + x36*(rho*(x34 + x50 + x56 + x59) + V{-1});
2089cell[18] = -x19*cell[18] - x36*(rho*(x40 + x62 - V{4.5}*x52*x52) + V{1});
2090return x20 + x22 + x24;
2091}
2092
2093template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
2094static auto adeBgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
2095{
2096auto x19 = omega + V{-1};
2097auto x20 = V{3}*u[0];
2098auto x21 = x20 + V{-1};
2099auto x22 = V{0.0555555555555556}*omega;
2100auto x23 = V{3}*u[1];
2101auto x24 = x23 + V{-1};
2102auto x25 = V{3}*u[2];
2103auto x26 = V{0.0277777777777778}*omega;
2104auto x27 = -x20;
2105auto x28 = x23 + V{1};
2106auto x29 = x25 + V{1};
2107auto x30 = -x23;
2108auto x31 = x20 + V{1};
2109auto x32 = -x25;
2110cell[0] = V{0.333333333333333}*omega*(rho + V{-1}) - x19*cell[0];
2111cell[1] = -x19*cell[1] - x22*(rho*x21 + V{1});
2112cell[2] = -x19*cell[2] - x22*(rho*x24 + V{1});
2113cell[3] = -x19*cell[3] - x22*(rho*(x25 + V{-1}) + V{1});
2114cell[4] = -x19*cell[4] - x26*(rho*(x21 + x23) + V{1});
2115cell[5] = -x19*cell[5] + x26*(rho*(x27 + x28) + V{-1});
2116cell[6] = -x19*cell[6] - x26*(rho*(x21 + x25) + V{1});
2117cell[7] = -x19*cell[7] + x26*(rho*(x27 + x29) + V{-1});
2118cell[8] = -x19*cell[8] - x26*(rho*(x24 + x25) + V{1});
2119cell[9] = -x19*cell[9] + x26*(rho*(x29 + x30) + V{-1});
2120cell[10] = -x19*cell[10] + x22*(rho*x31 + V{-1});
2121cell[11] = -x19*cell[11] + x22*(rho*x28 + V{-1});
2122cell[12] = -x19*cell[12] + x22*(rho*x29 + V{-1});
2123cell[13] = -x19*cell[13] + x26*(rho*(x23 + x31) + V{-1});
2124cell[14] = -x19*cell[14] + x26*(rho*(x30 + x31) + V{-1});
2125cell[15] = -x19*cell[15] + x26*(rho*(x25 + x31) + V{-1});
2126cell[16] = -x19*cell[16] + x26*(rho*(x31 + x32) + V{-1});
2127cell[17] = -x19*cell[17] + x26*(rho*(x25 + x28) + V{-1});
2128cell[18] = -x19*cell[18] + x26*(rho*(x28 + x32) + V{-1});
2129return u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
2130}
2131
2132template <typename CELL, typename PRESSURE, typename J, typename OMEGA, typename V=typename CELL::value_t>
2133static auto incBgkCollision(CELL& cell, PRESSURE& pressure, J& j, OMEGA& omega) any_platform
2134{
2135auto x19 = j[0]*j[0];
2136auto x20 = j[1]*j[1];
2137auto x21 = j[2]*j[2];
2138auto x22 = omega + V{-1};
2139auto x23 = V{0.0833333333333333}*x20;
2140auto x24 = V{0.166666666666667}*j[0];
2141auto x25 = V{0.166666666666667}*x19;
2142auto x26 = V{0.0833333333333333}*x21;
2143auto x27 = V{0.166666666666667}*pressure;
2144auto x28 = -x27;
2145auto x29 = x26 + x28 + V{0.0555555555555556};
2146auto x30 = V{0.0833333333333333}*x19;
2147auto x31 = V{0.166666666666667}*j[1];
2148auto x32 = V{0.166666666666667}*x20;
2149auto x33 = V{0.166666666666667}*j[2];
2150auto x34 = V{0.166666666666667}*x21;
2151auto x35 = j[0] + j[1];
2152auto x36 = V{0.125}*(x35*x35);
2153auto x37 = V{0.0833333333333333}*j[0];
2154auto x38 = V{0.0833333333333333}*j[1];
2155auto x39 = x37 + x38;
2156auto x40 = V{0.0416666666666667}*x19;
2157auto x41 = V{0.0416666666666667}*x20;
2158auto x42 = V{0.0416666666666667}*x21;
2159auto x43 = V{0.0833333333333333}*pressure;
2160auto x44 = x40 + x41 + x42 - x43 + V{0.0277777777777778};
2161auto x45 = j[0] - j[1];
2162auto x46 = -x45;
2163auto x47 = -x38;
2164auto x48 = x37 + x44;
2165auto x49 = V{0.0833333333333333}*j[2];
2166auto x50 = j[0] + j[2];
2167auto x51 = V{0.125}*(x50*x50);
2168auto x52 = -j[2];
2169auto x53 = x52 + j[0];
2170auto x54 = -x53;
2171auto x55 = -x49;
2172auto x56 = j[1] + j[2];
2173auto x57 = V{0.125}*(x56*x56);
2174auto x58 = x38 + x44;
2175auto x59 = x52 + j[1];
2176auto x60 = -x59;
2177auto x61 = -x23;
2178auto x62 = -x26 + x27 + V{-0.0555555555555556};
2179auto x63 = -x30;
2180auto x64 = -x40 - x41 - x42 + x43 + V{-0.0277777777777778};
2181auto x65 = -x37;
2182auto x66 = x49 + x64;
2183auto x67 = x44 + x49;
2184cell[0] = -omega*(-V{1}*pressure + V{0.5}*x19 + V{0.5}*x20 + V{0.5}*x21 + V{0.333333333333333}) - x22*cell[0];
2185cell[1] = -omega*(x23 + x24 - x25 + x29) - x22*cell[1];
2186cell[2] = -omega*(x29 + x30 + x31 - x32) - x22*cell[2];
2187cell[3] = -omega*(x23 + x28 + x30 + x33 - x34 + V{0.0555555555555556}) - x22*cell[3];
2188cell[4] = -omega*(-x36 + x39 + x44) - x22*cell[4];
2189cell[5] = -omega*(x47 + x48 - V{0.125}*x46*x46) - x22*cell[5];
2190cell[6] = -omega*(x48 + x49 - x51) - x22*cell[6];
2191cell[7] = -omega*(x48 + x55 - V{0.125}*x54*x54) - x22*cell[7];
2192cell[8] = -omega*(x49 - x57 + x58) - x22*cell[8];
2193cell[9] = -omega*(x55 + x58 - V{0.125}*x60*x60) - x22*cell[9];
2194cell[10] = omega*(x24 + x25 + x61 + x62) - x22*cell[10];
2195cell[11] = omega*(x31 + x32 + x62 + x63) - x22*cell[11];
2196cell[12] = omega*(x27 + x33 + x34 + x61 + x63 + V{-0.0555555555555556}) - x22*cell[12];
2197cell[13] = omega*(x36 + x39 + x64) - x22*cell[13];
2198cell[14] = -omega*(x58 + x65 - V{0.125}*x45*x45) - x22*cell[14];
2199cell[15] = omega*(x37 + x51 + x66) - x22*cell[15];
2200cell[16] = -omega*(x65 + x67 - V{0.125}*x53*x53) - x22*cell[16];
2201cell[17] = omega*(x38 + x57 + x66) - x22*cell[17];
2202cell[18] = -omega*(x47 + x67 - V{0.125}*x59*x59) - x22*cell[18];
2203return x19 + x20 + x21;
2204}
2205
2206template <typename CELL, typename RHO, typename U, typename RATIORHO, typename OMEGA, typename V=typename CELL::value_t>
2207static auto constRhoBgkCollision(CELL& cell, RHO& rho, U& u, RATIORHO& ratioRho, OMEGA& omega) any_platform
2208{
2209auto x19 = omega + V{-1};
2210auto x20 = V{0.333333333333333}*rho;
2211auto x21 = u[0]*u[0];
2212auto x22 = V{1.5}*x21;
2213auto x23 = u[1]*u[1];
2214auto x24 = V{1.5}*x23;
2215auto x25 = u[2]*u[2];
2216auto x26 = V{1.5}*x25;
2217auto x27 = x24 + x26 + V{-1};
2218auto x28 = x22 + x27;
2219auto x29 = V{0.0555555555555556}*rho;
2220auto x30 = V{3}*u[0];
2221auto x31 = V{3}*x21;
2222auto x32 = x27 + x30 - x31;
2223auto x33 = ratioRho*x29;
2224auto x34 = V{3}*u[1];
2225auto x35 = V{3}*x23;
2226auto x36 = x22 + V{-1};
2227auto x37 = x26 + x34 - x35 + x36;
2228auto x38 = V{3}*u[2];
2229auto x39 = V{3}*x25;
2230auto x40 = x24 + x36 + x38 - x39;
2231auto x41 = V{0.0277777777777778}*rho;
2232auto x42 = u[0] + u[1];
2233auto x43 = V{4.5}*(x42*x42);
2234auto x44 = x28 + x30;
2235auto x45 = x34 - x43 + x44;
2236auto x46 = ratioRho*x41;
2237auto x47 = -x34;
2238auto x48 = u[0] - u[1];
2239auto x49 = -x48;
2240auto x50 = x44 + x47 - V{4.5}*x49*x49;
2241auto x51 = u[0] + u[2];
2242auto x52 = V{4.5}*(x51*x51);
2243auto x53 = x38 + x44 - x52;
2244auto x54 = -x38;
2245auto x55 = -u[2];
2246auto x56 = x55 + u[0];
2247auto x57 = -x56;
2248auto x58 = x44 + x54 - V{4.5}*x57*x57;
2249auto x59 = u[1] + u[2];
2250auto x60 = V{4.5}*(x59*x59);
2251auto x61 = x28 + x34;
2252auto x62 = x38 - x60 + x61;
2253auto x63 = x55 + u[1];
2254auto x64 = -x63;
2255auto x65 = x54 + x61 - V{4.5}*x64*x64;
2256auto x66 = -x24;
2257auto x67 = V{1} - x26;
2258auto x68 = x66 + x67;
2259auto x69 = x30 + x68;
2260auto x70 = x31 + x69;
2261auto x71 = -x22;
2262auto x72 = x34 + x71;
2263auto x73 = x35 + x67 + x72;
2264auto x74 = x38 + x71;
2265auto x75 = x39 + x66 + x74 + V{1};
2266auto x76 = x43 + x69 + x72;
2267auto x77 = -x30;
2268auto x78 = x61 + x77 - V{4.5}*x48*x48;
2269auto x79 = x52 + x69 + x74;
2270auto x80 = x28 + x38;
2271auto x81 = x77 + x80 - V{4.5}*x56*x56;
2272auto x82 = x38 + x60 + x68 + x72;
2273auto x83 = x47 + x80 - V{4.5}*x63*x63;
2274cell[0] = -ratioRho*x20*x28 - x19*(x20*x28 + cell[0] + V{0.333333333333333}) + V{-0.333333333333333};
2275cell[1] = -x19*(x29*x32 + cell[1] + V{0.0555555555555556}) - x32*x33 + V{-0.0555555555555556};
2276cell[2] = -x19*(x29*x37 + cell[2] + V{0.0555555555555556}) - x33*x37 + V{-0.0555555555555556};
2277cell[3] = -x19*(x29*x40 + cell[3] + V{0.0555555555555556}) - x33*x40 + V{-0.0555555555555556};
2278cell[4] = -x19*(x41*x45 + cell[4] + V{0.0277777777777778}) - x45*x46 + V{-0.0277777777777778};
2279cell[5] = -x19*(x41*x50 + cell[5] + V{0.0277777777777778}) - x46*x50 + V{-0.0277777777777778};
2280cell[6] = -x19*(x41*x53 + cell[6] + V{0.0277777777777778}) - x46*x53 + V{-0.0277777777777778};
2281cell[7] = -x19*(x41*x58 + cell[7] + V{0.0277777777777778}) - x46*x58 + V{-0.0277777777777778};
2282cell[8] = -x19*(x41*x62 + cell[8] + V{0.0277777777777778}) - x46*x62 + V{-0.0277777777777778};
2283cell[9] = -x19*(x41*x65 + cell[9] + V{0.0277777777777778}) - x46*x65 + V{-0.0277777777777778};
2284cell[10] = V{0.0555555555555556}*ratioRho*rho*x70 - x19*(-x29*x70 + cell[10] + V{0.0555555555555556}) + V{-0.0555555555555556};
2285cell[11] = V{0.0555555555555556}*ratioRho*rho*x73 - x19*(-x29*x73 + cell[11] + V{0.0555555555555556}) + V{-0.0555555555555556};
2286cell[12] = V{0.0555555555555556}*ratioRho*rho*x75 - x19*(-x29*x75 + cell[12] + V{0.0555555555555556}) + V{-0.0555555555555556};
2287cell[13] = V{0.0277777777777778}*ratioRho*rho*x76 - x19*(-x41*x76 + cell[13] + V{0.0277777777777778}) + V{-0.0277777777777778};
2288cell[14] = -x19*(x41*x78 + cell[14] + V{0.0277777777777778}) - x46*x78 + V{-0.0277777777777778};
2289cell[15] = V{0.0277777777777778}*ratioRho*rho*x79 - x19*(-x41*x79 + cell[15] + V{0.0277777777777778}) + V{-0.0277777777777778};
2290cell[16] = -x19*(x41*x81 + cell[16] + V{0.0277777777777778}) - x46*x81 + V{-0.0277777777777778};
2291cell[17] = V{0.0277777777777778}*ratioRho*rho*x82 - x19*(-x41*x82 + cell[17] + V{0.0277777777777778}) + V{-0.0277777777777778};
2292cell[18] = -x19*(x41*x83 + cell[18] + V{0.0277777777777778}) - x46*x83 + V{-0.0277777777777778};
2293return x21 + x23 + x25;
2294}
2295
2296template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
2297static auto rlbCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
2298{
2299auto x19 = omega + V{-1};
2300auto x20 = V{3}*u[0];
2301auto x21 = x20 + V{1};
2302auto x22 = V{0.00925925925925926}*rho;
2303auto x23 = x20 + V{-1};
2304auto x24 = V{0.166666666666667}*cell[14];
2305auto x25 = V{3}*u[1];
2306auto x26 = -x25;
2307auto x27 = x21 + x26;
2308auto x28 = V{0.00462962962962963}*rho;
2309auto x29 = -x20;
2310auto x30 = x25 + V{1};
2311auto x31 = x29 + x30;
2312auto x32 = x28*x31;
2313auto x33 = -x24 + x27*x28 - x32 + V{0.166666666666667}*cell[5];
2314auto x34 = V{0.166666666666667}*cell[16];
2315auto x35 = V{3}*u[2];
2316auto x36 = -x35;
2317auto x37 = x21 + x36;
2318auto x38 = x35 + V{1};
2319auto x39 = x29 + x38;
2320auto x40 = x28*x39;
2321auto x41 = x28*x37 - x34 - x40 + V{0.166666666666667}*cell[7];
2322auto x42 = V{0.166666666666667}*cell[4];
2323auto x43 = V{0.166666666666667}*cell[13];
2324auto x44 = x21 + x25;
2325auto x45 = x28*x44;
2326auto x46 = x23 + x25;
2327auto x47 = x28*x46 + x42 - x43 + x45;
2328auto x48 = V{0.166666666666667}*cell[6];
2329auto x49 = V{0.166666666666667}*cell[15];
2330auto x50 = x21 + x35;
2331auto x51 = x28*x50;
2332auto x52 = x23 + x35;
2333auto x53 = x28*x52 + x48 - x49 + x51;
2334auto x54 = x19*(x21*x22 + x22*x23 + x33 + x41 + x47 + x53 - V{0.166666666666667}*cell[10] + V{0.166666666666667}*cell[1] + V{4.62592926927149e-18});
2335auto x55 = V{0.0555555555555556}*rho;
2336auto x56 = V{0.166666666666667}*cell[2];
2337auto x57 = -x46;
2338auto x58 = x25 + V{-1};
2339auto x59 = -x58;
2340auto x60 = x22*x30;
2341auto x61 = V{0.166666666666667}*cell[8];
2342auto x62 = x35 + x58;
2343auto x63 = x30 + x35;
2344auto x64 = x28*x63;
2345auto x65 = -x28*x62 - x61 - x64 + V{0.166666666666667}*cell[17];
2346auto x66 = V{0.166666666666667}*cell[18];
2347auto x67 = V{0.166666666666667}*cell[9];
2348auto x68 = x26 + x38;
2349auto x69 = x28*x68;
2350auto x70 = x30 + x36;
2351auto x71 = x28*x70;
2352auto x72 = x66 - x67 + x69 - x71;
2353auto x73 = V{0.166666666666667}*cell[3];
2354auto x74 = -x52;
2355auto x75 = x35 + V{-1};
2356auto x76 = -x75;
2357auto x77 = x22*x38;
2358auto x78 = -x66 + x67 - x69 + x71;
2359auto x79 = V{0.0833333333333333}*cell[2];
2360auto x80 = V{0.0833333333333333}*cell[11];
2361auto x81 = -x80;
2362auto x82 = x28*x30;
2363auto x83 = x28*x58;
2364auto x84 = V{0.0833333333333333}*cell[7];
2365auto x85 = V{0.0833333333333333}*cell[16];
2366auto x86 = V{0.00231481481481481}*rho;
2367auto x87 = x37*x86;
2368auto x88 = x39*x86;
2369auto x89 = x84 - x85 + x87 - x88;
2370auto x90 = x79 + x81 + x82 + x83 + x89;
2371auto x91 = V{0.0833333333333333}*cell[1];
2372auto x92 = -V{0.0833333333333333}*cell[10];
2373auto x93 = x21*x28;
2374auto x94 = x23*x28;
2375auto x95 = V{0.0833333333333333}*cell[6];
2376auto x96 = V{0.0833333333333333}*cell[15];
2377auto x97 = x50*x86;
2378auto x98 = x52*x86;
2379auto x99 = x95 - x96 + x97 + x98;
2380auto x100 = x91 + x92 + x93 + x94 + x99 + V{2.31296463463574e-18};
2381auto x101 = V{0.0833333333333333}*cell[8];
2382auto x102 = V{0.0833333333333333}*cell[17];
2383auto x103 = x63*x86;
2384auto x104 = x62*x86;
2385auto x105 = x101 - x102 + x103 + x104;
2386auto x106 = V{0.0833333333333333}*cell[9];
2387auto x107 = V{0.0833333333333333}*cell[18];
2388auto x108 = x70*x86;
2389auto x109 = x68*x86;
2390auto x110 = x106 - x107 + x108 - x109;
2391auto x111 = x19*(x100 + x105 + x110 + x47 + x90);
2392auto x112 = V{0.0277777777777778}*rho;
2393auto x113 = -x79 + x80 - x82 + x89;
2394auto x114 = -x106 + x107 - x108 + x109;
2395auto x115 = -x101 + x102 - x103 - x104;
2396auto x116 = x19*(x100 + x113 + x114 + x115 + x33 - x83);
2397auto x117 = V{0.0833333333333333}*cell[14];
2398auto x118 = x31*x86;
2399auto x119 = -x117 - x118 + x27*x86 + V{0.0833333333333333}*cell[5];
2400auto x120 = V{0.0833333333333333}*cell[3];
2401auto x121 = V{0.0833333333333333}*cell[12];
2402auto x122 = x28*x38;
2403auto x123 = x28*x75;
2404auto x124 = V{0.0833333333333333}*cell[4];
2405auto x125 = V{0.0833333333333333}*cell[13];
2406auto x126 = x44*x86;
2407auto x127 = x124 - x125 + x126 + x46*x86;
2408auto x128 = x120 - x121 + x122 + x123 + x127;
2409auto x129 = x91 + x92 + x93 + x94 + V{2.31296463463574e-18};
2410auto x130 = x19*(x105 + x114 + x119 + x128 + x129 + x53);
2411auto x131 = -x120;
2412auto x132 = -x122;
2413auto x133 = x119 + x121 + x131 + x132;
2414auto x134 = -x123 + x127;
2415auto x135 = x19*(x110 + x115 + x129 + x133 + x134 + x41);
2416auto x136 = -x95 + x96 - x97;
2417auto x137 = -V{0.00231481481481481}*rho*x27 + x117 + x118 - V{0.0833333333333333}*cell[5];
2418auto x138 = x19*(-x121 - x131 - x132 - x134 - x136 - x137 - x78 - x90 + x98);
2419auto x139 = x28*x62 + x61 + x64 - V{0.166666666666667}*cell[17];
2420cell[0] = V{0.333333333333333}*rho + V{-0.333333333333333};
2421cell[1] = -x23*x55 - x54 + V{-0.0555555555555556};
2422cell[2] = x19*(x22*x59 + x28*x57 + x33 - x42 + x43 - x45 - x56 - x60 + x65 + x72 + V{0.166666666666667}*cell[11]) - x55*x58 + V{-0.0555555555555556};
2423cell[3] = x19*(x22*x76 + x28*x74 + x41 - x48 + x49 - x51 + x65 - x73 - x77 + x78 + V{0.166666666666667}*cell[12]) - x55*x75 + V{-0.0555555555555556};
2424cell[4] = -x111 - x112*x46 + V{-0.0277777777777778};
2425cell[5] = V{0.0277777777777778}*rho*x31 - x116 + V{-0.0277777777777778};
2426cell[6] = -x112*x52 - x130 + V{-0.0277777777777778};
2427cell[7] = V{0.0277777777777778}*rho*x39 - x135 + V{-0.0277777777777778};
2428cell[8] = -x112*x62 + x19*(x113 - x124 + x125 - x126 + x133 + x136 + x28*x59 + x28*x76 + x57*x86 + x65 + x74*x86) + V{-0.0277777777777778};
2429cell[9] = x112*x68 + x138 + V{-0.0277777777777778};
2430cell[10] = x21*x55 + x54 + V{-0.0555555555555556};
2431cell[11] = V{0.0555555555555556}*rho*x30 - x19*(V{0.00462962962962963}*rho*x27 - x139 - x22*x58 - x24 - x32 - x47 - x56 - x60 - x78 + V{0.166666666666667}*cell[11] + V{0.166666666666667}*cell[5]) + V{-0.0555555555555556};
2432cell[12] = V{0.0555555555555556}*rho*x38 - x19*(V{0.00462962962962963}*rho*x37 - x139 - x22*x75 - x34 - x40 - x53 - x72 - x73 - x77 + V{0.166666666666667}*cell[12] + V{0.166666666666667}*cell[7]) + V{-0.0555555555555556};
2433cell[13] = x111 + x112*x44 + V{-0.0277777777777778};
2434cell[14] = x112*x27 + x116 + V{-0.0277777777777778};
2435cell[15] = x112*x50 + x130 + V{-0.0277777777777778};
2436cell[16] = x112*x37 + x135 + V{-0.0277777777777778};
2437cell[17] = V{0.0277777777777778}*rho*x63 - x19*(-x128 - x137 - x139 - x79 - x81 - x82 - x83 + x84 - x85 + x87 - x88 - x99) + V{-0.0277777777777778};
2438cell[18] = V{0.0277777777777778}*rho*x70 - x138 + V{-0.0277777777777778};
2439return u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
2440}
2441
2442template <typename CELL, typename RHO, typename U, typename PI, typename OMEGA, typename V=typename CELL::value_t>
2443static auto rlbCollision(CELL& cell, RHO& rho, U& u, PI& pi, OMEGA& omega) any_platform
2444{
2445auto x19 = u[0]*u[0];
2446auto x20 = V{1.5}*x19;
2447auto x21 = u[1]*u[1];
2448auto x22 = V{1.5}*x21;
2449auto x23 = u[2]*u[2];
2450auto x24 = V{1.5}*x23;
2451auto x25 = x22 + x24 + V{-1};
2452auto x26 = x20 + x25;
2453auto x27 = omega + V{-1};
2454auto x28 = V{0.0833333333333333}*pi[3];
2455auto x29 = V{0.0833333333333333}*pi[5];
2456auto x30 = x28 + x29 - V{0.166666666666667}*pi[0];
2457auto x31 = V{0.0555555555555556}*rho;
2458auto x32 = V{3}*u[0];
2459auto x33 = V{3}*x19;
2460auto x34 = V{0.0833333333333333}*pi[0];
2461auto x35 = x29 + x34 - V{0.166666666666667}*pi[3];
2462auto x36 = V{3}*u[1];
2463auto x37 = V{3}*x21;
2464auto x38 = x20 + V{-1};
2465auto x39 = x28 + x34 - V{0.166666666666667}*pi[5];
2466auto x40 = V{3}*u[2];
2467auto x41 = V{3}*x23;
2468auto x42 = V{0.0277777777777778}*rho;
2469auto x43 = u[0] + u[1];
2470auto x44 = V{4.5}*(x43*x43);
2471auto x45 = x26 + x32;
2472auto x46 = V{0.25}*pi[1];
2473auto x47 = V{0.0833333333333333}*pi[0];
2474auto x48 = V{0.0833333333333333}*pi[3];
2475auto x49 = x47 + x48 - V{0.0416666666666667}*pi[5];
2476auto x50 = x27*(x46 + x49) + V{0.0277777777777778};
2477auto x51 = -x36;
2478auto x52 = u[0] - u[1];
2479auto x53 = -x52;
2480auto x54 = x27*(-x46 + x49) + V{0.0277777777777778};
2481auto x55 = u[0] + u[2];
2482auto x56 = V{4.5}*(x55*x55);
2483auto x57 = V{0.25}*pi[2];
2484auto x58 = V{0.0833333333333333}*pi[5];
2485auto x59 = x47 + x58 - V{0.0416666666666667}*pi[3];
2486auto x60 = x27*(x57 + x59) + V{0.0277777777777778};
2487auto x61 = -x40;
2488auto x62 = -u[2];
2489auto x63 = x62 + u[0];
2490auto x64 = -x63;
2491auto x65 = x27*(-x57 + x59) + V{0.0277777777777778};
2492auto x66 = u[1] + u[2];
2493auto x67 = V{4.5}*(x66*x66);
2494auto x68 = x26 + x36;
2495auto x69 = V{0.25}*pi[4];
2496auto x70 = V{0.0416666666666667}*pi[0];
2497auto x71 = x27*(x48 + x58 + x69 - x70) + V{0.0277777777777778};
2498auto x72 = x62 + u[1];
2499auto x73 = -x72;
2500auto x74 = -x27*(-x48 - x58 + x69 + x70) + V{0.0277777777777778};
2501auto x75 = -x22;
2502auto x76 = V{1} - x24;
2503auto x77 = x75 + x76;
2504auto x78 = x32 + x77;
2505auto x79 = -x20;
2506auto x80 = x36 + x79;
2507auto x81 = x40 + x79;
2508auto x82 = -x32;
2509auto x83 = x26 + x40;
2510cell[0] = -V{0.333333333333333}*rho*x26 + V{0.5}*x27*(pi[0] + pi[3] + pi[5]) + V{-0.333333333333333};
2511cell[1] = x27*x30 - x31*(x25 + x32 - x33) + V{-0.0555555555555556};
2512cell[2] = x27*x35 - x31*(x24 + x36 - x37 + x38) + V{-0.0555555555555556};
2513cell[3] = x27*x39 - x31*(x22 + x38 + x40 - x41) + V{-0.0555555555555556};
2514cell[4] = -x42*(x36 - x44 + x45) - x50;
2515cell[5] = -x42*(x45 + x51 - V{4.5}*x53*x53) - x54;
2516cell[6] = -x42*(x40 + x45 - x56) - x60;
2517cell[7] = -x42*(x45 + x61 - V{4.5}*x64*x64) - x65;
2518cell[8] = -x42*(x40 - x67 + x68) - x71;
2519cell[9] = -x42*(x61 + x68 - V{4.5}*x73*x73) - x74;
2520cell[10] = x27*x30 + x31*(x33 + x78) + V{-0.0555555555555556};
2521cell[11] = x27*x35 + x31*(x37 + x76 + x80) + V{-0.0555555555555556};
2522cell[12] = x27*x39 + x31*(x41 + x75 + x81 + V{1}) + V{-0.0555555555555556};
2523cell[13] = V{0.0277777777777778}*rho*(x44 + x78 + x80) - x50;
2524cell[14] = -x42*(x68 + x82 - V{4.5}*x52*x52) - x54;
2525cell[15] = V{0.0277777777777778}*rho*(x56 + x78 + x81) - x60;
2526cell[16] = -x42*(x82 + x83 - V{4.5}*x63*x63) - x65;
2527cell[17] = V{0.0277777777777778}*rho*(x40 + x67 + x77 + x80) - x71;
2528cell[18] = -x42*(x51 + x83 - V{4.5}*x72*x72) - x74;
2529return x19 + x21 + x23;
2530}
2531
2532template <typename CELL, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
2533static void defineEqFirstOrder(CELL& cell, NEWRHO& newRho, NEWU& newU) any_platform
2534{
2535auto x19 = V{3}*newU[0];
2536auto x20 = x19 + V{-1};
2537auto x21 = V{3}*newU[1];
2538auto x22 = x21 + V{-1};
2539auto x23 = V{3}*newU[2];
2540auto x24 = -x19;
2541auto x25 = x21 + V{1};
2542auto x26 = x23 + V{1};
2543auto x27 = -x21;
2544auto x28 = x19 + V{1};
2545auto x29 = -x23;
2546cell[0] = V{0.333333333333333}*newRho + V{-0.333333333333333};
2547cell[1] = -V{0.0555555555555556}*newRho*x20 + V{-0.0555555555555556};
2548cell[2] = -V{0.0555555555555556}*newRho*x22 + V{-0.0555555555555556};
2549cell[3] = -V{0.0555555555555556}*newRho*(x23 + V{-1}) + V{-0.0555555555555556};
2550cell[4] = -V{0.0277777777777778}*newRho*(x20 + x21) + V{-0.0277777777777778};
2551cell[5] = V{0.0277777777777778}*newRho*(x24 + x25) + V{-0.0277777777777778};
2552cell[6] = -V{0.0277777777777778}*newRho*(x20 + x23) + V{-0.0277777777777778};
2553cell[7] = V{0.0277777777777778}*newRho*(x24 + x26) + V{-0.0277777777777778};
2554cell[8] = -V{0.0277777777777778}*newRho*(x22 + x23) + V{-0.0277777777777778};
2555cell[9] = V{0.0277777777777778}*newRho*(x26 + x27) + V{-0.0277777777777778};
2556cell[10] = V{0.0555555555555556}*newRho*x28 + V{-0.0555555555555556};
2557cell[11] = V{0.0555555555555556}*newRho*x25 + V{-0.0555555555555556};
2558cell[12] = V{0.0555555555555556}*newRho*x26 + V{-0.0555555555555556};
2559cell[13] = V{0.0277777777777778}*newRho*(x21 + x28) + V{-0.0277777777777778};
2560cell[14] = V{0.0277777777777778}*newRho*(x27 + x28) + V{-0.0277777777777778};
2561cell[15] = V{0.0277777777777778}*newRho*(x23 + x28) + V{-0.0277777777777778};
2562cell[16] = V{0.0277777777777778}*newRho*(x28 + x29) + V{-0.0277777777777778};
2563cell[17] = V{0.0277777777777778}*newRho*(x23 + x25) + V{-0.0277777777777778};
2564cell[18] = V{0.0277777777777778}*newRho*(x25 + x29) + V{-0.0277777777777778};
2565
2566}
2567
2568template <typename CELL, typename OLDRHO, typename OLDU, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
2569static void defineNEq(CELL& cell, OLDRHO& oldRho, OLDU& oldU, NEWRHO& newRho, NEWU& newU) any_platform
2570{
2571auto x19 = oldU[0]*oldU[0];
2572auto x20 = V{1.5}*x19;
2573auto x21 = oldU[1]*oldU[1];
2574auto x22 = V{1.5}*x21;
2575auto x23 = oldU[2]*oldU[2];
2576auto x24 = V{1.5}*x23;
2577auto x25 = x22 + x24 + V{-1};
2578auto x26 = x20 + x25;
2579auto x27 = newU[0]*newU[0];
2580auto x28 = V{1.5}*x27;
2581auto x29 = newU[1]*newU[1];
2582auto x30 = V{1.5}*x29;
2583auto x31 = newU[2]*newU[2];
2584auto x32 = V{1.5}*x31;
2585auto x33 = x30 + x32 + V{-1};
2586auto x34 = x28 + x33;
2587auto x35 = V{0.0555555555555556}*oldRho;
2588auto x36 = V{3}*oldU[0];
2589auto x37 = V{3}*x19;
2590auto x38 = V{0.0555555555555556}*newRho;
2591auto x39 = V{3}*newU[0];
2592auto x40 = V{3}*x27;
2593auto x41 = V{3}*oldU[1];
2594auto x42 = V{3}*x21;
2595auto x43 = x20 + V{-1};
2596auto x44 = V{3}*newU[1];
2597auto x45 = V{3}*x29;
2598auto x46 = x28 + V{-1};
2599auto x47 = V{3}*oldU[2];
2600auto x48 = V{3}*x23;
2601auto x49 = V{3}*newU[2];
2602auto x50 = V{3}*x31;
2603auto x51 = V{0.0277777777777778}*oldRho;
2604auto x52 = oldU[0] + oldU[1];
2605auto x53 = V{4.5}*(x52*x52);
2606auto x54 = x26 + x36;
2607auto x55 = V{0.0277777777777778}*newRho;
2608auto x56 = newU[0] + newU[1];
2609auto x57 = V{4.5}*(x56*x56);
2610auto x58 = x34 + x39;
2611auto x59 = -x41;
2612auto x60 = oldU[0] - oldU[1];
2613auto x61 = -V{4.5}*x60*x60;
2614auto x62 = -x44;
2615auto x63 = newU[0] - newU[1];
2616auto x64 = -V{4.5}*x63*x63;
2617auto x65 = oldU[0] + oldU[2];
2618auto x66 = V{4.5}*(x65*x65);
2619auto x67 = newU[0] + newU[2];
2620auto x68 = V{4.5}*(x67*x67);
2621auto x69 = -x47;
2622auto x70 = -oldU[2];
2623auto x71 = x70 + oldU[0];
2624auto x72 = -V{4.5}*x71*x71;
2625auto x73 = -x49;
2626auto x74 = -newU[2];
2627auto x75 = x74 + newU[0];
2628auto x76 = -V{4.5}*x75*x75;
2629auto x77 = oldU[1] + oldU[2];
2630auto x78 = V{4.5}*(x77*x77);
2631auto x79 = x26 + x41;
2632auto x80 = newU[1] + newU[2];
2633auto x81 = V{4.5}*(x80*x80);
2634auto x82 = x34 + x44;
2635auto x83 = x70 + oldU[1];
2636auto x84 = -V{4.5}*x83*x83;
2637auto x85 = x74 + newU[1];
2638auto x86 = -V{4.5}*x85*x85;
2639auto x87 = -x30;
2640auto x88 = V{1} - x32;
2641auto x89 = x87 + x88;
2642auto x90 = x39 + x89;
2643auto x91 = -x22;
2644auto x92 = V{1} - x24;
2645auto x93 = x91 + x92;
2646auto x94 = x36 + x93;
2647auto x95 = -x28;
2648auto x96 = x44 + x95;
2649auto x97 = -x20;
2650auto x98 = x41 + x97;
2651auto x99 = x49 + x95;
2652auto x100 = x47 + x97;
2653auto x101 = -x36;
2654auto x102 = -x39;
2655auto x103 = x26 + x47;
2656auto x104 = x34 + x49;
2657cell[0] = -V{0.333333333333333}*newRho*x34 + V{0.333333333333333}*oldRho*x26 + cell[0];
2658cell[1] = x35*(x25 + x36 - x37) - x38*(x33 + x39 - x40) + cell[1];
2659cell[2] = x35*(x24 + x41 - x42 + x43) - x38*(x32 + x44 - x45 + x46) + cell[2];
2660cell[3] = x35*(x22 + x43 + x47 - x48) - x38*(x30 + x46 + x49 - x50) + cell[3];
2661cell[4] = x51*(x41 - x53 + x54) - x55*(x44 - x57 + x58) + cell[4];
2662cell[5] = x51*(x54 + x59 + x61) - x55*(x58 + x62 + x64) + cell[5];
2663cell[6] = x51*(x47 + x54 - x66) - x55*(x49 + x58 - x68) + cell[6];
2664cell[7] = x51*(x54 + x69 + x72) - x55*(x58 + x73 + x76) + cell[7];
2665cell[8] = x51*(x47 - x78 + x79) - x55*(x49 - x81 + x82) + cell[8];
2666cell[9] = x51*(x69 + x79 + x84) - x55*(x73 + x82 + x86) + cell[9];
2667cell[10] = -x35*(x37 + x94) + x38*(x40 + x90) + cell[10];
2668cell[11] = -x35*(x42 + x92 + x98) + x38*(x45 + x88 + x96) + cell[11];
2669cell[12] = -x35*(x100 + x48 + x91 + V{1}) + x38*(x50 + x87 + x99 + V{1}) + cell[12];
2670cell[13] = -x51*(x53 + x94 + x98) + x55*(x57 + x90 + x96) + cell[13];
2671cell[14] = x51*(x101 + x61 + x79) - x55*(x102 + x64 + x82) + cell[14];
2672cell[15] = -x51*(x100 + x66 + x94) + x55*(x68 + x90 + x99) + cell[15];
2673cell[16] = x51*(x101 + x103 + x72) - x55*(x102 + x104 + x76) + cell[16];
2674cell[17] = -x51*(x47 + x78 + x93 + x98) + x55*(x49 + x81 + x89 + x96) + cell[17];
2675cell[18] = x51*(x103 + x59 + x84) - x55*(x104 + x62 + x86) + cell[18];
2676
2677}
2678
2679template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
2680static void defineNEqFromPi(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
2681{
2682auto x19 = u[0]*u[0];
2683auto x20 = V{1.5}*x19;
2684auto x21 = u[1]*u[1];
2685auto x22 = V{1.5}*x21;
2686auto x23 = u[2]*u[2];
2687auto x24 = V{1.5}*x23;
2688auto x25 = x22 + x24 + V{-1};
2689auto x26 = x20 + x25;
2690auto x27 = V{0.0555555555555556}*rho;
2691auto x28 = V{3}*u[0];
2692auto x29 = V{3}*x19;
2693auto x30 = V{0.0833333333333333}*pi[3];
2694auto x31 = V{0.0833333333333333}*pi[5] + V{0.0555555555555556};
2695auto x32 = x30 + x31 - V{0.166666666666667}*pi[0];
2696auto x33 = V{3}*u[1];
2697auto x34 = V{3}*x21;
2698auto x35 = x20 + V{-1};
2699auto x36 = V{0.0833333333333333}*pi[0];
2700auto x37 = x31 + x36 - V{0.166666666666667}*pi[3];
2701auto x38 = V{3}*u[2];
2702auto x39 = V{3}*x23;
2703auto x40 = x30 + x36 - V{0.166666666666667}*pi[5] + V{0.0555555555555556};
2704auto x41 = V{0.25}*pi[1];
2705auto x42 = V{0.0277777777777778}*rho;
2706auto x43 = u[0] + u[1];
2707auto x44 = V{4.5}*(x43*x43);
2708auto x45 = x26 + x28;
2709auto x46 = V{0.0416666666666667}*pi[5];
2710auto x47 = -V{0.0833333333333333}*pi[3];
2711auto x48 = V{0.0277777777777778} - V{0.0833333333333333}*pi[0];
2712auto x49 = x46 + x47 + x48;
2713auto x50 = -x33;
2714auto x51 = u[0] - u[1];
2715auto x52 = -x51;
2716auto x53 = x41 + x49;
2717auto x54 = V{0.25}*pi[2];
2718auto x55 = u[0] + u[2];
2719auto x56 = V{4.5}*(x55*x55);
2720auto x57 = V{0.0416666666666667}*pi[3];
2721auto x58 = -V{0.0833333333333333}*pi[5];
2722auto x59 = x48 + x57 + x58;
2723auto x60 = -x38;
2724auto x61 = -u[2];
2725auto x62 = x61 + u[0];
2726auto x63 = -x62;
2727auto x64 = x54 + x59;
2728auto x65 = V{0.25}*pi[4];
2729auto x66 = u[1] + u[2];
2730auto x67 = V{4.5}*(x66*x66);
2731auto x68 = x26 + x33;
2732auto x69 = V{0.0416666666666667}*pi[0];
2733auto x70 = x47 + x58 + x69 + V{0.0277777777777778};
2734auto x71 = x61 + u[1];
2735auto x72 = -x71;
2736auto x73 = x65 + x70;
2737auto x74 = -x22;
2738auto x75 = V{1} - x24;
2739auto x76 = x74 + x75;
2740auto x77 = x28 + x76;
2741auto x78 = -x20;
2742auto x79 = x33 + x78;
2743auto x80 = x38 + x78;
2744auto x81 = V{0.0833333333333333}*pi[3];
2745auto x82 = V{0.0833333333333333}*pi[0] + V{-0.0277777777777778};
2746auto x83 = -x28;
2747auto x84 = V{0.0833333333333333}*pi[5];
2748auto x85 = x26 + x38;
2749cell[0] = -V{0.333333333333333}*rho*x26 - V{0.5}*pi[0] - V{0.5}*pi[3] - V{0.5}*pi[5] + V{-0.333333333333333};
2750cell[1] = -x27*(x25 + x28 - x29) - x32;
2751cell[2] = -x27*(x24 + x33 - x34 + x35) - x37;
2752cell[3] = -x27*(x22 + x35 + x38 - x39) - x40;
2753cell[4] = x41 - x42*(x33 - x44 + x45) - x49;
2754cell[5] = -x42*(x45 + x50 - V{4.5}*x52*x52) - x53;
2755cell[6] = -x42*(x38 + x45 - x56) + x54 - x59;
2756cell[7] = -x42*(x45 + x60 - V{4.5}*x63*x63) - x64;
2757cell[8] = -x42*(x38 - x67 + x68) + x65 - x70;
2758cell[9] = -x42*(x60 + x68 - V{4.5}*x72*x72) - x73;
2759cell[10] = V{0.0555555555555556}*rho*(x29 + x77) - x32;
2760cell[11] = V{0.0555555555555556}*rho*(x34 + x75 + x79) - x37;
2761cell[12] = V{0.0555555555555556}*rho*(x39 + x74 + x80 + V{1}) - x40;
2762cell[13] = x41 + x42*(x44 + x77 + x79) - x46 + x81 + x82;
2763cell[14] = -x42*(x68 + x83 - V{4.5}*x51*x51) - x53;
2764cell[15] = x42*(x56 + x77 + x80) + x54 - x57 + x82 + x84;
2765cell[16] = -x42*(x83 + x85 - V{4.5}*x62*x62) - x64;
2766cell[17] = x42*(x38 + x67 + x76 + x79) + x65 - x69 + x81 + x84 + V{-0.0277777777777778};
2767cell[18] = -x42*(x50 + x85 - V{4.5}*x71*x71) - x73;
2768
2769}
2770
2771template <typename CELL, typename FORCE, typename V=typename CELL::value_t>
2772static auto computePiNeqNormSqr(CELL& cell, FORCE& force) any_platform
2773{
2774auto x0 = cell[15] - cell[6];
2775auto x1 = cell[13] - cell[4];
2776auto x2 = cell[10] + cell[14] + cell[16];
2777auto x3 = x0 + x1 + x2 - cell[1] - cell[5] - cell[7];
2778auto x4 = cell[17] - cell[8];
2779auto x5 = cell[12] + cell[7] + cell[9];
2780auto x6 = x0 + x4 + x5 - cell[16] - cell[18] - cell[3];
2781auto x7 = cell[11] + cell[18] + cell[5];
2782auto x8 = x2 + x5 + x7 + cell[0] + cell[13] + cell[15] + cell[17] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[8];
2783auto x9 = V{1} / (x8 + V{1});
2784auto x10 = x9*(x8 + V{1});
2785auto x11 = V{0.5}*x10;
2786auto x12 = x3*x9;
2787auto x13 = V{1}*x12;
2788auto x14 = x11*(x3*force[2] + x6*force[0]) - x13*x6 + V{1}*cell[15] - V{1}*cell[16] + V{1}*cell[6] - V{1}*cell[7];
2789auto x15 = x1 + x4 + x7 - cell[14] - cell[2] - cell[9];
2790auto x16 = x15*force[0] + x3*force[1];
2791auto x17 = V{1}*x10;
2792auto x18 = V{2}*x15;
2793auto x19 = x15*force[2] + x6*force[1];
2794auto x20 = x6*x9;
2795auto x21 = -V{0.333333333333333}*cell[0];
2796auto x22 = x21 - V{0.333333333333333}*cell[12] + V{0.666666666666667}*cell[13] + V{0.666666666666667}*cell[14] - V{0.333333333333333}*cell[3] + V{0.666666666666667}*cell[4] + V{0.666666666666667}*cell[5];
2797auto x23 = -V{0.333333333333333}*cell[11] + V{0.666666666666667}*cell[15] + V{0.666666666666667}*cell[16] - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[6] + V{0.666666666666667}*cell[7];
2798auto x24 = x10*x3*force[0] + x22 + x23 - x9*x3*x3 + V{0.666666666666667}*cell[10] - V{0.333333333333333}*cell[17] - V{0.333333333333333}*cell[18] + V{0.666666666666667}*cell[1] - V{0.333333333333333}*cell[8] - V{0.333333333333333}*cell[9];
2799auto x25 = -V{0.333333333333333}*cell[10] + V{0.666666666666667}*cell[17] + V{0.666666666666667}*cell[18] - V{0.333333333333333}*cell[1] + V{0.666666666666667}*cell[8] + V{0.666666666666667}*cell[9];
2800auto x26 = x10*x15*force[1] + x22 + x25 - x9*x15*x15 + V{0.666666666666667}*cell[11] - V{0.333333333333333}*cell[15] - V{0.333333333333333}*cell[16] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[6] - V{0.333333333333333}*cell[7];
2801auto x27 = x10*x6*force[2] + x21 + x23 + x25 - x9*x6*x6 + V{0.666666666666667}*cell[12] - V{0.333333333333333}*cell[13] - V{0.333333333333333}*cell[14] + V{0.666666666666667}*cell[3] - V{0.333333333333333}*cell[4] - V{0.333333333333333}*cell[5];
2802return (x11*x16 - x13*x15 + V{1}*cell[13] - V{1}*cell[14] + V{1}*cell[4] - V{1}*cell[5])*(-x12*x18 + x16*x17 + V{2}*cell[13] - V{2}*cell[14] + V{2}*cell[4] - V{2}*cell[5]) + (x11*x19 - V{1}*x15*x20 + V{1}*cell[17] - V{1}*cell[18] + V{1}*cell[8] - V{1}*cell[9])*(x17*x19 - x18*x20 + V{2}*cell[17] - V{2}*cell[18] + V{2}*cell[8] - V{2}*cell[9]) + 2*(x14*x14) + x24*x24 + x26*x26 + x27*x27;
2803}
2804
2805template <typename CELL, typename V=typename CELL::value_t>
2806static auto computePiNeqNormSqr(CELL& cell) any_platform
2807{
2808auto x0 = -cell[4];
2809auto x1 = -cell[8];
2810auto x2 = x1 + cell[18];
2811auto x3 = cell[11] + cell[17] + cell[5];
2812auto x4 = x0 + x2 + x3 + cell[13] - cell[14] - cell[2] - cell[9];
2813auto x5 = cell[10] + cell[13] + cell[15];
2814auto x6 = cell[12] + cell[7] + cell[9];
2815auto x7 = V{1} / (x3 + x5 + x6 + cell[0] + cell[14] + cell[16] + cell[18] + cell[1] + cell[2] + cell[3] + cell[4] + cell[6] + cell[8] + V{1});
2816auto x8 = x0 + cell[14];
2817auto x9 = -cell[6];
2818auto x10 = x9 + cell[16];
2819auto x11 = x10 + x5 + x8 - cell[1] - cell[5] - cell[7];
2820auto x12 = x11*x7;
2821auto x13 = x12*x4 + x8 - cell[13] + cell[5];
2822auto x14 = x1 + x6 + x9 + cell[15] - cell[16] + cell[17] - cell[18] - cell[3];
2823auto x15 = x10 + x12*x14 - cell[15] + cell[7];
2824auto x16 = x14*x4*x7 + x2 - cell[17] + cell[9];
2825auto x17 = V{1}*x7;
2826auto x18 = V{0.333333333333333}*cell[0];
2827auto x19 = x18 + V{0.333333333333333}*cell[10] - V{0.666666666666667}*cell[17] - V{0.666666666666667}*cell[18] + V{0.333333333333333}*cell[1] - V{0.666666666666667}*cell[8] - V{0.666666666666667}*cell[9];
2828auto x20 = V{0.333333333333333}*cell[11] - V{0.666666666666667}*cell[15] - V{0.666666666666667}*cell[16] + V{0.333333333333333}*cell[2] - V{0.666666666666667}*cell[6] - V{0.666666666666667}*cell[7];
2829auto x21 = x17*(x14*x14) + x19 + x20 - V{0.666666666666667}*cell[12] + V{0.333333333333333}*cell[13] + V{0.333333333333333}*cell[14] - V{0.666666666666667}*cell[3] + V{0.333333333333333}*cell[4] + V{0.333333333333333}*cell[5];
2830auto x22 = V{0.333333333333333}*cell[12] - V{0.666666666666667}*cell[13] - V{0.666666666666667}*cell[14] + V{0.333333333333333}*cell[3] - V{0.666666666666667}*cell[4] - V{0.666666666666667}*cell[5];
2831auto x23 = x17*(x4*x4) + x19 + x22 - V{0.666666666666667}*cell[11] + V{0.333333333333333}*cell[15] + V{0.333333333333333}*cell[16] - V{0.666666666666667}*cell[2] + V{0.333333333333333}*cell[6] + V{0.333333333333333}*cell[7];
2832auto x24 = x17*(x11*x11) + x18 + x20 + x22 - V{0.666666666666667}*cell[10] + V{0.333333333333333}*cell[17] + V{0.333333333333333}*cell[18] - V{0.666666666666667}*cell[1] + V{0.333333333333333}*cell[8] + V{0.333333333333333}*cell[9];
2833return V{2}*(x13*x13) + V{2}*(x15*x15) + V{2}*(x16*x16) + x21*x21 + x23*x23 + x24*x24;
2834}
2835
2836template <typename CELL, typename RHO, typename U, typename OMEGA, typename FORCE, typename V=typename CELL::value_t>
2837static void addExternalForce(CELL& cell, RHO& rho, U& u, OMEGA& omega, FORCE& force) any_platform
2838{
2839auto x19 = force[0]*u[0];
2840auto x20 = force[1]*u[1];
2841auto x21 = force[2]*u[2];
2842auto x22 = rho*(V{0.5}*omega + V{-1});
2843auto x23 = V{6}*u[0];
2844auto x24 = x23 + V{-3};
2845auto x25 = V{0.0555555555555556}*force[0];
2846auto x26 = V{0.166666666666667}*x20;
2847auto x27 = V{0.166666666666667}*x21;
2848auto x28 = x26 + x27;
2849auto x29 = V{6}*u[1];
2850auto x30 = x29 + V{-3};
2851auto x31 = V{0.0555555555555556}*force[1];
2852auto x32 = V{0.166666666666667}*x19;
2853auto x33 = x27 + x32;
2854auto x34 = V{6}*u[2];
2855auto x35 = x34 + V{-3};
2856auto x36 = V{0.0555555555555556}*force[2];
2857auto x37 = x26 + x32;
2858auto x38 = V{9}*u[1];
2859auto x39 = V{0.0277777777777778}*force[0];
2860auto x40 = V{9}*u[0];
2861auto x41 = V{0.0277777777777778}*force[1];
2862auto x42 = V{0.0833333333333333}*x21;
2863auto x43 = -x42;
2864auto x44 = V{3} - x23;
2865auto x45 = -x40;
2866auto x46 = x29 + V{3};
2867auto x47 = V{9}*u[2];
2868auto x48 = V{0.0277777777777778}*force[2];
2869auto x49 = V{0.0833333333333333}*x20;
2870auto x50 = -x49;
2871auto x51 = x34 + V{3};
2872auto x52 = V{0.0833333333333333}*x19;
2873auto x53 = -x52;
2874auto x54 = V{3} - x29;
2875auto x55 = -x38;
2876auto x56 = x23 + V{3};
2877auto x57 = V{3} - x34;
2878auto x58 = -x47;
2879cell[0] = V{1}*x22*(x19 + x20 + x21) + cell[0];
2880cell[1] = x22*(-x24*x25 + x28) + cell[1];
2881cell[2] = x22*(-x30*x31 + x33) + cell[2];
2882cell[3] = x22*(-x35*x36 + x37) + cell[3];
2883cell[4] = -x22*(x39*(x24 + x38) + x41*(x30 + x40) + x43) + cell[4];
2884cell[5] = -x22*(-x39*(x38 + x44) - x42 + V{0.0277777777777778}*(x45 + x46)*force[1]) + cell[5];
2885cell[6] = -x22*(x39*(x24 + x47) + x48*(x35 + x40) + x50) + cell[6];
2886cell[7] = -x22*(-x39*(x44 + x47) - x49 + V{0.0277777777777778}*(x45 + x51)*force[2]) + cell[7];
2887cell[8] = -x22*(x41*(x30 + x47) + x48*(x35 + x38) + x53) + cell[8];
2888cell[9] = -x22*(-x41*(x47 + x54) - x52 + V{0.0277777777777778}*(x51 + x55)*force[2]) + cell[9];
2889cell[10] = x22*(-x25*x56 + x28) + cell[10];
2890cell[11] = x22*(-x31*x46 + x33) + cell[11];
2891cell[12] = x22*(-x36*x51 + x37) + cell[12];
2892cell[13] = -x22*(x39*(x38 + x56) + x41*(x40 + x46) + x43) + cell[13];
2893cell[14] = -x22*(-x41*(x40 + x54) - x42 + V{0.0277777777777778}*(x55 + x56)*force[0]) + cell[14];
2894cell[15] = -x22*(x39*(x47 + x56) + x48*(x40 + x51) + x50) + cell[15];
2895cell[16] = -x22*(-x48*(x40 + x57) - x49 + V{0.0277777777777778}*(x56 + x58)*force[0]) + cell[16];
2896cell[17] = -x22*(x41*(x46 + x47) + x48*(x38 + x51) + x53) + cell[17];
2897cell[18] = -x22*(-x48*(x38 + x57) - x52 + V{0.0277777777777778}*(x46 + x58)*force[1]) + cell[18];
2898
2899}
2900
2901};
2902
2903template <typename... FIELDS>
2904struct lbm<descriptors::D3Q27<FIELDS...>> {
2905
2906template <typename CELL, typename V=typename CELL::value_t>
2907static auto computeRho(CELL& cell) any_platform
2908{
2909
2910return cell[0] + cell[10] + cell[11] + cell[12] + cell[13] + cell[14] + cell[15] + cell[16] + cell[17] + cell[18] + cell[19] + cell[1] + cell[20] + cell[21] + cell[22] + cell[23] + cell[24] + cell[25] + cell[26] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7] + cell[8] + cell[9] + V{1};
2911}
2912
2913template <typename CELL, typename J, typename V=typename CELL::value_t>
2914static void computeJ(CELL& cell, J& j) any_platform
2915{
2916auto x0 = -cell[23];
2917auto x1 = x0 + cell[10] + cell[11] - cell[17] - cell[24] + cell[4];
2918auto x2 = cell[12] - cell[19] - cell[25] + cell[6];
2919auto x3 = -cell[13] - cell[21] + cell[26] + cell[8];
2920j[0] = -V{1}*x1 - V{1}*x2 - V{1}*cell[13] + V{1}*cell[14] + V{1}*cell[18] - V{1}*cell[1] + V{1}*cell[20] + V{1}*cell[26] - V{1}*cell[5] - V{1}*cell[7];
2921j[1] = -V{1}*x1 - V{1}*x3 + V{1}*cell[12] + V{1}*cell[15] - V{1}*cell[18] + V{1}*cell[22] - V{1}*cell[25] - V{1}*cell[2] + V{1}*cell[5] - V{1}*cell[9];
2922j[2] = -V{1}*x0 - V{1}*x2 - V{1}*x3 - V{1}*cell[10] + V{1}*cell[11] + V{1}*cell[16] - V{1}*cell[20] - V{1}*cell[22] - V{1}*cell[24] - V{1}*cell[3] + V{1}*cell[7] + V{1}*cell[9];
2923
2924}
2925
2926template <typename CELL, typename RHO, typename U, typename V=typename CELL::value_t>
2927static void computeRhoU(CELL& cell, RHO& rho, U& u) any_platform
2928{
2929auto x0 = cell[13] + cell[1] + cell[5] + cell[7];
2930auto x1 = cell[18] + cell[25] + cell[2] + cell[9];
2931auto x2 = cell[10] + cell[20] + cell[22] + cell[24] + cell[3];
2932auto x3 = x0 + x1 + x2 + cell[0] + cell[11] + cell[12] + cell[14] + cell[15] + cell[16] + cell[17] + cell[19] + cell[21] + cell[23] + cell[26] + cell[4] + cell[6] + cell[8] + V{1};
2933auto x4 = -cell[23];
2934auto x5 = x4 + cell[10] + cell[11] - cell[17] - cell[24] + cell[4];
2935auto x6 = cell[12] - cell[19] - cell[25] + cell[6];
2936auto x7 = V{1}/x3;
2937auto x8 = -cell[13] - cell[21] + cell[26] + cell[8];
2938rho = x3;
2939u[0] = -x7*(x0 + x5 + x6 - cell[14] - cell[18] - cell[20] - cell[26]);
2940u[1] = -x7*(x1 + x5 + x8 - cell[12] - cell[15] - cell[22] - cell[5]);
2941u[2] = -x7*(x2 + x4 + x6 + x8 - cell[11] - cell[16] - cell[7] - cell[9]);
2942
2943}
2944
2945template <typename CELL, typename RHO, typename J, typename V=typename CELL::value_t>
2946static void computeRhoJ(CELL& cell, RHO& rho, J& j) any_platform
2947{
2948auto x0 = cell[13] + cell[1] + cell[5] + cell[7];
2949auto x1 = cell[18] + cell[25] + cell[2] + cell[9];
2950auto x2 = cell[10] + cell[20] + cell[22] + cell[24] + cell[3];
2951auto x3 = -cell[23];
2952auto x4 = x3 + cell[10] + cell[11] - cell[17] - cell[24] + cell[4];
2953auto x5 = cell[12] - cell[19] - cell[25] + cell[6];
2954auto x6 = -cell[13] - cell[21] + cell[26] + cell[8];
2955rho = x0 + x1 + x2 + cell[0] + cell[11] + cell[12] + cell[14] + cell[15] + cell[16] + cell[17] + cell[19] + cell[21] + cell[23] + cell[26] + cell[4] + cell[6] + cell[8] + V{1};
2956j[0] = -V{1}*x0 - V{1}*x4 - V{1}*x5 + V{1}*cell[14] + V{1}*cell[18] + V{1}*cell[20] + V{1}*cell[26];
2957j[1] = -V{1}*x1 - V{1}*x4 - V{1}*x6 + V{1}*cell[12] + V{1}*cell[15] + V{1}*cell[22] + V{1}*cell[5];
2958j[2] = -V{1}*x2 - V{1}*x3 - V{1}*x5 - V{1}*x6 + V{1}*cell[11] + V{1}*cell[16] + V{1}*cell[7] + V{1}*cell[9];
2959
2960}
2961
2962template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
2963static void computeStress(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
2964{
2965auto x0 = V{1}*cell[13];
2966auto x1 = V{1}*cell[26];
2967auto x2 = V{1}*cell[10];
2968auto x3 = V{1}*cell[23];
2969auto x4 = -V{0.333333333333333}*rho;
2970auto x5 = V{1}*cell[12];
2971auto x6 = V{1}*cell[25];
2972auto x7 = x5 + x6;
2973auto x8 = x7 + V{1}*cell[18] + V{1}*cell[5];
2974auto x9 = x0 + x1 + x2 + x3 + x4 + x8 + V{1}*cell[17] + V{1}*cell[4] + V{0.333333333333333};
2975auto x10 = V{1}*cell[11];
2976auto x11 = V{1}*cell[24];
2977auto x12 = x10 + x11;
2978auto x13 = x12 + V{1}*cell[20] + V{1}*cell[7];
2979auto x14 = x13 + V{1}*cell[19] + V{1}*cell[6];
2980auto x15 = rho*u[0];
2981auto x16 = -V{1}*cell[10];
2982auto x17 = -V{1}*cell[23];
2983auto x18 = x0 + x1 + x16 + x17;
2984auto x19 = V{1}*cell[9];
2985auto x20 = V{1}*cell[22];
2986auto x21 = x12 + x19 + x20;
2987auto x22 = V{1}*cell[21] + V{1}*cell[8];
2988pi[0] = -rho*u[0]*u[0] + x14 + x9 + V{1}*cell[14] + V{1}*cell[1];
2989pi[1] = x10 + x11 - x15*u[1] - x18 - x8 + V{1}*cell[17] + V{1}*cell[4];
2990pi[2] = -x13 - x15*u[2] - x18 + x5 + x6 + V{1}*cell[19] + V{1}*cell[6];
2991pi[3] = -rho*u[1]*u[1] + x21 + x22 + x9 + V{1}*cell[15] + V{1}*cell[2];
2992pi[4] = -rho*u[1]*u[2] + x0 + x1 - x16 - x17 - x21 - x7 + V{1}*cell[21] + V{1}*cell[8];
2993pi[5] = -rho*u[2]*u[2] + x0 + x1 + x14 + x19 + x2 + x20 + x22 + x3 + x4 + x7 + V{1}*cell[16] + V{1}*cell[3] + V{0.333333333333333};
2994
2995}
2996
2997template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
2998static void computeAllMomenta(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
2999{
3000auto x0 = cell[12] + cell[25];
3001auto x1 = x0 + cell[18];
3002auto x2 = cell[11] + cell[24];
3003auto x3 = x2 + cell[20];
3004auto x4 = cell[22] + cell[9];
3005auto x5 = cell[13] + cell[1];
3006auto x6 = cell[26] + cell[2] + cell[8];
3007auto x7 = cell[10] + cell[3];
3008auto x8 = x1 + x3 + x4 + x5 + x6 + x7 + cell[0] + cell[14] + cell[15] + cell[16] + cell[17] + cell[19] + cell[21] + cell[23] + cell[4] + cell[5] + cell[6] + cell[7] + V{1};
3009auto x9 = -cell[17];
3010auto x10 = -cell[24];
3011auto x11 = x10 + x9 + cell[5];
3012auto x12 = -cell[19];
3013auto x13 = -cell[25];
3014auto x14 = x12 + x13 + cell[7];
3015auto x15 = -cell[23];
3016auto x16 = x15 - cell[26];
3017auto x17 = cell[10] + cell[11] + cell[4];
3018auto x18 = cell[12] + cell[6];
3019auto x19 = x11 + x14 + x16 + x17 + x18 + x5 - cell[14] - cell[18] - cell[20];
3020auto x20 = V{1} / (x8);
3021auto x21 = V{1}*x20;
3022auto x22 = -cell[12];
3023auto x23 = -cell[13] - cell[21];
3024auto x24 = x15 + x23;
3025auto x25 = x10 + x17 + x22 + x24 + x6 + x9 - cell[15] + cell[18] - cell[22] + cell[25] - cell[5] + cell[9];
3026auto x26 = -cell[11];
3027auto x27 = x12 + x13 + x18 + x24 + x26 + x7 - cell[16] + cell[20] + cell[22] + cell[24] + cell[26] - cell[7] + cell[8] - cell[9];
3028auto x28 = V{0.666666666666667}*cell[10];
3029auto x29 = V{0.666666666666667}*cell[11];
3030auto x40 = V{0.666666666666667}*cell[12];
3031auto x41 = V{0.666666666666667}*cell[13];
3032auto x42 = V{0.666666666666667}*cell[23];
3033auto x43 = V{0.666666666666667}*cell[24];
3034auto x44 = V{0.666666666666667}*cell[25];
3035auto x45 = V{0.666666666666667}*cell[26];
3036auto x46 = -V{0.333333333333333}*cell[0];
3037auto x47 = x28 + x29 + x40 + x41 + x42 + x43 + x44 + x45 + x46 - V{0.333333333333333}*cell[16] + V{0.666666666666667}*cell[17] + V{0.666666666666667}*cell[18] - V{0.333333333333333}*cell[3] + V{0.666666666666667}*cell[4] + V{0.666666666666667}*cell[5];
3038auto x48 = -V{0.333333333333333}*cell[15] + V{0.666666666666667}*cell[19] + V{0.666666666666667}*cell[20] - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[6] + V{0.666666666666667}*cell[7];
3039auto x49 = x19*x20;
3040auto x50 = -cell[10];
3041auto x51 = x15 + x50 + cell[13] + cell[26];
3042auto x52 = -V{0.333333333333333}*cell[14] - V{0.333333333333333}*cell[1] + V{0.666666666666667}*cell[21] + V{0.666666666666667}*cell[22] + V{0.666666666666667}*cell[8] + V{0.666666666666667}*cell[9];
3043rho = x8;
3044u[0] = -x19*x21;
3045u[1] = -x21*x25;
3046u[2] = -x21*x27;
3047pi[0] = -x21*x19*x19 + x47 + x48 + V{0.666666666666667}*cell[14] + V{0.666666666666667}*cell[1] - V{0.333333333333333}*cell[21] - V{0.333333333333333}*cell[22] - V{0.333333333333333}*cell[8] - V{0.333333333333333}*cell[9];
3048pi[1] = -V{1}*x1 - V{1}*x11 - V{1}*x25*x49 - V{1}*x26 - V{1}*x51 + V{1}*cell[4];
3049pi[2] = -V{1}*x14 - V{1}*x22 - V{1}*x27*x49 - V{1}*x3 - V{1}*x51 + V{1}*cell[6];
3050pi[3] = -x21*x25*x25 + x47 + x52 + V{0.666666666666667}*cell[15] - V{0.333333333333333}*cell[19] - V{0.333333333333333}*cell[20] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[6] - V{0.333333333333333}*cell[7];
3051pi[4] = -V{1}*x0 - V{1}*x16 - V{1}*x2 - V{1}*x20*x25*x27 - V{1}*x23 - V{1}*x4 - V{1}*x50 + V{1}*cell[8];
3052pi[5] = -x21*x27*x27 + x28 + x29 + x40 + x41 + x42 + x43 + x44 + x45 + x46 + x48 + x52 + V{0.666666666666667}*cell[16] - V{0.333333333333333}*cell[17] - V{0.333333333333333}*cell[18] + V{0.666666666666667}*cell[3] - V{0.333333333333333}*cell[4] - V{0.333333333333333}*cell[5];
3053
3054}
3055
3056template <typename CELL, typename FEQ, typename V=typename CELL::value_t>
3057static void computeFeq(CELL& cell, FEQ& fEq) any_platform
3058{
3059auto x0 = cell[8] + cell[9];
3060auto x1 = cell[15] + cell[21];
3061auto x2 = cell[11] + cell[26];
3062auto x3 = x0 + x1 + x2 + cell[0] + cell[10] + cell[12] + cell[13] + cell[14] + cell[16] + cell[17] + cell[18] + cell[19] + cell[1] + cell[20] + cell[22] + cell[23] + cell[24] + cell[25] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7];
3063auto x4 = x3 + V{1};
3064auto x5 = x3 + V{1};
3065auto x6 = V{1} / ((x5)*(x5));
3066auto x7 = V{1.5}*x6;
3067auto x8 = -cell[17];
3068auto x9 = -cell[19];
3069auto x10 = x8 + x9 + cell[4] + cell[6];
3070auto x11 = -cell[24];
3071auto x12 = cell[10] - cell[23];
3072auto x13 = x11 + x12 + cell[11];
3073auto x14 = cell[12] - cell[25];
3074auto x15 = -cell[14];
3075auto x16 = -cell[20] + cell[7];
3076auto x17 = x15 + x16 + cell[1];
3077auto x18 = -cell[18] + cell[5];
3078auto x19 = cell[13] - cell[26];
3079auto x20 = x10 + x13 + x14 + x17 + x18 + x19;
3080auto x21 = -x20;
3081auto x22 = x21*x21;
3082auto x23 = x22*x7;
3083auto x24 = -cell[13];
3084auto x25 = -cell[21];
3085auto x26 = x24 + x25 + cell[26] + cell[8];
3086auto x27 = -cell[22];
3087auto x28 = x8 + cell[4];
3088auto x29 = x27 + x28 + cell[9];
3089auto x57 = -cell[15];
3090auto x58 = x57 + cell[18] + cell[2] - cell[5];
3091auto x59 = -cell[12] + cell[25];
3092auto x60 = x13 + x26 + x29 + x58 + x59;
3093auto x61 = -x60;
3094auto x62 = x61*x61;
3095auto x63 = x62*x7;
3096auto x64 = -cell[16];
3097auto x65 = x14 + x64 + cell[3];
3098auto x66 = -cell[9];
3099auto x67 = x9 + cell[6];
3100auto x68 = x66 + x67 + cell[22];
3101auto x69 = cell[20] - cell[7];
3102auto x70 = x12 - cell[11] + cell[24];
3103auto x71 = x26 + x65 + x68 + x69 + x70;
3104auto x72 = -x71;
3105auto x73 = x72*x72;
3106auto x74 = x7*x73;
3107auto x75 = x63 + x74 + V{-1};
3108auto x76 = x23 + x75;
3109auto x77 = V{1} / (x5);
3110auto x78 = V{3}*cell[5];
3111auto x79 = V{3}*cell[7];
3112auto x80 = V{3}*cell[13];
3113auto x81 = V{3}*cell[18];
3114auto x82 = V{3}*cell[20];
3115auto x83 = V{3}*cell[26];
3116auto x84 = V{3}*cell[10];
3117auto x85 = V{3}*cell[11];
3118auto x86 = -V{3}*cell[23];
3119auto x87 = V{3}*cell[24];
3120auto x88 = x84 + x85 + x86 - x87 - V{3}*cell[17] + V{3}*cell[4];
3121auto x89 = V{3}*cell[12];
3122auto x90 = V{3}*cell[25];
3123auto x91 = x89 - x90 - V{3}*cell[19] + V{3}*cell[6];
3124auto x92 = x78 + x79 + x80 - x81 - x82 - x83 + x88 + x91 - V{3}*cell[14] + V{3}*cell[1];
3125auto x93 = -x77*x92;
3126auto x94 = V{3}*x6;
3127auto x95 = V{3}*cell[9];
3128auto x96 = V{3}*cell[22];
3129auto x97 = -x80 + x83 - V{3}*cell[21] + V{3}*cell[8];
3130auto x98 = -x78 + x81 + x88 - x89 + x90 + x95 - x96 + x97 - V{3}*cell[15] + V{3}*cell[2];
3131auto x99 = -x77*x98;
3132auto x100 = x23 + V{-1};
3133auto x101 = -x79 + x82 + x84 - x85 + x86 + x87 + x91 - x95 + x96 + x97 - V{3}*cell[16] + V{3}*cell[3];
3134auto x102 = -x101*x77;
3135auto x103 = V{4.5}*x6;
3136auto x104 = V{2}*cell[11] - V{2}*cell[24];
3137auto x105 = V{2}*cell[10] - V{2}*cell[23];
3138auto x106 = x105 + x25;
3139auto x107 = x57 + cell[2];
3140auto x108 = x107 - V{2}*cell[17] + V{2}*cell[4];
3141auto x109 = x0 + x104 + x106 + x108 + x17 + x27 + x67;
3142auto x110 = -x109;
3143auto x111 = x76 + x93;
3144auto x112 = x111 + x99;
3145auto x113 = V{2}*cell[25];
3146auto x114 = V{2}*cell[12];
3147auto x115 = -x113 + x114;
3148auto x116 = V{2}*cell[26];
3149auto x117 = V{2}*cell[13];
3150auto x118 = -x116 + x117 - cell[8];
3151auto x119 = V{2}*cell[18];
3152auto x120 = V{2}*cell[5];
3153auto x121 = -x119 + x120 - cell[2];
3154auto x122 = x1 + x115 + x118 + x121 + x17 + x68;
3155auto x123 = -x99;
3156auto x124 = x111 + x123;
3157auto x125 = x15 + cell[1];
3158auto x126 = x125 + x18;
3159auto x127 = x64 + cell[3];
3160auto x128 = -V{2}*cell[19] + V{2}*cell[6];
3161auto x129 = x127 + x128;
3162auto x130 = x106 + x115 + x126 + x129 + x28 + x66 + cell[22] + cell[8];
3163auto x131 = -x130;
3164auto x132 = -x102;
3165auto x133 = -cell[3];
3166auto x134 = x104 + x133 + cell[16];
3167auto x135 = V{2}*cell[20];
3168auto x136 = V{2}*cell[7];
3169auto x137 = -x135 + x136;
3170auto x138 = x118 + x126 + x134 + x137 + x29 + cell[21];
3171auto x139 = -V{2}*cell[21] + V{2}*cell[8];
3172auto x140 = x127 + x139;
3173auto x141 = x10 + x105 + x116 - x117 + x140 + x58 + x69;
3174auto x142 = -x141;
3175auto x143 = x76 + x99;
3176auto x144 = x102 + x143;
3177auto x145 = V{2}*cell[22];
3178auto x146 = V{2}*cell[9];
3179auto x147 = -x145 + x146;
3180auto x148 = x113 - x114 + x134 + x147 + x16 + x28 + x58 + cell[19] - cell[6];
3181auto x149 = x108 + x125;
3182auto x150 = x11 + x128 + x139 + x149 + x2 + x24 + x65 + V{3}*cell[10] - V{3}*cell[23];
3183auto x151 = -x150;
3184auto x152 = x12 + x133 + x137 + x147 + x149 + x19 + x59 + V{3}*cell[11] + cell[16] - V{3}*cell[24];
3185auto x153 = x121 + x125 + x129 + x145 - x146 + x19 + x70 + V{3}*cell[12] + cell[15] - V{3}*cell[25];
3186auto x154 = x77*x92;
3187auto x155 = x107 + x119 - x120 + x135 - x136 + x140 + x59 + x70 - V{3}*cell[13] + cell[14] - cell[1] + V{3}*cell[26];
3188auto x156 = -x155;
3189auto x157 = x101*x77;
3190auto x158 = x60*x60;
3191auto x159 = x158*x7;
3192auto x160 = x71*x71;
3193auto x161 = x160*x7 + V{-1};
3194auto x162 = x159 + x161;
3195auto x163 = x77*x98;
3196auto x164 = x20*x20;
3197auto x165 = x164*x7;
3198auto x166 = x163 + x165;
3199auto x167 = x157 + x162 + x166;
3200auto x168 = x154 + x162;
3201auto x169 = x157 + x165;
3202auto x170 = x166 + x168;
3203auto x171 = -x93;
3204auto x172 = -x122;
3205auto x173 = x168 + x169;
3206auto x174 = -x138;
3207auto x175 = x102 + x76;
3208auto x176 = -x148;
3209auto x177 = -x152;
3210auto x178 = -x153;
3211fEq[0] = -V{0.296296296296296}*x4*x76 + V{-0.296296296296296};
3212fEq[1] = -V{0.0740740740740741}*x4*(-x22*x94 + x75 + x93) + V{-0.0740740740740741};
3213fEq[2] = -V{0.0740740740740741}*x4*(x100 - x62*x94 + x74 + x99) + V{-0.0740740740740741};
3214fEq[3] = -V{0.0740740740740741}*x4*(x100 + x102 + x63 - x73*x94) + V{-0.0740740740740741};
3215fEq[4] = -V{0.0185185185185185}*(x4*(-x103*x110*x110 + x112) + V{1});
3216fEq[5] = -V{0.0185185185185185}*(x4*(-x103*x122*x122 + x124) + V{1});
3217fEq[6] = -V{0.0185185185185185}*(x4*(x102 - x103*x131*x131 + x111) + V{1});
3218fEq[7] = -V{0.0185185185185185}*(x4*(-x103*x138*x138 + x111 + x132) + V{1});
3219fEq[8] = -V{0.0185185185185185}*(x4*(-x103*x142*x142 + x144) + V{1});
3220fEq[9] = -V{0.0185185185185185}*(x4*(-x103*x148*x148 + x132 + x143) + V{1});
3221fEq[10] = -V{0.00462962962962963}*(x4*(x102 - x103*x151*x151 + x112) + V{1});
3222fEq[11] = -V{0.00462962962962963}*(x4*(-x103*x152*x152 + x112 + x132) + V{1});
3223fEq[12] = -V{0.00462962962962963}*(x4*(x102 - x103*x153*x153 + x124) + V{1});
3224fEq[13] = -V{0.00462962962962963}*(x4*(-x103*x156*x156 - x154 + x167) + V{1});
3225fEq[14] = -V{0.0740740740740741}*x4*(-x164*x94 + x168) + V{-0.0740740740740741};
3226fEq[15] = -V{0.0740740740740741}*x4*(-x158*x94 + x161 + x166) + V{-0.0740740740740741};
3227fEq[16] = -V{0.0740740740740741}*x4*(x159 - x160*x94 + x169 + V{-1}) + V{-0.0740740740740741};
3228fEq[17] = -V{0.0185185185185185}*(x4*(-x103*x109*x109 + x170) + V{1});
3229fEq[18] = -V{0.0185185185185185}*(x4*(-x103*x172*x172 + x143 + x171) + V{1});
3230fEq[19] = -V{0.0185185185185185}*(x4*(-x103*x130*x130 + x173) + V{1});
3231fEq[20] = -V{0.0185185185185185}*(x4*(-x103*x174*x174 + x171 + x175) + V{1});
3232fEq[21] = -V{0.0185185185185185}*(x4*(-x103*x141*x141 + x167) + V{1});
3233fEq[22] = -V{0.0185185185185185}*(x4*(-x103*x176*x176 + x123 + x175) + V{1});
3234fEq[23] = -V{0.00462962962962963}*(x4*(-x103*x150*x150 + x157 + x170) + V{1});
3235fEq[24] = -V{0.00462962962962963}*(x4*(-x103*x177*x177 - x157 + x170) + V{1});
3236fEq[25] = -V{0.00462962962962963}*(x4*(-x103*x178*x178 - x163 + x173) + V{1});
3237fEq[26] = -V{0.00462962962962963}*(x4*(-x103*x155*x155 + x144 + x171) + V{1});
3238
3239}
3240
3241template <typename CELL, typename FNEQ, typename RHO, typename U, typename V=typename CELL::value_t>
3242static void computeFneq(CELL& cell, FNEQ& fNeq, RHO& rho, U& u) any_platform
3243{
3244auto x0 = u[0]*u[0];
3245auto x1 = V{1.5}*x0;
3246auto x2 = u[1]*u[1];
3247auto x3 = V{1.5}*x2;
3248auto x4 = u[2]*u[2];
3249auto x5 = V{1.5}*x4;
3250auto x6 = x3 + x5 + V{-1};
3251auto x7 = x1 + x6;
3252auto x8 = V{0.0740740740740741}*rho;
3253auto x9 = V{3}*u[0];
3254auto x10 = V{3}*x0;
3255auto x11 = V{3}*u[1];
3256auto x12 = V{3}*x2;
3257auto x13 = x1 + V{-1};
3258auto x14 = V{3}*u[2];
3259auto x15 = V{3}*x4;
3260auto x16 = V{0.0185185185185185}*rho;
3261auto x17 = u[0] + u[1];
3262auto x18 = V{4.5}*(x17*x17);
3263auto x19 = x7 + x9;
3264auto x20 = x11 + x19;
3265auto x21 = u[0] - u[1];
3266auto x22 = -V{4.5}*x21*x21;
3267auto x23 = -x11;
3268auto x24 = x19 + x23;
3269auto x25 = u[0] + u[2];
3270auto x26 = V{4.5}*(x25*x25);
3271auto x27 = -x14;
3272auto x28 = -u[2];
3273auto x29 = x28 + u[0];
3274auto x57 = -V{4.5}*x29*x29;
3275auto x58 = u[1] + u[2];
3276auto x59 = V{4.5}*(x58*x58);
3277auto x60 = x11 + x7;
3278auto x61 = x14 + x60;
3279auto x62 = x28 + u[1];
3280auto x63 = -V{4.5}*x62*x62;
3281auto x64 = V{0.00462962962962963}*rho;
3282auto x65 = x17 + u[2];
3283auto x66 = V{4.5}*(x65*x65);
3284auto x67 = x17 + x28;
3285auto x68 = V{4.5}*(x67*x67);
3286auto x69 = x21 + u[2];
3287auto x70 = V{4.5}*(x69*x69);
3288auto x71 = x58 - u[0];
3289auto x72 = -V{4.5}*x71*x71;
3290auto x73 = -x3;
3291auto x74 = V{1} - x5;
3292auto x75 = x73 + x74;
3293auto x76 = x75 + x9;
3294auto x77 = -x1;
3295auto x78 = x11 + x77;
3296auto x79 = x14 + x77;
3297auto x80 = x76 + x78;
3298auto x81 = -x9;
3299auto x82 = x76 + x79;
3300auto x83 = x14 + x7;
3301fNeq[0] = V{0.296296296296296}*rho*x7 + cell[0] + V{0.296296296296296};
3302fNeq[1] = x8*(-x10 + x6 + x9) + cell[1] + V{0.0740740740740741};
3303fNeq[2] = x8*(x11 - x12 + x13 + x5) + cell[2] + V{0.0740740740740741};
3304fNeq[3] = x8*(x13 + x14 - x15 + x3) + cell[3] + V{0.0740740740740741};
3305fNeq[4] = x16*(-x18 + x20) + cell[4] + V{0.0185185185185185};
3306fNeq[5] = x16*(x22 + x24) + cell[5] + V{0.0185185185185185};
3307fNeq[6] = x16*(x14 + x19 - x26) + cell[6] + V{0.0185185185185185};
3308fNeq[7] = x16*(x19 + x27 + x57) + cell[7] + V{0.0185185185185185};
3309fNeq[8] = x16*(-x59 + x61) + cell[8] + V{0.0185185185185185};
3310fNeq[9] = x16*(x27 + x60 + x63) + cell[9] + V{0.0185185185185185};
3311fNeq[10] = x64*(x14 + x20 - x66) + cell[10] + V{0.00462962962962963};
3312fNeq[11] = x64*(x20 + x27 - x68) + cell[11] + V{0.00462962962962963};
3313fNeq[12] = x64*(x14 + x24 - x70) + cell[12] + V{0.00462962962962963};
3314fNeq[13] = -x64*(-x24 - x27 - x72) + cell[13] + V{0.00462962962962963};
3315fNeq[14] = -x8*(x10 + x76) + cell[14] + V{0.0740740740740741};
3316fNeq[15] = -x8*(x12 + x74 + x78) + cell[15] + V{0.0740740740740741};
3317fNeq[16] = -x8*(x15 + x73 + x79 + V{1}) + cell[16] + V{0.0740740740740741};
3318fNeq[17] = -x16*(x18 + x80) + cell[17] + V{0.0185185185185185};
3319fNeq[18] = x16*(x22 + x60 + x81) + cell[18] + V{0.0185185185185185};
3320fNeq[19] = -x16*(x26 + x82) + cell[19] + V{0.0185185185185185};
3321fNeq[20] = x16*(x57 + x81 + x83) + cell[20] + V{0.0185185185185185};
3322fNeq[21] = -x16*(x14 + x59 + x75 + x78) + cell[21] + V{0.0185185185185185};
3323fNeq[22] = x16*(x23 + x63 + x83) + cell[22] + V{0.0185185185185185};
3324fNeq[23] = -x64*(x14 + x66 + x80) + cell[23] + V{0.00462962962962963};
3325fNeq[24] = -x64*(x27 + x68 + x80) + cell[24] + V{0.00462962962962963};
3326fNeq[25] = -x64*(x23 + x70 + x82) + cell[25] + V{0.00462962962962963};
3327fNeq[26] = x64*(x61 + x72 + x81) + cell[26] + V{0.00462962962962963};
3328
3329}
3330
3331template <typename CELL, typename FNEQ, typename V=typename CELL::value_t>
3332static void computeFneq(CELL& cell, FNEQ& fNeq) any_platform
3333{
3334auto x0 = cell[15] + cell[21];
3335auto x1 = cell[12] + cell[26];
3336auto x2 = x0 + x1 + cell[0] + cell[10] + cell[11] + cell[13] + cell[14] + cell[16] + cell[17] + cell[18] + cell[19] + cell[1] + cell[20] + cell[22] + cell[23] + cell[24] + cell[25] + cell[2] + cell[3] + cell[4] + cell[5] + cell[6] + cell[7] + cell[8] + cell[9] + V{1};
3337auto x3 = V{1} / ((x2)*(x2));
3338auto x4 = V{1.5}*x3;
3339auto x5 = -cell[19];
3340auto x6 = -cell[25];
3341auto x7 = x5 + x6 + cell[12] + cell[6];
3342auto x8 = -cell[14];
3343auto x9 = cell[11] - cell[24];
3344auto x10 = x8 + x9 + cell[1];
3345auto x11 = -cell[18] + cell[5];
3346auto x12 = -cell[17];
3347auto x13 = x12 + cell[4];
3348auto x14 = -cell[20] + cell[7];
3349auto x15 = x13 + x14;
3350auto x16 = cell[10] - cell[23];
3351auto x17 = x16 + cell[13] - cell[26];
3352auto x18 = x10 + x11 + x15 + x17 + x7;
3353auto x19 = x18*x18;
3354auto x20 = x19*x4;
3355auto x21 = -cell[21];
3356auto x22 = x12 + x21 + cell[4] + cell[8];
3357auto x23 = -cell[13];
3358auto x24 = x16 + x23 + cell[26];
3359auto x25 = -cell[15];
3360auto x26 = -cell[22] + cell[9];
3361auto x27 = x25 + x26 + cell[2];
3362auto x28 = cell[18] - cell[5];
3363auto x29 = -cell[12] + cell[25];
3364auto x57 = x22 + x24 + x27 + x28 + x29 + x9;
3365auto x58 = x57*x57;
3366auto x59 = x4*x58;
3367auto x60 = x21 + cell[8];
3368auto x61 = -cell[16];
3369auto x62 = cell[22] - cell[9];
3370auto x63 = x61 + x62 + cell[3];
3371auto x64 = -cell[11] + cell[24];
3372auto x65 = cell[20] - cell[7];
3373auto x66 = x24 + x60 + x63 + x64 + x65 + x7;
3374auto x67 = x66*x66;
3375auto x68 = x4*x67;
3376auto x69 = x59 + x68 + V{-1};
3377auto x70 = x20 + x69;
3378auto x71 = V{0.0740740740740741}*cell[0] + V{0.0740740740740741}*cell[10] + V{0.0740740740740741}*cell[11] + V{0.0740740740740741}*cell[12] + V{0.0740740740740741}*cell[13] + V{0.0740740740740741}*cell[14] + V{0.0740740740740741}*cell[15] + V{0.0740740740740741}*cell[16] + V{0.0740740740740741}*cell[17] + V{0.0740740740740741}*cell[18] + V{0.0740740740740741}*cell[19] + V{0.0740740740740741}*cell[1] + V{0.0740740740740741}*cell[20] + V{0.0740740740740741}*cell[21] + V{0.0740740740740741}*cell[22] + V{0.0740740740740741}*cell[23] + V{0.0740740740740741}*cell[24] + V{0.0740740740740741}*cell[25] + V{0.0740740740740741}*cell[26] + V{0.0740740740740741}*cell[2] + V{0.0740740740740741}*cell[3] + V{0.0740740740740741}*cell[4] + V{0.0740740740740741}*cell[5] + V{0.0740740740740741}*cell[6] + V{0.0740740740740741}*cell[7] + V{0.0740740740740741}*cell[8] + V{0.0740740740740741}*cell[9] + V{0.0740740740740741};
3379auto x72 = V{3}*x3;
3380auto x73 = x19*x72;
3381auto x74 = V{1} / (x2);
3382auto x75 = V{3}*cell[5];
3383auto x76 = V{3}*cell[7];
3384auto x77 = V{3}*cell[13];
3385auto x78 = V{3}*cell[18];
3386auto x79 = V{3}*cell[20];
3387auto x80 = V{3}*cell[26];
3388auto x81 = V{3}*cell[10];
3389auto x82 = V{3}*cell[11];
3390auto x83 = -V{3}*cell[23];
3391auto x84 = V{3}*cell[24];
3392auto x85 = x81 + x82 + x83 - x84 - V{3}*cell[17] + V{3}*cell[4];
3393auto x86 = V{3}*cell[12];
3394auto x87 = V{3}*cell[25];
3395auto x88 = x86 - x87 - V{3}*cell[19] + V{3}*cell[6];
3396auto x89 = x74*(x75 + x76 + x77 - x78 - x79 - x80 + x85 + x88 - V{3}*cell[14] + V{3}*cell[1]);
3397auto x90 = -V{1.5}*x3*x58;
3398auto x91 = -V{1.5}*x3*x67 + V{1};
3399auto x92 = x90 + x91;
3400auto x93 = x89 + x92;
3401auto x94 = x58*x72;
3402auto x95 = V{3}*cell[9];
3403auto x96 = V{3}*cell[22];
3404auto x97 = -x77 + x80 - V{3}*cell[21] + V{3}*cell[8];
3405auto x98 = x74*(-x75 + x78 + x85 - x86 + x87 + x95 - x96 + x97 - V{3}*cell[15] + V{3}*cell[2]);
3406auto x99 = -V{1.5}*x19*x3;
3407auto x100 = x98 + x99;
3408auto x101 = x67*x72;
3409auto x102 = x74*(-x76 + x79 + x81 - x82 + x83 + x84 + x88 - x95 + x96 + x97 - V{3}*cell[16] + V{3}*cell[3]);
3410auto x103 = x102 + x99;
3411auto x104 = V{0.0185185185185185}*cell[0] + V{0.0185185185185185}*cell[10] + V{0.0185185185185185}*cell[11] + V{0.0185185185185185}*cell[12] + V{0.0185185185185185}*cell[13] + V{0.0185185185185185}*cell[14] + V{0.0185185185185185}*cell[15] + V{0.0185185185185185}*cell[16] + V{0.0185185185185185}*cell[17] + V{0.0185185185185185}*cell[18] + V{0.0185185185185185}*cell[19] + V{0.0185185185185185}*cell[1] + V{0.0185185185185185}*cell[20] + V{0.0185185185185185}*cell[21] + V{0.0185185185185185}*cell[22] + V{0.0185185185185185}*cell[23] + V{0.0185185185185185}*cell[24] + V{0.0185185185185185}*cell[25] + V{0.0185185185185185}*cell[26] + V{0.0185185185185185}*cell[2] + V{0.0185185185185185}*cell[3] + V{0.0185185185185185}*cell[4] + V{0.0185185185185185}*cell[5] + V{0.0185185185185185}*cell[6] + V{0.0185185185185185}*cell[7] + V{0.0185185185185185}*cell[8] + V{0.0185185185185185}*cell[9] + V{0.0185185185185185};
3412auto x105 = V{4.5}*x3;
3413auto x106 = V{2}*cell[11] - V{2}*cell[24];
3414auto x107 = -V{2}*cell[17] + V{2}*cell[4];
3415auto x108 = -V{2}*cell[23];
3416auto x109 = V{2}*cell[10];
3417auto x110 = x8 + cell[1];
3418auto x111 = x108 + x109 + x110;
3419auto x112 = x5 + cell[6];
3420auto x113 = x112 + x14;
3421auto x114 = x106 + x107 + x111 + x113 + x27 + x60;
3422auto x115 = -x114;
3423auto x116 = x100 + x93;
3424auto x117 = V{2}*cell[25];
3425auto x118 = V{2}*cell[12];
3426auto x119 = -x117 + x118;
3427auto x120 = V{2}*cell[26];
3428auto x121 = V{2}*cell[13];
3429auto x122 = x110 - x120 + x121 - cell[8];
3430auto x123 = V{2}*cell[18];
3431auto x124 = V{2}*cell[5];
3432auto x125 = -x123 + x124 - cell[2];
3433auto x126 = -x0 - x113 - x119 - x122 - x125 - x62;
3434auto x127 = -x105*x126*x126;
3435auto x128 = -x89;
3436auto x129 = x128 + x70;
3437auto x130 = x129 + x98;
3438auto x131 = -V{2}*cell[19] + V{2}*cell[6];
3439auto x132 = x11 + x111 + x119 + x131 + x22 + x63;
3440auto x133 = -x132;
3441auto x134 = x103 + x93;
3442auto x135 = -cell[3];
3443auto x136 = x106 + x135 + cell[16];
3444auto x137 = V{2}*cell[20];
3445auto x138 = V{2}*cell[7];
3446auto x139 = -x137 + x138;
3447auto x140 = -x11 - x122 - x13 - x136 - x139 - x26 - cell[21];
3448auto x141 = -x105*x140*x140;
3449auto x142 = x102 + x129;
3450auto x143 = x25 + cell[2];
3451auto x144 = x143 + x28;
3452auto x145 = x61 + cell[3];
3453auto x146 = x145 - V{2}*cell[21] + V{2}*cell[8];
3454auto x147 = x108 + x109 + x112 + x120 - x121 + x13 + x144 + x146 + x65;
3455auto x148 = -x147;
3456auto x149 = x100 + x102 + x92;
3457auto x150 = V{2}*cell[22];
3458auto x151 = V{2}*cell[9];
3459auto x152 = -x150 + x151;
3460auto x153 = -x117 + x118 - x136 - x144 - x15 - x152 - cell[19] + cell[6];
3461auto x154 = -x105*x153*x153;
3462auto x155 = -x98;
3463auto x156 = x155 + x70;
3464auto x157 = x102 + x156;
3465auto x158 = V{0.00462962962962963}*cell[0] + V{0.00462962962962963}*cell[10] + V{0.00462962962962963}*cell[11] + V{0.00462962962962963}*cell[12] + V{0.00462962962962963}*cell[13] + V{0.00462962962962963}*cell[14] + V{0.00462962962962963}*cell[15] + V{0.00462962962962963}*cell[16] + V{0.00462962962962963}*cell[17] + V{0.00462962962962963}*cell[18] + V{0.00462962962962963}*cell[19] + V{0.00462962962962963}*cell[1] + V{0.00462962962962963}*cell[20] + V{0.00462962962962963}*cell[21] + V{0.00462962962962963}*cell[22] + V{0.00462962962962963}*cell[23] + V{0.00462962962962963}*cell[24] + V{0.00462962962962963}*cell[25] + V{0.00462962962962963}*cell[26] + V{0.00462962962962963}*cell[2] + V{0.00462962962962963}*cell[3] + V{0.00462962962962963}*cell[4] + V{0.00462962962962963}*cell[5] + V{0.00462962962962963}*cell[6] + V{0.00462962962962963}*cell[7] + V{0.00462962962962963}*cell[8] + V{0.00462962962962963}*cell[9] + V{0.00462962962962963};
3466auto x159 = x107 + x143;
3467auto x160 = x1 + x10 + x131 + x146 + x159 + x23 + x6 + V{3}*cell[10] - V{3}*cell[23];
3468auto x161 = -x160;
3469auto x162 = x110 + x17;
3470auto x163 = -x135 - x139 - x152 - x159 - x162 - x29 - V{3}*cell[11] - cell[16] + V{3}*cell[24];
3471auto x164 = -x105*x163*x163;
3472auto x165 = -x125 - x131 - x145 - x150 + x151 - x162 - x64 - V{3}*cell[12] - cell[15] + V{3}*cell[25];
3473auto x166 = x105*(x165*x165);
3474auto x167 = -x123 + x124 - x137 + x138 - x143 - x146 - x16 - x29 - x64 + V{3}*cell[13] - cell[14] + cell[1] - V{3}*cell[26];
3475auto x168 = x105*(x167*x167);
3476auto x169 = x20 + V{-1};
3477auto x170 = x70 + x89;
3478auto x171 = x170 + x98;
3479auto x172 = -x102;
3480auto x173 = x70 + x98;
3481fNeq[0] = x70*(V{0.296296296296296}*cell[0] + V{0.296296296296296}*cell[10] + V{0.296296296296296}*cell[11] + V{0.296296296296296}*cell[12] + V{0.296296296296296}*cell[13] + V{0.296296296296296}*cell[14] + V{0.296296296296296}*cell[15] + V{0.296296296296296}*cell[16] + V{0.296296296296296}*cell[17] + V{0.296296296296296}*cell[18] + V{0.296296296296296}*cell[19] + V{0.296296296296296}*cell[1] + V{0.296296296296296}*cell[20] + V{0.296296296296296}*cell[21] + V{0.296296296296296}*cell[22] + V{0.296296296296296}*cell[23] + V{0.296296296296296}*cell[24] + V{0.296296296296296}*cell[25] + V{0.296296296296296}*cell[26] + V{0.296296296296296}*cell[2] + V{0.296296296296296}*cell[3] + V{0.296296296296296}*cell[4] + V{0.296296296296296}*cell[5] + V{0.296296296296296}*cell[6] + V{0.296296296296296}*cell[7] + V{0.296296296296296}*cell[8] + V{0.296296296296296}*cell[9] + V{0.296296296296296}) + cell[0] + V{0.296296296296296};
3482fNeq[1] = x71*(-x73 - x93) + cell[1] + V{0.0740740740740741};
3483fNeq[2] = x71*(-x100 - x91 - x94) + cell[2] + V{0.0740740740740741};
3484fNeq[3] = x71*(-x101 - x103 - x90 + V{-1}) + cell[3] + V{0.0740740740740741};
3485fNeq[4] = -x104*(x105*(x115*x115) + x116) + cell[4] + V{0.0185185185185185};
3486fNeq[5] = x104*(x127 + x130) + cell[5] + V{0.0185185185185185};
3487fNeq[6] = -x104*(x105*(x133*x133) + x134) + cell[6] + V{0.0185185185185185};
3488fNeq[7] = x104*(x141 + x142) + cell[7] + V{0.0185185185185185};
3489fNeq[8] = -x104*(x105*(x148*x148) + x149) + cell[8] + V{0.0185185185185185};
3490fNeq[9] = x104*(x154 + x157) + cell[9] + V{0.0185185185185185};
3491fNeq[10] = -x158*(x102 + x105*(x161*x161) + x116) + cell[10] + V{0.00462962962962963};
3492fNeq[11] = x158*(x142 + x155 + x164) + cell[11] + V{0.00462962962962963};
3493fNeq[12] = x158*(-x134 - x155 - x166) + cell[12] + V{0.00462962962962963};
3494fNeq[13] = x158*(x102 + x130 - x168) + cell[13] + V{0.00462962962962963};
3495fNeq[14] = x71*(x69 - x73 + x89) + cell[14] + V{0.0740740740740741};
3496fNeq[15] = x71*(x169 + x68 - x94 + x98) + cell[15] + V{0.0740740740740741};
3497fNeq[16] = x71*(-x101 + x102 + x169 + x59) + cell[16] + V{0.0740740740740741};
3498fNeq[17] = x104*(-x105*x114*x114 + x171) + cell[17] + V{0.0185185185185185};
3499fNeq[18] = x104*(x127 + x156 + x89) + cell[18] + V{0.0185185185185185};
3500fNeq[19] = x104*(x102 - x105*x132*x132 + x170) + cell[19] + V{0.0185185185185185};
3501fNeq[20] = x104*(x141 + x170 + x172) + cell[20] + V{0.0185185185185185};
3502fNeq[21] = x104*(x102 - x105*x147*x147 + x173) + cell[21] + V{0.0185185185185185};
3503fNeq[22] = x104*(x154 + x172 + x173) + cell[22] + V{0.0185185185185185};
3504fNeq[23] = x158*(x102 - x105*x160*x160 + x171) + cell[23] + V{0.00462962962962963};
3505fNeq[24] = x158*(x164 + x171 + x172) + cell[24] + V{0.00462962962962963};
3506fNeq[25] = x158*(x157 - x166 + x89) + cell[25] + V{0.00462962962962963};
3507fNeq[26] = x158*(-x128 - x149 - x168) + cell[26] + V{0.00462962962962963};
3508
3509}
3510
3511template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
3512static auto bgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
3513{
3514auto x27 = omega + V{-1};
3515auto x28 = u[0]*u[0];
3516auto x29 = V{1.5}*x28;
3517auto x30 = u[1]*u[1];
3518auto x31 = V{1.5}*x30;
3519auto x32 = u[2]*u[2];
3520auto x33 = V{1.5}*x32;
3521auto x34 = x31 + x33 + V{-1};
3522auto x35 = x29 + x34;
3523auto x36 = V{0.0740740740740741}*omega;
3524auto x37 = V{3}*u[0];
3525auto x38 = V{3}*x28;
3526auto x39 = V{3}*u[1];
3527auto x40 = V{3}*x30;
3528auto x41 = x29 + V{-1};
3529auto x42 = V{3}*u[2];
3530auto x43 = V{3}*x32;
3531auto x44 = V{0.0185185185185185}*omega;
3532auto x45 = u[0] + u[1];
3533auto x46 = V{4.5}*(x45*x45);
3534auto x47 = x35 + x37;
3535auto x48 = x39 + x47;
3536auto x49 = u[0] - u[1];
3537auto x50 = -x49;
3538auto x51 = -x39;
3539auto x52 = x47 + x51;
3540auto x53 = u[0] + u[2];
3541auto x54 = V{4.5}*(x53*x53);
3542auto x55 = -x42;
3543auto x56 = -u[2];
3544auto x57 = x56 + u[0];
3545auto x58 = -x57;
3546auto x59 = u[1] + u[2];
3547auto x60 = V{4.5}*(x59*x59);
3548auto x61 = x35 + x39;
3549auto x62 = x42 + x61;
3550auto x63 = x56 + u[1];
3551auto x64 = -x63;
3552auto x65 = V{0.00462962962962963}*omega;
3553auto x66 = x45 + u[2];
3554auto x67 = V{4.5}*(x66*x66);
3555auto x68 = x45 + x56;
3556auto x69 = -x68;
3557auto x70 = x49 + u[2];
3558auto x71 = -x70;
3559auto x72 = x59 - u[0];
3560auto x73 = -x31;
3561auto x74 = V{1} - x33;
3562auto x75 = x73 + x74;
3563auto x76 = x37 + x75;
3564auto x77 = -x29;
3565auto x78 = x39 + x77;
3566auto x79 = x42 + x77;
3567auto x80 = x76 + x78;
3568auto x81 = -x37;
3569auto x82 = x76 + x79;
3570auto x83 = x35 + x42;
3571auto x84 = -x72;
3572cell[0] = -V{0.296296296296296}*omega*(rho*x35 + V{1}) - x27*cell[0];
3573cell[1] = -x27*cell[1] - x36*(rho*(x34 + x37 - x38) + V{1});
3574cell[2] = -x27*cell[2] - x36*(rho*(x33 + x39 - x40 + x41) + V{1});
3575cell[3] = -x27*cell[3] - x36*(rho*(x31 + x41 + x42 - x43) + V{1});
3576cell[4] = -x27*cell[4] - x44*(rho*(-x46 + x48) + V{1});
3577cell[5] = -x27*cell[5] - x44*(rho*(x52 - V{4.5}*x50*x50) + V{1});
3578cell[6] = -x27*cell[6] - x44*(rho*(x42 + x47 - x54) + V{1});
3579cell[7] = -x27*cell[7] - x44*(rho*(x47 + x55 - V{4.5}*x58*x58) + V{1});
3580cell[8] = -x27*cell[8] - x44*(rho*(-x60 + x62) + V{1});
3581cell[9] = -x27*cell[9] - x44*(rho*(x55 + x61 - V{4.5}*x64*x64) + V{1});
3582cell[10] = -x27*cell[10] - x65*(rho*(x42 + x48 - x67) + V{1});
3583cell[11] = -x27*cell[11] - x65*(rho*(x48 + x55 - V{4.5}*x69*x69) + V{1});
3584cell[12] = -x27*cell[12] - x65*(rho*(x42 + x52 - V{4.5}*x71*x71) + V{1});
3585cell[13] = -x27*cell[13] + x65*(-rho*(x52 + x55 - V{4.5}*x72*x72) + V{-1});
3586cell[14] = -x27*cell[14] + x36*(rho*(x38 + x76) + V{-1});
3587cell[15] = -x27*cell[15] + x36*(rho*(x40 + x74 + x78) + V{-1});
3588cell[16] = -x27*cell[16] + x36*(rho*(x43 + x73 + x79 + V{1}) + V{-1});
3589cell[17] = -x27*cell[17] + x44*(rho*(x46 + x80) + V{-1});
3590cell[18] = -x27*cell[18] - x44*(rho*(x61 + x81 - V{4.5}*x49*x49) + V{1});
3591cell[19] = -x27*cell[19] + x44*(rho*(x54 + x82) + V{-1});
3592cell[20] = -x27*cell[20] - x44*(rho*(x81 + x83 - V{4.5}*x57*x57) + V{1});
3593cell[21] = -x27*cell[21] + x44*(rho*(x42 + x60 + x75 + x78) + V{-1});
3594cell[22] = -x27*cell[22] - x44*(rho*(x51 + x83 - V{4.5}*x63*x63) + V{1});
3595cell[23] = -x27*cell[23] + x65*(rho*(x42 + x67 + x80) + V{-1});
3596cell[24] = -x27*cell[24] + x65*(rho*(x55 + x80 + V{4.5}*(x68*x68)) + V{-1});
3597cell[25] = -x27*cell[25] + x65*(rho*(x51 + x82 + V{4.5}*(x70*x70)) + V{-1});
3598cell[26] = -x27*cell[26] - x65*(rho*(x62 + x81 - V{4.5}*x84*x84) + V{1});
3599return x28 + x30 + x32;
3600}
3601
3602template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
3603static auto adeBgkCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
3604{
3605auto x27 = omega + V{-1};
3606auto x28 = V{3}*u[0];
3607auto x29 = x28 + V{-1};
3608auto x30 = V{0.0740740740740741}*omega;
3609auto x31 = V{3}*u[1];
3610auto x32 = x31 + V{-1};
3611auto x33 = V{3}*u[2];
3612auto x34 = x29 + x31;
3613auto x35 = V{0.0185185185185185}*omega;
3614auto x36 = -x28;
3615auto x37 = x31 + V{1};
3616auto x38 = x36 + x37;
3617auto x39 = x29 + x33;
3618auto x40 = x33 + V{1};
3619auto x41 = -x31;
3620auto x42 = V{0.00462962962962963}*omega;
3621auto x43 = -x33;
3622auto x44 = x28 + V{1};
3623auto x45 = x31 + x44;
3624auto x46 = x41 + x44;
3625cell[0] = V{0.296296296296296}*omega*(rho + V{-1}) - x27*cell[0];
3626cell[1] = -x27*cell[1] - x30*(rho*x29 + V{1});
3627cell[2] = -x27*cell[2] - x30*(rho*x32 + V{1});
3628cell[3] = -x27*cell[3] - x30*(rho*(x33 + V{-1}) + V{1});
3629cell[4] = -x27*cell[4] - x35*(rho*x34 + V{1});
3630cell[5] = -x27*cell[5] + x35*(rho*x38 + V{-1});
3631cell[6] = -x27*cell[6] - x35*(rho*x39 + V{1});
3632cell[7] = -x27*cell[7] + x35*(rho*(x36 + x40) + V{-1});
3633cell[8] = -x27*cell[8] - x35*(rho*(x32 + x33) + V{1});
3634cell[9] = -x27*cell[9] + x35*(rho*(x40 + x41) + V{-1});
3635cell[10] = -x27*cell[10] - x42*(rho*(x33 + x34) + V{1});
3636cell[11] = -x27*cell[11] - x42*(rho*(x34 + x43) + V{1});
3637cell[12] = -x27*cell[12] - x42*(rho*(x39 + x41) + V{1});
3638cell[13] = -x27*cell[13] + x42*(rho*(x33 + x38) + V{-1});
3639cell[14] = -x27*cell[14] + x30*(rho*x44 + V{-1});
3640cell[15] = -x27*cell[15] + x30*(rho*x37 + V{-1});
3641cell[16] = -x27*cell[16] + x30*(rho*x40 + V{-1});
3642cell[17] = -x27*cell[17] + x35*(rho*x45 + V{-1});
3643cell[18] = -x27*cell[18] + x35*(rho*x46 + V{-1});
3644cell[19] = -x27*cell[19] + x35*(rho*(x33 + x44) + V{-1});
3645cell[20] = -x27*cell[20] + x35*(rho*(x43 + x44) + V{-1});
3646cell[21] = -x27*cell[21] + x35*(rho*(x33 + x37) + V{-1});
3647cell[22] = -x27*cell[22] + x35*(rho*(x37 + x43) + V{-1});
3648cell[23] = -x27*cell[23] + x42*(rho*(x33 + x45) + V{-1});
3649cell[24] = -x27*cell[24] + x42*(rho*(x43 + x45) + V{-1});
3650cell[25] = -x27*cell[25] + x42*(rho*(x33 + x46) + V{-1});
3651cell[26] = -x27*cell[26] + x42*(rho*(x43 + x46) + V{-1});
3652return u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
3653}
3654
3655template <typename CELL, typename PRESSURE, typename J, typename OMEGA, typename V=typename CELL::value_t>
3656static auto incBgkCollision(CELL& cell, PRESSURE& pressure, J& j, OMEGA& omega) any_platform
3657{
3658auto x27 = j[0]*j[0];
3659auto x28 = j[1]*j[1];
3660auto x29 = j[2]*j[2];
3661auto x30 = omega + V{-1};
3662auto x31 = V{0.111111111111111}*x28;
3663auto x32 = V{0.222222222222222}*j[0];
3664auto x33 = V{0.222222222222222}*x27;
3665auto x34 = V{0.111111111111111}*x29;
3666auto x35 = V{0.222222222222222}*pressure;
3667auto x36 = -x35;
3668auto x37 = x34 + x36 + V{0.0740740740740741};
3669auto x38 = V{0.111111111111111}*x27;
3670auto x39 = V{0.222222222222222}*j[1];
3671auto x40 = V{0.222222222222222}*x28;
3672auto x41 = V{0.222222222222222}*j[2];
3673auto x42 = V{0.222222222222222}*x29;
3674auto x43 = j[0] + j[1];
3675auto x44 = V{0.0833333333333333}*(x43*x43);
3676auto x45 = V{0.0555555555555556}*j[0];
3677auto x46 = V{0.0555555555555556}*j[1];
3678auto x47 = x45 + x46;
3679auto x48 = V{0.0277777777777778}*x27;
3680auto x49 = V{0.0277777777777778}*x28;
3681auto x50 = V{0.0277777777777778}*x29;
3682auto x51 = V{0.0555555555555556}*pressure;
3683auto x52 = x48 + x49 + x50 - x51 + V{0.0185185185185185};
3684auto x53 = -x46;
3685auto x54 = j[0] - j[1];
3686auto x55 = -x54;
3687auto x56 = x45 + x52;
3688auto x57 = V{0.0555555555555556}*j[2];
3689auto x58 = j[0] + j[2];
3690auto x59 = V{0.0833333333333333}*(x58*x58);
3691auto x60 = -x57;
3692auto x61 = -j[2];
3693auto x62 = x61 + j[0];
3694auto x63 = -x62;
3695auto x64 = j[1] + j[2];
3696auto x65 = V{0.0833333333333333}*(x64*x64);
3697auto x66 = x46 + x52;
3698auto x67 = x61 + j[1];
3699auto x68 = -x67;
3700auto x69 = x43 + j[2];
3701auto x70 = V{0.0208333333333333}*(x69*x69);
3702auto x71 = V{0.0138888888888889}*j[0];
3703auto x72 = V{0.0138888888888889}*j[1];
3704auto x73 = V{0.0138888888888889}*j[2];
3705auto x74 = x71 + x72 + x73;
3706auto x75 = V{0.00694444444444444}*x27;
3707auto x76 = V{0.00694444444444444}*x28;
3708auto x77 = V{0.00694444444444444}*x29;
3709auto x78 = V{0.0138888888888889}*pressure;
3710auto x79 = x75 + x76 + x77 - x78 + V{0.00462962962962963};
3711auto x80 = x43 + x61;
3712auto x81 = -x80;
3713auto x82 = -x73;
3714auto x83 = x71 + x79;
3715auto x84 = x82 + x83;
3716auto x85 = x54 + j[2];
3717auto x86 = -x85;
3718auto x87 = -x72;
3719auto x88 = x73 + x87;
3720auto x89 = x64 - j[0];
3721auto x90 = -x31;
3722auto x91 = -x34 + x35 + V{-0.0740740740740741};
3723auto x92 = -x38;
3724auto x93 = -x48 - x49 - x50 + x51 + V{-0.0185185185185185};
3725auto x94 = -x45;
3726auto x95 = x57 + x93;
3727auto x96 = x52 + x57;
3728auto x97 = -x71 + x79;
3729auto x98 = x72 + x97;
3730auto x99 = -x89;
3731cell[0] = -omega*(-V{0.888888888888889}*pressure + V{0.444444444444444}*x27 + V{0.444444444444444}*x28 + V{0.444444444444444}*x29 + V{0.296296296296296}) - x30*cell[0];
3732cell[1] = -omega*(x31 + x32 - x33 + x37) - x30*cell[1];
3733cell[2] = -omega*(x37 + x38 + x39 - x40) - x30*cell[2];
3734cell[3] = -omega*(x31 + x36 + x38 + x41 - x42 + V{0.0740740740740741}) - x30*cell[3];
3735cell[4] = -omega*(-x44 + x47 + x52) - x30*cell[4];
3736cell[5] = -omega*(x53 + x56 - V{0.0833333333333333}*x55*x55) - x30*cell[5];
3737cell[6] = -omega*(x56 + x57 - x59) - x30*cell[6];
3738cell[7] = -omega*(x56 + x60 - V{0.0833333333333333}*x63*x63) - x30*cell[7];
3739cell[8] = -omega*(x57 - x65 + x66) - x30*cell[8];
3740cell[9] = -omega*(x60 + x66 - V{0.0833333333333333}*x68*x68) - x30*cell[9];
3741cell[10] = -omega*(-x70 + x74 + x79) - x30*cell[10];
3742cell[11] = -omega*(x72 + x84 - V{0.0208333333333333}*x81*x81) - x30*cell[11];
3743cell[12] = -omega*(x83 + x88 - V{0.0208333333333333}*x86*x86) - x30*cell[12];
3744cell[13] = -omega*(x84 + x87 - V{0.0208333333333333}*x89*x89) - x30*cell[13];
3745cell[14] = omega*(x32 + x33 + x90 + x91) - x30*cell[14];
3746cell[15] = omega*(x39 + x40 + x91 + x92) - x30*cell[15];
3747cell[16] = omega*(x35 + x41 + x42 + x90 + x92 + V{-0.0740740740740741}) - x30*cell[16];
3748cell[17] = omega*(x44 + x47 + x93) - x30*cell[17];
3749cell[18] = -omega*(x66 + x94 - V{0.0833333333333333}*x54*x54) - x30*cell[18];
3750cell[19] = omega*(x45 + x59 + x95) - x30*cell[19];
3751cell[20] = -omega*(x94 + x96 - V{0.0833333333333333}*x62*x62) - x30*cell[20];
3752cell[21] = omega*(x46 + x65 + x95) - x30*cell[21];
3753cell[22] = -omega*(x53 + x96 - V{0.0833333333333333}*x67*x67) - x30*cell[22];
3754cell[23] = omega*(x70 + x74 - x75 - x76 - x77 + x78 + V{-0.00462962962962963}) - x30*cell[23];
3755cell[24] = -omega*(x88 + x97 - V{0.0208333333333333}*x80*x80) - x30*cell[24];
3756cell[25] = -omega*(x82 + x98 - V{0.0208333333333333}*x85*x85) - x30*cell[25];
3757cell[26] = -omega*(x73 + x98 - V{0.0208333333333333}*x99*x99) - x30*cell[26];
3758return x27 + x28 + x29;
3759}
3760
3761template <typename CELL, typename RHO, typename U, typename RATIORHO, typename OMEGA, typename V=typename CELL::value_t>
3762static auto constRhoBgkCollision(CELL& cell, RHO& rho, U& u, RATIORHO& ratioRho, OMEGA& omega) any_platform
3763{
3764auto x27 = omega + V{-1};
3765auto x28 = V{0.296296296296296}*rho;
3766auto x29 = u[0]*u[0];
3767auto x30 = V{1.5}*x29;
3768auto x31 = u[1]*u[1];
3769auto x32 = V{1.5}*x31;
3770auto x33 = u[2]*u[2];
3771auto x34 = V{1.5}*x33;
3772auto x35 = x32 + x34 + V{-1};
3773auto x36 = x30 + x35;
3774auto x37 = V{0.0740740740740741}*rho;
3775auto x38 = V{3}*u[0];
3776auto x39 = V{3}*x29;
3777auto x40 = x35 + x38 - x39;
3778auto x41 = ratioRho*x37;
3779auto x42 = V{3}*u[1];
3780auto x43 = V{3}*x31;
3781auto x44 = x30 + V{-1};
3782auto x45 = x34 + x42 - x43 + x44;
3783auto x46 = V{3}*u[2];
3784auto x47 = V{3}*x33;
3785auto x48 = x32 + x44 + x46 - x47;
3786auto x49 = V{0.0185185185185185}*rho;
3787auto x50 = u[0] + u[1];
3788auto x51 = V{4.5}*(x50*x50);
3789auto x52 = x36 + x38;
3790auto x53 = x42 + x52;
3791auto x54 = -x51 + x53;
3792auto x55 = ratioRho*x49;
3793auto x56 = u[0] - u[1];
3794auto x57 = -x56;
3795auto x58 = -x42;
3796auto x59 = x52 + x58;
3797auto x60 = x59 - V{4.5}*x57*x57;
3798auto x61 = u[0] + u[2];
3799auto x62 = V{4.5}*(x61*x61);
3800auto x63 = x46 + x52 - x62;
3801auto x64 = -x46;
3802auto x65 = -u[2];
3803auto x66 = x65 + u[0];
3804auto x67 = -x66;
3805auto x68 = x52 + x64 - V{4.5}*x67*x67;
3806auto x69 = u[1] + u[2];
3807auto x70 = V{4.5}*(x69*x69);
3808auto x71 = x36 + x42;
3809auto x72 = x46 + x71;
3810auto x73 = -x70 + x72;
3811auto x74 = x65 + u[1];
3812auto x75 = -x74;
3813auto x76 = x64 + x71 - V{4.5}*x75*x75;
3814auto x77 = V{0.00462962962962963}*rho;
3815auto x78 = x50 + u[2];
3816auto x79 = V{4.5}*(x78*x78);
3817auto x80 = x46 + x53 - x79;
3818auto x81 = ratioRho*x77;
3819auto x82 = x50 + x65;
3820auto x83 = -x82;
3821auto x84 = x53 + x64 - V{4.5}*x83*x83;
3822auto x85 = x56 + u[2];
3823auto x86 = -x85;
3824auto x87 = x46 + x59 - V{4.5}*x86*x86;
3825auto x88 = x69 - u[0];
3826auto x89 = -x59 - x64 + V{4.5}*(x88*x88);
3827auto x90 = -x32;
3828auto x91 = V{1} - x34;
3829auto x92 = x90 + x91;
3830auto x93 = x38 + x92;
3831auto x94 = x39 + x93;
3832auto x95 = -x30;
3833auto x96 = x42 + x95;
3834auto x97 = x43 + x91 + x96;
3835auto x98 = x46 + x95;
3836auto x99 = x47 + x90 + x98 + V{1};
3837auto x100 = x93 + x96;
3838auto x101 = x100 + x51;
3839auto x102 = -x38;
3840auto x103 = x102 + x71 - V{4.5}*x56*x56;
3841auto x104 = x93 + x98;
3842auto x105 = x104 + x62;
3843auto x106 = x36 + x46;
3844auto x107 = x102 + x106 - V{4.5}*x66*x66;
3845auto x108 = x46 + x70 + x92 + x96;
3846auto x109 = x106 + x58 - V{4.5}*x74*x74;
3847auto x110 = x100 + x46 + x79;
3848auto x111 = x100 + x64 + V{4.5}*(x82*x82);
3849auto x112 = x104 + x58 + V{4.5}*(x85*x85);
3850auto x113 = -x88;
3851auto x114 = x102 + x72 - V{4.5}*x113*x113;
3852cell[0] = -ratioRho*x28*x36 - x27*(x28*x36 + cell[0] + V{0.296296296296296}) + V{-0.296296296296296};
3853cell[1] = -x27*(x37*x40 + cell[1] + V{0.0740740740740741}) - x40*x41 + V{-0.0740740740740741};
3854cell[2] = -x27*(x37*x45 + cell[2] + V{0.0740740740740741}) - x41*x45 + V{-0.0740740740740741};
3855cell[3] = -x27*(x37*x48 + cell[3] + V{0.0740740740740741}) - x41*x48 + V{-0.0740740740740741};
3856cell[4] = -x27*(x49*x54 + cell[4] + V{0.0185185185185185}) - x54*x55 + V{-0.0185185185185185};
3857cell[5] = -x27*(x49*x60 + cell[5] + V{0.0185185185185185}) - x55*x60 + V{-0.0185185185185185};
3858cell[6] = -x27*(x49*x63 + cell[6] + V{0.0185185185185185}) - x55*x63 + V{-0.0185185185185185};
3859cell[7] = -x27*(x49*x68 + cell[7] + V{0.0185185185185185}) - x55*x68 + V{-0.0185185185185185};
3860cell[8] = -x27*(x49*x73 + cell[8] + V{0.0185185185185185}) - x55*x73 + V{-0.0185185185185185};
3861cell[9] = -x27*(x49*x76 + cell[9] + V{0.0185185185185185}) - x55*x76 + V{-0.0185185185185185};
3862cell[10] = -x27*(x77*x80 + cell[10] + V{0.00462962962962963}) - x80*x81 + V{-0.00462962962962963};
3863cell[11] = -x27*(x77*x84 + cell[11] + V{0.00462962962962963}) - x81*x84 + V{-0.00462962962962963};
3864cell[12] = -x27*(x77*x87 + cell[12] + V{0.00462962962962963}) - x81*x87 + V{-0.00462962962962963};
3865cell[13] = V{0.00462962962962963}*ratioRho*rho*x89 - x27*(-x77*x89 + cell[13] + V{0.00462962962962963}) + V{-0.00462962962962963};
3866cell[14] = V{0.0740740740740741}*ratioRho*rho*x94 - x27*(-x37*x94 + cell[14] + V{0.0740740740740741}) + V{-0.0740740740740741};
3867cell[15] = V{0.0740740740740741}*ratioRho*rho*x97 - x27*(-x37*x97 + cell[15] + V{0.0740740740740741}) + V{-0.0740740740740741};
3868cell[16] = V{0.0740740740740741}*ratioRho*rho*x99 - x27*(-x37*x99 + cell[16] + V{0.0740740740740741}) + V{-0.0740740740740741};
3869cell[17] = V{0.0185185185185185}*ratioRho*rho*x101 - x27*(-x101*x49 + cell[17] + V{0.0185185185185185}) + V{-0.0185185185185185};
3870cell[18] = -x103*x55 - x27*(x103*x49 + cell[18] + V{0.0185185185185185}) + V{-0.0185185185185185};
3871cell[19] = V{0.0185185185185185}*ratioRho*rho*x105 - x27*(-x105*x49 + cell[19] + V{0.0185185185185185}) + V{-0.0185185185185185};
3872cell[20] = -x107*x55 - x27*(x107*x49 + cell[20] + V{0.0185185185185185}) + V{-0.0185185185185185};
3873cell[21] = V{0.0185185185185185}*ratioRho*rho*x108 - x27*(-x108*x49 + cell[21] + V{0.0185185185185185}) + V{-0.0185185185185185};
3874cell[22] = -x109*x55 - x27*(x109*x49 + cell[22] + V{0.0185185185185185}) + V{-0.0185185185185185};
3875cell[23] = V{0.00462962962962963}*ratioRho*rho*x110 - x27*(-x110*x77 + cell[23] + V{0.00462962962962963}) + V{-0.00462962962962963};
3876cell[24] = V{0.00462962962962963}*ratioRho*rho*x111 - x27*(-x111*x77 + cell[24] + V{0.00462962962962963}) + V{-0.00462962962962963};
3877cell[25] = V{0.00462962962962963}*ratioRho*rho*x112 - x27*(-x112*x77 + cell[25] + V{0.00462962962962963}) + V{-0.00462962962962963};
3878cell[26] = -x114*x81 - x27*(x114*x77 + cell[26] + V{0.00462962962962963}) + V{-0.00462962962962963};
3879return x29 + x31 + x33;
3880}
3881
3882template <typename CELL, typename RHO, typename U, typename OMEGA, typename V=typename CELL::value_t>
3883static auto rlbCollision(CELL& cell, RHO& rho, U& u, OMEGA& omega) any_platform
3884{
3885auto x27 = omega + V{-1};
3886auto x28 = V{0.222222222222222}*cell[23];
3887auto x29 = V{0.222222222222222}*cell[24];
3888auto x30 = V{0.222222222222222}*cell[10];
3889auto x31 = -x30;
3890auto x32 = V{0.222222222222222}*cell[11];
3891auto x33 = -x32;
3892auto x34 = V{3}*u[2];
3893auto x35 = V{3}*u[1];
3894auto x36 = V{3}*u[0];
3895auto x37 = x36 + V{-1};
3896auto x38 = x35 + x37;
3897auto x39 = x34 + x38;
3898auto x40 = -x39;
3899auto x41 = V{0.00102880658436214}*rho;
3900auto x42 = x40*x41;
3901auto x43 = x36 + V{1};
3902auto x44 = x35 + x43;
3903auto x45 = x34 + x44;
3904auto x46 = x41*x45;
3905auto x47 = -x46;
3906auto x48 = -x34;
3907auto x49 = x44 + x48;
3908auto x50 = x41*x49;
3909auto x51 = -x50;
3910auto x52 = V{0.222222222222222}*cell[1];
3911auto x53 = -x37;
3912auto x54 = V{0.0164609053497942}*rho;
3913auto x55 = x43*x54;
3914auto x56 = V{0.222222222222222}*cell[4];
3915auto x57 = x38 + x48;
3916auto x58 = -x57;
3917auto x59 = x41*x58;
3918auto x60 = -x38;
3919auto x61 = V{0.00411522633744856}*rho;
3920auto x62 = x44*x61;
3921auto x63 = -x56 + x59 + x60*x61 - x62 + V{0.222222222222222}*cell[17];
3922auto x64 = V{0.222222222222222}*cell[25];
3923auto x65 = V{0.222222222222222}*cell[6];
3924auto x66 = V{0.222222222222222}*cell[12];
3925auto x67 = -x66;
3926auto x68 = -x35;
3927auto x69 = x34 + x37;
3928auto x70 = x68 + x69;
3929auto x71 = -x70;
3930auto x72 = x41*x71;
3931auto x73 = -x69;
3932auto x74 = x34 + x43;
3933auto x75 = x68 + x74;
3934auto x76 = x41*x75;
3935auto x77 = -x76;
3936auto x78 = x61*x74;
3937auto x79 = x61*x73 + x64 - x65 + x67 + x72 + x77 - x78 + V{0.222222222222222}*cell[19];
3938auto x80 = V{0.222222222222222}*cell[18];
3939auto x81 = V{0.222222222222222}*cell[26];
3940auto x82 = V{0.222222222222222}*cell[5];
3941auto x83 = V{0.222222222222222}*cell[13];
3942auto x84 = -x83;
3943auto x85 = -x36;
3944auto x86 = x35 + V{1};
3945auto x87 = x85 + x86;
3946auto x88 = x34 + x87;
3947auto x89 = x41*x88;
3948auto x90 = x61*x87;
3949auto x91 = x43 + x68;
3950auto x92 = x48 + x91;
3951auto x93 = x41*x92;
3952auto x94 = -x93;
3953auto x95 = x61*x91;
3954auto x96 = x80 + x81 - x82 + x84 + x89 + x90 + x94 - x95;
3955auto x97 = V{0.222222222222222}*cell[20];
3956auto x98 = V{0.222222222222222}*cell[7];
3957auto x99 = x34 + V{1};
3958auto x100 = x85 + x99;
3959auto x101 = x100*x61;
3960auto x102 = x43 + x48;
3961auto x103 = x102*x61;
3962auto x104 = x101 - x103 + x97 - x98;
3963auto x105 = V{0.0740740740740741}*rho;
3964auto x106 = V{0.222222222222222}*cell[2];
3965auto x107 = x35 + V{-1};
3966auto x108 = -x107;
3967auto x109 = x54*x86;
3968auto x110 = V{0.222222222222222}*cell[22];
3969auto x111 = V{0.222222222222222}*cell[9];
3970auto x112 = -x64;
3971auto x113 = x68 + x99;
3972auto x114 = x113*x61;
3973auto x115 = x48 + x86;
3974auto x116 = x115*x61;
3975auto x117 = x110 - x111 + x112 + x114 - x116 + x29 + x33 + x51 + x66 + x76;
3976auto x118 = -x81;
3977auto x119 = -x89;
3978auto x120 = x118 + x119 - x80 + x82 + x83 - x90 + x93 + x95;
3979auto x121 = V{0.222222222222222}*cell[8];
3980auto x122 = x107 + x34;
3981auto x123 = -x122;
3982auto x124 = x34 + x86;
3983auto x125 = x124*x61;
3984auto x126 = -x121 + x123*x61 - x125 + x28 + x31 + x42 + x47 + V{0.222222222222222}*cell[21];
3985auto x127 = V{0.222222222222222}*cell[3];
3986auto x128 = x34 + V{-1};
3987auto x129 = -x128;
3988auto x130 = x54*x99;
3989auto x131 = -x29;
3990auto x132 = -x101 + x103 + x131 + x32 + x50 - x97 + x98;
3991auto x133 = -x110 + x111 - x114 + x116;
3992auto x134 = V{0.0555555555555556}*cell[15];
3993auto x135 = V{0.0555555555555556}*cell[19];
3994auto x136 = V{0.0555555555555556}*cell[2];
3995auto x137 = -x136;
3996auto x138 = V{0.0555555555555556}*cell[6];
3997auto x139 = -x138;
3998auto x140 = x41*x74;
3999auto x141 = -x140;
4000auto x142 = x61*x86;
4001auto x143 = -x142;
4002auto x144 = V{0.111111111111111}*cell[4];
4003auto x145 = V{0.111111111111111}*cell[11];
4004auto x146 = V{0.00051440329218107}*rho;
4005auto x147 = V{0.00205761316872428}*rho;
4006auto x148 = x146*x49;
4007auto x149 = x147*x44;
4008auto x150 = V{0.111111111111111}*cell[23];
4009auto x151 = V{0.111111111111111}*cell[10];
4010auto x152 = -x151;
4011auto x153 = x146*x40;
4012auto x154 = x146*x45;
4013auto x155 = -x154;
4014auto x156 = x108*x61 + x150 + x152 + x153 + x155 + x41*x73;
4015auto x157 = V{0.0555555555555556}*cell[20];
4016auto x158 = V{0.0555555555555556}*cell[7];
4017auto x159 = x100*x41;
4018auto x160 = x102*x41;
4019auto x161 = x157 - x158 + x159 - x160;
4020auto x162 = V{0.0555555555555556}*cell[21];
4021auto x163 = V{0.0555555555555556}*cell[8];
4022auto x164 = x124*x41;
4023auto x165 = x162 - x163 - x164;
4024auto x166 = V{0.0555555555555556}*cell[22];
4025auto x167 = V{0.0555555555555556}*cell[9];
4026auto x168 = x113*x41;
4027auto x169 = x115*x41;
4028auto x170 = x166 - x167 + x168 - x169;
4029auto x171 = x165 + x170;
4030auto x172 = V{0.0555555555555556}*cell[1];
4031auto x173 = x43*x61;
4032auto x174 = x123*x41 - x172 - x173 + x53*x61 + V{0.0555555555555556}*cell[14] + V{1.5419764230905e-18};
4033auto x175 = V{0.0185185185185185}*rho;
4034auto x176 = x107*x61;
4035auto x177 = -x157 + x158 - x159 + x160;
4036auto x178 = V{0.111111111111111}*cell[13];
4037auto x179 = V{0.111111111111111}*cell[26];
4038auto x180 = -x179;
4039auto x181 = x146*x92;
4040auto x182 = x146*x88;
4041auto x183 = -x182;
4042auto x184 = x134 + x137 + x143 + x178 + x180 + x181 + x183;
4043auto x185 = x41*x69;
4044auto x186 = -x135 + x138 + x140 + x185;
4045auto x187 = -V{0.0555555555555556}*cell[14];
4046auto x188 = x37*x61;
4047auto x189 = x122*x41;
4048auto x190 = x172 + x173 + x187 + x188 - x189 + V{-1.5419764230905e-18};
4049auto x191 = V{0.111111111111111}*cell[12];
4050auto x192 = V{0.111111111111111}*cell[25];
4051auto x193 = x146*x75;
4052auto x194 = x146*x70;
4053auto x195 = x191 - x192 + x193 + x194;
4054auto x196 = x27*(V{0.00205761316872428}*rho*x87 - x147*x91 - x171 + x176 - x177 - x184 - x186 - x190 - x195 + V{0.111111111111111}*cell[18] - V{0.111111111111111}*cell[5]);
4055auto x197 = V{0.111111111111111}*cell[6];
4056auto x198 = x147*x74;
4057auto x199 = V{0.0555555555555556}*cell[4];
4058auto x200 = x41*x44;
4059auto x201 = x129*x61 - x199 - x200 + x41*x60 + V{0.0555555555555556}*cell[17];
4060auto x202 = V{0.0555555555555556}*cell[18];
4061auto x203 = V{0.0555555555555556}*cell[5];
4062auto x204 = -x203;
4063auto x205 = x41*x87;
4064auto x206 = x41*x91;
4065auto x207 = -x206;
4066auto x208 = -x191 + x192 - x193 + x202 + x204 + x205 + x207;
4067auto x209 = V{0.0555555555555556}*cell[16];
4068auto x210 = V{0.0555555555555556}*cell[3];
4069auto x211 = -x210;
4070auto x212 = x61*x99;
4071auto x213 = -x212;
4072auto x214 = -x166 + x167 - x168 + x169;
4073auto x215 = x165 + x209 + x211 + x213 + x214;
4074auto x216 = -V{0.111111111111111}*cell[24];
4075auto x217 = x146*x57;
4076auto x218 = -x202 + x203 - x205 + x206;
4077auto x219 = x128*x61;
4078auto x220 = x199 + x200 + x38*x41 - V{0.0555555555555556}*cell[17];
4079auto x221 = -x219 + x220;
4080auto x222 = x27*(V{0.00205761316872428}*rho*x100 - x102*x147 - x145 - x148 - x178 - x180 - x181 - x183 - x190 - x215 - x216 - x217 - x218 - x221 + V{0.111111111111111}*cell[20] - V{0.111111111111111}*cell[7]);
4081auto x223 = V{0.111111111111111}*cell[8];
4082auto x224 = x124*x147;
4083auto x225 = x135 + x139 + x141 + x177 + x209 + x211 + x213;
4084auto x226 = -x134;
4085auto x227 = x136 + x142 + x145 + x148 + x176 + x216 + x217 + x226;
4086auto x228 = x27*(V{0.00205761316872428}*rho*x113 - x115*x147 + x185 + x194 - x208 - x221 - x225 - x227 + V{0.111111111111111}*cell[22] - V{0.111111111111111}*cell[9]);
4087auto x229 = V{0.0277777777777778}*cell[21];
4088auto x230 = V{0.0277777777777778}*cell[8];
4089auto x231 = V{0.0416666666666667}*cell[10];
4090auto x232 = V{0.000192901234567901}*rho;
4091auto x233 = V{6.43004115226337e-05}*rho;
4092auto x234 = x233*x71;
4093auto x235 = x233*x58;
4094auto x236 = x232*x45;
4095auto x237 = x124*x146;
4096auto x238 = V{0.0138888888888889}*cell[14];
4097auto x239 = V{0.0138888888888889}*cell[24];
4098auto x240 = V{0.0138888888888889}*cell[25];
4099auto x241 = V{0.0138888888888889}*cell[1];
4100auto x242 = -x241;
4101auto x243 = V{0.0138888888888889}*cell[11];
4102auto x244 = -x243;
4103auto x245 = V{0.0138888888888889}*cell[12];
4104auto x246 = -x245;
4105auto x247 = x233*x49;
4106auto x248 = -x247;
4107auto x249 = x233*x75;
4108auto x250 = -x249;
4109auto x251 = x41*x43;
4110auto x252 = -x251;
4111auto x253 = x238 + x239 + x240 + x242 + x244 + x246 + x248 + x250 + x252 + V{3.85494105772624e-19};
4112auto x254 = V{0.0138888888888889}*cell[13];
4113auto x255 = V{0.0138888888888889}*cell[16];
4114auto x256 = V{0.0138888888888889}*cell[3];
4115auto x257 = -x256;
4116auto x258 = V{0.0138888888888889}*cell[26];
4117auto x259 = -x258;
4118auto x260 = x233*x92;
4119auto x261 = x233*x88;
4120auto x262 = -x261;
4121auto x263 = x41*x99;
4122auto x264 = -x263;
4123auto x265 = x254 + x255 + x257 + x259 + x260 + x262 + x264;
4124auto x266 = V{0.0277777777777778}*cell[4];
4125auto x267 = x41*x53;
4126auto x268 = x108*x41;
4127auto x269 = x146*x44;
4128auto x270 = V{0.0138888888888889}*cell[15];
4129auto x271 = V{0.0138888888888889}*cell[2];
4130auto x272 = x41*x86;
4131auto x273 = x270 - x271 - x272;
4132auto x274 = x146*x60 - x266 + x267 + x268 - x269 + x273 + V{0.0277777777777778}*cell[17];
4133auto x275 = V{0.0277777777777778}*cell[6];
4134auto x276 = x129*x41;
4135auto x277 = x146*x74;
4136auto x278 = x146*x73 - x275 + x276 - x277 + V{0.0277777777777778}*cell[19];
4137auto x279 = V{0.00462962962962963}*rho;
4138auto x280 = V{0.0416666666666667}*cell[11];
4139auto x281 = x232*x49;
4140auto x282 = -x255;
4141auto x283 = V{0.0277777777777778}*cell[7];
4142auto x284 = x102*x146;
4143auto x285 = x100*x146 + x256 + x263 + x282 - x283 - x284 + V{0.0277777777777778}*cell[20];
4144auto x286 = V{0.0277777777777778}*cell[22];
4145auto x287 = V{0.0277777777777778}*cell[9];
4146auto x288 = x113*x146;
4147auto x289 = x115*x146;
4148auto x290 = x286 - x287 + x288 - x289;
4149auto x291 = -x254;
4150auto x292 = -x260;
4151auto x293 = -x240 + x245 + x249 + x258 + x261 + x291 + x292;
4152auto x294 = V{0.0138888888888889}*cell[23];
4153auto x295 = V{0.0138888888888889}*cell[10];
4154auto x296 = x233*x45;
4155auto x297 = x233*x40 + x238 + x242 + x252 + x294 - x295 - x296 + V{3.85494105772624e-19};
4156auto x298 = V{0.0416666666666667}*cell[12];
4157auto x299 = x232*x75;
4158auto x300 = -x270;
4159auto x301 = -x239 + x243 + x247 + x271 + x272 + x300;
4160auto x302 = V{0.0277777777777778}*cell[5];
4161auto x303 = x146*x91;
4162auto x304 = x146*x87 - x302 - x303 + V{0.0277777777777778}*cell[18];
4163auto x305 = -x286 + x287 - x288 + x289;
4164auto x306 = x37*x41;
4165auto x307 = x107*x41;
4166auto x308 = x128*x41;
4167auto x309 = x122*x146 - x229 + x230 + x237 + x307 + x308;
4168auto x310 = -x294;
4169auto x311 = x233*x39;
4170auto x312 = x233*x57;
4171auto x313 = x295 + x296 + x310 + x311 - x312;
4172auto x314 = x233*x70;
4173auto x315 = x271 + x272 + x300 - x314;
4174auto x316 = x27*(x232*x88 - x232*x92 + x253 + x285 + x304 - x306 + x309 + x313 + x315 - V{0.0416666666666667}*cell[13] + V{0.0416666666666667}*cell[26]);
4175auto x317 = -V{0.222222222222222}*cell[23];
4176auto x318 = x39*x41;
4177auto x319 = x41*x57;
4178auto x320 = x30 + x317 + x318 + x319 + x38*x61 + x46 + x56 + x62 - V{0.222222222222222}*cell[17];
4179auto x321 = x41*x70;
4180auto x322 = x321 + x61*x69 + x65 + x78 - V{0.222222222222222}*cell[19];
4181auto x323 = x121 + x122*x61 + x125 - V{0.222222222222222}*cell[21];
4182auto x324 = -V{0.111111111111111}*cell[23];
4183auto x325 = x146*x39;
4184auto x326 = x151 + x154 + x186 + x324 + x325;
4185auto x327 = -x162 + x163 + x164 + x172 + x173 + x187 + x188 + x189 + V{-1.5419764230905e-18};
4186auto x328 = -x209 + x210 + x212 + x219 + x220;
4187auto x329 = -V{0.0138888888888889}*cell[14];
4188auto x330 = x146*x38 + x241 + x251 + x266 + x269 + x306 + x329 - V{0.0277777777777778}*cell[17] + V{-3.85494105772624e-19};
4189auto x331 = x146*x69 + x256 + x263 + x275 + x277 + x282 - V{0.0277777777777778}*cell[19];
4190cell[0] = V{0.296296296296296}*rho + V{-0.296296296296296};
4191cell[1] = -x105*x37 + x27*(x104 + x28 + x29 + x31 + x33 + x42 + x47 + x51 - x52 + x53*x54 - x55 + x63 + x79 + x96 + V{0.222222222222222}*cell[14] + V{6.16790569236198e-18}) + V{-0.0740740740740741};
4192cell[2] = -x105*x107 + x27*(-x106 + x108*x54 - x109 + x117 + x120 + x126 + x63 - x72 + V{0.222222222222222}*cell[15]) + V{-0.0740740740740741};
4193cell[3] = -x105*x128 + x27*(x118 + x119 + x126 - x127 + x129*x54 - x130 + x132 + x133 - x59 + x79 + x83 + x93 + V{0.222222222222222}*cell[16]) + V{-0.0740740740740741};
4194cell[4] = -x175*x38 + x27*(x134 + x135 + x137 + x139 + x141 + x143 - x144 - x145 + x146*x58 + x147*x60 - x148 - x149 + x156 + x161 + x171 + x174 + V{0.111111111111111}*cell[17] + V{0.111111111111111}*cell[24]) + V{-0.0185185185185185};
4195cell[5] = x175*x87 + x196 + V{-0.0185185185185185};
4196cell[6] = -x175*x69 + x27*(x146*x71 + x147*x73 + x150 + x152 + x153 + x155 + x174 - x197 - x198 + x201 + x208 + x215 + V{0.111111111111111}*cell[19]) + V{-0.0185185185185185};
4197cell[7] = x100*x175 + x222 + V{-0.0185185185185185};
4198cell[8] = -x122*x175 + x27*(x123*x147 + x156 + x184 + x201 + x218 - x223 - x224 + x225 + V{0.111111111111111}*cell[21]) + V{-0.0185185185185185};
4199cell[9] = x113*x175 + x228 + V{-0.0185185185185185};
4200cell[10] = x27*(x123*x146 + x229 - x230 - x231 + x232*x40 + x234 + x235 - x236 - x237 + x253 + x265 + x274 + x278 + V{0.0416666666666667}*cell[23]) - x279*x39 + V{-0.00462962962962963};
4201cell[11] = x27*(x232*x58 - x234 + x274 - x276 - x280 - x281 + x285 + x290 + x293 + x297 + V{0.0416666666666667}*cell[24]) - x279*x57 + V{-0.00462962962962963};
4202cell[12] = x27*(x232*x71 - x235 + x255 + x257 + x258 + x261 + x264 + x267 - x268 + x278 + x291 + x292 + x297 - x298 - x299 + x301 + x304 + x305 + V{0.0416666666666667}*cell[25]) - x279*x70 + V{-0.00462962962962963};
4203cell[13] = x279*x88 + x316 + V{-0.00462962962962963};
4204cell[14] = V{0.0740740740740741}*rho*x43 - x27*(-x112 - x120 - x132 - x320 - x322 - x37*x54 - x52 - x55 - x66 - x76 + V{0.222222222222222}*cell[14] + V{6.16790569236198e-18}) + V{-0.0740740740740741};
4205cell[15] = V{0.0740740740740741}*rho*x86 - x27*(-x106 - x107*x54 - x109 - x131 - x133 - x32 - x320 + x321 - x323 - x50 - x64 - x67 - x77 - x96 + V{0.222222222222222}*cell[15]) + V{-0.0740740740740741};
4206cell[16] = V{0.0740740740740741}*rho*x99 - x27*(-x104 - x117 - x127 - x128*x54 - x130 - x30 - x317 - x318 + x319 - x322 - x323 - x46 - x81 - x84 - x89 - x94 + V{0.222222222222222}*cell[16]) + V{-0.0740740740740741};
4207cell[17] = V{0.0185185185185185}*rho*x44 - x27*(-x144 - x147*x38 - x149 - x177 - x214 - x227 - x326 - x327 + V{0.111111111111111}*cell[17]) + V{-0.0185185185185185};
4208cell[18] = V{0.0185185185185185}*rho*x91 - x196 + V{-0.0185185185185185};
4209cell[19] = V{0.0185185185185185}*rho*x74 - x27*(-x147*x69 - x151 - x154 - x170 - x195 - x197 - x198 - x218 - x324 - x325 - x327 - x328 + V{0.111111111111111}*cell[19]) + V{-0.0185185185185185};
4210cell[20] = V{0.0185185185185185}*rho*x102 - x222 + V{-0.0185185185185185};
4211cell[21] = V{0.0185185185185185}*rho*x124 - x27*(-x122*x147 - x136 - x142 - x161 - x176 + x178 - x179 + x181 - x182 - x202 - x204 - x205 - x207 - x223 - x224 - x226 - x326 - x328 + V{0.111111111111111}*cell[21]) + V{-0.0185185185185185};
4212cell[22] = V{0.0185185185185185}*rho*x115 - x228 + V{-0.0185185185185185};
4213cell[23] = V{0.00462962962962963}*rho*x45 - x27*(-x231 - x232*x39 - x236 - x293 - x301 - x309 - x312 - x314 - x330 - x331 + V{0.0416666666666667}*cell[23]) + V{-0.00462962962962963};
4214cell[24] = V{0.00462962962962963}*rho*x49 - x27*(V{0.00051440329218107}*rho*x100 - x232*x57 - x240 - x246 - x250 - x265 - x280 - x281 - x283 - x284 - x295 - x296 - x305 - x307 + x308 - x310 - x311 - x315 - x330 + V{0.0277777777777778}*cell[20] + V{0.0416666666666667}*cell[24]) + V{-0.00462962962962963};
4215cell[25] = V{0.00462962962962963}*rho*x75 - x27*(V{0.00051440329218107}*rho*x87 - x232*x70 - x239 - x241 - x244 - x248 - x251 - x254 - x259 - x260 - x262 - x273 - x290 - x298 - x299 - x302 - x303 - x306 + x307 - x308 - x313 - x329 - x331 + V{0.0277777777777778}*cell[18] + V{0.0416666666666667}*cell[25] + V{3.85494105772624e-19}) + V{-0.00462962962962963};
4216cell[26] = V{0.00462962962962963}*rho*x92 - x316 + V{-0.00462962962962963};
4217return u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
4218}
4219
4220template <typename CELL, typename RHO, typename U, typename PI, typename OMEGA, typename V=typename CELL::value_t>
4221static auto rlbCollision(CELL& cell, RHO& rho, U& u, PI& pi, OMEGA& omega) any_platform
4222{
4223auto x27 = u[0]*u[0];
4224auto x28 = V{1.5}*x27;
4225auto x29 = u[1]*u[1];
4226auto x30 = V{1.5}*x29;
4227auto x31 = u[2]*u[2];
4228auto x32 = V{1.5}*x31;
4229auto x33 = x30 + x32 + V{-1};
4230auto x34 = x28 + x33;
4231auto x35 = omega + V{-1};
4232auto x36 = V{0.111111111111111}*pi[3];
4233auto x37 = V{0.111111111111111}*pi[5];
4234auto x38 = x36 + x37 - V{0.222222222222222}*pi[0];
4235auto x39 = V{0.0740740740740741}*rho;
4236auto x40 = V{3}*u[0];
4237auto x41 = V{3}*x27;
4238auto x42 = V{0.111111111111111}*pi[0];
4239auto x43 = x37 + x42 - V{0.222222222222222}*pi[3];
4240auto x44 = V{3}*u[1];
4241auto x45 = V{3}*x29;
4242auto x46 = x28 + V{-1};
4243auto x47 = x36 + x42 - V{0.222222222222222}*pi[5];
4244auto x48 = V{3}*u[2];
4245auto x49 = V{3}*x31;
4246auto x50 = V{0.0185185185185185}*rho;
4247auto x51 = u[0] + u[1];
4248auto x52 = V{4.5}*(x51*x51);
4249auto x53 = x34 + x40;
4250auto x54 = x44 + x53;
4251auto x55 = V{0.166666666666667}*pi[1];
4252auto x56 = V{0.0555555555555556}*pi[0];
4253auto x57 = V{0.0555555555555556}*pi[3];
4254auto x58 = x56 + x57 - V{0.0277777777777778}*pi[5];
4255auto x59 = x35*(x55 + x58) + V{0.0185185185185185};
4256auto x60 = u[0] - u[1];
4257auto x61 = -x60;
4258auto x62 = -x44;
4259auto x63 = x53 + x62;
4260auto x64 = x35*(-x55 + x58) + V{0.0185185185185185};
4261auto x65 = u[0] + u[2];
4262auto x66 = V{4.5}*(x65*x65);
4263auto x67 = V{0.166666666666667}*pi[2];
4264auto x68 = V{0.0555555555555556}*pi[5];
4265auto x69 = x56 + x68 - V{0.0277777777777778}*pi[3];
4266auto x70 = x35*(x67 + x69) + V{0.0185185185185185};
4267auto x71 = -x48;
4268auto x72 = -u[2];
4269auto x73 = x72 + u[0];
4270auto x74 = -x73;
4271auto x75 = x35*(-x67 + x69) + V{0.0185185185185185};
4272auto x76 = u[1] + u[2];
4273auto x77 = V{4.5}*(x76*x76);
4274auto x78 = x34 + x44;
4275auto x79 = x48 + x78;
4276auto x80 = V{0.166666666666667}*pi[4];
4277auto x81 = V{0.0277777777777778}*pi[0];
4278auto x82 = x35*(x57 + x68 + x80 - x81) + V{0.0185185185185185};
4279auto x83 = x72 + u[1];
4280auto x84 = -x83;
4281auto x85 = -x35*(-x57 - x68 + x80 + x81) + V{0.0185185185185185};
4282auto x86 = V{0.00462962962962963}*rho;
4283auto x87 = x51 + u[2];
4284auto x88 = V{4.5}*(x87*x87);
4285auto x89 = V{0.0416666666666667}*pi[2];
4286auto x90 = V{0.0416666666666667}*pi[4];
4287auto x91 = V{0.0416666666666667}*pi[1];
4288auto x92 = V{0.0138888888888889}*pi[0];
4289auto x93 = V{0.0138888888888889}*pi[3];
4290auto x94 = V{0.0138888888888889}*pi[5];
4291auto x95 = x91 + x92 + x93 + x94;
4292auto x96 = x35*(x89 + x90 + x95) + V{0.00462962962962963};
4293auto x97 = x51 + x72;
4294auto x98 = -x97;
4295auto x99 = -x89;
4296auto x100 = -x90;
4297auto x101 = x35*(x100 + x95 + x99) + V{0.00462962962962963};
4298auto x102 = x60 + u[2];
4299auto x103 = -x102;
4300auto x104 = -x91 + x92 + x93 + x94;
4301auto x105 = x35*(x100 + x104 + x89) + V{0.00462962962962963};
4302auto x106 = x76 - u[0];
4303auto x107 = x35*(x104 + x90 + x99) + V{0.00462962962962963};
4304auto x108 = -x30;
4305auto x109 = V{1} - x32;
4306auto x110 = x108 + x109;
4307auto x111 = x110 + x40;
4308auto x112 = -x28;
4309auto x113 = x112 + x44;
4310auto x114 = x112 + x48;
4311auto x115 = x111 + x113;
4312auto x116 = -x40;
4313auto x117 = x111 + x114;
4314auto x118 = x34 + x48;
4315auto x119 = -x106;
4316cell[0] = -V{0.296296296296296}*rho*x34 + V{0.444444444444444}*x35*(pi[0] + pi[3] + pi[5]) + V{-0.296296296296296};
4317cell[1] = x35*x38 - x39*(x33 + x40 - x41) + V{-0.0740740740740741};
4318cell[2] = x35*x43 - x39*(x32 + x44 - x45 + x46) + V{-0.0740740740740741};
4319cell[3] = x35*x47 - x39*(x30 + x46 + x48 - x49) + V{-0.0740740740740741};
4320cell[4] = -x50*(-x52 + x54) - x59;
4321cell[5] = -x50*(x63 - V{4.5}*x61*x61) - x64;
4322cell[6] = -x50*(x48 + x53 - x66) - x70;
4323cell[7] = -x50*(x53 + x71 - V{4.5}*x74*x74) - x75;
4324cell[8] = -x50*(-x77 + x79) - x82;
4325cell[9] = -x50*(x71 + x78 - V{4.5}*x84*x84) - x85;
4326cell[10] = -x86*(x48 + x54 - x88) - x96;
4327cell[11] = -x101 - x86*(x54 + x71 - V{4.5}*x98*x98);
4328cell[12] = -x105 - x86*(x48 + x63 - V{4.5}*x103*x103);
4329cell[13] = -V{0.00462962962962963}*rho*(x63 + x71 - V{4.5}*x106*x106) - x107;
4330cell[14] = x35*x38 + x39*(x111 + x41) + V{-0.0740740740740741};
4331cell[15] = x35*x43 + x39*(x109 + x113 + x45) + V{-0.0740740740740741};
4332cell[16] = x35*x47 + x39*(x108 + x114 + x49 + V{1}) + V{-0.0740740740740741};
4333cell[17] = V{0.0185185185185185}*rho*(x115 + x52) - x59;
4334cell[18] = -x50*(x116 + x78 - V{4.5}*x60*x60) - x64;
4335cell[19] = V{0.0185185185185185}*rho*(x117 + x66) - x70;
4336cell[20] = -x50*(x116 + x118 - V{4.5}*x73*x73) - x75;
4337cell[21] = V{0.0185185185185185}*rho*(x110 + x113 + x48 + x77) - x82;
4338cell[22] = -x50*(x118 + x62 - V{4.5}*x83*x83) - x85;
4339cell[23] = V{0.00462962962962963}*rho*(x115 + x48 + x88) - x96;
4340cell[24] = V{0.00462962962962963}*rho*(x115 + x71 + V{4.5}*(x97*x97)) - x101;
4341cell[25] = V{0.00462962962962963}*rho*(x117 + x62 + V{4.5}*(x102*x102)) - x105;
4342cell[26] = -x107 - x86*(x116 + x79 - V{4.5}*x119*x119);
4343return x27 + x29 + x31;
4344}
4345
4346template <typename CELL, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
4347static void defineEqFirstOrder(CELL& cell, NEWRHO& newRho, NEWU& newU) any_platform
4348{
4349auto x27 = V{3}*newU[0];
4350auto x28 = x27 + V{-1};
4351auto x29 = V{3}*newU[1];
4352auto x30 = x29 + V{-1};
4353auto x31 = V{3}*newU[2];
4354auto x32 = x28 + x29;
4355auto x33 = -x27;
4356auto x34 = x29 + V{1};
4357auto x35 = x33 + x34;
4358auto x36 = x28 + x31;
4359auto x37 = x31 + V{1};
4360auto x38 = -x29;
4361auto x39 = -x31;
4362auto x40 = x27 + V{1};
4363auto x41 = x29 + x40;
4364auto x42 = x38 + x40;
4365cell[0] = V{0.296296296296296}*newRho + V{-0.296296296296296};
4366cell[1] = -V{0.0740740740740741}*newRho*x28 + V{-0.0740740740740741};
4367cell[2] = -V{0.0740740740740741}*newRho*x30 + V{-0.0740740740740741};
4368cell[3] = -V{0.0740740740740741}*newRho*(x31 + V{-1}) + V{-0.0740740740740741};
4369cell[4] = -V{0.0185185185185185}*newRho*x32 + V{-0.0185185185185185};
4370cell[5] = V{0.0185185185185185}*newRho*x35 + V{-0.0185185185185185};
4371cell[6] = -V{0.0185185185185185}*newRho*x36 + V{-0.0185185185185185};
4372cell[7] = V{0.0185185185185185}*newRho*(x33 + x37) + V{-0.0185185185185185};
4373cell[8] = -V{0.0185185185185185}*newRho*(x30 + x31) + V{-0.0185185185185185};
4374cell[9] = V{0.0185185185185185}*newRho*(x37 + x38) + V{-0.0185185185185185};
4375cell[10] = -V{0.00462962962962963}*newRho*(x31 + x32) + V{-0.00462962962962963};
4376cell[11] = -V{0.00462962962962963}*newRho*(x32 + x39) + V{-0.00462962962962963};
4377cell[12] = -V{0.00462962962962963}*newRho*(x36 + x38) + V{-0.00462962962962963};
4378cell[13] = V{0.00462962962962963}*newRho*(x31 + x35) + V{-0.00462962962962963};
4379cell[14] = V{0.0740740740740741}*newRho*x40 + V{-0.0740740740740741};
4380cell[15] = V{0.0740740740740741}*newRho*x34 + V{-0.0740740740740741};
4381cell[16] = V{0.0740740740740741}*newRho*x37 + V{-0.0740740740740741};
4382cell[17] = V{0.0185185185185185}*newRho*x41 + V{-0.0185185185185185};
4383cell[18] = V{0.0185185185185185}*newRho*x42 + V{-0.0185185185185185};
4384cell[19] = V{0.0185185185185185}*newRho*(x31 + x40) + V{-0.0185185185185185};
4385cell[20] = V{0.0185185185185185}*newRho*(x39 + x40) + V{-0.0185185185185185};
4386cell[21] = V{0.0185185185185185}*newRho*(x31 + x34) + V{-0.0185185185185185};
4387cell[22] = V{0.0185185185185185}*newRho*(x34 + x39) + V{-0.0185185185185185};
4388cell[23] = V{0.00462962962962963}*newRho*(x31 + x41) + V{-0.00462962962962963};
4389cell[24] = V{0.00462962962962963}*newRho*(x39 + x41) + V{-0.00462962962962963};
4390cell[25] = V{0.00462962962962963}*newRho*(x31 + x42) + V{-0.00462962962962963};
4391cell[26] = V{0.00462962962962963}*newRho*(x39 + x42) + V{-0.00462962962962963};
4392
4393}
4394
4395template <typename CELL, typename OLDRHO, typename OLDU, typename NEWRHO, typename NEWU, typename V=typename CELL::value_t>
4396static void defineNEq(CELL& cell, OLDRHO& oldRho, OLDU& oldU, NEWRHO& newRho, NEWU& newU) any_platform
4397{
4398auto x27 = oldU[0]*oldU[0];
4399auto x28 = V{1.5}*x27;
4400auto x29 = oldU[1]*oldU[1];
4401auto x30 = V{1.5}*x29;
4402auto x31 = oldU[2]*oldU[2];
4403auto x32 = V{1.5}*x31;
4404auto x33 = x30 + x32 + V{-1};
4405auto x34 = x28 + x33;
4406auto x35 = newU[0]*newU[0];
4407auto x36 = V{1.5}*x35;
4408auto x37 = newU[1]*newU[1];
4409auto x38 = V{1.5}*x37;
4410auto x39 = newU[2]*newU[2];
4411auto x40 = V{1.5}*x39;
4412auto x41 = x38 + x40 + V{-1};
4413auto x42 = x36 + x41;
4414auto x43 = V{0.0740740740740741}*oldRho;
4415auto x44 = V{3}*oldU[0];
4416auto x45 = V{3}*x27;
4417auto x46 = V{0.0740740740740741}*newRho;
4418auto x47 = V{3}*newU[0];
4419auto x48 = V{3}*x35;
4420auto x49 = V{3}*oldU[1];
4421auto x50 = V{3}*x29;
4422auto x51 = x28 + V{-1};
4423auto x52 = V{3}*newU[1];
4424auto x53 = V{3}*x37;
4425auto x54 = x36 + V{-1};
4426auto x55 = V{3}*oldU[2];
4427auto x56 = V{3}*x31;
4428auto x57 = V{3}*newU[2];
4429auto x58 = V{3}*x39;
4430auto x59 = V{0.0185185185185185}*oldRho;
4431auto x60 = oldU[0] + oldU[1];
4432auto x61 = V{4.5}*(x60*x60);
4433auto x62 = x34 + x44;
4434auto x63 = x49 + x62;
4435auto x64 = V{0.0185185185185185}*newRho;
4436auto x65 = newU[0] + newU[1];
4437auto x66 = V{4.5}*(x65*x65);
4438auto x67 = x42 + x47;
4439auto x68 = x52 + x67;
4440auto x69 = oldU[0] - oldU[1];
4441auto x70 = -V{4.5}*x69*x69;
4442auto x71 = -x49;
4443auto x72 = x62 + x71;
4444auto x73 = newU[0] - newU[1];
4445auto x74 = -V{4.5}*x73*x73;
4446auto x75 = -x52;
4447auto x76 = x67 + x75;
4448auto x77 = oldU[0] + oldU[2];
4449auto x78 = V{4.5}*(x77*x77);
4450auto x79 = newU[0] + newU[2];
4451auto x80 = V{4.5}*(x79*x79);
4452auto x81 = -x55;
4453auto x82 = -oldU[2];
4454auto x83 = x82 + oldU[0];
4455auto x84 = -V{4.5}*x83*x83;
4456auto x85 = -x57;
4457auto x86 = -newU[2];
4458auto x87 = x86 + newU[0];
4459auto x88 = -V{4.5}*x87*x87;
4460auto x89 = oldU[1] + oldU[2];
4461auto x90 = V{4.5}*(x89*x89);
4462auto x91 = x34 + x49;
4463auto x92 = x55 + x91;
4464auto x93 = newU[1] + newU[2];
4465auto x94 = V{4.5}*(x93*x93);
4466auto x95 = x42 + x52;
4467auto x96 = x57 + x95;
4468auto x97 = x82 + oldU[1];
4469auto x98 = -V{4.5}*x97*x97;
4470auto x99 = x86 + newU[1];
4471auto x100 = -V{4.5}*x99*x99;
4472auto x101 = V{0.00462962962962963}*oldRho;
4473auto x102 = x60 + oldU[2];
4474auto x103 = V{4.5}*(x102*x102);
4475auto x104 = V{0.00462962962962963}*newRho;
4476auto x105 = x65 + newU[2];
4477auto x106 = V{4.5}*(x105*x105);
4478auto x107 = x60 + x82;
4479auto x108 = V{4.5}*(x107*x107);
4480auto x109 = x65 + x86;
4481auto x110 = V{4.5}*(x109*x109);
4482auto x111 = x69 + oldU[2];
4483auto x112 = V{4.5}*(x111*x111);
4484auto x113 = x73 + newU[2];
4485auto x114 = V{4.5}*(x113*x113);
4486auto x115 = x93 - newU[0];
4487auto x116 = -V{4.5}*x115*x115;
4488auto x117 = x89 - oldU[0];
4489auto x118 = -V{4.5}*x117*x117;
4490auto x119 = -x38;
4491auto x120 = V{1} - x40;
4492auto x121 = x119 + x120;
4493auto x122 = x121 + x47;
4494auto x123 = -x30;
4495auto x124 = V{1} - x32;
4496auto x125 = x123 + x124;
4497auto x126 = x125 + x44;
4498auto x127 = -x36;
4499auto x128 = x127 + x52;
4500auto x129 = -x28;
4501auto x130 = x129 + x49;
4502auto x131 = x127 + x57;
4503auto x132 = x129 + x55;
4504auto x133 = x122 + x128;
4505auto x134 = x126 + x130;
4506auto x135 = -x44;
4507auto x136 = -x47;
4508auto x137 = x122 + x131;
4509auto x138 = x126 + x132;
4510auto x139 = x34 + x55;
4511auto x140 = x42 + x57;
4512cell[0] = -V{0.296296296296296}*newRho*x42 + V{0.296296296296296}*oldRho*x34 + cell[0];
4513cell[1] = x43*(x33 + x44 - x45) - x46*(x41 + x47 - x48) + cell[1];
4514cell[2] = x43*(x32 + x49 - x50 + x51) - x46*(x40 + x52 - x53 + x54) + cell[2];
4515cell[3] = x43*(x30 + x51 + x55 - x56) - x46*(x38 + x54 + x57 - x58) + cell[3];
4516cell[4] = x59*(-x61 + x63) - x64*(-x66 + x68) + cell[4];
4517cell[5] = x59*(x70 + x72) - x64*(x74 + x76) + cell[5];
4518cell[6] = x59*(x55 + x62 - x78) - x64*(x57 + x67 - x80) + cell[6];
4519cell[7] = x59*(x62 + x81 + x84) - x64*(x67 + x85 + x88) + cell[7];
4520cell[8] = x59*(-x90 + x92) - x64*(-x94 + x96) + cell[8];
4521cell[9] = x59*(x81 + x91 + x98) - x64*(x100 + x85 + x95) + cell[9];
4522cell[10] = x101*(-x103 + x55 + x63) - x104*(-x106 + x57 + x68) + cell[10];
4523cell[11] = x101*(-x108 + x63 + x81) - x104*(-x110 + x68 + x85) + cell[11];
4524cell[12] = x101*(-x112 + x55 + x72) - x104*(-x114 + x57 + x76) + cell[12];
4525cell[13] = -x101*(-x118 - x72 - x81) + x104*(-x116 - x76 - x85) + cell[13];
4526cell[14] = -x43*(x126 + x45) + x46*(x122 + x48) + cell[14];
4527cell[15] = -x43*(x124 + x130 + x50) + x46*(x120 + x128 + x53) + cell[15];
4528cell[16] = -x43*(x123 + x132 + x56 + V{1}) + x46*(x119 + x131 + x58 + V{1}) + cell[16];
4529cell[17] = -x59*(x134 + x61) + x64*(x133 + x66) + cell[17];
4530cell[18] = x59*(x135 + x70 + x91) - x64*(x136 + x74 + x95) + cell[18];
4531cell[19] = -x59*(x138 + x78) + x64*(x137 + x80) + cell[19];
4532cell[20] = x59*(x135 + x139 + x84) - x64*(x136 + x140 + x88) + cell[20];
4533cell[21] = -x59*(x125 + x130 + x55 + x90) + x64*(x121 + x128 + x57 + x94) + cell[21];
4534cell[22] = x59*(x139 + x71 + x98) - x64*(x100 + x140 + x75) + cell[22];
4535cell[23] = -x101*(x103 + x134 + x55) + x104*(x106 + x133 + x57) + cell[23];
4536cell[24] = -x101*(x108 + x134 + x81) + x104*(x110 + x133 + x85) + cell[24];
4537cell[25] = -x101*(x112 + x138 + x71) + x104*(x114 + x137 + x75) + cell[25];
4538cell[26] = x101*(x118 + x135 + x92) - x104*(x116 + x136 + x96) + cell[26];
4539
4540}
4541
4542template <typename CELL, typename RHO, typename U, typename PI, typename V=typename CELL::value_t>
4543static void defineNEqFromPi(CELL& cell, RHO& rho, U& u, PI& pi) any_platform
4544{
4545auto x27 = u[0]*u[0];
4546auto x28 = V{1.5}*x27;
4547auto x29 = u[1]*u[1];
4548auto x30 = V{1.5}*x29;
4549auto x31 = u[2]*u[2];
4550auto x32 = V{1.5}*x31;
4551auto x33 = x30 + x32 + V{-1};
4552auto x34 = x28 + x33;
4553auto x35 = V{0.0740740740740741}*rho;
4554auto x36 = V{3}*u[0];
4555auto x37 = V{3}*x27;
4556auto x38 = V{0.111111111111111}*pi[3];
4557auto x39 = V{0.111111111111111}*pi[5] + V{0.0740740740740741};
4558auto x40 = x38 + x39 - V{0.222222222222222}*pi[0];
4559auto x41 = V{3}*u[1];
4560auto x42 = V{3}*x29;
4561auto x43 = x28 + V{-1};
4562auto x44 = V{0.111111111111111}*pi[0];
4563auto x45 = x39 + x44 - V{0.222222222222222}*pi[3];
4564auto x46 = V{3}*u[2];
4565auto x47 = V{3}*x31;
4566auto x48 = x38 + x44 - V{0.222222222222222}*pi[5] + V{0.0740740740740741};
4567auto x49 = V{0.166666666666667}*pi[1];
4568auto x50 = V{0.0185185185185185}*rho;
4569auto x51 = u[0] + u[1];
4570auto x52 = V{4.5}*(x51*x51);
4571auto x53 = x34 + x36;
4572auto x54 = x41 + x53;
4573auto x55 = V{0.0277777777777778}*pi[5];
4574auto x56 = -V{0.0555555555555556}*pi[3];
4575auto x57 = V{0.0185185185185185} - V{0.0555555555555556}*pi[0];
4576auto x58 = x55 + x56 + x57;
4577auto x59 = u[0] - u[1];
4578auto x60 = -x59;
4579auto x61 = -x41;
4580auto x62 = x53 + x61;
4581auto x63 = x49 + x58;
4582auto x64 = V{0.166666666666667}*pi[2];
4583auto x65 = u[0] + u[2];
4584auto x66 = V{4.5}*(x65*x65);
4585auto x67 = V{0.0277777777777778}*pi[3];
4586auto x68 = -V{0.0555555555555556}*pi[5];
4587auto x69 = x57 + x67 + x68;
4588auto x70 = -x46;
4589auto x71 = -u[2];
4590auto x72 = x71 + u[0];
4591auto x73 = -x72;
4592auto x74 = x64 + x69;
4593auto x75 = V{0.166666666666667}*pi[4];
4594auto x76 = u[1] + u[2];
4595auto x77 = V{4.5}*(x76*x76);
4596auto x78 = x34 + x41;
4597auto x79 = x46 + x78;
4598auto x80 = V{0.0277777777777778}*pi[0];
4599auto x81 = x56 + x68 + x80 + V{0.0185185185185185};
4600auto x82 = x71 + u[1];
4601auto x83 = -x82;
4602auto x84 = x75 + x81;
4603auto x85 = V{0.00462962962962963}*rho;
4604auto x86 = x51 + u[2];
4605auto x87 = V{4.5}*(x86*x86);
4606auto x88 = V{0.0416666666666667}*pi[2];
4607auto x89 = V{0.0416666666666667}*pi[4];
4608auto x90 = x88 + x89;
4609auto x91 = V{0.0416666666666667}*pi[1];
4610auto x92 = V{0.0138888888888889}*pi[0] + V{0.0138888888888889}*pi[3] + V{0.0138888888888889}*pi[5] + V{-0.00462962962962963};
4611auto x93 = x91 + x92;
4612auto x94 = x90 + x93;
4613auto x95 = -x91;
4614auto x96 = x51 + x71;
4615auto x97 = -x96;
4616auto x98 = -V{0.0138888888888889}*pi[0] - V{0.0138888888888889}*pi[3] - V{0.0138888888888889}*pi[5] + V{0.00462962962962963};
4617auto x99 = x59 + u[2];
4618auto x100 = -x99;
4619auto x101 = -x88;
4620auto x102 = x101 + x89;
4621auto x103 = x91 + x98;
4622auto x104 = x76 - u[0];
4623auto x105 = x92 + x95;
4624auto x106 = -x30;
4625auto x107 = V{1} - x32;
4626auto x108 = x106 + x107;
4627auto x109 = x108 + x36;
4628auto x110 = -x28;
4629auto x111 = x110 + x41;
4630auto x112 = x110 + x46;
4631auto x113 = V{0.0555555555555556}*pi[3];
4632auto x114 = x109 + x111;
4633auto x115 = V{0.0555555555555556}*pi[0] + V{-0.0185185185185185};
4634auto x116 = -x36;
4635auto x117 = V{0.0555555555555556}*pi[5];
4636auto x118 = x109 + x112;
4637auto x119 = x34 + x46;
4638auto x120 = -x89;
4639auto x121 = x120 + x88;
4640auto x122 = -x104;
4641cell[0] = -V{0.296296296296296}*rho*x34 - V{0.444444444444444}*pi[0] - V{0.444444444444444}*pi[3] - V{0.444444444444444}*pi[5] + V{-0.296296296296296};
4642cell[1] = -x35*(x33 + x36 - x37) - x40;
4643cell[2] = -x35*(x32 + x41 - x42 + x43) - x45;
4644cell[3] = -x35*(x30 + x43 + x46 - x47) - x48;
4645cell[4] = x49 - x50*(-x52 + x54) - x58;
4646cell[5] = -x50*(x62 - V{4.5}*x60*x60) - x63;
4647cell[6] = -x50*(x46 + x53 - x66) + x64 - x69;
4648cell[7] = -x50*(x53 + x70 - V{4.5}*x73*x73) - x74;
4649cell[8] = -x50*(-x77 + x79) + x75 - x81;
4650cell[9] = -x50*(x70 + x78 - V{4.5}*x83*x83) - x84;
4651cell[10] = -x85*(x46 + x54 - x87) + x94;
4652cell[11] = -x85*(x54 + x70 - V{4.5}*x97*x97) - x90 - x95 - x98;
4653cell[12] = -x102 - x103 - x85*(x46 + x62 - V{4.5}*x100*x100);
4654cell[13] = x102 + x105 - x85*(x62 + x70 - V{4.5}*x104*x104);
4655cell[14] = V{0.0740740740740741}*rho*(x109 + x37) - x40;
4656cell[15] = V{0.0740740740740741}*rho*(x107 + x111 + x42) - x45;
4657cell[16] = V{0.0740740740740741}*rho*(x106 + x112 + x47 + V{1}) - x48;
4658cell[17] = x113 + x115 + x49 + x50*(x114 + x52) - x55;
4659cell[18] = -x50*(x116 + x78 - V{4.5}*x59*x59) - x63;
4660cell[19] = x115 + x117 + x50*(x118 + x66) + x64 - x67;
4661cell[20] = -x50*(x116 + x119 - V{4.5}*x72*x72) - x74;
4662cell[21] = x113 + x117 + x50*(x108 + x111 + x46 + x77) + x75 - x80 + V{-0.0185185185185185};
4663cell[22] = -x50*(x119 + x61 - V{4.5}*x82*x82) - x84;
4664cell[23] = x85*(x114 + x46 + x87) + x94;
4665cell[24] = x101 + x120 + x85*(x114 + x70 + V{4.5}*(x96*x96)) + x93;
4666cell[25] = x105 + x121 + x85*(x118 + x61 + V{4.5}*(x99*x99));
4667cell[26] = -x103 - x121 - x85*(x116 + x79 - V{4.5}*x122*x122);
4668
4669}
4670
4671template <typename CELL, typename FORCE, typename V=typename CELL::value_t>
4672static auto computePiNeqNormSqr(CELL& cell, FORCE& force) any_platform
4673{
4674auto x0 = V{1}*cell[12];
4675auto x1 = V{1}*cell[25];
4676auto x2 = -cell[23];
4677auto x3 = x2 + cell[10] + cell[12] - cell[19] - cell[25] + cell[6];
4678auto x4 = -cell[13] - cell[21] + cell[26] + cell[8];
4679auto x5 = cell[20] + cell[22] + cell[24] + cell[3];
4680auto x6 = x3 + x4 + x5 - cell[11] - cell[16] - cell[7] - cell[9];
4681auto x7 = cell[11] - cell[17] - cell[24] + cell[4];
4682auto x8 = cell[13] + cell[1] + cell[5] + cell[7];
4683auto x9 = x3 + x7 + x8 - cell[14] - cell[18] - cell[20] - cell[26];
4684auto x10 = cell[10] + cell[18] + cell[25] + cell[2] + cell[9];
4685auto x11 = x10 + x5 + x8 + cell[0] + cell[11] + cell[12] + cell[14] + cell[15] + cell[16] + cell[17] + cell[19] + cell[21] + cell[23] + cell[26] + cell[4] + cell[6] + cell[8];
4686auto x12 = V{1} / (x11 + V{1});
4687auto x13 = x12*(x11 + V{1});
4688auto x14 = V{0.5}*x13;
4689auto x15 = x12*x9;
4690auto x16 = V{1}*x15;
4691auto x17 = V{1}*cell[13];
4692auto x18 = V{1}*cell[26];
4693auto x19 = -V{1}*cell[10];
4694auto x20 = -V{1}*cell[23];
4695auto x21 = x17 + x18 + x19 + x20;
4696auto x22 = V{1}*cell[11];
4697auto x23 = V{1}*cell[24];
4698auto x24 = x22 + x23;
4699auto x25 = x0 + x1 - x14*(x6*force[0] + x9*force[2]) - x16*x6 - x21 - x24 + V{1}*cell[19] - V{1}*cell[20] + V{1}*cell[6] - V{1}*cell[7];
4700auto x26 = x10 + x2 + x4 + x7 - cell[12] - cell[15] - cell[22] - cell[5];
4701auto x27 = x26*force[0] + x9*force[1];
4702auto x28 = x0 + x1;
4703auto x29 = V{2}*cell[13];
4704auto x30 = V{2}*cell[26];
4705auto x31 = V{2}*cell[11];
4706auto x32 = V{2}*cell[24];
4707auto x33 = V{1}*x13;
4708auto x34 = V{2}*x26;
4709auto x35 = -V{2}*cell[10] + V{2}*cell[12] - V{2}*cell[23] + V{2}*cell[25];
4710auto x36 = x26*force[2] + x6*force[1];
4711auto x37 = x12*x6;
4712auto x38 = V{0.666666666666667}*cell[10];
4713auto x39 = V{0.666666666666667}*cell[11];
4714auto x40 = V{0.666666666666667}*cell[12];
4715auto x41 = V{0.666666666666667}*cell[13];
4716auto x42 = V{0.666666666666667}*cell[23];
4717auto x43 = V{0.666666666666667}*cell[24];
4718auto x44 = V{0.666666666666667}*cell[25];
4719auto x45 = V{0.666666666666667}*cell[26];
4720auto x46 = -V{0.333333333333333}*cell[0];
4721auto x47 = x38 + x39 + x40 + x41 + x42 + x43 + x44 + x45 + x46 - V{0.333333333333333}*cell[16] + V{0.666666666666667}*cell[17] + V{0.666666666666667}*cell[18] - V{0.333333333333333}*cell[3] + V{0.666666666666667}*cell[4] + V{0.666666666666667}*cell[5];
4722auto x48 = -V{0.333333333333333}*cell[15] + V{0.666666666666667}*cell[19] + V{0.666666666666667}*cell[20] - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[6] + V{0.666666666666667}*cell[7];
4723auto x49 = -x12*x9*x9 - x13*x9*force[0] + x47 + x48 + V{0.666666666666667}*cell[14] + V{0.666666666666667}*cell[1] - V{0.333333333333333}*cell[21] - V{0.333333333333333}*cell[22] - V{0.333333333333333}*cell[8] - V{0.333333333333333}*cell[9];
4724auto x50 = -V{0.333333333333333}*cell[14] - V{0.333333333333333}*cell[1] + V{0.666666666666667}*cell[21] + V{0.666666666666667}*cell[22] + V{0.666666666666667}*cell[8] + V{0.666666666666667}*cell[9];
4725auto x51 = -x12*x26*x26 - x13*x26*force[1] + x47 + x50 + V{0.666666666666667}*cell[15] - V{0.333333333333333}*cell[19] - V{0.333333333333333}*cell[20] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[6] - V{0.333333333333333}*cell[7];
4726auto x52 = -x12*x6*x6 - x13*x6*force[2] + x38 + x39 + x40 + x41 + x42 + x43 + x44 + x45 + x46 + x48 + x50 + V{0.666666666666667}*cell[16] - V{0.333333333333333}*cell[17] - V{0.333333333333333}*cell[18] + V{0.666666666666667}*cell[3] - V{0.333333333333333}*cell[4] - V{0.333333333333333}*cell[5];
4727return (-x14*x27 - x16*x26 - x21 + x22 + x23 - x28 + V{1}*cell[17] - V{1}*cell[18] + V{1}*cell[4] - V{1}*cell[5])*(-x15*x34 - x27*x33 - x29 - x30 + x31 + x32 - x35 + V{2}*cell[17] - V{2}*cell[18] + V{2}*cell[4] - V{2}*cell[5]) + (x29 + x30 - x31 - x32 - x33*x36 - x34*x37 - x35 + V{2}*cell[21] - V{2}*cell[22] + V{2}*cell[8] - V{2}*cell[9])*(-x14*x36 + x17 + x18 - x19 - x20 - x24 - V{1}*x26*x37 - x28 + V{1}*cell[21] - V{1}*cell[22] + V{1}*cell[8] - V{1}*cell[9]) + 2*(x25*x25) + x49*x49 + x51*x51 + x52*x52;
4728}
4729
4730template <typename CELL, typename V=typename CELL::value_t>
4731static auto computePiNeqNormSqr(CELL& cell) any_platform
4732{
4733auto x0 = -cell[11];
4734auto x1 = -cell[12];
4735auto x2 = -cell[17];
4736auto x3 = -cell[24];
4737auto x4 = x2 + x3 + cell[18];
4738auto x5 = cell[10] + cell[11] + cell[4];
4739auto x6 = -cell[23];
4740auto x7 = -cell[13] - cell[21];
4741auto x8 = x6 + x7 + cell[26] + cell[8];
4742auto x9 = x1 + x4 + x5 + x8 - cell[15] - cell[22] + cell[25] + cell[2] - cell[5] + cell[9];
4743auto x10 = -cell[19];
4744auto x11 = -cell[25];
4745auto x12 = x10 + x11 + cell[7];
4746auto x13 = x6 - cell[26];
4747auto x14 = cell[12] + cell[6];
4748auto x15 = cell[13] + cell[1];
4749auto x16 = x12 + x13 + x14 + x15 + x2 + x3 + x5 - cell[14] - cell[18] - cell[20] + cell[5];
4750auto x17 = cell[12] + cell[25];
4751auto x18 = x17 + cell[5];
4752auto x19 = cell[11] + cell[24];
4753auto x20 = x19 + cell[20];
4754auto x21 = cell[22] + cell[9];
4755auto x22 = cell[10] + cell[3];
4756auto x23 = V{1} / (x15 + x18 + x20 + x21 + x22 + cell[0] + cell[14] + cell[15] + cell[16] + cell[17] + cell[18] + cell[19] + cell[21] + cell[23] + cell[26] + cell[2] + cell[4] + cell[6] + cell[7] + cell[8] + V{1});
4757auto x24 = x16*x23;
4758auto x25 = -cell[10];
4759auto x26 = x25 + x6 + cell[13] + cell[26];
4760auto x27 = x0 + x18 + x24*x9 + x26 + x4 - cell[4];
4761auto x28 = x0 + x10 + x11 + x14 + x22 + x8 - cell[16] + cell[20] + cell[22] + cell[24] - cell[7] - cell[9];
4762auto x29 = x1 + x12 + x20 + x24*x28 + x26 - cell[6];
4763auto x30 = x13 + x17 + x19 + x21 + x23*x28*x9 + x25 + x7 - cell[8];
4764auto x31 = V{1}*x23;
4765auto x32 = V{0.666666666666667}*cell[10];
4766auto x33 = V{0.666666666666667}*cell[11];
4767auto x34 = V{0.666666666666667}*cell[12];
4768auto x35 = V{0.666666666666667}*cell[13];
4769auto x36 = V{0.666666666666667}*cell[23];
4770auto x37 = V{0.666666666666667}*cell[24];
4771auto x38 = V{0.666666666666667}*cell[25];
4772auto x39 = V{0.666666666666667}*cell[26];
4773auto x40 = -V{0.333333333333333}*cell[0];
4774auto x41 = x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x40 - V{0.333333333333333}*cell[16] + V{0.666666666666667}*cell[17] + V{0.666666666666667}*cell[18] - V{0.333333333333333}*cell[3] + V{0.666666666666667}*cell[4] + V{0.666666666666667}*cell[5];
4775auto x42 = -V{0.333333333333333}*cell[15] + V{0.666666666666667}*cell[19] + V{0.666666666666667}*cell[20] - V{0.333333333333333}*cell[2] + V{0.666666666666667}*cell[6] + V{0.666666666666667}*cell[7];
4776auto x43 = -x31*x16*x16 + x41 + x42 + V{0.666666666666667}*cell[14] + V{0.666666666666667}*cell[1] - V{0.333333333333333}*cell[21] - V{0.333333333333333}*cell[22] - V{0.333333333333333}*cell[8] - V{0.333333333333333}*cell[9];
4777auto x44 = -V{0.333333333333333}*cell[14] - V{0.333333333333333}*cell[1] + V{0.666666666666667}*cell[21] + V{0.666666666666667}*cell[22] + V{0.666666666666667}*cell[8] + V{0.666666666666667}*cell[9];
4778auto x45 = -x31*x9*x9 + x41 + x44 + V{0.666666666666667}*cell[15] - V{0.333333333333333}*cell[19] - V{0.333333333333333}*cell[20] + V{0.666666666666667}*cell[2] - V{0.333333333333333}*cell[6] - V{0.333333333333333}*cell[7];
4779auto x46 = -x31*x28*x28 + x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x40 + x42 + x44 + V{0.666666666666667}*cell[16] - V{0.333333333333333}*cell[17] - V{0.333333333333333}*cell[18] + V{0.666666666666667}*cell[3] - V{0.333333333333333}*cell[4] - V{0.333333333333333}*cell[5];
4780return V{2}*(x27*x27) + V{2}*(x29*x29) + V{2}*(x30*x30) + x43*x43 + x45*x45 + x46*x46;
4781}
4782
4783template <typename CELL, typename RHO, typename U, typename OMEGA, typename FORCE, typename V=typename CELL::value_t>
4784static void addExternalForce(CELL& cell, RHO& rho, U& u, OMEGA& omega, FORCE& force) any_platform
4785{
4786auto x27 = force[0]*u[0];
4787auto x28 = force[1]*u[1];
4788auto x29 = force[2]*u[2];
4789auto x30 = rho*(V{0.5}*omega + V{-1});
4790auto x31 = V{6}*u[0];
4791auto x32 = x31 + V{-3};
4792auto x33 = V{0.0740740740740741}*force[0];
4793auto x34 = V{0.222222222222222}*x28;
4794auto x35 = V{0.222222222222222}*x29;
4795auto x36 = x34 + x35;
4796auto x37 = V{6}*u[1];
4797auto x38 = x37 + V{-3};
4798auto x39 = V{0.0740740740740741}*force[1];
4799auto x40 = V{0.222222222222222}*x27;
4800auto x41 = x35 + x40;
4801auto x42 = V{6}*u[2];
4802auto x43 = x42 + V{-3};
4803auto x44 = V{0.0740740740740741}*force[2];
4804auto x45 = x34 + x40;
4805auto x46 = V{9}*u[1];
4806auto x47 = x32 + x46;
4807auto x48 = V{0.0185185185185185}*force[0];
4808auto x49 = V{9}*u[0];
4809auto x50 = x38 + x49;
4810auto x51 = V{0.0185185185185185}*force[1];
4811auto x52 = V{0.0555555555555556}*x29;
4812auto x53 = -x52;
4813auto x54 = V{3} - x31;
4814auto x55 = x46 + x54;
4815auto x56 = -x49;
4816auto x57 = x37 + V{3};
4817auto x58 = x56 + x57;
4818auto x59 = V{9}*u[2];
4819auto x60 = x32 + x59;
4820auto x61 = x43 + x49;
4821auto x62 = V{0.0185185185185185}*force[2];
4822auto x63 = V{0.0555555555555556}*x28;
4823auto x64 = -x63;
4824auto x65 = x42 + V{3};
4825auto x66 = x56 + x65;
4826auto x67 = V{0.0555555555555556}*x27;
4827auto x68 = -x67;
4828auto x69 = -x37;
4829auto x70 = x69 + V{3};
4830auto x71 = x59 + x70;
4831auto x72 = -x46;
4832auto x73 = x65 + x72;
4833auto x74 = V{0.00462962962962963}*x30;
4834auto x75 = -x59;
4835auto x76 = -x42;
4836auto x77 = x49 + V{-3};
4837auto x78 = x31 + V{3};
4838auto x79 = x46 + x78;
4839auto x80 = x49 + x57;
4840auto x81 = x49 + x70;
4841auto x82 = x72 + x78;
4842auto x83 = x49 + x65;
4843auto x84 = x76 + V{3};
4844auto x85 = x49 + x84;
4845cell[0] = V{0.888888888888889}*x30*(x27 + x28 + x29) + cell[0];
4846cell[1] = x30*(-x32*x33 + x36) + cell[1];
4847cell[2] = x30*(-x38*x39 + x41) + cell[2];
4848cell[3] = x30*(-x43*x44 + x45) + cell[3];
4849cell[4] = -x30*(x47*x48 + x50*x51 + x53) + cell[4];
4850cell[5] = -x30*(-x48*x55 - x52 + V{0.0185185185185185}*x58*force[1]) + cell[5];
4851cell[6] = -x30*(x48*x60 + x61*x62 + x64) + cell[6];
4852cell[7] = -x30*(-x48*(x54 + x59) - x63 + V{0.0185185185185185}*x66*force[2]) + cell[7];
4853cell[8] = -x30*(x51*(x38 + x59) + x62*(x43 + x46) + x68) + cell[8];
4854cell[9] = -x30*(-x51*x71 - x67 + V{0.0185185185185185}*x73*force[2]) + cell[9];
4855cell[10] = -x74*((x46 + x61)*force[2] + (x47 + x59)*force[0] + (x50 + x59)*force[1]) + cell[10];
4856cell[11] = -x74*((x47 + x75)*force[0] + (x50 + x75)*force[1] - (x46 + x76 + x77)*force[2]) + cell[11];
4857cell[12] = -x74*((x60 + x72)*force[0] + (x61 + x72)*force[2] - (x59 + x69 + x77)*force[1]) + cell[12];
4858cell[13] = -x74*((x46 + x66)*force[2] - (x55 + x59)*force[0] + (x58 + x59)*force[1]) + cell[13];
4859cell[14] = x30*(-x33*x78 + x36) + cell[14];
4860cell[15] = x30*(-x39*x57 + x41) + cell[15];
4861cell[16] = x30*(-x44*x65 + x45) + cell[16];
4862cell[17] = -x30*(x48*x79 + x51*x80 + x53) + cell[17];
4863cell[18] = -x30*(-x51*x81 - x52 + V{0.0185185185185185}*x82*force[0]) + cell[18];
4864cell[19] = -x30*(x48*(x59 + x78) + x62*x83 + x64) + cell[19];
4865cell[20] = -x30*(-x62*x85 - x63 + V{0.0185185185185185}*(x75 + x78)*force[0]) + cell[20];
4866cell[21] = -x30*(x51*(x57 + x59) + x62*(x46 + x65) + x68) + cell[21];
4867cell[22] = -x30*(-x62*(x46 + x84) - x67 + V{0.0185185185185185}*(x57 + x75)*force[1]) + cell[22];
4868cell[23] = -x74*((x46 + x83)*force[2] + (x59 + x79)*force[0] + (x59 + x80)*force[1]) + cell[23];
4869cell[24] = -x74*(-(x46 + x85)*force[2] + (x75 + x79)*force[0] + (x75 + x80)*force[1]) + cell[24];
4870cell[25] = -x74*(-(x49 + x71)*force[1] + (x49 + x73)*force[2] + (x59 + x82)*force[0]) + cell[25];
4871cell[26] = -x74*(-(x72 + x85)*force[2] - (x75 + x81)*force[1] + (x75 + x82)*force[0]) + cell[26];
4872
4873}
4874
4875};
4876
4877}
4878
4879#endif
4880
4881#endif
Descriptor for all types of 2D and 3D lattices.
Top level namespace for all of OpenLB.
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition platform.h:78
static V adeBgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
Advection diffusion BGK collision step.
Definition lbm.h:302
static void defineEqFirstOrder(CELL &cell, const NEWRHO &newRho, const NEWU &newU) any_platform
Definition lbm.h:389
static V constRhoBgkCollision(CELL &cell, const RHO &rho, const U &u, const RATIORHO &ratioRho, const OMEGA &omega) any_platform
BGK collision step with density correction.
Definition lbm.h:326
static void computeFeq(CELL &cell, FEQ &fEq) any_platform
Definition lbm.h:258
static void computeJ(CELL &cell, J &j) any_platform
Computation of momentum.
Definition lbm.h:197
static void computeFneq(CELL &cell, FNEQ &fNeq, const RHO &rho, const U &u) any_platform
Computation of non-equilibrium distribution.
Definition lbm.h:271
static void computeAllMomenta(CELL &cell, RHO &rho, U &u, PI &pi) any_platform
Computation of all hydrodynamic variables.
Definition lbm.h:251
static V computePiNeqNormSqr(CELL &cell, const FORCE &force) any_platform
Computes squared norm of non-equilibrium part of 2nd momentum for forced dynamics.
Definition lbm.h:424
static V rlbCollision(CELL &cell, const RHO &rho, const U &u, const OMEGA &omega) any_platform
RLB advection diffusion collision step.
Definition lbm.h:341
static void computeRhoJ(CELL &cell, RHO &rho, J &j) any_platform
Computation of hydrodynamic variables.
Definition lbm.h:211
static V computeRho(CELL &cell) any_platform
Computation of density.
Definition lbm.h:185
static void addExternalForce(CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const FORCE &force) any_platform
Add a force term after BGK collision.
Definition lbm.h:463
static V bgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
BGK collision step.
Definition lbm.h:290
static void computeStress(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
Computation of stress tensor.
Definition lbm.h:229
static void defineNEq(CELL &cell, const OLDRHO &oldRho, const OLDU &oldU, const NEWRHO &newRho, const NEWU &newU) any_platform
Definition lbm.h:397
static V incBgkCollision(CELL &cell, const PRESSURE &pressure, const J &j, const OMEGA &omega) any_platform
Incompressible BGK collision step.
Definition lbm.h:314
static void defineNEqFromPi(CELL &cell, const RHO &rho, const U &u, const PI &pi) any_platform
Definition lbm.h:410
static void computeRhoU(CELL &cell, RHO &rho, U &u) any_platform
Computation of hydrodynamic variables.
Definition lbm.h:219