# Big colloid particles and small LJ particles
lj
units
This command sets the style of units used for a simulation. It determines the units
of all quantities specified in the input script and data file, as well as quantities
output to the screen, log file, and dump files. Typically, this command is used at
the very beginning of an input script. 这个指令设定模拟的格式,它决定了在输入脚
本文件和数据文件以及在屏幕上显示的输出物,日志文件和垃圾文件中所有的单元格式。典
型的是,它经常用于输入脚本的开头
For style lj, all quantities are unitless. Without loss of generality, LAMMPS sets
the fundamental quantities mass, sigma, epsilon, and the Boltzmann constant = 1.
The masses, distances, energies you specify are multiples of these fundamental
values. The formulas relating the reduced or unitless quantity (with an asterisk)
to the same quantity with units is also given. Thus you can use the mass & sigma
& epsilon values for a specific material and convert the results from a unitless
LJ simulation into physical quantities.
对于 lj 格式,所有数量都是无量纲的。不失一般性的,lammps 设定了基本量 质量 sigma
epsilon 和波尔兹曼常数=1。你定义的 质量,距离,能量 是这些基本值的倍数。公式把衰
减量或者是无量纲量(用*)和单元给出的相同的量关联起来。因此你可以用 mass,sigma,
epsilon 值表示一个具体材料并且改变一个无量纲 lj 模拟的物理量的结果。
mass = mass or m
distance = sigma, where x* = x / sigma
time = tau, where tau = t* = t (epsilon / m / sigma^2)^1/2
energy = epsilon, where E* = E / epsilon
velocity = sigma/tau, where v* = v tau / sigma
force = epsilon/sigma, where f* = f sigma / epsilon
torque = epsilon, where t* = t / epsilon
temperature = reduced LJ temperature, where T* = T Kb / epsilon
pressure = reduced LJ pressure, where P* = P sigma^3 / epsilon
dynamic viscosity = reduced LJ viscosity, where eta* = eta sigma^3 / epsilon / tau
charge = reduced LJ charge, where q* = q / (4 pi perm0 sigma epsilon)^1/2
dipole = reduced LJ dipole, moment where *mu = mu / (4 pi perm0 sigma^3 epsilon)^1/2
electric field = force/charge, where E* = E (4 pi perm0 sigma epsilon)^1/2 sigma / epsilon
density = mass/volume, where rho* = rho sigma^dim
atom_style
Define what style of atoms to use in a simulation. This determines what attributes
are associated with the atoms. This command must be used before a simulation is setup
via a read_data, read_restart, or create_box command.
定义在模拟中用到的原子类型,这个决定了与原子有关的属性,这个命令必须用在模拟被设
定之前 通过 read_data, read_restart, or create_box
Atomic
Atomic 附加属性是只是默认值 用于粗粒液体,固体和金属的模拟
atomic 原子类型 atomic(原子的)
only the default values
coarse-grain liquids, solids, metals
dimension2 二维
sq 0.01 建造一个 sq 类型的二维晶格,lj 折合密度 rho*=0.01
lattice
Lattice
Define a lattice for use by other commands. In LAMMPS, a lattice is simply
a set of points in space, determined by a unit cell with basis atoms, that is
replicated infinitely in all dimensions. The arguments of the lattice command can
be used to define a wide variety of crystallographic lattices.
Lattice 指令定义了一个其他指令可以使用的晶格,在 lammps 中,一个晶格是一个空间中简
单的点集,被基本原子构成的所有维度中无限复制的晶胞在所决定。Lattice 指令额参数可以
被用来定义各种各样的晶格。
A lattice is used by LAMMPS in two ways. First, the create_atoms command creates
atoms on the lattice points inside the simulation box. Note that thecreate_atoms
command allows different atom types to be assigned to different basis atoms of the
lattice. Second, the lattice spacing in the x,y,z dimensions implied by the lattice,
can be used by other commands as distance units (e.g. create_box, region and
velocity), which are often convenient to use when the underlying problem geometry
is atoms on a lattice. 一个 lattice 明令在 lammps 中有两种实用方式,首先,create_atoms
command 在模拟盒子内部的格点上创建原子。注意,ecreate_atoms command 允许不同的原
子类型去分配到晶格中不同的基本原子。第二,晶格间距在 x,y,z 轴分量隐含在晶格中,
可以被其他命令应用作为距离单元。这个距离单元当潜在问题的几何构型是在晶格中的原子
的时候经常被方便的使用。
A lattice consists of a unit cell, a set of basis atoms within that cell, and a set
of transformation parameters (scale, origin, orient) that map the unit cell into
the simulation box. The vectors a1,a2,a3 are the edge vectors of the unit cell. This
is the nomenclature for "primitive" vectors in solid-state crystallography, but in
LAMMPS the unit cell they determine does not have to be a "primitive cell" of minimum
volume. 一个晶格由晶胞,晶胞内部的基本原子构成的集合,一个将晶胞绘制入模拟盒子的
基本参数构成的集合构成。矢量 a1,a2,a3 是晶胞的棱矢量,在固态物理学里面用术语
primitive 矢量来表示。但是在 lammps 中不一定要用最小体积的原胞来定义晶胞
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 = scale factor between lattice and simulation box
for style none:
scale is not specified (nor any optional arguments)
for all other styles:
scale = reduced density rho* (for LJ units)
scale = lattice constant in distance units (for non-LJ units)
Lattices of style sq and sq2 are 2d lattices that define a square unit cell with
edge length = 1.0. This means a1 = 1 0 0 and a2 = 0 1 0. A sq lattice has 1 basis
atom at the lower-left corner of the square. A sq2 lattice has 2 basis atoms, one
at the corner and one at the center of the square.
sq and sq2格式的晶格是一个 2 维晶格 这个晶格定义了一个棱长为 1.0 的直角晶胞的 2 维
box block 0 30 0 30 -0.5 0.5
晶胞。这意味着 a1=1 0 0 ,a2=0 1 0。一个 sq 晶格在正方形左下角有一个基本的原子。
Sq2 则有两个基本原子,一个在角落另一个在正方形的中心。
For unit style 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. 对于 li 单元,scale 是 Lennard-Jones
折算密度,典型写为 rho*。Lammps 通过公式"factor^dim = rho/rho*"将这个值转变为倍
增因子。Rho=N/V,v=晶格单元的体积,n=晶胞中基本原子的数量,dim 根据模拟的维度等
于 2 或者 3。实际上这表明如果在模拟中使用的 lj 粒子的 sigma=1.0,那么晶格中的粒子将
会有预期的折算密度。
region
在空间 xlo=0,xhi=30,ylo=0,yhi=30,zlo=—0.5,zhi=0.5 的范围内创建区域。
This command defines a geometric region of space. Various other commands
Region
use regions. For example, the region can be filled with atoms via the
create_atomscommand. Or a bounding box around the region, can be used to define the
simulation box via the create_box command. Or the surface of the region can be used
as a boundary wall via thefix wall/region command. Region 指令定义了一个几何空间。
许多的其他的指令都用这条指令,比如,空间可以被原子充满通过 create_atomscommand。
或者是一个区域周围的边界盒子可以被用来定义迷你盒子通过 create_box command.或者
空间表面可以作为一个边界框使用通过指令 thefix wall/region .
A box value selects standard distance units as defined by the units command, e.g.
Angstroms for units = real or metal. A lattice value means the distance units are
in lattice spacings. The lattice command must have been previously used to define
the lattice spacings which are used as follows:一个 box 值选用被 units 明令定义的
距离标准单位。如 A 对应的 units= real or metal.一个 lattice 值意味着距离单元在晶格
间距内。Lattice 指令必须已经在之前被用于定义晶格间距如:
For style block, the lattice spacing in dimension x is applied to xlo and xhi,
2 box
similarly the spacings in dimensions y,z are applied to ylo/yhi and zlo/zhi.
对于 block 格式,晶格间距在 x 轴上被应用于 xlo and xhi。y,z 轴情况相似。
create_box
This command creates a simulation box based on the specified region. Thus a region
command must first be used to define a geometric domain.这条指令在被指定的区域内
创建一个模拟盒子,因此一个 region 指令必须首先被用来定义一个几何区域。
The argument N is the number of atom types that will be used in the simulation.
参数 n 是在模拟中使用到的原子类型。
在上述空间内建在一个有两种原子类型的模拟箱
create_atoms 1 box
This command creates atoms on a lattice, or a single atom, or a random collection
of atoms, as an alternative to reading in their coordinates explicitly via a
read_data or read_restart command. A simulation box must already exist, which is
typically created via the create_box command. Before using this command, a lattice
must also be defined using the lattice command. The only exceptions are for the single
style with units = box or the random style 这条指令在晶格中创造原子,或者创造一
个简单原子,或是创造一个随即收集的原子,作为读取他们明确坐标的替代物,通过
read_data or read_restart 指令,一个模拟盒子必须已经存在,盒子可以通过 create_box
指令创建。在用这条指令之前,一个晶格也必须用 lattice 指令定义。
For the box style, the create_atoms command fills the entire simulation box with
atoms on the lattice. If your simulation box is periodic, you should insure its size
is a multiple of the lattice spacings, to avoid unwanted atom overlaps at the box
boundaries. If your box is periodic and a multiple of the lattice spacing in a
particular dimension, LAMMPS is careful to put exactly one atom at the boundary (on
either side of the box), not zero or two. 对于box格式, create_atoms 指令将整个
模拟盒子用晶格上的原子填充。如果模拟盒子是周期性的,你必须确保它的大小是一个晶
格间距的整数倍以避免边界上不必要的原子重叠。若箱在特定的维度是周期性的,并且
它的大小是一个晶格间距的整数倍,lammps就会在边界两侧各放一个原子。
set
set style ID keyword values ...
group all type/fraction 2 0.96 2398
Set one or more properties of one or more atoms. Since atom properties are
initially ass
igned by the read_data, read_restart or create_atoms commands, this
command changes those assignments. This can be useful for overriding the default
values assigned by the create_atoms command (e.g. charge = 0.0). It can be useful
for altering pairwise and molecular force interactions, since force-field
coefficients are defined in terms of types. It can be used to change the labeling
of atoms by atom type or molecule ID when they are output in dump files. It can be
useful for debugging purposes; i.e. positioning an atom at a precise location to
compute subsequent forces or energy. 设定一个或多个原子的一个或多个属性。自从原
子属性被 read_data, read_restart or create_atoms 指令所分配,这个命令改变他们的
参数。这个对于通过 create_atoms command 来重置默认值是很有用处的。当力场参数依据
类型被定义后,这条指令对于变更成对的或是分子的相互作用力是有用的。该指令可以被用
来改变原子的标识通过在他们在 dump files 中输出的时候改变原子类型或是分子 id 来完
成。这条指令也对调试目标是有用的。定位一个特定的原子的位置,计算后来的力量或能量。
The style groupselects all the atoms in the specified group. The style region
specified geometric region. Group 格式选择所有的
selects all the atoms in the
原子在指定的群里。Region 格式选择在制定几何区域内德所有原子。
Keyword type/fraction sets the atom type for a fraction of the selected atoms.
The actual number of atoms changed is not guaranteed to be exactly the requested
fraction, but should be statistically close. Random numbers are used in such a way
that a particular atom is changed or not changed, regardless of how many processors
are being used. 关键词 type/fraction 设定一部分指定原子的原子类型。真实的原子改
变的数量不被保证正是需要的部分,但是应该是统计接近的。随机数在一个特定原子是改变
或是不变的时候被使用,不管多少处理器被使用。
type/fraction values = type fraction seed
type = new atom type
fraction = fraction of selected atoms to set to new atom type
seed = random # seed (positive integer)
mass
mass
1 9 第一种原子类型质量为 9 g/mol
2 1 第二种原子类型质量为 1 g/mol
velocity
velocity
all create 1.44 87287 loop geom
group-ID style args
keyword
value ...
Set or change the velocities of a group of atoms in one of several styles. For
each style, there are required arguments and optional keyword/value parameters. Not
all options are used by each style. Each option has a default as listed below.
设定或是改变在一个或是几个类型里一群原子的速度。对于每个类型,都有需要的参数
和可选项 keyword/value 参数。不是所有的可选项都在每一个类型中使用到,每一个可选项
有一个默认值。
The create style generates an ensemble of velocities using a random number
generator with the specified seed as the specified temperature. Creat 类型引发了
全体的速度用一个被指定温度指定的种子的随即数发生器。
group-ID = ID of group of atoms whose velocity will be changed
create args = temp seed
temp = temperature value (temperature units)
seed = random # seed (positive integer)
loop value = all or local or geom
The loop option is used by create in the following ways.
If loop = geom, then each processor loops over only its atoms. For each atom a unique random
number seed is created, based on the atom's xyz coordinates. A velocity is generated using that
seed. This is a fast loop and the velocity assigned to a particular atom will be the same,
independent of how many processors are used.对于每个原子都有基于 xyz 坐标的独一无二的随
机数产生。这是一个快速回路并且分配给特别原子的速度将是一样的,独立于有多少处理器
被使用。
Note that the loop geom option will not necessarily assign identical velocities for two
simulations run on different machines. This is because the computations based on xyz coordinates
are sensitive to tiny differences in the double-precision value for a coordinate as stored on a
particular machine.geom 选项将不必要对不同机器上运行的两个模拟分配完全相同的速度。
这是因为基于 xyz 坐标的运算指令对储存在一个特定机器的双精度坐标值的微小变化是敏
感的。
If units = box, the velocities and coordinates specified in the velocity command
are in the standard units described by the units command (e.g. Angstroms/fmsec for
real units). 如果 units = box,被 velocity command 指定的速度和坐标是被 the units
command 描述的标准单元
# multi neighbor and comm for efficiency
neighbor 1 multi
neighbor skin style
skin = extra distance beyond force cutoff (distance units)
style = bin or nsq or multi
This command sets parameters that affect the building of pairwise neighbor lists.
All atom pairs within a neighbor cutoff distance equal to the their force cutoff
plus the skindistance are stored in the list. Typically, the larger the skin distance,
the less often neighbor lists need to be built, but more pairs must be checked for
possible force interactions every timestep. The default value for skin depends on
the choice of units for the simulation; see the default values below. 这个指令设
定影响成对建造的邻域列表的参数。所有截止距离等于它的力的截断距离加上缓冲距离的原
子对都被储存在列表里。代表性的是,缓冲距离越大所需要构建的临域列表越小,但是每一
步的时候必须检查更多的原子对间可能的相互作用。缓冲距离的默认值依靠模拟单元的选
择。
The skin distance is also used to determine how often atoms migrate to new
processors if the checkoption of the neigh_modify command is set to yes. Atoms are
migrated (communicated) to new processors on the same timestep that neighbor lists
are re-built. 那种距离也被用来定义如果检查 neigh_modify command 设定的是 yes 的情
况下,原子迁移至新的处理器一次要多长时间。在 neighbor 列表被重新构建的同一步里原
子迁移到新的处理器内。
The style value selects what algorithm is used to build the list.
Style 值构建列表的算法。
The multi style is a modified binning algorithm that is useful for systems with
a wide range of cutoff distances, e.g. due to different size particles. For the bin
style, the bin size is set to 1/2 of the largest cutoff distance between any pair
of atom types and a single set of bins is defined to search over for all atom types.
This can be inefficient if one pair of types has a very long cutoff, but other type
pairs have a much shorter cutoff. For style multithe bin size is set to 1/2 of the
shortest cutoff distance and multiple sets of bins are defined to search over for
different atom types. This imposes some extra setup overhead, but the searches
themselves may be much faster for the short-cutoff cases. multi 风格是一个改良
的 bining 算法,对于有广泛截止距离的系统有很大作用。举例来说由于不同的粒子大小,
对于 bin 风格,bin 大小设定为任意两个原子类型之间最大的截止距离 1/2,并且 bin 的基
本设置被定义来搜索所有的原子类型。如果子类型有很长的截至距离这可能是低效的,但是
其他的类型可能会有断的截至距离。例如对于 multithe bin 大小被设置成两个原子类型之
间最小的截止距离 1/2 ,并且 bins 在 multiple 中得设置来定义搜索不同的原子类型。这
个利用其它的设置控制信息,但是搜索本身对于短截止距离的情况可能是很快的。
neigh_modify delay 0
neigh_modify keyword values
delay value = N
N = delay building until this many steps since last build
自上次构建 neighbor 列表之后无延迟
communicate multi
communicate style keyword value
style = single or multi
This command sets the style of inter-processor communication that occurs each
timestep as atom coordinates and other properties are exchanged between neighboring
processors and stored as properties of ghost atoms. 这条指令设置在在每一步中发生
的处理器之间的交流方式,就想原子坐标和其他的属性在相近的处理器之间交换并且作为
ghost 原子储存。
For many systems this is an efficient algorithm, but for systems with widely varying
cutoffs for different type pairs, the multistyle can be faster. In this case, each
atom type is assigned its own distance cutoff for communication purposes, and fewer
atoms will be communicated. 对于很多的系统这会是有效的算法。但是对于有着广泛截止
距离的不同类型的原子对,multi 格式会更快一些,既然这样,每一个类型的原子为了交流
(信息)被分配自己的截至距离,很少的原子会被联系。
# colloid potential
args
style
pair_style colloid 12.5
pair_style
style = one of the styles from the list below
args = arguments used by a particular style
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair
potentials are defined between pairs of atoms that are within a cutoff distance and
the set of active interactions typically changes over time. See the bond_style
command to define potentials between pairs of bonded atoms, which typically remain
in place for the duration of a simulation. 设置 lammps 实用的公式来计算成对发生
的相互作用力。在 lammps 中电位对。被定义在两个在截止距离内的原子之间,有活性的相
互作用的设置随时间典型变化。
In LAMMPS, pairwise force fields encompass a variety of interactions, some of which
include many-body effects, e.g. EAM, Stillinger-Weber, Tersoff, REBO potentials.
They are still classified as "pairwise" potentials because the set of interacting
atoms changes with time (unlike molecular bonds) and thus a neighbor list is used
to find nearby interacting atoms. 在 lammps 中承兑发生的力场包括大量的相互作用,
有些包括多体作用。这些依然被分类为 "pairwise" potentials 因为原子相互作用的设置
随时间变化并且因此 neighbor 列表被用来发现在相互作用附近的原子。
pair_style colloid - integrated(完全的) colloidal(胶体) potential
pair_style colloid cutoff
cutoff = global cutoff for colloidal interactions (distance units) 对于胶体的相
互作用球形的截至距离。
pair_coeff 1 1 1.0 1.0 5.0 5.0 12.5
pair_coeff 1 2 5.0 1.0 5.0 0.0 7.0
pair_coeff 2 2 10.0 1.0 0.0 0.0 2.5
pair_coeff I J args
I,J = atom types (see asterisk form below)
args = coefficients for one or more pairs of atom types
Specify the pairwise force field coefficients for one or more pairs of atom types.
The number and meaning of the coefficients depends on the pair style. Pair
coefficients can also be set in the data file read by the read_data command or in
a restart file. 为一个或更多原子类型制定成对的力场系数。系数的数量和意义取决于
pair style 。每一个系数也可以在数据文件中被设定。在 read data 指令或是在一个重启
文件。
I and J can be specified in one of two ways. Explicit numeric values can be used
for each, as in the 1st example above. I <= J is required. LAMMPS sets the coefficients
for the symmetric J,I interaction to the same values. I 和 J 可以被定义在通过两种
方式。明确的数值可以被用于每个, I <= J 是必须的。Lammps 设置对称的 i,j 相互作用
系数是一样的。
The following coefficients must be defined for each pair of atoms types via the
pair_coeff command 紧跟的系数一定通过 pair_coeff command 被确定为每一个原子对类
型
A (energy units)
sigma (distance units)
d1 (distance units)
d2 (distance units)
cutoff (distance units)
A is the Hamaker energy prefactor A 是 Hamaker 能量速率
Sigma is the size of the solvent particle or the constituent particles integrated
sigma 是溶剂粒子的大小或是胶体粒子的整体的粒子构
over in the colloidal particle
成。fix
1 all npt temp 2.0 2.0 1.0 iso 0.0 1.0 10.0 drag 1.0 &
mtk no pchain 0 tchain 1
2 all enforce2d
fix
fix ID group-ID style args
ID = user-assigned name for the fix
group-ID = ID of the group of atoms to apply the fix to
style = one of a long list of possible style names (see below)
args = arguments used by a particular style
Set a fix that will be applied to a group of atoms. In LAMMPS, a "fix" is any operation
that is applied to the system during timestepping or minimization.设置一个 fix 会
应用为一个原子群里。在 lammps 里面一个"fix"是一个任意的操作在整个时间步伐里应用
于系统中。