【LAMMPS翻译系列】atom_style命令

atom_style命令用来定义模拟过程中原子的类型,它会决定原子包括哪些属性。

使用语法

atom_style style args

其中:

  • style可取:angleoratomicorbodyorbondorchargeordipoleorelectronorellipsoidorfullorlineormesoormolecularorperiorsphereortriorhybrid
  • 只有body和hybrid需要设置args(具体参考原文档)

使用举例

atom_style atomic
atom_style bond
atom_style full
atom_style body nparticle 2 10
atom_style hybrid charge bond
atom_style hybrid charge body nparticle 2 5

使用介绍

定义模拟过程中原子的类型,它会决定原子包括哪些属性。该命令必须在建立模拟盒子(使用命令read_dataread_restartcreate_box)之前使用。

一定原子的类型被设置了,在模拟过程中就不能在改变了,因此尽量更加通用的类型,以免某些属性没有被包括却被用到了。举例来说,对于bond类型,原子没有角度项,也不能在模拟的过程中为模型添加角度属性。尽量使用更加通用的类型,虽然这可能会因为某些属性没有用到,同时会稍微降低效率,但总比出错好。

类型的选择会影响每个原子所能够存储的性质、在计算力的时候处理器间能够交换的性质以及在数据文件中所能够显示并被命令read_data读入的性质。

下表中列出了每种类型所包括的属性以及会用到这种类型的典型物理体系。所有的类型都包括坐标、速度、原子ID和原子类型。参考命令read_datacreate_atomsset,了解关于如何设置这些性质。

angle bonds and angles bead-spring polymers with stiffness
atomic only the default values coarse-grain liquids, solids, metals
body mass, inertia moments, quaternion, angular momentum arbitrary bodies
bond bonds bead-spring polymers
charge charge atomic system with charges
dipole charge and dipole moment system with dipolar particles
electron charge and spin and eradius electronic force field
ellipsoid shape, quaternion, angular momentum aspherical particles
full molecular + charge bio-molecules
line end points, angular velocity rigid bodies
meso rho, e, cv SPH particles
molecular bonds, angles, dihedrals, impropers uncharged molecules
peri mass, volume mesocopic Peridynamic models
sphere diameter, mass, angular velocity granular models
tri corner points, angular momentum rigid bodies
wavepacket charge, spin, eradius, etag, cs_re, cs_im AWPMD

注意:通过命令fix property/atom对原子添加它原先没有的属性是可以的,比如分子ID。该命令也允许为原子添加新的由整数或浮点数组成的自定义属性。参考命令fix property/atom,了解更多细节和例子。

上面的类型中,除了sphereellipsoidelectronperiwavepacketlinetri, and body定义的是有限尺寸粒子,其他的类型定义的都是点粒子。

对于定义为有限尺寸粒子的类型,在设置质量时是对每一个粒子进行的;而对于点粒子,这是对类型进行设置的。

  • sphere:粒子是球形的,每个粒子存有其直径和质量。如果其直径大于0,粒子是有限尺寸的球;如果直径等于0,它是一个点粒子(point particle)。
  • ellipsoid:粒子是椭球体,每个粒子存有一个标记,用来区分该粒子是有限尺寸的椭球还是点粒子。如果是椭球,那么每个粒子就存有形状矢量,这个矢量包括椭球体的三个直径和一个代表其方位的四维矢量。
  • electron:the particles representing electrons are 3d Gaussians with a specified position and bandwidth or uncertainty in position, which is represented by the eradius = electron size.
  • peri:粒子是球形的,每个粒子存有其质量和体积。
  • meso:粒子用于光滑粒子流体动力学SPH计算,存有密度、能量和热容。
  • wavepacket:与类型electron类似,but the electrons may consist of several Gaussian wave packets, summed up with coefficients cs= (cs_re,cs_im). Each of the wave packets is treated as a separate particle in LAMMPS, wave packets belonging to the same electron must have identical etag values.
  • line:the particles are idealized line segments and each stores a per-particle mass and length and orientation (i.e. the end points of the line segment).
  • tri:the particles are planar triangles and each stores a per-particle mass and size and orientation (i.e. the corner points of the triangle).
  • body:the particles are arbitrary bodies with internal attributes defined by the "style" of the bodies, which is specified by the bstyle argument. Body particles can represent complex entities, such as surface meshes of discrete points, collections of sub-particles, deformable objects, etc.

一般来说,模拟时需要单独一种的原子类型(non-hybrid)。但如果模拟中的有些原子不需要某些性质,但其他的原子需要,那么就要使用包含所有这些性质的类型。比如,如果有些原子需要电荷,而另外一些不需要,要使用类型charge;如果有些原子有键,而另外一些没有,要使用类型bond。

唯一可能用到类型hybrid的情况是没有任何一种类型包括了所有需要的性质。比如,如果你要使用极性粒子,并且要这些粒子在扭矩下旋转,那么你就需要用到atom_style hybrid sphere dipole。如果使用类型hybrid,那么原子就会储存由这两种类型定义的所有性质。

使用限制

该命令不能在模拟盒子被定义(使用命令read_datacreate_box)之后使用。

类型angle/bond/full/molecular是MOLECULAR包的一部分;类型line/tri是ASPHERE包的一部分;类型body是BODY包的一部分;类型dipole是DIPOLE包的一部分;类型peri是PERI包的一部分;类型electron是USER-EFF包的一部分;类型meso是USER-SPH包的一部分;wavepacket是USER-AWPMD包的一部分。只有在LAMMPS编译的时候把相应的包编译进去了,这些类型才可以使用。

相关命令

read_datapair_style

默认设置

atom_style atomic

标签: lammps, lammps翻译

相关文章推荐

添加新评论 (无需注册,可直接评论)

已有 4 条评论

  1. Andrew Fan

    学长你好,请教一下,我先使用了create_box,之后我删除了一个球形区域的原子,再添加另外一种原子就不能直接使用atom_style了,是不是应该使用read_data命令定义这种原子?

  2. 李安然

    你好,我想问一下,在src里面可以找到一些源程序,假如说meam,我怎样才能找到它的主函数呢,pair_meam.cpp里面都是定义的各个子函数,并没有说如何调用各个子函数。不知道您对这方面了解不?

    1. 我爱搜集网博主

      meam是安装包,在lib目录下。

  3. Albert Wang

    楼主你好,相关命令下没有超链接,建议取消。