~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to doc/lattice.html

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
unit cell they determine does not have to be a "primitive cell" of
83
83
minimum volume.
84
84
</P>
 
85
<P>Note that the lattice command can be used multiple times in an input
 
86
script.  Each time it is invoked, the lattice attributes are
 
87
re-defined and are used for all subsequent commands (that use lattice
 
88
attributes).  For example, a sequence of lattice,
 
89
<A HREF = "region.html">region</A>, and <A HREF = "create_atoms.html">create_atoms</A> commands
 
90
can be repeated multiple times to build a poly-crystalline model with
 
91
different geometric regions populated with atoms in different lattice
 
92
orientations.
 
93
</P>
85
94
<HR>
86
95
 
87
96
<P>A lattice of style <I>none</I> does not define a unit cell and basis set,
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
178
 
simulation box.
 
183
the Z direction.
 
184
</P>
 
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.
179
192
</P>
180
193
<HR>
181
194
 
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.  
186
199
</P>
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
194
 
lattices.
 
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.
195
207
</P>
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.
204
216
</P>
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.
211
223
</P>
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.
222
 
</P>
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.
 
234
</P>
 
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.
 
243
</P>
 
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.
226
247
</P>
227
248
<HR>
228
249