Merge remote-tracking branch 'lammps-ro/master' into lammps-icms

Resolved Conflicts:
	doc/Manual.html
	doc/Manual.txt
This commit is contained in:
Axel Kohlmeyer
2014-11-20 10:51:29 -05:00
23 changed files with 1313 additions and 501 deletions

View File

@ -1,7 +1,7 @@
<HTML>
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="20 Nov 2014 version">
<META NAME="docnumber" CONTENT="22 Nov 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -22,7 +22,7 @@
<CENTER><H3>LAMMPS-ICMS Documentation
</H3></CENTER>
<CENTER><H4>20 Nov 2014 version
<CENTER><H4>22 Nov 2014 version
</H4></CENTER>
<H4>Version info:
</H4>

View File

@ -1,7 +1,7 @@
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="20 Nov 2014 version">
<META NAME="docnumber" CONTENT="22 Nov 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -19,7 +19,7 @@
<H1></H1>
LAMMPS-ICMS Documentation :c,h3
20 Nov 2014 version :c,h4
22 Nov 2014 version :c,h4
Version info: :h4

View File

@ -443,14 +443,14 @@ KOKKOS, o = USER-OMP, t = OPT.
<TR ALIGN="center"><TD ><A HREF = "compute_angle_local.html">angle/local</A></TD><TD ><A HREF = "compute_atom_molecule.html">atom/molecule</A></TD><TD ><A HREF = "compute_body_local.html">body/local</A></TD><TD ><A HREF = "compute_bond_local.html">bond/local</A></TD><TD ><A HREF = "compute_centro_atom.html">centro/atom</A></TD><TD ><A HREF = "compute_cluster_atom.html">cluster/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_cna_atom.html">cna/atom</A></TD><TD ><A HREF = "compute_com.html">com</A></TD><TD ><A HREF = "compute_com_molecule.html">com/molecule</A></TD><TD ><A HREF = "compute_contact_atom.html">contact/atom</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD><TD ><A HREF = "compute_damage_atom.html">damage/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_dihedral_local.html">dihedral/local</A></TD><TD ><A HREF = "compute_dilatation_atom.html">dilatation/atom</A></TD><TD ><A HREF = "compute_displace_atom.html">displace/atom</A></TD><TD ><A HREF = "compute_erotate_asphere.html">erotate/asphere</A></TD><TD ><A HREF = "compute_erotate_rigid.html">erotate/rigid</A></TD><TD ><A HREF = "compute_erotate_sphere.html">erotate/sphere</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_erotate_sphere_atom.html">erotate/sphere/atom</A></TD><TD ><A HREF = "compute_event_displace.html">event/displace</A></TD><TD ><A HREF = "compute_group_group.html">group/group</A></TD><TD ><A HREF = "compute_gyration.html">gyration</A></TD><TD ><A HREF = "compute_gyration_molecule.html">gyration/molecule</A></TD><TD ><A HREF = "compute_heat_flux.html">heat/flux</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_improper_local.html">improper/local</A></TD><TD ><A HREF = "compute_inertia_molecule.html">inertia/molecule</A></TD><TD ><A HREF = "compute_ke.html">ke</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD><TD ><A HREF = "compute_ke_rigid.html">ke/rigid</A></TD><TD ><A HREF = "compute_msd.html">msd</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_msd_molecule.html">msd/molecule</A></TD><TD ><A HREF = "compute_msd_nongauss.html">msd/nongauss</A></TD><TD ><A HREF = "compute_pair.html">pair</A></TD><TD ><A HREF = "compute_pair_local.html">pair/local</A></TD><TD ><A HREF = "compute_pe.html">pe (c)</A></TD><TD ><A HREF = "compute_pe_atom.html">pe/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_plasticity_atom.html">plasticity/atom</A></TD><TD ><A HREF = "compute_pressure.html">pressure (c)</A></TD><TD ><A HREF = "compute_property_atom.html">property/atom</A></TD><TD ><A HREF = "compute_property_local.html">property/local</A></TD><TD ><A HREF = "compute_property_molecule.html">property/molecule</A></TD><TD ><A HREF = "compute_rdf.html">rdf</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_reduce.html">reduce</A></TD><TD ><A HREF = "compute_reduce.html">reduce/region</A></TD><TD ><A HREF = "compute_slice.html">slice</A></TD><TD ><A HREF = "compute_sna.html">sna/atom</A></TD><TD ><A HREF = "compute_sna.html">snad/atom</A></TD><TD ><A HREF = "compute_sna.html">snav/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_temp.html">temp (c)</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD><TD ><A HREF = "compute_temp_com.html">temp/com</A></TD><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial (c)</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_temp_profile.html">temp/profile</A></TD><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD><TD ><A HREF = "compute_temp_region.html">temp/region</A></TD><TD ><A HREF = "compute_temp_sphere.html">temp/sphere</A></TD><TD ><A HREF = "compute_ti.html">ti</A></TD><TD ><A HREF = "compute_vacf.html">vacf</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_voronoi_atom.html">voronoi/atom</A>
<TR ALIGN="center"><TD ><A HREF = "compute_erotate_sphere_atom.html">erotate/sphere/atom</A></TD><TD ><A HREF = "compute_event_displace.html">event/displace</A></TD><TD ><A HREF = "compute_force_molecule.html">force/molecule</A></TD><TD ><A HREF = "compute_group_group.html">group/group</A></TD><TD ><A HREF = "compute_gyration.html">gyration</A></TD><TD ><A HREF = "compute_gyration_molecule.html">gyration/molecule</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_heat_flux.html">heat/flux</A></TD><TD ><A HREF = "compute_improper_local.html">improper/local</A></TD><TD ><A HREF = "compute_inertia_molecule.html">inertia/molecule</A></TD><TD ><A HREF = "compute_ke.html">ke</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD><TD ><A HREF = "compute_ke_rigid.html">ke/rigid</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_msd.html">msd</A></TD><TD ><A HREF = "compute_msd_molecule.html">msd/molecule</A></TD><TD ><A HREF = "compute_msd_nongauss.html">msd/nongauss</A></TD><TD ><A HREF = "compute_pair.html">pair</A></TD><TD ><A HREF = "compute_pair_local.html">pair/local</A></TD><TD ><A HREF = "compute_pe.html">pe (c)</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_pe_atom.html">pe/atom</A></TD><TD ><A HREF = "compute_plasticity_atom.html">plasticity/atom</A></TD><TD ><A HREF = "compute_pressure.html">pressure (c)</A></TD><TD ><A HREF = "compute_property_atom.html">property/atom</A></TD><TD ><A HREF = "compute_property_local.html">property/local</A></TD><TD ><A HREF = "compute_property_molecule.html">property/molecule</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_rdf.html">rdf</A></TD><TD ><A HREF = "compute_reduce.html">reduce</A></TD><TD ><A HREF = "compute_reduce.html">reduce/region</A></TD><TD ><A HREF = "compute_slice.html">slice</A></TD><TD ><A HREF = "compute_sna.html">sna/atom</A></TD><TD ><A HREF = "compute_sna.html">snad/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_sna.html">snav/atom</A></TD><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_temp.html">temp (c)</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD><TD ><A HREF = "compute_temp_com.html">temp/com</A></TD><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_temp_partial.html">temp/partial (c)</A></TD><TD ><A HREF = "compute_temp_profile.html">temp/profile</A></TD><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD><TD ><A HREF = "compute_temp_region.html">temp/region</A></TD><TD ><A HREF = "compute_temp_sphere.html">temp/sphere</A></TD><TD ><A HREF = "compute_ti.html">ti</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_vacf.html">vacf</A></TD><TD ><A HREF = "compute_vcm_molecule.html">vcm/molecule</A></TD><TD ><A HREF = "compute_voronoi_atom.html">voronoi/atom</A>
</TD></TR></TABLE></DIV>
<P>These are additional compute styles in USER packages, which can be

