Reviewing the Fix AddForce class
In this section, we will study the methods implemented in the Fix AddForce
class, which applies a pre-defined force to a group of atoms.
This fix adds a force defined by its (x, y, z) components to every atom in a group using fix_addforce.cpp
and fix_addforce.h
. In a LAMMPS input script, the corresponding syntax is as follows:
fix FIX_ID GROUP_ID addforce Fx Fy Fz
As you can see, the FIX_ID
parameter is the unique ID of the fix defined, while the GROUP_ID
parameter is the ID of the group of atoms that the fix acts on, as described in the LAMMPS manual (https://lammps.sandia.gov/doc/fix_addforce.html). The Fx
, Fy
, and Fz
quantities represent the three force components applied to each atom. Optional keywords can be entered to specify the frequency of applying this force, the region where the atoms must reside, and the energy calculation associated with the force. First, we will look at the constructor method of...