24#ifdef ESPRESSO_WALBERLA
50 [[nodiscard]] std::shared_ptr<::walberla::EKReactionBase>
69 return reactant->is_gpu();
77 auto get_order = [](
Variant const &v) {
81 auto const sum_alphas =
82 std::accumulate(reactant.begin(), reactant.end(), 0.,
83 [get_order](
double sum,
auto &element) {
84 return sum + get_order(element);
98 std::ranges::transform(reactants, std::back_inserter(output),
get_instance);
100 auto const coefficient =
103 return allocator(lattice->lattice(), output, coefficient);
150 return get_instance()->get_lattice()->get_grid_dimensions();
169 [[nodiscard]]
auto get_impl()
const {
return m_ekreaction_impl; }
173 if (method ==
"set_node_is_boundary") {
177 m_ekreaction_impl->set_node_is_boundary(
181 if (method ==
"get_node_is_boundary") {
185 auto const result = m_ekreaction_impl->get_node_is_boundary(index);
192 std::shared_ptr<::walberla::EKReactionBaseIndexed> m_ekreaction_impl;
Variant get_parameter(const std::string &name) const final
void add_parameters(std::vector< AutoParameter > &¶ms)
Utils::Vector3i get_mapped_index(Utils::Vector3i const &index, Utils::Vector3i const &shape) const
Context * context() const
Responsible context.
void do_construct(VariantMap const &args) override
void do_construct(VariantMap const &args) override
Variant do_call_method(std::string const &method, VariantMap const ¶meters) override
auto get_conversion_coefficient() const noexcept
auto get_is_gpu(VariantMap const &args) const
double m_conv_coefficient
std::shared_ptr<::walberla::EKReactionBase > m_ekreaction
auto get_agrid(VariantMap const &args) const
std::shared_ptr<::walberla::EKReactionBase > get_instance() const
auto calculate_bulk_conversion_factor(VariantMap const &args) const
auto make_instance(VariantMap const &args, F &allocator) const
std::vector< std::shared_ptr< EKReactant > > reactants_type
make_recursive_variant< ObjectRef > Variant
Possible types for parameters.
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
std::unordered_map< std::string, Variant > VariantMap
constexpr const None none
None-"literal".
T reduce_optional(boost::mpi::communicator const &comm, std::optional< T > const &result)
Reduce an optional on the head node.
DEVICE_QUALIFIER constexpr T int_pow(T x)
Calculate integer powers.
std::shared_ptr< EKReactionBaseIndexed > new_ek_reaction_indexed_gpu(std::shared_ptr< LatticeWalberla > const &lattice, typename EKReactionBase::reactants_type const &reactants, double coefficient)
std::shared_ptr< EKReactionBase > new_ek_reaction_bulk_gpu(std::shared_ptr< LatticeWalberla > const &lattice, typename EKReactionBase::reactants_type const &reactants, double coefficient)
std::shared_ptr< EKReactionBaseIndexed > new_ek_reaction_indexed_cpu(std::shared_ptr< LatticeWalberla > const &lattice, typename EKReactionBase::reactants_type const &reactants, double coefficient)
std::shared_ptr< EKReactionBase > new_ek_reaction_bulk_cpu(std::shared_ptr< LatticeWalberla > const &lattice, typename EKReactionBase::reactants_type const &reactants, double coefficient)
static constexpr const ReadOnly read_only