Fortune Telling Collection - Comprehensive fortune-telling - On the output of LAMMPS.
On the output of LAMMPS.
On the output of LAMMPS
2009-09-25 19:40
No matter any simulation, we want to get the data we want from the simulation, and then analyze these data and extract relevant information. Maybe it's a new discovery, so the output data is
An inevitable program, let's talk about how LAMMPS software outputs data.
The output data processed in LAMMPS is mainly divided into three parts:
1. breakpoint data, this is mainly to prevent accidents in the simulation process, such as sudden power failure in the laboratory or computer room, errors in some stages of the program, and so on.
2. The output of thermodynamic quantity of the system is generally the collective behavior quantity of each atom in the system, such as temperature and pressure.
3. Output the detailed information of a single atom, such as the trajectory file we want.
Corresponding to the above three parts, LAMMPS sets different commands, and some commands are combined to realize related functions.
1. For breakpoint data and original data, LAMMPS mainly has the following commands to input and output data. Read_data, read_restart read-in, restart and write_restart output. If you can use these commands flexibly, your simulation will get economic benefits in an emergency. There are two wildcards in this command, * indicates the time step and% indicates the number of CPU.
2. The global thermodynamic data, the so-called thermodynamic output, is oriented to the system, not to a certain class, group or atom. Generally, it is the data of macro information of the system. There are several commands that can handle these data, such as Thermo, Thermo _ Modify, Thermo _ Style (beginners should learn and debug this command carefully), and related auxiliary commands that can convert monatomic information into global quantities: fixave/time, fix ave/spatial, and compute reduce. These commands can set their own output frequency, file name, etc. Combining thermo_style and compute/fix/variable commands for data processing and output is a big problem, and it needs constant debugging to master it skillfully. In fact, learning variable calculation and several corrections about data processing can save you a lot of time in later data processing.
3. Single atom data. The related commands mainly include dump, dump _ modify and dump. Remember, these commands are used to process atom data and are very sensitive to your mistakes.
Sex, hehe.
4。 Echo, print, fix print combined variables can be used to debug your script and correct errors.
5. Show an example of exporting setforce and group atoms to other interaction forces.
# -
fix3tetras setforce 0.0 0.0 0.0
Variable? fxequal f_3[ 1]
Variable? fy equal F3[2]
Variable? fzequal F3[3]
fix 4 tetras print 1 "-$ { FX } $ { fy } $ { FZ }-"
# -
Thermo Fisher Scientific? 2
thermo_style? User-defined step F3 [1] F3 [1] F3 [1]
# -
The above is written by Reddream/fc is next.
As for the output, Manual 4. 15 has been roughly translated.
In addition to restarting files, LAMMPS has two basic outputs. The first is the thermodynamic output, which is printed to the screen and the number of columns in the log file at each specific time step. The second is a dump file, which includes snapshots of atomic positions and various values per atom written to the file at a specific frequency. Each simulation prints a set of thermodynamic outputs; Any number of dump files can be generated. As described below, LAMMPS provides you with many methods to determine which quantities need to be calculated and printed when outputting thermodynamic information and dumping files. There are three fix commands that can execute their own output according to the number selected by the user: fix ave/time for time average, fix ave/spatial for space average, and fix print. It will be introduced in detail below. Throughout the discussion, users should note that they can add their own calculation commands and repair commands, and define their own output through these commands.
The frequency and format of Thermodynamic output are set by the commands of thermo, thermo_style and thermo_modify. The thermo_style command also specifies which values need to be calculated and output. You can specify predefined variables (such as press, etotal, etc.). You can also specify three types of keywords (c _ id, f_ID and v_name), and the corresponding data are provided by the compute, fix and variable commands respectively. The following are described in turn.
In LAMMPS, there are two types of calculation commands: one is to calculate global values (such as temperature and pressure tensor), and the other is to calculate the value of each atom. Only the former can be used as thermodynamic output. The user-specified ID of the compute command plus an optional subscript is used as part of the thermo_style command. For example, c_myTemp outputs a scalar value obtained by calculation; C_myTemp[2] outputs the second vector component. Note that compute reduce can sum the number of each atom to obtain a global scalar and vector.
Fix command can generate global scalar or vector output through thermodynamics, such as the interaction energy between indenter and atom. These values can be in the same format as the aforementioned compute command, such as f_ID and f_ID[N]. As for which fix can calculate the global value that can be output through thermodynamic information, please refer to the manuals of each fix.
The time-average global quantity generated by a fixed ave/time can be output through thermodynamics, such as time-average pressure.
Variables can be defined in the in file, and all other variables can be output through thermodynamic information except atom style variables, because atom style variables will generate values corresponding to each atom. Thermo_style calls a variable named abc in the form of v_abc.
Formulas related to equal style variables can include mathematical operators, functions (such as x+y, x*y, (), sqrt, exp), atomic properties (such as x[N], fx[N]), group functions (such as mass (), vcm ()) and thermodynamic quantities (such as temp, press, vol). Therefore, equation variables are the most common way to define variables calculated and output by thermodynamic information.
Dump file output
The dump file output is specified by the dump command and the dump_modify command. There are many predefined formats, such as dump atom, dump xtc and so on. Similarly, there is also a kind of
The user specifies which attributes of each atom are output in dump custom format. You can specify predefined keywords (such as tag, x, fx) or three other keywords (namely, c_ID, f_ID, v_name, and the corresponding values are provided by the compute, fix and variable commands respectively). The following are described in turn.
The compute command generates one or more values for each atom, which can be defined by dump custom***. The styles of these compute commands include the word atom, such as ke/atom, stress/atom and so on. For the scalar value of each atom, you can use c_myKE to call it; You can use c_myStress[2] to call the component of each atomic value of a vector.
The fix command generates a value that can be output to each atom of the dump file. For example, the fix ave/atom command calculates the time average of each atom's attribute value, just like those commands and atom style variables. The dumpcustom command can use these fixed values of each atom like the compute command mentioned above, such as f_myKE or f_myStress[2].
Variable commands can be used in in files. Only atom-style variables can be used to dump custom output, because only they generate each atomvalue. The dump custom command refers to a variable named abc in the form of v_abc.
Just like equal style variables, formulas related to atom style variables can also include mathematical operators, functions (such as x+y, x*y, (), sqrt, temp), atomic attribute values (such as x[N], fx[N]), group functions (such as press (), vcm ()) and thermodynamic quantities (. In addition, atomic style variables can refer to atomic attribute value vectors (such as x[], fx[], etc.). ), generate compute for each atomic value, fix for each atomic value, and other atomic style variables. Therefore, atomic-style variables are the most common way to define variables calculated and output by dump files.
Repairing output requires special attention to three commands for repairing output: repairing ave/time, repairing ave/spatial and repairing print.
The fix ave/time command can time average any global quantity, such as those thermodynamic information outputs. One or more physical quantities that need time averaging are specified by the user, and these physical quantities can be global quantities obtained by the compute command, global quantities obtained by the fix command or non-atomic variables. Because variables can be related to keywords (such as temp or press) used by thermo_style custom commands, any thermodynamic quantity can be time averaged in this way.
The fix ave/time command provides several options to control how to integrate time. The results it generates can be used in the following two ways. First, the results can be directly written to a file, one line per time step. Note that the averaging parameter can be adjusted so as not to average at all, but only as a convenient way to output the required physical quantities directly to the specified file.
Just like other fixes that generate global quantities, the results of this fix can also be used as input for any other command that can use global quantities, such as thermo_style custom command or variable command.
The fix ave/spatial command can average the number of atoms in space, which is similar to dump file output, except that the latter is equivalent to dividing the simulation box into only one layer. The number per atom can be density (mass density or number density) or properties of atoms, such as position, speed and force, or the value per atom calculated by compute, fix and atom style variables.
The Fixed Average/Space command provides several options to control how spatial averaging is performed. The value of each layer it obtains can be used in the following two ways. First, write directly to the file. Note that the average parameter can be adjusted so that it does not do spatial averaging at all, but just as a convenient way to directly output the required physical quantity (the sum of the corresponding values of all atoms in the 1d layer) to the specified file. Just like other fixes that generate global quantities, the results of this fix can also be used as input for any other command that can use global quantities, such as thermo_style custom command or variable command. As for how to refer to these values, please refer to the manual description of the fix ave/spatial command.
During the simulation process, the fix print command periodically generates a line of output and writes it to a screen and log file or a specified file. The output of this line can include one or more variable values (non-atomic variables). As mentioned earlier, variables themselves can include global quantities generated by keywords, calculation, repair, or other variable commands that reference the thermo_style command. Therefore, the fix print command is different from the normal thermodynamic information output or dump file output, and it outputs any physical quantity expected to be calculated.
The following table summarizes the commands related to various output methods, details their inputs and outputs, and lists the frequency of calling them to complete the output. Generally speaking, two commands can be used as long as their inputs and outputs match. Matching means that the input and output frequencies are exactly the same as the global or per-atom properties. The table has been given, and an example is not repeated to output setforce and group atoms to other interaction forces.
# -
fix3tetras setforce 0.0 0.0 0.0
Variable? fxequal f_3[ 1]
Variable? fy equal F3[2]
Variable? fzequal F3[3]
fix 4 tetras print 1 "-$ { FX } $ { fy } $ { FZ }-"
# -
Thermo Fisher Scientific? 2
thermo_style? User-defined step F3 [1] F3 [1] F3 [1]
#-| xgv 00 | FCC 8d 4d e 8 197 f 69 FDE 70263 fb4d 52380
- Related articles
- What are the five constellations with dragon blood?
- Zhaoqing fortune-telling fraud _ Zhaoqing fortune-telling fraud case
- If people choose not to have children for life, will they be happier?
- How to treat children's "graffiti" well to develop their creative imagination?
- Pucheng Linjiang Fortune Teller _ Linpu Fortune Teller
- Will life get thinner and thinner?
- Monkey 12 zodiac wedding table, which belongs to the monkey, which is the most suitable?
- Dreaming of a girl as a stepmother.
- The correct method of choosing a day in Tiananmen Square
- Pei County Fortune Telling Funny _ Pei County Fortune Telling Funny Event