# # Triclinic (non-orthogonal) simulation boxes

LAMMPS同样支持三斜体系。三斜盒子同样有它的原点(xlo ylo zlo)，然后定义了三个边向量

a=(xhi-xlo,0,0)\\b=(xy,yhi-ylo)\\ c=(xz, yz, zhi-zlo)

xy xz yz称为倾斜系数(tilt factors)，它们是应用于原本正交长方体的面以将其转换为平行六面体的位移量。

LAMMPS中，$a b c$三个向量不能随意设置。a必须在x正轴上，b在 xy平面指向y轴正方向上，c指向z轴正方向。这也就是要求整个三斜盒子都在第一卦限中，确保是“右手系”。

$(\mathbf{a} \quad \mathbf{b} \quad \mathbf{c})=\left(\begin{array}{ccc} a_{x} & b_{x} & c_{x} \\ 0 & b_{y} & c_{y} \\ 0 & 0 & c_{z} \end{array}\right)$

$a_{x}=A$

$b_{x}=\mathbf{B} \cdot \hat{\mathbf{A}} \quad=\quad B \cos \gamma$

$b_{y}=|\hat{\mathbf{A}} \times \mathbf{B}|=B \sin \gamma=\sqrt{B^{2}-b_{x}^{2}}$

$c_{x}=\mathbf{C} \cdot \hat{\mathbf{A}} \quad=\quad C \cos \beta$

c_{y}=\mathbf{C} \cdot(\widehat{\mathbf{A} \times \mathbf{B}}) \times \hat{\mathbf{A}} \quad=\frac{\mathbf{B} \cdot \mathbf{C}-b_{x} c_{x}}{b_{y}} c_{z}=|\mathbf{C} \cdot(\widehat{\mathbf{A} \times \mathbf{B}})|=\sqrt{C^{2}-c_{x}^{2}-c_{y}^{2}}

where A = | A | indicates the scalar length of A. The hat symbol (^) indicates the corresponding unit vector. and are angles between the vectors described below. Note that by construction, a, b, and c have strictly positive x, y, and z components, respectively. If it should happen that A, B, and C form a left-handed basis, then the above equations are not valid for c. In this case, it is necessary to first apply an inversion. This can be achieved by interchanging two basis vectors or by changing the sign of one of them.

For consistency, the same rotation/inversion applied to the basis vectors must also be applied to atom positions, velocities, and any other vector quantities. This can be conveniently achieved by first converting to fractional coordinates in the old basis and then converting to distance coordinates in the new basis. The transformation is given by the following equation:

$\mathbf{x}=(\begin{array}{lll} \mathbf{a} & \mathbf{b} & \mathbf{c}) \cdot \frac{1}{V}\left(\begin{array}{l} \mathbf{B} \times \mathbf{C} \\ \mathbf{C} \times \mathbf{A} \\ \mathbf{A} \times \mathbf{B} \end{array}\right) \end{array}\cdot \mathbf{X}$

where V is the volume of the box, X is the original vector quantity and x is the vector in the LAMMPS basis.

• create_box
• change_box

a=\operatorname{lx} b^{2}=\operatorname{ly}^{2}+\mathrm{xy}^{2}

$c^{2}=\mathrm{lz}^{2}+\mathrm{xz}^{2}+\mathrm{yz}^{2}$

$\cos \alpha=\frac{\mathrm{xy} * \mathrm{xz}+\mathrm{ly} * \mathrm{yz}}{b * c}$

$\cos \beta=\frac{\mathrm{xz}}{c}$

$\cos \gamma=\frac{\mathrm{xy}}{b}$

$\mathrm{lx}=a$

$\mathrm{xy}=b \cos \gamma$

$\mathrm{xz}=c \cos \beta$

$\mathrm{ly}^{2}=b^{2}-\mathrm{xy}^{2}$

$\mathrm{yz}=\frac{b * c \cos \alpha-\mathrm{xy} * \mathrm{xz}}{\mathrm{ly}}$

$\mathrm{lz}^{2}=c^{2}-\mathrm{xz}^{2}-\mathrm{yz}^{2}$

$a b c$$\alpha \beta \gamma$可以通过内置热力学参数cella cellb cellalpha打印出来。

dump文件的帧头格式：

ITEM: BOX BOUNDS xy xz yz
xlo_bound xhi_bound xy
ylo_bound yhi_bound xz
zlo_bound zhi_bound yz

1
2
3
4

_bound是为了可视化处理而给出的变量，由以下算出：

xlo_bound = xlo + MIN(0.0,xy,xz,xy+xz)
xhi_bound = xhi + MAX(0.0,xy,xz,xy+xz)
ylo_bound = ylo + MIN(0.0,yz)
yhi_bound = yhi + MAX(0.0,yz)
zlo_bound = zlo
zhi_bound = zhi

1
2
3
4
5
6

One use of triclinic simulation boxes is to model solid-state crystals with triclinic symmetry. The lattice command can be used with non-orthogonal basis vectors to define a lattice that will tile a triclinic simulation box via the create_atoms command.

A second use is to run Parrinello-Rahman dynamics via the fix npt command, which will adjust the xy, xz, yz tilt factors to compensate for off-diagonal components of the pressure tensor. The analog for an energy minimization is the fix box/relax command.

A third use is to shear a bulk solid to study the response of the material. The fix deform command can be used for this purpose. It allows dynamic control of the xy, xz, yz tilt factors as a simulation runs. This is discussed in the next section on non-equilibrium MD (NEMD) simulations.