Merge remote-tracking branch 'lammps-ro/master' into lammps-icms
Resolved Conflicts: doc/Manual.html doc/Manual.txt
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
|
||||
<META NAME="docnumber" CONTENT="18 Mar 2015 version">
|
||||
<META NAME="docnumber" CONTENT="25 Mar 2015 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>18 Mar 2015 version
|
||||
<CENTER><H4>25 Mar 2015 version
|
||||
</H4></CENTER>
|
||||
<H4>Version info:
|
||||
</H4>
|
||||
|
||||
BIN
doc/Manual.pdf
BIN
doc/Manual.pdf
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<HEAD>
|
||||
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
|
||||
<TITLE>LAMMPS Users Manual</TITLE>
|
||||
<META NAME="docnumber" CONTENT="18 Mar 2015 version">
|
||||
<META NAME="docnumber" CONTENT="25 Mar 2015 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
|
||||
18 Mar 2015 version :c,h4
|
||||
25 Mar 2015 version :c,h4
|
||||
|
||||
Version info: :h4
|
||||
|
||||
|
||||
@ -453,17 +453,17 @@ letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
|
||||
KOKKOS, o = USER-OMP, t = OPT.
|
||||
</P>
|
||||
<DIV ALIGN=center><TABLE BORDER=1 >
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_angle_local.html">angle/local</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_chunk_atom.html">chunk/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_chunk.html">com/chunk</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_chunk.html">gyration/chunk</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_chunk.html">inertia/chunk</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_chunk.html">msd/chunk</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_chunk.html">property/chunk</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_chunk.html">temp/chunk</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_torque_chunk.html">torque/chunk</A></TD><TD ><A HREF = "compute_vacf.html">vacf</A></TD><TD ><A HREF = "compute_vcm_chunk.html">vcm/chunk</A></TD><TD ><A HREF = "compute_voronoi_atom.html">voronoi/atom</A>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_angle_local.html">angle/local</A></TD><TD ><A HREF = "compute_angmom_chunk.html">angmom/chunk</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_chunk_atom.html">chunk/atom</A></TD></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_cluster_atom.html">cluster/atom</A></TD><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_chunk.html">com/chunk</A></TD><TD ><A HREF = "compute_contact_atom.html">contact/atom</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_damage_atom.html">damage/atom</A></TD><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></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_erotate_sphere.html">erotate/sphere</A></TD><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_chunk.html">gyration/chunk</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_chunk.html">inertia/chunk</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_chunk.html">msd/chunk</A></TD><TD ><A HREF = "compute_msd_nongauss.html">msd/nongauss</A></TD><TD ><A HREF = "compute_omega_chunk.html">omega/chunk</A></TD><TD ><A HREF = "compute_pair.html">pair</A></TD><TD ><A HREF = "compute_pair_local.html">pair/local</A></TD></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_pe.html">pe (c)</A></TD><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></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_property_chunk.html">property/chunk</A></TD><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></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_sna.html">snad/atom</A></TD><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></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_temp_chunk.html">temp/chunk</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><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></TR>
|
||||
<TR ALIGN="center"><TD ><A HREF = "compute_temp_sphere.html">temp/sphere</A></TD><TD ><A HREF = "compute_ti.html">ti</A></TD><TD ><A HREF = "compute_torque_chunk.html">torque/chunk</A></TD><TD ><A HREF = "compute_vacf.html">vacf</A></TD><TD ><A HREF = "compute_vcm_chunk.html">vcm/chunk</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
|
||||
|
||||
@ -642,6 +642,7 @@ letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
|
||||
KOKKOS, o = USER-OMP, t = OPT.
|
||||
|
||||
"angle/local"_compute_angle_local.html,
|
||||
"angmom/chunk"_compute_angmom_chunk.html,
|
||||
"body/local"_compute_body_local.html,
|
||||
"bond/local"_compute_bond_local.html,
|
||||
"centro/atom"_compute_centro_atom.html,
|
||||
@ -673,6 +674,7 @@ KOKKOS, o = USER-OMP, t = OPT.
|
||||
"msd"_compute_msd.html,
|
||||
"msd/chunk"_compute_msd_chunk.html,
|
||||
"msd/nongauss"_compute_msd_nongauss.html,
|
||||
"omega/chunk"_compute_omega_chunk.html,
|
||||
"pair"_compute_pair.html,
|
||||
"pair/local"_compute_pair_local.html,
|
||||
"pe (c)"_compute_pe.html,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
94
doc/compute_angmom_chunk.html
Normal file
94
doc/compute_angmom_chunk.html
Normal file
@ -0,0 +1,94 @@
|
||||
<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 angmom/chunk command
|
||||
</H3>
|
||||
<P><B>Syntax:</B>
|
||||
</P>
|
||||
<PRE>compute ID group-ID angmom/chunk chunkID
|
||||
</PRE>
|
||||
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
|
||||
<LI>angmom/molecule = style name of this compute command
|
||||
<LI>chunkID = ID of <A HREF = "compute_chunk_atom.html">compute chunk/atom</A> command
|
||||
</UL>
|
||||
<P><B>Examples:</B>
|
||||
</P>
|
||||
<PRE>compute 1 fluid angmom/chunk molchunk
|
||||
</PRE>
|
||||
<P><B>Description:</B>
|
||||
</P>
|
||||
<P>Define a computation that calculates the angular momemtum of multiple
|
||||
chunks of atoms.
|
||||
</P>
|
||||
<P>In LAMMPS, chunks are collections of atoms defined by a <A HREF = "compute_chunk_atom.html">compute
|
||||
chunk/atom</A> command, which assigns each atom
|
||||
to a single chunk (or no chunk). The ID for this command is specified
|
||||
as chunkID. For example, a single chunk could be the atoms in a
|
||||
molecule or atoms in a spatial bin. See the <A HREF = "compute_chunk_atom.html">compute
|
||||
chunk/atom</A> doc page and "<A HREF = "Section_howto.html#howto_23">Section_howto
|
||||
23</A> for details of how chunks can be
|
||||
defined and examples of how they can be used to measure properties of
|
||||
a system.
|
||||
</P>
|
||||
<P>This compute calculates the 3 components of the angular momentum
|
||||
vector for each chunk, due to the velocity/momentum of the individual
|
||||
atoms in the chunk around the center-of-mass of the chunk. The
|
||||
calculation includes all effects due to atoms passing thru periodic
|
||||
boundaries.
|
||||
</P>
|
||||
<P>Note that only atoms in the specified group contribute to the
|
||||
calculation. The <A HREF = "compute_chunk_atom.html">compute chunk/atom</A> command
|
||||
defines its own group; atoms will have a chunk ID = 0 if they are not
|
||||
in that group, signifying they are not assigned to a chunk, and will
|
||||
thus also not contribute to this calculation. You can specify the
|
||||
"all" group for this command if you simply want to include atoms with
|
||||
non-zero chunk IDs.
|
||||
</P>
|
||||
<P>IMPORTANT NOTE: The coordinates of an atom contribute to the chunk's
|
||||
angular momentum in "unwrapped" form, by using the image flags
|
||||
associated with each atom. See the <A HREF = "dump.html">dump custom</A> command
|
||||
for a discussion of "unwrapped" coordinates. See the Atoms section of
|
||||
the <A HREF = "read_data.html">read_data</A> command for a discussion of image flags
|
||||
and how they are set for each atom. You can reset the image flags
|
||||
(e.g. to 0) before invoking this compute by using the <A HREF = "set.html">set
|
||||
image</A> command.
|
||||
</P>
|
||||
<P>The simplest way to output the results of the compute angmom/chunk
|
||||
calculation to a file is to use the <A HREF = "fix_ave_time.html">fix ave/time</A>
|
||||
command, for example:
|
||||
</P>
|
||||
<PRE>compute cc1 all chunk/atom molecule
|
||||
compute myChunk all angmom/chunk cc1
|
||||
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector
|
||||
</PRE>
|
||||
<P><B>Output info:</B>
|
||||
</P>
|
||||
<P>This compute calculates a global array where the number of rows = the
|
||||
number of chunks <I>Nchunk</I> as calculated by the specified <A HREF = "compute_chunk_atom.html">compute
|
||||
chunk/atom</A> command. The number of columns =
|
||||
3 for the 3 xyz components of the angular momentum for each chunk.
|
||||
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
|
||||
mass-velocity-distance <A HREF = "units.html">units</A>.
|
||||
</P>
|
||||
<P><B>Restrictions:</B> none
|
||||
</P>
|
||||
<P><B>Related commands:</B>
|
||||
</P>
|
||||
<P><A HREF = "variable.html">variable angmom() function</A>
|
||||
</P>
|
||||
<P><B>Default:</B> none
|
||||
</P>
|
||||
</HTML>
|
||||
89
doc/compute_angmom_chunk.txt
Normal file
89
doc/compute_angmom_chunk.txt
Normal file
@ -0,0 +1,89 @@
|
||||
"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 angmom/chunk command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID angmom/chunk chunkID :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command
|
||||
angmom/molecule = style name of this compute command
|
||||
chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command :ul
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 fluid angmom/chunk molchunk :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a computation that calculates the angular momemtum of multiple
|
||||
chunks of atoms.
|
||||
|
||||
In LAMMPS, chunks are collections of atoms defined by a "compute
|
||||
chunk/atom"_compute_chunk_atom.html command, which assigns each atom
|
||||
to a single chunk (or no chunk). The ID for this command is specified
|
||||
as chunkID. For example, a single chunk could be the atoms in a
|
||||
molecule or atoms in a spatial bin. See the "compute
|
||||
chunk/atom"_compute_chunk_atom.html doc page and ""Section_howto
|
||||
23"_Section_howto.html#howto_23 for details of how chunks can be
|
||||
defined and examples of how they can be used to measure properties of
|
||||
a system.
|
||||
|
||||
This compute calculates the 3 components of the angular momentum
|
||||
vector for each chunk, due to the velocity/momentum of the individual
|
||||
atoms in the chunk around the center-of-mass of the chunk. The
|
||||
calculation includes all effects due to atoms passing thru periodic
|
||||
boundaries.
|
||||
|
||||
Note that only atoms in the specified group contribute to the
|
||||
calculation. The "compute chunk/atom"_compute_chunk_atom.html command
|
||||
defines its own group; atoms will have a chunk ID = 0 if they are not
|
||||
in that group, signifying they are not assigned to a chunk, and will
|
||||
thus also not contribute to this calculation. You can specify the
|
||||
"all" group for this command if you simply want to include atoms with
|
||||
non-zero chunk IDs.
|
||||
|
||||
IMPORTANT NOTE: The coordinates of an atom contribute to the chunk's
|
||||
angular momentum in "unwrapped" form, by using the image flags
|
||||
associated with each atom. See the "dump custom"_dump.html command
|
||||
for a discussion of "unwrapped" coordinates. See the Atoms section of
|
||||
the "read_data"_read_data.html command for a discussion of image flags
|
||||
and how they are set for each atom. You can reset the image flags
|
||||
(e.g. to 0) before invoking this compute by using the "set
|
||||
image"_set.html command.
|
||||
|
||||
The simplest way to output the results of the compute angmom/chunk
|
||||
calculation to a file is to use the "fix ave/time"_fix_ave_time.html
|
||||
command, for example:
|
||||
|
||||
compute cc1 all chunk/atom molecule
|
||||
compute myChunk all angmom/chunk cc1
|
||||
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a global array where the number of rows = the
|
||||
number of chunks {Nchunk} as calculated by the specified "compute
|
||||
chunk/atom"_compute_chunk_atom.html command. The number of columns =
|
||||
3 for the 3 xyz components of the angular momentum for each chunk.
|
||||
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
|
||||
mass-velocity-distance "units"_units.html.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"variable angmom() function"_variable.html
|
||||
|
||||
[Default:] none
|
||||
94
doc/compute_omega_chunk.html
Normal file
94
doc/compute_omega_chunk.html
Normal file
@ -0,0 +1,94 @@
|
||||
<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 omega/chunk command
|
||||
</H3>
|
||||
<P><B>Syntax:</B>
|
||||
</P>
|
||||
<PRE>compute ID group-ID omega/chunk chunkID
|
||||
</PRE>
|
||||
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
|
||||
<LI>omega/molecule = style name of this compute command
|
||||
<LI>chunkID = ID of <A HREF = "compute_chunk_atom.html">compute chunk/atom</A> command
|
||||
</UL>
|
||||
<P><B>Examples:</B>
|
||||
</P>
|
||||
<PRE>compute 1 fluid omega/chunk molchunk
|
||||
</PRE>
|
||||
<P><B>Description:</B>
|
||||
</P>
|
||||
<P>Define a computation that calculates the angular velocity (omega) of
|
||||
multiple chunks of atoms.
|
||||
</P>
|
||||
<P>In LAMMPS, chunks are collections of atoms defined by a <A HREF = "compute_chunk_atom.html">compute
|
||||
chunk/atom</A> command, which assigns each atom
|
||||
to a single chunk (or no chunk). The ID for this command is specified
|
||||
as chunkID. For example, a single chunk could be the atoms in a
|
||||
molecule or atoms in a spatial bin. See the <A HREF = "compute_chunk_atom.html">compute
|
||||
chunk/atom</A> doc page and "<A HREF = "Section_howto.html#howto_23">Section_howto
|
||||
23</A> for details of how chunks can be
|
||||
defined and examples of how they can be used to measure properties of
|
||||
a system.
|
||||
</P>
|
||||
<P>This compute calculates the 3 components of the angular velocity
|
||||
vector for each chunk, via the formula L = Iw where L is the angular
|
||||
momentum vector of the chunk, I is its moment of inertia tensor, and w
|
||||
is omega = angular velocity of the chunk. The calculation includes
|
||||
all effects due to atoms passing thru periodic boundaries.
|
||||
</P>
|
||||
<P>Note that only atoms in the specified group contribute to the
|
||||
calculation. The <A HREF = "compute_chunk_atom.html">compute chunk/atom</A> command
|
||||
defines its own group; atoms will have a chunk ID = 0 if they are not
|
||||
in that group, signifying they are not assigned to a chunk, and will
|
||||
thus also not contribute to this calculation. You can specify the
|
||||
"all" group for this command if you simply want to include atoms with
|
||||
non-zero chunk IDs.
|
||||
</P>
|
||||
<P>IMPORTANT NOTE: The coordinates of an atom contribute to the chunk's
|
||||
angular velocity in "unwrapped" form, by using the image flags
|
||||
associated with each atom. See the <A HREF = "dump.html">dump custom</A> command
|
||||
for a discussion of "unwrapped" coordinates. See the Atoms section of
|
||||
the <A HREF = "read_data.html">read_data</A> command for a discussion of image flags
|
||||
and how they are set for each atom. You can reset the image flags
|
||||
(e.g. to 0) before invoking this compute by using the <A HREF = "set.html">set
|
||||
image</A> command.
|
||||
</P>
|
||||
<P>The simplest way to output the results of the compute omega/chunk
|
||||
calculation to a file is to use the <A HREF = "fix_ave_time.html">fix ave/time</A>
|
||||
command, for example:
|
||||
</P>
|
||||
<PRE>compute cc1 all chunk/atom molecule
|
||||
compute myChunk all omega/chunk cc1
|
||||
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector
|
||||
</PRE>
|
||||
<P><B>Output info:</B>
|
||||
</P>
|
||||
<P>This compute calculates a global array where the number of rows = the
|
||||
number of chunks <I>Nchunk</I> as calculated by the specified <A HREF = "compute_chunk_atom.html">compute
|
||||
chunk/atom</A> command. The number of columns =
|
||||
3 for the 3 xyz components of the angular velocity for each chunk.
|
||||
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
|
||||
velocity/distance <A HREF = "units.html">units</A>.
|
||||
</P>
|
||||
<P><B>Restrictions:</B> none
|
||||
</P>
|
||||
<P><B>Related commands:</B>
|
||||
</P>
|
||||
<P><A HREF = "variable.html">variable omega() function</A>
|
||||
</P>
|
||||
<P><B>Default:</B> none
|
||||
</P>
|
||||
</HTML>
|
||||
89
doc/compute_omega_chunk.txt
Normal file
89
doc/compute_omega_chunk.txt
Normal file
@ -0,0 +1,89 @@
|
||||
"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 omega/chunk command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID omega/chunk chunkID :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command
|
||||
omega/molecule = style name of this compute command
|
||||
chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command :ul
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 fluid omega/chunk molchunk :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a computation that calculates the angular velocity (omega) of
|
||||
multiple chunks of atoms.
|
||||
|
||||
In LAMMPS, chunks are collections of atoms defined by a "compute
|
||||
chunk/atom"_compute_chunk_atom.html command, which assigns each atom
|
||||
to a single chunk (or no chunk). The ID for this command is specified
|
||||
as chunkID. For example, a single chunk could be the atoms in a
|
||||
molecule or atoms in a spatial bin. See the "compute
|
||||
chunk/atom"_compute_chunk_atom.html doc page and ""Section_howto
|
||||
23"_Section_howto.html#howto_23 for details of how chunks can be
|
||||
defined and examples of how they can be used to measure properties of
|
||||
a system.
|
||||
|
||||
This compute calculates the 3 components of the angular velocity
|
||||
vector for each chunk, via the formula L = Iw where L is the angular
|
||||
momentum vector of the chunk, I is its moment of inertia tensor, and w
|
||||
is omega = angular velocity of the chunk. The calculation includes
|
||||
all effects due to atoms passing thru periodic boundaries.
|
||||
|
||||
Note that only atoms in the specified group contribute to the
|
||||
calculation. The "compute chunk/atom"_compute_chunk_atom.html command
|
||||
defines its own group; atoms will have a chunk ID = 0 if they are not
|
||||
in that group, signifying they are not assigned to a chunk, and will
|
||||
thus also not contribute to this calculation. You can specify the
|
||||
"all" group for this command if you simply want to include atoms with
|
||||
non-zero chunk IDs.
|
||||
|
||||
IMPORTANT NOTE: The coordinates of an atom contribute to the chunk's
|
||||
angular velocity in "unwrapped" form, by using the image flags
|
||||
associated with each atom. See the "dump custom"_dump.html command
|
||||
for a discussion of "unwrapped" coordinates. See the Atoms section of
|
||||
the "read_data"_read_data.html command for a discussion of image flags
|
||||
and how they are set for each atom. You can reset the image flags
|
||||
(e.g. to 0) before invoking this compute by using the "set
|
||||
image"_set.html command.
|
||||
|
||||
The simplest way to output the results of the compute omega/chunk
|
||||
calculation to a file is to use the "fix ave/time"_fix_ave_time.html
|
||||
command, for example:
|
||||
|
||||
compute cc1 all chunk/atom molecule
|
||||
compute myChunk all omega/chunk cc1
|
||||
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a global array where the number of rows = the
|
||||
number of chunks {Nchunk} as calculated by the specified "compute
|
||||
chunk/atom"_compute_chunk_atom.html command. The number of columns =
|
||||
3 for the 3 xyz components of the angular velocity for each chunk.
|
||||
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
|
||||
velocity/distance "units"_units.html.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"variable omega() function"_variable.html
|
||||
|
||||
[Default:] none
|
||||
@ -15,10 +15,9 @@
|
||||
</P>
|
||||
<PRE>read_restart file flag
|
||||
</PRE>
|
||||
<UL><LI>file = name of binary restart file to read in
|
||||
<UL><LI>file = name of binary restart file to read in
|
||||
<LI>flag = remap (optional)
|
||||
</UL>
|
||||
<P>flag = remap (optional)
|
||||
</P>
|
||||
<P><B>Examples:</B>
|
||||
</P>
|
||||
<PRE>read_restart save.10000
|
||||
@ -51,7 +50,7 @@ that atoms were "lost" when the file is read. This error should be
|
||||
reported to the LAMMPS developers so the invalid writing of the
|
||||
restart file can be fixed. If you still wish to use the restart file,
|
||||
the optional <I>remap</I> flag can be appended to the read_restart command.
|
||||
This will avoid the error, by explicitly remapping each atom back into
|
||||
This should avoid the error, by explicitly remapping each atom back into
|
||||
the simulation box, updating image flags for the atom appropriately.
|
||||
</P>
|
||||
<P>Restart files are saved in binary format to enable exact restarts,
|
||||
|
||||
@ -12,8 +12,8 @@ read_restart command :h3
|
||||
|
||||
read_restart file flag :pre
|
||||
|
||||
file = name of binary restart file to read in :ul
|
||||
flag = remap (optional)
|
||||
file = name of binary restart file to read in
|
||||
flag = remap (optional) :ul
|
||||
|
||||
[Examples:]
|
||||
|
||||
@ -47,7 +47,7 @@ that atoms were "lost" when the file is read. This error should be
|
||||
reported to the LAMMPS developers so the invalid writing of the
|
||||
restart file can be fixed. If you still wish to use the restart file,
|
||||
the optional {remap} flag can be appended to the read_restart command.
|
||||
This will avoid the error, by explicitly remapping each atom back into
|
||||
This should avoid the error, by explicitly remapping each atom back into
|
||||
the simulation box, updating image flags for the atom appropriately.
|
||||
|
||||
Restart files are saved in binary format to enable exact restarts,
|
||||
|
||||
@ -137,8 +137,9 @@ This feature is not yet supported.
|
||||
|
||||
E: Cannot use Ewald/disp solver on system with no charge, dipole, or LJ particles
|
||||
|
||||
No atoms in system have a non-zero charge or dipole, or are LJ particles. Change
|
||||
charges/dipoles or change options of the kspace solver/pair style.
|
||||
No atoms in system have a non-zero charge or dipole, or are LJ
|
||||
particles. Change charges/dipoles or change options of the kspace
|
||||
solver/pair style.
|
||||
|
||||
W: System is not charge neutral, net charge = %g
|
||||
|
||||
|
||||
@ -344,7 +344,7 @@ void FixGCMC::init()
|
||||
(domain->triclinic == 1)) {
|
||||
full_flag = true;
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"fix gcmc using full_energy option");
|
||||
error->warning(FLERR,"Fix gcmc using full_energy option");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1288,6 +1288,7 @@ void FixGCMC::attempt_atomic_deletion_full()
|
||||
atom->q[i] = 0.0;
|
||||
}
|
||||
}
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
double energy_after = energy_full();
|
||||
|
||||
if (random_equal->uniform() <
|
||||
@ -1305,6 +1306,7 @@ void FixGCMC::attempt_atomic_deletion_full()
|
||||
atom->mask[i] = tmpmask;
|
||||
if (atom->q_flag) atom->q[i] = q_tmp;
|
||||
}
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
energy_stored = energy_before;
|
||||
}
|
||||
update_gas_atoms_list();
|
||||
@ -1360,7 +1362,7 @@ void FixGCMC::attempt_atomic_insertion_full()
|
||||
}
|
||||
atom->nghost = 0;
|
||||
comm->borders();
|
||||
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
double energy_after = energy_full();
|
||||
|
||||
if (random_equal->uniform() <
|
||||
@ -1371,6 +1373,7 @@ void FixGCMC::attempt_atomic_insertion_full()
|
||||
} else {
|
||||
atom->natoms--;
|
||||
if (proc_flag) atom->nlocal--;
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
energy_stored = energy_before;
|
||||
}
|
||||
update_gas_atoms_list();
|
||||
@ -1575,10 +1578,10 @@ void FixGCMC::attempt_molecule_deletion_full()
|
||||
m++;
|
||||
atom->q[i] = 0.0;
|
||||
}
|
||||
|
||||
toggle_intramolecular(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
double energy_after = energy_full();
|
||||
|
||||
if (random_equal->uniform() <
|
||||
@ -1600,12 +1603,14 @@ void FixGCMC::attempt_molecule_deletion_full()
|
||||
for (int i = 0; i < atom->nlocal; i++) {
|
||||
if (atom->molecule[i] == deletion_molecule) {
|
||||
atom->mask[i] = tmpmask[i];
|
||||
toggle_intramolecular(i);
|
||||
if (atom->q_flag) {
|
||||
atom->q[i] = q_tmp[m];
|
||||
m++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
}
|
||||
update_gas_atoms_list();
|
||||
}
|
||||
@ -1720,6 +1725,7 @@ void FixGCMC::attempt_molecule_insertion_full()
|
||||
if (atom->map_style) atom->map_init();
|
||||
atom->nghost = 0;
|
||||
comm->borders();
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
double energy_after = energy_full();
|
||||
|
||||
if (random_equal->uniform() < zz*volume*natoms_per_molecule*
|
||||
@ -1744,6 +1750,7 @@ void FixGCMC::attempt_molecule_insertion_full()
|
||||
atom->nlocal--;
|
||||
} else i++;
|
||||
}
|
||||
if (force->kspace) force->kspace->qsum_qsq();
|
||||
}
|
||||
update_gas_atoms_list();
|
||||
}
|
||||
@ -1823,6 +1830,28 @@ tagint FixGCMC::pick_random_gas_molecule()
|
||||
return gas_molecule_id_all;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixGCMC::toggle_intramolecular(int i)
|
||||
{
|
||||
if (atom->avec->bonds_allow)
|
||||
for (int m = 0; m < atom->num_bond[i]; m++)
|
||||
atom->bond_type[i][m] = -atom->bond_type[i][m];
|
||||
|
||||
if (atom->avec->angles_allow)
|
||||
for (int m = 0; m < atom->num_angle[i]; m++)
|
||||
atom->angle_type[i][m] = -atom->angle_type[i][m];
|
||||
|
||||
if (atom->avec->dihedrals_allow)
|
||||
for (int m = 0; m < atom->num_dihedral[i]; m++)
|
||||
atom->dihedral_type[i][m] = -atom->dihedral_type[i][m];
|
||||
|
||||
if (atom->avec->impropers_allow)
|
||||
for (int m = 0; m < atom->num_improper[i]; m++)
|
||||
atom->improper_type[i][m] = -atom->improper_type[i][m];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
update the list of gas atoms
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -50,6 +50,7 @@ class FixGCMC : public Fix {
|
||||
double energy_full();
|
||||
int pick_random_gas_atom();
|
||||
tagint pick_random_gas_molecule();
|
||||
void toggle_intramolecular(int);
|
||||
double molecule_energy(tagint);
|
||||
void update_gas_atoms_list();
|
||||
double compute_vector(int);
|
||||
@ -188,7 +189,7 @@ E: Region ID for fix gcmc does not exist
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
W: fix gcmc using full_energy option
|
||||
W: Fix gcmc using full_energy option
|
||||
|
||||
Fix gcmc has automatically turned on the full_energy option since it
|
||||
is required for systems like the one specified by the user. User input
|
||||
|
||||
@ -831,7 +831,7 @@ bool FixRattle::check4(double **v, int m, bool checkr, bool checkv)
|
||||
fabs(MathExtra::dot3(r03,v03)) > tol));
|
||||
if (!stat)
|
||||
error->one(FLERR,"RATTLE velocity constraints are not satisfied "
|
||||
"up to desired tolerance!");
|
||||
"up to desired tolerance");
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
||||
@ -99,8 +99,4 @@ E: RATTLE velocity constraints are not satisfied up to desired tolerance
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
E: RATTLE velocity constraints are not satisfied up to desired tolerance!
|
||||
|
||||
UNDOCUMENTED
|
||||
|
||||
*/
|
||||
|
||||
255
src/compute_angmom_chunk.cpp
Normal file
255
src/compute_angmom_chunk.cpp
Normal file
@ -0,0 +1,255 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
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 "string.h"
|
||||
#include "compute_angmom_chunk.h"
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "compute_chunk_atom.h"
|
||||
#include "domain.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 4) error->all(FLERR,"Illegal compute angmom/chunk command");
|
||||
|
||||
array_flag = 1;
|
||||
size_array_cols = 3;
|
||||
size_array_rows = 0;
|
||||
size_array_rows_variable = 1;
|
||||
extarray = 0;
|
||||
|
||||
// ID of compute chunk/atom
|
||||
|
||||
int n = strlen(arg[3]) + 1;
|
||||
idchunk = new char[n];
|
||||
strcpy(idchunk,arg[3]);
|
||||
|
||||
init();
|
||||
|
||||
// chunk-based data
|
||||
|
||||
nchunk = 1;
|
||||
maxchunk = 0;
|
||||
massproc = masstotal = NULL;
|
||||
com = comall = NULL;
|
||||
angmom = angmomall = NULL;
|
||||
allocate();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeAngmomChunk::~ComputeAngmomChunk()
|
||||
{
|
||||
delete [] idchunk;
|
||||
memory->destroy(massproc);
|
||||
memory->destroy(masstotal);
|
||||
memory->destroy(com);
|
||||
memory->destroy(comall);
|
||||
memory->destroy(angmom);
|
||||
memory->destroy(angmomall);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::init()
|
||||
{
|
||||
int icompute = modify->find_compute(idchunk);
|
||||
if (icompute < 0)
|
||||
error->all(FLERR,"Chunk/atom compute does not exist for "
|
||||
"compute angmom/chunk");
|
||||
cchunk = (ComputeChunkAtom *) modify->compute[icompute];
|
||||
if (strcmp(cchunk->style,"chunk/atom") != 0)
|
||||
error->all(FLERR,"Compute angmom/chunk does not use chunk/atom compute");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::compute_array()
|
||||
{
|
||||
int i,index;
|
||||
double dx,dy,dz,massone;
|
||||
double unwrap[3];
|
||||
|
||||
invoked_array = update->ntimestep;
|
||||
|
||||
// compute chunk/atom assigns atoms to chunk IDs
|
||||
// extract ichunk index vector from compute
|
||||
// ichunk = 1 to Nchunk for included atoms, 0 for excluded atoms
|
||||
|
||||
nchunk = cchunk->setup_chunks();
|
||||
cchunk->compute_ichunk();
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_array_rows = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
massproc[i] = 0.0;
|
||||
com[i][0] = com[i][1] = com[i][2] = 0.0;
|
||||
angmom[i][0] = angmom[i][1] = angmom[i][2] = 0.0;
|
||||
}
|
||||
|
||||
// compute COM for each chunk
|
||||
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
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) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
if (rmass) massone = rmass[i];
|
||||
else massone = mass[type[i]];
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
massproc[index] += massone;
|
||||
com[index][0] += unwrap[0] * massone;
|
||||
com[index][1] += unwrap[1] * massone;
|
||||
com[index][2] += unwrap[2] * massone;
|
||||
}
|
||||
|
||||
MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
comall[i][0] /= masstotal[i];
|
||||
comall[i][1] /= masstotal[i];
|
||||
comall[i][2] /= masstotal[i];
|
||||
}
|
||||
|
||||
// compute angmom for each chunk
|
||||
|
||||
double **v = atom->v;
|
||||
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
dx = unwrap[0] - comall[index][0];
|
||||
dy = unwrap[1] - comall[index][1];
|
||||
dz = unwrap[2] - comall[index][2];
|
||||
if (rmass) massone = rmass[i];
|
||||
else massone = mass[type[i]];
|
||||
angmom[index][0] += massone * (dy*v[i][2] - dz*v[i][1]);
|
||||
angmom[index][1] += massone * (dz*v[i][0] - dx*v[i][2]);
|
||||
angmom[index][2] += massone * (dx*v[i][1] - dy*v[i][0]);
|
||||
}
|
||||
|
||||
MPI_Allreduce(&angmom[0][0],&angmomall[0][0],3*nchunk,
|
||||
MPI_DOUBLE,MPI_SUM,world);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
lock methods: called by fix ave/time
|
||||
these methods insure vector/array size is locked for Nfreq epoch
|
||||
by passing lock info along to compute chunk/atom
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
increment lock counter
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::lock_enable()
|
||||
{
|
||||
cchunk->lockcount++;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
decrement lock counter in compute chunk/atom, it if still exists
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::lock_disable()
|
||||
{
|
||||
int icompute = modify->find_compute(idchunk);
|
||||
if (icompute >= 0) {
|
||||
cchunk = (ComputeChunkAtom *) modify->compute[icompute];
|
||||
cchunk->lockcount--;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
calculate and return # of chunks = length of vector/array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int ComputeAngmomChunk::lock_length()
|
||||
{
|
||||
nchunk = cchunk->setup_chunks();
|
||||
return nchunk;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set the lock from startstep to stopstep
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::lock(Fix *fixptr, bigint startstep, bigint stopstep)
|
||||
{
|
||||
cchunk->lock(fixptr,startstep,stopstep);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unset the lock
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::unlock(Fix *fixptr)
|
||||
{
|
||||
cchunk->unlock(fixptr);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free and reallocate per-chunk arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeAngmomChunk::allocate()
|
||||
{
|
||||
memory->destroy(massproc);
|
||||
memory->destroy(masstotal);
|
||||
memory->destroy(com);
|
||||
memory->destroy(comall);
|
||||
memory->destroy(angmom);
|
||||
memory->destroy(angmomall);
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"angmom/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"angmom/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"angmom/chunk:com");
|
||||
memory->create(comall,maxchunk,3,"angmom/chunk:comall");
|
||||
memory->create(angmom,maxchunk,3,"angmom/chunk:angmom");
|
||||
memory->create(angmomall,maxchunk,3,"angmom/chunk:angmomall");
|
||||
array = angmomall;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of local data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double ComputeAngmomChunk::memory_usage()
|
||||
{
|
||||
double bytes = (bigint) maxchunk * 2 * sizeof(double);
|
||||
bytes += (bigint) maxchunk * 2*3 * sizeof(double);
|
||||
bytes += (bigint) maxchunk * 2*3 * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
75
src/compute_angmom_chunk.h
Normal file
75
src/compute_angmom_chunk.h
Normal file
@ -0,0 +1,75 @@
|
||||
/* -*- 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(angmom/chunk,ComputeAngmomChunk)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_COMPUTE_ANGMOM_CHUNK_H
|
||||
#define LMP_COMPUTE_ANGMOM_CHUNK_H
|
||||
|
||||
#include "compute.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class ComputeAngmomChunk : public Compute {
|
||||
public:
|
||||
ComputeAngmomChunk(class LAMMPS *, int, char **);
|
||||
~ComputeAngmomChunk();
|
||||
void init();
|
||||
void compute_array();
|
||||
|
||||
void lock_enable();
|
||||
void lock_disable();
|
||||
int lock_length();
|
||||
void lock(class Fix *, bigint, bigint);
|
||||
void unlock(class Fix *);
|
||||
|
||||
double memory_usage();
|
||||
|
||||
private:
|
||||
int nchunk,maxchunk;
|
||||
char *idchunk;
|
||||
class ComputeChunkAtom *cchunk;
|
||||
|
||||
double *massproc,*masstotal;
|
||||
double **com,**comall;
|
||||
double **angmom,**angmomall;
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#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: Chunk/atom compute does not exist for compute angmom/chunk
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
E: Compute angmom/chunk does not use chunk/atom compute
|
||||
|
||||
The style of the specified compute is not chunk/atom.
|
||||
|
||||
*/
|
||||
333
src/compute_omega_chunk.cpp
Normal file
333
src/compute_omega_chunk.cpp
Normal file
@ -0,0 +1,333 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
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 "string.h"
|
||||
#include "compute_omega_chunk.h"
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "compute_chunk_atom.h"
|
||||
#include "domain.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command");
|
||||
|
||||
array_flag = 1;
|
||||
size_array_cols = 3;
|
||||
size_array_rows = 0;
|
||||
size_array_rows_variable = 1;
|
||||
extarray = 0;
|
||||
|
||||
// ID of compute chunk/atom
|
||||
|
||||
int n = strlen(arg[3]) + 1;
|
||||
idchunk = new char[n];
|
||||
strcpy(idchunk,arg[3]);
|
||||
|
||||
init();
|
||||
|
||||
// chunk-based data
|
||||
|
||||
nchunk = 1;
|
||||
maxchunk = 0;
|
||||
massproc = masstotal = NULL;
|
||||
com = comall = NULL;
|
||||
angmom = angmomall = NULL;
|
||||
allocate();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeOmegaChunk::~ComputeOmegaChunk()
|
||||
{
|
||||
delete [] idchunk;
|
||||
memory->destroy(massproc);
|
||||
memory->destroy(masstotal);
|
||||
memory->destroy(com);
|
||||
memory->destroy(comall);
|
||||
memory->destroy(angmom);
|
||||
memory->destroy(angmomall);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::init()
|
||||
{
|
||||
int icompute = modify->find_compute(idchunk);
|
||||
if (icompute < 0)
|
||||
error->all(FLERR,"Chunk/atom compute does not exist for "
|
||||
"compute omega/chunk");
|
||||
cchunk = (ComputeChunkAtom *) modify->compute[icompute];
|
||||
if (strcmp(cchunk->style,"chunk/atom") != 0)
|
||||
error->all(FLERR,"Compute omega/chunk does not use chunk/atom compute");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::compute_array()
|
||||
{
|
||||
int i,j,index;
|
||||
double dx,dy,dz,massone;
|
||||
double unwrap[3];
|
||||
|
||||
invoked_array = update->ntimestep;
|
||||
|
||||
// compute chunk/atom assigns atoms to chunk IDs
|
||||
// extract ichunk index vector from compute
|
||||
// ichunk = 1 to Nchunk for included atoms, 0 for excluded atoms
|
||||
|
||||
nchunk = cchunk->setup_chunks();
|
||||
cchunk->compute_ichunk();
|
||||
int *ichunk = cchunk->ichunk;
|
||||
|
||||
if (nchunk > maxchunk) allocate();
|
||||
size_array_rows = nchunk;
|
||||
|
||||
// zero local per-chunk values
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
massproc[i] = 0.0;
|
||||
com[i][0] = com[i][1] = com[i][2] = 0.0;
|
||||
for (j = 0; j < 6; j++) inertia[i][j] = 0.0;
|
||||
angmom[i][0] = angmom[i][1] = angmom[i][2] = 0.0;
|
||||
omega[i][0] = omega[i][1] = omega[i][2] = 0.0;
|
||||
}
|
||||
|
||||
// compute COM for each chunk
|
||||
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
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) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
if (rmass) massone = rmass[i];
|
||||
else massone = mass[type[i]];
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
massproc[index] += massone;
|
||||
com[index][0] += unwrap[0] * massone;
|
||||
com[index][1] += unwrap[1] * massone;
|
||||
com[index][2] += unwrap[2] * massone;
|
||||
}
|
||||
|
||||
MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
comall[i][0] /= masstotal[i];
|
||||
comall[i][1] /= masstotal[i];
|
||||
comall[i][2] /= masstotal[i];
|
||||
}
|
||||
|
||||
// compute inertia tensor for each chunk
|
||||
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
if (rmass) massone = rmass[i];
|
||||
else massone = mass[type[i]];
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
dx = unwrap[0] - comall[index][0];
|
||||
dy = unwrap[1] - comall[index][1];
|
||||
dz = unwrap[2] - comall[index][2];
|
||||
inertia[index][0] += massone * (dy*dy + dz*dz);
|
||||
inertia[index][1] += massone * (dx*dx + dz*dz);
|
||||
inertia[index][2] += massone * (dx*dx + dy*dy);
|
||||
inertia[index][3] -= massone * dx*dy;
|
||||
inertia[index][4] -= massone * dy*dz;
|
||||
inertia[index][5] -= massone * dx*dz;
|
||||
}
|
||||
|
||||
MPI_Allreduce(&inertia[0][0],&inertiaall[0][0],6*nchunk,
|
||||
MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
// compute angmom for each chunk
|
||||
|
||||
double **v = atom->v;
|
||||
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
index = ichunk[i]-1;
|
||||
if (index < 0) continue;
|
||||
domain->unmap(x[i],image[i],unwrap);
|
||||
dx = unwrap[0] - comall[index][0];
|
||||
dy = unwrap[1] - comall[index][1];
|
||||
dz = unwrap[2] - comall[index][2];
|
||||
if (rmass) massone = rmass[i];
|
||||
else massone = mass[type[i]];
|
||||
angmom[index][0] += massone * (dy*v[i][2] - dz*v[i][1]);
|
||||
angmom[index][1] += massone * (dz*v[i][0] - dx*v[i][2]);
|
||||
angmom[index][2] += massone * (dx*v[i][1] - dy*v[i][0]);
|
||||
}
|
||||
|
||||
MPI_Allreduce(&angmom[0][0],&angmomall[0][0],3*nchunk,
|
||||
MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
// compute omega for each chunk from L = Iw, inverting I to solve for w
|
||||
|
||||
double ione[3][3],inverse[3][3];
|
||||
|
||||
for (i = 0; i < nchunk; i++) {
|
||||
ione[0][0] = inertiaall[i][0];
|
||||
ione[1][1] = inertiaall[i][1];
|
||||
ione[2][2] = inertiaall[i][2];
|
||||
ione[0][1] = inertiaall[i][3];
|
||||
ione[1][2] = inertiaall[i][4];
|
||||
ione[0][2] = inertiaall[i][5];
|
||||
ione[1][0] = ione[0][1];
|
||||
ione[2][1] = ione[1][2];
|
||||
ione[2][0] = ione[0][2];
|
||||
|
||||
inverse[0][0] = ione[1][1]*ione[2][2] - ione[1][2]*ione[2][1];
|
||||
inverse[0][1] = -(ione[0][1]*ione[2][2] - ione[0][2]*ione[2][1]);
|
||||
inverse[0][2] = ione[0][1]*ione[1][2] - ione[0][2]*ione[1][1];
|
||||
|
||||
inverse[1][0] = -(ione[1][0]*ione[2][2] - ione[1][2]*ione[2][0]);
|
||||
inverse[1][1] = ione[0][0]*ione[2][2] - ione[0][2]*ione[2][0];
|
||||
inverse[1][2] = -(ione[0][0]*ione[1][2] - ione[0][2]*ione[1][0]);
|
||||
|
||||
inverse[2][0] = ione[1][0]*ione[2][1] - ione[1][1]*ione[2][0];
|
||||
inverse[2][1] = -(ione[0][0]*ione[2][1] - ione[0][1]*ione[2][0]);
|
||||
inverse[2][2] = ione[0][0]*ione[1][1] - ione[0][1]*ione[1][0];
|
||||
|
||||
double determinant = ione[0][0]*ione[1][1]*ione[2][2] +
|
||||
ione[0][1]*ione[1][2]*ione[2][0] + ione[0][2]*ione[1][0]*ione[2][1] -
|
||||
ione[0][0]*ione[1][2]*ione[2][1] - ione[0][1]*ione[1][0]*ione[2][2] -
|
||||
ione[2][0]*ione[1][1]*ione[0][2];
|
||||
|
||||
if (determinant > 0.0)
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int j = 0; j < 3; j++)
|
||||
inverse[i][j] /= determinant;
|
||||
|
||||
omega[i][0] = inverse[0][0]*angmom[i][0] + inverse[0][1]*angmom[i][1] +
|
||||
inverse[0][2]*angmom[i][2];
|
||||
omega[i][1] = inverse[1][0]*angmom[i][0] + inverse[1][1]*angmom[i][1] +
|
||||
inverse[1][2]*angmom[i][2];
|
||||
omega[i][2] = inverse[2][0]*angmom[i][0] + inverse[2][1]*angmom[i][1] +
|
||||
inverse[2][2]*angmom[i][2];
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
lock methods: called by fix ave/time
|
||||
these methods insure vector/array size is locked for Nfreq epoch
|
||||
by passing lock info along to compute chunk/atom
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
increment lock counter
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::lock_enable()
|
||||
{
|
||||
cchunk->lockcount++;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
decrement lock counter in compute chunk/atom, it if still exists
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::lock_disable()
|
||||
{
|
||||
int icompute = modify->find_compute(idchunk);
|
||||
if (icompute >= 0) {
|
||||
cchunk = (ComputeChunkAtom *) modify->compute[icompute];
|
||||
cchunk->lockcount--;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
calculate and return # of chunks = length of vector/array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int ComputeOmegaChunk::lock_length()
|
||||
{
|
||||
nchunk = cchunk->setup_chunks();
|
||||
return nchunk;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set the lock from startstep to stopstep
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::lock(Fix *fixptr, bigint startstep, bigint stopstep)
|
||||
{
|
||||
cchunk->lock(fixptr,startstep,stopstep);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unset the lock
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::unlock(Fix *fixptr)
|
||||
{
|
||||
cchunk->unlock(fixptr);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free and reallocate per-chunk arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeOmegaChunk::allocate()
|
||||
{
|
||||
memory->destroy(massproc);
|
||||
memory->destroy(masstotal);
|
||||
memory->destroy(com);
|
||||
memory->destroy(comall);
|
||||
memory->destroy(inertia);
|
||||
memory->destroy(inertiaall);
|
||||
memory->destroy(angmom);
|
||||
memory->destroy(angmomall);
|
||||
memory->destroy(omega);
|
||||
maxchunk = nchunk;
|
||||
memory->create(massproc,maxchunk,"omega/chunk:massproc");
|
||||
memory->create(masstotal,maxchunk,"omega/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"omega/chunk:com");
|
||||
memory->create(comall,maxchunk,3,"omega/chunk:comall");
|
||||
memory->create(inertia,maxchunk,6,"omega/chunk:inertia");
|
||||
memory->create(inertiaall,maxchunk,6,"omega/chunk:inertiaall");
|
||||
memory->create(angmom,maxchunk,3,"omega/chunk:angmom");
|
||||
memory->create(angmomall,maxchunk,3,"omega/chunk:angmomall");
|
||||
memory->create(omega,maxchunk,3,"omega/chunk:omega");
|
||||
array = omega;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of local data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double ComputeOmegaChunk::memory_usage()
|
||||
{
|
||||
double bytes = (bigint) maxchunk * 2 * sizeof(double);
|
||||
bytes += (bigint) maxchunk * 2*3 * sizeof(double);
|
||||
bytes += (bigint) maxchunk * 2*6 * sizeof(double);
|
||||
bytes += (bigint) maxchunk * 2*3 * sizeof(double);
|
||||
bytes += (bigint) maxchunk * 3 * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
77
src/compute_omega_chunk.h
Normal file
77
src/compute_omega_chunk.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* -*- 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(omega/chunk,ComputeOmegaChunk)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_COMPUTE_OMEGA_CHUNK_H
|
||||
#define LMP_COMPUTE_OMEGA_CHUNK_H
|
||||
|
||||
#include "compute.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class ComputeOmegaChunk : public Compute {
|
||||
public:
|
||||
ComputeOmegaChunk(class LAMMPS *, int, char **);
|
||||
~ComputeOmegaChunk();
|
||||
void init();
|
||||
void compute_array();
|
||||
|
||||
void lock_enable();
|
||||
void lock_disable();
|
||||
int lock_length();
|
||||
void lock(class Fix *, bigint, bigint);
|
||||
void unlock(class Fix *);
|
||||
|
||||
double memory_usage();
|
||||
|
||||
private:
|
||||
int nchunk,maxchunk;
|
||||
char *idchunk;
|
||||
class ComputeChunkAtom *cchunk;
|
||||
|
||||
double *massproc,*masstotal;
|
||||
double **com,**comall;
|
||||
double **inertia,**inertiaall;
|
||||
double **angmom,**angmomall;
|
||||
double **omega;
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#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: Chunk/atom compute does not exist for compute omega/chunk
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
E: Compute omega/chunk does not use chunk/atom compute
|
||||
|
||||
The style of the specified compute is not chunk/atom.
|
||||
|
||||
*/
|
||||
@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
|
||||
ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 4) error->all(FLERR,"Illegal compute inertia/chunk command");
|
||||
if (narg != 4) error->all(FLERR,"Illegal compute torque/chunk command");
|
||||
|
||||
array_flag = 1;
|
||||
size_array_cols = 3;
|
||||
@ -153,9 +153,9 @@ void ComputeTorqueChunk::compute_array()
|
||||
dx = unwrap[0] - comall[index][0];
|
||||
dy = unwrap[1] - comall[index][1];
|
||||
dz = unwrap[2] - comall[index][2];
|
||||
torque[i][0] += dy*f[i][2] - dz*f[i][1];
|
||||
torque[i][1] += dz*f[i][0] - dx*f[i][2];
|
||||
torque[i][2] += dx*f[i][1] - dy*f[i][0];
|
||||
torque[index][0] += dy*f[i][2] - dz*f[i][1];
|
||||
torque[index][1] += dz*f[i][0] - dx*f[i][2];
|
||||
torque[index][2] += dx*f[i][1] - dy*f[i][0];
|
||||
}
|
||||
|
||||
MPI_Allreduce(&torque[0][0],&torqueall[0][0],3*nchunk,
|
||||
@ -235,8 +235,8 @@ void ComputeTorqueChunk::allocate()
|
||||
memory->create(masstotal,maxchunk,"torque/chunk:masstotal");
|
||||
memory->create(com,maxchunk,3,"torque/chunk:com");
|
||||
memory->create(comall,maxchunk,3,"torque/chunk:comall");
|
||||
memory->create(torque,maxchunk,6,"torque/chunk:torque");
|
||||
memory->create(torqueall,maxchunk,6,"torque/chunk:torqueall");
|
||||
memory->create(torque,maxchunk,3,"torque/chunk:torque");
|
||||
memory->create(torqueall,maxchunk,3,"torque/chunk:torqueall");
|
||||
array = torqueall;
|
||||
}
|
||||
|
||||
|
||||
@ -222,11 +222,13 @@ Self-explanatory.
|
||||
|
||||
E: System is not charge neutral, net charge = %g
|
||||
|
||||
UNDOCUMENTED
|
||||
The total charge on all atoms on the system is not 0.0.
|
||||
For some KSpace solvers this is an error.
|
||||
|
||||
W: System is not charge neutral, net charge = %g
|
||||
|
||||
UNDOCUMENTED
|
||||
The total charge on all atoms on the system is not 0.0.
|
||||
For some KSpace solvers this is only a warning.
|
||||
|
||||
W: For better accuracy use 'pair_modify table 0'
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
#define LAMMPS_VERSION "14 Mar 2015"
|
||||
#define LAMMPS_VERSION "25 Mar 2015"
|
||||
|
||||
Reference in New Issue
Block a user