Adding Steve's edits in documenation + associated changes in files

This commit is contained in:
Joel Thomas Clemmer
2021-12-03 16:12:31 -07:00
parent 7113334f99
commit 40258f8b9a
33 changed files with 745 additions and 732 deletions

View File

@ -33,6 +33,7 @@ OPT.
* *
* *
* :doc:`bpm/rotational <bond_bpm_rotational>` * :doc:`bpm/rotational <bond_bpm_rotational>`
* :doc:`bpm/spring <bond_bpm_spring>`
* :doc:`class2 (ko) <bond_class2>` * :doc:`class2 (ko) <bond_class2>`
* :doc:`fene (iko) <bond_fene>` * :doc:`fene (iko) <bond_fene>`
* :doc:`fene/expand (o) <bond_fene_expand>` * :doc:`fene/expand (o) <bond_fene_expand>`

View File

@ -1,81 +1,106 @@
Bonded particle models Bonded particle models
=============== ===============
Bonded particle models are used to simulate mesoscale solids. The BPM package implements bonded particle models which can be used to
Solids are constructed as a collection of particles which each simulate mesoscale solids. Solids are constructed as a collection of
represent a coarse-grained region of space much larger than the
atomistic scale. Particles within a solid region are then connected particles which each represent a coarse-grained region of space much
by a network of bonds to provide solid elasticity. larger than the atomistic scale. Particles within a solid region are
then connected by a network of bonds to provide solid elasticity.
Unlike traditional bonds in molecular dynamics, the equilibrium Unlike traditional bonds in molecular dynamics, the equilibrium bond
bond length can vary between bonds. Bonds store the reference state. length can vary between bonds. Bonds store the reference state. This
This includes setting the equilibrium length equal to the initial includes setting the equilibrium length equal to the initial distance
distance between the two particles but can also include data on the between the two particles but can also include data on the bond
bond orientation for rotational models. This produces a stress free orientation for rotational models. This produces a stress free initial
initial state. Furthermore, bonds are allowed to break under large state. Furthermore, bonds are allowed to break under large strains
strains producing fracture. producing fracture. The examples/bpm directory has sample input scripts
for simulations of the fragmentation of an impacted plate and the
pouring of extended, elastic bodies.
Bonds can be created using a :doc:`read data <read_data>` ----------
or :doc:`create bond <create_bond>` command. Alternatively, a
Bonds can be created using a :doc:`read data <read_data>` or
:doc:`create bond <create_bond>` command. Alternatively, a
:doc:`molecule <molecule>` template with bonds can be used with :doc:`molecule <molecule>` template with bonds can be used with
:doc:`fix deposit <fix_deposit>` or :doc:`fix pour <fix_pour>` to :doc:`fix deposit <fix_deposit>` or :doc:`fix pour <fix_pour>` to
create solid grains. create solid grains.
In this implementation, bonds store their reference state when they
are first computed in the setup of a simulation run. Data is then
preserved across run commands and is written to :doc:`binary restart files <restart>`
such that restarting the system will not reset the reference state of a bond.
As bonds can be broken between neighbor list builds, :doc:`special_bonds <special_bonds>` In this implementation, bonds store their reference state when they are
work differently for BPM bond styles. There are two possible settings first computed in the setup of the first simulation run. Data is then
which determine how pair interactions work between bonded preserved across run commands and is written to :doc:`binary restart
particles. files <restart>` such that restarting the system will not reset the
First, one can censor all pair interactions between bonded particles. reference state of a bond. Bonds that are created midway into a run,
Unlike :doc:`bond quartic <bond_quartic>`, this is not done by subtracting such as those created by pouring grains using :doc:`fix pour
pair forces during the bond computation but rather by dynamically updating <fix_pour>`, are initialized on that timestep.
the special bond list. This is the default behavior of BPM bond styles
and is done by updating the 1-2 special bond list as bonds break. As bonds can be broken between neighbor list builds, the
To do this, LAMMPS requires :doc:`newton <newton>` bond off such that all :doc:`special_bonds <special_bonds>` command works differently for BPM
bond styles. There are two possible settings which determine how pair
interactions work between bonded particles. First, one can turn off
all pair interactions between bonded particles. Unlike :doc:`bond
quartic <bond_quartic>`, this is not done by subtracting pair forces
during the bond computation but rather by dynamically updating the
special bond list. This is the default behavior of BPM bond styles and
is done by updating the 1-2 special bond list as bonds break. To do
this, LAMMPS requires :doc:`newton <newton>` bond off such that all
processors containing an atom know when a bond breaks. Additionally, processors containing an atom know when a bond breaks. Additionally,
one must use the following special bond settings one must do either (A) or (B).
(A)
Use the following special bond settings
.. code-block:: LAMMPS .. code-block:: LAMMPS
special_bonds lj 0 1 1 coul 1 1 1 special_bonds lj 0 1 1 coul 1 1 1
These settings accomplish two goals. First, they turns off 1-3 and These settings accomplish two goals. First, they turn off 1-3 and 1-4
1-4 special bond lists, which are not currently supported for BPMs. As BPMs often special bond lists, which are not currently supported for BPMs. As
have dense bond networks, generating 1-3 and 1-4 special bond lists is expensive. BPMs often have dense bond networks, generating 1-3 and 1-4 special
By setting the lj weight for 1-2 bonds to zero, this censors pairwise interactions. bond lists is expensive. By setting the lj weight for 1-2 bonds to
By setting a nonzero coul weight for 1-2 bonds ensures all bonded neighbors are zero, this turns off pairwise interactions. Even though there are no
still included in the neighbor list in case bonds break between neighbor list builds. charges in BPM models, setting a nonzero coul weight for 1-2 bonds
ensures all bonded neighbors are still included in the neighbor list
in case bonds break between neighbor list builds.
(B)
Alternatively, one can simply overlay pair interactions such that all Alternatively, one can simply overlay pair interactions such that all
bonded particles also feel pair interactions. This can be accomplished by bonded particles also feel pair interactions. This can be accomplished
using the *overlay/pair* keyword in the bond settings and by by using the *overlay/pair* keyword present in all bpm bond styles and
using the following special bond settings by using the following special bond settings
.. code-block:: LAMMPS .. code-block:: LAMMPS
special_bonds lj/coul 1 1 1 special_bonds lj/coul 1 1 1
Currently there are two types of bonds included in this package. The first ----------
bond style, :doc:`bond bpm/spring <bond_bpm_spring>`, only applies pairwise,
central body forces. Point particles must have :doc:`bond atom style <atom_style>` Currently there are two types of bonds included in the BPM
and may be thought of as nodes in a spring network. Alternatively, package. The first bond style, :doc:`bond bpm/spring
the second bond style, :doc:`bond bpm/rotational <bond_bpm_rotational>`, <bond_bpm_spring>`, only applies pairwise, central body forces. Point
resolves tangential forces and torques arising with the shearing, bending, particles must have :doc:`bond atom style <atom_style>` and may be
and twisting of the bond due to rotation or displacement of particles. thought of as nodes in a spring network. Alternatively, the second
Particles are similar to those used in the :doc:`granular package <Howto_granular>`, bond style, :doc:`bond bpm/rotational <bond_bpm_rotational>`, resolves
:doc:`atom style sphere <atom_style>`. However, they must also track the tangential forces and torques arising with the shearing, bending, and
current orientation of particles and therefore use a derived :doc:`atom style sphere/bpm <atom_style>`. twisting of the bond due to rotation or displacement of particles.
This also requires a unique integrator :doc:`fix nve/sphere/bpm <fix_nve_sphere_bpm>` Particles are similar to those used in the :doc:`granular package
which numerically integrates orientation similar to :doc:`fix nve/asphere <fix_nve_asphere>`. <Howto_granular>`, :doc:`atom style sphere <atom_style>`. However,
they must also track the current orientation of particles and
therefore use a derived :doc:`atom style sphere/bpm <atom_style>`.
This also requires a unique integrator :doc:`fix nve/sphere/bpm
<fix_nve_sphere_bpm>` which numerically integrates orientation similar
to :doc:`fix nve/asphere <fix_nve_asphere>`.
To monitor the fracture of bonds in the system, all BPM bond styles To monitor the fracture of bonds in the system, all BPM bond styles
can be associated with an instance of :doc:`fix store/local <fix_store_local>` can be associated with an instance of :doc:`fix store/local
to record all instances of bond breakage for output. Additionally, one can use <fix_store_local>` to record all instances of bond breakage for
:doc:`compute nbond/atom <compute_nbond_atom>` to tally the current number of bonds per atom. output. Additionally, one can use :doc:`compute nbond/atom
<compute_nbond_atom>` to tally the current number of bonds per atom.
In addition to bond styles, a new pair style :doc:`pair bpm/spring <pair_bpm_spring>` was added In addition to bond styles, a new pair style :doc:`pair bpm/spring
to accompany the bpm/spring bond style. This pair style is simply a hookean repulsion with <pair_bpm_spring>` was added to accompany the bpm/spring bond
similar velocity damping as its sister bond style. style. This pair style is simply a hookean repulsion with similar
velocity damping as its sister bond style.