View File

@ -641,6 +641,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"erotate/sphere"_compute_erotate_sphere.html,
"erotate/sphere/atom"_compute_erotate_sphere_atom.html,
"event/displace"_compute_event_displace.html,
"force/molecule"_compute_force_molecule.html,
"group/group"_compute_group_group.html,
"gyration"_compute_gyration.html,
"gyration/molecule"_compute_gyration_molecule.html,
@ -681,6 +682,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"temp/sphere"_compute_temp_sphere.html,
"ti"_compute_ti.html,
"vacf"_compute_vacf.html,
"vcm/molecule"_compute_vcm_molecule.html,
"voronoi/atom"_compute_voronoi_atom.html :tb(c=6,ea=c)
These are additional compute styles in USER packages, which can be

View File

@ -0,0 +1,63 @@
<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>compute force/molecule command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID force/molecule
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>force/molecule = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 fluid force/molecule
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the total force on individual
molecules, as a sum over the forces on atoms in the molecule. The
x,y,z components of the force on each molecule are computed.
</P>
<P>The force on a particular molecule is only computed if one or more of
its atoms are in the specified group. Normally all atoms in the
molecule should be in the group, however this is not required. LAMMPS
will warn you if this is not the case. Only atoms in the group
contribute to the force on the molecule.
</P>
<P>The ordering of per-molecule quantities produced by this compute is
consistent with the ordering produced by other compute commands that
generate per-molecule datums. Conceptually, them molecule IDs will be
in ascending order for any molecule with one or more of its atoms in
the specified group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global array where the number of rows =
Nmolecules and the number of columns = 3 for the fx,fy,fz components
of force on each molecule. These values can be accessed by any
command that uses global array values from a compute as input. See
<A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an overview of
LAMMPS output options.
</P>
<P>The array values are "intensive". The array values will be in
distance <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_vcm_molecule.html">compute vcm/molecule</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>

View File

@ -0,0 +1,58 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute force/molecule command :h3
[Syntax:]
compute ID group-ID force/molecule :pre
ID, group-ID are documented in "compute"_compute.html command
force/molecule = style name of this compute command :ul
[Examples:]
compute 1 fluid force/molecule :pre
[Description:]
Define a computation that calculates the total force on individual
molecules, as a sum over the forces on atoms in the molecule. The
x,y,z components of the force on each molecule are computed.
The force on a particular molecule is only computed if one or more of
its atoms are in the specified group. Normally all atoms in the
molecule should be in the group, however this is not required. LAMMPS
will warn you if this is not the case. Only atoms in the group
contribute to the force on the molecule.
The ordering of per-molecule quantities produced by this compute is
consistent with the ordering produced by other compute commands that
generate per-molecule datums. Conceptually, them molecule IDs will be
in ascending order for any molecule with one or more of its atoms in
the specified group.
[Output info:]
This compute calculates a global array where the number of rows =
Nmolecules and the number of columns = 3 for the fx,fy,fz components
of force on each molecule. These values can be accessed by any
command that uses global array values from a compute as input. See
"Section_howto 15"_Section_howto.html#howto_15 for an overview of
LAMMPS output options.
The array values are "intensive". The array values will be in
distance "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute vcm/molecule"_compute_vcm_molecule.html
[Default:] none

