58 auto const mass_tot = mass1 + mass2;
59 auto const mass_tot_inv = 1.0 / mass_tot;
60 auto const sqrt_mass_tot = sqrt(mass_tot);
61 auto const sqrt_mass_red = sqrt(mass1 * mass2 / mass_tot);
62 auto const com_vel = mass_tot_inv * (mass1 * vel1 + mass2 * vel2);
63 auto const dist_vel = vel2 - vel1;
64 auto const thermostat_view = m_thermostat.lock();
65 assert(thermostat_view);
66 auto const &thermalized_bond = *thermostat_view->thermalized_bond;
70 auto const noise = Random::noise_uniform<RNGSalt::THERMALIZED_BOND>(
71 thermalized_bond.rng_counter(), thermalized_bond.rng_seed(), id1, id2);
73 for (
unsigned int i = 0u; i < 3u; ++i) {
74 double force_lv_com, force_lv_dist;
92 force1[i] = mass1 * mass_tot_inv * force_lv_com - force_lv_dist;
93 force2[i] = mass2 * mass_tot_inv * force_lv_com + force_lv_dist;
96 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.