5
doc/src/Howto_broken_bonds.rst Executable file
View File

@ -0,0 +1,5 @@
Broken Bonds
===============

View File

@ -17,10 +17,12 @@ Syntax
*store/local* values = ID of associated fix store/local followed by one or more attributes *store/local* values = ID of associated fix store/local followed by one or more attributes
*id1, id2* = IDs of 2 atoms in the bond *id1, id2* = IDs of 2 atoms in the bond
*time* = the time the bond broke *time* = the timestep the bond broke
*x, y, z* = the center of mass position of the 2 atoms when the bond broke *x, y, z* = the center of mass position of the 2 atoms when the bond broke (distance units)
*x/ref, y/ref, z/ref* = the inintial center of mass position of the 2 atoms *x/ref, y/ref, z/ref* = the initial center of mass position of the 2 atoms (distance units)
*overlay/pair* value = none
bonded particles will still interact with pair forces
Examples Examples
"""""""" """"""""
@ -38,11 +40,11 @@ Examples
Description Description
""""""""""" """""""""""
The *bpm/rotational* bond style computes forces and torques based The *bpm/rotational* bond style computes forces and torques based on
on deviations from the initial reference state of the two atoms. deviations from the initial reference state of the two atoms. The
The reference state is stored by each bond when it is first computed reference state is stored by each bond when it is first computed in
in the setup of a run. Data is then preserved across run commands and the setup of a run. Data is then preserved across run commands and is
is written to :doc:`binary restart files <restart>` such that restarting written to :doc:`binary restart files <restart>` such that restarting
the system will not reset the reference state of a bond. the system will not reset the reference state of a bond.
Forces include a normal and tangential component. The base normal force Forces include a normal and tangential component. The base normal force
@ -56,13 +58,14 @@ where :math:`k_r` is a stiffness and :math:`r` is the current distance and
:math:`r_0` is the initial distance between the two particles. :math:`r_0` is the initial distance between the two particles.
A tangential force is applied perpendicular to the normal direction A tangential force is applied perpendicular to the normal direction
which is proportional to the tangential shear displacement with a stiffness which is proportional to the tangential shear displacement with a
of :math:`k_s`. This tangential force also induces a torque. stiffness of :math:`k_s`. This tangential force also induces a torque.
In addition, bending and twisting torques are also applied to particles In addition, bending and twisting torques are also applied to
which are proportional to angular bending and twisting displacements with particles which are proportional to angular bending and twisting
stiffnesses of :math`k_b` and :math:`k_t`, respectively. displacements with stiffnesses of :math`k_b` and :math:`k_t',
Details on the calculations of shear displacements and angular displacements respectively. Details on the calculations of shear displacements and
can be found in :ref:`(Wang) <Wang2009>` and :ref:`(Wang and Mora) <WangMora2009b>`. angular displacements can be found in :ref:`(Wang) <Wang2009>` and
:ref:`(Wang and Mora) <WangMora2009b>`.
Bonds will break under sufficient stress. A breaking criteria is calculated Bonds will break under sufficient stress. A breaking criteria is calculated
@ -72,18 +75,18 @@ Bonds will break under sufficient stress. A breaking criteria is calculated
\frac{|\tau_b|}{\tau_{b,c}} + \frac{|\tau_t|}{\tau_{t,c}} \} \frac{|\tau_b|}{\tau_{b,c}} + \frac{|\tau_t|}{\tau_{t,c}} \}
where :math:`|f_s|` is the magnitude of the shear force and where :math:`|f_s|` is the magnitude of the shear force and
:math:`|\tau_b|` and :math:`|\tau_t|` are the magnitudes of the bending and :math:`|\tau_b|` and :math:`|\tau_t|` are the magnitudes of the
twisting forces, respectively. The corresponding variables :math:`f_{r,c}` bending and twisting forces, respectively. The corresponding variables
:math:`f_{s,c}`, :math:`\tau_{b,c}`, and :math:`\tau_{t,c}` are critical :math:`f_{r,c}` :math:`f_{s,c}`, :math:`\tau_{b,c}`, and
limits to each force or torque. :math:`\tau_{t,c}` are critical limits to each force or torque. If
If :math:`B` is ever equal to or exceeds one, the bond will break. :math:`B` is ever equal to or exceeds one, the bond will break. This
This is done by setting by setting its type to 0 such that forces and is done by setting by setting its type to 0 such that forces and
torques are no longer computed. torques are no longer computed.
After computing the base magnitudes of the forces and torques, they are After computing the base magnitudes of the forces and torques, they
all multiplied by an extra factor :math:`w` to smoothly interpolate are all multiplied by an extra factor :math:`w` to smoothly
forces and torques to zero as the bond breaks. This term is calculated interpolate forces and torques to zero as the bond breaks. This term
as :math:`w = (1.0 - B^4)`. is calculated as :math:`w = (1.0 - B^4)`.
Finally, additional damping forces and torques are applied to the two Finally, additional damping forces and torques are applied to the two
particles. A force is applied proportional to the difference in the particles. A force is applied proportional to the difference in the
@ -97,11 +100,12 @@ dissipative particle dynamics (:ref:`(Groot) <Groot1>`):
where :math:`\gamma_n` is the damping strength, :math:`\hat{r}` is the where :math:`\gamma_n` is the damping strength, :math:`\hat{r}` is the
radial normal vector, and :math:`\vec{v}` is the velocity difference radial normal vector, and :math:`\vec{v}` is the velocity difference
between the two particles. Similarly, tangential forces are applied to between the two particles. Similarly, tangential forces are applied to
each atom proportional to the relative differences in sliding velocities each atom proportional to the relative differences in sliding
with a constant prefactor :math:`\gamma_s` (:ref:`(Wang et al.) <Wang2015>`) velocities with a constant prefactor :math:`\gamma_s` (:ref:`(Wang et
along with their associated torques. The rolling and twisting components of al.) <Wang2015>) along with their associated torques. The rolling and
the relative angular velocities of the two atoms are also damped by applying twisting components of the relative angular velocities of the two
torques with prefactors of :math:`\gamma_r` and :math:`\gamma_t`, respectively. atoms are also damped by applying torques with prefactors of
:math:`\gamma_r` and :math:`\gamma_t`, respectively.
The following coefficients must be defined for each bond type via the The following coefficients must be defined for each bond type via the
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in :doc:`bond_coeff <bond_coeff>` command as in the example above, or in
@ -122,14 +126,16 @@ or :doc:`read_restart <read_restart>` commands:
* :math:`\gamma_t` (distance*force/seconds/radians units) * :math:`\gamma_t` (distance*force/seconds/radians units)
By default, pair forces are not calculated between bonded particles. By default, pair forces are not calculated between bonded particles.
Pair forces can alternatively be overlaid on top of bond forces Pair forces can alternatively be overlaid on top of bond forces using
using the *overlay/pair* keyword. These settings require specific the *overlay/pair* keyword. These settings require specific
:doc:`special_bonds <special_bonds>` settings described in the restrictions. :doc:`special_bonds <special_bonds>` settings described in the
Further details can be found in the `:doc: how to <Howto_BPM>` page on BPMs. restrictions. Further details can be found in the `:doc: how to
<Howto_BPM>` page on BPMs.
This bond style tracks broken bonds and can record them using an instance of This bond style tracks broken bonds and can record them using an
:doc:`fix store/local <fix_store_local>` if the *store/local* keyword is instance of :doc:`fix store/local <fix_store_local>` if the
used followed by the ID of the fix and then a series of bond attributes. *store/local* keyword is used followed by the ID of the fix and then a
series of bond attributes.
Note that when bonds are dumped to a file via the :doc:`dump local <dump>` Note that when bonds are dumped to a file via the :doc:`dump local <dump>`
command, bonds with type 0 (broken bonds) are not included. The command, bonds with type 0 (broken bonds) are not included. The
@ -148,24 +154,26 @@ Restart
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This bond style writes the reference state of each bond to This bond style writes the reference state of each bond to
:doc:`binary restart files <restart>`. Loading a restart :doc:`binary restart files <restart>`. Loading a restart file will
file will properly resume bonds. properly resume bonds.
Restrictions Restrictions
"""""""""""" """"""""""""
This bond style can only be used if LAMMPS was built with the BPM This bond style can only be used if LAMMPS was built with the BPM
package. See the :doc:`Build package <Build_package>` doc page for more package. See the :doc:`Build package <Build_package>` doc page for
info. more info.
By default if pair interactions are censored, this bond style requires setting By default if pair interactions are to be disabled, this bond style
requires setting
.. code-block:: LAMMPS .. code-block:: LAMMPS
special_bonds lj 0 1 1 coul 1 1 1 special_bonds lj 0 1 1 coul 1 1 1
and :doc:`newton <newton>` must be set to bond off. and :doc:`newton <newton>` must be set to bond off. If the
If the *overlay/pair* option is used, this bond style alternatively requires setting *overlay/pair* option is used, this bond style alternatively requires
setting
.. code-block:: LAMMPS .. code-block:: LAMMPS
@ -184,6 +192,7 @@ Default
none none
----------
.. _Wang2009: .. _Wang2009:
@ -203,4 +212,4 @@ p 117-127 (2009).
**(Wang et al, 2015)** Wang, Y., Alonso-Marroquin, F., & Guo, **(Wang et al, 2015)** Wang, Y., Alonso-Marroquin, F., & Guo,
W. W. (2015). Rolling and sliding in 3-D discrete element W. W. (2015). Rolling and sliding in 3-D discrete element
models. Particuology, 23, 49-55. models. Particuology, 23, 49-55.

