lammp中文手册(4)

来源:网络收集 时间:2025-08-15 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xuecool-com或QQ:370150219 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

fix ID group?ID lineforce x y z

fix hold boundary lineforce 0.0 1.0 1.0

调整组内原子的力,使其只保留沿着线方向的力分量。

fix ID group?ID drag x y z fmag delta

对组内每个原子施加一个力,使其拖向x,y,z点,fmag为力的大小,如果原子和xyz距离小于delta,则不再施加力。NULL表示计算距离时不含该方向,不改变改方向原子的力。

fix ID group?ID momentum N linear/angular values ... fix 1 all momentum 1 linear 1 1 0

fix 1 all momentum 100 linear 1 1 1 angular

N = adjust the momentum every this many timesteps one or more keyword/value pairs may be appended linear values = xflag yflag zflag. xflag,yflag,zflag = 0/1 to exclude/include each dimension 每隔N步,减去质心的xyz分速度和角速度。防止体系平动或转动。

fix ID group?ID planeforce x y z

fix ID group?ID orient/fcc nstats dir alat dE cutlo cuthi file0 file1 fix ID group?ID setforce fx fy fz

计算特定量

fix ID group?ID com N file

每隔N步计算组内原子质心,输出到特定的文件中。

fix ID group?ID gyration N file fix 1 all gyration 100 molecule.out

每隔N步计算组内原子的回旋半径。

fix ID group?ID coord/original

储存声明fix时原子的坐标。用于通过compute displace/atom计算原子的位移,原始坐标以unwrapped形式储存。

fix ID group?ID msd N file keyword value ... fix 1 all msd 100 diff.out

fix 1 all msd 1000 diff.out com yes

N = compute mean?squared displacement(均方位移) every this many timesteps file = filename to write mean?squared displacement info to keyword = com, com value = yes or no

计算组内原子的均方位移。从而可以计算扩散系数。

fix ID group?ID rdf N file Nbin itype1 jtype1 itype2 jtype2 ...

fix ID group?ID ave/atom Nevery Nrepeat Nfreq value1 value2 fix 1 all ave/atom 1 100 100 vx vy vz

fix 1 all ave/atom 10 20 1000 c_my_stress1

每隔N步计算原子的特定的平均值,Nrepeat是取平均的个数。

Nevery = calculate property every this many timesteps,每隔Nevery步计算value。 Nrepeat = # of times to repeat the Nevery calculation before averaging,计算平均值之前,要重复Nrepeat次间隔Nevery步的计算。

16

Nfreq = timestep frequency at which the average value is calculated,每隔多少步计算一次平均值。 value = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name

计算的是组内每个原子的平均量量,可以列多个值,每个值将会分别计算平均值。

fix ID group?ID ave/spatial Nevery Nrepeat Nfreq dim origin delta value1 value2 ... keyword args ... dim = x or y or z

origin = lower or center or upper or coordinate value (distance units) delta = thickness of spatial layers in dim (distance units) units arg = box or lattice or reduced norm arg = all or sample

file arg = filename, filename = file to write results to

ave args = one or running or window M, one = output new average value every Nfreq steps, running = output cumulative average of all previous Nfreq steps, window M = output average of M most recent Nfreq steps 用于计算几个时间步的瞬态单原子属性(per-atom quantities),并在选定的维度上按“层”平均,再将“层属性”(layer values)在较长时间尺度上平均。平均值可以被用于其他的输出命令(比如thermo_style custom),或者写入文件。每个列出的属性值是独立计算其平均值得。

Nevery,Nrepeat和Nfreq参数指明用于平均的层属性在哪些时间步计算。最终的平均值每Nfreq步产生一次。由相隔Nevery个时间不的Nrepeat个值平均得到。因此,Nfreq必须是Nevery的整数倍,Nevery必须非零(即使Nrepeat为1,Nevery也必须非零)。同时,用于计算两个相邻平均值的时间步不能重叠,即必须满足Nfreq > (Nrepeat-1)*Nevery。 例如,如果Nevery=2, Nrepeat=6, Nfreq=100,这意味着时间步100的值由时间步90, 92, 94, 96, 98, 100做平均得到。同样地,时间步200的值由时间步190, 192, 194, 196, 198, 200做平均得到。如果Nrepeat=1, Nfreq=100,则不做时间平均,命令产生的值仅仅是时间步100, 200的值。

