count=moldyn->count;
/* how many atoms do we expect */
+ if(type==NONE) {
+ new*=1;
+ printf("[moldyn] WARNING: create 'none' lattice called");
+ }
if(type==CUBIC) new*=1;
if(type==FCC) new*=4;
if(type==DIAMOND) new*=8;
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->timestep/moldyn->t_tc;
scale=sqrt(scale);
/* velocity scaling */
/* scaling factor */
if(moldyn->pt_scale&P_SCALE_BERENDSEN) {
- scale=1.0-(moldyn->p_ref-moldyn->p)*moldyn->p_tc;
- scale=pow(scale,ONE_THIRD);
+ scale=(moldyn->p_ref-moldyn->p)*moldyn->p_tc*moldyn->timestep;
+ scale=pow(1.0-scale,ONE_THIRD);
}
else {
scale=pow(moldyn->p/moldyn->p_ref,ONE_THIRD);
printf("[moldyn] WARNING: cutoff > 0.5 x dim.y\n");
if(moldyn->cutoff>0.5*moldyn->dim.z)
printf("[moldyn] WARNING: cutoff > 0.5 x dim.z\n");
- ds=0.5*atom[0].f.x*moldyn->tau_square/atom[0].mass;
- if(ds>0.05*moldyn->nnd)
+ if(moldyn->count) {
+ ds=0.5*atom[0].f.x*moldyn->tau_square/atom[0].mass;
+ if(ds>0.05*moldyn->nnd)
printf("[moldyn] WARNING: forces too high / tau too small!\n");
+ }
/* zero absolute time */
// should have right values!
/* 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);
}