24#ifdef SCAFACOS_DIPOLES
44 std::shared_ptr<boost::mpi::environment> m_mpi_env_lock;
50 [
this]() {
return actor()->get_method(); }},
60 m_mpi_env_lock.reset();
64 auto const method_name = get_value<std::string>(
params,
"method_name");
65 auto const param_list =
params.at(
"method_params");
66 auto const prefactor = get_value<double>(
params,
"prefactor");
69 if (prefactor <= 0.) {
70 throw std::domain_error(
"Parameter 'prefactor' must be > 0");
75 actor()->set_prefactor(prefactor);
83 if (
name ==
"get_available_methods") {
Communication::MpiCallbacks manages MPI communication using a visitor pattern.
ScafacosContextBase provides the public interface of the ScaFaCoS bridge.
void add_parameters(std::vector< AutoParameter > &¶ms)
virtual void parallel_try_catch(std::function< void()> const &cb) const =0
Common interface for magnetostatic actors.
Variant do_call_method(std::string const &name, VariantMap const ¶ms) override
std::shared_ptr< CoreActorClass > actor()
std::shared_ptr< CoreActorClass > m_actor
void do_construct(VariantMap const ¶ms) override
~DipolarScafacos() override
Variant do_call_method(std::string const &name, VariantMap const ¶ms) override
VariantMap get_parameters() const
Get current parameters.
boost::string_ref name() const
Context * context() const
Responsible context.
This file contains the defaults for ESPResSo.
This file contains the asynchronous MPI communication.
std::shared_ptr< DipolarScafacos > make_dipolar_scafacos(std::string const &method, std::string const ¶meters)
std::shared_ptr< MpiCallbacks > mpiCallbacksHandle()
std::unordered_map< std::string, Variant > deserialize_parameters(std::string const ¶meters)
Convert flattened parameters to a map.
std::string serialize_parameters(Variant const &pack)
Flatten a parameter map.
std::vector< std::string > available_methods()
Fetch list of methods compiled in ScaFaCoS.
std::unordered_map< std::string, Variant > VariantMap
auto make_vector_of_variants(std::vector< T > const &v)
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.
static SteepestDescentParameters params
Currently active steepest descent instance.
static void sanity_check_method(std::string const &method_name)
static constexpr const ReadOnly read_only