ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ReactionKernelBulk_5_double_precision.cpp
Go to the documentation of this file.
1//======================================================================================================================
2//
3// This file is part of waLBerla. waLBerla is free software: you can
4// redistribute it and/or modify it under the terms of the GNU General Public
5// License as published by the Free Software Foundation, either version 3 of
6// the License, or (at your option) any later version.
7//
8// waLBerla is distributed in the hope that it will be useful, but WITHOUT
9// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11// for more details.
12//
13// You should have received a copy of the GNU General Public License along
14// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
15//
16//! \\file ReactionKernelBulk_5_double_precision.cpp
17//! \\author pystencils
18//======================================================================================================================
19
20// kernel generated with pystencils v1.3.3, lbmpy v1.3.3, lbmpy_walberla/pystencils_walberla from waLBerla commit b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
21
22#include <cmath>
23
25#include "core/DataTypes.h"
26#include "core/Macros.h"
27
28#define FUNC_PREFIX
29
30#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || (defined WALBERLA_CXX_COMPILER_IS_CLANG)
31#pragma GCC diagnostic push
32#pragma GCC diagnostic ignored "-Wfloat-equal"
33#pragma GCC diagnostic ignored "-Wshadow"
34#pragma GCC diagnostic ignored "-Wconversion"
35#pragma GCC diagnostic ignored "-Wunused-variable"
36#endif
37
38#if (defined WALBERLA_CXX_COMPILER_IS_INTEL)
39#pragma warning push
40#pragma warning(disable : 1599)
41#endif
42
43using namespace std;
44
45namespace walberla {
46namespace pystencils {
47
48namespace internal_5119d69793e3096feaaca816d627c080 {
49static FUNC_PREFIX void reactionkernelbulk_5_double_precision_reactionkernelbulk_5_double_precision(double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, double *RESTRICT _data_rho_3, double *RESTRICT _data_rho_4, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int64_t const _stride_rho_4_0, int64_t const _stride_rho_4_1, int64_t const _stride_rho_4_2, double order_0, double order_1, double order_2, double order_3, double order_4, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2, double stoech_3, double stoech_4) {
50 for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) {
51 for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) {
52 for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) {
53 const double local_rho_0 = _data_rho_0[_stride_rho_0_0 * ctr_0 + _stride_rho_0_1 * ctr_1 + _stride_rho_0_2 * ctr_2];
54 const double local_rho_1 = _data_rho_1[_stride_rho_1_0 * ctr_0 + _stride_rho_1_1 * ctr_1 + _stride_rho_1_2 * ctr_2];
55 const double local_rho_2 = _data_rho_2[_stride_rho_2_0 * ctr_0 + _stride_rho_2_1 * ctr_1 + _stride_rho_2_2 * ctr_2];
56 const double local_rho_3 = _data_rho_3[_stride_rho_3_0 * ctr_0 + _stride_rho_3_1 * ctr_1 + _stride_rho_3_2 * ctr_2];
57 const double local_rho_4 = _data_rho_4[_stride_rho_4_0 * ctr_0 + _stride_rho_4_1 * ctr_1 + _stride_rho_4_2 * ctr_2];
58 const double rate_factor = pow(local_rho_0, order_0) * pow(local_rho_1, order_1) * pow(local_rho_2, order_2) * pow(local_rho_3, order_3) * pow(local_rho_4, order_4) * rate_coefficient;
59 _data_rho_0[_stride_rho_0_0 * ctr_0 + _stride_rho_0_1 * ctr_1 + _stride_rho_0_2 * ctr_2] = local_rho_0 + rate_factor * stoech_0;
60 _data_rho_1[_stride_rho_1_0 * ctr_0 + _stride_rho_1_1 * ctr_1 + _stride_rho_1_2 * ctr_2] = local_rho_1 + rate_factor * stoech_1;
61 _data_rho_2[_stride_rho_2_0 * ctr_0 + _stride_rho_2_1 * ctr_1 + _stride_rho_2_2 * ctr_2] = local_rho_2 + rate_factor * stoech_2;
62 _data_rho_3[_stride_rho_3_0 * ctr_0 + _stride_rho_3_1 * ctr_1 + _stride_rho_3_2 * ctr_2] = local_rho_3 + rate_factor * stoech_3;
63 _data_rho_4[_stride_rho_4_0 * ctr_0 + _stride_rho_4_1 * ctr_1 + _stride_rho_4_2 * ctr_2] = local_rho_4 + rate_factor * stoech_4;
64 }
65 }
66 }
67}
68} // namespace internal_5119d69793e3096feaaca816d627c080
69
71
72 auto rho_0 = block->getData<field::GhostLayerField<double, 1>>(rho_0ID);
73 auto rho_1 = block->getData<field::GhostLayerField<double, 1>>(rho_1ID);
74 auto rho_3 = block->getData<field::GhostLayerField<double, 1>>(rho_3ID);
75 auto rho_4 = block->getData<field::GhostLayerField<double, 1>>(rho_4ID);
76 auto rho_2 = block->getData<field::GhostLayerField<double, 1>>(rho_2ID);
77
78 auto &stoech_2 = this->stoech_2_;
79 auto &rate_coefficient = this->rate_coefficient_;
80 auto &stoech_1 = this->stoech_1_;
81 auto &stoech_3 = this->stoech_3_;
82 auto &order_0 = this->order_0_;
83 auto &stoech_0 = this->stoech_0_;
84 auto &order_2 = this->order_2_;
85 auto &order_4 = this->order_4_;
86 auto &order_1 = this->order_1_;
87 auto &stoech_4 = this->stoech_4_;
88 auto &order_3 = this->order_3_;
89 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_0->nrOfGhostLayers()))
90 double *RESTRICT _data_rho_0 = rho_0->dataAt(0, 0, 0, 0);
91 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_1->nrOfGhostLayers()))
92 double *RESTRICT _data_rho_1 = rho_1->dataAt(0, 0, 0, 0);
93 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_2->nrOfGhostLayers()))
94 double *RESTRICT _data_rho_2 = rho_2->dataAt(0, 0, 0, 0);
95 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_3->nrOfGhostLayers()))
96 double *RESTRICT _data_rho_3 = rho_3->dataAt(0, 0, 0, 0);
97 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_4->nrOfGhostLayers()))
98 double *RESTRICT _data_rho_4 = rho_4->dataAt(0, 0, 0, 0);
99 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->xSizeWithGhostLayer(), int64_t(int64_c(rho_0->xSize()) + 0))
100 const int64_t _size_rho_0_0 = int64_t(int64_c(rho_0->xSize()) + 0);
101 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->ySizeWithGhostLayer(), int64_t(int64_c(rho_0->ySize()) + 0))
102 const int64_t _size_rho_0_1 = int64_t(int64_c(rho_0->ySize()) + 0);
103 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->zSizeWithGhostLayer(), int64_t(int64_c(rho_0->zSize()) + 0))
104 const int64_t _size_rho_0_2 = int64_t(int64_c(rho_0->zSize()) + 0);
105 const int64_t _stride_rho_0_0 = int64_t(rho_0->xStride());
106 const int64_t _stride_rho_0_1 = int64_t(rho_0->yStride());
107 const int64_t _stride_rho_0_2 = int64_t(rho_0->zStride());
108 const int64_t _stride_rho_1_0 = int64_t(rho_1->xStride());
109 const int64_t _stride_rho_1_1 = int64_t(rho_1->yStride());
110 const int64_t _stride_rho_1_2 = int64_t(rho_1->zStride());
111 const int64_t _stride_rho_2_0 = int64_t(rho_2->xStride());
112 const int64_t _stride_rho_2_1 = int64_t(rho_2->yStride());
113 const int64_t _stride_rho_2_2 = int64_t(rho_2->zStride());
114 const int64_t _stride_rho_3_0 = int64_t(rho_3->xStride());
115 const int64_t _stride_rho_3_1 = int64_t(rho_3->yStride());
116 const int64_t _stride_rho_3_2 = int64_t(rho_3->zStride());
117 const int64_t _stride_rho_4_0 = int64_t(rho_4->xStride());
118 const int64_t _stride_rho_4_1 = int64_t(rho_4->yStride());
119 const int64_t _stride_rho_4_2 = int64_t(rho_4->zStride());
120 internal_5119d69793e3096feaaca816d627c080::reactionkernelbulk_5_double_precision_reactionkernelbulk_5_double_precision(_data_rho_0, _data_rho_1, _data_rho_2, _data_rho_3, _data_rho_4, _size_rho_0_0, _size_rho_0_1, _size_rho_0_2, _stride_rho_0_0, _stride_rho_0_1, _stride_rho_0_2, _stride_rho_1_0, _stride_rho_1_1, _stride_rho_1_2, _stride_rho_2_0, _stride_rho_2_1, _stride_rho_2_2, _stride_rho_3_0, _stride_rho_3_1, _stride_rho_3_2, _stride_rho_4_0, _stride_rho_4_1, _stride_rho_4_2, order_0, order_1, order_2, order_3, order_4, rate_coefficient, stoech_0, stoech_1, stoech_2, stoech_3, stoech_4);
121}
122
123void ReactionKernelBulk_5_double_precision::runOnCellInterval(const shared_ptr<StructuredBlockStorage> &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block) {
124
125 CellInterval ci = globalCellInterval;
126 CellInterval blockBB = blocks->getBlockCellBB(*block);
127 blockBB.expand(ghostLayers);
128 ci.intersect(blockBB);
129 blocks->transformGlobalToBlockLocalCellInterval(ci, *block);
130 if (ci.empty())
131 return;
132
133 auto rho_0 = block->getData<field::GhostLayerField<double, 1>>(rho_0ID);
134 auto rho_1 = block->getData<field::GhostLayerField<double, 1>>(rho_1ID);
135 auto rho_3 = block->getData<field::GhostLayerField<double, 1>>(rho_3ID);
136 auto rho_4 = block->getData<field::GhostLayerField<double, 1>>(rho_4ID);
137 auto rho_2 = block->getData<field::GhostLayerField<double, 1>>(rho_2ID);
138
139 auto &stoech_2 = this->stoech_2_;
140 auto &rate_coefficient = this->rate_coefficient_;
141 auto &stoech_1 = this->stoech_1_;
142 auto &stoech_3 = this->stoech_3_;
143 auto &order_0 = this->order_0_;
144 auto &stoech_0 = this->stoech_0_;
145 auto &order_2 = this->order_2_;
146 auto &order_4 = this->order_4_;
147 auto &order_1 = this->order_1_;
148 auto &stoech_4 = this->stoech_4_;
149 auto &order_3 = this->order_3_;
150 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_0->nrOfGhostLayers()))
151 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_0->nrOfGhostLayers()))
152 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_0->nrOfGhostLayers()))
153 double *RESTRICT _data_rho_0 = rho_0->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
154 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_1->nrOfGhostLayers()))
155 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_1->nrOfGhostLayers()))
156 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_1->nrOfGhostLayers()))
157 double *RESTRICT _data_rho_1 = rho_1->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
158 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_2->nrOfGhostLayers()))
159 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_2->nrOfGhostLayers()))
160 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_2->nrOfGhostLayers()))
161 double *RESTRICT _data_rho_2 = rho_2->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
162 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_3->nrOfGhostLayers()))
163 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_3->nrOfGhostLayers()))
164 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_3->nrOfGhostLayers()))
165 double *RESTRICT _data_rho_3 = rho_3->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
166 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_4->nrOfGhostLayers()))
167 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_4->nrOfGhostLayers()))
168 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_4->nrOfGhostLayers()))
169 double *RESTRICT _data_rho_4 = rho_4->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
170 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->xSizeWithGhostLayer(), int64_t(int64_c(ci.xSize()) + 0))
171 const int64_t _size_rho_0_0 = int64_t(int64_c(ci.xSize()) + 0);
172 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->ySizeWithGhostLayer(), int64_t(int64_c(ci.ySize()) + 0))
173 const int64_t _size_rho_0_1 = int64_t(int64_c(ci.ySize()) + 0);
174 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->zSizeWithGhostLayer(), int64_t(int64_c(ci.zSize()) + 0))
175 const int64_t _size_rho_0_2 = int64_t(int64_c(ci.zSize()) + 0);
176 const int64_t _stride_rho_0_0 = int64_t(rho_0->xStride());
177 const int64_t _stride_rho_0_1 = int64_t(rho_0->yStride());
178 const int64_t _stride_rho_0_2 = int64_t(rho_0->zStride());
179 const int64_t _stride_rho_1_0 = int64_t(rho_1->xStride());
180 const int64_t _stride_rho_1_1 = int64_t(rho_1->yStride());
181 const int64_t _stride_rho_1_2 = int64_t(rho_1->zStride());
182 const int64_t _stride_rho_2_0 = int64_t(rho_2->xStride());
183 const int64_t _stride_rho_2_1 = int64_t(rho_2->yStride());
184 const int64_t _stride_rho_2_2 = int64_t(rho_2->zStride());
185 const int64_t _stride_rho_3_0 = int64_t(rho_3->xStride());
186 const int64_t _stride_rho_3_1 = int64_t(rho_3->yStride());
187 const int64_t _stride_rho_3_2 = int64_t(rho_3->zStride());
188 const int64_t _stride_rho_4_0 = int64_t(rho_4->xStride());
189 const int64_t _stride_rho_4_1 = int64_t(rho_4->yStride());
190 const int64_t _stride_rho_4_2 = int64_t(rho_4->zStride());
191 internal_5119d69793e3096feaaca816d627c080::reactionkernelbulk_5_double_precision_reactionkernelbulk_5_double_precision(_data_rho_0, _data_rho_1, _data_rho_2, _data_rho_3, _data_rho_4, _size_rho_0_0, _size_rho_0_1, _size_rho_0_2, _stride_rho_0_0, _stride_rho_0_1, _stride_rho_0_2, _stride_rho_1_0, _stride_rho_1_1, _stride_rho_1_2, _stride_rho_2_0, _stride_rho_2_1, _stride_rho_2_2, _stride_rho_3_0, _stride_rho_3_1, _stride_rho_3_2, _stride_rho_4_0, _stride_rho_4_1, _stride_rho_4_2, order_0, order_1, order_2, order_3, order_4, rate_coefficient, stoech_0, stoech_1, stoech_2, stoech_3, stoech_4);
192}
193
194} // namespace pystencils
195} // namespace walberla
196
197#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || (defined WALBERLA_CXX_COMPILER_IS_CLANG)
198#pragma GCC diagnostic pop
199#endif
200
201#if (defined WALBERLA_CXX_COMPILER_IS_INTEL)
202#pragma warning pop
203#endif
#define FUNC_PREFIX
\file AdvectiveFluxKernel_double_precision.cpp \author pystencils
#define RESTRICT
\file AdvectiveFluxKernel_double_precision.h \author pystencils
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block)
static double * block(double *p, std::size_t index, std::size_t size)
Definition elc.cpp:172
static FUNC_PREFIX void reactionkernelbulk_5_double_precision_reactionkernelbulk_5_double_precision(double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, double *RESTRICT _data_rho_3, double *RESTRICT _data_rho_4, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int64_t const _stride_rho_4_0, int64_t const _stride_rho_4_1, int64_t const _stride_rho_4_2, double order_0, double order_1, double order_2, double order_3, double order_4, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2, double stoech_3, double stoech_4)