View File

@ -0,0 +1,65 @@
<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>compute vcm/molecule command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID vcm/molecule
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>vcm/molecule = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 fluid vcm/molecule
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the center-of-mass velocity of
individual molecules. The x,y,z components of the velocity of each
molecule are computed. This is calcualted by summing mass*velocity
for each atom in the molecule and dividing the sum by the total mass
of the molecule.
</P>
<P>The velocity of a particular molecule is only computed if one or more
of its atoms are in the specified group. Normally all atoms in the
molecule should be in the group, however this is not required. LAMMPS
will warn you if this is not the case. Only atoms in the group
contribute to the velocity calculation for the molecule.
</P>
<P>The ordering of per-molecule quantities produced by this compute is
consistent with the ordering produced by other compute commands that
generate per-molecule datums. Conceptually, them molecule IDs will be
in ascending order for any molecule with one or more of its atoms in
the specified group.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a global array where the number of rows =
Nmolecules and the number of columns = 3 for the vx,vy,vz components
of the center-of-mass velocity of each molecule. These values can be
accessed by any command that uses global array values from a compute
as input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A> for an
overview of LAMMPS output options.
</P>
<P>The array values are "intensive". The array values will be in
distance <A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_force_molecule.html">compute force/molecule</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>

View File

@ -0,0 +1,60 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute vcm/molecule command :h3
[Syntax:]
compute ID group-ID vcm/molecule :pre
ID, group-ID are documented in "compute"_compute.html command
vcm/molecule = style name of this compute command :ul
[Examples:]
compute 1 fluid vcm/molecule :pre
[Description:]
Define a computation that calculates the center-of-mass velocity of
individual molecules. The x,y,z components of the velocity of each
molecule are computed. This is calcualted by summing mass*velocity
for each atom in the molecule and dividing the sum by the total mass
of the molecule.
The velocity of a particular molecule is only computed if one or more
of its atoms are in the specified group. Normally all atoms in the
molecule should be in the group, however this is not required. LAMMPS
will warn you if this is not the case. Only atoms in the group
contribute to the velocity calculation for the molecule.
The ordering of per-molecule quantities produced by this compute is
consistent with the ordering produced by other compute commands that
generate per-molecule datums. Conceptually, them molecule IDs will be
in ascending order for any molecule with one or more of its atoms in
the specified group.
[Output info:]
This compute calculates a global array where the number of rows =
Nmolecules and the number of columns = 3 for the vx,vy,vz components
of the center-of-mass velocity of each molecule. These values can be
accessed by any command that uses global array values from a compute
as input. See "Section_howto 15"_Section_howto.html#howto_15 for an
overview of LAMMPS output options.
The array values are "intensive". The array values will be in
distance "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute force/molecule"_compute_force_molecule.html
[Default:] none

View File

