【LAMMPS翻译系列】lattice命令

lattice命令用来定义晶格。

使用语法

lattice style scale keyword values ...
  • style: none or sc or bcc or fcc or hcp or diamond or sq or sq2 or hex or custom
  • scale:晶格和模拟盒子的比例因子
  • 可以不添加或添加多个keyword/value。
  • keyword:origin or orient or spacing or a1 or a2 or a3 or basis
    • origin
    • orient
    • spacing
    • a1/a2/a3
    • basis

使用举例

lattice fcc 3.52
lattice hex 0.85
lattice sq 0.8 origin 0.0 0.5 0.0 orient x 1 1 0 orient y -1 1 0
lattice 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.5
lattice none 2.0

使用介绍

该命令用来定义晶格,以便其他命令使用。在LAMMPS中,晶格仅仅对应空间中的一些列阵点,而这些阵点的位置是由相应原胞中基本原子的位置决定的。这些阵点会在所有的方向上无限的复制。lattice命令的参数可以用来定义很多晶体学晶格。

在LAMMPS,晶格有两种使用方式。第一种,使用命令create_atoms在模拟盒子内的晶格阵点上创建原子。需要注意的是,使用命令create_atoms可以在一个晶格的不同格点上创建不同类型的原子。第二种,晶格沿着x,y,z三个方向的晶格间距可以被其他的命令(比如命令create_box, region, velocity)用作距离单位。这对于the underlying problem geometry is atoms on a lattice是非常方便的。

晶格类型必须要是模拟的维度(参考命令dimension)要匹配。类型sc or bcc or fcc or hcp or diamond属于三维问题。类型sq or sq2 or hex属于二维问题。类型custom既可以用于二维,也可以用于三维问题。

对于LAMMPS中一个晶格来说,它是由单胞、一些基本原子和一些在模拟盒子安放单胞的变换参数(比例因子、原点和方位)组成。矢量a1, a2, a3是单胞的边向量。在固体物理或晶体学中,它们被称为基矢。需要注意的是,LAMMPS中使用的单胞是不同于具有最小体积的原胞。


  • 类型none并没有定义原胞和相关基组,因此用它定义的晶格不能被命令create_atoms使用。但它定义了由比例参数scale指定的晶格间距。上面已经提到了,晶格间距可以被其他命令用作距离单位。对于类型none来说,不能添加额外的keyword/value。默认定义的是lattice none 1.0,就是说晶格距离与命令units定义的单位长度相等。
  • 类型sc, fcc, bcc, diamond是三维晶格。其中scfccbccdiamond定义了边长为1.0的立方单胞,其单胞的边矢量为a1 = 1 0 0, a2 = 0 1 0, a3 = 0 0 1。类型hcp的边矢量是a1 = 1 0 0, a2 = 0 sqrt(3) 0, a3 = 0 0 sqrt(8/3)。具体到基本原子如何在单胞中进行摆放,在任何一本固体物理课本上应该都有介绍。
    • sc晶格有1个基本原子,在立方体左下角后面的位置。
    • bcc晶格有2个基本原子,分别在立方体的角上和中心的位置。
    • fcc晶格有4个基本原子,有1个在角上,另外3个在面心的位置。
    • hcp晶格有4个基本原子,有2个在z=0的平面上,另外2个在z=0.5的平面上。
    • diamond晶格有8个基本原子。
  • 类型sqandsq2是二维晶格,定义了边长为1.0的正方形单胞,其单胞的边向量是a1 = 1 0 0和a2 = 0 1 0。类型hex定义的也是二维晶格,但单胞是长方形的,其单胞边矢量为a1 = 1 0 0和a2 = 0 sqrt(3) 0。
    • sq晶格有1个基本原子,在正方形的左下角的位置。
    • sq2晶格有2个基本原子,分别在正方形的角上和中心的位置。
    • hex晶格有2个基本原子,分别在长方形的角上和中心的位置。
  • 类型custom允许你通过指定边矢量a1, a2, a3和单胞中一系列基本原子的坐标来定义晶格。默认情况下,a1, a2, a3是正交的单位矢量,但你也可以将它们指定为非正交任意长度的矢量,从而描述平行六面体式的单胞。关键字basis是用来添加原子的,每使用一次添加一个。它的参数是分数坐标(0.0 <= x,y,z < 1.0),因此0.5的意思就是在相应方向上中间的位置。




下面这部分介绍将理想单胞变换为模拟盒子中晶格阵点的相关参数。

参数scale决定在模拟盒子中布置单胞时,它的实际尺寸。也就是说,将该参数作为乘法因子作用在单胞上,从而可以获得所需尺寸的晶格。参数scale的意义依赖于你在模拟过程中使用的单位类型(参考命令units)。

对于除了lj之外的所有单位类型,参数scale都是由相应单位类型所 定义的长度单位 指定。举例来说,对于real或metal的单位类型,如果立方单胞的边长为1.0,指定scale=3.52,那么就会创建一个间距3.52A的立方晶格。对于cgs单位类型而言,间距是3.52cm。

