我的辣鸡命令们

  • 声明
  • 常用命令
  • fix addforce
  • real的force单位
  • write_restart ,read_restart
  • move linear
  • real的velocity单位
  • How to chunk(未完成)
  • compute temp/chunk
  • chunk/atom+ave/chunk
  • compute chunk/atom
  • compute temp/chunk com yes与compute temp/com的区别
  • compute temp/chunk 与fix ave/chunk temp
  • compute temp/partial
  • fix nve/time
  • compute reduce(未完成)
  • fix nve/limit
  • fix nve/noforce
  • fix rigid
  • fix rigid single
  • rigid/nve
  • fix rigid:force and torque keywords
  • reset_timestep

声明

命令以及分析仅限于我在学习过程中涉及到的以及各位为我补充的,具体细节还是得根据:美帝的manual来。

总之不定期更新ing,可能一开始的内容会比较少。。。但会根据问题的出现慢慢加。。。也欢迎大家给我安利各种命令,私信,qq,邮箱都可以,如果有命令解释错误,请指出!!!
本人也会尽量将命令和具体论文结合但是准确度可能无法完全保证,但是会努力优化!!!!这就需要大家的努力了!!!

  • 小建议:在PDF中添加自己的常用命令标签,方便反复查阅。

常用命令

fix addforce

你填入的value需要为每个原子的所受到的力,一方面要考虑力学单位换算,又要考虑进行平均!注意使用前要确定受力对象要在系综中。

Add fx,fy,fz to the corresponding component of force for each atom in the group. This command can be used to give an additional push to atoms in a simulation, such as for a simulation of Poiseuille flow in a channel.

real的force单位

Kcal/mole/Angstrom,可自行换算1Kcal/mole/Angstrom=6.950166e-11N

以下为我在模仿论文:Identifying the Mechanisms of Polymer Friction through Molecular Dynamics Simulation用到的addforce命令,再进行1GPa施压时我所用的单位换算,仅供参考:

variable     target_pressure equal 1e9   #目标压力设定(pa)
variable        total_force_E_F equal ${target_pressure}*lx*ly*1e-20                #EF层所受的总力(N)lx,ly为盒子边长
variable        atom_force_E_F equal ${total_force_E_F}/(${C_number_02}+${H_number_02})        #EF层每一个原子受到的力(N)
variable        f_coefficient equal 6.950166e-11
variable        f_to_addforce equal ${atom_force_E_F}/${f_coefficient} #EF层每个原子所受的力(Kcal/mole/Angstrom)

write_restart ,read_restart

可以保留之前的模拟的group,运算后的原子坐标,速度,温度等信息,但是fix和variable需要在下次模拟中仍然需要重新声明

Although the purpose of restart files is to enable restarting a simulation from where it left off, not all information about a simulation is stored in the file. For example, the list of fixes that were specified during the initial run is not stored, which means the new input script must specify any fixes you want to use. Even when restart information is stored in the file, as it is for some fixes, commands may need to be re-specified in the new input script, in order to re-use that information.

move linear

同样要注意单位换算; 另外注意有了move之后,如果不需要控温,则NULL就代表位置和速度更新等同于nve了!!!如果nve+move null,相当于两个系综的混合使用了,可见下面的错误示范!!

If any of the velocity components is specified as NULL, then the position and velocity of that component is time integrated the same as the fix nve command would perform, using the corresponding force component on the atom

错误示范(可运行,但是会报错,运行结果也有问题)

fix          1 E_F nve                                           #第一次nve
fix         2 E_F move linear NULL ${input_velocity} NULL       #第二次nve

错误警告:

可以正常运行的示范(至于结果合不合理,得综合考虑!!!)

#-----------------------恒速
fix         4 E_F move linear NULL ${input_velocity} NULL
fix         5 E_F addforce 0.0 0.0 -${f_to_addforce_F}
fix         6 F temp/rescale 10 300.0 300.0 10.0 1.0

real的velocity单位

Angstroms/femtosecond; 换算成SI:1A/fs=1e5m/s
1m/s我所用的单位换算,仅供参考:

