29#include "thermostat.hpp"
42 double time_step,
double kT) {
45#ifdef ESPRESSO_THERMOSTAT_PER_PARTICLE
47 auto const pref_friction = -gamma;
56#ifdef ESPRESSO_PARTICLE_ANISOTROPY
57 auto const aniso_flag = (pref_friction[0] != pref_friction[1]) ||
58 (pref_friction[1] != pref_friction[2]);
62 auto const O = rotation_matrix(p.
quat());
63 auto const Ot = O.transposed();
64 auto const v_body = Ot * p.
v();
65 auto const noise_body = Ot * noise;
66 return O * (hadamard_product(pref_friction, v_body) +
67 hadamard_product(pref_noise, noise_body));
70 return hadamard_product(pref_friction, p.
v()) +
71 hadamard_product(pref_noise, noise);
74#ifdef ESPRESSO_ROTATION
87#ifdef ESPRESSO_THERMOSTAT_PER_PARTICLE
90 auto const pref_friction = gamma;
99 return -hadamard_product(pref_friction, p.
omega()) +
100 hadamard_product(pref_noise, noise);
Vector implementation and trait types for boost qvm interoperability.
Utils::Vector3d friction_thermo_langevin(LangevinThermostat const &langevin, Particle const &p, double time_step, double kT)
Langevin thermostat for particle translational velocities.
Utils::Vector3d friction_thermo_langevin_rotation(LangevinThermostat const &langevin, Particle const &p, double time_step, double kT)
Langevin thermostat for particle angular velocities.
Matrix implementation and trait types for boost qvm interoperability.
DEVICE_QUALIFIER auto noise_uniform(uint64_t counter, uint32_t seed, int key1, int key2=0)
Generator for random uniform noise.
auto const & handle_particle_gamma(GammaType const &particle_gamma, GammaType const &default_gamma)
Random number generation using Philox.
This file contains all subroutines required to process rotational motion.
uint64_t rng_counter() const
Get current value of the RNG.
uint32_t rng_seed() const
Thermostat for Langevin dynamics.
GammaType pref_friction
Prefactor for the friction.
static GammaType sigma(double kT, double time_step, GammaType const &gamma)
Calculate the noise prefactor.
GammaType gamma_rotation
Rotational friction coefficient .
GammaType gamma
Translational friction coefficient .
GammaType pref_noise
Prefactor for the translational velocity noise.
GammaType pref_noise_rotation
Prefactor for the angular velocity noise.
Struct holding all information for one particle.
constexpr auto const & quat() const
constexpr auto const & omega() const
constexpr auto const & gamma() const
constexpr auto const & gamma_rot() const
constexpr auto const & id() const
constexpr auto const & v() const