Page MenuHomec4science

create_atoms.html
No OneTemporary

File Metadata

Created
Fri, Aug 30, 23:14

create_atoms.html

<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>create_atoms command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>create_atoms type style args keyword values ...
</PRE>
<UL><LI>type = atom type (1-Ntypes) of atoms to create
<LI>style = <I>box</I> or <I>region</I> or <I>single</I> or <I>random</I>
<PRE> <I>box</I> args = none
<I>region</I> args = region-ID
region-ID = atoms will only be created if contained in the region
<I>single</I> args = x y z
x,y,z = coordinates of a single atom (distance units)
<I>random</I> args = N seed region-ID
N = number of atoms to create
seed = random # seed (positive integer)
region-ID = create atoms within this region, use NULL for entire simulation box
</PRE>
<LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>basis</I> or <I>remap</I> or <I>units</I>
<PRE> <I>basis</I> values = M itype
M = which basis atom
itype = atom type (1-N) to assign to this basis atom
<I>remap</I> value = <I>yes</I> or <I>no</I>
<I>units</I> value = <I>lattice</I> or <I>box</I>
<I>lattice</I> = the geometry is defined in lattice units
<I>box</I> = the geometry is defined in simulation box units
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>create_atoms 1 box
create_atoms 3 region regsphere basis 2 3
create_atoms 3 single 0 0 5
</PRE>
<P><B>Description:</B>
</P>
<P>This command creates atoms on a lattice, or a single atom, or a random
collection of atoms, as an alternative to reading in their coordinates
explicitly via a <A HREF = "read_data.html">read_data</A> or
<A HREF = "read_restart.html">read_restart</A> command. A simulation box must
already exist, which is typically created via the
<A HREF = "create_box.html">create_box</A> command. Before using this command, a
lattice must also be defined using the <A HREF = "lattice.html">lattice</A> command.
The only exceptions are for the <I>single</I> style with units = box or the
<I>random</I> style.
</P>
<P>For the <I>box</I> style, the create_atoms command fills the entire
simulation box with atoms on the lattice. If your simulation box is
periodic, you should insure its size is a multiple of the lattice
spacings, to avoid unwanted atom overlaps at the box boundaries. If
your box is periodic and a multiple of the lattice spacing in a
particular dimension, LAMMPS is careful to put exactly one atom at the
boundary (on either side of the box), not zero or two.
</P>
<P>For the <I>region</I> style, the geometric volume is filled that is inside
the simulation box and is also consistent with the region volume. See
the <A HREF = "region.html">region</A> command for details. Note that a region can
be specified so that its "volume" is either inside or outside a
geometric boundary. Also note that if your region is the same size as
a periodic simulation box (in some dimension), LAMMPS does not
implement the same logic as with the <I>box</I> style, to insure exactly
one atom at the boundary. if this is what you desire, you should
either use the <I>box</I> style, or tweak the region size to get precisely
the atoms you want.
</P>
<P>For the <I>single</I> style, a single atom is added to the system at the
specified coordinates. This can be useful for debugging purposes or
to create a tiny system with a handful of atoms at specified
positions.
</P>
<P>For the <I>random</I> style, N atoms are added to the system at randomly
generated coordinates, which can be useful for generating an amorphous
system. The atoms are created one by one using the speficied random
number <I>seed</I>, resulting in the same set of atom coordinates,
independent of how many processors are being used in the simulation.
If the <I>region-ID</I> argument is specified as NULL, then the created
atoms will be anywhere in the simulation box. If a <I>region-ID</I> is
specified, a geometric volume is filled that is inside the simulation
box and is also consistent with the region volume. See the
<A HREF = "region.html">region</A> command for details. Note that a region can be
specified so that its "volume" is either inside or outside a geometric
boundary.
</P>
<P>IMPORTANT NOTE: The atoms generated by the <I>random</I> style will
typically be highly overlapped which will cause many interatomic
potentials to compute large energies and forces. Thus you should
either perform an <A HREF = "minimize.html">energy minimization</A> or run dynamics
with <A HREF = "fix_nve_limit.html">fix nve/limit</A> to equilibrate such a system,
before running normal dynamics.
</P>
<P>The <I>basis</I> keyword specifies an atom type that will be assigned to
specific basis atoms as they are created. See the
<A HREF = "lattice.html">lattice</A> command for specifics on how basis atoms are
defined for the unit cell of the lattice. By default, all created
atoms are assigned the argument <I>type</I> as their atom type.
</P>
<P>The <I>remap</I> keyword only applies to the <I>single</I> style. If it is set
to <I>yes</I>, then if the specified position is outside the simulation
box, it will mapped back into the box, assuming the relevant
dimensions are periodic. If it is set to <I>no</I>, no remapping is done
and no atom is created if its position is outside the box.
</P>
<P>The <I>units</I> keyword determines the meaning of the distance units used
to specify the coordinates of the one atom created by the <I>single</I>
style. A <I>box</I> value selects standard distance units as defined by
the <A HREF = "units.html">units</A> command, e.g. Angstroms for units = real or
metal. A <I>lattice</I> value means the distance units are in lattice
spacings.
</P>
<P>Note that this command adds atoms to those that already exist. By
using the create_atoms command multiple times, multiple sets of atoms
can be added to the simulation. For example, interleaving
create_atoms with <A HREF = "lattice.html">lattice</A> commands specifying different
orientations, grain boundaries can be created. By using the
create_atoms command in conjunction with the
<A HREF = "delete_atoms.html">delete_atoms</A> command, reasonably complex
geometries can be created. The create_atoms command can also be used
to add atoms to a system previously read in from a data or restart
file. In all these cases, care should be taken to insure that new
atoms do not overlap existing atoms inappropriately. The
<A HREF = "delete_atoms.html">delete_atoms</A> command can be used to handle
overlaps.
</P>
<P>Atom IDs are assigned to created atoms in the following way. The
collection of created atoms are assigned consecutive IDs that start
immediately following the largest atom ID existing before the
create_atoms command was invoked. When a simulation is performed on
different numbers of processors, there is no guarantee a particular
created atom will be assigned the same ID.
</P>
<P>Aside from their ID, atom type, and xyz position, other properties of
created atoms are set to default values, depending on which quantities
are defined by the chosen <A HREF = "atom_style.html">atom style</A>. See the <A HREF = "atom_style.html">atom
style</A> command for more details. See the
<A HREF = "set.html">set</A> and <A HREF = "velocity.html">velocity</A> commands for info on how
to change these values.
</P>
<UL><LI>charge = 0.0
<LI>dipole moment magnitude = 0.0
<LI>diameter = 1.0
<LI>shape = 0.0 0.0 0.0
<LI>density = 1.0
<LI>volume = 1.0
<LI>velocity = 0.0 0.0 0.0
<LI>angular velocity = 0.0 0.0 0.0
<LI>angular momentum = 0.0 0.0 0.0
<LI>quaternion = (1,0,0,0)
<LI>bonds, angles, dihedrals, impropers = none
</UL>
<P>Note that the <I>sphere</I> atom style sets the default particle diameter
to 1.0 as well as the density. This means the mass for the particle
is not 1.0, but is PI/6 * diameter^3 = 0.5236.
</P>
<P>Note that the <I>ellipsoid</I> atom style sets the default particle shape
to (0.0 0.0 0.0) and the density to 1.0 which means it is a point
particle, not an ellipsoid, and has a mass of 1.0.
</P>
<P>Note that the <I>peri</I> style sets the default volume and density to 1.0
and thus also set the mass for the particle to 1.0.
</P>
<P>The <A HREF = "set.html">set</A> command can be used to override many of these
default settings.
</P>
<P><B>Restrictions:</B>
</P>
<P>An <A HREF = "atom_style.html">atom_style</A> must be previously defined to use this
command.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "lattice.html">lattice</A>, <A HREF = "region.html">region</A>, <A HREF = "create_box.html">create_box</A>,
<A HREF = "read_data.html">read_data</A>, <A HREF = "read_restart.html">read_restart</A>
</P>
<P><B>Default:</B>
</P>
<P>The default for the <I>basis</I> keyword is that all created atoms are
assigned the argument <I>type</I> as their atom type. The default for
<I>remap</I> = no and for <I>units</I> = lattice.
</P>
</HTML>

Event Timeline