diff --git a/doc/Section_commands.html b/doc/Section_commands.html index c4c098ae64..a5fa3a0c1d 100644 --- a/doc/Section_commands.html +++ b/doc/Section_commands.html @@ -325,14 +325,14 @@ of each style or click on the style itself for a full description:
These are fix styles contributed by users, which can be used if diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index 377ec3d5d6..88e8806177 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -401,6 +401,7 @@ of each style or click on the style itself for a full description: "efield"_fix_efield.html, "enforce2d"_fix_enforce2d.html, "evaporate"_fix_evaporate.html, +"external"_fix_external.html, "freeze"_fix_freeze.html, "gravity"_fix_gravity.html, "heat"_fix_heat.html, diff --git a/doc/fix.html b/doc/fix.html index fc6e8828cc..b205d42b75 100644 --- a/doc/fix.html +++ b/doc/fix.html @@ -178,6 +178,7 @@ list of fix styles available in LAMMPS:
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 +
+ diff --git a/doc/fix_external.txt b/doc/fix_external.txt new file mode 100644 index 0000000000..392b0b3431 --- /dev/null +++ b/doc/fix_external.txt @@ -0,0 +1,71 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Section_commands.html#comm) + +:line + +fix external command :h3 + +[Syntax:] + +fix ID group-ID external :pre + +ID, group-ID are documented in "fix"_fix.html command +external = style name of this fix command :ul + +[Examples:] + +fix 1 all external :pre + +[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"_run.html command. + +The callback function "foo" will be invoked every timestep as: + +foo(ptr,timestep,nlocal,ids,x,fexternal); :pre + +which has this prototype: + +void foo(void *, int, int, int *, double **, double **); + +The arguments are as follows: + +ptr = pointer provided by and simply passed back to external driver +timestep = current LAMMPS timestep +nlocal = # of atoms on this processor +ids = list of atom IDs on this processor +x = coordinates of atoms on this processor +fexternal = forces on atoms on this processor :ul + +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"_quest. + +:link(quest,http://dft.sandia.gov/Quest) + +[Restart, fix_modify, output, run start/stop, minimize info:] + +No information about this fix is written to "binary restart +files"_restart.html. None of the "fix_modify"_fix_modify.html options +are relevant to this fix. No global or per-atom quantities are stored +by this fix for access by various "output +commands"_Section_howto.html#4_15. No parameter of this fix can be +used with the {start/stop} keywords of the "run"_run.html command. +This fix is not invoked during "energy minimization"_minimize.html. + +[Restrictions:] none + +[Related commands:] none + +[Default:] none