Controlling what gets written to energies and trajectory files

To change what gets written we call the SetOutputMetaData method, which functions similar to SetOutputScheduling in that it takes a string with the name of the output manager, and one or more keyword arguments specifying either that a parameter should be included or not, or what the overall precision should be.

  sim.SetOutputMetaData("energies",totalEnergy=False,stress_xy=True, precision=7)
which turns off writing the total energy, turns on writing the xy component of the stress tensor, and sets the precision to seven decimal places. Table 3 shows the most important available quantities. To each of these are associated two strings: an ``identifier'' for use in scripts, to refer to a given quantity when turning it ``on'' or ``off''; and a ``column-label'', which appears in the comment-line of the energies file to identify which column corresponds to which quantity.


Table 3: Identifier and column-label for the main quantities that can be written to the energies file.

\begin{threeparttable}
\begin{tabular}{\vert c\vert c\vert}
\hline
identifier...
... atomic stress. Similarly yy, zz, xy, etc
\end{tablenotes} \end{threeparttable}


For simulations in which more than one potential is present, the contributions from different terms to the total potential energy can be included in the energies file. Each potential class has an ID string. For example for Pot_LJ_12_6 it is ``potLJ''. If desired the ID string can be changed (for example to the simpler ``LJ'') via

  pot.SetID_String("LJ")
In the case of contributions to potential energy this ID-string functions as both the identifier in scripts, and the column-label in the energies-file. So for example, after changing the ID-string to ``LJ'' as above, to cause it to be written we would write

  sim.SetOutputMetaData("energies", LJ=True)
There is a mechanism for additional quantities to be defined and included in the energies file, via classes of type ExternalCalculator. This is described in the user manual.

Heine Larsen 2017-07-21