@ -82,6 +82,15 @@ are the edge vectors of the unit cell. This is the nomenclature for
unit cell they determine does not have to be a "primitive cell" of
minimum volume.
</P>
<P>Note that the lattice command can be used multiple times in an input
script. Each time it is invoked, the lattice attributes are
re-defined and are used for all subsequent commands (that use lattice
attributes). For example, a sequence of lattice,
<A HREF = "region.html">region</A>, and <A HREF = "create_atoms.html">create_atoms</A> commands
can be repeated multiple times to build a poly-crystalline model with
different geometric regions populated with atoms in different lattice
orientations.
</P>
<HR>
<P>A lattice of style <I>none</I> does not define a unit cell and basis set,
@ -168,61 +177,73 @@ mapping it into the simulation box. The <I>dim</I> argument is one of the
the crystallographic direction in the lattice that you want to orient
along that axis, specified as integers. E.g. "orient x 2 1 0" means
the x-axis in the simulation box will be the [210] lattice
direction. The 3 lattice directions you specify must be mutually
direction, and similarly for y and z. The 3 lattice directions you
specify do not have to be unit vectors, but they must be mutually
orthogonal and obey the right-hand rule, i.e. (X cross Y) points in
the Z direction. Note that this description is really only valid for
orthogonal lattices. If you are using the more general lattice style
<I>custom</I> with non-orthogonal a1,a2,a3 vectors, then think of the 3
<I>orient</I> options as creating a 3x3 rotation matrix which is applied to
a1,a2,a3 to rotate the original unit cell to a new orientation in the
simulation box.
the Z direction.
</P>
<P>IMPORTANT NOTE: The preceding paragraph describing lattice directions
is only valid for orthogonal cubic unit cells (or square in 2d). If
you are using a <I>hcp</I> or <I>hex</I> lattice or the more general lattice
style <I>custom</I> with non-orthogonal a1,a2,a3 vectors, then you should
think of the 3 <I>orient</I> vectors as creating a 3x3 rotation matrix
which is applied to a1,a2,a3 to rotate the original unit cell to a new
orientation in the simulation box.
</P>
<HR>
<P>Several LAMMPS commands have the option to use distance units that are
inferred from "lattice spacing" in the x,y,z box directions. E.g. the
<A HREF = "region.html">region</A> command can create a block of size 10x20x20,
where 10 means 10 lattice spacings in the x direction.
inferred from "lattice spacings" in the x,y,z box directions.
E.g. the <A HREF = "region.html">region</A> command can create a block of size
10x20x20, where 10 means 10 lattice spacings in the x direction.
</P>
<P>The <I>spacing</I> option sets the 3 lattice spacings directly. All must
be non-zero (use 1.0 for dz in a 2d simulation). The specified values
are multiplied by the multiplicative factor described above that is
associated with the scale factor. Thus a spacing of 1.0 means one
unit cell independent of the scale factor. This option can be useful
if the spacings LAMMPS computes are inconvenient to use in subsequent
commands, which can be the case for non-orthogonal or rotated
lattices.
<P>IMPORTANT NOTE: Though they are called lattice spacings, all the
commands that have a "units lattice" option, simply use the 3 values
as scale factors on the distance units defined by the
<A HREF = "units.html">units</A> command. Thus if you do not like the lattice
spacings computed by LAMMPS (e.g. for a non-orthogonal or rotated unit
cell), you can define the 3 values to be whatever you wish, via the
<I>spacing</I> option.
</P>
<P>If the <I>spacing</I> option is not specified, the lattice spacings are
computed by LAMMPS in the following way. A unit cell of the lattice
is mapped into the simulation box (scaled, shifted, rotated), so that
it now has (perhaps) a modified size and orientation. The lattice
spacing in X is defined as the difference between the min/max extent
of the x coordinates of the 8 corner points of the modified unit cell.
Similarly, the Y and Z lattice spacings are defined as the difference
in the min/max of the y and z coordinates.
is mapped into the simulation box (scaled and rotated), so that it now
has (perhaps) a modified size and orientation. The lattice spacing in
X is defined as the difference between the min/max extent of the x
coordinates of the 8 corner points of the modified unit cell (4 in
2d). Similarly, the Y and Z lattice spacings are defined as the
difference in the min/max of the y and z coordinates.
</P>
<P>Note that if the unit cell is orthogonal with axis-aligned edges (not
rotated via the <I>orient</I> keyword), then the lattice spacings in each
<P>Note that if the unit cell is orthogonal with axis-aligned edges (no
rotation via the <I>orient</I> keyword), then the lattice spacings in each
dimension are simply the scale factor (described above) multiplied by
the length of a1,a2,a3. Thus a <I>hex</I> style lattice with a scale
factor of 3.0 Angstroms, would have a lattice spacing of 3.0 in x and
3*sqrt(3.0) in y.
</P>
<P>IMPORTANT NOTE: For non-orthogonal unit cells and/or when a rotation
is applied via the <I>orient</I> keyword, then the lattice spacings may be
less intuitive. In particular, in these cases, there is no guarantee
that the lattice spacing is an integer multiple of the periodicity of
the lattice in that direction. Thus, if you create an orthogonal
periodic simulation box whose size in a dimension is a multiple of the
lattice spacing, and then fill it with atoms via the
<A HREF = "create_atoms.html">create_atoms</A> command, you will NOT necessarily
create a periodic system. I.e. atoms may overlap incorrectly at the
faces of the simulation box.
is applied via the <I>orient</I> keyword, then the lattice spacings
computed by LAMMPS are typically less intuitive. In particular, in
these cases, there is no guarantee that a particular lattice spacing
is an integer multiple of the periodicity of the lattice in that
direction. Thus, if you create an orthogonal periodic simulation box
whose size in a dimension is a multiple of the lattice spacing, and
then fill it with atoms via the <A HREF = "create_atoms.html">create_atoms</A>
command, you will NOT necessarily create a periodic system.
I.e. atoms may overlap incorrectly at the faces of the simulation box.
</P>
<P>Regardless of these issues, the values of the lattice spacings LAMMPS
calculates are printed out, so their effect in commands that use the
spacings should be decipherable.
<P>The <I>spacing</I> option sets the 3 lattice spacings directly. All must
be non-zero (use 1.0 for dz in a 2d simulation). The specified values
are multiplied by the multiplicative factor described above that is
associated with the scale factor. Thus a spacing of 1.0 means one
unit cell edge length independent of the scale factor. As mentioned
above, this option can be useful if the spacings LAMMPS computes are
inconvenient to use in subsequent commands, which can be the case for
non-orthogonal or rotated lattices.
</P>
<P>Note that whenever the lattice command is used, the values of the
lattice spacings LAMMPS calculates are printed out. Thus their effect
in commands that use the spacings should be decipherable.
</P>
<HR>

View File

