127 |
|
void Verlet::integrate( void ){ |
128 |
|
|
129 |
|
int i, j; /* loop counters */ |
130 |
< |
|
130 |
> |
int calcPot; |
131 |
> |
|
132 |
|
double kE; |
133 |
|
|
134 |
|
double *Rx = new double[c_natoms]; |
164 |
|
// the first time integrate is called, the forces need to be initialized |
165 |
|
|
166 |
|
|
167 |
< |
myFF->doForces(); |
167 |
> |
myFF->doForces(1); |
168 |
|
|
169 |
|
if( entry_plug->setTemp ){ |
170 |
|
tStats->velocitize(); |
171 |
|
} |
172 |
|
|
173 |
|
dump_out->writeDump( 0.0 ); |
174 |
+ |
|
175 |
|
e_out->writeStat( 0.0 ); |
176 |
|
|
177 |
+ |
calcPot = 0; |
178 |
+ |
|
179 |
|
if( c_is_constrained ){ |
180 |
|
for(i = 0; i < n_loops; i++){ |
181 |
|
|
216 |
|
|
217 |
|
// calculate the forces |
218 |
|
|
219 |
< |
myFF->doForces(); |
219 |
> |
myFF->doForces(calcPot); |
220 |
|
|
221 |
|
// finish the constrain move ( same as above. ) |
222 |
|
|
258 |
|
if( !(time % vel_n) ) tStats->velocitize(); |
259 |
|
} |
260 |
|
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
261 |
< |
if( !(time % status_n) ) e_out->writeStat( time * dt ); |
261 |
> |
if( !((time+1) % status_n) ) calcPot = 1; |
262 |
> |
if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; } |
263 |
|
} |
264 |
|
} |
265 |
|
else{ |
269 |
|
|
270 |
|
// calculate the forces |
271 |
|
|
272 |
< |
myFF->doForces(); |
272 |
> |
myFF->doForces(calcPot); |
273 |
|
|
274 |
|
// complete the verlet move |
275 |
|
|
280 |
|
if( entry_plug->setTemp ){ |
281 |
|
if( !(time % vel_n) ) tStats->velocitize(); |
282 |
|
} |
283 |
< |
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
284 |
< |
if( !(time % status_n) ) e_out->writeStat( time * dt ); |
283 |
> |
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
284 |
> |
if( !((time+1) % status_n) ) calcPot = 1; |
285 |
> |
if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; } |
286 |
|
} |
287 |
|
} |
288 |
|
|