git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13984 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
sjplimp
2015-09-02 20:41:02 +00:00
parent 047be536bc
commit a6b9148a1e
5 changed files with 59 additions and 5 deletions

View File

@ -3,7 +3,7 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="29 Aug 2015 version">
<META NAME="docnumber" CONTENT="2 Sep 2015 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -21,7 +21,7 @@
<P><CENTER><H3>LAMMPS Documentation
</H3></CENTER>
<CENTER><H4>29 Aug 2015 version
<CENTER><H4>2 Sep 2015 version
</H4></CENTER>
<H4>Version info:
</H4>

View File

@ -1865,10 +1865,11 @@ internal LAMMPS operations. Note that LAMMPS classes are defined
within a LAMMPS namespace (LAMMPS_NS) if you use them from another C++
application.
</P>
<P>Library.cpp contains these 4 functions:
<P>Library.cpp contains these 5 basic functions:
</P>
<PRE>void lammps_open(int, char **, MPI_Comm, void **)
void lammps_close(void *)
int lammps_version(void *)
void lammps_file(void *, char *)
char *lammps_command(void *, char *)
</PRE>
@ -1893,6 +1894,14 @@ instances of LAMMPS to perform different calculations.
<P>The lammps_close() function is used to shut down an instance of LAMMPS
and free all its memory.
</P>
<P>The lammps_version() function can be used to determined the specific
version of the underlying LAMMPS code. This is particularly useful
when loading LAMMPS as a shared library via dlopen(). The code using
the library interface can than use this information to adapt to changes
to the LAMMPS command syntax between versions. The returned LAMMPS
version code is an integer (e.g. 2 Sep 2015 results in 20150902) that
is growing with every new LAMMPS version.
</P>
<P>The lammps_file() and lammps_command() functions are used to pass a
file or string to LAMMPS as if it were an input script or single
command in an input script. Thus the calling code can read or

View File

@ -503,6 +503,8 @@ lmp = lammps("g++",list)
</PRE>
<PRE>lmp.close() # destroy a LAMMPS object
</PRE>
<P>version = lmp.version() # return the numerical version id, e.g. LAMMPS 2 Sep 2015 -> 20150902
</P>
<PRE>lmp.file(file) # run an entire input script, file = "in.lj"
lmp.command(cmd) # invoke a single LAMMPS command, cmd = "run 100"
</PRE>

View File

@ -247,6 +247,39 @@ in commands that use the spacings should be decipherable.
</P>
<HR>
<P>Example commands for generating a Wurtzite crystal (courtesy
of Aidan Thompson), with its 8 atom unit cell.
</P>
<PRE>variable a equal 4.340330
variable b equal $a*sqrt(3.0)
variable c equal $a*sqrt(8.0/3.0)
</PRE>
<PRE>variable 1_3 equal 1.0/3.0
variable 2_3 equal 2.0/3.0
variable 1_6 equal 1.0/6.0
variable 5_6 equal 5.0/6.0
variable 1_12 equal 1.0/12.0
variable 5_12 equal 5.0/12/0
</PRE>
<PRE>lattice custom 1.0 &
a1 $a 0.0 0.0 &
a2 0.0 $b 0.0 &
a3 0.0 0.0 $c &
basis 0.0 0.0 0.0 &
basis 0.5 0.5 0.0 &
basis ${1_3} 0.0 0.5 &
basis ${5_6} 0.5 0.5 &
basis 0.0 0.0 0.625 &
basis 0.5 0.5 0.625 &
basis ${1_3} 0.0 0.125 &
basis ${5_6} 0.5 0.125
</PRE>
<PRE>region myreg block 0 1 0 1 0 1
create_box 2 myreg
create_atoms 1 box
</PRE>
<HR>
<P><B>Restrictions:</B>
</P>
<P>The <I>a1,a2,a3,basis</I> keywords can only be used with style <I>custom</I>.

View File

@ -49,7 +49,7 @@
<I>python</I> arg = function
<I>equal</I> or <I>atom</I> args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references
numbers = 0.0, 100, -5.4, 2.8e-4, etc
constants = PI
constants = PI, version
thermo keywords = vol, ke, press, etc from <A HREF = "thermo_style.html">thermo_style</A>
math operators = (), -x, x+y, x-y, x*y, x/y, x^y, x%y,
x == y, x != y, x &lt y, x &lt= y, x &gt y, x &gt= y, x && y, x || y, !x
@ -422,7 +422,7 @@ references to other variables.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >Number</TD><TD > 0.2, 100, 1.0e20, -15.4, etc</TD></TR>
<TR><TD >Constant</TD><TD > PI</TD></TR>
<TR><TD >Constant</TD><TD > PI, version</TD></TR>
<TR><TD >Thermo keywords</TD><TD > vol, pe, ebond, etc</TD></TR>
<TR><TD >Math operators</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, x%y, </TD></TR>
<TR><TD >Math operators</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, x%y, x == y, x != y, x &lt y, x &lt= y, x &gt y, x &gt= y, x && y, x || y, !x</TD></TR>
@ -457,6 +457,16 @@ When they invoke the atom-style variable, only atoms in the group are
inlcuded in the formula evaluation. The variable evaluates to 0.0 for
atoms not in the group.
</P>
<P>Constants are set at compile time and cannot be changed. <I>PI</I> will
return the number 3.14159265358979323846, <I>version</I> will return a
numeric version code of the current LAMMPS version (e.g. version
2 Sep 2015 will return the number 20150902). The corresponding value
for newer versions of LAMMPS will be larger, for older versions of
LAMMPS will be smaller. This can be used to make input scripts adapt
automatically to LAMMPS versions, for example:
</P>
<PRE>if $(version<20140513) then "communicate vel yes" else "comm_modify vel yes"
</PRE>
<P>The thermo keywords allowed in a formula are those defined by the
<A HREF = "thermo_style.html">thermo_style custom</A> command. Thermo keywords that
require a <A HREF = "compute.html">compute</A> to calculate their values such as