Writing a fix to apply an active force
The following is a list of changes that should be made to the source code:
- The new files that should be created are
fix_activeforce.cpp
andfix_activeforce.h
. - The existing files that are modified are
fix_addforce.cpp
,fix_addforce.h
, andcompute_bond_local.cpp
. - The methods that are modified are constructor,
post_force()
. - The input parameters are
fMagnitude
, anddirection
. - The other quantities introduced in this section can be seen in a full list in Figure 10.9 under
post_force()
. - The LAMMPS syntax is
fix FIX_NAME GROUP activeforce FMAGNITUDE DIRECTION
(we'll review the syntax in this section).
In this section, we will create an active force in Fix Activeforce
that applies a specified magnitude of force along the direction defined by two bonded atoms.
Theory (active force on bonded atoms)
An active force is generated by an atom and acts on the same atom. In this example, the active force acts on an...