Studying the Fix NVE class
In this section, we will study the Fix NVE
class, which time-integrates a system using the velocity Verlet algorithm we described in Chapter 1, MD Theory and Simulation Practices.
The first half of the algorithm updates the velocity over a half-timestep and the position over a full-timestep. How the velocity and position components are updated is shown in the following equations.
The velocity update for the x component is given as follows:
The position update for the x coordinate is given as follows:
The y and z coordinates are updated similarly. The second half of the algorithm updates the three components of the velocity over the second half of the timestep.
We get the x component as follows:
The y and z components are updated in a similar fashion.
The source code for this class is provided in the fix_nve.cpp
and fix_nve.h
files. In a LAMMPS input script, the corresponding syntax is as follows:
fix FIX_ID...