Commit bc62002b authored by Steve Plimpton's avatar Steve Plimpton
Browse files

units and doc changes

parent 94457423
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -44,10 +44,11 @@ running {ab initio} MD with quantum forces.

The group associated with this fix is ignored.

The protocol for message format and content that LAMMPS exchanges with
the server code is defined on the "server md"_server_md.html doc page.
The protocol and "units"_units.html for message format and content
that LAMMPS exchanges with the server code is defined on the "server
md"_server_md.html doc page.

Note that when using LAMMPS in this mode, your LAMMPS input script
Note that when using LAMMPS as an MD client, your LAMMPS input script
should not normally contain force field commands, like a
"pair_style"_doc/pair_style.html, "bond_style"_doc/bond_style.html, or
"kspace_style"_kspace_style.html commmand.  However it is possible for
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ signals when it is done sending messages to LAMMPS, at which point the
loop will exit, and the remainder of the LAMMPS script will be
processed.

The "server"_server.html doc page gives other options for using LAMMPS
See an example of how this command is used in
examples/COUPLE/lammps_mc/in.server.

+34 −9
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ signals when it is done sending messages to LAMMPS, at which point the
loop will exit, and the remainder of the LAMMPS script will be
processed.

See an example of how this command is used in
The "server"_server.html doc page gives other options for using LAMMPS
in server mode.  See an example of how this command is used in
examples/message/in.message.server.

:line
@@ -45,13 +46,13 @@ examples/message/in.message.server.
When using this command, LAMMPS (as the server code) receives the
current coordinates of all particles from the client code each
timestep, computes their interaction, and returns the energy, forces,
and virial for the interacting particles to the client code, so it can
complete the timestep.  This command could also be used with a client
code that performs energy minimization, using the server to compute
forces and energy each iteration of its minimizer.
and pressure for the interacting particles to the client code, so it
can complete the timestep.  This command could also be used with a
client code that performs energy minimization, using the server to
compute forces and energy each iteration of its minimizer.

When using the "fix client/md" command, LAMMPS (as the client code)
does the timestepping and receives needed energy, forces, and virial
does the timestepping and receives needed energy, forces, and pressure
values from the server code.

The format and content of the exchanged messages are explained here in
@@ -70,7 +71,7 @@ The following pseudo-code uses these values, defined as enums.

enum{SETUP=1,STEP};
enum{DIM=1,PERIODICITY,ORIGIN,BOX,NATOMS,NTYPES,TYPES,COORDS,UNITS,CHARGE};
enum{FORCES=1,ENERGY,VIRIAL,ERROR}; :pre
enum{FORCES=1,ENERGY,PRESSURE,ERROR}; :pre

[Client sends 2 kinds of messages]:

@@ -101,11 +102,35 @@ cs->pack(BOX,9,box) # 3 edge vectors of simulation box

[Server replies to either kind of message]:

# required fields: FORCES, ENERGY, PRESSURE
# optional fields: ERROR :pre

cs->send(msgID,nfields)      # msgID with nfields
cs->pack(FORCES,3*Natoms,f)  # vector of 3N forces on atoms
cs->pack(ENERGY,1,poteng)    # total potential energy of system
cs->pack(VIRIAL,6,virial)    # global virial tensor (6-vector)
cs->pack(ERROR,6,virial)     # server had an error (e.g. DFT non-convergence) :pre
cs->pack(PRESSURE,6,press)   # global pressure tensor (6-vector)
cs->pack_int(ERROR,flag)     # server had an error (e.g. DFT non-convergence) :pre

:line

The units for various quantities that are sent and received iva
messages are defined for atomic-scale simulations in the table below.
The client and server codes (including LAMMPS) can use internal units
different than these (e.g. "real units"_units.html in LAMMPS), so long
as they convert to these units for meesaging.

COORDS, ORIGIN, BOX = Angstroms
CHARGE = multiple of electron charge (1.0 is a proton)
ENERGY = eV
FORCES = eV/Angstrom
PRESSURE = bars :ul

Note that these are "metal units"_units.html in LAMMPS.

If you wish to run LAMMPS in another its non-atomic units, e.g. "lj
units"_units.html, then the client and server should exchange a UNITS
message as indicated above, and both the client and server should
agree on the units for the data they exchange.

:line

+4 −2
Original line number Diff line number Diff line
@@ -34,11 +34,13 @@ These are the sub-directories included in this directory:

simple		    simple example of driver code calling LAMMPS as a lib
multiple	    example of driver code calling multiple instances of LAMMPS
lammps_mc           client/server coupling Monte Carlo with LAMMPS MD
lammps_mc           client/server coupling of Monte Carlo client 
                      with LAMMPS server for energy evaluation
lammps_quest	    MD with quantum forces, coupling to Quest DFT code
lammps_spparks	    grain-growth Monte Carlo with strain via MD,
		    coupling to SPPARKS kinetic MC code
lammps_vasp         client/server coupling LAMMPS MD with VASP quantum DFT
lammps_vasp         client/server coupling of LAMMPS client  with 
                      VASP quantum DFT as server for quantum forces
library		    collection of useful inter-code communication routines
fortran             a simple wrapper on the LAMMPS library API that
 		      can be called from Fortran
+2 −3
Original line number Diff line number Diff line
@@ -19,10 +19,9 @@ LINKFLAGS = -g -O -L$(CSLIB)
# targets

mc:	$(OBJ)
#	this line if built the CSlib within lib/message with ZMQ support
#       note this is using the serial (no-mpi) version of the CSlib
#	first line if built the CSlib within lib/message with ZMQ support
#	second line if built the CSlib without ZMQ support
	$(LINK) $(LINKFLAGS) $(OBJ) -lcsnompi -lzmq -o mc
#	this line if built the CSlib without ZMQ support
#	$(LINK) $(LINKFLAGS) $(OBJ) -lcsnompi -o mc

clean:
Loading