View File

@ -17,10 +17,12 @@ Syntax
*store/local* values = ID of associated fix store/local followed by one or more attributes *store/local* values = ID of associated fix store/local followed by one or more attributes
*id1, id2* = IDs of 2 atoms in the bond *id1, id2* = IDs of 2 atoms in the bond
*time* = the time the bond broke *time* = the timestep the bond broke
*x, y, z* = the center of mass position of the 2 atoms when the bond broke *x, y, z* = the center of mass position of the 2 atoms when the bond broke (distance units)
*x/ref, y/ref, z/ref* = the inintial center of mass position of the 2 atoms *x/ref, y/ref, z/ref* = the initial center of mass position of the 2 atoms (distance units)
*overlay/pair* value = none
bonded particles will still interact with pair forces
Examples Examples
"""""""" """"""""
@ -38,36 +40,35 @@ Examples
Description Description
""""""""""" """""""""""
The *bpm/spring* bond style computes forces and torques based The *bpm/spring* bond style computes forces and torques based on
on deviations from the initial reference state of the two atoms. deviations from the initial reference state of the two atoms. The
The reference state is stored by each bond when it is first computed reference state is stored by each bond when it is first computed in
in the setup of a run. Data is then preserved across run commands and the setup of a run. Data is then preserved across run commands and is
is written to :doc:`binary restart files <restart>` such that restarting written to :doc:`binary restart files <restart>` such that restarting
the system will not reset the reference state of a bond. the system will not reset the reference state of a bond.
This bond style only applies central-body forces which conserve the translational This bond style only applies central-body forces which conserve the
and rotational degrees of freedom of a bonded set of particles. The force translational and rotational degrees of freedom of a bonded set of
has a magnitude of particles. The force has a magnitude of
.. math:: .. math::
F = k (r - r_0) w F = k (r - r_0) w
where :math:`k_r` is a stiffness, :math:`r` is the current distance and where :math:`k_r` is a stiffness, :math:`r` is the current distance
:math:`r_0` is the initial distance between the two particles, and :math:`w` and :math:`r_0` is the initial distance between the two particles, and
is a smoothing factor. :math:`w` is a smoothing factor. Bonds will break at a strain of
Bonds will break at a strain of :math:`\epsilon_c`. :math:`\epsilon_c`. This is done by setting by setting its type to 0
This is done by setting by setting its type to 0 such that forces are such that forces are no longer computed. The smoothing factor
no longer computed. :math:`w` is constructed such that forces smoothly go to zero,
The smoothing factor :math:`w` is constructed such that forces smoothly avoiding discontinuities, as bonds approach the critical strain
go to zero, avoiding discontinuities, as bonds approach the critical strain
.. math:: .. math::
w = 1.0 - \left( \frac{r - r_0}{r_0 \epsilon_c} \right)^8 . w = 1.0 - \left( \frac{r - r_0}{r_0 \epsilon_c} \right)^8 .
Finally, an additional damping force is applied to the bonded particles. Finally, an additional damping force is applied to the bonded
This forces is proportional to the difference in the particles. This forces is proportional to the difference in the
normal velocity of particles using a similar construction as normal velocity of particles using a similar construction as
dissipative particle dynamics (:ref:`(Groot) <Groot1>`): dissipative particle dynamics (:ref:`(Groot) <Groot1>`):
@ -81,34 +82,35 @@ between the two particles.
The following coefficients must be defined for each bond type via the The following coefficients must be defined for each bond type via the
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in :doc:`bond_coeff <bond_coeff>` command as in the example above, or in
the data file or restart files read by the :doc:`read_data <read_data>` the data file or restart files read by the :doc:`read_data
or :doc:`read_restart <read_restart>` commands: <read_data>` or :doc:`read_restart <read_restart>` commands:
* :math:`k` (force/distance units) * :math:`k` (force/distance units)
* :math:`\epsilon_c` (unit less) * :math:`\epsilon_c` (unit less)
* :math:`\gamma` (force/velocity units) * :math:`\gamma` (force/velocity units)
By default, pair forces are not calculated between bonded particles. By default, pair forces are not calculated between bonded particles.
Pair forces can alternatively be overlaid on top of bond forces Pair forces can alternatively be overlaid on top of bond forces using
using the *overlay/pair* keyword. These settings require specific the *overlay/pair* keyword. These settings require specific
:doc:`special_bonds <special_bonds>` settings described in the restrictions. :doc:`special_bonds <special_bonds>` settings described in the
Further details can be found in the `:doc: how to <Howto_BPM>` page on BPMs. restrictions. Further details can be found in the `:doc: how to
<Howto_BPM>` page on BPMs.
This bond style tracks broken bonds and can record them using an instance of This bond style tracks broken bonds and can record them using an
:doc:`fix store/local <fix_store_local>` if the *store/local* keyword is instance of :doc:`fix store/local <fix_store_local>` if the
used followed by the ID of the fix and then a series of bond attributes. *store/local* keyword is used followed by the ID of the fix and then a
series of bond attributes.
Note that when bonds are dumped to a file via the :doc:`dump local <dump>` Note that when bonds are dumped to a file via the :doc:`dump local
command, bonds with type 0 (broken bonds) are not included. The <dump>` command, bonds with type 0 (broken bonds) are not included.
:doc:`delete_bonds <delete_bonds>` command can also be used to query the The :doc:`delete_bonds <delete_bonds>` command can also be used to
status of broken bonds or permanently delete them, e.g.: query the status of broken bonds or permanently delete them, e.g.:
.. code-block:: LAMMPS .. code-block:: LAMMPS
delete_bonds all stats delete_bonds all stats
delete_bonds all bond 0 remove delete_bonds all bond 0 remove
---------- ----------
Restart Restart
@ -122,17 +124,19 @@ Restrictions
"""""""""""" """"""""""""
This bond style can only be used if LAMMPS was built with the BPM This bond style can only be used if LAMMPS was built with the BPM
package. See the :doc:`Build package <Build_package>` doc page for more package. See the :doc:`Build package <Build_package>` doc page for
info. more info.
By default if pair interactions are censored, this bond style requires setting By default if pair interactions are to be disabled, this bond style
requires setting
.. code-block:: LAMMPS .. code-block:: LAMMPS
special_bonds lj 0 1 1 coul 1 1 1 special_bonds lj 0 1 1 coul 1 1 1
and :doc:`newton <newton>` must be set to bond off. and :doc:`newton <newton>` must be set to bond off. If the
If the *overlay/pair* option is used, this bond style alternatively requires setting *overlay/pair* option is used, this bond style alternatively requires
setting
.. code-block:: LAMMPS .. code-block:: LAMMPS
@ -149,6 +153,7 @@ Default
none none
----------
.. _Groot1: .. _Groot1:

View File