@ -74,6 +74,15 @@ are the edge vectors of the unit cell. This is the nomenclature for
unit cell they determine does not have to be a "primitive cell" of
minimum volume.
Note that the lattice command can be used multiple times in an input
script. Each time it is invoked, the lattice attributes are
re-defined and are used for all subsequent commands (that use lattice
attributes). For example, a sequence of lattice,
"region"_region.html, and "create_atoms"_create_atoms.html commands
can be repeated multiple times to build a poly-crystalline model with
different geometric regions populated with atoms in different lattice
orientations.
:line
A lattice of style {none} does not define a unit cell and basis set,
@ -160,61 +169,73 @@ mapping it into the simulation box. The {dim} argument is one of the
the crystallographic direction in the lattice that you want to orient
along that axis, specified as integers. E.g. "orient x 2 1 0" means
the x-axis in the simulation box will be the \[210\] lattice
direction. The 3 lattice directions you specify must be mutually
direction, and similarly for y and z. The 3 lattice directions you
specify do not have to be unit vectors, but they must be mutually
orthogonal and obey the right-hand rule, i.e. (X cross Y) points in
the Z direction. Note that this description is really only valid for
orthogonal lattices. If you are using the more general lattice style
{custom} with non-orthogonal a1,a2,a3 vectors, then think of the 3
{orient} options as creating a 3x3 rotation matrix which is applied to
a1,a2,a3 to rotate the original unit cell to a new orientation in the
simulation box.
the Z direction.
IMPORTANT NOTE: The preceding paragraph describing lattice directions
is only valid for orthogonal cubic unit cells (or square in 2d). If
you are using a {hcp} or {hex} lattice or the more general lattice
style {custom} with non-orthogonal a1,a2,a3 vectors, then you should
think of the 3 {orient} vectors as creating a 3x3 rotation matrix
which is applied to a1,a2,a3 to rotate the original unit cell to a new
orientation in the simulation box.
:line
Several LAMMPS commands have the option to use distance units that are
inferred from "lattice spacing" in the x,y,z box directions. E.g. the
"region"_region.html command can create a block of size 10x20x20,
where 10 means 10 lattice spacings in the x direction.
inferred from "lattice spacings" in the x,y,z box directions.
E.g. the "region"_region.html command can create a block of size
10x20x20, where 10 means 10 lattice spacings in the x direction.
The {spacing} option sets the 3 lattice spacings directly. All must
be non-zero (use 1.0 for dz in a 2d simulation). The specified values
are multiplied by the multiplicative factor described above that is
associated with the scale factor. Thus a spacing of 1.0 means one
unit cell independent of the scale factor. This option can be useful
if the spacings LAMMPS computes are inconvenient to use in subsequent
commands, which can be the case for non-orthogonal or rotated
lattices.
IMPORTANT NOTE: Though they are called lattice spacings, all the
commands that have a "units lattice" option, simply use the 3 values
as scale factors on the distance units defined by the
"units"_units.html command. Thus if you do not like the lattice
spacings computed by LAMMPS (e.g. for a non-orthogonal or rotated unit
cell), you can define the 3 values to be whatever you wish, via the
{spacing} option.
If the {spacing} option is not specified, the lattice spacings are
computed by LAMMPS in the following way. A unit cell of the lattice
is mapped into the simulation box (scaled, shifted, rotated), so that
it now has (perhaps) a modified size and orientation. The lattice
spacing in X is defined as the difference between the min/max extent
of the x coordinates of the 8 corner points of the modified unit cell.
Similarly, the Y and Z lattice spacings are defined as the difference
in the min/max of the y and z coordinates.
is mapped into the simulation box (scaled and rotated), so that it now
has (perhaps) a modified size and orientation. The lattice spacing in
X is defined as the difference between the min/max extent of the x
coordinates of the 8 corner points of the modified unit cell (4 in
2d). Similarly, the Y and Z lattice spacings are defined as the
difference in the min/max of the y and z coordinates.
Note that if the unit cell is orthogonal with axis-aligned edges (not
rotated via the {orient} keyword), then the lattice spacings in each
Note that if the unit cell is orthogonal with axis-aligned edges (no
rotation via the {orient} keyword), then the lattice spacings in each
dimension are simply the scale factor (described above) multiplied by
the length of a1,a2,a3. Thus a {hex} style lattice with a scale
factor of 3.0 Angstroms, would have a lattice spacing of 3.0 in x and
3*sqrt(3.0) in y.
IMPORTANT NOTE: For non-orthogonal unit cells and/or when a rotation
is applied via the {orient} keyword, then the lattice spacings may be
less intuitive. In particular, in these cases, there is no guarantee
that the lattice spacing is an integer multiple of the periodicity of
the lattice in that direction. Thus, if you create an orthogonal
periodic simulation box whose size in a dimension is a multiple of the
lattice spacing, and then fill it with atoms via the
"create_atoms"_create_atoms.html command, you will NOT necessarily
create a periodic system. I.e. atoms may overlap incorrectly at the
faces of the simulation box.
is applied via the {orient} keyword, then the lattice spacings
computed by LAMMPS are typically less intuitive. In particular, in
these cases, there is no guarantee that a particular lattice spacing
is an integer multiple of the periodicity of the lattice in that
direction. Thus, if you create an orthogonal periodic simulation box
whose size in a dimension is a multiple of the lattice spacing, and
then fill it with atoms via the "create_atoms"_create_atoms.html
command, you will NOT necessarily create a periodic system.
I.e. atoms may overlap incorrectly at the faces of the simulation box.
Regardless of these issues, the values of the lattice spacings LAMMPS
calculates are printed out, so their effect in commands that use the
spacings should be decipherable.
The {spacing} option sets the 3 lattice spacings directly. All must
be non-zero (use 1.0 for dz in a 2d simulation). The specified values
are multiplied by the multiplicative factor described above that is
associated with the scale factor. Thus a spacing of 1.0 means one
unit cell edge length independent of the scale factor. As mentioned
above, this option can be useful if the spacings LAMMPS computes are
inconvenient to use in subsequent commands, which can be the case for
non-orthogonal or rotated lattices.
Note that whenever the lattice command is used, the values of the
lattice spacings LAMMPS calculates are printed out. Thus their effect
in commands that use the spacings should be decipherable.
:line

View File

