ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ReactionKernelBulk_2_single_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_2_single_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_6de92b64acc501777cd14903620af26b {
49static FUNC_PREFIX void reactionkernelbulk_2_single_precision_reactionkernelbulk_2_single_precision(float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, 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, float order_0, float order_1, float rate_coefficient, float stoech_0, float stoech_1) {
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 float 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 float 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 float rate_factor = rate_coefficient * powf(local_rho_0, order_0) * powf(local_rho_1, order_1);
56 _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;
57 _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;
58 }
59 }
60 }
61}
62} // namespace internal_6de92b64acc501777cd14903620af26b
63
65
66 auto rho_1 = block->getData<field::GhostLayerField<float, 1>>(rho_1ID);
67 auto rho_0 = block->getData<field::GhostLayerField<float, 1>>(rho_0ID);
68
69 auto &stoech_0 = this->stoech_0_;
70 auto &rate_coefficient = this->rate_coefficient_;
71 auto &order_0 = this->order_0_;
72 auto &order_1 = this->order_1_;
73 auto &stoech_1 = this->stoech_1_;
74 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_0->nrOfGhostLayers()))
75 float *RESTRICT _data_rho_0 = rho_0->dataAt(0, 0, 0, 0);
76 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_1->nrOfGhostLayers()))
77 float *RESTRICT _data_rho_1 = rho_1->dataAt(0, 0, 0, 0);
78 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->xSizeWithGhostLayer(), int64_t(int64_c(rho_0->xSize()) + 0))
79 const int64_t _size_rho_0_0 = int64_t(int64_c(rho_0->xSize()) + 0);
80 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->ySizeWithGhostLayer(), int64_t(int64_c(rho_0->ySize()) + 0))
81 const int64_t _size_rho_0_1 = int64_t(int64_c(rho_0->ySize()) + 0);
82 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->zSizeWithGhostLayer(), int64_t(int64_c(rho_0->zSize()) + 0))
83 const int64_t _size_rho_0_2 = int64_t(int64_c(rho_0->zSize()) + 0);
84 const int64_t _stride_rho_0_0 = int64_t(rho_0->xStride());
85 const int64_t _stride_rho_0_1 = int64_t(rho_0->yStride());
86 const int64_t _stride_rho_0_2 = int64_t(rho_0->zStride());
87 const int64_t _stride_rho_1_0 = int64_t(rho_1->xStride());
88 const int64_t _stride_rho_1_1 = int64_t(rho_1->yStride());
89 const int64_t _stride_rho_1_2 = int64_t(rho_1->zStride());
90 internal_6de92b64acc501777cd14903620af26b::reactionkernelbulk_2_single_precision_reactionkernelbulk_2_single_precision(_data_rho_0, _data_rho_1, _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, order_0, order_1, rate_coefficient, stoech_0, stoech_1);
91}
92
93void ReactionKernelBulk_2_single_precision::runOnCellInterval(const shared_ptr<StructuredBlockStorage> &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block) {
94
95 CellInterval ci = globalCellInterval;
96 CellInterval blockBB = blocks->getBlockCellBB(*block);
97 blockBB.expand(ghostLayers);
98 ci.intersect(blockBB);
99 blocks->transformGlobalToBlockLocalCellInterval(ci, *block);
100 if (ci.empty())
101 return;
102
103 auto rho_1 = block->getData<field::GhostLayerField<float, 1>>(rho_1ID);
104 auto rho_0 = block->getData<field::GhostLayerField<float, 1>>(rho_0ID);
105
106 auto &stoech_0 = this->stoech_0_;
107 auto &rate_coefficient = this->rate_coefficient_;
108 auto &order_0 = this->order_0_;
109 auto &order_1 = this->order_1_;
110 auto &stoech_1 = this->stoech_1_;
111 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_0->nrOfGhostLayers()))
112 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_0->nrOfGhostLayers()))
113 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_0->nrOfGhostLayers()))
114 float *RESTRICT _data_rho_0 = rho_0->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
115 WALBERLA_ASSERT_GREATER_EQUAL(ci.xMin(), -int_c(rho_1->nrOfGhostLayers()))
116 WALBERLA_ASSERT_GREATER_EQUAL(ci.yMin(), -int_c(rho_1->nrOfGhostLayers()))
117 WALBERLA_ASSERT_GREATER_EQUAL(ci.zMin(), -int_c(rho_1->nrOfGhostLayers()))
118 float *RESTRICT _data_rho_1 = rho_1->dataAt(ci.xMin(), ci.yMin(), ci.zMin(), 0);
119 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->xSizeWithGhostLayer(), int64_t(int64_c(ci.xSize()) + 0))
120 const int64_t _size_rho_0_0 = int64_t(int64_c(ci.xSize()) + 0);
121 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->ySizeWithGhostLayer(), int64_t(int64_c(ci.ySize()) + 0))
122 const int64_t _size_rho_0_1 = int64_t(int64_c(ci.ySize()) + 0);
123 WALBERLA_ASSERT_GREATER_EQUAL(rho_0->zSizeWithGhostLayer(), int64_t(int64_c(ci.zSize()) + 0))
124 const int64_t _size_rho_0_2 = int64_t(int64_c(ci.zSize()) + 0);
125 const int64_t _stride_rho_0_0 = int64_t(rho_0->xStride());
126 const int64_t _stride_rho_0_1 = int64_t(rho_0->yStride());
127 const int64_t _stride_rho_0_2 = int64_t(rho_0->zStride());
128 const int64_t _stride_rho_1_0 = int64_t(rho_1->xStride());
129 const int64_t _stride_rho_1_1 = int64_t(rho_1->yStride());
130 const int64_t _stride_rho_1_2 = int64_t(rho_1->zStride());
131 internal_6de92b64acc501777cd14903620af26b::reactionkernelbulk_2_single_precision_reactionkernelbulk_2_single_precision(_data_rho_0, _data_rho_1, _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, order_0, order_1, rate_coefficient, stoech_0, stoech_1);
132}
133
134} // namespace pystencils
135} // namespace walberla
136
137#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || (defined WALBERLA_CXX_COMPILER_IS_CLANG)
138#pragma GCC diagnostic pop
139#endif
140
141#if (defined WALBERLA_CXX_COMPILER_IS_INTEL)
142#pragma warning pop
143#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_2_single_precision_reactionkernelbulk_2_single_precision(float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, 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, float order_0, float order_1, float rate_coefficient, float stoech_0, float stoech_1)
\file PackInfoPdfDoublePrecision.cpp \author pystencils