Loading [MathJax]/extensions/TeX/AMSmath.js
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
NonBondedInteraction.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/** @file
21 * The ScriptInterface counterparts of the non-bonded interactions parameters
22 * structs from the core are defined here.
23 */
24
25#pragma once
26
30
33
34#include <algorithm>
35#include <array>
36#include <cmath>
37#include <cstddef>
38#include <iterator>
39#include <memory>
40#include <stdexcept>
41#include <string>
42#include <tuple>
43#include <vector>
44
45namespace ScriptInterface {
46namespace Interactions {
47
48class NonBondedInteractionHandle;
49
50template <class CoreIA>
52 : public AutoParameters<InteractionPotentialInterface<CoreIA>> {
53public:
55
56protected:
60
61 /** @brief Managed object. */
62 std::shared_ptr<CoreInteraction> m_handle;
63 /** @brief Handle to the container whose members have to be synchronized. */
64 std::weak_ptr<::IA_parameters> m_core_struct;
65 /** @brief Handle to the interface used to synchronize data members. */
66 std::weak_ptr<NonBondedInteractionHandle *> m_si_struct;
67 /** @brief Callback to notify changes to the interaction range. */
68 std::weak_ptr<std::function<void()>> m_notify_non_bonded_ia_change;
69 /** @brief Pointer to the corresponding member in a handle. */
71 /** @brief Create a new instance using the constructor with range checks. */
72 virtual void make_new_instance(VariantMap const &params) = 0;
73 /** @brief Which parameter indicates whether the potential is inactive. */
74 virtual std::string inactive_parameter() const { return "cutoff"; }
75 /** @brief Which magic value indicates the potential is inactive. */
76 virtual double inactive_cutoff() const { return INACTIVE_CUTOFF; }
77
78 template <typename T>
81 [this, ptr]() { return m_handle.get()->*ptr; }};
82 }
83
84private:
85 void check_valid_parameters(VariantMap const &params) const {
86 auto const keys = get_valid_parameters();
87 for (auto const &key : keys) {
88 if (params.count(std::string(key)) == 0) {
89 throw std::runtime_error("Parameter '" + key + "' is missing");
90 }
91 }
92 for (auto const &kv : params) {
93 if (std::ranges::find(keys, kv.first) == keys.end()) {
94 throw std::runtime_error("Parameter '" + kv.first +
95 "' is not recognized");
96 }
97 }
98 }
99
100public:
101 Variant do_call_method(std::string const &name,
102 VariantMap const &params) override {
103 if (name == "set_params") {
104 context()->parallel_try_catch([this, &params]() {
105 check_valid_parameters(params);
107 });
108 // copying the new value to the core may queue a runtime error message,
109 // but we can't detect it to roll back to the last valid state
110 update_core();
111 return {};
112 }
113 if (name == "deactivate") {
114 m_handle = std::make_shared<CoreInteraction>();
115 update_core(get_value_or<bool>(params, "notify", true));
116 return {};
117 }
118 return {};
119 }
120
121 void do_construct(VariantMap const &params) final {
122 if (params.empty()) {
123 m_handle = std::make_shared<CoreInteraction>();
124 } else {
126 inactive_cutoff()) < 1e-9) {
127 m_handle = std::make_shared<CoreInteraction>();
128 } else {
129 context()->parallel_try_catch([this, &params]() {
130 check_valid_parameters(params);
132 });
133 }
134 }
135 }
136
137 void attach(std::weak_ptr<NonBondedInteractionHandle *> si_struct,
138 std::weak_ptr<::IA_parameters> core_struct) {
141 }
142
143 void update_core(bool notify = true);
144};
145
146#ifdef WCA
147class InteractionWCA : public InteractionPotentialInterface<::WCA_Parameters> {
148protected:
150 return &::IA_parameters::wca;
151 }
152
153public:
160
161private:
162 std::string inactive_parameter() const override { return "sigma"; }
163 double inactive_cutoff() const override { return 0.; }
164
165 void make_new_instance(VariantMap const &params) override {
167 params, "epsilon", "sigma");
168 }
169
170public:
171 Variant do_call_method(std::string const &name,
172 VariantMap const &params) override {
173 if (name == "get_cutoff") {
174 return m_handle.get()->cut;
175 }
177 name, params);
178 }
179};
180#endif // WCA
181
182#ifdef LENNARD_JONES
183class InteractionLJ : public InteractionPotentialInterface<::LJ_Parameters> {
184protected:
186 return &::IA_parameters::lj;
187 }
188
189public:
200
201private:
202 void make_new_instance(VariantMap const &params) override {
203 auto new_params = params;
204 auto const *shift_string = boost::get<std::string>(&params.at("shift"));
205 if (shift_string != nullptr) {
206 if (*shift_string != "auto") {
207 throw std::invalid_argument(
208 "LJ parameter 'shift' has to be 'auto' or a float");
209 }
210 new_params["shift"] = 0.;
211 }
213 double, double, double>(
214 new_params, "epsilon", "sigma", "cutoff", "offset", "min", "shift");
215 if (shift_string != nullptr) {
216 m_handle->shift = m_handle->get_auto_shift();
217 }
218 }
219};
220#endif // LENNARD_JONES
221
222#ifdef LENNARD_JONES_GENERIC
224 : public InteractionPotentialInterface<::LJGen_Parameters> {
225protected:
229
230public:
248
249private:
250 void make_new_instance(VariantMap const &params) override {
251 auto new_params = params;
252 auto const *shift_string = boost::get<std::string>(&params.at("shift"));
253 if (shift_string != nullptr) {
254 if (*shift_string != "auto") {
255 throw std::invalid_argument(
256 "Generic LJ parameter 'shift' has to be 'auto' or a float");
257 }
258 new_params["shift"] = 0.;
259 }
261 double, double,
262#ifdef LJGEN_SOFTCORE
263 double, double,
264#endif
265 double, double, double, double>(
266 new_params, "epsilon", "sigma", "cutoff", "shift", "offset",
267#ifdef LJGEN_SOFTCORE
268 "lam", "delta",
269#endif
270 "e1", "e2", "b1", "b2");
271 if (shift_string != nullptr) {
272 m_handle->shift = m_handle->get_auto_shift();
273 }
274 }
275};
276#endif // LENNARD_JONES_GENERIC
277
278#ifdef LJCOS
280 : public InteractionPotentialInterface<::LJcos_Parameters> {
281protected:
285
286public:
295
296private:
297 void make_new_instance(VariantMap const &params) override {
298 m_handle =
300 params, "epsilon", "sigma", "cutoff", "offset");
301 }
302};
303#endif // LJCOS
304
305#ifdef LJCOS2
307 : public InteractionPotentialInterface<::LJcos2_Parameters> {
308protected:
312
313public:
322
323private:
324 std::string inactive_parameter() const override { return "sigma"; }
325 double inactive_cutoff() const override { return 0.; }
326
327 void make_new_instance(VariantMap const &params) override {
328 m_handle =
330 params, "epsilon", "sigma", "offset", "width");
331 }
332
333public:
334 Variant do_call_method(std::string const &name,
335 VariantMap const &params) override {
336 if (name == "get_cutoff") {
337 return m_handle.get()->cut;
338 }
340 name, params);
341 }
342};
343#endif // LJCOS2
344
345#ifdef HERTZIAN
347 : public InteractionPotentialInterface<::Hertzian_Parameters> {
348protected:
352
353public:
360
361private:
362 std::string inactive_parameter() const override { return "sig"; }
363
368};
369#endif // HERTZIAN
370
371#ifdef GAUSSIAN
373 : public InteractionPotentialInterface<::Gaussian_Parameters> {
374protected:
378
379public:
387
388private:
393};
394#endif // GAUSSIAN
395
396#ifdef BMHTF_NACL
398 : public InteractionPotentialInterface<::BMHTF_Parameters> {
399protected:
403
404public:
415
416private:
417 void make_new_instance(VariantMap const &params) override {
419 double, double, double>(
420 params, "a", "b", "c", "d", "sig", "cutoff");
421 }
422};
423#endif // BMHTF_NACL
424
425#ifdef MORSE
427 : public InteractionPotentialInterface<::Morse_Parameters> {
428protected:
432
433public:
442
443private:
444 void make_new_instance(VariantMap const &params) override {
445 m_handle =
447 params, "eps", "alpha", "rmin", "cutoff");
448 }
449};
450#endif // MORSE
451
452#ifdef BUCKINGHAM
454 : public InteractionPotentialInterface<::Buckingham_Parameters> {
455protected:
459
460public:
472
473private:
474 void make_new_instance(VariantMap const &params) override {
476 double, double, double, double>(
477 params, "a", "b", "c", "d", "cutoff", "discont", "shift");
478 }
479};
480#endif // BUCKINGHAM
481
482#ifdef SOFT_SPHERE
484 : public InteractionPotentialInterface<::SoftSphere_Parameters> {
485protected:
489
490public:
499
500private:
501 void make_new_instance(VariantMap const &params) override {
502 m_handle =
504 params, "a", "n", "cutoff", "offset");
505 }
506};
507#endif // SOFT_SPHERE
508
509#ifdef HAT
510class InteractionHat : public InteractionPotentialInterface<::Hat_Parameters> {
511protected:
513 return &::IA_parameters::hat;
514 }
515
516public:
523
524private:
529};
530#endif // HAT
531
532#ifdef GAY_BERNE
534 : public InteractionPotentialInterface<::GayBerne_Parameters> {
535protected:
539
540public:
552
553private:
554 std::string inactive_parameter() const override { return "cut"; }
555
556 void make_new_instance(VariantMap const &params) override {
558 double, double, double, double>(
559 params, "eps", "sig", "cut", "k1", "k2", "mu", "nu");
560 }
561};
562#endif // GAY_BERNE
563
564#ifdef TABULATED
566 : public InteractionPotentialInterface<::TabulatedPotential> {
567protected:
569 return &::IA_parameters::tab;
570 }
571
572public:
581
582private:
583 std::string inactive_parameter() const override { return "max"; }
584
585 void make_new_instance(VariantMap const &params) override {
587 std::vector<double>, std::vector<double>>(
588 params, "min", "max", "force", "energy");
589 }
590
591public:
592 Variant do_call_method(std::string const &name,
593 VariantMap const &params) override {
594 if (name == "get_cutoff") {
595 return m_handle.get()->cutoff();
596 }
598 name, params);
599 }
600};
601#endif // TABULATED
602
603#ifdef DPD
604class InteractionDPD : public InteractionPotentialInterface<::DPD_Parameters> {
605protected:
607 return &::IA_parameters::dpd;
608 }
609
610public:
613 {"weight_function", AutoParameter::read_only,
614 [this]() { return m_handle.get()->radial.wf; }},
615 {"gamma", AutoParameter::read_only,
616 [this]() { return m_handle.get()->radial.gamma; }},
618 [this]() { return m_handle.get()->radial.k; }},
619 {"r_cut", AutoParameter::read_only,
620 [this]() { return m_handle.get()->radial.cutoff; }},
621 {"trans_weight_function", AutoParameter::read_only,
622 [this]() { return m_handle.get()->trans.wf; }},
623 {"trans_gamma", AutoParameter::read_only,
624 [this]() { return m_handle.get()->trans.gamma; }},
625 {"trans_r_cut", AutoParameter::read_only,
626 [this]() { return m_handle.get()->trans.cutoff; }},
627 });
628 std::ignore = get_ptr_offset(); // for code coverage
629 }
630
631private:
632 std::string inactive_parameter() const override { return "r_cut"; }
633
634 void make_new_instance(VariantMap const &params) override {
636 double, double, double, double>(
637 params, "gamma", "k", "r_cut", "weight_function", "trans_gamma",
638 "trans_r_cut", "trans_weight_function");
639 if (m_handle->radial.wf != 0 and m_handle->radial.wf != 1) {
640 throw std::domain_error(
641 "DPDInteraction parameter 'weight_function' must be 0 or 1");
642 }
643 if (m_handle->trans.wf != 0 and m_handle->trans.wf != 1) {
644 throw std::domain_error(
645 "DPDInteraction parameter 'trans_weight_function' must be 0 or 1");
646 }
647 }
648};
649#endif // DPD
650
651#ifdef THOLE
653 : public InteractionPotentialInterface<::Thole_Parameters> {
654protected:
658
659public:
666
667private:
668 std::string inactive_parameter() const override { return "scaling_coeff"; }
669 double inactive_cutoff() const override { return 0.; }
670
671 void make_new_instance(VariantMap const &params) override {
673 params, "scaling_coeff", "q1q2");
674 }
675};
676#endif // THOLE
677
678#ifdef SMOOTH_STEP
680 : public InteractionPotentialInterface<::SmoothStep_Parameters> {
681protected:
685
686public:
697
698private:
699 void make_new_instance(VariantMap const &params) override {
701 double, int, double>(
702 params, "eps", "sig", "cutoff", "d", "n", "k0");
703 }
704};
705#endif // SMOOTH_STEP
706
708 : public AutoParameters<NonBondedInteractionHandle> {
709 std::shared_ptr<::IA_parameters> m_handle;
710 std::shared_ptr<NonBondedInteractionHandle *> m_self;
711 std::weak_ptr<std::function<void()>> m_notify_cutoff_change;
712#ifdef WCA
713 std::shared_ptr<InteractionWCA> m_wca;
714#endif
715#ifdef LENNARD_JONES
716 std::shared_ptr<InteractionLJ> m_lj;
717#endif
718#ifdef LENNARD_JONES_GENERIC
719 std::shared_ptr<InteractionLJGen> m_ljgen;
720#endif
721#ifdef LJCOS
722 std::shared_ptr<InteractionLJcos> m_ljcos;
723#endif
724#ifdef LJCOS2
725 std::shared_ptr<InteractionLJcos2> m_ljcos2;
726#endif
727#ifdef HERTZIAN
728 std::shared_ptr<InteractionHertzian> m_hertzian;
729#endif
730#ifdef GAUSSIAN
731 std::shared_ptr<InteractionGaussian> m_gaussian;
732#endif
733#ifdef BMHTF_NACL
734 std::shared_ptr<InteractionBMHTF> m_bmhtf;
735#endif
736#ifdef MORSE
737 std::shared_ptr<InteractionMorse> m_morse;
738#endif
739#ifdef BUCKINGHAM
740 std::shared_ptr<InteractionBuckingham> m_buckingham;
741#endif
742#ifdef SOFT_SPHERE
743 std::shared_ptr<InteractionSoftSphere> m_soft_sphere;
744#endif
745#ifdef HAT
746 std::shared_ptr<InteractionHat> m_hat;
747#endif
748#ifdef GAY_BERNE
749 std::shared_ptr<InteractionGayBerne> m_gay_berne;
750#endif
751#ifdef TABULATED
752 std::shared_ptr<InteractionTabulated> m_tabulated;
753#endif
754#ifdef DPD
755 std::shared_ptr<InteractionDPD> m_dpd;
756#endif
757#ifdef THOLE
758 std::shared_ptr<InteractionThole> m_thole;
759#endif
760#ifdef SMOOTH_STEP
761 std::shared_ptr<InteractionSmoothStep> m_smooth_step;
762#endif
763
764public:
766 m_self = std::make_shared<NonBondedInteractionHandle *>(this);
767 std::vector<AutoParameter> params;
768 apply([this, &params]<typename T>(std::shared_ptr<T> &member,
769 std::string const &name,
770 std::string const &) {
771 auto const setter = [this, &member](Variant const &v) {
773 member->attach(m_self, m_handle);
774 // copying the new value to the core may queue a runtime error message,
775 // but we can't detect it to roll back to the last valid state
776 member->update_core();
777 };
778 params.emplace_back(name.c_str(), setter, [&member]() { return member; });
779 });
780 add_parameters(std::move(params));
781 }
782
783public:
784 Variant do_call_method(std::string const &name,
785 VariantMap const &params) override {
786 if (name == "reset") {
787 if (not context()->is_head_node()) {
788 return {};
789 }
790 auto const new_params = VariantMap{{"notify", false}};
791 apply([&new_params](auto &so, std::string const &, std::string const &) {
792 so->call_method("deactivate", new_params);
793 });
794 if (get_value_or<bool>(params, "notify", true)) {
795 call_method("on_non_bonded_ia_change", {});
796 }
797 return {};
798 }
799 if (name == "on_non_bonded_ia_change") {
801 return {};
802 }
803 return {};
804 }
805
806 void do_construct(VariantMap const &params) override {
807 m_handle = std::make_shared<::IA_parameters>();
808 if (not context()->is_head_node()) {
809 return;
810 }
811 apply([this, &params]<typename T>(std::shared_ptr<T> &member,
812 std::string const &name,
813 std::string const &so_name) {
814 auto so = (params.contains(name))
816 : std::dynamic_pointer_cast<T>(
817 context()->make_shared(so_name, {}));
819 });
820 }
821
822 void attach(
823 std::function<void(std::shared_ptr<::IA_parameters> const &)> cb_register,
824 std::weak_ptr<std::function<void()>> cb_notify_cutoff_change) {
825 cb_register(m_handle);
826 m_notify_cutoff_change = cb_notify_cutoff_change;
827 }
828
829private:
830 void apply(auto const &&fun) {
831#ifdef WCA
832 fun(m_wca, "wca", "Interactions::InteractionWCA");
833#endif
834#ifdef LENNARD_JONES
835 fun(m_lj, "lennard_jones", "Interactions::InteractionLJ");
836#endif
837#ifdef LENNARD_JONES_GENERIC
838 fun(m_ljgen, "generic_lennard_jones", "Interactions::InteractionLJGen");
839#endif
840#ifdef LJCOS
841 fun(m_ljcos, "lennard_jones_cos", "Interactions::InteractionLJcos");
842#endif
843#ifdef LJCOS2
844 fun(m_ljcos2, "lennard_jones_cos2", "Interactions::InteractionLJcos2");
845#endif
846#ifdef HERTZIAN
847 fun(m_hertzian, "hertzian", "Interactions::InteractionHertzian");
848#endif
849#ifdef GAUSSIAN
850 fun(m_gaussian, "gaussian", "Interactions::InteractionGaussian");
851#endif
852#ifdef BMHTF_NACL
853 fun(m_bmhtf, "bmhtf", "Interactions::InteractionBMHTF");
854#endif
855#ifdef MORSE
856 fun(m_morse, "morse", "Interactions::InteractionMorse");
857#endif
858#ifdef BUCKINGHAM
859 fun(m_buckingham, "buckingham", "Interactions::InteractionBuckingham");
860#endif
861#ifdef SOFT_SPHERE
862 fun(m_soft_sphere, "soft_sphere", "Interactions::InteractionSoftSphere");
863#endif
864#ifdef HAT
865 fun(m_hat, "hat", "Interactions::InteractionHat");
866#endif
867#ifdef GAY_BERNE
868 fun(m_gay_berne, "gay_berne", "Interactions::InteractionGayBerne");
869#endif
870#ifdef TABULATED
871 fun(m_tabulated, "tabulated", "Interactions::InteractionTabulated");
872#endif
873#ifdef DPD
874 fun(m_dpd, "dpd", "Interactions::InteractionDPD");
875#endif
876#ifdef THOLE
877 fun(m_thole, "thole", "Interactions::InteractionThole");
878#endif
879#ifdef SMOOTH_STEP
880 fun(m_smooth_step, "smooth_step", "Interactions::InteractionSmoothStep");
881#endif
882 }
883
884public:
886 if (auto callback = m_notify_cutoff_change.lock()) {
887 (*callback)();
888 }
889 }
890};
891
892template <class CoreIA>
894 assert(m_handle);
895 if (auto core_struct = m_core_struct.lock()) {
896 core_struct.get()->*get_ptr_offset() = *m_handle;
897 if (notify) {
898 if (auto si_struct = m_si_struct.lock()) {
899 (**si_struct).on_non_bonded_ia_change();
900 }
901 }
902 }
903}
904
905} // namespace Interactions
906} // namespace ScriptInterface
Bind parameters in the script interface.
void add_parameters(std::vector< AutoParameter > &&params)
virtual void parallel_try_catch(std::function< void()> const &cb) const =0
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
void make_new_instance(VariantMap const &params) override
Variant do_call_method(std::string const &name, VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
virtual void make_new_instance(VariantMap const &params)=0
Create a new instance using the constructor with range checks.
std::weak_ptr< std::function< void()> > m_notify_non_bonded_ia_change
Callback to notify changes to the interaction range.
virtual CoreInteraction IA_parameters::* get_ptr_offset() const =0
Pointer to the corresponding member in a handle.
std::shared_ptr< CoreInteraction > m_handle
Managed object.
void attach(std::weak_ptr< NonBondedInteractionHandle * > si_struct, std::weak_ptr<::IA_parameters > core_struct)
virtual double inactive_cutoff() const
Which magic value indicates the potential is inactive.
auto make_autoparameter(T CoreInteraction::*ptr, char const *name)
Variant do_call_method(std::string const &name, VariantMap const &params) override
std::weak_ptr<::IA_parameters > m_core_struct
Handle to the container whose members have to be synchronized.
std::weak_ptr< NonBondedInteractionHandle * > m_si_struct
Handle to the interface used to synchronize data members.
virtual std::string inactive_parameter() const
Which parameter indicates whether the potential is inactive.
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
Variant do_call_method(std::string const &name, VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
CoreInteraction IA_parameters::* get_ptr_offset() const override
void make_new_instance(VariantMap const &params) override
CoreInteraction IA_parameters::* get_ptr_offset() const override
Variant do_call_method(std::string const &name, VariantMap const &params) override
void make_new_instance(VariantMap const &params) override
void attach(std::function< void(std::shared_ptr<::IA_parameters > const &)> cb_register, std::weak_ptr< std::function< void()> > cb_notify_cutoff_change)
Variant do_call_method(std::string const &name, VariantMap const &params) override
boost::string_ref name() const
Variant call_method(const std::string &name, const VariantMap &params)
Call a method on the object.
Context * context() const
Responsible context.
void set_parameter(const std::string &name, const Variant &value)
Set single parameter.
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
std::unordered_map< std::string, Variant > VariantMap
Definition Variant.hpp:69
std::shared_ptr< T > make_shared_from_args(VariantMap const &vals, ArgNames &&...args)
Make a new std::shared_ptr<T> with arguments extracted from a 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.
Definition Variant.hpp:67
Various procedures concerning interactions between particles.
constexpr double INACTIVE_CUTOFF
Cutoff for deactivated interactions.
static SteepestDescentParameters params
Currently active steepest descent instance.
Parameters for non-bonded interactions.
Gaussian_Parameters gaussian
GayBerne_Parameters gay_berne
SoftSphere_Parameters soft_sphere
SmoothStep_Parameters smooth_step
Hertzian_Parameters hertzian
Buckingham_Parameters buckingham
Generic Lennard-Jones with shift.
Lennard-Jones with shift.
Lennard-Jones with a different Cos potential.
Lennard-Jones+Cos potential.
Description and getter/setter for a parameter.
static constexpr const ReadOnly read_only
Evaluate forces and energies using a custom potential profile.
std::vector< double > force_tab
Tabulated forces.
double maxval
Position on the x-axis of the last tabulated value.
std::vector< double > energy_tab
Tabulated energies.
double minval
Position on the x-axis of the first tabulated value.