@ -54,7 +54,7 @@
math functions = sqrt(x), exp(x), ln(x), log(x), abs(x),
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x),
random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x)
ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)
ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), stride2(x,y,z,a,b,c), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,dir), gyration(group), ke(group),
@ -378,7 +378,7 @@ references to other variables.
<TR><TD >Thermo keywords</TD><TD > vol, pe, ebond, etc</TD></TR>
<TR><TD >Math operators</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, x%y, </TD></TR>
<TR><TD >Math operators</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, x%y, x == y, x != y, x &lt y, x &lt= y, x &gt y, x &gt= y, x && y, x || y, !x</TD></TR>
<TR><TD >Math functions</TD><TD > sqrt(x), exp(x), ln(x), log(x), abs(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)</TD></TR>
<TR><TD >Math functions</TD><TD > sqrt(x), exp(x), ln(x), log(x), abs(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), stride2(x,y,z,a,b,c), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)</TD></TR>
<TR><TD >Group functions</TD><TD > count(ID), mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID), angmom(ID,dim), torque(ID,dim), inertia(ID,dimdim), omega(ID,dim)</TD></TR>
<TR><TD >Region functions</TD><TD > count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR), angmom(ID,dim,IDR), torque(ID,dim,IDR), inertia(ID,dimdim,IDR), omega(ID,dim,IDR)</TD></TR>
<TR><TD >Special functions</TD><TD > sum(x), min(x), max(x), ave(x), trap(x), slope(x), gmask(x), rmask(x), grmask(x,y), next(x)</TD></TR>
@ -542,16 +542,33 @@ output timesteps:
</PRE>
<P>The stride(x,y,z) function uses the current timestep to generate a new
timestep. X,y >= 0 and z > 0 and x <= y are required. The generated
timesteps increase in increments of z, from x to y, I.e. it generates
timesteps increase in increments of z, from x to y, i.e. it generates
the sequece x,x+z,x+2z,...,y. If y-x is not a multiple of z, then
similar to the way a for loop operates, the last value will be one
that does not exceed y. For any current timestep, the next timestep
in the sequence is returned. Thus if stagger(1000,2000,100) is used
in the sequence is returned. Thus if stride(1000,2000,100) is used
in a variable by the <A HREF = "dump_modify.html">dump_modify every</A> command, it
will generate the sequence of output timesteps:
</P>
<PRE>1000,1100,1200, ... ,1900,2000
</PRE>
<P>The stride2(x,y,z,a,b,c) function is similar to the stride() function
except it generates two sets of strided timesteps, one at a coarser
level and one at a finer level. Thus it is useful for debugging,
e.g. to produce output every timestep at the point in simulation when
a problem occurs. X,y >= 0 and z > 0 and x <= y are required, as are
a,b >= 0 and c > 0 and a < b. Also, a >= x and b <= y are required so
that the second stride is inside the first. The generated timesteps
increase in increments of z, starting at x, until a is reached. At
that point the timestep increases in increments of c, from a to b,
then after b, increments by z are resumed until y is reached. For any
current timestep, the next timestep in the sequence is returned. Thus
if stride(1000,2000,100,1350,1360,1) is used in a variable by the
<A HREF = "dump_modify.html">dump_modify every</A> command, it will generate the
sequence of output timesteps:
</P>
<PRE>1000,1100,1200,1300,1350,1351,1352, ... 1359,1360,1400,1500, ... ,2000
</PRE>
<P>The vdisplace(x,y) function takes 2 arguments: x = value0 and y =
velocity, and uses the elapsed time to change the value by a linear
displacement due to the applied velocity over the course of a run,

View File

@ -49,7 +49,7 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {st
math functions = sqrt(x), exp(x), ln(x), log(x), abs(x),
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x),
random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x)
ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)
ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), stride2(x,y,z,a,b,c), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,dir), gyration(group), ke(group),
@ -371,7 +371,7 @@ Constant: PI
Thermo keywords: vol, pe, ebond, etc
Math operators: (), -x, x+y, x-y, x*y, x/y, x^y, x%y,
Math operators: (), -x, x+y, x-y, x*y, x/y, x^y, x%y, x == y, x != y, x &lt y, x &lt= y, x &gt y, x &gt= y, x && y, x || y, !x
Math functions: sqrt(x), exp(x), ln(x), log(x), abs(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)
Math functions: sqrt(x), exp(x), ln(x), log(x), abs(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), ramp(x,y), stagger(x,y), logfreq(x,y,z), stride(x,y,z), stride2(x,y,z,a,b,c), vdisplace(x,y), swiggle(x,y,z), cwiggle(x,y,z)
Group functions: count(ID), mass(ID), charge(ID), xcm(ID,dim), \
vcm(ID,dim), fcm(ID,dim), bound(ID,dir), \
gyration(ID), ke(ID), angmom(ID,dim), torque(ID,dim), \
@ -542,16 +542,33 @@ output timesteps:
The stride(x,y,z) function uses the current timestep to generate a new
timestep. X,y >= 0 and z > 0 and x <= y are required. The generated
timesteps increase in increments of z, from x to y, I.e. it generates
timesteps increase in increments of z, from x to y, i.e. it generates
the sequece x,x+z,x+2z,...,y. If y-x is not a multiple of z, then
similar to the way a for loop operates, the last value will be one
that does not exceed y. For any current timestep, the next timestep
in the sequence is returned. Thus if stagger(1000,2000,100) is used
in the sequence is returned. Thus if stride(1000,2000,100) is used
in a variable by the "dump_modify every"_dump_modify.html command, it
will generate the sequence of output timesteps:
1000,1100,1200, ... ,1900,2000 :pre
The stride2(x,y,z,a,b,c) function is similar to the stride() function
except it generates two sets of strided timesteps, one at a coarser
level and one at a finer level. Thus it is useful for debugging,
e.g. to produce output every timestep at the point in simulation when
a problem occurs. X,y >= 0 and z > 0 and x <= y are required, as are
a,b >= 0 and c > 0 and a < b. Also, a >= x and b <= y are required so
that the second stride is inside the first. The generated timesteps
increase in increments of z, starting at x, until a is reached. At
that point the timestep increases in increments of c, from a to b,
then after b, increments by z are resumed until y is reached. For any
current timestep, the next timestep in the sequence is returned. Thus
if stride(1000,2000,100,1350,1360,1) is used in a variable by the
"dump_modify every"_dump_modify.html command, it will generate the
sequence of output timesteps:
1000,1100,1200,1300,1350,1351,1352, ... 1359,1360,1400,1500, ... ,2000 :pre
The vdisplace(x,y) function takes 2 arguments: x = value0 and y =
velocity, and uses the elapsed time to change the value by a linear
displacement due to the applied velocity over the course of a run,

