LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

fix external command

Syntax:

fix ID group-ID external 

Examples:

fix 1 all external 

Description:

This fix makes a callback each timestep to an external driver program that is using LAMMPS as a library. This is a way to let another program compute forces on atoms which LAMMPS will include in its dynamics performed by the run command.

The callback function "foo" will be invoked every timestep as:

foo(ptr,timestep,nlocal,ids,x,fexternal); 

which has this prototype:

void foo(void *, int, int, int *, double **, double **);

The arguments are as follows:

Fexternal are the forces returned by the driver program, which LAMMPS adds to the current force on each atom.

See the couple/lammps_quest/lmpqst.cpp file in the LAMMPS distribution for an example of a coupling application that uses this fix, and how it makes a call to the fix to specify what function the fix should callback to. The sample application performs classical MD using quantum forces computed by a density functional code Quest.

Restart, fix_modify, output, run start/stop, minimize info:

No information about this fix is written to binary restart files. None of the fix_modify options are relevant to this fix. No global or per-atom quantities are stored by this fix for access by various output commands. No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy minimization.

Restrictions: none

Related commands: none

Default: none