而对于lj单位类型,the scale argument is the Lennard-Jones reduced density, typically written as rho*. LAMMPS converts this value into the multiplicative factor via the formula "factor^dim = rho/rho*", where rho = N/V with V = the volume of the lattice unit cell and N = the number of basis atoms in the unit cell (described below), and dim = 2 or 3 for the dimensionality of the simulation. Effectively, this means that if LJ particles of size sigma = 1.0 are used in the simulation, the lattice of particles will be at the desired reduced density.

origin选项指定在将单胞布置在模拟盒子中的时候,如何对其进行平移。参数x,y,z是分数值(0.0 <= x,y,z < 1.0),意思是说按着相应方向上的晶格间距的分数倍进行平移。晶格间距的意思在下面会介绍。

orient选项指定在将单胞布置在模拟盒子中的时候,如何对其进行旋转。参数dim是模拟盒子3个坐标轴中的一个。另外3个参数定义一个晶体学方向,你的单胞将会沿着那个方向摆放;需要指定为整数,比如orient x 2 1 0的意思就是说模拟盒子的x方向是沿着晶格的[210]方向。你所指定的三个晶格方向必须是相互正交的,并且满足右手定则,即X叉乘Y的方向与Z相同。需要注意的是,这里的介绍只对正交晶格是适用的。如果你要使用custom类型定义非正交的边矢量a1,a2,a3,那么你可以认为orient选项定义了3x3的旋转矩阵,并将其作用于a1,a2,a3对最初的单胞进行旋转,从而得到新的摆向。




有些LAMMPS命令会使用沿着x,y,z三个方向的晶格距离作为距离的单位。比如使用命令region创建尺寸为10x20x20的方块,其中的10就是说沿着x方向的长度是10倍的晶格距离。

spacing选项用来直接设置3个晶格间距。所有的参数都不能是0(如果是二维模拟,将dz设置为1.0)。指定的值

The spacing option sets the 3 lattice spacings directly. All must be non-zero (use 1.0 for dz in a 2d simulation). The specified values are multiplied by the multiplicative factor described above that is associated with the scale factor. Thus a spacing of 1.0 means one unit cell independent of the scale factor. This option can be useful if the spacings LAMMPS computes are inconvenient to use in subsequent commands, which can be the case for non-orthogonal or rotated lattices.

If the spacing option is not specified, the lattice spacings are computed by LAMMPS in the following way. A unit cell of the lattice is mapped into the simulation box (scaled, shifted, rotated), so that it now has (perhaps) a modified size and orientation. The lattice spacing in X is defined as the difference between the min/max extent of the x coordinates of the 8 corner points of the modified unit cell. Similarly, the Y and Z lattice spacings are defined as the difference in the min/max of the y and z coordinates.

Note that if the unit cell is orthogonal with axis-aligned edges (not rotated via the orient keyword), then the lattice spacings in each dimension are simply the scale factor (described above) multiplied by the length of a1,a2,a3. Thus a hex style lattice with a scale factor of 3.0 Angstroms, would have a lattice spacing of 3.0 in x and 3*sqrt(3.0) in y.

IMPORTANT NOTE: For non-orthogonal unit cells and/or when a rotation is applied via the orient keyword, then the lattice spacings may be less intuitive. In particular, in these cases, there is no guarantee that the lattice spacing is an integer multiple of the periodicity of the lattice in that direction. Thus, if you create an orthogonal periodic simulation box whose size in a dimension is a multiple of the lattice spacing, and then fill it with atoms via the create_atoms command, you will NOT necessarily create a periodic system. I.e. atoms may overlap incorrectly at the faces of the simulation box.

Regardless of these issues, the values of the lattice spacings LAMMPS calculates are printed out, so their effect in commands that use the spacings should be decipherable.

注意:对于非正交的单胞

使用限制

参数a1/a2/a3/basis只能在custom样式下使用。

相关命令

dimensioncreate_atomsregion

默认设置

lattice none 1.0

对于其他的晶格样式,默认的设置是:origin = 0.0 0.0 0.0, orient = x 1 0 0, orient = y 0 1 0, orient = z 0 0 1, a1 = 1 0 0, a2 = 0 1 0, and a3 = 0 0 1.

标签: lammps, lammps翻译

相关文章推荐

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

已有 4 条评论

  1. 哈哈哈

    请问2019版的lammps运行报错,显示lattice custom 不合法,请问可能的原因是什么呢,我完全按照官网来的呀

  2. hcp建模

    您好,我想问一下在建立hcp金属模型时,建立坐标系中怎么指定xyz轴为文献中的4轴指数所表示的坐标系呢?

  3. LAMMPS学习

    您好,我想用lattice命令建立一个二维材料的模型单晶胞,例如二硫化钼或磷烯或硅烯模型晶胞,请问可以实现吗?您能给予一下指导吗?该如何实现呢?

    1. 这个应该是可以的。具体可以参考这篇文章:
      http://www.52souji.net/usual-modelling-methods-for-lammps.html

      二维材料,dimension要设为2