50 auto const mass_tot = p1.
mass() + p2.
mass();
51 auto const mass_tot_inv = 1.0 / mass_tot;
52 auto const sqrt_mass_tot = sqrt(mass_tot);
53 auto const sqrt_mass_red = sqrt(p1.
mass() * p2.
mass() / mass_tot);
54 auto const com_vel = mass_tot_inv * (p1.
mass() * p1.
v() + p2.
mass() * p2.
v());
55 auto const dist_vel = p2.
v() - p1.
v();
56 auto const thermostat_view = m_thermostat.lock();
57 assert(thermostat_view);
58 auto const &thermalized_bond = *thermostat_view->thermalized_bond;
62 auto const noise = Random::noise_uniform<RNGSalt::THERMALIZED_BOND>(
63 thermalized_bond.rng_counter(), thermalized_bond.rng_seed(), p1.
id(),
66 for (
unsigned int i = 0u; i < 3u; ++i) {
67 double force_lv_com, force_lv_dist;
85 force1[i] = p1.
mass() * mass_tot_inv * force_lv_com - force_lv_dist;
86 force2[i] = p2.
mass() * mass_tot_inv * force_lv_com + force_lv_dist;
89 return std::make_tuple(force1, force2);
Struct holding all information for one particle.
auto const & mass() const
std::optional< std::tuple< Utils::Vector3d, Utils::Vector3d > > forces(Particle const &p1, Particle const &p2, Utils::Vector3d const &dx) const
Separately thermalizes the com and distance of a particle pair.