diff --git a/doc/Eqs/rotate.jpg b/doc/Eqs/rotate.jpg new file mode 100644 index 0000000000..42b46bfa9e Binary files /dev/null and b/doc/Eqs/rotate.jpg differ diff --git a/doc/Eqs/rotate.tex b/doc/Eqs/rotate.tex new file mode 100644 index 0000000000..46fa592a6f --- /dev/null +++ b/doc/Eqs/rotate.tex @@ -0,0 +1,26 @@ +\documentclass[12pt]{article} + +\usepackage{amsmath} + +\begin{document} + +\begin{eqnarray*} +\mathbf{x} + &=& +\begin{pmatrix} +\mathbf{a} & +\mathbf{b} & +\mathbf{c} +\end{pmatrix} +\cdot + \frac{1}{V} + \begin{pmatrix} +\mathbf{B \times C} \\ +\mathbf{C \times A} \\ +\mathbf{A \times B} +\end{pmatrix} +\cdot +\mathbf{X} +\end{eqnarray*} + +\end{document} diff --git a/doc/Eqs/transform.jpg b/doc/Eqs/transform.jpg index d6ed98eb16..31722dd444 100644 Binary files a/doc/Eqs/transform.jpg and b/doc/Eqs/transform.jpg differ diff --git a/doc/Eqs/transform.tex b/doc/Eqs/transform.tex index 7ec66705e5..6048e67181 100644 --- a/doc/Eqs/transform.tex +++ b/doc/Eqs/transform.tex @@ -1,17 +1,27 @@ \documentclass[12pt]{article} +\usepackage{amsmath} + \begin{document} \begin{eqnarray*} -\vec{a} &=& (a_x,0,0) \\ -\vec{b} &=& (b_x,b_y,0) \\ -\vec{c} &=& (c_x,c_y,c_z) \\ +\begin{pmatrix} +\mathbf{a} & +\mathbf{b} & +\mathbf{c} +\end{pmatrix} +& = & +\begin{pmatrix} +a_x & b_x & c_x \\ +0 & b_y & c_y \\ +0 & 0 & c_z \\ +\end{pmatrix} \\ a_x &=& A \\ -b_x &=& (\vec{B} \bullet \vec{A}) \,\, / \,\, A \\ -b_y &=& |\vec{A} \times \vec{B}| \,\, / \,\, A \quad \rm{or} \quad \sqrt{B^2 - {b_x}^2} \\ -c_x &=& (\vec{C} \bullet \vec{A}) \,\, / \,\, A \\ -c_y &=& [\vec{C} \bullet ((\vec{A} \times \vec{B}) \times \vec{A})] \,\, / \,\, |(\vec{A} \times \vec{B}) \times \vec{A}| \quad \rm{or} \quad \sqrt{C^2 - {c_x}^2 -{c_z}^2} \\ -c_z &=& [\vec{C} \bullet (\vec{A} \times \vec{B})] \,\, / \,\, |\vec{A} \times \vec{B}| \\ +b_x &=& \mathbf{B} \cdot \mathbf{\hat{A}} \quad = \quad B \cos{\gamma} \\ +b_y &=& |\mathbf{\hat{A}} \times \mathbf{B}| \quad = \quad B \sin{\gamma} \quad = \quad \sqrt{B^2 - {b_x}^2} \\ +c_x &=& \mathbf{C} \cdot \mathbf{\hat{A}} \quad = \quad C \cos{\beta} \\ +c_y &=& \mathbf{C} \cdot \widehat{(\mathbf{A} \times \mathbf{B})} \times \mathbf{\hat{A}} \quad = \quad \frac{B C - b_x c_x}{b_y} \\ +c_z &=& |\mathbf{C} \cdot \widehat{(\mathbf{A} \times \mathbf{B})}|\quad = \quad \sqrt{C^2 - {c_x}^2 - {c_y}^2} \\ \end{eqnarray*} \end{document} diff --git a/doc/Section_howto.html b/doc/Section_howto.html index 5d9177e319..d3548c1e09 100644 --- a/doc/Section_howto.html +++ b/doc/Section_howto.html @@ -769,11 +769,11 @@ See the dump command for more information on XTC files
By default, LAMMPS uses an orthogonal simulation box to encompass the particles. The boundary command sets the boundary -conditions of the box (periodic, non-,periodic, etc). The orthogonal +conditions of the box (periodic, non-periodic, etc). The orthogonal box has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by a = (xhi-xlo,0,0); b = (0,yhi-ylo,0); c = (0,0,zhi-zlo). The 6 parameters -(xlo,xhi,ylo,yhi,zlo,zhi) are defined at the time the simluation box +(xlo,xhi,ylo,yhi,zlo,zhi) are defined at the time the simulation box is created, e.g. by the create_box or read_data or read_restart commands. Additionally, LAMMPS defines box size parameters lx,ly,lz @@ -781,30 +781,53 @@ where lx = xhi-xlo, and similarly in the y and z dimensions. The 6 parameters, as well as lx,ly,lz, can be output via the thermo_style custom command.
-LAMMPS also allows simulations to be perfored in triclinic +
LAMMPS also allows simulations to be performed in triclinic (non-orthogonal) simulation boxes shaped as a parallelepiped with triclinic symmetry. The parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by a = (xhi-xlo,0,0); b = (xy,yhi-ylo,0); c = -(xz,yz,zhi-zlo). Xy,xz,yz can be 0.0 or positive or negative values +(xz,yz,zhi-zlo). xy,xz,yz can be 0.0 or positive or negative values and are called "tilt factors" because they are the amount of displacement applied to faces of an originally orthogonal box to -transform it into the parallelepiped. Note that in LAMMPS the +transform it into the parallelepiped. In LAMMPS the triclinic simulation box edge vectors a, b, and c cannot be -arbitrary vectors. As indicated, a must be aligned with the x axis, -b must be in the xy plane, and c is arbitrary. However, this is -not a restriction since it is possible to rotate any set of 3 crystal -basis vectors so that they meet this restriction. +arbitrary vectors. As indicated, a must lie on the positive x axis. +b must lie in the xy plane, with strictly positive y component. c may +have any orientation with strictly positive z component. +The requirement that a, b, and c have strictly positive x, y, +and z components, respectively, ensures +that a, b, and c form a complete right-handed basis. +These restrictions impose +no loss of generality, since it is possible to rotate/invert +any set of 3 crystal basis vectors so that they conform to the restrictions.
For example, assume that the 3 vectors A,B,C are the edge -vectors of a general parallelipied, where there is no directional -requirements A,B,C other than they are not co-planar and that -C dotted into (A x B) be > 0, i.e. the vectors are ordered to -satisfy a right-hand rule. The equivalent LAMMPS a,b,c vectors -can be computed as follows where A = |A| = scalar length of A. +vectors of a general parallelepiped, where there is no restriction +on A,B,C other than they form a complete right-handed basis i.e. +A x B . C > 0. +The equivalent LAMMPS a,b,c are a linear rotation of A, B, and +C and can be computed as follows:
where A = |A| indicates the scalar length of A. The ^ hat symbol +indicates the corresponding unit vector. beta and gamma are angles +between the vectors described below. The same rotation must also +be applied to atom positions, velocities, and any other vector quantities. +This can be done 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: +
+
+where V is the volume of the box, X is the original vector quantity and +x is the vector in the LAMMPS basis. +
+If it should happen that +A, B, and C form a left-handed basis, then it is necessary +to first apply an inversion in addition to rotation. This can be achieved +by interchanging two of the vectors or changing the sign of one of them. +
There is no requirement that a triclinic box be periodic in any dimension, though it typically should be in at least the 2nd dimension of the tilt (y in xy) if you want to enforce a shift in periodic @@ -1214,7 +1237,7 @@ discussed below, it can be referenced via the following bracket notation, where ID in this case is the ID of a compute. The leading "c_" would be replaced by "f_" for a fix, or "v_" for a variable:
-| c_ID | entire scalar, vector, or array | ||||||||||||
| c_ID[I] | one element of vector, one column of array | ||||||||||||
| c_ID[I][J] | one element of array
@@ -1413,7 +1436,7 @@ data and scalar/vector/array data.
input, that could be an element of a vector or array. Likewise a
vector input could be a column of an array.
-
|