168
177
the crystallographic direction in the lattice that you want to orient
169
178
along that axis, specified as integers. E.g. "orient x 2 1 0" means
170
179
the x-axis in the simulation box will be the [210] lattice
171
direction. The 3 lattice directions you specify must be mutually
180
direction, and similarly for y and z. The 3 lattice directions you
181
specify do not have to be unit vectors, but they must be mutually
172
182
orthogonal and obey the right-hand rule, i.e. (X cross Y) points in
173
the Z direction. Note that this description is really only valid for
174
orthogonal lattices. If you are using the more general lattice style
175
<I>custom</I> with non-orthogonal a1,a2,a3 vectors, then think of the 3
176
<I>orient</I> options as creating a 3x3 rotation matrix which is applied to
177
a1,a2,a3 to rotate the original unit cell to a new orientation in the
185
<P>IMPORTANT NOTE: The preceding paragraph describing lattice directions
186
is only valid for orthogonal cubic unit cells (or square in 2d). If
187
you are using a <I>hcp</I> or <I>hex</I> lattice or the more general lattice
188
style <I>custom</I> with non-orthogonal a1,a2,a3 vectors, then you should
189
think of the 3 <I>orient</I> vectors as creating a 3x3 rotation matrix
190
which is applied to a1,a2,a3 to rotate the original unit cell to a new
191
orientation in the simulation box.
182
195
<P>Several LAMMPS commands have the option to use distance units that are
183
inferred from "lattice spacing" in the x,y,z box directions. E.g. the
184
<A HREF = "region.html">region</A> command can create a block of size 10x20x20,
185
where 10 means 10 lattice spacings in the x direction.
196
inferred from "lattice spacings" in the x,y,z box directions.
197
E.g. the <A HREF = "region.html">region</A> command can create a block of size
198
10x20x20, where 10 means 10 lattice spacings in the x direction.
187
<P>The <I>spacing</I> option sets the 3 lattice spacings directly. All must
188
be non-zero (use 1.0 for dz in a 2d simulation). The specified values
189
are multiplied by the multiplicative factor described above that is
190
associated with the scale factor. Thus a spacing of 1.0 means one
191
unit cell independent of the scale factor. This option can be useful
192
if the spacings LAMMPS computes are inconvenient to use in subsequent
193
commands, which can be the case for non-orthogonal or rotated
200
<P>IMPORTANT NOTE: Though they are called lattice spacings, all the
201
commands that have a "units lattice" option, simply use the 3 values
202
as scale factors on the distance units defined by the
203
<A HREF = "units.html">units</A> command. Thus if you do not like the lattice
204
spacings computed by LAMMPS (e.g. for a non-orthogonal or rotated unit
205
cell), you can define the 3 values to be whatever you wish, via the
206
<I>spacing</I> option.
196
208
<P>If the <I>spacing</I> option is not specified, the lattice spacings are
197
209
computed by LAMMPS in the following way. A unit cell of the lattice
198
is mapped into the simulation box (scaled, shifted, rotated), so that
199
it now has (perhaps) a modified size and orientation. The lattice
200
spacing in X is defined as the difference between the min/max extent
201
of the x coordinates of the 8 corner points of the modified unit cell.
202
Similarly, the Y and Z lattice spacings are defined as the difference
203
in the min/max of the y and z coordinates.
210
is mapped into the simulation box (scaled and rotated), so that it now
211
has (perhaps) a modified size and orientation. The lattice spacing in
212
X is defined as the difference between the min/max extent of the x
213
coordinates of the 8 corner points of the modified unit cell (4 in
214
2d). Similarly, the Y and Z lattice spacings are defined as the
215
difference in the min/max of the y and z coordinates.
205
<P>Note that if the unit cell is orthogonal with axis-aligned edges (not
206
rotated via the <I>orient</I> keyword), then the lattice spacings in each
217
<P>Note that if the unit cell is orthogonal with axis-aligned edges (no
218
rotation via the <I>orient</I> keyword), then the lattice spacings in each
207
219
dimension are simply the scale factor (described above) multiplied by
208
220
the length of a1,a2,a3. Thus a <I>hex</I> style lattice with a scale
209
221
factor of 3.0 Angstroms, would have a lattice spacing of 3.0 in x and
210
222
3*sqrt(3.0) in y.
212
224
<P>IMPORTANT NOTE: For non-orthogonal unit cells and/or when a rotation
213
is applied via the <I>orient</I> keyword, then the lattice spacings may be
214
less intuitive. In particular, in these cases, there is no guarantee
215
that the lattice spacing is an integer multiple of the periodicity of
216
the lattice in that direction. Thus, if you create an orthogonal
217
periodic simulation box whose size in a dimension is a multiple of the
218
lattice spacing, and then fill it with atoms via the
219
<A HREF = "create_atoms.html">create_atoms</A> command, you will NOT necessarily
220
create a periodic system. I.e. atoms may overlap incorrectly at the
221
faces of the simulation box.
223
<P>Regardless of these issues, the values of the lattice spacings LAMMPS
224
calculates are printed out, so their effect in commands that use the
225
spacings should be decipherable.
225
is applied via the <I>orient</I> keyword, then the lattice spacings
226
computed by LAMMPS are typically less intuitive. In particular, in
227
these cases, there is no guarantee that a particular lattice spacing
228
is an integer multiple of the periodicity of the lattice in that
229
direction. Thus, if you create an orthogonal periodic simulation box
230
whose size in a dimension is a multiple of the lattice spacing, and
231
then fill it with atoms via the <A HREF = "create_atoms.html">create_atoms</A>
232
command, you will NOT necessarily create a periodic system.
233
I.e. atoms may overlap incorrectly at the faces of the simulation box.
235
<P>The <I>spacing</I> option sets the 3 lattice spacings directly. All must
236
be non-zero (use 1.0 for dz in a 2d simulation). The specified values
237
are multiplied by the multiplicative factor described above that is
238
associated with the scale factor. Thus a spacing of 1.0 means one
239
unit cell edge length independent of the scale factor. As mentioned
240
above, this option can be useful if the spacings LAMMPS computes are
241
inconvenient to use in subsequent commands, which can be the case for
242
non-orthogonal or rotated lattices.
244
<P>Note that whenever the lattice command is used, the values of the
245
lattice spacings LAMMPS calculates are printed out. Thus their effect
246
in commands that use the spacings should be decipherable.