2006-09-22 00:22:34 +08:00
|
|
|
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
|
|
|
|
|
|
|
:link(lws,http://lammps.sandia.gov)
|
|
|
|
:link(ld,Manual.html)
|
|
|
|
:link(lc,Section_commands.html#comm)
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
print command :h3
|
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
2015-03-18 00:05:28 +08:00
|
|
|
print string keyword value :pre
|
2006-09-22 00:22:34 +08:00
|
|
|
|
2013-08-20 00:49:20 +08:00
|
|
|
string = text string to print, which may contain variables :ulb,l
|
2013-08-15 23:22:35 +08:00
|
|
|
zero or more keyword/value pairs may be appended :l
|
|
|
|
keyword = {file} or {append} or {screen} :l
|
|
|
|
{file} value = filename
|
|
|
|
{append} value = filename
|
|
|
|
{screen} value = {yes} or {no} :pre
|
|
|
|
:ule
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
[Examples:]
|
|
|
|
|
2013-08-15 23:22:35 +08:00
|
|
|
print "Done with equilibration" file info.dat
|
|
|
|
print Vol=$v append info.dat screen no
|
|
|
|
print "The system volume is now $v"
|
2015-03-18 00:05:28 +08:00
|
|
|
print 'The system volume is now $v'
|
|
|
|
print """
|
|
|
|
System volume = $v
|
|
|
|
System temperature = $t
|
|
|
|
""" :pre
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
[Description:]
|
|
|
|
|
2015-03-18 00:05:28 +08:00
|
|
|
Print a text string to the screen and logfile. The text string must
|
|
|
|
be a single argument, so if it is one line but more than one word, it
|
|
|
|
should be enclosed in single or double quotes. To generate multiple
|
|
|
|
lines of output, the string can be enclosed in triple quotes, as in
|
|
|
|
the last example above. If the text string contains variables, they
|
|
|
|
will be evaluated and their current values printed.
|
2013-08-15 23:22:35 +08:00
|
|
|
|
|
|
|
If the {file} or {append} keyword is used, a filename is specified to
|
2013-08-20 00:49:20 +08:00
|
|
|
which the output will be written. If {file} is used, then the
|
|
|
|
filename is overwritten if it already exists. If {append} is used,
|
|
|
|
then the filename is appended to if it already exists, or created if
|
|
|
|
it does not exist.
|
2013-08-15 23:22:35 +08:00
|
|
|
|
2013-08-20 00:49:20 +08:00
|
|
|
If the {screen} keyword is used, output to the screen and logfile can
|
|
|
|
be turned on or off as desired.
|
2007-02-10 05:37:30 +08:00
|
|
|
|
|
|
|
If you want the print command to be executed multiple times (with
|
|
|
|
changing variable values), there are 3 options. First, consider using
|
2008-01-03 03:25:15 +08:00
|
|
|
the "fix print"_fix_print.html command, which will print a string
|
2007-02-10 05:37:30 +08:00
|
|
|
periodically during a simulation. Second, the print command can be
|
|
|
|
used as an argument to the {every} option of the "run"_run.html
|
|
|
|
command. Third, the print command could appear in a section of the
|
2008-01-03 03:25:15 +08:00
|
|
|
input script that is looped over (see the "jump"_jump.html and
|
|
|
|
"next"_next.html commands).
|
2007-02-10 05:37:30 +08:00
|
|
|
|
|
|
|
See the "variable"_variable.html command for a description of {equal}
|
|
|
|
style variables which are typically the most useful ones to use with
|
2007-12-13 22:33:12 +08:00
|
|
|
the print command. Equal-style variables can calculate formulas
|
|
|
|
involving mathematical operations, atom properties, group properties,
|
2008-03-01 09:13:20 +08:00
|
|
|
thermodynamic properties, global values calculated by a
|
2007-12-13 22:33:12 +08:00
|
|
|
"compute"_compute.html or "fix"_fix.html, or references to other
|
|
|
|
"variables"_variable.html.
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
[Restrictions:] none
|
|
|
|
|
|
|
|
[Related commands:]
|
|
|
|
|
|
|
|
"fix print"_fix_print.html, "variable"_variable.html
|
|
|
|
|
2013-08-15 23:22:35 +08:00
|
|
|
[Default:]
|
|
|
|
|
2013-08-20 00:49:20 +08:00
|
|
|
The option defaults are no file output and screen = yes.
|