added set_temp and set_timestep stages
[physik/posic.git] / moldyn.c
index eb3c4b0..d56d6f3 100644 (file)
--- a/moldyn.c
+++ b/moldyn.c
@@ -872,7 +872,7 @@ int scale_velocity(t_moldyn *moldyn,u8 equi_init) {
                scale*=2.0;
        else
                if(moldyn->pt_scale&T_SCALE_BERENDSEN)
-                       scale=1.0+(scale-1.0)/moldyn->t_tc;
+                       scale=1.0+(scale-1.0)*moldyn->tau/moldyn->t_tc;
        scale=sqrt(scale);
 
        /* velocity scaling */
@@ -1182,7 +1182,7 @@ int scale_volume(t_moldyn *moldyn) {
 
        /* scaling factor */
        if(moldyn->pt_scale&P_SCALE_BERENDSEN) {
-               scale=1.0-(moldyn->p_ref-moldyn->p)*moldyn->p_tc;
+               scale=1.0-(moldyn->p_ref-moldyn->p)*moldyn->p_tc*moldyn->tau;
                scale=pow(scale,ONE_THIRD);
        }
        else {
@@ -2125,7 +2125,7 @@ int potential_force_calc(t_moldyn *moldyn) {
 
                /* check forces regarding the given timestep */
                if(v3_norm(&(itom[i].f))>\
-                  0.1*moldyn->nnd*itom[i].mass/moldyn->tau_square)
+                   0.1*moldyn->nnd*itom[i].mass/moldyn->tau_square)
                        printf("[moldyn] WARNING: pfc (high force: atom %d)\n",
                               i);
        }