sum是对组内原子相应的变量的求和,返回一个总和,min和max返回的是组内的最小值。 如果只有一个input,返回一个标量,如果多个inpu,返回的是多分量的矢量。
compute ID group?ID stress/atom (keyword= ke/pair/bond/angle/dihedral/improper/kspace/fix)
compute peratom all stress/atom
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3] variable press equal ?(c_p[1]+c_p[2]+c_p[3])/(3*vol) thermo_style custom step temp etotal press v_press
计算组内每个原子的应力张量,包含6个分量,sxx,syy,szz,szy,sxz,syz,用1-6来表示。
compute_modify compute?ID keyword value
keyword = extra or dynamic
extra value = N,N of extra degrees of freedom to subtract
dynamic value = yes or no,do or do not recompute the number of atoms contributing to the temperature thermo value = yes or no,yes/no = do or do not add contributions from fixes to the potential energy
compute ID group?ID temp
计算组内原子的温度。
compute ID group?ID temp/com
计算组内原子的温度,减去质心速度。
compute ID group?ID temp/deform
计算组内原子的温度,减去晶胞形状带来的影响。
compute ID group?ID temp/partial xflag yflag zflag
计算组内原子的温度,减去质心速度的特定分量带来的影响。xflag,yflag,zflag=1/0
compute ID group?ID temp/ramp vdim vlo vhi dim clo chi keyword value
计算组内原子的温度,减去特定的速度梯度。
compute ID group?ID temp/region region?ID
计算某一区域的温度。
uncompute compute-ID
删除一个compute,这同样也会删除由compute_modify带来的影响。
7. 势函数
pair_style
? pair_style none ? turn off pairwise interactions
21
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?
? ? ? ? ? ? ?
?
pair_style hybrid ? multiple styles of pairwise interactions
pair_style hybrid/overlay ? multiple styles of superposed pairwise interactions pair_style airebo ? AI?REBO potential
pair_style born/coul/long ? Born?Mayer?Huggins with long?range Coulomb pair_style buck ? Buckingham potential
pair_style buck/coul/cut ? Buckingham with cutoff Coulomb
pair_style buck/coul/long ? Buckingham with long?range Coulomb pair_style colloid ? integrated colloidal potential pair_style coul/cut ? cutoff Coulombic potential
pair_style coul/debye ? cutoff Coulombic potential with Debye screening pair_style coul/long ? long?range Coulombic potential pair_style dipole/cut ? point dipoles with cutoff
pair_style dpd ? dissipative particle dynamics (DPD) pair_style eam ? embedded atom method (EAM) pair_style eam/opt ? optimized version of EAM pair_style eam/alloy ? alloy EAM
pair_style eam/alloy/opt ? optimized version of alloy EAM pair_style eam/fs ? Finnis?Sinclair EAM
pair_style eam/fs/opt ? optimized version of Finnis?Sinclair EAM pair_style gayberne ? Gay?Berne ellipsoidal potential
pair_style gran/hertz/history ? granular potential with Hertzian interactions pair_style gran/hooke ? granular potential with history effects
pair_style gran/hooke/history ? granular potential without history effects
pair_style lj/charmm/coul/charmm ? CHARMM potential with cutoff Coulomb pair_style lj/charmm/coul/charmm/implicit ? CHARMM for implicit solvent pair_style lj/charmm/coul/long ? CHARMM with long?range Coulomb
pair_style lj/charmm/coul/long/opt ? optimized version of CHARMM with long?range Coulomb pair_style lj/class2 ? COMPASS (class 2) force field with no Coulomb pair_style lj/class2/coul/cut ? COMPASS with cutoff Coulomb
pair_style lj/class2/coul/long ? COMPASS with long?range Coulomb pair_style lj/cut ? cutoff Lennard?Jones potential with no Coulomb pair_style lj/cut/opt ? optimized version of cutoff LJ pair_style lj/cut/coul/cut ? LJ with cutoff Coulomb
pair_style lj/cut/coul/debye ? LJ with Debye screening added to Coulomb pair_style lj/cut/coul/long ? LJ with long?range Coulomb
pair_style lj/cut/coul/long/tip4p ? LJ with long?range Coulomb for TIP4P water pair_style lj/expand ? Lennard?Jones for variable size particles pair_style lj/gromacs ? GROMACS?style Lennard?Jones potential
pair_style lj/gromacs/coul/gromacs ? GROMACS?style LJ and Coulombic potential pair_style lj/smooth ? smoothed Lennard?Jones potential pair_style lubricate ? hydrodynamic lubrication forces
pair_style meam ? modified embedded atom method (MEAM) pair_style morse ? Morse potential
pair_style morse/opt ? optimized version of Morse potential pair_style peri/pmb ? peridynamic PMB potential pair_style reax ? ReaxFF potential
pair_style resquared ? Everaers RE?Squared ellipsoidal potential pair_style soft ? Soft (cosine) potential
pair_style sw ? Stillinger?Weber 3?body potential pair_style table ? tabulated pair potential pair_style tersoff ? Tersoff 3?body potential
pair_style tersoff/zbl ? Tersoff/ZBL 3?body potential pair_style yukawa ? Yukawa potential
pair_style tersoff
pair_style tersoff
pair_coeff * * WH.tersoff W H
22
tersoff势,tersoff势参数从WH.tersoff读取,包含两种元素WH
E?1Vij, Vij?fC(rij)[fR(rij)?bijfA(rij)], fR(rij)?Aexp(??1r), fA(rij)??Bexp(??2r) ??2ii?j?1,r?R-D?11?r?R?fC(r)???sin(),R?r?D
2D?22r?R?D0,??bij?(1???)nnij?12nc2c2, ?ij??fC(rik)g(?)exp[) ?(rij?rik)], g(?)??ijk(1?2?22dd?(cos??cos?)k(?i,j)0m3m每一行格式:特别注意每一行中R,D为I-K元素间的R,D。注意元素名称与pair_coeff一致。
element 1, element 2, element 3,m, gamma, lambda3, c, d, costheta0, n, beta, lambda2, B, R, D, lambda1, A # Tersoff parameters for various elements and mixtures # multiple entries can be added to this file, LAMMPS reads the ones it needs # these entries are in LAMMPS \# A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms # other quantities are unitless # format of a single entry (one or more lines): # element 1, element 2, element 3, # m, gamma, lambda3, c, d, costheta0, n, beta, lambda2, B, R, D, lambda1, A # The following GaN potential is from J. Nord, K. Albe, P. Erhart # and K. Nordlund, J. Phys.: Condens. Matter, 15, 5649(2003). # This file is from Xiaowang Zhou, xzhou @ sandia.gov Ga Ga Ga 1.0 0.007874 1.846 1.918000 0.75000 -0.301300 1.0 1.0 1.44970 410.132 2.87 0.15 1.60916 535.199 N N N 1.0 0.766120 0.000 0.178493 0.20172 -0.045238 1.0 1.0 2.38426 423.769 2.20 0.20 3.55779 1044.77 Ga Ga N 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 0.00000 0.00000 2.90 0.20 0.00000 0.00000 Ga N N 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 2.63906 3864.27 2.90 0.20 2.93516 6136.44 N Ga Ga 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 2.63906 3864.27 2.90 0.20 2.93516 6136.44 N Ga N 1.0 0.766120 0.000 0.178493 0.20172 -0.045238 1.0 1.0 0.00000 0.00000 2.20 0.20 0.00000 0.00000 N N Ga 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 0.00000 0.00000 2.90 0.20 0.00000 0.00000 Ga N Ga 1.0 0.007874 1.846 1.918000 0.75000 -0.301300 1.0 1.0 0.00000 0.00000 2.87 0.15 0.00000 0.00000
kspace_style
Define a K?space solver for LAMMPS to use each timestep to compute long?range Coulombic interactions or long?range 1/r^N interactions.
kspace_modify
pair_write itype jtype N r/rsq/bitmap inner outer file keyword Qi Qj
pair_write 1 3 500 r 1.0 10.0 table.txt LJ
pair_write 1 1 1000 rsq 2.0 8.0 table.txt Yukawa_1_1 ?0.5 0.5
计算两种原子间的对势势函数。其中itype,jtype为原子种类,N为计算点,r/rsq/bitmap为计算间隔方法,inner,outer为计算的截断距离,file为输出文件名,keyword为文件中的注释名,Qi,Qj 为ij电荷(可选)
23
8. 运行
run N upto/start/stop/pre/post/every values
run 10000
run 1000000 upto
run 100 start 0 stop 1000 run 1000 pre no post yes
run 100000 start 0 stop 1000000 every 1000 print \run 100000 every 1000 NULL
upto:从现在开始,总共运行N步。
start N1/stop N2:对于多个运算,总的起始步和结束步,可以影响fix pre/post yes/no:是否进行前期设置和后期分析
every M cmd:每M步运行后面的命令。将会中断计算执行后面命令,再重新开始计算。这个会变成N/M个计算。NULL表示空命令。
default:pre=yes; post=yes
run_style verlet/respa(args) run_style决定用什么算法。
respa: rRESPA multi?timescale integrator (Tuckerman) run_style verlet: velocity-verlet。(default)
run_style respa 4 2 2 2 bond 1 dihedral 2 pair 3 kspace 4
run_style respa 4 2 2 2 bond 1 dihedral 2 inner 3 5.0 6.0 outer 4 kspace 4
minimize etol ftol maxiter maxeval
minimize 1.0e?4 1.0e?6 100 1000 minimize 0.0 1.0e?8 1000 100000 minimize etol ftol maxiter maxeval 能量最小化,驰豫,分子静力学。
etol能量收敛精度,ftol力收敛精度,maxiter最大迭代次数,maxeval最大评估数 minimize 与初始温度设置无关。
min_style cg/sd
default= min_style cg
最小化算法,cg=conjugate gradient共轭梯度,sd=steepest descent最速下降。
min_modify dmax 0.2 (default=0.1)
最小化算法中,原子最大移动距离。
temper
clear
(commands for 1st simulation) clear
(commands for 2nd simulation)
重新开始另一个任务,将删除所有原子,重置所有设置,释放内存。用于在一个in文件里运行多个任务。 以下设置不会被影响:计算路径,log状态,变量,echo状态
24
9. 其他
variable name delete/index/loop/world/universe/uloop/equal/atom
variable x index run1 run2 run3 run4 run5 run6 run7 run8 variable LoopVar loop $n variable beta equal temp/3.0
variable b1 equal x[234]+0.5*vol variable b1 equal \variable b equal xcm(mol1,x)/2.0 variable b equal c_myTemp variable b atom x[]*y[]/vol
variable temp world 300.0 310.0 320.0 ${Tfinal} variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 variable x uloop 15 variable x delete
定义一个变量。并给变量赋值。变量定义后不会立即赋值,特别注意变量不能多次定义,当变量循环完成后,将删除变量。变量与junp结合,可以实现循环。引用变量:多字符${LoopVar};单字符$i。 index string1 string2:定义一个变量等于一系列值。 loop N:定义变量为一系列整数,从1-N。
world/universe/uloop:并行计算为不同CPU使用不同变量。 delete:删除变量。
循环实现方法: variable a loop 10 label loop [commands] next a jump in loop equal/atom:给变量赋予给定的表达式,equal计算平均值,atom对每个原子都计算,可能的值和操作如下表。 thermo keywords可以接受和thermo_style custom里已有的格式。 group里面,dim=x, y, z; dir=xmin, xmax, ymin, ymax, zmin, zmax. 其中count()为原子数,mass()为总质量,其他类似。 Number 0.2, 100, 1.0e20, ?15.4, etc Thermo keywords vol, pe, ebond, etc Math operations (), ?x, x+y, x?y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), ceil(x), floor(x), round(x) Group functions count(ID), mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID) Region functions count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR) Atom values mass[N], type[N], x[N], y[N], z[N], vx[N], vy[N], vz[N], fx[N], fy[N], fz[N] Atom vectors mass[], type[], x[], y[], z[], vx[], vy[], vz[], fx[], fy[], fz[] Compute refer-c_ID, c_ID[2], c_ID[N], c_ID[N][2], c_ID[], c_ID[][2] ences Fix references f_ID, f_ID[2], f_ID[N], f_ID[N][2], f_ID[], f_ID[][2] Other variables v_abc, v_abc[N], v_abc[] 对于compute的引用说明如下表。 c_ID scalar value of a global compute c_ID[2] vector component of a global compute c_ID[N] single atom's scalar value of a per?atom compute c_ID[N][M] single atom's vector component of a per?atom compute 25
百度搜索“70edu”或“70教育网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,70教育网,提供经典综合文库lammp中文手册(5)在线全文阅读。
相关推荐: