Obtaining single-temperature output from temper command

Dear LAMMPS users,

I have been using the temper command with output commands in a script that may look like this:

variable t world 300.00 315.00 330.00 346.00 363.00 381.00 400.00

dump DCD_dump all dcd 100 PLUM_$t.dcd

fix myfix all nvt temp $t $t 100.0

temper 10000000 100 $t myfix 0 58382

And I’ve noticed that the file PLUM_300.00.dcd will contain the trajectory for the system that started at 300.00, and will follow it to whatever temperature it goes. Is there a way to instead output the data for the 300.00 box, rather than following the system as it changes temperature?

Alternatively, would there be a way to output N separate files, but have them only be written to when the temperature is 300.00?

If not, are there any existing tool to make it easier for me to stitch together the information for a single-temperature trajectory?

Thank you,

Gil Rutter

University of Warwick, UK

Dear LAMMPS users,

I have been using the temper command with output commands in a script that
may look like this:

variable t world 300.00 315.00 330.00 346.00 363.00 381.00 400.00

dump DCD_dump all dcd 100 PLUM_$t.dcd

fix myfix all nvt temp $t $t 100.0

temper 10000000 100 $t myfix 0 58382

And I've noticed that the file PLUM_300.00.dcd will contain the trajectory
for the system that started at 300.00, and will follow it to whatever
temperature it goes. Is there a way to instead output the data for the
300.00 box, rather than following the system as it changes temperature?

the usual consensus is that it would be too time consuming to swap
entire system rather than just the target temperature and that any
complex manipulations with closing and opening/appending dump files
may lead to data corruption.

if you search through the mailing list archive, you will probably find
some suggestions as to how this can be resolved in post processing.
since usually there is little value to look at anything but the last
frame before a swap attempt, it may be convenient to write out frames
indexed by time step and replica id as individual files and then
reassemble them (the native lammps dump file format allows a simple
concatenating of files).

Alternatively, would there be a way to output N separate files, but have
them only be written to when the temperature is 300.00?

it might be possible. the options and available facilities of the dump
infrastructure has improved a lot over the last years. check out the
docs. personally, i think the option to write one file per dump frame
and then reassemble them in post processing is the safest bet.

If not, are there any existing tool to make it easier for me to stitch
together the information for a single-temperature trajectory?

it should be doable with a little bit of
shell/perl/python/tcl/awk/whatever scripting.

axel.

it may be convenient to write out frames
indexed by time step and replica id as individual files and then
reassemble them (the native lammps dump file format allows a simple
concatenating of files).

this is the simplest way to do it. Then you have
N*M files, where N = # of replicas, M = snapshots per replica.

The global output of a tempering run, like this:

Step T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15
0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
500 1 0 3 2 5 4 6 7 8 9 10 11 12 13 14 15
1000 2 0 4 1 5 3 6 7 8 9 10 11 12 14 13 15
1500 2 1 4 0 5 3 6 7 9 8 10 11 12 14 13 15
2000 2 1 3 0 6 4 5 7 10 8 9 11 12 14 13 15
2500 2 1 3 0 6 4 5 7 11 8 9 10 12 14 13 15

tells you which of the M files from each timestep to assemble
to recover N big files, each for one temp. So a little Python
script that concats them together would do the trick.

If you want to start with N big output files (each with M frames),
then Pizza.py can read them and use the same logic to
reassemble them by temperature. Again a short script.

Steve