variable         target_velocity equal 1                             #m/s
variable        velocity_coefficient equal 1e5
variable        input_velocity equal ${target_velocity}/${velocity_coefficient}         #埃/fs

How to chunk(未完成)

compute temp/chunk

Define a computation that calculates the temperature of a group of atoms that are also in chunks, after optionally subtracting out the center-of-mass velocity of each chunk. By specifying optional values, it can also calculate the per-chunk temperature or energies of the multiple chunks of atoms.

The temp value calculates the temperature for each chunk by the formula KE = DOF/2 k T, where KE = total kinetic energy of the chunk of atoms (sum of 1/2 m v^2), DOF = the total number of degrees of freedom for all atoms in the chunk, k = Boltzmann constant, and T = temperature.
The DOF in this case is calculated as N*adof + cdof, where N = number of atoms in the chunk, adof = degrees of freedom per atom, and cdof = degrees of freedom per chunk. By default adof = 2 or 3 = dimensionality of system, as set via the dimension command, and cdof = 0.0. This gives the usual formula for temperature.
The kecom value calculates the kinetic energy of each chunk as if all its atoms were moving with the velocity of the center-of-mass of the chunk.
The internal value calculates the internal kinetic energy of each chunk. The interal KE is summed over the atoms in the chunk using an internal “thermal” velocity for each atom, which is its velocity minus the center-of-mass velocity of the chunk.

在论文中的体现:

Tong R-t, Han B, Quan Z-f, Liu G. Molecular dynamics simulation of friction and heat properties of Nano-texture GOLD film in space environment. Surface and Coatings Technology 2019;358:775–84. https://doi.org/10.1016/j.surfcoat.2018.11.084

chunk/atom+ave/chunk

这个组合简单来说就是,把你想要的group均分为块,然后求出每个块内的属性值,例如数密度,温度等。可参考二维温度云图实现。采样的解释同ave/time.

compute chunk/atom

将不同的原子分成不同的块

compute temp/chunk com yes与compute temp/com的区别

compute temp/chunk com yes是计算每个chunk的温度,方法是:对于某个chunk,比如是chunk1,将该chunk内的所有原子先求出质心速度,而后,把将该chunk内的所有原子的速度减掉求出的质心速度,在根据能量均分定理,计算获得该chunk的温度。
compute temp/com是计算某个group的温度,方法是:对于某个group,先将该group的原子求出质心速度,而后,将该group内的所有原子的速度减掉求出的质心速度,,在根据能量均分定理,计算获得该chunk的温度。

compute temp/chunk 与fix ave/chunk temp

  • This compute calculates the temperature for each chunk for a single snapshot. Fix ave/chunk can do that but can also time average those values over many snapshots, or it can compute a temperature as if the atoms in the chunk on different timesteps were collected together as one set of atoms to calculate their temperature.
  • If you want to time-average what compute temp/chunk produces (a global array of temp per chunk), you could use a column of it as input to fix ave/time in its vector mode. This will not do the fancy stuff that fix ave/chunk temp does with combing atoms across timesteps to accumulate one temp,as on its doc page.(这一点应该是说fix ave/chunk更好,因为它是将某一时间段内进入到该chunk的原子进行统计,而后进行温度计算,应该是温度数据震荡会更小吧?)
  • This compute allows the center-of-mass velocity of each chunk to be subtracted before calculating the temperature; fix ave/chunk does not.
    compute temp/chunk com yes + fix ave/time’与

