fix print command

Syntax:

fix ID print N string keyword value ...
  • ID is documented in fix command

  • print = style name of this fix command

  • N = print every N steps

  • string = text string to print with optional variable names

  • zero or more keyword/value pairs may be appended

    keyword = file or append or screen or title

    • file value = filename
    • append value = filename
    • screen value = yes or no
    • title value = string: text to print as 1st line of output file

Examples:

fix extra print 100 "Coords of marker particle = $x $y $z"
fix extra print 100 "Coords of marker particle = $x $y $z" file coord.txt

Description:

Print a text string every N steps during a simulation run. This can be used for diagnostic purposes or as a debugging tool to monitor some quantity during a run. The text string must be a single argument, so it should be enclosed in quotes if it is more than one word. If it contains variables it must be enclosed in quotes to insure they are not evaluated when the input script line is read, but will instead be evaluated each time the string is printed.

See the variable command for a description of equal style variables which are the most useful ones to use with the fix print command, since they are evaluated afresh each timestep that the fix print line is output. Equal-style variables calculate formulas involving mathematical operations, statistical properties, global values calculated by a compute or fix, or references to other variables.

If the file or append keyword is used, a filename is specified to which the output generated by this fix 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.

If the screen keyword is used, output by this fix to the screen and logfile can be turned on or off as desired.

The title keyword allow specification of the string that will be printed as the first line of the output file, assuming the file keyword was used. By default, the title line is as follows:

# Fix print output for fix ID

where ID is replaced with the fix-ID.

Restart, output info:

No information about this fix is written to binary restart files. No global or per-particle or per-grid quantities are stored by this fix for access by various output commands.

Restrictions:

none

Default:

The option defaults are no file output, screen = yes, and title string as described above.