Commit 87a5a35b authored by Michele Ceriotti's avatar Michele Ceriotti
Browse files

A tiny bugfix for the reset flag, and a brief explanation of the changes

parent fd174ce2
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;