Hi,

*I want to calculate a magnitude that includes Fij and Vi, (where Fij is a given two boddy force between two atoms i,j and Vi the velocity of one of these atoms) in the code itself (pair potential file). It seems that the velocities I get within the pair force calculation routine (compute()) are calculated at time steps that are shifted compared to the time steps where the forces are actually calculated. It seems there is a dt/2 time shifting (dt=time steps) between the two calculations.*

*e.g :*

*F calculated at 0, dt, 2dt, 3dt,…*

*V calculated at dt/2, 3/2dt, 5/2dt…*

*I think lammps uses a velocity verlet integrator, not a leapfrog one and I am confused :*

*I would like to know if it is actually the case and if so, how can I get the forces and the velocities calculated exactly at the same time steps (no extrapolation) through the compute routine ?*

*Thanks a lot for you time,*

*y/*

Hi,

I want to calculate a magnitude that includes Fij and Vi, (where Fij is a

given two boddy force between two atoms i,j and Vi the velocity of one of

these atoms) in the code itself (pair potential file). It seems that the

velocities I get within the pair force calculation routine (compute()) are

calculated at time steps that are shifted compared to the time steps where

the forces are actually calculated. It seems there is a dt/2 time shifting

(dt=time steps) between the two calculations.

e.g :

F calculated at 0, dt, 2dt, 3dt,...

V calculated at dt/2, 3/2dt, 5/2dt...

I think lammps uses a velocity verlet integrator, not a leapfrog one and I

am confused :

in the velocity verlet you update the velocities _twice_

propagate velocities by 1/2 a time step.

propagate positions by a full time step

using the updated velocities.

compute forces

propagate velocities by 1/2 a time step.

repeat.

so at the beginning and end of the cycle,

you have position, forces and velocities in sync.

cheers,

axel.

An additional point is that if you print out this info

in a dump file or with thermo output, then the

compute that calclulates it (that you are writing?)

will be invoked at the end of the timestep, so

F and V will be in sync, as Axel states.

Steve