Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pair_style cosine/squared #1626

Merged
merged 14 commits into from Aug 20, 2019
1 change: 1 addition & 0 deletions doc/src/Commands_pair.txt
Expand Up @@ -65,6 +65,7 @@ OPT.
"colloid (go)"_pair_colloid.html,
"comb (o)"_pair_comb.html,
"comb3"_pair_comb.html,
"cosine/squared"_pair_cosine_squared.html,
"coul/cut (gko)"_pair_coul.html,
"coul/cut/soft (o)"_pair_fep_soft.html,
"coul/debye (gko)"_pair_coul.html,
Expand Down
Binary file added doc/src/Eqs/pair_cosine_squared.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions doc/src/Eqs/pair_cosine_squared.tex
@@ -0,0 +1,16 @@
\documentclass[12pt]{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
E =
\begin{cases}
-\epsilon& \quad r < \sigma \\
-\epsilon\cos\left(\frac{\pi\left(r - \sigma\right)}{2\left(r_c - \sigma\right)}\right)&\quad \sigma \leq r < r_c \\
0& \quad r \geq r_c
\end{cases}
\end{align*}

\end{document}
Binary file added doc/src/Eqs/pair_cosine_squared_wca.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions doc/src/Eqs/pair_cosine_squared_wca.tex
@@ -0,0 +1,11 @@
\documentstyle[12pt]{article}

\begin{document}

$$
E = \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} -
2\left(\frac{\sigma}{r}\right)^6 + 1\right]
, \quad r < \sigma
$$

\end{document}
Binary file added doc/src/JPG/pair_cosine_squared_graphs.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/src/fix.txt
Expand Up @@ -244,7 +244,7 @@ accelerated styles exist.
"mscg"_fix_mscg.html - apply MSCG method for force-matching to generate coarse grain models
"msst"_fix_msst.html - multi-scale shock technique (MSST) integration
"mvv/dpd"_fix_mvv_dpd.html - DPD using the modified velocity-Verlet integration algorithm
"mvv/edpd"_fix_mvv_dpd.html - constant energy DPD using the modified velocity-Verlet algrithm
"mvv/edpd"_fix_mvv_dpd.html - constant energy DPD using the modified velocity-Verlet algorithm
"mvv/tdpd"_fix_mvv_dpd.html - constant temperature DPD using the modified velocity-Verlet algorithm
"neb"_fix_neb.html - nudged elastic band (NEB) spring forces
"nph"_fix_nh.html - constant NPH time integration via Nose/Hoover
Expand Down
1 change: 1 addition & 0 deletions doc/src/lammps.book
Expand Up @@ -569,6 +569,7 @@ pair_charmm.html
pair_class2.html
pair_colloid.html
pair_comb.html
pair_cosine_squared.html
pair_coul.html
pair_coul_diel.html
pair_coul_shield.html
Expand Down
108 changes: 108 additions & 0 deletions doc/src/pair_cosine_squared.txt
@@ -0,0 +1,108 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands_all.html)

:line

pair_style cosine/squared command :h3

[Syntax:]

pair_style cosine/squared cutoff :pre

cutoff = global cutoff for cosine-squared interactions (distance units) :ul

pair_coeff i j eps sigma
pair_coeff i j eps sigma cutoff
pair_coeff i j eps sigma wca
pair_coeff i j eps sigma cutoff wca :pre

i,j = a particle type
eps = interaction strength, i.e. the depth of the potential minimum (energy units)
sigma = distance of the potential minimum from 0
cutoff = the cutoff distance for this pair type, if different from global (distance units)
wca = if specified a Weeks-Chandler-Andersen potential (with eps strength and minimum at sigma) is added, otherwise not :ul

[Examples:]

pair_style cosine/squared 3.0
pair_coeff * * 1.0 1.3
pair_coeff 1 3 1.0 1.3 2.0
pair_coeff 1 3 1.0 1.3 wca
pair_coeff 1 3 1.0 1.3 2.0 wca :pre

[Description:]

Style {cosine/squared} computes a potential of the form

:c,image(Eqs/pair_cosine_squared.jpg)

between two point particles, where (sigma, -epsilon) is the location of
the (rightmost) minimum of the potential, as explained in the syntax
section above.

This potential was first used in (Cooke)_#CKD for a coarse-grained lipid
membrane model. It is generally very useful as a non-specific
interaction potential because it is fully adjustable in depth and width
while joining the minimum at (sigma, -epsilon) and zero at (cutoff, 0)
smoothly, requiring no shifting and causing no related artifacts, tail
energy calculations etc. This evidently requires {cutoff} to be larger
than {sigma}.