每个单原子属性的平均是在一层原子中进行的。层是指在特定的维度dim上厚度为delta的区域。每隔Nfreq时间步,当平均开始执行,也就是单原子属性第一次计算的时候,层的数目和边界(limey:按照层的定义,一个box中有很多层)被计算出来。因此,如果模拟的过程中simulation box的大小发生改变,层的数目和边界也会发生改变。层的位置定义到相对于一个指定的原点(origin),原点可以是box在dim维度的上/下边界(upper/lower)、中心点(center)或者一个指定的坐标值。从原点(origin)开始,创建足够多的层用以充满整个box。在接下来的计算中,每个原子映射到一个层,超过最低/最高层的原子被计入最低/最高层。(limey:既然层已经充满了整个box,怎么会有超出的原子呢?——或者解释就是创建层就像搭积木一样,边界上的层不超出box,这样边界总可能有原子不在层里,如果box不能被划分为整数个层的话。另外,从描述上看,每个平均原子的层信息是不被记录的。) 对于立方simulation box,层是沿xyz坐标轴排列的切片。对于非立方(三斜)box,层是平行于box的斜面的斜切片。参见LAMMPS手册的region prism命令关于非立方box的讨论。设非立方box的边矢量为a,b,c。则x维层的层面与bXc(limey:向量叉乘)垂直;y维层的层面与aXc垂直;z维层的层面与aXb垂直。注意:为了准确定义层的位置和厚度,对于非立方box,units选项必须设成reduced。

file关键字允许指定一个文件名。每Nfreq时间步,层的信息按照下列格式以文本的形式写入文件。第一行记下时间步和层数,下面写下层的信息,一行一层,包括层号(1-N),层中心点的坐标,层内原子数,一个或多个计 算值。每行有多少个数值取决于fix ave/spatial命令行中指定的值的数目。层内原子数和计算值是平均值。如果units关键字是box或lattice,输出的坐标值的单位为 units命令指定的单位。如果units关键字是reduced,输出的坐标值是归一化的。

ave关键字指明在将计算出的平均值打印到文件之 前,当前步计算出的ave/spatial平均值如何用前面输出的平均值求平均。(limey:每Nfreq步输出平均值,如果时间步是Nfreq的倍 数,则该时间步是输出结果的时间步,暂且叫它输出步。lammps在每个输出步将计算结果写入文件,ave关键字表明lammps不仅能对(n-1)*Nfreq时间步到n*Nfreq时间步的状态量进行平均,还可以调出以前的计算结果进行平均。)

如果ave设为one,则每个“输出步”都是独立输出结果的(这样的输出步没有记忆)。

如果ave设为running,则输出步的计算值还要与以前输出的计算值进行平均。这个时候每个层属性是之前写入文件的所有输出步的同一层的属性值。running平均从fix定义的那个时刻开始,要想从新开始平均,只能用unfix命令删掉这个fix,或者重新定义这个fix。

如果ave设为window,则输出步的计算值还要与指定的window时间窗中的计算值平均,因此需要重读M个值才能生成当前输出步的层属性。例如:如果M=3、Nfreq=1000,第10000步是一个输出步,这个输出步的输出结果是8000、9000、10000步各层的平均值。如果输出步太早(limey:没有足够的输出步在窗口里),则平均将在少于M个值上进行。

17

fix ID group?ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ... file arg = filename, filename = name of file to output time averages to

ave args = one or running or window M, one = output a new average value every Nfreq steps, running = output cumulative average of all previous Nfreq steps, window M = output average of M most recent Nfreq steps start args = Nstart, Nstart = start averaging on this timestep

