rerun command — LAMMPS documentation (2024)

Syntax

rerun file1 file2 ... keyword args ...
  • file1,file2,… = dump file(s) to read

  • one or more keywords may be appended, keyword dump must appear and be last

    keyword = first or last or every or skip or start or stop or post or dump first args = Nfirst Nfirst = dump timestep to start on last args = Nlast Nlast = dumptimestep to stop on every args = Nevery Nevery = read snapshots matching every this many timesteps skip args = Nskip Nskip = read one out of every Nskip snapshots start args = Nstart Nstart = timestep on which pseudo run will start stop args = Nstop Nstop = timestep to which pseudo run will end post value = yes or no dump args = same as read_dump command starting with its field arguments

Examples

rerun dump.file dump x y z vx vy vzrerun dump1.txt dump2.txt first 10000 every 1000 dump x y zrerun dump.vels dump x y z vx vy vz box yes format molfile lammpstrjrerun dump.dcd dump x y z box no format molfile dcdrerun ../run7/dump.file.gz skip 2 dump x y z box yesrerun dump.bp dump x y z box no format adiosrerun dump.bp dump x y z vx vy vz format adios timeout 10.0

Description

Perform a pseudo simulation run where atom information is read onesnapshot at a time from a dump file(s), and energies and forces arecomputed on the shapshot to produce thermodynamic or other output.

This can be useful in the following kinds of scenarios, after aninitial simulation produced the dump file:

Conceptually, using the rerun command is like running an input scriptthat has a loop in it (see the next and jumpcommands). Each iteration of the loop reads one snapshot from thedump file via the read_dump command, sets thetimestep to the appropriate value, and then invokes a runcommand for zero timesteps to simply compute energy and forces, andany other thermodynamic output or diagnostic infoyou have defined. This computation also invokes any fixes you havedefined that apply constraints to the system, such as fix shake or fix indent.

Note that a simulation box must already be defined before using thererun command. This can be done by the create_box,read_data, or read_restartcommands.

Also note that reading per-atom information from dump snapshots islimited to the atom coordinates, velocities and image flags asexplained in the read_dump command. Other atomproperties, which may be necessary to compute energies and forces,such as atom charge, or bond topology information for a molecularsystem, are not read from (or even contained in) dump files. Thusthis auxiliary information should be defined in the usual way, e.g. ina data file read in by a read_data command, beforeusing the rerun command.

Also note that the frequency of thermodynamic or dump output from thererun simulation will depend on settings made in the rerun script, thesame as for output from any LAMMPS simulation. See further info belowas to what that means if the timesteps for snapshots read from dumpfiles do not match the specified output frequency.

If more than one dump file is specified, the dump files are read oneafter the other in the order specified. It is assumed that snapshottimesteps will be in ascending order. If a snapshot is encountered thatis not in ascending order, it will skip the snapshot until it reads onethat is.This allows skipping of a duplicate snapshot (same timestep),e.g. that appeared at the end of one file and beginning of the next.However if you specify a series of dump files in an incorrect order(with respect to the timesteps they contain), you may skip largenumbers of snapshots.

Note that the dump files specified as part of the dump keyword can beparallel files, i.e. written as multiple files either per processorand/or per snapshot. If that is the case they will also be read inparallel which can make the rerun command operate dramatically fasterfor large systems. See the page for the read_dump and dump commands which describe how to readand write parallel dump files.

The first, last, every, skip keywords determine whichsnapshots are read from the dump file(s). Snapshots are skipped untilthey have a timestep >= Nfirst. When a snapshot with a timestep >Nlast is encountered, the rerun command finishes. Note thatthe defaults for first and last are to read all snapshots. If theevery keyword is set to a value > 0, then only snapshots withtimesteps that are a multiple of Nevery are read (the firstsnapshot is always read). If Nevery = 0, then this criterion isignored, i.e. every snapshot is read that meets the other criteria.If the skip keyword is used, then after the first snapshot is read,every Nth snapshot is read, where N = Nskip. E.g. if Nskip = 3,then only 1 out of every 3 snapshots is read, assuming the snapshottimestep is also consistent with the other criteria.

Note

Not all dump formats contain the timestep and not all dump readerssupport reading it. In that case individual snapshots are assignedconsecutive timestep numbers starting at 1.

The start and stop keywords do not affect which snapshots are readfrom the dump file(s). Rather, they have the same meaning that theydo for the run command. They only need to be defined if(a) you are using a fix command that changes some valueover time, and (b) you want the reference point for elapsed time (fromstart to stop) to be different than the first and last settings.See the page for individual fixes to see which ones can be usedwith the start/stop keywords. Note that if you define neither ofthe start/stop or first/last keywords, then LAMMPS treats thepseudo run as going from 0 to a huge value (effectively infinity).This means that any quantity that a fix scales as a fraction ofelapsed time in the run, will essentially remain at its initial value.Also note that an error will occur if you read a snapshot from thedump file with a timestep value larger than the stop setting youhave specified.

The post keyword can be used to minimize the output to the screen thathappens after a rerun command, similar to the post keyword of therun command. It is set to no by default.

The dump keyword is required and must be the last keyword specified.Its arguments are passed internally to the read_dumpcommand. The first argument following the dump keyword should bethe field1 argument of the read_dump command. Seethe read_dump page for details on the variousoptions it allows for extracting information from the dump filesnapshots, and for using that information to alter the LAMMPSsimulation.

In general, a LAMMPS input script that uses a rerun command caninclude and perform all the usual operations of an input script thatuses the run command. There are a few exceptions andpoints to consider, as discussed here.

Fixes that perform time integration, such as fix nveor fix npt are not invoked, since no time integrationis performed. Fixes that perturb or constrain the forces on atomswill be invoked, just as they would during a normal run. Examples arefix indent and fix langevin.So you should think carefully as to whether that makes sense for themanner in which you are reprocessing the dump snapshots.

If you only want the rerun script to perform an analysis that does notinvolve pair interactions, such as use compute msd to calculateddisplacements over time, you do not need to define a pair style, which may also mean neighbor lists will not need to becalculated which saves time. The comm_modify cutoff command can also be used to ensure ghost atoms areacquired from far enough away for operations like bond and angleevaluations, if no pair style is being used.

Every time a snapshot is read, the timestep for the simulation is reset,as if the reset_timestep command were used.This command has some restrictions as to what fixes can be defined. Seeits documentation page for details. For example, the fix deposit and fix dt/reset fixes are in thiscategory. They also make no sense to use with a rerun command.

If time-averaging fixes like fix ave/time areused, they are invoked on timesteps that are a function of theirNevery, Nrepeat, and Nfreq settings. As an example, see thefix ave/time page for details. You mustensure those settings are consistent with the snapshot timestamps thatare read from the dump file(s). If an averaging fix is not invoked ona timestep it expects to be, LAMMPS will flag an error.

The various forms of LAMMPS output, as defined by thethermo_style, thermo,dump, and restart commands occur withspecified frequency, e.g. every N steps. If the timestep for a dumpsnapshot is not a multiple of N, then it will be read and processed,but no output will be produced. If you want output for every dumpsnapshot, you can simply use N=1 for an output frequency, e.g. forthermodynamic output or new dump file output.

Restrictions

The rerun command is subject to all restrictions ofthe read_dump command.

Related commands

read_dump

Default

The option defaults are first = 0, last = a huge value (effectivelyinfinity), start = same as first, stop = same as last, every = 0, skip= 1, post = no;

rerun command — LAMMPS documentation (2024)
Top Articles
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 5911

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.