33#include "system/Leaf.hpp"
43#include <unordered_map>
47#ifdef ESPRESSO_PARTICLE_ANISOTROPY
57#ifdef ESPRESSO_PARTICLE_ANISOTROPY
65#ifdef ESPRESSO_PARTICLE_ANISOTROPY
71#ifdef ESPRESSO_THERMOSTAT_PER_PARTICLE
80#ifdef ESPRESSO_PARTICLE_ANISOTROPY
116 m_initialized =
true;
134 bool m_initialized{
false};
149#ifdef ESPRESSO_ROTATION
167#ifdef ESPRESSO_ROTATION
182#ifdef ESPRESSO_ROTATION
213#ifdef ESPRESSO_ROTATION
255#ifdef ESPRESSO_ROTATION
267#ifdef ESPRESSO_ROTATION
287 std::vector<double>
const &mass_list,
291 for (
const auto &mass : mass_list) {
304 static double sigma(
double kT,
double gamma,
double time_step) {
308 return sqrt(
temp_coeff * kT * gamma * time_step);
314 static double sigma_OU(
double kT,
double gamma,
double time_step) {
315 return std::sqrt(kT * (1.0 - std::exp(-2. * gamma * time_step)));
372#ifdef ESPRESSO_STOKESIAN_DYNAMICS
389 std::shared_ptr<IsotropicNptThermostat>
npt_iso;
391 std::shared_ptr<LBThermostat>
lb;
393 std::shared_ptr<DPDThermostat>
dpd;
395#ifdef ESPRESSO_STOKESIAN_DYNAMICS
401 void philox_counter_increment();
404 void recalc_prefactors(
double time_step);
408 lb->couple_to_md =
true;
411 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
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Matrix implementation and trait types for boost qvm interoperability.
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.
std::unordered_map< double, double > pref_noise_0
Particle velocity rescaling noise standard deviation for Orstein-Uhlenbeck equation.
static double sigma_OU(double kT, double gamma, double time_step)
Calculate the noise prefactor for the exact solution of Orstein-Uhlenbeck equation.
double pref_rescale_V
Volume rescaling at half the time step.
void recalc_prefactors(double kT, double piston, std::vector< double > const &mass_list, double time_step)
Recalculate prefactors.
double gamma0
Friction coefficient of the particles .
double gammav
Friction coefficient for the box .
double pref_noise_V
Volume rescaling noise standard deviation for Orstein-Uhlenbeck equation Stores .
std::unordered_map< double, double > pref_rescale_0
Particle velocity rescaling at the time step for Orstein-Uhlenbeck equation.
static double sigma(double kT, double gamma, double time_step)
Calculate the noise prefactor.
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.