ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ReactionKernelIndexed_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 ReactionKernelIndexed_5_double_precision.cpp
17//! \\author pystencils
18//======================================================================================================================
19
20// kernel generated with pystencils v1.4+1.ge851f4e, lbmpy v1.4+1.ge9efe34, sympy v1.12.1, lbmpy_walberla/pystencils_walberla from waLBerla commit 007e77e077ad9d22b5eed6f3d3118240993e553c
21
23#include "core/DataTypes.h"
24#include "core/Macros.h"
25
26#define FUNC_PREFIX
27
28using namespace std;
29
30namespace walberla {
31namespace pystencils {
32
33#ifdef __GNUC__
34#pragma GCC diagnostic push
35#pragma GCC diagnostic ignored "-Wstrict-aliasing"
36#pragma GCC diagnostic ignored "-Wunused-variable"
37#pragma GCC diagnostic ignored "-Wconversion"
38#endif
39
40#ifdef __CUDACC__
41#pragma push
42#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
43#pragma nv_diag_suppress 177
44#else
45#pragma diag_suppress 177
46#endif
47#endif
48// NOLINTBEGIN(readability-non-const-parameter*)
49namespace internal_714956d26e6eb81c5dec60e7ab7da8ab {
50static FUNC_PREFIX void reactionkernelindexed_5_double_precision_boundary_ReactionKernelIndexed_5_double_precision(uint8_t *RESTRICT const _data_indexVector, 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 _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, int32_t indexVectorSize, 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) {
51 for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) {
52 const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0]));
53 const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4]));
54 const int32_t z = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 8]));
55
56 const double local_rho_0 = _data_rho_0[_stride_rho_0_0 * x + _stride_rho_0_1 * y + _stride_rho_0_2 * z];
57 const double local_rho_1 = _data_rho_1[_stride_rho_1_0 * x + _stride_rho_1_1 * y + _stride_rho_1_2 * z];
58 const double local_rho_2 = _data_rho_2[_stride_rho_2_0 * x + _stride_rho_2_1 * y + _stride_rho_2_2 * z];
59 const double local_rho_3 = _data_rho_3[_stride_rho_3_0 * x + _stride_rho_3_1 * y + _stride_rho_3_2 * z];
60 const double local_rho_4 = _data_rho_4[_stride_rho_4_0 * x + _stride_rho_4_1 * y + _stride_rho_4_2 * z];
61 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;
62 _data_rho_0[_stride_rho_0_0 * x + _stride_rho_0_1 * y + _stride_rho_0_2 * z] = local_rho_0 + rate_factor * stoech_0;
63 _data_rho_1[_stride_rho_1_0 * x + _stride_rho_1_1 * y + _stride_rho_1_2 * z] = local_rho_1 + rate_factor * stoech_1;
64 _data_rho_2[_stride_rho_2_0 * x + _stride_rho_2_1 * y + _stride_rho_2_2 * z] = local_rho_2 + rate_factor * stoech_2;
65 _data_rho_3[_stride_rho_3_0 * x + _stride_rho_3_1 * y + _stride_rho_3_2 * z] = local_rho_3 + rate_factor * stoech_3;
66 _data_rho_4[_stride_rho_4_0 * x + _stride_rho_4_1 * y + _stride_rho_4_2 * z] = local_rho_4 + rate_factor * stoech_4;
67 }
68}
69} // namespace internal_714956d26e6eb81c5dec60e7ab7da8ab
70
71// NOLINTEND(readability-non-const-parameter*)
72#ifdef __GNUC__
73#pragma GCC diagnostic pop
74#endif
75
76#ifdef __CUDACC__
77#pragma pop
78#endif
79
80void ReactionKernelIndexed_5_double_precision::run_impl(IBlock *block, IndexVectors::Type type) {
81 auto *indexVectors = block->uncheckedFastGetData<IndexVectors>(indexVectorID);
82 int32_t indexVectorSize = int32_c(indexVectors->indexVector(type).size());
83 if (indexVectorSize == 0)
84 return;
85
86 auto pointer = indexVectors->pointerCpu(type);
87
88 uint8_t *_data_indexVector = reinterpret_cast<uint8_t *>(pointer);
89
90 auto rho_3 = block->getData<field::GhostLayerField<double, 1>>(rho_3ID);
91 auto rho_1 = block->getData<field::GhostLayerField<double, 1>>(rho_1ID);
92 auto rho_2 = block->getData<field::GhostLayerField<double, 1>>(rho_2ID);
93 auto rho_4 = block->getData<field::GhostLayerField<double, 1>>(rho_4ID);
94 auto rho_0 = block->getData<field::GhostLayerField<double, 1>>(rho_0ID);
95
96 auto &rate_coefficient = rate_coefficient_;
97 auto &stoech_1 = stoech_1_;
98 auto &stoech_3 = stoech_3_;
99 auto &order_3 = order_3_;
100 auto &order_1 = order_1_;
101 auto &order_4 = order_4_;
102 auto &stoech_2 = stoech_2_;
103 auto &stoech_4 = stoech_4_;
104 auto &order_0 = order_0_;
105 auto &stoech_0 = stoech_0_;
106 auto &order_2 = order_2_;
107 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_0->nrOfGhostLayers()))
108 double *RESTRICT _data_rho_0 = rho_0->dataAt(0, 0, 0, 0);
110 double *RESTRICT _data_rho_1 = rho_1->dataAt(0, 0, 0, 0);
112 double *RESTRICT _data_rho_2 = rho_2->dataAt(0, 0, 0, 0);
114 double *RESTRICT _data_rho_3 = rho_3->dataAt(0, 0, 0, 0);
116 double *RESTRICT _data_rho_4 = rho_4->dataAt(0, 0, 0, 0);
117 const int64_t _stride_rho_0_0 = int64_t(rho_0->xStride());
118 const int64_t _stride_rho_0_1 = int64_t(rho_0->yStride());
119 const int64_t _stride_rho_0_2 = int64_t(rho_0->zStride());
120 const int64_t _stride_rho_1_0 = int64_t(rho_1->xStride());
121 const int64_t _stride_rho_1_1 = int64_t(rho_1->yStride());
122 const int64_t _stride_rho_1_2 = int64_t(rho_1->zStride());
123 const int64_t _stride_rho_2_0 = int64_t(rho_2->xStride());
124 const int64_t _stride_rho_2_1 = int64_t(rho_2->yStride());
125 const int64_t _stride_rho_2_2 = int64_t(rho_2->zStride());
126 const int64_t _stride_rho_3_0 = int64_t(rho_3->xStride());
127 const int64_t _stride_rho_3_1 = int64_t(rho_3->yStride());
128 const int64_t _stride_rho_3_2 = int64_t(rho_3->zStride());
129 const int64_t _stride_rho_4_0 = int64_t(rho_4->xStride());
130 const int64_t _stride_rho_4_1 = int64_t(rho_4->yStride());
131 const int64_t _stride_rho_4_2 = int64_t(rho_4->zStride());
132 internal_714956d26e6eb81c5dec60e7ab7da8ab::reactionkernelindexed_5_double_precision_boundary_ReactionKernelIndexed_5_double_precision(_data_indexVector, _data_rho_0, _data_rho_1, _data_rho_2, _data_rho_3, _data_rho_4, _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, indexVectorSize, order_0, order_1, order_2, order_3, order_4, rate_coefficient, stoech_0, stoech_1, stoech_2, stoech_3, stoech_4);
133}
134
138
142
146
147} // namespace pystencils
148} // namespace walberla
#define FUNC_PREFIX
\file AdvectiveFluxKernel_double_precision.cpp \author pystencils
#define RESTRICT
\file AdvectiveFluxKernel_double_precision.h \author pystencils
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static double * block(double *p, std::size_t index, std::size_t size)
Definition elc.cpp:177
STL namespace.
static FUNC_PREFIX void reactionkernelindexed_5_double_precision_boundary_ReactionKernelIndexed_5_double_precision(uint8_t *RESTRICT const _data_indexVector, 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 _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, int32_t indexVectorSize, 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)
\file PackInfoPdfDoublePrecision.cpp \author pystencils