(1) compute temp/chunk com yes能够实现每个chunk内原子减掉该chunk的质心速度,而后计算温度,并采用fix ave/time平均输出;(完整命令:

compute tempWcom all temp/chunk slices temp com yes
fix T_slices all ave/time 10 100 1000 c_tempWcom[*] file slices_equi.prof mode vector

(2) ‘compute temp/chunk com yes + fix ave/time’ 与‘compute temp/chunk com yes + fix ave/chunk temp bias’ 的结果输出的一样

(3) compute temp/com + fix ave/chunk temp bias也能够实现针对于chunk的温度计算并输出,与(1)不同的是,每个chunk内原子减掉该compute所使用的group的质心速度,而后计算的温度。转载自s-q-dirac的博客

compute temp/partial

Define a computation that calculates the temperature of a group of atoms, after excluding one or more velocity components

至于为什么要取消人为设定速度方向上的影响,和网友讨论的结果是:温度只与系统内部的热运动有关,所以要把系统整体的速度去掉,也就是去掉系质心的速度,这一点和论文描述也是一致的。我自己也有个比方:假如你捏着拿着一筒卷纸,沿着任意方向高速运动,本身速度对于物体的温度是没有影响的,关键是你的手对卷纸施加的力,力对卷纸内部的作用才造成了能量的变化,而lammps能量就是和速度相关,所以人为设定的外部速度的存在是会影响结果的。

Example中shear例子中的体现(在friction中也有):

转自公众号:LAMMPS 爱好者 一个剪切(shear)模拟例子的学习(3)

fix nve/time

时间范围内进行采样

注意保存成restart文件的时候,下次读取仍然需要再次声明fix!

No information about this fix is written to binary restart files. None of the fix_modify options are relevant to this fix.

compute reduce(未完成)

功能和python reduce函数一样,具有累加的功能

fix nve/limit

注意:此命令只适合在模拟前期使用,在真正数据收集的过程中请不要使用此命令,而改成需要的系综,如fix nve, fix NVT等!!!!!
转自:fix nve/limit command使用及注意

fix nve/noforce

会匀速更新原子坐标,需要配合velocity group set 0.0 0.0 0.0实现对边界的固定,另外和setforce固定不同的是,该命令下原子是受力的,信息可以被dump出。

#-----------------------A层固定
velocity        A set 0.0 0.0 0.0
fix         17 A nve/noforce

Perform updates of position, but not velocity for atoms in the group each timestep. In other words, the force on the atoms is ignored and their velocity is not updated. The atom velocities are used to update their positions.

This can also be accomplished via the fix setforce command, but with fix nve/noforce, the forces on the wall atoms are unchanged, and can thus be printed by the dump command or queried with an equal-style variable that uses the fcm() group function to compute the total force on the group of atoms.

fix rigid

论文中的rigid描述(个人推测,仅供参考)

fix rigid single

single相当于把一个group的原子看成一个rigid body,施加力的时候需要考虑大小,例如1Gpa对于1000个原子,针对single类型,只需要1Mpa的数值。

For bodystyle single the entire fix group of atoms is treated as one rigid body.

id styles.

rigid/nve

该命令执行nve积分,不需要在叠加其他积分运算了

The rigid, rigid/nve, rigid/small, and rigid/small/nve styles perform constant NVE time integration. The only difference is that the rigid and rigid/small styles use an integration technique based on Richardson iterations. The rigid/nve and rigid/small/nve styles uses the methods described in the paper by Miller, which are thought to provide better energy conservation than an iterative approach

fix rigid:force and torque keywords

off:代表清除那个方向上与其他原子之间的作用
on:保持与其他原子之间的相互作用
没有力并不代表不会运动,没有速度,如果需要固定,则需要提前velocity set 0 0 0.

reset_timestep

我以后不会再用了。。。。。。
Various fixes use the current timestep to calculate related quantities. If the timestep is reset, this may produce unexpected behavior, but LAMMPS allows the fixes to be defined even if the timestep is reset. For example, commands which thermostat the system, e.g. fix nvt, allow you to specify a target temperature which ramps from Tstart to Tstop which may persist over several runs. If you change the timestep, you may induce an instantaneous change in the target
temperature.

Lammps基础命令(2020.3.26.01已更新)相关推荐

  1. lammps基础命令及教程

    原创 YJ学长 LAMMPS交流站javascript:void(0); 01 lammp常用命令 1.units命令 2.dimension命令 3.boundary命令 3.atom_style命 ...

  2. Asky极简教程:零基础1小时学编程,已更新前8节

    Asky极简架构 开源Asky极简架构.超轻量级.高并发.水平扩展.微服务架构 <Asky极简教程:零基础1小时学编程>开源教程 零基础入门,从零开始全程演示,如何开发一个大型互联网系统, ...

  3. Linux 基础命令快速入门

    Linux 基础命令快速入门: 目录 Linux 基础命令快速入门: 1.vim 命令记录 2.开机.重启和用户登录注销 3.用户管理 4.用户组相关 5.用户信息文件 6.实用指令 7.帮助指令 8 ...

  4. linux12 -MYSQL数据库 -->04 数据库和数据表基础命令--01

    文章目录 数据库的基础命令详解 一.数据库库相关操作 二.数据库表相关操作 三.数据库字段 四.数据库命令详解 1. 系统数据库 2. 创建数据库 1 语法(help create database) ...

  5. Linux基础命令-进程与系统性能

    Linux基础命令-进程与系统性能 进程与系统性能 一.进程相关概念 1.进程概念 2.进程的基本状态和转换 3.IPC进程间通信 4.进程优先级 5.进程状态 二.进程与系统性能 1.系统管理工具 ...

  6. Mysql常用基础命令操作实战

    目录 一    启动与关闭MySQL    3 1.1    单实例MySQL启动与关闭方法    3 ※1※    常规启动关闭数据库方式(推荐)    3 1.2    多实例MySQL启动与关闭 ...

  7. 自动化运维之ansible-安装部署与基础命令篇

    一.Ansible简介 Ansible基于Python语言开发,集合了众多优秀运维工具的优点,实现了批量运行命令.部署程序.配置系统等功能. 二.安装部署Ansible服务 Ansible自动化运维环 ...

  8. Linux基础第一章:基础知识与基础命令

    目录 一.虚拟机的三种网卡模式 二.基础知识 2.1  shell的内外部命令 2.2可以使用type命令来区分内外部命令 2.3命令行头解释 2.4文件具体信息含义 2.5命令行格式 三.基础命令 ...

  9. Linux常用基础命令198个

    Linux常用基础命令198个 1.mkdir 创建目录 * 主要选项:-p 递归创建目录 主要案列:mkdir /xujun mkdir -p /xujun/oldboy mkdir -p /xuj ...

最新文章

  1. mac os下valgrind的安装
  2. (0030) iOS 开发之跳转之转场动画
  3. Java编写抓取用户信息代码_[代码全屏查看]-一个基于JAVA的知乎爬虫,抓取知乎用户基本信息...
  4. 【LeetCode】103# 二叉树的锯齿形层次遍历
  5. C#正则表达式判断是否为IP地址
  6. HDU3430-扩展中国剩余定理
  7. Python_面向对象_zipfile和tarfile
  8. 关于SOAP的几篇文章
  9. 计算机二级考试python_全国计算机等级考试考试大纲(2018年版)
  10. python is 与 == 的区别
  11. 回溯算法高效解标准数独
  12. 高端驱动和低端驱动--ir2110
  13. RS232 与 RS485的区别总结
  14. 举头望明月,低头敲代码
  15. 三行九个点,用4条线段连接(扩展,用3条,用1条)
  16. 从零开始做运营 入门版(张亮著)读书知识整理①
  17. 支藏人元及五行四时旺衰
  18. 保研之路——北航计算机学院直硕夏令营
  19. Linux超级用户(root)的密码
  20. 一年中重要的节日列表_一年中所有节日一览表

热门文章

  1. 最常用的十大管理工具 公司管理常用哪几种管理工具
  2. 节能灯与led灯哪个对眼睛好?分享专业护眼的led灯
  3. 小学计算机学科知识与能力,小学教育教学知识能力考点:信息技术与学科教学整合的概念...
  4. 三坐标检测之测量同心度时要注意的问题
  5. 用JavaScript制作页面特效
  6. java毕业设计高铁站失物招领平台(附源码、数据库)
  7. 双模耳机KC认证申请办理机构
  8. Windows 10 无法连接网络:未关闭科学上网软件、连接科学上网软件后,关闭科学上网软件无法上网、设置默认不开启代理服务器
  9. NLP自然语言处理实战(三):词频背后的语义--5.距离和相似度反馈及改进
  10. WinSock的I/O模型