diff --git a/doc/src/fix_ipi.txt b/doc/src/fix_ipi.txt index 3899f505293fbdc3e398af1c5fcaee8cf7e023cd..b1533830bcbd31c35eccfda7279825400be64c82 100644 --- a/doc/src/fix_ipi.txt +++ b/doc/src/fix_ipi.txt @@ -10,18 +10,19 @@ fix ipi command :h3 [Syntax:] -fix ID group-ID ipi address port \[unix\] :pre +fix ID group-ID ipi address port \[unix\] \[reset\] :pre ID, group-ID are documented in "fix"_fix.html command ipi = style name of this fix command address = internet address (FQDN or IP), or UNIX socket name port = port number (ignored for UNIX sockets) -optional keyword = {unix}, if present uses a unix socket :ul +optional keyword = {unix}, if present uses a unix socket +optional keyword = {reset}, if present reset electrostatics at each call :ul [Examples:] fix 1 all ipi my.server.com 12345 -fix 1 all ipi mysocket 666 unix +fix 1 all ipi mysocket 666 unix reset [Description:] @@ -57,6 +58,15 @@ input are listed in the same order as in the data file of LAMMPS. The initial configuration is ignored, as it will be substituted with the coordinates received from i-PI before forces are ever evaluated. +A note of caution when using potentials that contain long-range +electrostatics, or that contain parameters that depend on box size: +all of these options will be initialized based on the cell size in the +LAMMPS-side initial configuration and kept constant during the run. +This is required to e.g. obtain reproducible and conserved forces. +If the cell varies too wildly, it may be advisable to reinitialize +these interactions at each call. This behavior can be requested by +setting the {reset} switch. + [Restart, fix_modify, output, run start/stop, minimize info:] There is no restart information associated with this fix, since all diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp index 20b3c90f8ae1258595dfd368ae5ecd142ea6263e..67c9cc8ee255e6ddefacdd0c2e00c4b369eb9e18 100644 --- a/src/USER-MISC/fix_ipi.cpp +++ b/src/USER-MISC/fix_ipi.cpp @@ -195,7 +195,7 @@ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : inet = ((narg > 5) && (strcmp(arg[5],"unix") == 0) ) ? 0 : 1; master = (comm->me==0) ? 1 : 0; // check if forces should be reinitialized and set flag - reset_flag = ((narg > 6) || (strcmp(arg[5],"reset") == 0) ) ? 1 : 0; + reset_flag = ((narg > 6 && (strcmp(arg[5],"reset") == 0 )) || ((narg > 5) && (strcmp(arg[5],"reset") == 0)) ) ? 1 : 0; hasdata = bsize = 0;