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"
60 BlockDataID rho_0ID_, BlockDataID rho_1ID_, BlockDataID rho_2ID_,
61 double order_0,
double order_1,
double order_2,
double rate_coefficient,
62 double stoech_0,
double stoech_1,
double stoech_2)
63 : rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), rho_2ID(rho_2ID_),
64 order_0_(order_0), order_1_(order_1), order_2_(order_2),
65 rate_coefficient_(rate_coefficient), stoech_0_(stoech_0),
66 stoech_1_(stoech_1), stoech_2_(stoech_2) {}
71 const CellInterval &globalCellInterval,
72 cell_idx_t ghostLayers, IBlock *
block,
73 gpuStream_t
stream =
nullptr);
80 const shared_ptr<ReactionKernelBulk_3_double_precision_CUDA> &kernel) {
81 return [kernel](IBlock *b) { kernel->run(b); };
85 const shared_ptr<ReactionKernelBulk_3_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> & ,
120 inline void setOrder_0(
const double value) { order_0_ = value; }
121 inline void setOrder_1(
const double value) { order_1_ = value; }
122 inline void setOrder_2(
const double value) { order_2_ = value; }
124 rate_coefficient_ = value;
126 inline void setStoech_0(
const double value) { stoech_0_ = value; }
127 inline void setStoech_1(
const double value) { stoech_1_ = value; }
128 inline void setStoech_2(
const double value) { stoech_2_ = value; }
137 double rate_coefficient_;
146#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
147 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
148#pragma GCC diagnostic pop
void setOrder_0(const double value)
double getOrder_0() const
void setStoech_0(const double value)
void setOrder_2(const double value)
static std::function< void(IBlock *)> getSweep(const shared_ptr< ReactionKernelBulk_3_double_precision_CUDA > &kernel)
double getStoech_0() const
void setStoech_1(const double value)
void operator()(IBlock *block, gpuStream_t stream=nullptr)
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< ReactionKernelBulk_3_double_precision_CUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
void configure(const shared_ptr< StructuredBlockStorage > &, IBlock *)
double getOrder_1() const
void run(IBlock *block, gpuStream_t stream=nullptr)
double getOrder_2() const
double getStoech_2() const
std::function< void(IBlock *)> getSweep(gpuStream_t stream=nullptr)
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 setOrder_1(const double value)
void setStoech_2(const double value)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1, gpuStream_t stream=nullptr)
ReactionKernelBulk_3_double_precision_CUDA(BlockDataID rho_0ID_, BlockDataID rho_1ID_, BlockDataID rho_2ID_, double order_0, double order_1, double order_2, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2)
void setRate_coefficient(const double value)
double getRate_coefficient() const
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