@ -23,11 +23,11 @@ Examples
Description Description
""""""""""" """""""""""
Define a computation that computes the number of bonds per-atom. Define a computation that computes the number of bonds each atom is
Bonds which are broken are not counted in the tally. part of. Bonds which are broken are not counted in the tally. See
See :doc:`bond_style quartic <bond_quartic>` or the the :doc:`Howto broken bonds <Howto_bpm>` page for more information.
:doc:`Howto bpm <Howto_bpm>` page. The number of bonds will be zero The number of bonds will be zero for atoms not in the specified
for atoms not in the specified compute group. compute group. This compute does not depend on Newton bond settings.
Output info Output info
""""""""""" """""""""""
@ -40,9 +40,8 @@ LAMMPS output options.
Restrictions Restrictions
"""""""""""" """"""""""""
This fix can only be used if LAMMPS was built with the BPM This fix can only be used if LAMMPS was built with the BPM package.
package. See the :doc:`Build package <Build_package>` doc page for more See the :doc:`Build package <Build_package>` doc page for more info.
info.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -285,7 +285,7 @@ accelerated styles exist.
* :doc:`nve/manifold/rattle <fix_nve_manifold_rattle>` - * :doc:`nve/manifold/rattle <fix_nve_manifold_rattle>` -
* :doc:`nve/noforce <fix_nve_noforce>` - NVE without forces (v only) * :doc:`nve/noforce <fix_nve_noforce>` - NVE without forces (v only)
* :doc:`nve/sphere <fix_nve_sphere>` - NVE for spherical particles * :doc:`nve/sphere <fix_nve_sphere>` - NVE for spherical particles
* :doc:`nve/sphere/bpm <fix_nve_sphere_bpm>` - NVE for spherical particles used in bonded particle models * :doc:`nve/sphere/bpm <fix_nve_sphere_bpm>` - NVE for spherical particles used in the BPM package
* :doc:`nve/spin <fix_nve_spin>` - NVE for a spin or spin-lattice system * :doc:`nve/spin <fix_nve_spin>` - NVE for a spin or spin-lattice system
* :doc:`nve/tri <fix_nve_tri>` - NVE for triangles * :doc:`nve/tri <fix_nve_tri>` - NVE for triangles
* :doc:`nvk <fix_nvk>` - constant kinetic energy time integration * :doc:`nvk <fix_nvk>` - constant kinetic energy time integration

View File

