Output File Formats in MD++: Difference between revisions
No edit summary |
|||
| Line 23: | Line 23: | ||
Different amount of details are saved into the file, depending on two flags: <tt>writevelocity</tt> and <tt>writeall</tt>. By default, <tt>writevelocity = 0</tt> and <tt>writeall = 0</tt>. |
Different amount of details are saved into the file, depending on two flags: <tt>writevelocity</tt> and <tt>writeall</tt>. By default, <tt>writevelocity = 0</tt> and <tt>writeall = 0</tt>. |
||
===Overall format=== |
===Overall format=== |
||
| Line 28: | Line 29: | ||
The saved .cn files have the following format. |
The saved .cn files have the following format. |
||
The first line is the number of atoms <math>NP</math>. |
* The first line is the number of atoms <math>NP</math>. |
||
This is followed by <math>NP</math> lines of data, each corresponding to an atom (more explanation below). |
* This is followed by <math>NP</math> lines of data, each corresponding to an atom (more explanation below). |
||
After that, there is a 3x3 matrix <math>H</math> whose column vectors are the three repeat vector of the supercell. |
* After that, there is a 3x3 matrix <math>\mathbf{H}</math> whose column vectors are the three repeat vector of the supercell. |
||
The next line contains the number of species and the name of the species. By default, the number of species is 1 and the name of the species is "Mo". The species name can be set in the input file by, e.g. element0 = "Si", element1 = "C". The species names will not be used by the simulation. Even if you forgot to set them, the simulation can still run correctly. |
* The next line contains the number of species and the name of the species. By default, the number of species is 1 and the name of the species is "Mo". The species name can be set in the input file by, e.g. element0 = "Si", element1 = "C". The species names will not be used by the simulation. Even if you forgot to set them, the simulation can still run correctly. |
||
| ⚫ | |||
| ⚫ | |||
===Basic atomic information=== |
===Basic atomic information=== |
||
| Line 42: | Line 44: | ||
When <tt>writeall = 0</tt> and <tt>writevelocity = 0</tt> (default), each line in the saved .cn file (from line 2 to line <math>NP + 1</math>) has the following format. |
When <tt>writeall = 0</tt> and <tt>writevelocity = 0</tt> (default), each line in the saved .cn file (from line 2 to line <math>NP + 1</math>) has the following format. |
||
<math>s_{x_i} |
<math>s_{x_i} \ s_{y_i} \ s_{z_i}</math> |
||
They are the scaled coordinates of atom <math>i</math>. |
They are the scaled coordinates of atom <math>i</math>. |
||
| Line 49: | Line 51: | ||
<math>\mathbf{r}_i = \mathbf{H} \cdot \mathbf{s}_i </math> |
<math>\mathbf{r}_i = \mathbf{H} \cdot \mathbf{s}_i </math> |
||
where <math>\mathbf{H}</math> is the matrix described in the previous sub-section. |
|||
The default setting is sufficient for quasi-static (energy minimization) simulations involving a single species without any fixed atoms. |
|||
===Use writevelocity=== |
|||
If we want to save a restart file from Molecular Dynamics simulations, we need to save atomic velocities. This can be turned on by setting <tt>writevelocity = 1</tt>, as in the following command. |
|||
finalcnfile = myfile.cn writevelocity = 1 writecn |
|||
The command for reading this file is the same as before. MD++ will automatically detect the format of the saved .cn files. |
|||
| ⚫ | |||
<math>s_{x_i} \ s_{y_i} \ s_{z_i} \ vs_{x_i} \ vs_{y_i} \ vs_{z_i} </math> |
|||
The last three numbers are the scaled velocities of atom <math>i</math>. They are related to the real velocities in the same way as the scaled coordinates are related to the real coordinates. |
|||
===Use writeall=== |
|||
If the simulation contains more than one species, or if some atoms are fixed, these kinds of information can only be saved if we set <tt>writeall = 1</tt>, as in the following command. |
|||
finalcnfile = myfile.cn writeall = 1 writecn |
|||
If <tt>writeall = 1</tt>, atomic velocities will be written to file regardless of the value of the <tt>writevelocity</tt> varible. |
|||
When <tt>writeall = 1</tt>, each line in the saved .cn file (from line 2 to line <math>NP + 1</math>) has the following format. |
|||
<math>s_{x_i} \ s_{y_i} \ s_{z_i} \ vs_{x_i} \ vs_{y_i} \ vs_{z_i} \ {\rm EPOT[}i{\rm ]} \ {\rm fixed[}i{\rm ]} \ {\rm topol[}i{\rm ]} \ {\rm species[}i{\rm ]} \ {\rm group[}i{\rm ]} \ {\rm image[}i{\rm ]}</math> |
|||
The last 6 numbers are additional attributes of atom <math>i</math> in MD++. |
|||
* <math>{\rm EPOT[}i{\rm ]}</math> is the local potential energy of atom <math>i</math>. The sum <math>{\rm EPOT[}i{\rm ]}</math> for all atoms equals to the potential energy of the system. |
|||
* <math>{\rm fixed[}i{\rm ]}</math> has the default value 0. If it equals to 1, then atom <math>i</math> is fixed. Its position will not change in energy minimization or Molecular Dynamics simulations. If it equals to -1, then this atom is "removed". It will not be included in the evaluation of potential energy, and it will not exert any force on other atoms. (This is a useful way to remove an atom without changing the indices of other atoms.) |
|||
* <math>{\rm topol[}i{\rm ]}</math> stores the central symetry deviation (CSD) parameter of atom <math>i</math> or other parameters computed by visualization algorithms. By default, it is not computed. To turn on the calculation of this field in energy minimzation or MD simulations, set <tt>plot_color_axis = 2</tt>. You can also ask MD++ to compute the <math>{\rm topol[}i{\rm ]}</math> value for the current configuration by calling <tt>calcentralsymmetry</tt>. |
|||
* <math>{\rm species[}i{\rm ]}</math> stores the element type of atom <math>i</math>. For a binary system, <math>{\rm species[}i{\rm ]}</math> is either 0 or 1. For a ternary system, <math>{\rm species[}i{\rm ]}</math> is either 0, 1 or 2. The interatomic potential function uses this field to decide which function to use, e.g. to compute the interaction between two given atoms. |
|||
* <math>{\rm group[}i{\rm ]}</math> specifies which group atom <math>i</math> belongs to. By default, <math>{\rm group[}i{\rm ]} = 0</math> for all atoms. One way to define a group of atoms is to use commands <tt>fixatoms_by_position</tt> or <tt>fixatoms_by_ID</tt>, followed by <tt>setfixedatomsgroup</tt> and <tt>freeallatoms</tt>. Once a group (or several groups) of atoms are defined, we can use commands <tt>movegroup</tt>, <tt>setgroupcomvel</tt>, <tt>addFext_to_group</tt>, <tt>relax_by_group</tt> to manipulate them. |
|||
* <math>{\rm image[}i{\rm ]}</math> has the default value -1. If it is not -1, it means atom <math>i</math> is not a real atom but a (periodic) image of another atom, whose index is stored in <math>{\rm image[}i{\rm ]}</math>. This means that if atom <math>{\rm image[}i{\rm ]}</math> moves in one step of the simulation, MD++ will move atom <math>i</math> by the same amount before going to the next step. |
|||
| ⚫ | |||
==Property .out File== |
==Property .out File== |
||
Revision as of 05:16, 17 August 2009
Output File Formats in MD++
This tutorial describes the formats of MD++ output files. The most frequently used file in MD++ is the configuration (.cn) file describing atomic positions (and other attributes). Also used a lot is the property (.out) file produced by Molecular Dynamics simulations. MD++ can also read and write VASP (POSCAR) and LAMMPS files.
Configuration .cn File
In MD++, we save the current atomic configuration (in memory) to a file using the following command.
finalcnfile = myfile.cn writecn
(This is what we write in a .script input file. If we use .tcl input file, we need to put MD++ at the beginning of the line.)
The atomic configuration can be read into MD++ later (either in the same simulation run or in a different run) using the following command.
incnfile = myfile.cn readcn
Different amount of details are saved into the file, depending on two flags: writevelocity and writeall. By default, writevelocity = 0 and writeall = 0.
Overall format
The saved .cn files have the following format.
- The first line is the number of atoms Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle NP} .
- This is followed by Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle NP} lines of data, each corresponding to an atom (more explanation below).
- After that, there is a 3x3 matrix Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{H}} whose column vectors are the three repeat vector of the supercell.
- The next line contains the number of species and the name of the species. By default, the number of species is 1 and the name of the species is "Mo". The species name can be set in the input file by, e.g. element0 = "Si", element1 = "C". The species names will not be used by the simulation. Even if you forgot to set them, the simulation can still run correctly.
- The last line contains two numbers: zeta and zetav. These are variables used in the Nose-Hoover thermostat. We save them to enhance reproducibility of MD simulations from a saved .cn (restart) file. These values are zero if the file is saved after quasi-static simulations.
Basic atomic information
When writeall = 0 and writevelocity = 0 (default), each line in the saved .cn file (from line 2 to line Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle NP + 1} ) has the following format.
They are the scaled coordinates of atom .
If we let Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{s}_i = (s_{x_i}, s_{y_i}, s_{z_i})^T} be the scaled coordinate vector of atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} and let Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{r}_i = (x_i, y_i, z_i)^T} be the real coordinate vector, then they are related to each other by,
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{r}_i = \mathbf{H} \cdot \mathbf{s}_i }
where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{H}} is the matrix described in the previous sub-section.
The default setting is sufficient for quasi-static (energy minimization) simulations involving a single species without any fixed atoms.
Use writevelocity
If we want to save a restart file from Molecular Dynamics simulations, we need to save atomic velocities. This can be turned on by setting writevelocity = 1, as in the following command.
finalcnfile = myfile.cn writevelocity = 1 writecn
The command for reading this file is the same as before. MD++ will automatically detect the format of the saved .cn files.
When writevelocity = 1, each line in the saved .cn file (from line 2 to line Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle NP + 1} ) has the following format.
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle s_{x_i} \ s_{y_i} \ s_{z_i} \ vs_{x_i} \ vs_{y_i} \ vs_{z_i} }
The last three numbers are the scaled velocities of atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} . They are related to the real velocities in the same way as the scaled coordinates are related to the real coordinates.
Use writeall
If the simulation contains more than one species, or if some atoms are fixed, these kinds of information can only be saved if we set writeall = 1, as in the following command.
finalcnfile = myfile.cn writeall = 1 writecn
If writeall = 1, atomic velocities will be written to file regardless of the value of the writevelocity varible.
When writeall = 1, each line in the saved .cn file (from line 2 to line Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle NP + 1} ) has the following format.
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle s_{x_i} \ s_{y_i} \ s_{z_i} \ vs_{x_i} \ vs_{y_i} \ vs_{z_i} \ {\rm EPOT[}i{\rm ]} \ {\rm fixed[}i{\rm ]} \ {\rm topol[}i{\rm ]} \ {\rm species[}i{\rm ]} \ {\rm group[}i{\rm ]} \ {\rm image[}i{\rm ]}}
The last 6 numbers are additional attributes of atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} in MD++.
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm EPOT[}i{\rm ]}} is the local potential energy of atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} . The sum Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm EPOT[}i{\rm ]}} for all atoms equals to the potential energy of the system.
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm fixed[}i{\rm ]}} has the default value 0. If it equals to 1, then atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} is fixed. Its position will not change in energy minimization or Molecular Dynamics simulations. If it equals to -1, then this atom is "removed". It will not be included in the evaluation of potential energy, and it will not exert any force on other atoms. (This is a useful way to remove an atom without changing the indices of other atoms.)
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm topol[}i{\rm ]}} stores the central symetry deviation (CSD) parameter of atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} or other parameters computed by visualization algorithms. By default, it is not computed. To turn on the calculation of this field in energy minimzation or MD simulations, set plot_color_axis = 2. You can also ask MD++ to compute the Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm topol[}i{\rm ]}} value for the current configuration by calling calcentralsymmetry.
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm species[}i{\rm ]}} stores the element type of atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} . For a binary system, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm species[}i{\rm ]}} is either 0 or 1. For a ternary system, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm species[}i{\rm ]}} is either 0, 1 or 2. The interatomic potential function uses this field to decide which function to use, e.g. to compute the interaction between two given atoms.
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm group[}i{\rm ]}} specifies which group atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} belongs to. By default, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm group[}i{\rm ]} = 0} for all atoms. One way to define a group of atoms is to use commands fixatoms_by_position or fixatoms_by_ID, followed by setfixedatomsgroup and freeallatoms. Once a group (or several groups) of atoms are defined, we can use commands movegroup, setgroupcomvel, addFext_to_group, relax_by_group to manipulate them.
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm image[}i{\rm ]}} has the default value -1. If it is not -1, it means atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} is not a real atom but a (periodic) image of another atom, whose index is stored in Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm image[}i{\rm ]}} . This means that if atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\rm image[}i{\rm ]}} moves in one step of the simulation, MD++ will move atom Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i} by the same amount before going to the next step.