Skip to content

Commit

Permalink
Merge pull request #3087 from akohlmey/pair-harmonic
Browse files Browse the repository at this point in the history
Add new pair styles harmonic/cut for repulsive-only harmonic interaction
  • Loading branch information
akohlmey committed Jan 17, 2022
2 parents 5530927 + 1e7969c commit e1d028e
Show file tree
Hide file tree
Showing 9 changed files with 774 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/src/Commands_pair.rst
Expand Up @@ -119,6 +119,7 @@ OPT.
* :doc:`granular <pair_granular>`
* :doc:`gw <pair_gw>`
* :doc:`gw/zbl <pair_gw>`
* :doc:`harmonic/cut (o) <pair_harmonic_cut>`
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
* :doc:`hdnnp <pair_hdnnp>`
Expand Down
90 changes: 90 additions & 0 deletions doc/src/pair_harmonic_cut.rst
@@ -0,0 +1,90 @@
.. index:: pair_style harmonic/cut
.. index:: pair_style harmonic/cut/omp

pair_style harmonic/cut command
===============================

Accelerator Variants: *harmonic/cut/omp*

Syntax
""""""

.. code-block:: LAMMPS
pair_style style
* style = *harmonic/cut*

Examples
""""""""

.. code-block:: LAMMPS
pair_style harmonic/cut 2.5
pair_coeff * * 0.2 2.0
pair_coeff 1 1 0.5 2.5
Description
"""""""""""

Style *harmonic/cut* computes pairwise repulsive-only harmonic interactions with the formula

.. math::
E = k (r_c - r)^2 \qquad r < r_c
:math:`r_c` is the cutoff.

The following coefficients must be defined for each pair of atoms
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:

* :math:`k` (energy units)
* :math:`r_c` (distance units)

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

For atom type pairs I,J and I != J, the :math:`k` and :math:`r_c`
coefficients can be mixed. The default mix value is *geometric*.
See the "pair_modify" command for details.

Since the potential is zero at and beyond the cutoff parameter by
construction, there is no need to support support the :doc:`pair_modify
<pair_modify>` shift or tail options for the energy and pressure of the
pair interaction.

These pair styles write their information to :doc:`binary restart files <restart>`,
so pair_style and pair_coeff commands do not need to be specified in an input script
that reads a restart file.

These pair styles can only be used via the *pair* keyword of the
:doc:`run_style respa <run_style>` command. They do not support the
*inner*, *middle*, *outer* keywords.

----------

Restrictions
""""""""""""

The *harmonic/cut* pair style is only enabled if LAMMPS was
built with the EXTRA-PAIR package.
See the :doc:`Build package <Build_package>` page for more info.

Related commands
""""""""""""""""

:doc:`pair_coeff <pair_coeff>`

Default
"""""""

none
1 change: 1 addition & 0 deletions doc/src/pair_style.rst
Expand Up @@ -183,6 +183,7 @@ accelerated styles exist.
* :doc:`gran/hooke/history <pair_gran>` - granular potential without history effects
* :doc:`gw <pair_gw>` - Gao-Weber potential
* :doc:`gw/zbl <pair_gw>` - Gao-Weber potential with a repulsive ZBL core
* :doc:`harmonic/cut <pair_harmonic_cut>` - repulsive-only harmonic potential
* :doc:`hbond/dreiding/lj <pair_hbond_dreiding>` - DREIDING hydrogen bonding LJ potential
* :doc:`hbond/dreiding/morse <pair_hbond_dreiding>` - DREIDING hydrogen bonding Morse potential
* :doc:`hdnnp <pair_hdnnp>` - High-dimensional neural network potential
Expand Down
2 changes: 2 additions & 0 deletions src/.gitignore
Expand Up @@ -1489,6 +1489,8 @@
/pair_dpd_fdt.h
/pair_dpd_fdt_energy.cpp
/pair_dpd_fdt_energy.h
/pair_harmonic_cut.cpp
/pair_harmonic_cut.h
/pair_lennard_mdf.cpp
/pair_lennard_mdf.h
/pair_lj_cut_coul_long_cs.cpp
Expand Down

0 comments on commit e1d028e

Please sign in to comment.