




免费预览已结束,剩余23页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
lammps简要使用说明李小椿北京航空航天大学物理科学与核能工程学院更新于:2010年2月1日星期一目录lammps简要使用说明1LAMMPS介绍4文件41.系统初始化4units lj/real/metal/si/cgs4atom_style angle/atomic/bond/charge/dipole/dpd/ellipsoid/full/granular/molecular/hybrid5atom_modify map/first5dimension N ,N=2/35boundary x y z, default=boundary p p p5newton flag/flag1 flag25communicate single/multi group/cutoff5processors Px Py Pz62.创建模拟晶胞6lattice none/sc/bcc/fcc/hcp/diamond/sq/sq2/hex/custom scale keyword values6region ID style block/cylinder/prism/sphere/union/intersect args keyword value6group ID region/type/id/molecule/subtract/union/intersect6create_box N regionID7create_atoms type box/region/single args keyword values7delete_atoms group/region/overlap/porosity args7read_restart file/read_date file7set atom/group/region ID keyword values8displace_atoms groupID move/ramp/random args keyword value8displace_box groupID parameter args . keyword value 9change_box ortho/triclinic9replicate nx ny nz93.设置9mass I value9velocity groupID create/set/scale/ramp/zero args keyword value9timestep dt10reset_timestep N10neighbor skin bin/nsq/multi10neigh_modify keyword values104.输出10dump ID groupID bond/dcd/xtc/xyz/custom N file args10dump_modify dumpID format/scale/image/flush/unwrap/every/precision/region/thresh values11undump dumpID11thermo_style one/multi/custom(args)11thermo_modify lost/norm/flush/line/format/temp/press value12thermo N12print string12restart N root13write_restart file13echo none/screen/log/both13log filename135.FIX13fix ID groupID style args13系综相关15力和速度的控制15计算特定量16模拟晶胞的控制18模拟过程的控制18unfix fix-id196.COMPUTE19compute ID groupID style args19compute ID groupID ackland/atom19compute ID groupID centro/atom19compute ID groupID coord/atom cutoff20compute ID groupID damage/atom20compute ID groupID displace/atom fixID20compute ID groupID group/group group2ID20compute ID groupID ke20compute ID groupID ke/atom20compute ID groupID pe (keyword=pair/bond/angle/dihedral/improper/kspace)20compute ID groupID pe/atom (keyword=pair/bond/angle/dihedral/improper)20compute ID groupID pressure tempID keyword=ke/pair/bond/angle/dihedral/improper/kspace/fix20compute ID groupID reduce mode=sum/min/max input1 input2 20compute ID groupID stress/atom (keyword= ke/pair/bond/angle/dihedral/improper/kspace/fix)21compute_modify computeID keyword value21compute ID groupID temp21compute ID groupID temp/com21compute ID groupID temp/deform21compute ID groupID temp/partial xflag yflag zflag21compute ID groupID temp/ramp vdim vlo vhi dim clo chi keyword value21compute ID groupID temp/region regionID21uncompute compute-ID217.势函数21pair_style21pair_style tersoff22kspace_style23kspace_modify23pair_write itype jtype N r/rsq/bitmap inner outer file keyword Qi Qj238.运行24run N upto/start/stop/pre/post/every values24run_style verlet/respa(args)24minimize etol ftol maxiter maxeval24min_style cg/sd24min_modify dmax 0.2 (default=0.1)24temper24clear249.其他25variable name delete/index/loop/world/universe/uloop/equal/atom25next variables26jump file label26label string26if value1 operator value2 then command1 else command226include filename27shell cd/mkdir/mv/rm/rmdir2710.模拟方法论27缺陷的生成27晶格常数27迁移27表面28立方晶系弹性常数2828LAMMPS介绍LAMMPS= Large-scale Atomic/Molecular Massively Parallel Simulator. Sandia National Laboratories命令行选项:-in file输入文件;-log file 输出文件;-screen file屏幕输出文件;-echo style,输入文件内容是否输出到输出文件和屏幕,style=none/screen/log/both (default=log)。特点:免费,C+,并行,集成大量势函数并行:mpirun -nolocal -machinefile node -np $ncpu /opt/lammps/lmp_mpi -in in -screen log.screen &串行:/opt/lammps/lmp in.lammps串行:/opt/lammps/lmp -screen log.screen -in in文件in.*文件:输入文件,控制整个计算过程。每一非空行都被认为是一条命令(大小写敏感,极少有命令或参数大写的)。读入一行执行一行,有些命令在其他命令后有效,有些命令要用到其他命令的输出, in文件中各命令的顺序可能会对计算产生影响,但大部分情况下不会有影响。每行后的“&” 表示续行(类似fortran)。“#”表示注释(类似bash)。每行命令中的不同字段由空格或者制表符分隔开来,每个字段可以由字母、数字、下划线、或标点符号构成。每行命令中第一个字段表示命令名,之后的字段都是相关的参数。提醒:注意单位。命令使用时一定一定要注意他们的默认设置,否则错了你都找不到北。很多命令都是在需要修改默认值的情况下才特别设置的。log.lammps:记录了整个计算过程屏幕上显示的所有信息。dump文件:输出应力、能量、原子位置、速度等,由dump命令控制输出文件。restart文件:断点续算文件,由write_restart命令控制。1. 系统初始化units lj/real/metal/si/cgsdefault=units ljunits定义单位系统,该命令定义了input里所有变量的单位。UnitsRealMetalSicgslj质量g/molg/molKgGmass or m距离AngAngmcmsigma, where x* = x / sigma时间fsPssStau, where tau = t* = t (epsilon / m / sigma2)1/2能量Kc/moleVJergsepsilon, where E* = E / epsilon速度Aug/fsAug/psm/scm/ssigma/tau, where v* = v tau / sigma力Kc/mol/AugeV/AugNdynesepsilon/sigma, where f* = f sigma / epsilon温度KKKKreduced LJ temperature, where T* = T Kb / epsilon压力atmBarPadyne/cm2;1.0e-6barsreduced LJ pressure, P* = P sigma3 / epsilon粘度PoisePoisePa*sPoisereduced LJ viscosity, eta* = eta sigma3 / epsilon / tau电荷multiple of electron charge (+1.0 is a proton)multiple of electron charge (+1.0 is a proton)Cstatcoulombs or esureduced LJ charge, where q* = q / (4 pi perm0 sigma epsilon)1/2偶极子charge*Augcharge*AugC*mstatcoulcm = 1018 debyereduced LJ dipole, moment where *mu = mu / (4 pi perm0 sigma3 epsilon)1/2电场强度V/AugV/AugV/mstatvolt/cm or dyne/esuforce/charge, where E* = E (4 pi perm0 sigma epsilon)1/2 sigma / epsilon1Aug=1e-10 m=1e-8 cm1ps=1e-12 s, 1fs=1e-15 s, 1ps=1000 fs 1eV=23.0445512 Kc/mol, 1ev=3.8276e-23 Kc, 1eV=1.60217733e-19 J, 1eV=1.60217733e-12 erg, 1mol=6.0221367e231J=0.23884 c, 1erg=1e-7 J, 1Kc=4186.8 J, 1Kc=4.1868e10 erg, 1Kc=2.6126e22 eV1atm=1.01325 bar =101325 Pa, 1bar=100000 Paatom_style angle/atomic/bond/charge/dipole/dpd/ellipsoid/full/granular/molecular/hybrid default=atom_style atomic定义使用什么样的原子类型,决定了原子的属性,该命令应该在其他命令前。style = angle/atomic/bond/charge/dipole/dpd/ellipsoid/full/granular/molecular/hybridatom_modify map/first定义并行计算如何求最近邻atom_modify map array/hashmap定义了并行计算求最近邻的方法,array表示每个CPU都储存领域列表,hash表示每个CPU只储存在分配在本CPU的领域列表,array更快,但是体系特别大的时候会消耗更多系统内存。atom_modify first groupID允许某一组原子在领域列表是作为第一个原子。dimension N ,N=2/3default=dimension 3设置模拟的维度,进行2维模拟前要先使用该命令设置模拟盒子。该命令应在创建晶胞前。boundary x y z, default=boundary p p pboundary p p fboundary p fs pboundary s f fm 设置晶胞在3个方向的边界条件,该命令应在创建晶胞前。x/y/z = p/s/f/m/2个字母组合,2个字母组合表示第一个字母分配给下表面,第二个字母分配给上表面。p必须应用到上下两个表面。p=周期性f=不是周期性,固定的,如果原子走出表面,可能丢失;s is nonperiodic and shrinkwrappedm is nonperiodic and shrinkwrapped with a minimum value。newton flag/flag1 flag2Default=newton onflag = on or off for both pairwise and bonded interactionsflag1 = on or off for pairwise interactionsflag2 = on or off for bonded interactionsThis command turns Newtons 3rd law on or off for pairwise and bonded municate single/multi group/cutoffcommunicate multicommunicate multi group solventcommunicate single cutoff 5.0定义并行计算中CPU通讯方式。processors Px Py PzSpecify how processors are mapped as a 3d logical grid to the global simulation box.Px,Py,Pz = # of processors in each dimension of a 3d grid2. 创建模拟晶胞lattice none/sc/bcc/fcc/hcp/diamond/sq/sq2/hex/custom scale keyword valueslattice fcc 3.52lattice hex 0.85lattice sq 0.8 origin 0.0 0.5 0.0 orient x 1 1 0 orient y 1 1 0lattice custom 3.52 a1 1.0 0.0 0.0 a2 0.5 1.0 0.0 a3 0.0 0.0 0.5 basis 0.0 0.0 0.0 basis 0.5 0.5 0.5lattice none定义一个计算点阵,sc/bcc/fcc/hcp/diamond为三维点阵,sq/sq2/hex为二维点阵。scale=晶格常数(非LJ unit) & reduced density rho* (for LJ units)。同时,该命令将改变系统长度单位为三个方向的基矢长度,特别注意。origin:定义点阵的起点。将点阵平移 x,y,z 个晶格常数。0x,y,z1orient dim ijk:将点阵旋转,dim为xyz,ijk为晶向指数,注意旋转后的三个基矢必须还是正交的。切符合右手规则。spacing dx dy dz:分别定义在xyz三个方向的间隔。custom:自定义晶胞基矢和间隔。basis x y z:fractional coords of a basis atomregion ID style block/cylinder/prism/sphere/union/intersect args keyword valueregion 1 block 3.0 5.0 INF 10.0 INF INFregion 2 sphere 0.0 0.0 0.0 5 side outregion void cylinder y 2 3 5 5.0 EDGE units boxregion 1 prism 0 10 0 10 0 10 2 0 0region outside union 4 side1 side2 side3 side4定义一个空间区域。block xlo xhi ylo yhi zlo zhi:正交区域。cylinder dim c1 c2 radius lo hi:定义圆柱,dim=xyz,c1,c2为圆柱轴在其它方向坐标,radius为半径,lo,hi为圆柱在轴向范围。prism xlo xhi ylo yhi zlo zhi xy xz yz:棱柱体,xy = y在x方向倾斜量,xz,yz类似。sphere x y z radius(半径):球面union N regID1 regID2:多个区域的并集,N为数目intersect N regID1 regID2 :多个区域的交集,N为数目side out=定义的区域为描述的几何空间之外。默认为side in。units lattice以晶格常数为单位(默认),units box表示以units定义的标准距离单位定义区域。特别注意这个问题。EDGE=当前模拟盒子定义的边界;INF=无限大。group ID region/type/id/molecule/subtract/union/intersectgroup edge region regstripgroup water type 3 4 !类型为3、4group sub id =,=,!=),between,比如50 250 表示50-250subtract two or more group IDs:第一个组减去后面的组union one or more group IDs:并集intersect two or more group IDs:交集all这个组已经提前定义好了,包含所有的原子。包括all在内总共不能超过32个组。create_box N regionIDcreate_box 2 box N = # of atom types to use in this simulation原子种类regionID = ID of region to use as simulation domain在区域中创建一个模拟box,含N种原子,使用前应该先定义一个区域create_atoms type box/region/single args keyword valuescreate_atoms 1 boxcreate_atoms 3 region regsphere basis 2 3create_atoms 3 single 0 0 5 units boxcreate_atoms 1 box:在模拟盒子中产生原子种类为1的原子,必须先有create_box定义模拟box。lattice也应先定义。region:在区域内创建原子。create_atoms 1 single 0.0 0.0 0.0:增加单个原子,原子种类为1,坐标为0.0 0.0 0.0,可以用于产生间隙原子。basis:给单胞内原子指定不同原子类型,参见lattice的custom选项。units lattice以晶格常数为单位(默认),units box表示以units定义的标准距离单位定义区域。特别注意这个问题。四面体间隙0.5 0.25 0.0;八面体间隙0.5 0.5 0.0delete_atoms group/region/overlap/porosity argsdelete_atoms group edgedelete_atoms region spheredelete_atoms overlap 0.3 all all delete_atoms overlap 0.5 solvent colloiddelete_atoms porosity cube 0.1group ID:删除组中原子region ID:删除区域中原子overlap cutoff gid1 gid2:cutoff为两个原子间最近距离,必须一个原子在一个组,另一个在另外一个组,这样属于第一个组的原子将会被删除。两个组可以是一样的名字,比如all。由于算法问题,不同CPU可能删除原子数可能不一样,当可以保证最后没有距离在cutoff内的原子对。porosity regionID fraction seed:特定比例的原子讲被删除, fraction为比例,seed为随机数seed。同样不同CPU结果可能不一样。删除组groupid中的原子,删除区域regionid中的原子,可以产生一系列空位指定位置产生一个空位:region 1 sphere 0.000000 0.000000 0.000000 0.01delete_atoms region 1 read_restart file/read_date fileread_restart file 从重启文件中读入坐标等read_date filename 从file中读取坐标,具体坐标格式可以参照examplePosition data for Silicon-Carbon system1400 atoms1 atom types 0.00 44.75985925 xlo xhi 0.0050.000 ylo yhi 0.00 31.650 zlo zhiMasses1 183.8 Atoms11000212.2379929632.23799296303104.4759859250412.2379929636.7139788880set atom/group/region ID keyword valuesset group solvent type 2set group solvent type/fraction 2 0.5 12393set group edge bond 4set region half charge 0.5set atom 100 x 0.5 vx 1.0set atom 1492 type 3对指定的多个原子设置特定的属性。type/fraction:按比例设置指定的原子到新的type。set keywordstype atom-type:设置原子种类。type/fraction type fraction seed:按比例设置指定的原子到新的种类。type=新原子种类,fraction=比例mol molecule-ID:设置分子种类。x,y,z value = 原子坐标 (长度单位)vx,vy,vz value = 速度分量 (速度单位)charge atomic-charge = 设置电荷 (charge units)dipole values = x y z,x,y,z = orientation of dipole moment vectordipole/random value = seedquat values = a b c theta,a,b,c = unit vector to rotate particle around via righthand rule,theta = rotation angle in degreesquat/random value = seeddiameter value = particle diameter (distance units)density value = particle density (mass/distance3 units)volume value = particle volume (distance3 units)image nx ny nz:定义原子分配到那个镜像。nx,ny,nz = which periodic image of the simulation box the atom is inbond value = bond type for all bonds between selected atomsangle value = angle type for all angles between selected atomsdihedral value = dihedral type for all dihedrals between selected atomsimproper value = improper type for all impropers between selected atomsdisplace_atoms groupID move/ramp/random args keyword valuedisplace_atoms top move 0 5 0 units boxdisplace_atoms all random 1.0e-3 1.0e-3 1.0e-3 617displace_atoms flow ramp x 0.0 5.0 y 2.0 20.5displace_atoms groupID style args :移动一组原子。move delx dely delz:在xyz三个方向移动的距离。random dx dy dz seed:随机移动原子ramp ddim dlo dhi dim clo chi:ddim=xyz,dim=xyz,在ddim方向移动原子,移动范围为dlo-dhi,移动距离根据原子在dim方向的坐标大小来决定,小于cho移动dlo,大于chi移动dhi。displace_box groupID parameter args . keyword value displace_box all xy final 2.0 z final 0.0 5.0 units boxdisplace_box all x scale 1.1 y volume z volumedisplace_box groupID parameter改变模拟盒子的形状、体积change_box ortho/triclinicchange_box ortho 把模拟晶胞从三斜转换为正交晶胞change_box triclinic 把模拟晶胞从正交转换为三斜晶胞lammps默认是正交晶胞replicate nx ny nznx,ny,nz = replication factors in each dimension,整数。复制现有的模拟晶胞。原子属性也同时复制。1表示不变。3. 设置mass I valuemass 1 1.0mass * 62.5mass 2* 62.5设置不同种类的原子质量。Mass也可以由read_data命令从data文件读入。pair_eam在eam势文件里设置了原子质量。原子种类描述方法:* *n m* m*n开始模拟前必须先定义原子质量。velocity groupID create/set/scale/ramp/zero args keyword valuevelocity all create 300.0 4928459 rot yes dist gaussian velocity border set NULL 4.0 3.0 sum yes units boxvelocity flow scale 300.0velocity flow ramp lattice vx 0.0 5.0 y 5 25 temp mytemp velocity all zero linearvelocity groupID create/set/scale/ramp/zerocreate temp seed:随机产生指定温度的速度。set vx vy vz:把这个group的速度设置成vx,vy,vz。scale temp:标度到指定温度。 NULL为不变。ramp vx/vy/vz vlo vhi x/y/z clo chi:产生速度梯度。zero linear/angular:linear=总线速度为零,angular=总角速度为零。dist uniform/gaussion:create速度分布是均匀分布还是高斯分布,默认均匀分布。sum yes/no:新速度是叠加到之前的速度。否=替换之前的速度。(not zero)mom yes/no:for create,产生的总线速度=0rot yes/no:for create,产生的总角速度=0temp compute-id:指定计算温度方法。(for create/scale)loop all/local/geom:定义并行计算中原子速度产生方法。units box/lattice:for set/ramp,使用说明坐标,box为绝对坐标,lattice为点阵坐标。default: dist=uniform; sum=no; mom=yes; rot=no; loop=alltimestep dt为接下来的MD计算定义时间步长。也可以由fix dt/reset或run_style respa定义变化的时间步长。Default:timestep = 0.005 tau for units = ljtimestep = 1.0 fmsec for units = realtimestep = 0.001 psec for units = metaltimestep = 1.0e8 sec (10 nsec) for units = si or cgsreset_timestep Nreset_timestep 0reset_timestep 4000000重设时间步到指定值。read_data/create_box设置时间步为0。read_restart设置时间步为上次计算值。不能用在dump/restart已经有输出的时候,这样会打乱文件输出。neighbor skin bin/nsq/multineighbor skin style, style=bin/nsq/multi, (default: 2.0 bin for units = real or metal,) neighbor 2.0 binThis command sets parameters that affect the building of pairwise neighbor lists.定义求最近邻的截断半径,bin模式在最长cutoff的基础上加2.0A作为新的截断半径neigh_modify keyword valuesneigh_modify every 20 delay 10 check yes定义求最近邻原子数的方法,每隔20步更新最近邻,上次更新后10步内不更新,check设置判断原子是否大步移动,从而决定更新。4. 输出dump ID groupID bond/dcd/xtc/xyz/custom N file argsdump myDump all atom 100 dump.atomdump 2 subgroup atom 50 dump.run.bin dump 4a all custom 100 dump.myforce.* id type x y vx fx dump 4b flow custom 100 dump.%.myforce id type c_myF3 v_ke dump 1 all xtc 1000 file.xtc定义一个输出,包含各种物理量,每隔N步输出到file中。atom:文本文件,含原子坐标,ID,种类会输出到文件中。可用VMD打开。custom:定制如何输出dump文件。dcd:二进制文件,用于CHARMM,NAMD,Xplor,VMDxtc:二进制文件,用于GROMACS,VMDxyz:简单文本文件,含原子坐标,种类,可用VMD打开。文件名称规则:file.%.* :*表示时间步,%表示CPU IDfile.bin:输出二进制文件。(可用binary2txt转换成文本)file.gz:输出gzipped文件。dump custom argsid = atom IDmol = molecule IDtype = atom typex,y,z = unscaled atom coordinatesxs,ys,zs = scaled atom coordinatesxu,yu,zu = unwrapped atom coordinatesix,iy,iz = box image that the atom is invx,vy,vz = atom velocitiesfx,fy,fz = forces on atomsq = atom chargemux,muy,muz = orientation of dipolar atomradius = radius of extended spherical particleomegax,omegay,omegaz = angular velocity of extended particleangmomx,angmomy,angmomz = angular momentum of extended particlequatw,quati,quatj,quatk = quaternion components for aspherical particlestqx,tqy,tqz = torque on extended particlesc_ID = peratom scalar value calculated by a compute with IDc_IDN = Nth component of peratom vector calculated by a compute with IDf_ID = peratom scalar value calculated by a fix with IDf_IDN = Nth component of peratom vector calculated by a fix with IDv_name = peratom value calculated by an atomstyle variable with namedump_modify dumpID format/scale/image/flush/unwrap/every/precision/region/thresh valuesdump_modify 1 format %d %d %20.15g %g %g scale yesdump_modify myDump image yes scale no flush yesdump_modify 1 region mySphere thresh x = 3.2dump_modify xtcdump precision 10000定义如何输出dump文件。default:scale=yes; image=no; flush=yes; unwrap=no; thresh=noneformat string:输出格式。scale yes/no:是否输出归一化坐标。image yes/no:是否输出原子穿越边界次数。flush yes/no:是否实时输出。every N:重新设定输出间隔region Rid:只输出区域内原子。thresh attribute operation value:设置条件,只输出符合条件。attribute=dump custom argsoperation= “ ” “=” “=” “!=” unwrap yes/no:dcd/xtc,输出未穿过边界的坐标。precision N:xtc,定义输出精度。10-1000000undump dumpID关闭之前定义的dump。关闭和dump关联的文件。thermo_style one/multi/custom(args)thermo_style multithermo_style custom step temp pe etotal press vol v_abc default = thermo_style onecustom args:定制要输出什么信息one=thermo_style custom step temp epair emol etotal press“multi=thermo_style custom etotal ke temp pe ebond eangle edihed eimp evdwl ecoul elong press“可能会产生一些compute,可通过compute_modify修改。compute thermo_temp all tempcompute thermo_press all pressure thermo_tempcompute thermo_pe all pe该命令应在创建晶胞后使用。thermo_style custom argsstep = timestepatoms = # of atomscpu = elapsed CPU timete
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025版高端别墅清洁人员劳动合同
- 2025年新能源汽车抵押融资合同样本
- 消费者选择行为变化-洞察及研究
- 2025年度生活垃圾运输合同废弃物处理设施运营环保责任合同
- 2025电商企业年度运营项目总监劳动合同
- 2025版试用期劳动合同:电力行业试用期员工安全生产责任书
- 2025版起重机安全认证买卖合同范本
- 2025版高端景观铁艺栏杆施工合作协议
- 2025年网络安全防护系统设计与实施合同
- 2025变更劳动合同协议书:文化用品企业销售员合同调整方案
- 子宫憩室护理查房
- 河南省开封市西北片区2023-2024学年九年级英语第一学期期末达标检测模拟试题含解析
- 体育开学第一课课件
- 被诈骗的起诉书范文
- 医院病历单请假用
- 肝胆外科专科知识题库及答案
- 滁州市珠龙广卫绢云母粉厂滁州市南谯区将军山绢云母矿1万吨-年露天采矿工程项目环境影响报告书
- 迷你中长导管-
- 钢质防火门安装施工方法
- 优化物理教学策略的思考(黄恕伯)
- GB/T 26358-2022旅游度假区等级划分
评论
0/150
提交评论