把全局量进行时间平均,然后将数据输出到一个文档里,方便后处理的数据提取。

模拟晶胞的控制

fix ID group?ID deform N parameter args ... keyword value ... 改变晶胞的体积和形状

fix ID group?ID deposit N type M seed keyword values ...

沉积原子:每隔M步插入一个原子,直到N个为止。type为原子类型。

keyword = region or global or local or near or attempt or rate or vx or vy or vz or units

fix ID group?ID pour N type seed keyword values ...

fix ID group?ID indent k keyword values ...

fix 1 all indent 10.0 sphere 0.0 0.0 15.0 3.0 vel 0.0 0.0 ?1.0 fix 2 flow indent 10.0 cylinder z 0.0 0.0 10.0 units box 在模拟晶胞中产生一个“钻头”,任何接触这个钻头的原子都会弹回去。

fix ID group?ID recenter x y z keyword value ...

fix ID group?ID wall/gran Kn Kt gamma_n gamma_t xmu dampflag wallstyle args keyword values ... fix ID group?ID wall/lj126 style coord epsilon sigma cutoff keyword values ... fix ID group?ID wall/lj93 style coord epsilon sigma cutoff keyword values ... fix ID group?ID wall/reflect keyword ...

fix ID group?ID wiggle dim amplitude period

模拟过程的控制

fix ID group?ID dt/reset N Tmin Tmax Xmax keyword values ... fix 5 all dt/reset 10 1.0e?5 0.01 0.1

fix 5 all dt/reset 10 0.01 2.0 0.2 units box

每隔N步重设模拟时间步长,Tmin为允许的最小步长,Tmax为最大步长,Xmax为允许原子最大移动距离。 keyword:units value = lattice or box

fix ID group?ID poems keyword values fix ID group?ID rigid keyword values fix ID group?ID spring keyword values fix ID group?ID spring/rg K RG0 fix ID group?ID spring/self K

fix ID group?ID smd type values keyword values

fix ID group?ID thermal/conductivity N edim Nbin keyword value ... fix ID group?ID tmd rho_final file1 N file2

fix ID group?ID viscosity N vdim pdim Nbin keyword value ... fix ID group?ID viscous gamma keyword values ...

fix ID group?ID print N string keyword value ...

18

unfix fix-id

删除之前定义的fix,同样也会清除fix_modify带来的更改。

6. COMPUTE

compute ID group?ID style args

lamps里面,compute有别于fix,compute主要是针对一组原子,根据调用compute时刻的状态做一些特定的计算,计算的都是瞬时值,分为两类:一类计算全局量,另一类是每个原子的量,这类在compute里都带有atom字样。

compute可以被以下命令调用:thermo_style, fix ave/time, variable。 输出compute计算值:dump, fix ave/spatial, fix ave/atom.

compute-ID只能包含字母数字下划线。列表是目前lammps支持的compute。 ? centro/atom ? centro?symmetry parameter for each atom ? cna/atom ? common neighbor analysis (CNA) for each atom ? coord/atom ? coordination number for each atom ? damage/atom ? Peridynamic damage for each atom ? displace/atom ? displacement of each atom

? erotate/asphere ? rotational energy of aspherical particles ? erotate/sphere ? rotational energy of spherical particles ? group/group ? energy/force between two groups of atoms ? heat/flux ? heat flux through a group of atoms ? ke ? translational kinetic energy

? ke/atom ? kinetic energy for each atom ? pe ? potential energy

? pe/atom ? potential energy for each atom ? pressure ? total pressure and pressure tensor

? reduce ? combine per?atom quantities into a single global value ? reduce/region ? same as compute reduce, within a region ? stress/atom ? stress tensor for each atom ? temp ? temperature of group of atoms

? temp/asphere ? temperature of aspherical particles

? temp/com ? temperature after subtracting center?of?mass velocity ? temp/deform ? temperature excluding box deformation velocity

