Commit 7e42af18 authored by Markus Hoehnerbach's avatar Markus Hoehnerbach
Browse files

Feature: AIREBO parametrize cutoff switching

In #514 it has been raised that the switching function that
ensures a smooth transition to the cutoff is only correct if
cutlj = 3.0. This patch gives users an opportunity to configure
the switching function together with the cutoff by specifying
the start of the transition region. Behaviour in the default case
remaing unchanged.
This allows users to specify larger cutoffs than 3 (which used to
have no effect) and get correct cutoff behaviour for values less
then 3.
parent 74d63c24
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -15,12 +15,13 @@ pair_style rebo/omp command :h3

[Syntax:]

pair_style style cutoff LJ_flag TORSION_flag :pre
pair_style style cutoff LJ_flag TORSION_flag cutoff_min :pre

style = {airebo} or {airebo/morse} or {rebo}
cutoff = LJ or Morse cutoff (sigma scale factor) (AIREBO and AIREBO-M only)
LJ_flag = 0/1 to turn off/on the LJ or Morse term (AIREBO and AIREBO-M only, optional)
TORSION_flag = 0/1 to turn off/on the torsion term (AIREBO and AIREBO-M only, optional) :ul
TORSION_flag = 0/1 to turn off/on the torsion term (AIREBO and AIREBO-M only, optional)
cutoff_min = Start of the transition region of cutoff (sigma scale factor) (AIREBO and AIREBO-M only, optional) :ul

[Examples:]

@@ -60,7 +61,7 @@ The AIREBO potential consists of three terms:
:c,image(Eqs/pair_airebo.jpg)

By default, all three terms are included.  For the {airebo} style, if
the two optional flag arguments to the pair_style command are
the first two optional flag arguments to the pair_style command are
included, the LJ and torsional terms can be turned off.  Note that
both or neither of the flags must be included.  If both of the LJ an
torsional terms are turned off, it becomes the 2nd-generation REBO
@@ -97,6 +98,12 @@ standard AIREBO potential, sigma_CC = 3.4 Angstroms, so with a scale
factor of 3.0 (the argument in pair_style), the resulting E_LJ cutoff
would be 10.2 Angstroms.

By default, the longer-ranged interaction is smoothly switched off
between 2.16 and 3.0 sigma. By specifying {cutoff_min} in addition
to {cutoff}, the switching can be configured to take place between 
{cutoff_min} and {cutoff}. {cutoff_min} can only be specified if all
optional arguments are given.

The E_TORSION term is an explicit 4-body potential that describes
various dihedral angle preferences in hydrocarbon configurations.

+13 −5
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@ PairAIREBO::PairAIREBO(LAMMPS *lmp) : Pair(lmp)
  nC = nH = NULL;
  map = NULL;
  manybody_flag = 1;

  sigwid = 0.84;
  sigcut = 3.0;
  sigmin = sigcut - sigwid;
}

/* ----------------------------------------------------------------------
@@ -147,7 +151,8 @@ void PairAIREBO::allocate()

void PairAIREBO::settings(int narg, char **arg)
{
  if (narg != 1 && narg != 3) error->all(FLERR,"Illegal pair_style command");
  if (narg != 1 && narg != 3 && narg != 4)
    error->all(FLERR,"Illegal pair_style command");

  cutlj = force->numeric(FLERR,arg[0]);

@@ -155,6 +160,13 @@ void PairAIREBO::settings(int narg, char **arg)
    ljflag = force->inumeric(FLERR,arg[1]);
    torflag = force->inumeric(FLERR,arg[2]);
  }
  if (narg == 4) {
    ljflag = force->inumeric(FLERR,arg[1]);
    torflag = force->inumeric(FLERR,arg[2]);
    sigcut = cutlj;
    sigmin = force->numeric(FLERR,arg[3]);
    sigwid = sigcut - sigmin;
  }

  // this one parameter for C-C interactions is different in AIREBO vs REBO
  // see Favata, Micheletti, Ryu, Pugno, Comp Phys Comm (2016)
@@ -736,10 +748,6 @@ void PairAIREBO::FLJ(int eflag, int vflag)

      // compute LJ forces and energy

      sigwid = 0.84;
      sigcut = 3.0;
      sigmin = sigcut - sigwid;

      rljmin = sigma[itype][jtype];
      rljmax = sigcut * rljmin;
      rljmin = sigmin * rljmin;
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ class PairAIREBO : public Pair {
  int morseflag;                   // 1 if Morse instead of LJ for non-bonded

  double cutlj;                    // user-specified LJ cutoff
  double sigcut,sigwid,sigmin;     // corresponding cutoff function
  double cutljrebosq;              // cut for when to compute
                                   // REBO neighs of ghost atoms