int moldyn_shutdown(t_moldyn *moldyn) {
+ moldyn_log_shutdown(moldyn);
link_cell_shutdown(moldyn);
moldyn_log_shutdown(moldyn);
rand_close(&(moldyn->random));
return p_total;
}
-double estimate_time_step(t_moldyn *moldyn,double nn_dist,double t) {
+double estimate_time_step(t_moldyn *moldyn,double nn_dist) {
double tau;
- tau=0.05*nn_dist/(sqrt(3.0*K_BOLTZMANN*t/moldyn->atom[0].mass));
- tau*=1.0E-9;
- if(tau<moldyn->tau)
- printf("[moldyn] warning: time step (%f > %.15f)\n",
- moldyn->tau,tau);
+ /* nn_dist is the nearest neighbour distance */
+
+ if(moldyn->t==5.0) {
+ printf("[moldyn] i do not estimate timesteps below %f K!\n",
+ MOLDYN_CRITICAL_EST_TEMP);
+ return 23.42;
+ }
+
+ tau=(0.05*nn_dist*moldyn->atom[0].mass)/sqrt(3.0*K_BOLTZMANN*moldyn->t);
return tau;
}
/* reset energy */
moldyn->energy=0.0;
+printf("DEBUG: count = %d\n",count);
for(i=0;i<count;i++) {
/* reset force */
/* 2 body pair potential/force */
if(atom[i].attr&(ATOM_ATTR_2BP|ATOM_ATTR_3BP)) {
-
+
+printf("DEBUG: processing atom %d\n",i);
link_cell_neighbour_index(moldyn,
(atom[i].r.x+moldyn->dim.x/2)/lc->x,
(atom[i].r.y+moldyn->dim.y/2)/lc->y,
countn=lc->countn;
dnlc=lc->dnlc;
+printf("DEBUG: countn = %d - dnslc = %d\n",countn,dnlc);
for(j=0;j<countn;j++) {
this=&(neighbour[j]);
if((btom->attr&ATOM_ATTR_2BP)&
(atom[i].attr&ATOM_ATTR_2BP))
+printf("DEBUG: calling func2b\n");
moldyn->func2b(moldyn,
&(atom[i]),
btom,