View File

@ -1,4 +1,4 @@
/* -*- c++ -*- ----------------------------------------------------------
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov

View File

@ -169,6 +169,7 @@ void FixQEqDynamic::pre_force(int vflag)
}
if (force->kspace) force->kspace->setup();
}
/* ---------------------------------------------------------------------- */
@ -213,6 +214,7 @@ double FixQEqDynamic::compute_eneg()
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delr[0] = x[i][0] - x[j][0];
delr[1] = x[i][1] - x[j][1];

View File

@ -28,8 +28,8 @@
#include "neigh_request.h"
#include "update.h"
#include "force.h"
#include "kspace.h"
#include "group.h"
#include "kspace.h"
#include "respa.h"
#include "memory.h"
#include "error.h"
@ -53,8 +53,8 @@ void FixQEqPoint::init()
int irequest = neighbor->request(this);
neighbor->requests[irequest]->pair = 0;
neighbor->requests[irequest]->fix = 1;
neighbor->requests[irequest]->half = 1;
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
int ntypes = atom->ntypes;
memory->create(shld,ntypes+1,ntypes+1,"qeq:shileding");
@ -146,6 +146,7 @@ void FixQEqPoint::compute_H()
for( jj = 0; jj < jnum; jj++ ) {
j = jlist[jj];
j &= NEIGHMASK;
dx = x[j][0] - x[i][0];
dy = x[j][1] - x[i][1];

View File

@ -28,8 +28,8 @@
#include "neigh_request.h"
#include "update.h"
#include "force.h"
#include "kspace.h"
#include "group.h"
#include "kspace.h"
#include "respa.h"
#include "memory.h"
#include "error.h"
@ -190,6 +190,7 @@ void FixQEqShielded::compute_H()
for( jj = 0; jj < jnum; jj++ ) {
j = jlist[jj];
j &= NEIGHMASK;
dx = x[j][0] - x[i][0];
dy = x[j][1] - x[i][1];

View File

@ -0,0 +1,106 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "compute_force_molecule.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeForceMolecule::ComputeForceMolecule(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 3) error->all(FLERR,"Illegal compute force/molecule command");
if (atom->molecular == 0)
error->all(FLERR,"Compute force/molecule requires molecular atom style");
array_flag = 1;
size_array_cols = 3;
extarray = 0;
// setup molecule-based data
nmolecules = molecules_in_group(idlo,idhi);
size_array_rows = nmolecules;
memory->create(force,nmolecules,3,"force/molecule:force");
memory->create(forceall,nmolecules,3,"force/molecule:forceall");
array = forceall;
}
/* ---------------------------------------------------------------------- */
ComputeForceMolecule::~ComputeForceMolecule()
{
memory->destroy(force);
memory->destroy(forceall);
}
/* ---------------------------------------------------------------------- */
void ComputeForceMolecule::init()
{
int ntmp = molecules_in_group(idlo,idhi);
if (ntmp != nmolecules)
error->all(FLERR,"Molecule count changed in compute force/molecule");
}
/* ---------------------------------------------------------------------- */
void ComputeForceMolecule::compute_array()
{
tagint imol;
double massone;
double unwrap[3];
invoked_array = update->ntimestep;
for (int i = 0; i < nmolecules; i++)
force[i][0] = force[i][1] = force[i][2] = 0.0;
double **f = atom->f;
int *mask = atom->mask;
tagint *molecule = atom->molecule;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
imol = molecule[i];
if (molmap) imol = molmap[imol-idlo];
else imol--;
force[imol][0] += f[i][0];
force[imol][1] += f[i][1];
force[imol][2] += f[i][2];
}
MPI_Allreduce(&force[0][0],&forceall[0][0],3*nmolecules,
MPI_DOUBLE,MPI_SUM,world);
}
/* ----------------------------------------------------------------------
memory usage of local data
------------------------------------------------------------------------- */
double ComputeForceMolecule::memory_usage()
{
double bytes = 0;
if (molmap) bytes += (idhi-idlo+1) * sizeof(int);
bytes += (bigint) nmolecules * 2*3 * sizeof(double);
return bytes;
}

View File

@ -0,0 +1,63 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(force/molecule,ComputeForceMolecule)
#else
#ifndef LMP_COMPUTE_FORCE_MOLECULE_H
#define LMP_COMPUTE_FORCE_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeForceMolecule : public Compute {
public:
ComputeForceMolecule(class LAMMPS *, int, char **);
~ComputeForceMolecule();
void init();
void compute_array();
double memory_usage();
private:
int nmolecules;
tagint idlo,idhi;
double **force,**forceall;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Compute force/molecule requires molecular atom style
Self-explanatory.
E: Molecule count changed in compute force/molecule
Number of molecules must remain constant over time.
*/

