22#include "system/System.hpp"
24#include <boost/serialization/access.hpp>
29#include <unordered_map>
56 template <
typename Archive>
65using Queue = std::vector<QueueEntry>;
81 int bond_type,
double distance) {
82 if (not breakage_specs.contains(bond_type)) {
87 auto const &spec = *(breakage_specs.at(bond_type));
90 if (distance >= spec.breakage_length) {
91 queue_breakage(particle_id, bond_partners, bond_type);
102 if (not breakage_specs.empty()) {
103 process_queue_impl(system);
111 void queue_breakage(
int particle_id,
BondPartners const &bond_partners,
std::unordered_map< int, std::shared_ptr< BreakageSpec > > breakage_specs
Bond breakage specifications.
void process_queue(System::System &system)
bool check_and_handle_breakage(int particle_id, BondPartners const &bond_partners, int bond_type, double distance)
Check if the bond between the particles should break, if yes, queue it.
@ REVERT_BIND_AT_POINT_OF_COLLISION
std::array< std::optional< int >, 2 > BondPartners
Stores one or two bond parnters for pair/angle bonds.
std::vector< QueueEntry > Queue
Record bonds broken during a time step.
void serialize(Archive &ar, unsigned int const)
friend class boost::serialization::access
BondPartners bond_partners