Simpatico  v1.10
2.5 Command Files

2.4 Parameter Files (Prev)         2.6 Configuration Files (Next)

For any Simpatico simulation program, after the parameter file is processed by the readParam() method, the progress of a simulation is controlled by a command file, which is processed by a readCommand() method. The name of the command file is usually specified in command line argument that invokes the program, as an argument of the -c command line option. If the name of the command file is not specified in the command line, it can instead by given in the parameter file as the value of the optional commandFileName parameter in the FileMaster block of the parameter file.

If the command file name given by the special string "paramfile", the program will assume that command file has been appended to the end of the parameter file, after the closing bracket of the main McSimulation or MdSimulation block, and will attempt to read commands from the parameter file rather than from a separate command file.

The command file contains a sequence of one-line commands that are read and executed in sequence. Each command begins with an all upper case label. Some commands take one or more parameters, which must appear after the upper case label, separated by spaces. The script stops execution when it encounters the command string 'FINISH' on a line by itself.

Example

Here is a example of a command file for an mdSim MD simulation that reads in a file in the MC format, generates random velocities, runs a simulation of 100000 MD steps, then outputs the final configuration in the MD format:

SET_CONFIG_IO McConfigIo
READ_CONFIG config
THERMALIZE 1.0000
SIMULATE 100000
SET_CONFIG_IO MdConfigIo
WRITE_CONFIG config
FINISH

The command "SET_CONFIG_IO McConfigIo" identifies the configuration file format to be used in subsequent READ_CONFIG and WRITE_CONFIG commands. The "McConfigIo" format is the default format for an mcSim MC simulation, but can also be used as an input to an Md simulation, as done here. If no SET_CONFIG command is given before the first READ_CONFIG or WRITE_CONFIG command, the program will choose the default format for the program, i.e., and MC file format with no velocities for mcSim and an MD file format that does contain velocities for mdSim.

The command "READ_CONFIG config" reads an MC configuration file from a file named "config", prefixed by the input prefix string given in the param file.

The "THERMALIZE 1.0" command generates random velocities chosen from the Maxwell-Boltzmann distribution with a thermal energy kT = 1.0. This is necessary here because the MC file format used here does not contain any velocities.

The command "SIMULATE 100000" runs a simulation of 100000 MD steps.

The command "SET_CONFIG_IO MdConfigIo" resets the configuration file format to the "MdConfigIo" format, which is the default for mdSim.

"WRITE_CONFIG config" writes the final configuration in the MdConfigIo format, which includes velocities. The configuration is written to a file whose name is given by the string argument "config" prefixed by the output path prefix which is specified in the param file FileMaster block.

The ANALYZE_CONFIGS and ANALYZE_TRAJECTORY commands can be used to read and analyze (i.e., post-process) configurations that were dumped by a previous simulation. The ANALYZE_CONFIGS command reads a sequence of configuration files, in which the name each of files is concatenation of a base name followed by an integer suffix. The ANALYZE_TRAJECTORY command reads a single trajectory file containing multiple "frames", each of which is an instantaneous configuration.

A system can be initialized either by reading a configuration from file or by using the GENERATE_MOLECULES command to generate a partiall random initial configuration. The GENERATE_MOLECULES command generates a initial configuration in which atoms of molecules are distributed at random, using conformations chosen from the equilibrium distribution for a molecule in vaccum, supplemented by a constraint that rejects all conformations that violate a hard-core constraint on the distance between any pair of atoms. The command guarantees that no two atoms will be closer than the sum of their exclusion radii.

Commands

The following table shows a list of available commands for all three programs. The last three columns indicate which commands are valid for each program: An "X" represents a valid command for mcSim, mdSim, or ddSim.

command parameter(s) description mcSim mdSim ddSim
READ_CONFIG filename [string] Read configuration from file filename, with input prefix X X X
SIMULATE nStep [int] Run a simulation of nStep MD or MC steps. Initialize state of simulation, and set iStep = 0, before entering the main loop. X X X
CONTINUE endStep [int] Continue a simulation simulation until step counter iStep reaches endStep, with no re-initialization. X X -
WRITE_CONFIG filename [string] Write configuration from file filename, with output prefix X X X
WRITE_PARAM filename [string] Write parameter file block to file filename, with output prefix X X X
SET_CONFIG_IO className [string] Choose a file format form reading and writing config files, by creating a new instance of a specified subclass className of ConfigIo to be used for these purposes. The resulting object will be used until the next SET_CONFIG_IO command. X X X
THERMALIZE temperature [float] Generate random velocities for specified temperature (in energy units). - X X
GENERATE_MOLECULES boxL [float], nMol0 [int], nMol1 [int], ..., radius0 [float], radius1[float], ... Generate random molecules in a cubix box of size boxL. The number of molecules is nMol0 for species 0, nMol1 for species 1, etc. The hard core exclusion radius is radius0 for atoms of type 0, etc. X X -
ANALYZE_CONFIGS min [int], max [int], filename [string] Postprocess a series of configuration files with integer suffix labels min <= i <= max and a specified base filename X X -
ANALYZE_TRAJECTORY min[int], max[int], classname [string], filename [string] Postprocess frames from a trajectory file filename using an instance of TrajectoryReader subclass classname. Reads frame numbers 0 to max from the file, and analyzes frame numbers min <= i <= max. X X -
SET_PAIR

name[string], i[int], j[int], value[float]

Set value of specific parameter (e.g., name = "epsilon") in pair potential for particles of types i and j. X X X
SET_BOND

name[string], type[int], value[float]

Set value of specific parameter (e.g., name = "kappa") in the bond potential for specific bond type X X X
SET_ANGLE

name[string], type[int], value[float]

Set value of specific parameter (e.g., name = "kappa") in the angle potential for specific angle type X X X
SET_DIHEDRAL

name[string], type[int], value[float]

Set value of specific parameter in the dihedral potential for specific dihedral type X X X
SET_INPUT_PREFIX prefix [string] Change the input prefix that is used to construct paths for input files. Directory names must end with a slash. - - X
SET_OUTPUT_PREFIX prefix [string] Change the output prefix that is used to construct paths for output files. Directory names must end with a slash. - - X
OUTPUT_ANALYZERS Call output() function of each Analyzer - - X
OUTPUT_INTEGRATOR_STATS Output timing statistics - - X
OUTPUT_MEMORY_STATS Output memory usage statistics. - - X
CLEAR_INTEGRATOR Clear integrator state and all statistical accumulators. - - X

The SET_ANGLE and SET_DIHEDRAL commands are only available in programs compiled with angle and dihedral potentials enabled, respectively.


2.4 Parameter Files (Prev)         2 User Guide (Up)         2.6 Configuration Files (Next)