34#include <boost/mpi/collectives/all_reduce.hpp>
35#include <boost/serialization/vector.hpp>
46 std::optional<bool>
const &is_boundary) {
47 return boost::mpi::all_reduce(comm, is_boundary ? *is_boundary :
false,
53 if (
name ==
"override_index") {
56 auto const index = get_value<Utils::Vector3i>(
params,
"index");
63 if (
name ==
"set_density") {
64 auto const dens = get_value<double>(
params,
"value");
65 m_ek_species->set_node_density(m_index, dens * m_conv_dens);
66 m_ek_species->ghost_communication();
69 if (
name ==
"get_density") {
70 auto const result = m_ek_species->get_node_density(m_index);
74 if (
name ==
"get_is_boundary") {
75 auto const result = m_ek_species->get_node_is_boundary(m_index);
78 if (
name ==
"get_node_density_at_boundary") {
79 auto const boundary_opt =
80 m_ek_species->get_node_is_density_boundary(m_index);
82 auto const result = m_ek_species->get_node_density_at_boundary(m_index);
88 if (
name ==
"set_node_density_at_boundary") {
90 m_ek_species->remove_node_from_density_boundary(m_index);
92 auto const dens = get_value<double>(
params,
"value") * m_conv_dens;
93 m_ek_species->set_node_density_boundary(m_index, dens);
97 if (
name ==
"get_node_flux_at_boundary") {
98 auto const boundary_opt = m_ek_species->get_node_is_flux_boundary(m_index);
100 auto const result = m_ek_species->get_node_flux_at_boundary(m_index);
106 if (
name ==
"set_node_flux_at_boundary") {
108 m_ek_species->remove_node_from_flux_boundary(m_index);
111 get_value<Utils::Vector3d>(
params,
"value") * m_conv_flux;
112 m_ek_species->set_node_flux_boundary(m_index, flux);
Vector implementation and trait types for boost qvm interoperability.
bool is_index_valid(Utils::Vector3i const &index, Utils::Vector3i const &shape) const
Type to indicate no value in Variant.
boost::string_ref name() const
Context * context() const
Responsible context.
Variant do_call_method(std::string const &name, VariantMap const ¶ms) override
This file contains the defaults for ESPResSo.
#define ES_OK
error code if no error occurred
#define ES_ERROR
error code if an error occurred
static bool is_boundary_all_reduce(boost::mpi::communicator const &comm, std::optional< bool > const &is_boundary)
std::unordered_map< std::string, Variant > VariantMap
boost::make_recursive_variant< None, bool, int, std::size_t, double, std::string, ObjectRef, Utils::Vector3b, Utils::Vector3i, Utils::Vector2d, Utils::Vector3d, Utils::Vector4d, std::vector< int >, std::vector< double >, std::vector< boost::recursive_variant_ >, std::unordered_map< int, boost::recursive_variant_ >, std::unordered_map< std::string, boost::recursive_variant_ > >::type Variant
Possible types for parameters.
bool is_none(Variant const &v)
T reduce_optional(boost::mpi::communicator const &comm, std::optional< T > const &result)
Reduce an optional on the head node.
static SteepestDescentParameters params
Currently active steepest descent instance.