doc updates
This commit is contained in:
@ -56,8 +56,7 @@ a conceptual sense. Python-style pseudo code for the library calls to
|
||||
the CSlib is shown, which performs the actual message exchange between
|
||||
the two codes. See the "CSlib website"_http://cslib.sandia.gov doc
|
||||
pages for more details on the actual library syntax. The "cs" object
|
||||
in this pseudo code is an instance of the CSlib that both the client
|
||||
and server codes store.
|
||||
in this pseudo code is a pointer to an instance of the CSlib.
|
||||
|
||||
See the src/MESSAGE/server_mc.cpp file for details on how LAMMPS uses
|
||||
these messages. See the examples/COUPLE/lammmps_mc/mc.cpp file for an
|
||||
@ -67,35 +66,35 @@ Let NATOMS=1, EINIT=2, DISPLACE=3, ACCEPT=4, RUN=5.
|
||||
|
||||
[Client sends one of these kinds of message]:
|
||||
|
||||
cs.send(NATOMS,0) # msgID = 1 with no fields :pre
|
||||
cs->send(NATOMS,0) # msgID = 1 with no fields :pre
|
||||
|
||||
cs.send(EINIT,0) # msgID = 2 with no fields :pre
|
||||
cs->send(EINIT,0) # msgID = 2 with no fields :pre
|
||||
|
||||
cs.send(DISPLACE,2) # msgID = 3 with 2 fields
|
||||
cs.pack(1,1,ID) # 1st field = ID of atom to displace
|
||||
cs.pack(2,3,xnew) # 2nd field = new xyz coords of displaced atom :pre
|
||||
cs->send(DISPLACE,2) # msgID = 3 with 2 fields
|
||||
cs->pack(1,1,ID) # 1st field = ID of atom to displace
|
||||
cs->pack(2,3,xnew) # 2nd field = new xyz coords of displaced atom :pre
|
||||
|
||||
cs.send(ACCEPT,1) # msgID = 4 with 1 field
|
||||
cs.pack(1,1,flag) # 1st field = accept/reject flag :pre
|
||||
cs->send(ACCEPT,1) # msgID = 4 with 1 field
|
||||
cs->pack(1,1,flag) # 1st field = accept/reject flag :pre
|
||||
|
||||
cs.send(RUN,1) # msgID = 5 with 1 field
|
||||
cs.pack(1,1,nsteps) # 1st field = # of timesteps to run MD :pre
|
||||
cs->send(RUN,1) # msgID = 5 with 1 field
|
||||
cs->pack(1,1,nsteps) # 1st field = # of timesteps to run MD :pre
|
||||
|
||||
[Server replies]:
|
||||
|
||||
cs.send(NATOMS,1) # msgID = 1 with 1 field
|
||||
cs.pack(1,1,Natoms) # 1st field = number of atoms :pre
|
||||
cs->send(NATOMS,1) # msgID = 1 with 1 field
|
||||
cs->pack(1,1,Natoms) # 1st field = number of atoms :pre
|
||||
|
||||
cs.send(EINIT,2) # msgID = 2 with 2 fields
|
||||
cs.pack(1,1,poteng) # 1st field = potential energy of system
|
||||
cs.pack(2,3*Natoms,x) # 2nd field = 3N coords of Natoms :pre
|
||||
cs->send(EINIT,2) # msgID = 2 with 2 fields
|
||||
cs->pack(1,1,poteng) # 1st field = potential energy of system
|
||||
cs->pack(2,3*Natoms,x) # 2nd field = 3N coords of Natoms :pre
|
||||
|
||||
cs.send(DISPLACE,1) # msgID = 3 with 1 field
|
||||
cs.pack(1,1,poteng) # 1st field = new potential energy of system :pre
|
||||
cs->send(DISPLACE,1) # msgID = 3 with 1 field
|
||||
cs->pack(1,1,poteng) # 1st field = new potential energy of system :pre
|
||||
|
||||
cs.send(ACCEPT,0) # msgID = 4 with no fields
|
||||
cs->send(ACCEPT,0) # msgID = 4 with no fields
|
||||
|
||||
cs.send(RUN,0) # msgID = 5 with no fields
|
||||
cs->send(RUN,0) # msgID = 5 with no fields
|
||||
|
||||
:line
|
||||
|
||||
|
||||
@ -59,8 +59,7 @@ a conceptual sense. Python-style pseudo code for the library calls to
|
||||
the CSlib is shown, which performs the actual message exchange between
|
||||
the two codes. See the "CSlib website"_http://cslib.sandia.gov doc
|
||||
pages for more details on the actual library syntax. The "cs" object
|
||||
in this pseudo code is an instance of the CSlib that both the client
|
||||
and server codes store.
|
||||
in this pseudo code is a pointer to an instance of the CSlib.
|
||||
|
||||
See the src/MESSAGE/server_md.cpp and src/MESSAGE/fix_client_md.cpp
|
||||
files for details on how LAMMPS uses these messages. See the
|
||||
@ -78,34 +77,34 @@ enum{FORCES=1,ENERGY,VIRIAL}; :pre
|
||||
# required fields: NATOMS, NTYPES, BOXLO, BOXHI, TYPES, COORDS
|
||||
# optional fields: others in 2nd enum above :pre
|
||||
|
||||
cs.send(SETUP,nfields) # msgID with nfields :pre
|
||||
cs->send(SETUP,nfields) # msgID with nfields :pre
|
||||
|
||||
cs.pack_string(UNITS,units) # units = "lj", "real", "metal", etc
|
||||
cs.pack_int(NATOMS,natoms) # total numer of atoms
|
||||
cs.pack_int(NTYPES,ntypes) # number of atom types
|
||||
cs.pack(BOXLO,3,boxlo) # 3-vector of lower box bounds
|
||||
cs.pack(BOXHI,3,boxhi) # 3-vector of upper box bounds
|
||||
cs.pack(BOXTILT,3,boxtilt) # 3-vector of tilt factors for triclinic boxes
|
||||
cs.pack(TYPES,natoms,type) # vector of per-atom types
|
||||
cs.pack(COORDS,3*natoms,x) # vector of 3N atom coords
|
||||
cs.pack(CHARGE,natoms,q) # vector of per-atom charge :pre
|
||||
cs->pack_string(UNITS,units) # units = "lj", "real", "metal", etc
|
||||
cs->pack_int(NATOMS,natoms) # total numer of atoms
|
||||
cs->pack_int(NTYPES,ntypes) # number of atom types
|
||||
cs->pack(BOXLO,3,boxlo) # 3-vector of lower box bounds
|
||||
cs->pack(BOXHI,3,boxhi) # 3-vector of upper box bounds
|
||||
cs->pack(BOXTILT,3,boxtilt) # 3-vector of tilt factors for triclinic boxes
|
||||
cs->pack(TYPES,natoms,type) # vector of per-atom types
|
||||
cs->pack(COORDS,3*natoms,x) # vector of 3N atom coords
|
||||
cs->pack(CHARGE,natoms,q) # vector of per-atom charge :pre
|
||||
|
||||
# required fields: COORDS
|
||||
# optional fields: BOXLO, BOXHI, BOXTILT :pre
|
||||
|
||||
cs.send(STEP,nfields) # msgID with nfields :pre
|
||||
cs->send(STEP,nfields) # msgID with nfields :pre
|
||||
|
||||
cs.pack_int(NATOMS,natoms) # total numer of atoms
|
||||
cs.pack_int(NTYPES,ntypes) # number of atom types
|
||||
cs.pack(BOXLO,3,boxlo) # 3-vector of lower box bounds
|
||||
cs.pack(BOXTILT,3,boxtilt) # 3-vector of tilt factors for triclinic boxes :pre
|
||||
cs->pack_int(NATOMS,natoms) # total numer of atoms
|
||||
cs->pack_int(NTYPES,ntypes) # number of atom types
|
||||
cs->pack(BOXLO,3,boxlo) # 3-vector of lower box bounds
|
||||
cs->pack(BOXTILT,3,boxtilt) # 3-vector of tilt factors for triclinic boxes :pre
|
||||
|
||||
[Server replies to either kind of message]:
|
||||
|
||||
cs.send(msgID,3) # msgID = 1 with 3 fields
|
||||
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) :pre
|
||||
cs->send(msgID,3) # msgID = 1 with 3 fields
|
||||
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) :pre
|
||||
|
||||
:line
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ in a LAMMPS input script.
|
||||
|
||||
The CSlib libary is included in the LAMMPS distribution. A fuller
|
||||
version including documentation and test programs is available at
|
||||
http:cslib.sandia.gov and was developed by Steve Plimpton at Sandia
|
||||
http://cslib.sandia.gov. It was developed by Steve Plimpton at Sandia
|
||||
National Laboratories.
|
||||
|
||||
You can type "make lib-message" from the src directory to see help on
|
||||
@ -16,7 +16,7 @@ The CSlib can be optionally built with support for sockets using
|
||||
the open-source ZeroMQ (ZMQ) library. If it is not installed
|
||||
on your system, it is easy to download and install.
|
||||
|
||||
Go to this website: http://zeromq.org
|
||||
Go to the ZMQ website for details: http://zeromq.org
|
||||
|
||||
-----------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user