26#include "system/System.hpp"
28#include "thermostat.hpp"
30#include <boost/variant.hpp>
38 template <
typename T>
double operator()(T
const &bond)
const {
44 auto const max_cut_bonded = std::accumulate(
46 return std::max(max_cut,
47 boost::apply_visitor(
BondCutoff(), *kv.second));
51 auto const any_dihedrals = std::any_of(
begin(),
end(), [](
auto const &kv) {
52 return (boost::get<DihedralBond>(&(*kv.second)) ||
53 boost::get<TabulatedDihedralBond>(&(*kv.second)));
58 return (any_dihedrals) ? 2 * max_cut_bonded : max_cut_bonded;
62 n_thermalized_bonds = 0;
66 for (
auto &kv : *
this) {
67 if (boost::get<ThermalizedBond>(&(*kv.second)) !=
nullptr) {
68 ++n_thermalized_bonds;
71 if (boost::get<RigidBond>(&(*kv.second)) !=
nullptr) {
77 system->on_short_range_ia_change();
78 system->on_thermostat_param_change();
84 if (
auto bond = boost::get<ThermalizedBond>(ptr.get())) {
85 bond->set_thermostat_view(system.thermostat);
87 if (
auto bond = boost::get<IBMVolCons>(ptr.get())) {
88 system.immersed_boundaries->register_softID(*bond);
90 if (
auto bond = boost::get<IBMTriel>(ptr.get())) {
91 bond->initialize(*system.box_geo, *system.cell_structure);
93 if (
auto bond = boost::get<IBMTribend>(ptr.get())) {
94 bond->initialize(*system.box_geo, *system.cell_structure);
99 if (
auto bond = boost::get<ThermalizedBond>(ptr.get())) {
100 bond->unset_thermostat_view();
102 if (
auto bond = boost::get<IBMVolCons>(ptr.get())) {
103 bond->unset_volumes_view();
Data structures for bonded interactions.
static constexpr double BONDED_INACTIVE_CUTOFF
Visitor to get the bond cutoff from the bond parameter variant.
double operator()(T const &bond) const
virtual void activate_bond(mapped_type const &ptr)
virtual void deactivate_bond(mapped_type const &ptr)
double maximal_cutoff() const
Calculate the maximal cutoff of bonded interactions, required to determine the cell size for communic...
typename container_type::mapped_type mapped_type
std::weak_ptr< System > m_system
Definition of the rigid bond data type for the Rattle algorithm.
Routines to thermalize the center of mass and distance of a particle pair.