30#include <blockforest/StructuredBlockForest.h>
31#include <domain_decomposition/BlockDataID.h>
32#include <domain_decomposition/IBlock.h>
33#include <field/AddToStorage.h>
34#include <field/FlagField.h>
35#include <field/FlagUID.h>
36#include <waLBerlaDefinitions.h>
48template <lbmpy::Arch Architecture = lbmpy::Arch::CPU>
53 bool m_pending_changes;
62#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
65 detail::ReactionKernelIndexedSelector::KernelTrait<>::
66 ReactionKernelIndexed::IndexVectors,
67 detail::ReactionKernelIndexedSelector::KernelTraitGPU<>::
68 ReactionKernelIndexedGPU::IndexVectors>::type;
71 detail::ReactionKernelIndexedSelector::KernelTrait<>::
72 ReactionKernelIndexed::IndexInfo,
73 detail::ReactionKernelIndexedSelector::KernelTraitGPU<>::
74 ReactionKernelIndexedGPU::IndexInfo>::type;
76 using IndexVectors = detail::ReactionKernelIndexedSelector::KernelTrait<>::
77 ReactionKernelIndexed::IndexVectors;
78 using IndexInfo = detail::ReactionKernelIndexedSelector::KernelTrait<>::
79 ReactionKernelIndexed::IndexInfo;
94 m_pending_changes(
false) {
95 m_flagfield_id = field::addFlagFieldToStorage<FlagField>(
99 auto createIdxVector = [](IBlock *
const, StructuredBlockStorage *
const) {
129 std::function<
void(IBlock *)> kernel;
131 kernel = detail::ReactionKernelIndexedSelector::get_kernel(
134#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
135 kernel = detail::ReactionKernelIndexedSelector::get_kernel_gpu(
145 bool is_boundary)
override {
148 get_flag_field_and_flag(
bc->block, m_flagfield_id);
154 m_pending_changes =
true;
162 get_flag_field_and_flag(
bc->block, m_flagfield_id);
169 if (m_pending_changes) {
171 fillFromFlagField(
block);
173 m_pending_changes =
false;
178 void fillFromFlagField(IBlock &
block) {
210 if (inner.contains(
it.x(),
it.y(),
it.z())) {
Vector implementation and trait types for boost qvm interoperability.
std::vector< std::shared_ptr< EKReactant > > reactants_type
auto get_lattice() const noexcept
double get_coefficient() const noexcept
auto const & get_reactants() const noexcept
std::optional< bool > get_node_is_boundary(Utils::Vector3i const &node) override
FlagUID const Boundary_flag
Flag for boundary cells.
FlagUID const Domain_flag
Flag for domain cells, i.e.
field::FlagField< uint8_t > FlagField
detail::ReactionKernelIndexedSelector::KernelTrait<>::ReactionKernelIndexed::IndexInfo IndexInfo
~EKReactionImplIndexed() override=default
detail::ReactionKernelIndexedSelector::KernelTrait<>::ReactionKernelIndexed::IndexVectors IndexVectors
EKReactionImplIndexed(std::shared_ptr< LatticeWalberla > const &lattice, reactants_type const &reactants, double coefficient)
void set_node_is_boundary(Utils::Vector3i const &node, bool is_boundary) override
void perform_reaction() override
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
std::optional< BlockAndCell > get_block_and_cell(::LatticeWalberla const &lattice, signed_integral_vector auto const &node, bool consider_ghost_layers)