22#ifdef ESPRESSO_STOKESIAN_DYNAMICS
73 context()->parallel_try_catch([&]() {
83 if (approx ==
"fts") {
85 }
else if (approx !=
"ft") {
86 throw std::invalid_argument(
"Unknown approximation '" + approx +
"'");
88 m_instance = std::make_shared<::StokesianDynamics>(
90 get_value<std::unordered_map<int, double>>(params,
"radii"), bitfield);
95 context()->parallel_try_catch([&]() {
96 auto &system = get_system();
97 auto const &box_geo = *system.box_geo;
98 if (box_geo.periodic(0) or box_geo.periodic(1) or box_geo.periodic(2)) {
99 throw std::runtime_error(
100 "Stokesian Dynamics requires periodicity (False, False, False)");
102 system.stokesian_dynamics = m_instance;
void add_parameters(std::vector< AutoParameter > &¶ms)
::StokesianDynamics const & get_instance() const
void do_construct(VariantMap const ¶ms) override
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
auto make_unordered_map_of_variants(std::unordered_map< K, V > const &v)
T get_value_or(VariantMap const &vals, std::string const &name, T const &default_)
Get a value from a VariantMap by name, or return a default value if it does not exist.
std::unordered_map< std::string, Variant > VariantMap
See durlofsky87a for the Stokesian dynamics method used here.
static constexpr const ReadOnly read_only