31#include "system/Leaf.hpp"
43#ifdef PARTICLE_ANISOTROPY
53#ifdef PARTICLE_ANISOTROPY
61#ifdef PARTICLE_ANISOTROPY
67#ifdef THERMOSTAT_PER_PARTICLE
70 return particle_gamma >=
gamma_null ? particle_gamma : default_gamma;
76#ifdef PARTICLE_ANISOTROPY
77 auto const aniso_flag =
78 (gamma_body[0] != gamma_body[1]) || (gamma_body[1] != gamma_body[2]);
80 boost::qvm::diag_mat(gamma_body);
81 auto const gamma_space =
91 constexpr auto relative_tolerance = 1e-6;
92 if (old_kT == 0. and new_kT == 0.) {
95 if ((old_kT < 0. and new_kT >= 0.) or (old_kT >= 0. and new_kT < 0.)) {
98 auto const large_kT = (old_kT > new_kT) ? old_kT : new_kT;
99 auto const small_kT = (old_kT > new_kT) ? new_kT : old_kT;
100 return (large_kT / small_kT - 1. < relative_tolerance);
109 m_initialized =
true;
126 uint32_t m_rng_seed{0u};
127 bool m_initialized{
false};
153 constexpr auto const temp_coeff = 2.0 * 12.0;
154 return sqrt((temp_coeff * kT / time_step) *
gamma);
221 constexpr auto const temp_coeff = 2.0;
230 constexpr auto const temp_coeff = 1.0;
231 return sqrt(temp_coeff * kT);
280 assert(piston > 0.0);
281 auto const half_time_step = time_step / 2.0;
292 static double sigma(
double kT,
double gamma,
double time_step) {
295 constexpr auto const temp_coeff = 12.0;
296 return sqrt(temp_coeff * kT * gamma * time_step);
350#ifdef STOKESIAN_DYNAMICS
367 std::shared_ptr<IsotropicNptThermostat>
npt_iso;
369 std::shared_ptr<LBThermostat>
lb;
371 std::shared_ptr<DPDThermostat>
dpd;
373#ifdef STOKESIAN_DYNAMICS
379 void philox_counter_increment();
382 void recalc_prefactors(
double time_step);
386 lb->couple_to_md =
true;
389 void lb_coupling_deactivate();
Vector implementation and trait types for boost qvm interoperability.
container for bonded interactions.
Abstract class that represents a component of the system.
std::shared_ptr< BrownianThermostat > brownian
void lb_coupling_activate()
std::shared_ptr< ThermalizedBondThermostat > thermalized_bond
std::shared_ptr< LangevinThermostat > langevin
std::shared_ptr< DPDThermostat > dpd
std::shared_ptr< LBThermostat > lb
std::shared_ptr< IsotropicNptThermostat > npt_iso
std::shared_ptr< StokesianThermostat > stokesian
This file contains the defaults for ESPResSo.
bool are_kT_equal(double old_kT, double new_kT)
Check that two kT values are close up to a small tolerance.
Utils::Vector3d GammaType
constexpr GammaType gamma_sentinel
Value for unset friction coefficient.
constexpr GammaType gamma_null
Value for a null friction coefficient.
auto handle_particle_anisotropy(Particle const &p, GammaType const &gamma_body)
auto const & handle_particle_gamma(GammaType const &particle_gamma, GammaType const &default_gamma)
auto hadamard_division(Vector< T, N > const &a, Vector< U, N > const &b)
This file contains all subroutines required to process rotational motion.
auto convert_body_to_space(const Utils::Quaternion< double > &quat, const Utils::Matrix< T, 3, 3 > &A)
Transform matrix from body- to space-fixed frame.
uint64_t rng_counter() const
Get current value of the RNG.
uint32_t rng_seed() const
void rng_increment()
Increment the RNG counter.
bool is_seed_required() const
Is the RNG seed required.
void rng_initialize(uint32_t const seed)
Initialize or re-initialize the RNG counter with a seed.
void set_rng_counter(uint64_t value)
Thermostat for Brownian dynamics.
GammaType gamma
Translational friction coefficient .
GammaType gamma_rotation
Rotational friction coefficient .
void recalc_prefactors(double kT)
Recalculate prefactors.
GammaType sigma_pos
Translational noise standard deviation.
double sigma_vel_rotation
Angular velocity noise standard deviation.
double sigma_vel
Translational velocity noise standard deviation.
GammaType sigma_pos_rotation
Rotational noise standard deviation.
static GammaType sigma(double kT, GammaType const &gamma)
Calculate the noise prefactor.
static double sigma(double kT)
Calculate the noise prefactor.
Thermostat for dissipative particle dynamics.
Thermostat for isotropic NPT dynamics.
double pref_rescale_V
Volume rescaling at half the time step.
double pref_rescale_0
Particle velocity rescaling at half the time step.
double gamma0
Friction coefficient of the particles .
double pref_noise_0
Particle velocity rescaling noise standard deviation.
double gammav
Friction coefficient for the box .
double pref_noise_V
Volume rescaling noise standard deviation.
static double sigma(double kT, double gamma, double time_step)
Calculate the noise prefactor.
void recalc_prefactors(double kT, double piston, double time_step)
Recalculate prefactors.
Thermostat for lattice-Boltzmann particle coupling.
bool couple_to_md
Internal flag to disable particle coupling during force recalculation.
double gamma
Friction coefficient.
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 .
void recalc_prefactors(double kT, double time_step)
Recalculate prefactors.
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.
Thermostat for Stokesian dynamics.
Thermostat for thermalized bonds.
void recalc_prefactors(double time_step, BondedInteractionsMap &bonded_ias)
Matrix representation with static size.