View File

@ -0,0 +1,147 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "compute_vcm_molecule.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeVCMMolecule::ComputeVCMMolecule(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 3) error->all(FLERR,"Illegal compute vcm/molecule command");
if (atom->molecular == 0)
error->all(FLERR,"Compute vcm/molecule requires molecular atom style");
array_flag = 1;
size_array_cols = 3;
extarray = 0;
// setup molecule-based data
nmolecules = molecules_in_group(idlo,idhi);
size_array_rows = nmolecules;
memory->create(massproc,nmolecules,"vcm/molecule:massproc");
memory->create(masstotal,nmolecules,"vcm/molecule:masstotal");
memory->create(vcm,nmolecules,3,"vcm/molecule:vcm");
memory->create(vcmall,nmolecules,3,"vcm/molecule:vcmall");
array = vcmall;
// compute masstotal for each molecule
int *mask = atom->mask;
tagint *molecule = atom->molecule;
int *type = atom->type;
double *mass = atom->mass;
double *rmass = atom->rmass;
int nlocal = atom->nlocal;
tagint imol;
double massone;
for (int i = 0; i < nmolecules; i++) massproc[i] = 0.0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (rmass) massone = rmass[i];
else massone = mass[type[i]];
imol = molecule[i];
if (molmap) imol = molmap[imol-idlo];
else imol--;
massproc[imol] += massone;
}
MPI_Allreduce(massproc,masstotal,nmolecules,MPI_DOUBLE,MPI_SUM,world);
}
/* ---------------------------------------------------------------------- */
ComputeVCMMolecule::~ComputeVCMMolecule()
{
memory->destroy(massproc);
memory->destroy(masstotal);
memory->destroy(vcm);
memory->destroy(vcmall);
}
/* ---------------------------------------------------------------------- */
void ComputeVCMMolecule::init()
{
int ntmp = molecules_in_group(idlo,idhi);
if (ntmp != nmolecules)
error->all(FLERR,"Molecule count changed in compute vcm/molecule");
}
/* ---------------------------------------------------------------------- */
void ComputeVCMMolecule::compute_array()
{
tagint imol;
double massone;
double unwrap[3];
invoked_array = update->ntimestep;
for (int i = 0; i < nmolecules; i++)
vcm[i][0] = vcm[i][1] = vcm[i][2] = 0.0;
double **v = atom->v;
int *mask = atom->mask;
tagint *molecule = atom->molecule;
int *type = atom->type;
imageint *image = atom->image;
double *mass = atom->mass;
double *rmass = atom->rmass;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (rmass) massone = rmass[i];
else massone = mass[type[i]];
imol = molecule[i];
if (molmap) imol = molmap[imol-idlo];
else imol--;
vcm[imol][0] += v[i][0] * massone;
vcm[imol][1] += v[i][1] * massone;
vcm[imol][2] += v[i][2] * massone;
}
MPI_Allreduce(&vcm[0][0],&vcmall[0][0],3*nmolecules,
MPI_DOUBLE,MPI_SUM,world);
for (int i = 0; i < nmolecules; i++) {
vcmall[i][0] /= masstotal[i];
vcmall[i][1] /= masstotal[i];
vcmall[i][2] /= masstotal[i];
}
}
/* ----------------------------------------------------------------------
memory usage of local data
------------------------------------------------------------------------- */
double ComputeVCMMolecule::memory_usage()
{
double bytes = (bigint) nmolecules * 2 * sizeof(double);
if (molmap) bytes += (idhi-idlo+1) * sizeof(int);
bytes += (bigint) nmolecules * 2*3 * sizeof(double);
return bytes;
}

View File

@ -0,0 +1,64 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(vcm/molecule,ComputeVCMMolecule)
#else
#ifndef LMP_COMPUTE_VCM_MOLECULE_H
#define LMP_COMPUTE_VCM_MOLECULE_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeVCMMolecule : public Compute {
public:
ComputeVCMMolecule(class LAMMPS *, int, char **);
~ComputeVCMMolecule();
void init();
void compute_array();
double memory_usage();
private:
int nmolecules;
tagint idlo,idhi;
double *massproc,*masstotal;
double **vcm,**vcmall;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Compute vcm/molecule requires molecular atom style
Self-explanatory.
E: Molecule count changed in compute vcm/molecule
Number of molecules must remain constant over time.
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* -*- c++ -*- ----------------------------------------------------------
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -72,7 +72,9 @@ class Variable : protected Pointers {
int nstride; // stride between atoms if array is a 2d array
int selfalloc; // 1 if array is allocated here, else 0
int ivalue1,ivalue2; // extra values for needed for gmask,rmask,grmask
Tree *left,*middle,*right; // ptrs further down tree
int nextra; // # of additional args beyond first 2
Tree *first,*second; // ptrs further down tree for first 2 args
Tree **extra; // ptrs further down tree for nextra args
};
void remove(int);
@ -94,6 +96,7 @@ class Variable : protected Pointers {
void atom_vector(char *, Tree **, Tree **, int &);
int is_constant(char *);
double constant(char *);
int parse_args(char *, char **);
char *find_next_comma(char *);
void print_tree(Tree *, int);
};

View File

@ -1 +1 @@
#define LAMMPS_VERSION "20 Nov 2014"
#define LAMMPS_VERSION "22 Nov 2014"