36#include <boost/algorithm/string/predicate.hpp>
55namespace Interactions {
63 std::shared_ptr<const ::Bonded_IA_Parameters>
bonded_ia()
const {
73 return {
vec.begin(),
vec.end()};
81 throw std::runtime_error(
"Parameter '" +
key +
"' is missing");
86 throw std::runtime_error(
"Parameter '" +
key +
"' is not recognized");
93 check_valid_parameters(
params);
108 if (
name ==
"is_same_bond") {
113 if (
name ==
"get_num_partners") {
125 return std::get<CoreBondedInteraction>(*
bonded_ia());
142 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
202 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
218 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
236 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
255 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
274 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
308 [
this]() {
return get_struct().pot->minval; }},
310 [
this]() {
return get_struct().pot->maxval; }},
312 [
this]() {
return get_struct().pot->energy_tab; }},
314 [
this]() {
return get_struct().pot->force_tab; }},
333 [
this]() {
return get_struct().pot->minval; }},
335 [
this]() {
return get_struct().pot->maxval; }},
337 [
this]() {
return get_struct().pot->energy_tab; }},
339 [
this]() {
return get_struct().pot->force_tab; }},
359 [
this]() {
return get_struct().pot->minval; }},
361 [
this]() {
return get_struct().pot->maxval; }},
363 [
this]() {
return get_struct().pot->energy_tab; }},
365 [
this]() {
return get_struct().pot->force_tab; }},
388 [
this]() {
return get_struct().temp_distance; }},
390 [
this]() {
return get_struct().gamma_distance; }},
398 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
412 [
this]() {
return std::sqrt(
get_struct().d2); }},
414 [
this]() {
return 0.5 *
get_struct().p_tol; }},
436 [
this]() {
return std::get<0>(
get_struct().p_ids); }},
438 [
this]() {
return std::get<1>(
get_struct().p_ids); }},
440 [
this]() {
return std::get<2>(
get_struct().p_ids); }},
446 return std::string(
"NeoHookean");
448 return std::string(
"Skalak");
451 [
this]() {
return get_struct().is_initialized; }},
455 return std::vector<double>{{s.l0, s.lp0, s.sinPhi0, s.cosPhi0,
456 s.area0, s.a1, s.a2, s.b1, s.b2}};
470 throw std::invalid_argument(
471 "Invalid value for parameter 'elasticLaw': '" +
law_name +
"'");
490 bond.is_initialized =
true;
492 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(std::move(
bond));
501 [
this]() {
return static_cast<int>(
get_struct().softID); }},
509 if (
name ==
"current_volume") {
517 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(
529 [
this]() {
return std::get<0>(
get_struct().p_ids); }},
531 [
this]() {
return std::get<1>(
get_struct().p_ids); }},
533 [
this]() {
return std::get<2>(
get_struct().p_ids); }},
535 [
this]() {
return std::get<3>(
get_struct().p_ids); }},
538 return std::string((
get_struct().flat) ?
"Flat" :
"Initial");
543 [
this]() {
return get_struct().is_initialized; }},
556 throw std::invalid_argument(
"Invalid value for parameter 'refShape': '" +
565 bond.is_initialized =
true;
567 m_bonded_ia = std::make_shared<::Bonded_IA_Parameters>(std::move(
bond));
Data structures for bonded interactions.
int number_of_partners(Bonded_IA_Parameters const &iaparams)
Get the number of bonded partners for the specified bond.
Bind parameters in the script interface.
std::vector< std::string_view > valid_parameters() const final
void add_parameters(std::vector< AutoParameter > &¶ms)
virtual void parallel_try_catch(std::function< void()> const &cb) const =0
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
CoreBondedInteraction & get_struct()
CoreIA CoreBondedInteraction
std::shared_ptr<::Bonded_IA_Parameters > m_bonded_ia
std::set< std::string > get_valid_parameters() const
bool operator==(BondedInteraction const &other) const
std::shared_ptr< const ::Bonded_IA_Parameters > bonded_ia() const
void do_construct(VariantMap const ¶ms) override
virtual void construct_bond(VariantMap const ¶ms)=0
std::shared_ptr<::Bonded_IA_Parameters > bonded_ia()
Variant do_call_method(std::string const &name, VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
Variant do_call_method(std::string const &name, VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const ¶ms) override
void construct_bond(VariantMap const &) override
Context * context() const
Responsible context.
std::string_view name() const
Implementation in thermostat.cpp.
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
std::unordered_map< std::string, Variant > VariantMap
static SteepestDescentParameters params
Currently active steepest descent instance.
static constexpr const ReadOnly read_only
Recursive variant implementation.