dump命令
语法:
dump ID group-ID style N files args
iD用户给dump命令定义的名字
group-ID要输出的原子组的名字
style包括atom、atom/mpiio、cfg、cfg/mpiio、dcd、xtc、xyz、xyz/mpiio、movie、molfile、local、custom、custom/mpiio
N 是每N步输出一次
file输出到文件的名字
args对于一些style需要的一些对象
atom无
atom/mpiio无
cfg与custom相同,见下文
cfg/mppio与custom相同,见下文
dcd无
xtc无
xyz无
xyz/mpiio无
image、movie详见dump image命令中
molfile详见dump molfile命令
local包括index、c_ID、c_ID[N]、f_ID,f_ID[N]。
Index为local值列表
C_ID为名字为ID的compute命令计算得到的二维数组
C_ID[N]为名字为ID的compute命令计算得到的二维数组的第N列
F_ID为名为ID的fix命令计算得到的二维数组
F_ID[N]为名为ID的fix命令计算得到的二维数组的第N列
custom或者custom/mpiio包括原子属性的列表
可能包括id、mol、proc、procp1、type、element、mass、x、y、z、xs、ys、zs、xu、yu、zu、xsu、ysu、zsu、ix、iy、iz、vx、vy、vz、fx、fy、fz、q、mux、muy、muz、mu、radius、diameter、omegax、omegay、omegaz、angmomz、angmomy、angmomz、tqx、tqy、tqz、c_ID、c_ID[N]、f_ID、f_ID[N]、v_name
id为原子的名字
mol为分子的名字
proc为拥有原子的处理器的名字
prop1为拥有原子的处理器的名字+1
type为原子的类型
element为原子元素的名字,利用dump_modify 命令定义
mass为原子的质量
x、y、z为unscaled的原子坐标
xs、ys、zs为scaled原子坐标
xu、yu、zu为unwrapped原子坐标
xsu、ysu、zsu为scaled unwrapped原子坐标
ix、iy、iz为原子所在的盒子镜像
Vx、vy、vz为原子速度
fx、fy、fz为原子所受的力
q为原子电荷
mux、muy、muz为原子偶极矩的方向
mu为偶极矩的大小
radius、diameter为球形粒子的半径和直径
omegax、omegay、omegaz为球形粒子的角速度
angmomx、angmomy、angmomz为球形粒子的角动量
tqx、tqy、tqz为有限大小离子的力矩
c_ID = per-atom vector calculated by a compute with ID
c_ID[N] = Nth column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID[N] = Nth column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name
d_name = per-atom floating point vector with name, managed by fix property/atom
i_name = per-atom integer vector with name, managed by fix property/atom
描述:
以某一种类型每N步输出一次原子的参数到一个或多个文件中。Image和movie类型是特殊情况,详见dump_image命令。输出的步数可以由一个变量控制,详见dump_modify every命令。
只有在特定组里的原子的信息能够被输出。Dump_modify thresh 和 region命令能够改变原子是否输出。不是所有的类型都支持这些选项,详见下文。
文件名决定了输出文件的类型(文本文件、二进制文件或压缩文件,一个大文件或者每步输出一个文件,一个大文件或者多个小文件)。
注意:当邻近列表重新建立时,周期性边界条件才会实施,所以写入输出文件的原子坐标有可能稍微超出在盒子的边界。
注意:如果dump_modify sort选项没有被使用,则每个构型的原子信息的写入顺序是不确定的。即使在单个处理器上计算(atom_modify sort选项默认打开),顺序依然是不确定的。在这种情况下,模拟过程中原子的顺序根据空间顺序重新排列。并行运算时,写入顺序同样是不确定的,因为每个构型的原子信息来源于多个处理器,每个处理器又含有很多个原子。
对于atom、custom、cfg和local类型,sorting默认是关闭的。对于dcd、xtc、xyz和molfile类型,默认按照原子的名字进行排序。详见dump_modify命令。
Atom/mpiio, cfg/mpiip, custom/mpiio类型在命令的语法和输出文件的格式上都和没有mpiio的类型完全相同,除非他们产生的单个输出文件通过MPI-IO库由并行计算写入。作为小提醒,可以想到atom和atom/mpiio是可以互换的。The one exception is how the filename is specified for the MPI-IO styles, as explained below.
Style关键字决定了原子的什么属性以什么形式写到文件中。通过dump_modify命令可以修改每个值和文件的格式。
Atom、local和custom类型能够创建简单的文本格式。一些LAMMPS工具能够读取这个格式的文件,包括pizza.py,同样rerun命令也能够读取文本格式。
每个构型中包括模拟盒子的尺寸。对于长方体盒子来说,
ITEM: BOX BOUNDS xx yy zz
xlo xhi
ylo yhi
zlo zhi
其中,xlo,xhi是盒子在x方向的最大范围,y、z与x类似。Xx、yy、zz表示盒子在6个方向的边界条件,这六个字母可以是p=periodic、f=fixed、s=shrink wrap或者m=shrink wrapped with a minimum value.详见boundary命令。
对于三斜盒子For triclinic simulation boxes (non-orthogonal), an orthogonal bounding box which encloses the triclinic simulation box is output, along with the 3 tilt factors (xy, xz, yz) of the triclinic box, formatted as follows:
ITEM: BOX BOUNDS xy xz yz xx yy zz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz
The presence of the text “xy xz yz” in the ITEM line indicates that the 3 tilt factors will be included on each of the 3 following lines. This bounding box is convenient for many visualization programs. The meaning of the 6 character flags for “xx yy zz” is the same as above.
Note that the first two numbers on each line are now xlo_bound instead of xlo, etc, since they repesent a bounding box. See this section of the doc pages for a geometric description of triclinic boxes, as defined by LAMMPS, simple formulas for how the 6 bounding box extents (xlo_bound,xhi_bound,etc) are calculated from the triclinic parameters, and how to transform those parameters to and from other commonly used triclinic representations.
ITEM:ATOMS行列出了每个原子的描述符。例如默认atom的描述符是“id type xs ys zs”,而custom类型的描述符是用户在dump命令中列出的原子属性。
对于atom类型来说,原子的坐标和原子ID和类型写入文件。默认情况下,原子坐标用scaled格式(0-1)写出。可以利用dump_modify命令设置改为unscaled格式。镜像标记(image flags)可以通过dump_modify命令添加到每个原子上。
Custom类型允许用户自己定义写入到输出文件的原子属性。可能的属性已经列在上面,这些属性将会按照定义的顺序显示出来 。你不能设置一个没有定义属性,例如原子类型为bond时没有q属性,因为这种类型不分配电荷。当一步结束的时候才进行输出, 因此原子的属性用到每步中fixes的影响。
对于local类型,
For style local, local output generated by computes and fixes is used to generate lines of output that is written to the dump file. This local data is typically calculated by each processor based on the atoms it owns, but there may be zero or more entities per atom, e.g. a list of bond distances. An explanation of the possible dump local attributes is given below. Note that by using input from the compute property/local command with dump local, it is possible to generate information on bonds, angles, etc that can be cut and pasted directly into a data file read by the read_data command.
Cfg类型的语法和custom的相同,输出CFG格式的文件,可以通过Atomeye查看。因为CFG格式每一个构型产生一个文件,所以“*”必须包括在文件名当中。Cfg类型的原子属性的列表必须以mass type xs ys zs或者mass type xsu ysu zsu开始,这是正确CFG格式的要求。其他的属性将会本存储为“auxiliary properties”补充属性。注意一般情况用户会利用dump_modify element命令来设置对原子类型设置为元素的名字,这样Atomeye能够正确的识别各个原子。当坐标为unwrapped的坐标xsu、ysu、zsu时,Atomeye的周期盒子的尺寸会按照一个大因子扩展UNWRAPEXPAND=10.0,这样能够保证原子对于UNWRAPEXPAND/2个周期性交叉时能够正确显示。除此之外,Atomeye能够对unwrapped的坐标重新wrap。
Dcd类型输出DCD格式文件,一个标准的轨迹文件,可以用于CHARMM,NAMD和XPlor分子动力学模拟的软件包。DCD文件一个二进制文件,因此对不同的机器都兼容。而且DCD格式中,每个构型的原子的数目不能改变。Dump_modify命令中的unwrapped选项能够设置DCD格式中的坐标以unwrapped形式输出。Unwrapped的意思是如果一个原子跨国周期性边界,坐标的数值按照跨出盒子之后的坐标输出,而不是周期性条件下重新进入盒子的坐标。注意这个坐标有可能距离盒子非常远。
Xtc类型是一个压缩的轨迹文件格式,用于GROMACS。XTC文件的精度可以通过dump_modify命令进行调整。默认值为1000,表示坐标保留到1/1000 nm的精度。Xtc是NFS XDR格式的二进制文件,因此任何支持XDR格式的文件都能够读取xtc文件。在xtc文件中每步构型重的原子数目不能改变。Dump_modify命令中的unwrapped选项能够设置xtc格式中的坐标以unwrapped形式输出。Unwrapped的意思是如果一个原子跨国周期性边界,坐标的数值按照跨出盒子之后的坐标输出,而不是周期性条件下重新进入盒子的坐标。注意这个坐标有可能距离盒子非常远。
Xyz类型时间的基于文本的坐标形式。特别的,xyz文件通常含有一行说明原子的个数,然后是一行注释(可以忽略),然后是每个原子一行的原子类型 和坐标。用户可以利用dump_modify element选项来改变按照原子类型输出或者元素名称输出(或者其他方式)。
注意atom,custom,dcd,xtc和xyz类型的输出文件能够直接通过VMD读取。详见关于VMD说明部分
Dump能够在N的整数倍或者优化的最后一步执行。 注意这表明dump不会在初始不执行,如果当前步不是N的整数倍。通过dump_modify first命令可以修改。N值可以再运行过程中通过dump_modify every command修改(不能用于dcd类型)。Dump_modify every命令同样可以设置一个变量决定在那些步进行输出。即使在这种情况下,第一步也不会被输出,除非dump_modify first命令被设置。
特定的文件名决定了输出文件如何输出。默认情况下输出一个大的文本文件,当dump命令被引用是打开,当undump命令被用或者退出LAMMPS时关闭。对于dcd和xtc文件来说,默认生成一个大的二进制文件。
输出的文件名包括练个功通配符。如果*出现在文件名中,那么每个构型输出一个文件,*被步数代替。这个通配符对dcd和xtc不适用。注意dump_modify pad命令可以被用来保证所有的步数的数值的位数相同。
如果%出现在文件名中,那么每个处理器输出一个dump文件,%被处理器ID代替。这种方法可以产生较小的文件,而且能够被支持并行输出的设备快速输出。这个通配符对dcd,xtc和xyz类型不适用。默认,输出的文件个数P为处理器的个数,但是P可以通过dump_modify 的nfile和fileper关键字设置为较小的值,这样可以方便利用大量处理器计算的情况。
注意*和%一起使用会产生大量的小输出文件。
对于atom/mpiio,cfg/mpiio, custom/mpiio 和xyz/mpiio类型来说,通过MPI-IO库输出一个单独的dump文件。与MPI-IO重启文件不同,由MPI-IO产生的dump文件与未用MPI-IO产生的文件完全相同。也就是说,用户可以利用MPI-IO产生输出文件,然后利用read_dump或者其他程序就像没使用MPIIO输出的文件一样进行访问。
注意MPIIO输出文件只有一个包含所有处理器的文件。所以在文件命中不能使用%。
如果文件名以.bin结尾,那么dump文件为二进制格式。这样速度更快。当然再进行读取时,必须利用binary2txt工具将二进制转化成文本文件。这是适用于atom和custom类型。
如果文件名以.gz结尾,那么输出文件为gzip压缩格式。文件的大小约为文本文件的三分之一,但需要花费较长的时间。这不适用于dcd和xtc。
This section explains the local attributes that can be specified as part of the local style.
The index attribute can be used to generate an index number from 1 to N for each line written into the dump file, where N is the total number of local datums from all processors, or lines of output that will appear in the snapshot. Note that because data from different processors depend on what atoms they currently own, and atoms migrate between processor, there is no guarantee that the same index will be used for the same info (e.g. a particular bond) in successive snapshots.
The c_ID and c_ID[N] attributes allow local vectors or arrays calculated by a compute to be output. The ID in the attribute should be replaced by the actual ID of the compute that has been defined previously in the input script. See the compute command for details. There are computes for calculating local information such as indices, types, and energies for bonds and angles.
Note that computes which calculate global or per-atom quantities, as opposed to local quantities, cannot be output in a dump local command. Instead, global quantities can be output by the thermo_style customcommand, and per-atom quantities can be output by the dump custom command.
If c_ID is used as a attribute, then the local vector calculated by the compute is printed. If c_ID[N] is used, then N must be in the range from 1-M, which will print the Nth column of the M-length local array calculated by the compute.
The f_ID and f_ID[N] attributes allow local vectors or arrays calculated by a fix to be output. The ID in the attribute should be replaced by the actual ID of the fix that has been defined previously in the input script.
If f_ID is used as a attribute, then the local vector calculated by the fix is printed. If f_ID[N] is used, then N must be in the range from 1-M, which will print the Nth column of the M-length local array calculated by the fix.
Here is an example of how to dump bond info for a system, including the distance and energy of each bond:
compute 1 all property/local batom1 batom2 btype
compute 2 all bond/local dist eng
dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_2[1] c_2[2]
下面这部分介绍custon和cfg类型中的属性
id、mol、proc、procp1、type、element、mass、vx、vy、vz、fx、fy、fz、q属性比较清楚。
id是原子的id。Mol是分子的id,包括在数据文件中。Proc是拥有原子的处理器的id。Procp1是处理器id+1,对于利用type属性来设置原子颜色的情况非常实用。Type是原子的类型。Element一般是元素的化学名称,必须通过dump_modify element明镜进行分配。另外,element可以是任意字符串。Mass是原子质量。vx、vy、vz、fx、fy、fz、q是原子速度、受力和电荷。
这里有多个与原子坐标相关的选项。X、y、z属性输出unscaled坐标,单位为距离的单位(Angstrom,sigma, etc)。xs、ys、zs输出scaled(归一化)坐标,0-1. Xu、yu、zu输出unwrapped坐标。Unwrapped的意思是如果一个原子跨国周期性边界,坐标的数值按照跨出盒子之后的坐标输出,而不是周期性条件下重新进入盒子的坐标。注意这个坐标有可能距离盒子非常远。Xsu、ysu、zsu是scaled和unwrapped的坐标。
ix、iy、iz可以输出image flags(镜像标记)。对于周期性结构来说,他们决定了原子所在的镜像盒子。当image为0时表示在定义的盒子中,当image为2时,表明加两个盒子的长度是真实的值。值为-1时表明减一个盒子的长度是真实的值。当模拟过程中原子跨越边界时,LAMMPS自动更新image flags。
Mux、muy、muz属性是具有偶极矩的原子类型的偶极矩。Mu为原子偶极矩的大小。
Radius和diameter是具有有限大小的球形粒子的半径和直径,例如原子理性为sphere。
Omegax、omegay、omegaz属性为有限大小球形粒子的角速度。只有特定的原子类型具有这个属性,例如sphere。
Angmomx、angmomy和angmomz属性为有限大小球形粒子的角动量。只有ellipsoid原子类型具有这个属性。
tqx、tqy、tqz属性为有限大小粒子与其他粒子组成的转动力矩。
c_ID和c_ID[N]属性输出有compute计算得到的每个原子的向量或数组。ID是compute命令的真实id。详见compute命令。可计算的量包括每个原子的能量、力、中心对称参数和每个原子的坐标数。
注意当compute计算出的是全局和局部量,而不是原子量时,不能被dump custom命令输出。全局量可以通过thermo_style custom命令输出,局部变量可以通过dump local命令输出。
使用c_ID可以输出计算得到的每个原子的向量。使用c_ID[N]可以输出每个原子数组中的第N列。
f_ID和f_ID[N]属性输出有fix计算得到的每个原子的向量或数组。ID是fix命令的真实id。Fix ave/atom命令可以计算每个原子的量。因为它能够将compute,fix,或者任何原子类型的变量进行时间平均。最后将结果输出。
使用f_ID可以输出计算得到的每个原子的向量。使用f_ID[N]可以输出每个原子数组中的第N列。
v_name属性输出被变量计算得到的每个原子的向量。需要用真实的向量名称进行替换。只有原子类型的变量能够被引用,因为只有原子类型的变量才能产生每个原子的量。变量可以引用单个原子量、每个原子属性、热动力学关键字或者其他computer、fix或者variable命令,所以可以利用多种方法产生结果用以输出。
d_name和i_name属性可以输出有fix property/atom控制的浮点型和整数型参数。