Domain

class Domain

A Domain represents the spatial boundaries and constraints imposed upon the positions of the particles.

The origin is always located at the center of the domain.

By default, periodicity in each dimension is enabled when the side lengths are set.

A cuboid-shaped domain may have unique side lengths but the angles between the edges of the domain are fixed at ninety degrees. In two-dimensions, the cuboid reduces to a rectangle.

A triclinic-shaped domain is similar to cuboid-shaped except that the angles between the boundaries may different from ninety degrees. In two-dimensions, this reduces to a parallelogram.

The triclinic periodic cell is defined by a vector for each dimension. This implementation is only valid for two- or three-dimensions.

For the first (i.e., “x”):

\( \vec{l}_x = \{l_x, 0, 0\} \)

For the second (i.e., “y”):

\( \vec{l}_y = \{xy, l_y, 0\} \)

For the third (i.e., “z”):

\( \vec{l}_z = \{xz, yz, l_z\} \)

Thus, the angle, \(\alpha\), between the “x” and “y” vectors is given by

\( |l_x| |l_y| \cos\alpha = \vec{l}_x \cdot \vec{l}_y\).

Scaled coordinates, \(\vec{s}\), defined in the range of [0, 1] in each dimension, are related to the Cartesian coordinates, \(\vec{x}\), via the matrix, \( \mathbf{H}=[\vec{l}_x,\vec{l}_y,\vec{l}_z] \), as follows:

\( \vec{x} = \mathbf{H} \vec{s} \)

\( \vec{s} = \mathbf{H}^{-1} \vec{x} \)

\( \mathbf{H} = \begin{bmatrix} lx & xy & xz\\ 0 & ly & yz\\ 0 & 0 & lz \end{bmatrix} \)

\( \mathbf{H}^{-1} = \begin{bmatrix} 1/lx & -\frac{xy}{lx* ly} & \frac{xy* yz - xz* ly}{lx* ly* lz}\\ 0 & 1/ly & -\frac{yz}{ly* lz}\\ 0 & 0 & 1/lz \end{bmatrix} \)

For more information, see LAMMPS: https://docs.lammps.org/Howto_triclinic.html

Another good resource is Section 4.1 of https://doi.org/10.1080/08927022.2013.819102

Periodic boundaries conditions are applied in scalar coordinates as

\( \vec{s}' = \vec{s} - \mathrm{rint}(\vec{s}) \)

where rint rounds a real number to the nearest integer.

By comparison, the angles \( \alpha, \beta, \gamma \) and scalar boundary lengths \( a, b, c \) are related to the above variables as follows:

\( lx = a \)

\( ly = b \cos(\gamma) \)

\( lz = c \sqrt{1-\cos(\beta)^2-\eta} \)

\( \eta = \frac{\cos(\alpha) - \cos(\gamma)\cos(\beta)}{\sin(\gamma)} \)

\( xy = ly \cos(\gamma) \)

\( xz = c \cos(\beta) \)

\( yz = c \eta \)

Or in the other direction

\( a = lx\)

\( b^2 = ly^2 + xy^2 \)

\( c^2 = lz^2 + xz^2 + yz^2 \)

\( \cos(\alpha) = \frac{xy*xz + ly*yz}{b*c}\)

\( \cos(\beta) = xz/c\)

\( \cos(\gamma) = xy/b\)

Arguments

  • side_length: set the side length(s) of each dimension. Multiple side lengths may be provided as a comma-separated list.

  • cubic_side_length: side length of cubic perioidic boundary conditions.

  • periodic: set if the side length(s) are periodic (default: true). If given, multiple must be provided as a comma-separated list equal to the number of dimensions.

  • xy: set the tilt along the x-y direction (default: 0).

  • xz: set the tilt along the x-z direction (default: 0).

  • yz: set the tilt along the y-z direction (default: 0).