If the {wca} option is used then a Weeks-Chandler-Andersen potential
(Weeks)_#WCA is added to the above specified cosine-squared potential,
specifically the following:

:c,image(Eqs/pair_cosine_squared_wca.jpg)

In this case, and this case only, the {sigma} parameter can be equal to
{cutoff} (sigma = cutoff) which will result in ONLY the WCA potential
being used (and print a warning), so the minimum will be attained at
(sigma, 0). This is a convenience feature that enables a purely
repulsive potential to be used without a need to define an additional
pair style and use the hybrid styles.

The energy and force of this pair style for parameters epsilon = 1.0,
sigma = 1.0, cutoff = 2.5, with and without the WCA potential, are shown
in the graphs below:

:c,image(JPG/pair_cosine_squared_graphs.jpg)

:line

[Mixing, shift, table, tail correction, restart, rRESPA info]:

Mixing is not supported for this style.

The {shift}, {table} and {tail} options are not relevant for this style.

This pair style writes its information to "binary restart
files"_restart.html, 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
"run_style respa"_run_style.html command. They do not support the
{inner}, {middle}, {outer} keywords.

:line

[Restrictions:]

The {cosine/squared} style is part of the "USER-MISC" package. It is only
enabled if LAMMPS is build with that package. See the "Build
package"_Build_package.html doc page for more info.

[Related commands:]

"pair_coeff"_pair_coeff.html,
"pair_style lj/cut"_pair_lj.html

[Default:] none

:link(CKD)
[(Cooke)] "Cooke, Kremer and Deserno, Phys. Rev. E, 72, 011506 (2005)"

:link(WCA)
[(Weeks)] "Weeks, Chandler and Andersen, J. Chem. Phys., 54, 5237 (1971)"
1 change: 1 addition & 0 deletions doc/src/pair_style.txt
Expand Up @@ -129,6 +129,7 @@ accelerated styles exist.
"colloid"_pair_colloid.html - integrated colloidal potential
"comb"_pair_comb.html - charge-optimized many-body (COMB) potential
"comb3"_pair_comb.html - charge-optimized many-body (COMB3) potential
"cosine/squared"_pair_cosine_squared.html - Cooke-Kremer-Deserno membrane model potential
"coul/cut"_pair_coul.html - cutoff Coulombic potential
"coul/cut/soft"_pair_fep_soft.html - Coulombic potential with a soft core
"coul/debye"_pair_coul.html - cutoff Coulombic potential with Debye screening
Expand Down
1 change: 1 addition & 0 deletions doc/src/pairs.txt
Expand Up @@ -24,6 +24,7 @@ Pair Styles :h1
pair_class2
pair_colloid
pair_comb
pair_cosine_squared
pair_coul
pair_coul_diel
pair_coul_shield
Expand Down
3 changes: 3 additions & 0 deletions doc/utils/sphinx-config/false_positives.txt
Expand Up @@ -356,6 +356,7 @@ Cii
Cij
cis
civ
CKD
Clang
clearstore
Cleary
Expand Down Expand Up @@ -421,6 +422,7 @@ coreshell
cornflowerblue
cornsilk
corotate
corotation
corotational
correlator
cosineshifted
Expand Down Expand Up @@ -2991,6 +2993,7 @@ Waltham
wavepacket
wB
Wbody
wca
webpage
Weckner
WeinanE
Expand Down
2 changes: 2 additions & 0 deletions src/.gitignore
Expand Up @@ -801,6 +801,8 @@
/pair_comb3.h
/pair_colloid.cpp
/pair_colloid.h
/pair_cosine_squared.cpp
/pair_cosine_squared.h
/pair_coul_diel.cpp
/pair_coul_diel.h
/pair_coul_long.cpp
Expand Down
1 change: 1 addition & 0 deletions src/USER-MISC/README
Expand Up @@ -69,6 +69,7 @@ improper_style ring, Georgios Vogiatzis, gvog at chemeng.ntua.gr, 25 May 12
improper_style distance, Paolo Raiteri, p.raiteri at curtin.edu.au, 2 Dec 15
pair_style agni, Axel Kohlmeyer, akohlmey at gmail.com, 9 Nov 16
pair_style buck/mdf, Paolo Raiteri, p.raiteri at curtin.edu.au, 2 Dec 15
pair_style cosine/squared, Eugen Rozic, eugen.rozic.17 at ucl.ac.uk, 9 Aug 19
pair_style coul/diel, Axel Kohlmeyer, akohlmey at gmail.com, 1 Dec 11
pair_style coul/shield, Wengen Ouyang (Tel Aviv University), w.g.ouyang at gmail dot com, 30 Mar 18
pair_style dipole/sf, Mario Orsi, orsimario at gmail.com, 8 Aug 11
Expand Down