? temp/partial ? temperature excluding one or more dimensions of velocity ? temp/profile ? temperature excluding a binned velocity profile ? temp/ramp ? temperature excluding ramped velocity component ? temp/region ? temperature of a region of atoms ? temp/sphere ? temperature of spherical particles

compute ID group?ID ackland/atom

判断晶体结构,通过近邻原子与中心原子的角度关系来判断,因此在有温度的情况下,也能正确的判断出晶体结构。每个原子都会计算, 返回值:0 = UNKNOWN,1 = BCC,2 = FCC,3 = HCP,4 = ICO 属于user?ackland安装包,返回值标量,不属于组内原子的返回值为0

compute ID group?ID centro/atom

计算每个原子的晶体对称性,对fcc结构,

,因此p=0表示原子周围正常,p!=0表示原子周围有缺陷。

返回值标量,不属于组内原子的返回值为0

19

compute ID group?ID coord/atom cutoff

计算组中每个原子配位数。即cutoff内近邻原子的数目,返回值标量,不属于组内原子的返回值为0

compute ID group?ID damage/atom

计算组内每个原子的缺陷情况,参照PDLAMMPS.pdf,属于peri软件包,返回值标量,不属于组内原子的返回值为0

compute ID group?ID displace/atom fix?ID

计算组内每个原子相对于初始位置的位移,初始位置通过fix-ID所指明的fix cord/original命令存储。输出当前时刻坐标相对于初始位置的位移。

返回值为4分量矢量,1-3=x,y,z位移,4=总位移。不属于组内原子的返回值为0

compute ID group?ID group/group group2?ID

计算两组原子间的总能量和力。只考虑对势,对于三体势不适应。

返回值为一个标量,等于相互作用能量流,一个3分量矢量,表示相互作用力。

compute ID group?ID ke

计算组内原子的总动能,ke=sum(0.5*m*v^2)

返回值为一个标量,注意这个动能和thermo里输出的ke可能有区别,那个KE=0.5*Kb*T,如果温度是用默认的compute temp计算,两者一直,否则两者可能存在细微差别。

compute ID group?ID ke/atom

计算组内每个原子的平动能,ke=0.5*m*v^2,返回值标量,不属于组内原子的返回值为0

compute ID group?ID pe (keyword=pair/bond/angle/dihedral/improper/kspace)

计算组内原子的总势能,group?ID必须是all,如果没有keyword,默认会计算所有的能量,如果有特定的keyword,只会计算keyword指定部分的能量。返回值为一个标量。

compute ID group?ID pe/atom (keyword=pair/bond/angle/dihedral/improper)

计算组内每个原子的势能,如果没有keyword,默认会计算所有的能量,如果有特定的keyword,只会计算keyword指定部分的能量。对于多体作用产生的能量,单个原子的势能只取所部分(比如对势/2,三体势/3)。返回值标量,不属于组内原子的返回值为0

compute ID group?ID pressure temp?ID keyword=ke/pair/bond/angle/dihedral/improper/kspace/fix

计算整个体系的压强,group?ID必须为all,temp-ID为计算温度的compute-ID。

N为原子数,Kb为波尔兹曼常数,T为系统温度,V为体积,ri为原子坐标矢量,f为原子力矢量,d是系统的维度。 同时也会计算6个内应力:pxx,pyy,pzz,pxy,pxz,pyz。

返回一个标量,压强,一个6分量矢量,分布对于6个内应力。

compute ID group?ID reduce mode=sum/min/max input1 input2 …

input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name

定义一个reduce,对组内所有原子执行这个reduce,包括sum/min/max,后面可以接多个变量。

20

百度搜索“70edu”或“70教育网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,70教育网,提供经典综合文库lammp中文手册(4)在线全文阅读。

lammp中文手册(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.70edu.com/wenku/346812.html(转载请注明文章来源)
Copyright © 2020-2025 70教育网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:370150219 邮箱:370150219@qq.com
苏ICP备16052595号-17
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:7 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219