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__
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_, BlockDataID phiID_, BlockDataID rhoID_,
double D,
59 double f_ext_0,
double f_ext_1,
double f_ext_2, uint32_t field_size_0,
60 uint32_t field_size_1, uint32_t field_size_2,
double kT, uint32_t seed,
61 uint32_t time_step,
double z)
62 : jID(jID_), phiID(phiID_), rhoID(rhoID_), D_(D), f_ext_0_(f_ext_0),
63 f_ext_1_(f_ext_1), f_ext_2_(f_ext_2), field_size_0_(field_size_0),
64 field_size_1_(field_size_1), field_size_2_(field_size_2), kT_(kT),
65 seed_(seed), time_step_(time_step), z_(z), block_offset_0_(uint32_t(0)),
66 block_offset_1_(uint32_t(0)), block_offset_2_(uint32_t(0)),
72 const CellInterval &globalCellInterval,
73 cell_idx_t ghostLayers, IBlock *
block);
77 static std::function<void(IBlock *)>
81 return [kernel](IBlock *b) { kernel->run(b); };
88 const shared_ptr<StructuredBlockStorage> &blocks,
89 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
90 return [kernel, blocks, globalCellInterval, ghostLayers](IBlock *b) {
91 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b);
96 return [
this](IBlock *b) { this->
run(b); };
99 std::function<void(IBlock *)>
101 const CellInterval &globalCellInterval,
102 cell_idx_t ghostLayers = 1) {
103 return [
this, blocks, globalCellInterval, ghostLayers](IBlock *b) {
108 void configure(
const shared_ptr<StructuredBlockStorage> &blocks,
110 Cell BlockCellBB = blocks->getBlockCellBB(*block).min();
111 block_offset_0_ = uint32_t(BlockCellBB[0]);
112 block_offset_1_ = uint32_t(BlockCellBB[1]);
113 block_offset_2_ = uint32_t(BlockCellBB[2]);
117 inline double getD()
const {
return D_; }
127 inline double getKt()
const {
return kT_; }
128 inline uint32_t
getSeed()
const {
return seed_; }
130 inline double getZ()
const {
return z_; }
131 inline void setD(
const double value) { D_ = value; }
133 block_offset_0_ = value;
136 block_offset_1_ = value;
139 block_offset_2_ = value;
141 inline void setF_ext_0(
const double value) { f_ext_0_ = value; }
142 inline void setF_ext_1(
const double value) { f_ext_1_ = value; }
143 inline void setF_ext_2(
const double value) { f_ext_2_ = value; }
147 inline void setKt(
const double value) { kT_ = value; }
148 inline void setSeed(
const uint32_t value) { seed_ = value; }
150 inline void setZ(
const double value) { z_ = value; }
157 inline void setPhiID(BlockDataID phiID_) { phiID = phiID_; }
162 uint32_t block_offset_0_;
163 uint32_t block_offset_1_;
164 uint32_t block_offset_2_;
168 uint32_t field_size_0_;
169 uint32_t field_size_1_;
170 uint32_t field_size_2_;
182#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
183 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
184#pragma GCC diagnostic pop
uint32_t getField_size_0() const
void setBlock_offset_1(const uint32_t value)
void setZ(const double value)
void setF_ext_2(const double value)
uint32_t getField_size_2() const
uint32_t getTime_step() const
void configure(const shared_ptr< StructuredBlockStorage > &blocks, IBlock *block)
void setKt(const double value)
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block)
double getF_ext_0() const
void setSeed(const uint32_t value)
void setPhiID(BlockDataID phiID_)
void setF_ext_1(const double value)
void setBlock_offset_2(const uint32_t value)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
static std::function< void(IBlock *)> getSweep(const shared_ptr< DiffusiveFluxKernelWithElectrostaticThermalized_double_precision > &kernel)
void setTime_step(const uint32_t value)
void setD(const double value)
void setBlock_offset_0(const uint32_t value)
DiffusiveFluxKernelWithElectrostaticThermalized_double_precision(BlockDataID jID_, BlockDataID phiID_, BlockDataID rhoID_, double D, double f_ext_0, double f_ext_1, double f_ext_2, uint32_t field_size_0, uint32_t field_size_1, uint32_t field_size_2, double kT, uint32_t seed, uint32_t time_step, double z)
void setField_size_2(const uint32_t value)
static std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< DiffusiveFluxKernelWithElectrostaticThermalized_double_precision > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
std::function< void(IBlock *)> getSweep()
void setField_size_1(const uint32_t value)
double getF_ext_1() const
uint32_t getField_size_1() const
void setField_size_0(const uint32_t value)
void operator()(IBlock *block)
uint32_t getBlock_offset_2() const
uint32_t getBlock_offset_1() const
void setF_ext_0(const double value)
uint32_t getBlock_offset_0() const
double getF_ext_2() const
static double * block(double *p, std::size_t index, std::size_t size)
\file PackInfoPdfDoublePrecision.cpp \author pystencils