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__
45#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
46 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
47#pragma GCC diagnostic push
48#pragma GCC diagnostic ignored "-Wunused-parameter"
49#pragma GCC diagnostic ignored "-Wreorder"
58 BlockDataID jID_,
float D,
59 float kT,
float rho_lb)
60 : fID(fID_), jID(jID_), D_(D), kT_(kT), rho_lb_(rho_lb) {}
65 const CellInterval &globalCellInterval,
66 cell_idx_t ghostLayers, IBlock *
block,
67 gpuStream_t
stream =
nullptr);
74 const shared_ptr<FrictionCouplingKernel_single_precision_CUDA> &kernel) {
75 return [kernel](IBlock *b) { kernel->run(b); };
79 const shared_ptr<FrictionCouplingKernel_single_precision_CUDA> &kernel,
80 const shared_ptr<StructuredBlockStorage> &blocks,
81 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
82 return [kernel, blocks, globalCellInterval,
83 ghostLayers](IBlock *b, gpuStream_t
stream =
nullptr) {
84 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b,
93 std::function<void(IBlock *)>
95 const CellInterval &globalCellInterval,
96 cell_idx_t ghostLayers = 1,
97 gpuStream_t
stream =
nullptr) {
98 return [
this, blocks, globalCellInterval, ghostLayers,
stream](IBlock *b) {
104 void configure(
const shared_ptr<StructuredBlockStorage> & ,
107 inline float getD()
const {
return D_; }
108 inline float getKt()
const {
return kT_; }
110 inline void setD(
const float value) { D_ = value; }
111 inline void setKt(
const float value) { kT_ = value; }
112 inline void setRho_lb(
const float value) { rho_lb_ = value; }
125#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
126 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
127#pragma GCC diagnostic pop
void setD(const float value)
void setRho_lb(const float value)
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block, gpuStream_t stream=nullptr)
static std::function< void(IBlock *)> getSweep(const shared_ptr< FrictionCouplingKernel_single_precision_CUDA > &kernel)
void setKt(const float value)
FrictionCouplingKernel_single_precision_CUDA(BlockDataID fID_, BlockDataID jID_, float D, float kT, float rho_lb)
void operator()(IBlock *block, gpuStream_t stream=nullptr)
std::function< void(IBlock *)> getSweep(gpuStream_t stream=nullptr)
void configure(const shared_ptr< StructuredBlockStorage > &, IBlock *)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1, gpuStream_t stream=nullptr)
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< FrictionCouplingKernel_single_precision_CUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
void run(IBlock *block, 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