25#include "core/DataTypes.h"
26#include "core/logging/Logging.h"
28#include "domain_decomposition/BlockDataID.h"
29#include "domain_decomposition/IBlock.h"
30#include "domain_decomposition/StructuredBlockStorage.h"
31#include "field/GhostLayerField.h"
32#include "field/SwapableCompare.h"
35#include <unordered_map>
38#define RESTRICT __restrict__
43#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
44 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
45#pragma GCC diagnostic push
46#pragma GCC diagnostic ignored "-Wunused-parameter"
47#pragma GCC diagnostic ignored "-Wreorder"
56 BlockDataID jID_, BlockDataID phiID_, BlockDataID rhoID_,
float D,
57 float f_ext_0,
float f_ext_1,
float f_ext_2, uint32_t field_size_0,
58 uint32_t field_size_1, uint32_t field_size_2,
float kT, uint32_t seed,
59 uint32_t time_step,
float z)
60 : jID(jID_), phiID(phiID_), rhoID(rhoID_), D_(D), f_ext_0_(f_ext_0),
61 f_ext_1_(f_ext_1), f_ext_2_(f_ext_2), field_size_0_(field_size_0),
62 field_size_1_(field_size_1), field_size_2_(field_size_2), kT_(kT),
63 seed_(seed), time_step_(time_step), z_(z), block_offset_0_(uint32_t(0)),
64 block_offset_1_(uint32_t(0)), block_offset_2_(uint32_t(0)),
70 const CellInterval &globalCellInterval,
71 cell_idx_t ghostLayers, IBlock *
block);
75 static std::function<void(IBlock *)>
79 return [kernel](IBlock *b) { kernel->run(b); };
86 const shared_ptr<StructuredBlockStorage> &blocks,
87 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
88 return [kernel, blocks, globalCellInterval, ghostLayers](IBlock *b) {
89 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b);
94 return [
this](IBlock *b) { this->
run(b); };
97 std::function<void(IBlock *)>
99 const CellInterval &globalCellInterval,
100 cell_idx_t ghostLayers = 1) {
101 return [
this, blocks, globalCellInterval, ghostLayers](IBlock *b) {
106 void configure(
const shared_ptr<StructuredBlockStorage> &blocks,
108 Cell BlockCellBB = blocks->getBlockCellBB(*block).min();
109 block_offset_0_ = uint32_t(BlockCellBB[0]);
110 block_offset_1_ = uint32_t(BlockCellBB[1]);
111 block_offset_2_ = uint32_t(BlockCellBB[2]);
115 inline float getD()
const {
return D_; }
125 inline float getKt()
const {
return kT_; }
126 inline uint32_t
getSeed()
const {
return seed_; }
128 inline float getZ()
const {
return z_; }
129 inline void setD(
const float value) { D_ = value; }
131 block_offset_0_ = value;
134 block_offset_1_ = value;
137 block_offset_2_ = value;
139 inline void setF_ext_0(
const float value) { f_ext_0_ = value; }
140 inline void setF_ext_1(
const float value) { f_ext_1_ = value; }
141 inline void setF_ext_2(
const float value) { f_ext_2_ = value; }
145 inline void setKt(
const float value) { kT_ = value; }
146 inline void setSeed(
const uint32_t value) { seed_ = value; }
148 inline void setZ(
const float value) { z_ = value; }
155 inline void setPhiID(BlockDataID phiID_) { phiID = phiID_; }
160 uint32_t block_offset_0_;
161 uint32_t block_offset_1_;
162 uint32_t block_offset_2_;
166 uint32_t field_size_0_;
167 uint32_t field_size_1_;
168 uint32_t field_size_2_;
180#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
181 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
182#pragma GCC diagnostic pop
uint32_t getTime_step() const
uint32_t getField_size_0() const
void operator()(IBlock *block)
void setF_ext_0(const float value)
void setField_size_1(const uint32_t value)
uint32_t getField_size_1() const
void setD(const float value)
void setTime_step(const uint32_t value)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
void configure(const shared_ptr< StructuredBlockStorage > &blocks, IBlock *block)
void setF_ext_2(const float value)
void setZ(const float value)
void setSeed(const uint32_t value)
void setField_size_0(const uint32_t value)
uint32_t getField_size_2() const
void setBlock_offset_2(const uint32_t value)
uint32_t getBlock_offset_2() const
static std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< DiffusiveFluxKernelWithElectrostaticThermalized_single_precision > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
void setKt(const float value)
DiffusiveFluxKernelWithElectrostaticThermalized_single_precision(BlockDataID jID_, BlockDataID phiID_, BlockDataID rhoID_, float D, float f_ext_0, float f_ext_1, float f_ext_2, uint32_t field_size_0, uint32_t field_size_1, uint32_t field_size_2, float kT, uint32_t seed, uint32_t time_step, float z)
uint32_t getBlock_offset_1() const
void setF_ext_1(const float value)
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block)
void setField_size_2(const uint32_t value)
void setBlock_offset_1(const uint32_t value)
void setPhiID(BlockDataID phiID_)
uint32_t getBlock_offset_0() const
void setBlock_offset_0(const uint32_t value)
std::function< void(IBlock *)> getSweep()
static std::function< void(IBlock *)> getSweep(const shared_ptr< DiffusiveFluxKernelWithElectrostaticThermalized_single_precision > &kernel)
static double * block(double *p, std::size_t index, std::size_t size)
\file PackInfoPdfDoublePrecision.cpp \author pystencils