25#include "core/DataTypes.h"
26#include "core/logging/Logging.h"
28#include "gpu/GPUField.h"
29#include "gpu/GPUWrapper.h"
31#include "domain_decomposition/BlockDataID.h"
32#include "domain_decomposition/IBlock.h"
33#include "domain_decomposition/StructuredBlockStorage.h"
34#include "field/SwapableCompare.h"
37#include <unordered_map>
40#define RESTRICT __restrict__
42#define RESTRICT __restrict
47#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
48 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
49#pragma GCC diagnostic push
50#pragma GCC diagnostic ignored "-Wunused-parameter"
51#pragma GCC diagnostic ignored "-Wreorder"
61 double order_0,
double order_1,
62 double rate_coefficient,
63 double stoech_0,
double stoech_1)
64 : rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), order_0_(order_0),
65 order_1_(order_1), rate_coefficient_(rate_coefficient),
66 stoech_0_(stoech_0), stoech_1_(stoech_1) {}
71 const CellInterval &globalCellInterval,
72 cell_idx_t ghostLayers, IBlock *
block,
73 gpuStream_t
stream =
nullptr);
80 const shared_ptr<ReactionKernelBulk_2_double_precision_CUDA> &kernel) {
81 return [kernel](IBlock *b) { kernel->run(b); };
85 const shared_ptr<ReactionKernelBulk_2_double_precision_CUDA> &kernel,
86 const shared_ptr<StructuredBlockStorage> &blocks,
87 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
88 return [kernel, blocks, globalCellInterval,
89 ghostLayers](IBlock *b, gpuStream_t
stream =
nullptr) {
90 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b,
99 std::function<void(IBlock *)>
101 const CellInterval &globalCellInterval,
102 cell_idx_t ghostLayers = 1,
103 gpuStream_t
stream =
nullptr) {
104 return [
this, blocks, globalCellInterval, ghostLayers,
stream](IBlock *b) {
110 void configure(
const shared_ptr<StructuredBlockStorage> & ,
118 inline void setOrder_0(
const double value) { order_0_ = value; }
119 inline void setOrder_1(
const double value) { order_1_ = value; }
121 rate_coefficient_ = value;
123 inline void setStoech_0(
const double value) { stoech_0_ = value; }
124 inline void setStoech_1(
const double value) { stoech_1_ = value; }
131 double rate_coefficient_;
139#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
140 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
141#pragma GCC diagnostic pop
double getOrder_0() const
double getRate_coefficient() const
double getStoech_1() const
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block, gpuStream_t stream=nullptr)
void setStoech_1(const double value)
void configure(const shared_ptr< StructuredBlockStorage > &, IBlock *)
double getOrder_1() const
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< ReactionKernelBulk_2_double_precision_CUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
double getStoech_0() const
void setOrder_0(const double value)
void setStoech_0(const double value)
void operator()(IBlock *block, gpuStream_t stream=nullptr)
void run(IBlock *block, gpuStream_t stream=nullptr)
ReactionKernelBulk_2_double_precision_CUDA(BlockDataID rho_0ID_, BlockDataID rho_1ID_, double order_0, double order_1, double rate_coefficient, double stoech_0, double stoech_1)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1, gpuStream_t stream=nullptr)
void setOrder_1(const double value)
static std::function< void(IBlock *)> getSweep(const shared_ptr< ReactionKernelBulk_2_double_precision_CUDA > &kernel)
void setRate_coefficient(const double value)
std::function< void(IBlock *)> getSweep(gpuStream_t stream=nullptr)
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)
\file PackInfoPdfDoublePrecision.cpp \author pystencils