diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 7fb556639e..48f7a3c9ea 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -197,3 +197,14 @@ void FixLangevin::reset_target(double t_new) { t_start = t_stop = t_new; } + +/* ---------------------------------------------------------------------- */ + +void FixLangevin::reset_dt() +{ + for (int i = 1; i <= atom->ntypes; i++) { + gfactor2[i] = sqrt(atom->mass[i]) * + sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) / force->ftm2v; + gfactor2[i] *= 1.0/sqrt(ratio[i]); + } +} diff --git a/src/fix_langevin.h b/src/fix_langevin.h index 9b614e8823..8a8a89aeb8 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -28,6 +28,7 @@ class FixLangevin : public Fix { void post_force(int); void post_force_respa(int, int, int); void reset_target(double); + void reset_dt(); private: double t_start,t_stop,t_period;