Simpatico
v1.10
|
2.5 Command Files (Prev) 2.7 Examples (Next)
The instantaneous state of a system is recorded in a configuration file. Each of the simpatico programs has a default configuration file format, and is also able to read and write several other formats.
The default configuration file formats for mcSim, mdSim and ddSim are slightly different. In all cases, the default configuration file format contains the dimensions of the periodic boundary, and the positions of all atoms. Configuration file formats for mdSim and ddSim, that are designed for use with MD simulations, also contain atomic velocities.
The default ddSim file format contains information about molecular topology (i.e., covalent bonding), while the default mcSim and mdSim configuration file formats do not. This difference is a result in the information available from the parameter file: The parameter files for mcSim and mcSim (but not ddSim) contain a description of every molecular species, including the number of atoms per molecule and a complete specification of its chemical structure. The configuration file formats for mcSim and mdSim thus contain only the box dimensions, atomic positions and (for mdSim) atomic velocities. In ddSim, their is no required notion of a molecular "species", and the configuration file format contains a complete description of the covalent connections among molecules, as discussed in more detail below.
Below is an example of the default format for a small MC simulation. This is a configuration for simulation of 100 chains of a single species, each containing 8 atoms, in a periodic cubic unit cell with a length of 10.455 on each side. The atomic positions are read in blocks, each corresponding to a particular molecule of a particular species, in which each line contains the position vector for one atom. The parameter file, which must be read before any configuration file, contains the number of species and the number of atoms per molecule in each species, and this information is used to read the configuration file. The actual number of molecules of each species is given in the configuration file at the beginning of the block corresponding to each species. The number of molecules of each species must be less than or equal to a capacity (i.e., a maximum allowable number of molecules) that is specified for each species in the parameter file.
The configuration file has two sections, which begin with the keywords BOUNDARY and ATOMS.
The BOUNDARY section contains a single line that contains the dimensions of the periodic unit cell. This line starts with a key word that describes the symmetry of the unit cell (i.e., the lattice system). Currently, this may have values "cubic", "tetragonal" or "orthorhombic". This is followed by one or more unit cell dimensions. Only one cell dimension is given for a "cubic" cell, two for a "tetragonal" cell and three for an "orthorhombic" cell. For a tetragonal cell, the first length is the unique direction, which aligned along the x (0 index) direction, and the second is the length along the y and z (1 and 2) directions, which must be equal.
The ATOMS section contains a set of sub blocks, one per each species listed in the parameter file, which appear in the order that they appear in the parameter file. The value of the variable nMolecule near the beginning of each species block must be less than or equal to the "capacity" specified for that species in the parameter file, which specifies the amount of memory that has been allocated for molecules of that species, which is maximum allowable number of such molecules. The atomic positions are listed in blocks, where each block contains the number of atoms in one molecule of the enclosing species, as specified by the parameter file.
The default file format for an MD simulation is similar, except that it includes Cartesian velocity components for each atom as well as coordinates. In the default MD format, information for each atom thus contains 6 floating point numbers the first of which contains the x, y, and z position coordinates, and the second of which contains the corresponding velocity components. This is normally output on two lines (one for the position and the second for the velocity) but newlines and other whitespace are ignored when the file is read.
The default configuration file format for a parallel ddSim simulation differs from those used by mcSim or mdSim in several ways. First, all of the atoms in the simulation are listed in a single block, in which atoms records may appear in random order, and in which each atom is identified by an index. Second, the file format contains blocks that specify which atoms interact via 2-body covalent bonds, and (if angle and dihedral potentials are enabled) which groups of atoms interact via covalent 3-body angle and 4-body dihedral interactions.
Here is an example of this format for a simulation of 18816 atoms with covalent bonds but no angle or dihedral potentials. Ellipses (...) indicate parts of the file that are not shown. The file format is discussed in more detail below the example.
This file contains three blocks, which are identified by the keywords BOUNDARY, ATOMS, and BONDS.
The format of the BOUNDARY section is identical to that of an mcSim or mdSim configuration file.
The ATOMS section contains an unordered list of records for atoms. In this example, the information for each atom has been formatted using two lines. Each atom record contains, in this order, an integer identifier, an atom type identifier, a position vector (3 floating point numbers), and a velocity vector (3 floating point numbers). Atoms may appear in any order, but each atom may appear only once.
The BONDS sections contains a list of records for different covalent bonds. In the above example, each bond record is on a different line. As for atoms, bonds may appear in any order, but each bond should only appear once. Each bond record contains, in this order: a unique identifier for the bond, a bond type identifier, and the identifiers of the two atoms that are connected by the bond.
In a simulation that contains angle and/or dihedral potentials this would be followed by sections entitled ANGLES and DIHEDRALS, each of which has a format analogous to that used for BONDS.
The configuration file formats described above are used by default for both reading and writing configuration files. Other formats may be selected for any simpatico program by adding a SET_CONFIG_IO command in the command file. The SET_CONFIG_IO command takes one string argument that specifies a configuration file format. For example, adding the line
to a command file for any simpatico simulation program (mcSim, mdSim or ddSim) will set the program to read and write configuration files using the Lammps data file format. The argument of the SET_CONFIG_IO command is actually the name of a class that implements a configuration file format, which must be a subclass of McMd::ConfigIo for mcSim or mdSim or of DdMd::ConfigIo object for ddSim.
The SET_CONFIG_IO command creates an instance of the specified class that will be used for all subsequent operations that read or write configuration files, until another SET_CONFIG_IO command is encountered. By inserting a SET_CONFIG_IO command just before a subsequent WRITE_CONFIG, you may specify a new file format for the final output configuration file. A command file that contains only SET_CONFIG_IO, READ_CONFIG and WRITE_CONFIG commands can be used to convert between file formats.
ConfigIo file classes available for use in mcSim and mdSim programs, are:
Configuration file classes available for use in ddSim simulations are:
The string that is passed to a SET_CONFIG_IO command should not include a namespace qualifier, i.e., it should be LammpsConfigIo rather than McMd::LammpsConfigIo or DdMd::LammpsConfigIo.
The McMd::DdMdConfigIo and McMd::LammpsConfigIo classes can be used in mcSim or mdSim simulations to produce configuration files that can be read by ddSim, to initialize a parallel MD simulation. The serial mcSim and mdSim programs can thus be used to create partially equilibrated initial configurations for longer parallel MD simulations.
Because the data structures used in the ddSim parallel MD program are signficantly different from those used in mcSim and mdSim, mcSim and mdSim can currently read ddSim and lammps configuration files only if the configuration files obey a restrictive convention regarding the ordering of atom ids. This convention is discussed in the class documentation for McMd::LammpsConfigIo and McMd::DdMdConfigIo. The DdMd::DdMdOrderedConfigIo and DdMd::LammpsConfigIo are designed to produce configuration files with sequentially ordered atom ids that can be read by mdSim and mcSim. The default DdMd::DdMdConfigIo format does not write files with sequentially ordered atom ids, and so avoids the cost in time and memory of assembling an ordered list of atoms from data that is initially distirbuted over many processors.
An mdSim MD simulation can be instructed to read an output file created by an earlier mcSim MC simulation by adding a command "SET_CONFIG_IO McConfigIo" before the READ_CONFIG command. Because the default MC file format does not contain any information about velocities, however, this pair of commands would normally be followed in the file for an MdSimulation by a THERMALIZE command, to generate random velocities chosen from a Maxwell-Boltzmann distribution.
2.5 Command Files (Prev) 2 User Guide (Up) 2.7 Examples (Next)