@ -30,15 +30,18 @@ Examples
Description Description
""""""""""" """""""""""
Perform constant NVE integration to update position, velocity, angular velocity, Perform constant NVE integration to update position, velocity, angular
and quaternion orientation for finite-size spherical particles in the group each velocity, and quaternion orientation for finite-size spherical
timestep. V is volume; E is energy. This creates a system trajectory particles in the group each timestep. V is volume; E is energy. This
consistent with the microcanonical ensemble. creates a system trajectory consistent with the microcanonical
ensemble.
This fix differs from the :doc:`fix nve <fix_nve>` command, which This fix differs from the :doc:`fix nve <fix_nve>` command, which
assumes point particles and only updates their position and velocity. assumes point particles and only updates their position and velocity.
It also differs from the :doc:`fix nve/sphere <fix_nve/sphere>` command, which It also differs from the :doc:`fix nve/sphere <fix_nve/sphere>`
does not evaluate a particles orientation or quaternion. command which assumes finite-size spheroid particles which do not
store a quaternion. It thus does not update a particle's orientation
or quaternion.
If the *disc* keyword is used, then each particle is treated as a 2d If the *disc* keyword is used, then each particle is treated as a 2d
disc (circle) instead of as a sphere. This is only possible for 2d disc (circle) instead of as a sphere. This is only possible for 2d
@ -51,21 +54,23 @@ moment of inertia, as used in the time integration.
Restart, fix_modify, output, run start/stop, minimize info Restart, fix_modify, output, run start/stop, minimize info
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options No information about this fix is written to :doc:`binary restart files
are relevant to this fix. No global or per-atom quantities are stored <restart>`. None of the :doc:`fix_modify <fix_modify>` options are
by this fix for access by various :doc:`output commands <Howto_output>`. relevant to this fix. No global or per-atom quantities are stored by
this fix for access by various :doc:`output commands <Howto_output>`.
No parameter of this fix can be used with the *start/stop* keywords of No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`. the :doc:`run <run>` command. This fix is not invoked during
:doc:`energy minimization <minimize>`.
Restrictions Restrictions
"""""""""""" """"""""""""
This fix requires that atoms store torque, angular velocity (omega), This fix requires that atoms store torque, angular velocity (omega), a
a radius, and a quaternion as defined by the :doc:`atom_style sphere/bpm <atom_style>` radius, and a quaternion as defined by the :doc:`atom_style sphere/bpm
command. <atom_style>` command.
All particles in the group must be finite-size spheres with quaternions. They cannot All particles in the group must be finite-size spheres with
be point particles. quaternions. They cannot be point particles.
Use of the *disc* keyword is only allowed for 2d simulations, as Use of the *disc* keyword is only allowed for 2d simulations, as
defined by the :doc:`dimension <dimension>` keyword. defined by the :doc:`dimension <dimension>` keyword.

View File

@ -20,49 +20,69 @@ Examples
.. code-block:: LAMMPS .. code-block:: LAMMPS
bond_style bpm/simple store/local 1 id1 id2
fix 1 all store/local 1000 2 fix 1 all store/local 1000 2
dump 1 all local 1000 dump.local f_1[1] f_1[2] dump 1 all local 1000 dump.local f_1[1] f_1[2]
dump_modify 1 write_header no
pair_style hybrid/overlay tracker 1 x y z lj/cut 2.5
fix 1 all store/local 1000 3
dump 1 all local 1000 dump.local f_1[1] f_1[2] f_1[3]
Description Description
""""""""""" """""""""""
This fix provides the ability to store local data produced by This fix provides the ability to store local data generated by another
some LAMMPS commands including some pair and bond styles so it can be output. LAMMPS command, including some pair and bond styles, so it can be
Data is accumulated over a span of *N* timesteps before being deleted. output. One examples, shown above, is the
The number of datums generated, aggregated across all processors, depends on :doc:`bpm/simple bondstyle <bond_bpm_simple>` which allows bonds to
the associated commands. Data is only included if it is generated from atoms break and passes information on the broken bonds to this fix. A
within the fix group-ID. :doc:`dump local <dump_local>` command can then output the list of
broken bonds
This fix continuously accumulates local data over intervals of *N*
timesteps. At the end of each interval, all of the saved accumulated
data is deleted to make room for new data. Individual datum may
therefore persist anywhere between *1* to *N* timesteps depending on
when they are saved. This data can be accessed by a
:doc:`dump local <dump_local>` command. To ensure all data is output,
the dump frequency should correspond to the same interval of *N*
timesteps. A dump frequency of an integer multiple of *N* can be used
to regularly output a sample of the accumulated data.
---------- ----------
Restart, fix_modify, run start/stop, minimize info Restart, fix_modify, run start/stop, minimize info
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Accumulated local data is written to :doc:`binary restart files <restart>`. Accumulated local data is written to :doc:`binary restart files
None of the :doc:`fix_modify <fix_modify>` options are <restart>`. None of the :doc:`fix_modify <fix_modify>` options are
relevant to this fix.
No parameter of this fix can be used with the *start/stop* keywords of relevant to this fix. No parameter of this fix can be used with the
the :doc:`run <run>` command. *start/stop* keywords of the :doc:`run <run>` command.
Output info Output info
""""""""""" """""""""""
This compute calculates a local vector or local array depending on the This compute calculates a local vector or local array depending on the
number of input values. The length of the vector or number of rows in number of input values. The length of the vector or number of rows in
the array is the number of recorded, lost interactions. If a single input is the array is the number of recorded, lost interactions. If a single
specified, a local vector is produced. If two or more inputs are input is specified, a local vector is produced. If two or more inputs
specified, a local array is produced where the number of columns = the are specified, a local array is produced where the number of columns =
number of inputs. The vector or array can be accessed by any command the number of inputs. The vector or array can be accessed by any
that uses local values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output command that uses local values from a compute as input. See the
options. :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
output options.
The vector or array values will be doubles that correspond to the The vector or array will be floating point values that correspond to
specified attribute. the specified attribute.
Restrictions Restrictions
"""""""""""" """"""""""""
Must be used in conjunction with another LAMMPS class which outputs local data. This fix must be used in conjunction with another LAMMPS command which
generates local data and passes it to this fix. See the related
commands below for examples of such commands.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -48,12 +48,22 @@ given by
w = 1.0 - \left( \frac{r}{r_c} \right)^8 . w = 1.0 - \left( \frac{r}{r_c} \right)^8 .
This pair style is designed for use in a spring-based bonded particle model. This pair style is designed for use in a spring-based bonded particle
It mirrors the construction of the :doc:`bpm/spring <bond_bpm_spring>` bond style. model. It mirrors the construction of the :doc:`bpm/spring
<bond_bpm_spring>` bond style.
This pair interaction is always applied to pairs of nonbonded particles
that are within the interaction distance. For pairs of bonded particles
that are within the interaction distance, there is the option to either
include this pair interaction and overlay the pair force over the bond
force or to exclude this pair interaction such that the two particles
only interact via the bond force. See discussion of the *overlay/pair*
option for BPM bond styles and the :doc:`special_bonds <special_bonds>`
command in the `:doc: how to <Howto_BPM>` page on BPMs for more details.
The following coefficients must be defined for each pair of atom types The following coefficients must be defined for each pair of atom types
via the :doc:`pair_coeff <pair_coeff>` command as in the examples above, via the :doc:`pair_coeff <pair_coeff>` command as in the examples
or in the data file or restart files read by the above, or in the data file or restart files read by the
:doc:`read_data <read_data>` or :doc:`read_restart <read_restart>` :doc:`read_data <read_data>` or :doc:`read_restart <read_restart>`
commands, or by mixing as described below: commands, or by mixing as described below:
@ -79,8 +89,9 @@ shift option, since the pair interaction goes to 0.0 at the cutoff.
The :doc:`pair_modify <pair_modify>` table and tail options are not The :doc:`pair_modify <pair_modify>` table and tail options are not
relevant for this pair style. relevant for this pair style.
This pair style writes its information to :doc:`binary restart files <restart>`, so pair_style and pair_coeff commands do not need This pair style writes its information to :doc:`binary restart files
to be specified in an input script that reads a restart file. <restart>`, so pair_style and pair_coeff commands do not need to be
specified in an input script that reads a restart file.
This pair style can only be used via the *pair* keyword of the This pair style can only be used via the *pair* keyword of the
:doc:`run_style respa <run_style>` command. It does not support the :doc:`run_style respa <run_style>` command. It does not support the

View File

@ -19,9 +19,9 @@ Syntax
*finite* value = none *finite* value = none
pair style uses atomic diameters to identify contacts pair style uses atomic diameters to identify contacts
*time/min* value = T *time/min* value = T
T = minimum interaction time T = minimum number of timesteps of interaction
*type/include* value = arg1 arg2 *type/include* value = list1 list2
arg = separate lists of types (see below) list1,list2 = separate lists of types (see below)
* one or more attributes may be appended * one or more attributes may be appended
@ -33,22 +33,22 @@ Syntax
.. parsed-literal:: .. parsed-literal::
id1, id2 = IDs of the 2 atoms in each pair interaction id1, id2 = IDs of the 2 atoms in each pair interaction
time/created = the time that the 2 atoms began interacting time/created = the timestep that the 2 atoms began interacting
time/broken = the time that the 2 atoms stopped interacting time/broken = the timestep that the 2 atoms stopped interacting
time/total = the total time the 2 atoms interacted time/total = the total number of timesteps the 2 atoms interacted
r/min = the minimum radial distance between the 2 atoms during the interaction r/min = the minimum radial distance between the 2 atoms during the interaction (distance units)
r/ave = the average radial distance between the 2 atoms during the interaction r/ave = the average radial distance between the 2 atoms during the interaction (distance units)
x, y, z = the center of mass position of the 2 atoms when they stopped interacting x, y, z = the center of mass position of the 2 atoms when they stopped interacting (distance units)
Examples Examples
"""""""" """"""""
.. code-block:: LAMMPS .. code-block:: LAMMPS
pair_style hybrid/overlay tracker myfix id1 id2 type/include 1 * type/include 2 3,4 pair_style hybrid/overlay tracker myfix id1 id2 type/include 1 * type/include 2 3,4 lj/cut 2.5
pair_coeff 1 1 tracker 2.0 pair_coeff 1 1 tracker 2.0
pair_style hybrid/overlay tracker myfix finite x y z time/min 100 pair_style hybrid/overlay tracker myfix finite x y z time/min 100 granular
pair_coeff * * tracker pair_coeff * * tracker
fix myfix all store/local 1000 3 fix myfix all store/local 1000 3
@ -58,59 +58,91 @@ Examples
Description Description
""""""""""" """""""""""
Style *tracker* monitors information about pairwise interactions. Style *tracker* monitors information about pairwise interactions. It
It does not calculate any forces on atoms. does not calculate any forces on atoms. :doc:`Pair hybrid/overlay
:doc:`Pair hybrid/overlay <pair_hybrid>` can be used to combine this pair <pair_hybrid>` can be used to combine this pair style with any other
style with another pair style. Style *tracker* must be used in conjunction pair style, as shown in the examples above. Style *tracker* must also
with :doc:`fix store/local <fix_store_local>` which contains be used in conjunction with the :doc:`fix store/local
information on outputting data. Whenever two neighboring atoms move beyond <fix_store_local>` command which stores the pairise information so it
the interaction cutoffPairwise data is processed and transferred to the associated can be accessed as local data by other LAMMPS commands, e.g. by the
instance of :doc:`fix store/local <fix_store_local>`. Additional filters can :doc:`dump local <dump>` command for output.
be applied using the *time/min* or *type/include* keywords described below.
If the *finite* keyword is not defined, the following coefficients must be At each timestep, if two neighboring atoms move beyond the interaction
defined for each pair of atom types via the :doc:`pair_coeff <pair_coeff>` cutoff, pairwise data is processed and transferred to the associated
command as in the examples above, or in the data file or restart files instance of :doc:`fix store/local <fix_store_local>`. Additional
read by the :doc:`read_data <read_data>` or :doc:`read_restart <read_restart>` filters can be applied using the *time/min* or *type/include* keywords
commands, or by mixing as described below: described below. Note that this is the interaction cutoff defined by
this pair style, not the short-range cutoff defined by the pair style
that is calculating forces on atoms.
Following any optional keyword/value arguments, a list of one or more
attributes is specified. These include the IDs of the two atoms in
the pair. The other attributes for the pair of atoms are for the
duration of time they were "interacting" or at the point in time they
started or stopped interacting. In this context, "interacting" means
the time window during which the two atoms were closer than the
interaction cutoff distance. The attributes for time/* refer to
timesteps.
----------
The following optional keywords may be used.
If the *finite* keyword is not used, the following coefficients must
be defined for each pair of atom types via the :doc:`pair_coeff
<pair_coeff>` command as in the examples above, or in the data file or
restart files read by the :doc:`read_data <read_data>` or
:doc:`read_restart <read_restart>` commands, or by mixing as described
below:
* cutoff (distance units) * cutoff (distance units)
If the *finite* keyword is defined, no coefficients may be defined. If the *finite* keyword is used, there are no additional coefficients
Interaction cutoffs are alternatively calculated based on the to set for each pair of atom types via the
diameter of finite particles. :doc:`pair_coeff <pair_coeff>` command. Interaction cutoffs are
instead calculated based on the diameter of finite particles. However
you must still use the :doc:`pair_coeff <pair_coeff>` for all atom
types. For example the command
.. note:: .. code-block:: LAMMPS
For extremely long-lived interactions, the calculation of *r/ave* may not be pair_coeff * *
correct due to double overflow.
The *time/min* keyword sets a minimum amount of time that an interaction must should be used.
persist to be included. This setting can be used to censor short-lived interactions.
The *type/include* keyword filters interactions based on the types of the two atoms. The *time/min* keyword sets a minimum amount of time that an
Data is only saved for interactions between atoms with types in the two lists. interaction must persist to be included. This setting can be used to
Each list consists of a series of type censor short-lived interactions.
ranges separated by commas. The range can be specified as a
single numeric value, or a wildcard asterisk can be used to specify a range The *type/include* keyword filters interactions based on the types of
of values. This takes the form "\*" or "\*n" or "n\*" or "m\*n". For the two atoms. Data is only saved for interactions between atoms
example, if M = the number of atom types, then an asterisk with no numeric whose two atom types appear in *list1* and *list2*. Atom type 1 must
values means all types from 1 to M. A leading asterisk means all types be in list1 and atom type 2 in list2. Or vice versa.
from 1 to n (inclusive). A trailing asterisk means all types from n to M
(inclusive). A middle asterisk means all types from m to n (inclusive). Each type list consists of a series of type ranges separated by
Multiple *type/include* keywords may be added. commas. Each range can be specified as a single numeric value, or a
wildcard asterisk can be used to specify a range of values. This
takes the form "\*" or "\*n" or "n\*" or "m\*n". For example, if M =
the number of atom types, then an asterisk with no numeric values
means all types from 1 to M. A leading asterisk means all types from
1 to n (inclusive). A trailing asterisk means all types from n to M
(inclusive). A middle asterisk means all types from m to n
(inclusive). Note that the *type/include* keyword can be specified
multiple times.
Mixing, shift, table, tail correction, restart, rRESPA info Mixing, shift, table, tail correction, restart, rRESPA info
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
For atom type pairs I,J and I != J, the cutoff coefficient and cutoff For atom type pairs I,J and I != J, the cutoff coefficient and cutoff
distance for this pair style can be mixed. The cutoff is always mixed via a distance for this pair style can be mixed. The cutoff is always mixed
*geometric* rule. The cutoff is mixed according to the pair_modify via a *geometric* rule. The cutoff is mixed according to the
mix value. The default mix value is *geometric*\ . See the pair_modify mix value. The default mix value is *geometric*\ . See
"pair_modify" command for details. the "pair_modify" command for details.
This pair style writes its information to :doc:`binary restart files <restart>`, so This pair style writes its information to :doc:`binary restart files
pair_style and pair_coeff commands do not need <restart>`, so pair_style and pair_coeff commands do not need to be
to be specified in an input script that reads a restart file. specified in an input script that reads a restart file.
The :doc:`pair_modify <pair_modify>` shift, table, and tail options The :doc:`pair_modify <pair_modify>` shift, table, and tail options
are not relevant for this pair style. are not relevant for this pair style.
@ -120,19 +152,20 @@ are not relevant for this pair style.
Restrictions Restrictions
"""""""""""" """"""""""""
A corresponding :doc:`fix pair_tracker <fix_pair_tracker>` must be defined
to use this pair style.
This pair style is currently incompatible with granular pair styles that extend
beyond the contact (e.g. JKR and DMT).
This fix is part of the MISC package. It is only enabled if LAMMPS This fix is part of the MISC package. It is only enabled if LAMMPS
was built with that package. See the :doc:`Build package <Build_package>` page for more info. was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
A corresponding :doc:`fix store_local <fix_store_local>` must be
defined to use this pair style.
This pair style is currently incompatible with granular pair styles
that extend beyond the contact (e.g. JKR and DMT).
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`fix pair_tracker <fix_pair_tracker>` :doc:`fix store_local <fix_store_local>`
Default Default
""""""" """""""

View File

@ -112,7 +112,7 @@ void BondBPM::init_style()
if (id_fix_dummy) { if (id_fix_dummy) {
id_fix_update = utils::strdup("BPM_update_special_bonds"); id_fix_update = utils::strdup("BPM_update_special_bonds");
fix_update_special_bonds = (FixUpdateSpecialBonds *) modify->replace_fix(id_fix_dummy, fix_update_special_bonds = (FixUpdateSpecialBonds *) modify->replace_fix(id_fix_dummy,
fmt::format("{} all update/special/bonds", id_fix_update),1); fmt::format("{} all UPDATE/SPECIAL/BONDS", id_fix_update),1);
delete [] id_fix_dummy; delete [] id_fix_dummy;
id_fix_dummy = nullptr; id_fix_dummy = nullptr;
} }

View File

@ -1,76 +1,76 @@
/* -*- c++ -*- ---------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under certain rights in this software. This software is distributed under
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef BOND_CLASS #ifdef BOND_CLASS
// clang-format off // clang-format off
BondStyle(bpm/rotational,BondBPMRotational) BondStyle(bpm/rotational,BondBPMRotational)
// clang-format on // clang-format on
#else #else
#ifndef LMP_BOND_BPM_ROTATIONAL_H #ifndef LMP_BOND_BPM_ROTATIONAL_H
#define LMP_BOND_BPM_ROTATIONAL_H #define LMP_BOND_BPM_ROTATIONAL_H
#include "bond_bpm.h" #include "bond_bpm.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class BondBPMRotational : public BondBPM { class BondBPMRotational : public BondBPM {
public: public:
BondBPMRotational(class LAMMPS *); BondBPMRotational(class LAMMPS *);
virtual ~BondBPMRotational(); virtual ~BondBPMRotational();
virtual void compute(int, int); virtual void compute(int, int);
void coeff(int, char **); void coeff(int, char **);
void init_style(); void init_style();
void write_restart(FILE *); void write_restart(FILE *);
void read_restart(FILE *); void read_restart(FILE *);
void write_data(FILE *); void write_data(FILE *);
double single(int, double, int, int, double &); double single(int, double, int, int, double &);
protected: protected:
double *Kr, *Ks, *Kt, *Kb, *gnorm, *gslide, *groll, *gtwist; double *Kr, *Ks, *Kt, *Kb, *gnorm, *gslide, *groll, *gtwist;
double *Fcr, *Fcs, *Tct, *Tcb; double *Fcr, *Fcs, *Tct, *Tcb;
double acos_limit(double); double acos_limit(double);
void allocate(); void allocate();
void store_data(); void store_data();
double store_bond(int, int, int); double store_bond(int, int, int);
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS
#endif #endif
#endif #endif
/* ERROR/WARNING messages: /* ERROR/WARNING messages:
E: Atom missing in BPM bond E: Atom missing in BPM bond
Bonded atom cannot be found Bonded atom cannot be found
E: Incorrect args for bond coefficients E: Incorrect args for bond coefficients
Self-explanatory. Check the input script or data file. Self-explanatory. Check the input script or data file.
E: Bond bpm/rotational requires atom style sphere/bpm E: Bond bpm/rotational requires atom style sphere/bpm
Self-explanatory. Self-explanatory.
E: Bond style bpm requires 1-3 and 1-4 special weights of 1.0 E: Bond style bpm requires 1-3 and 1-4 special weights of 1.0
Self-explanatory. Self-explanatory.
W: Bond style bpm/rotational not intended for 2d use, may be inefficient W: Bond style bpm/rotational not intended for 2d use, may be inefficient
This bond style will perform a lot of unnecessary calculations in 2d This bond style will perform a lot of unnecessary calculations in 2d
*/ */

View File

@ -134,7 +134,7 @@ void BondBPMSpring::compute(int eflag, int vflag)
store_data(); store_data();
} }
int i1,i2,m,n,type,itype,jtype; int i1,i2,itmp,m,n,type,itype,jtype;
double delx, dely, delz, delvx, delvy, delvz; double delx, dely, delz, delvx, delvy, delvz;
double e, rsq, r, r0, rinv, smooth, fbond, ebond, dot; double e, rsq, r, r0, rinv, smooth, fbond, ebond, dot;
@ -143,6 +143,7 @@ void BondBPMSpring::compute(int eflag, int vflag)
double **x = atom->x; double **x = atom->x;
double **v = atom->v; double **v = atom->v;
double **f = atom->f; double **f = atom->f;
tagint *tag = atom->tag;
int **bondlist = neighbor->bondlist; int **bondlist = neighbor->bondlist;
int nbondlist = neighbor->nbondlist; int nbondlist = neighbor->nbondlist;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
@ -160,6 +161,15 @@ void BondBPMSpring::compute(int eflag, int vflag)
type = bondlist[n][2]; type = bondlist[n][2];
r0 = bondstore[n][0]; r0 = bondstore[n][0];
// Ensure pair is always ordered to ensure numerical operations
// are identical to minimize the possibility that a bond straddling
// an mpi grid (newton off) doesn't break on one proc but not the other
if (tag[i2] < tag[i1]) {
itmp = i1;
i1 = i2;
i2 = itmp;
}
// If bond hasn't been set - should be initialized to zero // If bond hasn't been set - should be initialized to zero
if (r0 < EPSILON || std::isnan(r0)) if (r0 < EPSILON || std::isnan(r0))
r0 = store_bond(n,i1,i2); r0 = store_bond(n,i1,i2);

View File

@ -1,74 +1,74 @@
/* -*- c++ -*- ---------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under certain rights in this software. This software is distributed under
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef BOND_CLASS #ifdef BOND_CLASS
// clang-format off // clang-format off
BondStyle(bpm/spring,BondBPMSpring) BondStyle(bpm/spring,BondBPMSpring)
// clang-format on // clang-format on
#else #else
#ifndef LMP_BOND_BPM_SPRING_H #ifndef LMP_BOND_BPM_SPRING_H
#define LMP_BOND_BPM_SPRING_H #define LMP_BOND_BPM_SPRING_H
#include "bond_bpm.h" #include "bond_bpm.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class BondBPMSpring : public BondBPM { class BondBPMSpring : public BondBPM {
public: public:
BondBPMSpring(class LAMMPS *); BondBPMSpring(class LAMMPS *);
virtual ~BondBPMSpring(); virtual ~BondBPMSpring();
virtual void compute(int, int); virtual void compute(int, int);
void coeff(int, char **); void coeff(int, char **);
void init_style(); void init_style();
void write_restart(FILE *); void write_restart(FILE *);
void read_restart(FILE *); void read_restart(FILE *);
void write_data(FILE *); void write_data(FILE *);
double single(int, double, int, int, double &); double single(int, double, int, int, double &);
protected: protected:
double *k, *ecrit, *gamma; double *k, *ecrit, *gamma;
void allocate(); void allocate();
void store_data(); void store_data();
double store_bond(int, int, int); double store_bond(int, int, int);
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS
#endif #endif
#endif #endif
/* ERROR/WARNING messages: /* ERROR/WARNING messages:
E: Atom missing in BPM bond E: Atom missing in BPM bond
Bonded atom cannot be found Bonded atom cannot be found
E: Incorrect args for bond coefficients E: Incorrect args for bond coefficients
Self-explanatory. Check the input script or data file. Self-explanatory. Check the input script or data file.
E: Bond bpm/rotational requires atom style sphere/bpm E: Bond bpm/rotational requires atom style sphere/bpm
Self-explanatory. Self-explanatory.
E: Bond style bpm requires 1-3 and 1-4 special weights of 1.0 E: Bond style bpm requires 1-3 and 1-4 special weights of 1.0
Self-explanatory. Self-explanatory.
W: Bond style bpm/rotational not intended for 2d use, may be inefficient W: Bond style bpm/rotational not intended for 2d use, may be inefficient
This bond style will perform a lot of unnecessary calculations in 2d This bond style will perform a lot of unnecessary calculations in 2d
*/ */

View File

@ -44,7 +44,7 @@ PairTracker::PairTracker(LAMMPS *lmp) :
neighprev = 0; neighprev = 0;
history = 1; history = 1;
size_history = 4; size_history = 3;
nondefault_history_transfer = 1; nondefault_history_transfer = 1;
finitecutflag = 0; finitecutflag = 0;
@ -96,7 +96,7 @@ PairTracker::~PairTracker()
void PairTracker::compute(int eflag, int vflag) void PairTracker::compute(int eflag, int vflag)
{ {
int i, j, ii, jj, inum, jnum, itype, jtype; int i, j, ii, jj, inum, jnum, itype, jtype;
double xtmp, ytmp, ztmp, delx, dely, delz, time; double xtmp, ytmp, ztmp, delx, dely, delz;
double radi, radj, radsum, rsq, r; double radi, radj, radsum, rsq, r;
int *ilist, *jlist, *numneigh, **firstneigh; int *ilist, *jlist, *numneigh, **firstneigh;
int *touch, **firsttouch; int *touch, **firsttouch;
@ -152,23 +152,20 @@ void PairTracker::compute(int eflag, int vflag)
} }
touch[jj] = 0; touch[jj] = 0;
data[0] = 0.0; // initial time data[0] = 0.0; // initial timestep
data[1] = 0.0; // initial timestep data[1] = 0.0; // sum of r, may be inaccurate over long times
data[2] = 0.0; // sum of r, may overflow data[2] = 0.0; // min of r
data[3] = 0.0; // min of r
} else { } else {
data = &alldata[size_history * jj]; data = &alldata[size_history * jj];
if (touch[jj] == 0) { if (touch[jj] == 0) {
time = update->atime + (update->ntimestep - update->atimestep) * update->dt; data[0] = (double) update->ntimestep;
data[0] = time; data[1] = r;
data[1] = (double) update->ntimestep;
data[2] = r; data[2] = r;
data[3] = r;
} else if (updateflag) { } else if (updateflag) {
data[2] += r; data[1] += r;
if (data[3] > r) data[3] = r; if (data[2] > r) data[2] = r;
} }
touch[jj] = 1; touch[jj] = 1;
} }
@ -182,23 +179,20 @@ void PairTracker::compute(int eflag, int vflag)
} }
touch[jj] = 0; touch[jj] = 0;
data[0] = 0.0; // initial time data[0] = 0.0; // initial timestep
data[1] = 0.0; // initial timestep data[1] = 0.0; // sum of r, may be inaccurate over long times
data[2] = 0.0; // sum of r, may overflow data[2] = 0.0; // min of r
data[3] = 0.0; // min of r
} else { } else {
data = &alldata[size_history * jj]; data = &alldata[size_history * jj];
if (touch[jj] == 0) { if (touch[jj] == 0) {
time = update->atime + (update->ntimestep - update->atimestep) * update->dt; data[0] = (double) update->ntimestep;
data[0] = time; data[1] = r;
data[1] = (double) update->ntimestep;
data[2] = r; data[2] = r;
data[3] = r;
} else if (updateflag) { } else if (updateflag) {
data[2] += r; data[1] += r;
if (data[3] > r) data[3] = r; if (data[2] > r) data[2] = r;
} }
touch[jj] = 1; touch[jj] = 1;
} }
@ -570,9 +564,7 @@ double PairTracker::radii2cut(double r1, double r2)
void PairTracker::process_data(int i, int j, double * input_data) void PairTracker::process_data(int i, int j, double * input_data)
{ {
double time = update->atime + (update->ntimestep - update->atimestep) * update->dt; if ((update->ntimestep - input_data[0]) < tmin) return;
int time_initial = (int) input_data[0];
if ((time - time_initial) < tmin) return;
if (type_filter) { if (type_filter) {
int *type = atom->type; int *type = atom->type;
@ -590,25 +582,21 @@ void PairTracker::process_data(int i, int j, double * input_data)
void PairTracker::pack_time_created(int n, int i, int j, double * data) void PairTracker::pack_time_created(int n, int i, int j, double * data)
{ {
double time_initial = data[0]; output_data[n] = data[0];
output_data[n] = time_initial;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairTracker::pack_time_broken(int n, int i, int j, double * data) void PairTracker::pack_time_broken(int n, int i, int j, double * data)
{ {
double time = update->atime + (update->ntimestep - update->atimestep) * update->dt; output_data[n] = update->ntimestep;
output_data[n] = time;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairTracker::pack_time_total(int n, int i, int j, double * data) void PairTracker::pack_time_total(int n, int i, int j, double * data)
{ {
double time = update->atime + (update->ntimestep - update->atimestep) * update->dt; output_data[n] = update->ntimestep - data[0];
double time_initial = data[0];
output_data[n] = time - time_initial;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -655,15 +643,12 @@ void PairTracker::pack_z(int n, int i, int j, double * data)
void PairTracker::pack_rmin(int n, int i, int j, double * data) void PairTracker::pack_rmin(int n, int i, int j, double * data)
{ {
double rmin = data[3]; output_data[n] = data[2];
output_data[n] = rmin;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void PairTracker::pack_rave(int n, int i, int j, double * data) void PairTracker::pack_rave(int n, int i, int j, double * data)
{ {
double rsum = data[2]; output_data[n] = data[1] / (update->ntimestep - data[0]);
double nstep_initial = data[1];
output_data[n] = rsum / (update->ntimestep - nstep_initial);
} }

View File

@ -40,6 +40,7 @@ class PairTracker : public Pair {
virtual double single(int, int, int, int, double, double, double, double &); virtual double single(int, int, int, int, double, double, double, double &);
double atom2cut(int); double atom2cut(int);
double radii2cut(double, double); double radii2cut(double, double);
void transfer_history(double *, double *);
protected: protected:
int sizeflag; int sizeflag;
@ -75,8 +76,6 @@ class PairTracker : public Pair {
void pack_rmin(int, int, int, double *); void pack_rmin(int, int, int, double *);
void pack_rave(int, int, int, double *); void pack_rave(int, int, int, double *);
void transfer_data(int, int);
void transfer_history(double *, double *);
void process_data(int, int, double *); void process_data(int, int, double *);
void allocate(); void allocate();
}; };

View File

@ -1,201 +1,126 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under certain rights in this software. This software is distributed under
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include "fix_store_local.h" #include "fix_store_local.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
#include "error.h" #include "error.h"
#include "memory.h" #include "memory.h"
#include "update.h" #include "update.h"
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
using namespace FixConst; using namespace FixConst;
#define DELTA 1000 #define DELTA 1000
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
FixStoreLocal::FixStoreLocal(LAMMPS *lmp, int narg, char **arg) : FixStoreLocal::FixStoreLocal(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg), nvalues(0), vector(nullptr), array(nullptr) Fix(lmp, narg, arg), nvalues(0), vector(nullptr), array(nullptr)
{ {
if (narg != 5) error->all(FLERR, "Illegal fix store/local command"); if (narg != 5) error->all(FLERR, "Illegal fix store/local command");
local_flag = 1; local_flag = 1;
nevery = utils::inumeric(FLERR, arg[3], false, lmp); nevery = utils::inumeric(FLERR, arg[3], false, lmp);
if (nevery <= 0) error->all(FLERR, "Illegal fix store/local command"); if (nevery <= 0) error->all(FLERR, "Illegal fix store/local command");
local_freq = nevery; local_freq = nevery;
nvalues = utils::inumeric(FLERR, arg[4], false, lmp); nvalues = utils::inumeric(FLERR, arg[4], false, lmp);
if (nvalues <= 0) error->all(FLERR, "Illegal fix store/local command"); if (nvalues <= 0) error->all(FLERR, "Illegal fix store/local command");
if (nvalues == 1) if (nvalues == 1)
size_local_cols = 0; size_local_cols = 0;
else else
size_local_cols = nvalues; size_local_cols = nvalues;
size_local_rows = 0; size_local_rows = 0;
vector = nullptr; vector = nullptr;
array = nullptr; array = nullptr;
nmax = 0; nmax = 0;
ncount = 0; ncount = 0;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
FixStoreLocal::~FixStoreLocal() FixStoreLocal::~FixStoreLocal()
{ {
memory->destroy(vector); memory->destroy(vector);
memory->destroy(array); memory->destroy(array);
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
int FixStoreLocal::setmask() int FixStoreLocal::setmask()
{ {
int mask = 0; int mask = 0;
mask |= POST_FORCE; mask |= POST_FORCE;
return mask; return mask;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixStoreLocal::add_data(double *input_data, int i, int j) void FixStoreLocal::add_data(double *input_data, int i, int j)
{ {
int *mask = atom->mask; int *mask = atom->mask;
if (!(mask[i] & groupbit)) return; if (!(mask[i] & groupbit)) return;
if (!(mask[j] & groupbit)) return; if (!(mask[j] & groupbit)) return;
if (ncount >= nmax) reallocate(ncount); if (ncount >= nmax) reallocate(ncount);
// fill vector or array with local values // fill vector or array with local values
if (nvalues == 1) { if (nvalues == 1) {
vector[ncount] = input_data[0]; vector[ncount] = input_data[0];
} else { } else {
for (int i = 0; i < nvalues; i++) array[ncount][i] = input_data[i]; for (int i = 0; i < nvalues; i++) array[ncount][i] = input_data[i];
} }
ncount += 1; ncount += 1;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixStoreLocal::post_force(int /*vflag*/) void FixStoreLocal::post_force(int /*vflag*/)
{ {
if (update->ntimestep % nevery == 0) { if (update->ntimestep % nevery == 0) {
size_local_rows = ncount; size_local_rows = ncount;
ncount = 0; ncount = 0;
} }
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixStoreLocal::reallocate(int n) void FixStoreLocal::reallocate(int n)
{ {
// grow vector or array // grow vector or array
while (nmax <= n) nmax += DELTA; while (nmax <= n) nmax += DELTA;
if (nvalues == 1) { if (nvalues == 1) {
memory->grow(vector, nmax, "fix_store_local:vector"); memory->grow(vector, nmax, "fix_store_local:vector");
vector_local = vector; vector_local = vector;
} else { } else {
memory->grow(array, nmax, nvalues, "fix_store_local:array"); memory->grow(array, nmax, nvalues, "fix_store_local:array");
array_local = array; array_local = array;
} }
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
write global array to restart file memory usage of local data
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void FixStoreLocal::write_restart(FILE *fp) double FixStoreLocal::memory_usage()
{ {
// fill rbuf with size and vec/array values double bytes = (double) nmax * (double) nvalues * sizeof(double);
return bytes;
rbuf[0] = nmax; }
rbuf[1] = nvalues;
if (nvalues == 1) memcpy(&rbuf[2], vector, sizeof(double) * nmax);
else memcpy(&rbuf[2], &array[0][0], sizeof(double) * nmax * nvalues);
int n = nmax * nvalues + 2;
if (comm->me == 0) {
int size = n * sizeof(double);
fwrite(&size, sizeof(int), 1, fp);
fwrite(rbuf, sizeof(double), n, fp);
}
}
/* ----------------------------------------------------------------------
use global array from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixStoreLocal::restart(char *buf)
{
// first 2 values in buf are vec/array sizes
double *dbuf = (double *) buf;
int nrow_restart = dbuf[0];
int ncol_restart = dbuf[1];
// if size of vec/array has changed,
// means the restart file is setting size of vec or array and doing init
// because caller did not know size at time this fix was instantiated
// reallocate vector or array accordingly
if (nmax != nrow_restart || nvalues != ncol_restart) {
memory->destroy(vector);
memory->destroy(array);
memory->destroy(rbuf);
vector = nullptr;
array = nullptr;
nmax = nrow_restart;
nvalues = ncol_restart;
if (nvalues == 1) memory->create(vector, nmax, "fix/store/local:vector");
else memory->create(array, nmax, nvalues, "fix/store/local:array");
memory->create(rbuf, nmax * nvalues + 2, "fix/store:rbuf");
}
int n = nmax*nvalues;
if (nvalues == 1) memcpy(vector, &dbuf[2], n * sizeof(double));
else memcpy(&array[0][0], &dbuf[2], n * sizeof(double));
}
/* ----------------------------------------------------------------------
maxsize of any atom's restart data
------------------------------------------------------------------------- */
int FixStoreLocal::maxsize_restart()
{
return nvalues + 1;
}
/* ----------------------------------------------------------------------
size of atom nlocal's restart data
------------------------------------------------------------------------- */
int FixStoreLocal::size_restart(int /*nlocal*/)
{
return nvalues + 1;
}
/* ----------------------------------------------------------------------
memory usage of local data
------------------------------------------------------------------------- */
double FixStoreLocal::memory_usage()
{
double bytes = (double) nmax * (double) nvalues * sizeof(double);
return bytes;
}

View File

@ -1,75 +1,70 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under certain rights in this software. This software is distributed under
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef FIX_CLASS #ifdef FIX_CLASS
// clang-format off // clang-format off
FixStyle(store/local,FixStoreLocal); FixStyle(store/local,FixStoreLocal);
// clang-format on // clang-format on
#else #else
#ifndef LMP_FIX_STORE_LOCAL_H #ifndef LMP_FIX_STORE_LOCAL_H
#define LMP_FIX_STORE_LOCAL_H #define LMP_FIX_STORE_LOCAL_H
#include "fix.h" #include "fix.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
class FixStoreLocal : public Fix { class FixStoreLocal : public Fix {
public: public:
FixStoreLocal(class LAMMPS *, int, char **); FixStoreLocal(class LAMMPS *, int, char **);
~FixStoreLocal(); ~FixStoreLocal();
int setmask(); int setmask();
void post_force(int); void post_force(int);
void write_restart(FILE *); double memory_usage();
void restart(char *); void add_data(double *, int, int);
int size_restart(int); int nvalues;
int maxsize_restart();
double memory_usage(); private:
void add_data(double *, int, int); int nmax;
int nvalues;
double *vector;
private: double **array;
int nmax;
int ncount;
double *vector;
double **array; void reallocate(int);
};
int ncount;
} // namespace LAMMPS_NS
void reallocate(int);
double *rbuf; // restart buffer for GLOBAL vec/array #endif
}; #endif
} // namespace LAMMPS_NS /* ERROR/WARNING messages:
#endif E: Illegal ... command
#endif
Self-explanatory. Check the input script syntax and compare to the
/* ERROR/WARNING messages: documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Illegal ... command
E: Invalid keyword in fix store/local command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a Self-explanatory.
command-line option when running LAMMPS to see the offending line.
E: Unused instance of fix store/local
E: Invalid keyword in fix store/local command
Instance of fix store/local is not associated with any other LAMMPS
Self-explanatory. class such as a bond style, pair style, etc.
E: Unused instance of fix store/local */
Instance of fix store/local is not associated with any other LAMMPS
class such as a bond style, pair style, etc.
*/

View File

@ -121,7 +121,6 @@ void NPairHalfSizeBinNewtoff::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -124,7 +124,6 @@ void NPairHalfSizeBinNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }
@ -160,7 +159,6 @@ void NPairHalfSizeBinNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -130,7 +130,6 @@ void NPairHalfSizeBinNewtonTri::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -142,7 +142,6 @@ void NPairHalfSizeMultiNewtoff::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -151,7 +151,6 @@ void NPairHalfSizeMultiNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }
@ -196,7 +195,6 @@ void NPairHalfSizeMultiNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -154,7 +154,6 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -132,7 +132,6 @@ void NPairHalfSizeMultiOldNewtoff::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -128,7 +128,6 @@ void NPairHalfSizeMultiOldNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }
@ -171,7 +170,6 @@ void NPairHalfSizeMultiOldNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }

View File

@ -139,7 +139,6 @@ void NPairHalfSizeMultiOldNewtonTri::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -120,7 +120,6 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }

View File

@ -138,7 +138,6 @@ void NPairHalfSizeNsqNewton::build(NeighList *list)
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh; neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh; } else neighptr[n++] = jh;
} }
} }