From ddfdabf189638b8b02fe2da6ae426c41c110700f Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Thu, 30 Jan 2020 14:16:59 -0500 Subject: [PATCH 01/25] added bond style special --- src/USER-MISC/bond_special.cpp | 218 +++++++++++++++++++++++++++++++++ src/USER-MISC/bond_special.h | 74 +++++++++++ 2 files changed, 292 insertions(+) create mode 100644 src/USER-MISC/bond_special.cpp create mode 100644 src/USER-MISC/bond_special.h diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp new file mode 100644 index 0000000000..322279e005 --- /dev/null +++ b/src/USER-MISC/bond_special.cpp @@ -0,0 +1,218 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. + + Contributing Author: David Nicholson (MIT) +------------------------------------------------------------------------- */ + +#include +#include +#include +#include "bond_special.h" +#include "atom.h" +#include "neighbor.h" +#include "domain.h" +#include "comm.h" +#include "force.h" +#include "pair.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +BondSpecial::BondSpecial(LAMMPS *lmp) : Bond(lmp) {} + +/* ---------------------------------------------------------------------- */ + +BondSpecial::~BondSpecial() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(factor_lj); + memory->destroy(factor_coul); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondSpecial::init_style() +{ + if (force->pair == NULL || force->pair->single_enable == 0) + error->all(FLERR,"Pair style does not support bond style special"); + + if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0) + error->all(FLERR,"Invalid 1-2 setting for bond style special."); + + if (force->special_angle != 1 && (force->special_lj[2] != 0.0 || + force->special_coul[3] != 0.0)) + error->all(FLERR,"Invalid 1-3 setting for bond style special."); + + if (force->special_dihedral != 1 && (force->special_lj[3] != 0.0 || + force->special_coul[3] != 0.0)) + error->all(FLERR,"Invalid 1-4 setting for bond style special."); + +} + +/* ---------------------------------------------------------------------- */ + +void BondSpecial::compute(int eflag, int vflag) +{ + int i1,i2,i1type,i2type,n,type; + double delx,dely,delz,ebond,fbond; + double rsq; + + ev_init(eflag,vflag); + + double **x = atom->x; + double **f = atom->f; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + for (n = 0; n < nbondlist; n++) { + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + type = bondlist[n][2]; + + i1type = atom->type[i1]; + i2type = atom->type[i2]; + + delx = x[i1][0] - x[i2][0]; + dely = x[i1][1] - x[i2][1]; + delz = x[i1][2] - x[i2][2]; + + rsq = delx*delx + dely*dely + delz*delz; + + ebond = force->pair->single(i1,i2,i1type,i2type,rsq,factor_lj[type], + factor_coul[type],fbond); + + // apply force to each of 2 atoms + + if (newton_bond || i1 < nlocal) { + f[i1][0] += delx*fbond; + f[i1][1] += dely*fbond; + f[i1][2] += delz*fbond; + } + + if (newton_bond || i2 < nlocal) { + f[i2][0] -= delx*fbond; + f[i2][1] -= dely*fbond; + f[i2][2] -= delz*fbond; + } + + if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondSpecial::allocate() +{ + allocated = 1; + int n = atom->nbondtypes; + + memory->create(factor_lj,n+1,"bond:factor_lj"); + memory->create(factor_coul,n+1,"bond:factor_coul"); + + memory->create(setflag,n+1,"bond:setflag"); + for (int i = 1; i <= n; i++) setflag[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types +------------------------------------------------------------------------- */ + +void BondSpecial::coeff(int narg, char **arg) +{ + if (narg != 3) error->all(FLERR,"Incorrect args for bond coefficients"); + if (!allocated) allocate(); + + int ilo,ihi; + force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + + double factor_lj_one = force->numeric(FLERR,arg[1]); + double factor_coul_one = force->numeric(FLERR,arg[2]); + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + factor_lj[i] = factor_lj_one; + factor_coul[i] = factor_coul_one; + setflag[i] = 1; + count++; + } + + if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients"); +} + +/* ---------------------------------------------------------------------- + return an equilbrium bond length +------------------------------------------------------------------------- */ + +double BondSpecial::equilibrium_distance(int i) +{ + return 0.; +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void BondSpecial::write_restart(FILE *fp) +{ + fwrite(&factor_lj[1],sizeof(double),atom->nbondtypes,fp); + fwrite(&factor_coul[1],sizeof(double),atom->nbondtypes,fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void BondSpecial::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + fread(&factor_lj[1],sizeof(double),atom->nbondtypes,fp); + fread(&factor_coul[1],sizeof(double),atom->nbondtypes,fp); + } + MPI_Bcast(&factor_lj[1],atom->nbondtypes,MPI_DOUBLE,0,world); + MPI_Bcast(&factor_coul[1],atom->nbondtypes,MPI_DOUBLE,0,world); + + for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondSpecial::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g\n",i,factor_lj[i],factor_coul[i]); +} + +/* ---------------------------------------------------------------------- */ + +double BondSpecial::single(int type, double rsq, int i, int j, + double &fforce) +{ + int itype = atom->type[i]; + int jtype = atom->type[j]; + double ebond; + ebond = force->pair->single(i,j,itype,jtype,rsq,factor_lj[type], + factor_coul[type],fforce); + return ebond; +} + + diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h new file mode 100644 index 0000000000..52b28e526c --- /dev/null +++ b/src/USER-MISC/bond_special.h @@ -0,0 +1,74 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. + + Contributing Author: David Nicholson (MIT) +------------------------------------------------------------------------- */ + +#ifdef BOND_CLASS + +BondStyle(special,BondSpecial) + +#else + +#ifndef LMP_BOND_SPECIAL_H +#define LMP_BOND_SPECIAL_H + +#include +#include "bond.h" + +namespace LAMMPS_NS { + +class BondSpecial: public Bond { + public: + BondSpecial(class LAMMPS *); + virtual ~BondSpecial(); + void init_style(); + void compute(int, int); + void coeff(int, char **); + double equilibrium_distance(int); + void write_restart(FILE *); + void read_restart(FILE *); + void write_data(FILE *); + double single(int, double, int, int, double &); + + protected: + double *factor_lj,*factor_coul; + + void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Incorrect args for bond coefficients + +Self-explanatory. Check the input script or data file. + +E: Invalid 1-2 setting for bond style special. + +Bond style special must be used with zero factors for 1-2 special bonds. + +E: Invalid 1-3 setting for bond style special. + +Bond style special must be used with either zero factors for 1-3 special bonds +or the angle keyword. + +E: Invalid 1-4 setting for bond style special. + +Bond style special must be used with either zero factors for 1-4 special bonds +or the dihedral keyword. + +*/ From 58a03f12eb2bbbc842499214bd038a2339403ec9 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Thu, 30 Jan 2020 15:25:55 -0500 Subject: [PATCH 02/25] draft doc page for bond_style special --- doc/src/bond_special.rst | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 doc/src/bond_special.rst diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst new file mode 100644 index 0000000000..1b9409be3d --- /dev/null +++ b/doc/src/bond_special.rst @@ -0,0 +1,59 @@ +.. index:: bond_style special + +bond_style special command +================================= + +Syntax +"""""" + + +.. code-block:: LAMMPS + + bond_style special + +Examples +"""""""" + + +.. code-block:: LAMMPS + + bond_style special + bond_coeff 0.5 0.5 + +Description +""""""""""" + +The *special* bond style can be used to impose weighted Lennard Jones and/or +Coloumbic interactions on any two particles in the system. It can be used for +cases that cannot be handled in :doc:`special_bonds `, such as +1-5 interactions or hyrbrid simulations that require the use of different +weighting factors for different molecules. + +The following coefficients must be defined for each bond type via the +:doc:`bond_coeff ` command as in the example above, or in +the data file or restart files read by the :doc:`read_data ` +or :doc:`read_restart ` commands: + +* `w_lj` weight (0.0 to 1.0) on pairwise Lennard-Jones interactions + +* `w_coul` weight (0.0 to 1.0) on pairwise Coulombic interactions + +This command will typically be used in conjunction with + +---------- + + + +Restrictions +"""""""""""" + +This bond style can only be used if LAMMPS was built with the +USER-MISC package. See the :doc:`Build package ` doc +page for more info. + +Related commands +"""""""""""""""" + +:doc:`bond_coeff `, :doc:`special_bonds `, + +**Default:** none From 9b3a93d2225c691a213543359a391b8ae5467849 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 11:30:41 -0500 Subject: [PATCH 03/25] add bond_style special to the list --- doc/src/Commands_bond.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index 19be6d8cbc..41c7728a7c 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -46,6 +46,7 @@ OPT. * :doc:`oxdna2/fene ` * :doc:`oxrna2/fene ` * :doc:`quartic (o) ` + * :doc:`special ` * :doc:`table (o) ` .. _angle: From 6bb30a33128383d6481d3b005898a2e8725ca0f4 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 12:26:00 -0500 Subject: [PATCH 04/25] revised doc for bond_style special --- doc/src/bond_special.rst | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index 1b9409be3d..5c560d7986 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -26,22 +26,36 @@ Description The *special* bond style can be used to impose weighted Lennard Jones and/or Coloumbic interactions on any two particles in the system. It can be used for cases that cannot be handled in :doc:`special_bonds `, such as -1-5 interactions or hyrbrid simulations that require the use of different -weighting factors for different molecules. +1-5 interactions or complex systems that require the use of different +weighting factors for different molecules. It is a potential of the form: + +.. math:: + + E = w_{LJ} E_{LJ} + w_{Coul}E_{Coul} The following coefficients must be defined for each bond type via the :doc:`bond_coeff ` command as in the example above, or in the data file or restart files read by the :doc:`read_data ` or :doc:`read_restart ` commands: -* `w_lj` weight (0.0 to 1.0) on pairwise Lennard-Jones interactions +* :math:`w_{LJ}` weight (0.0 to 1.0) on pairwise Lennard-Jones interactions -* `w_coul` weight (0.0 to 1.0) on pairwise Coulombic interactions - -This command will typically be used in conjunction with +* :math:`w_{Coul}` weight (0.0 to 1.0) on pairwise Coulombic interactions ---------- +This style has strict requirements on the :doc:`special_bonds ` +setting. 1-2 interactions must have weights of zero. 1-3 interactions must +either have weights of zero or the *angle* setting must be turned on. 1-4 +interactions must have weights of zero or the *dihedral* setting must be turned +on. These requirements ensure that the new bonds created by this style do not +create spurious 1-2, 1-3 or 1-4 interactions. + +This style should be used in conjunction with a regular bond style via +:doc:`bond_style hybrid `. Since it can be used to create +bonded interactions between particles that are further away than usual +(e.g. 1-5 or 1-6 interactions), this style may require an increase in the +communication cutoff via the :doc:`neigh_modify ` command. Restrictions @@ -54,6 +68,6 @@ page for more info. Related commands """""""""""""""" -:doc:`bond_coeff `, :doc:`special_bonds `, +:doc:`bond_coeff `, :doc:`special_bonds ` **Default:** none From 923ccaaff9f6801fe79d8334ea78d3ffd531989d Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 12:56:02 -0500 Subject: [PATCH 05/25] fixed error handling --- src/USER-MISC/bond_special.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 322279e005..3773da6e2c 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -54,7 +54,7 @@ void BondSpecial::init_style() error->all(FLERR,"Invalid 1-2 setting for bond style special."); if (force->special_angle != 1 && (force->special_lj[2] != 0.0 || - force->special_coul[3] != 0.0)) + force->special_coul[2] != 0.0)) error->all(FLERR,"Invalid 1-3 setting for bond style special."); if (force->special_dihedral != 1 && (force->special_lj[3] != 0.0 || From 035fba10e5708348932d403267a30cf08e061439 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 15:33:59 -0500 Subject: [PATCH 06/25] fixed special_bonds requirements --- doc/src/bond_special.rst | 4 ++-- src/USER-MISC/bond_special.cpp | 8 ++++---- src/USER-MISC/bond_special.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index 5c560d7986..63f76f16c3 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -46,8 +46,8 @@ or :doc:`read_restart ` commands: This style has strict requirements on the :doc:`special_bonds ` setting. 1-2 interactions must have weights of zero. 1-3 interactions must -either have weights of zero or the *angle* setting must be turned on. 1-4 -interactions must have weights of zero or the *dihedral* setting must be turned +either have weights of one or the *angle* setting must be turned on. 1-4 +interactions must have weights of one or the *dihedral* setting must be turned on. These requirements ensure that the new bonds created by this style do not create spurious 1-2, 1-3 or 1-4 interactions. diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 3773da6e2c..4621640f51 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -53,12 +53,12 @@ void BondSpecial::init_style() if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0) error->all(FLERR,"Invalid 1-2 setting for bond style special."); - if (force->special_angle != 1 && (force->special_lj[2] != 0.0 || - force->special_coul[2] != 0.0)) + if (force->special_angle != 1 && (force->special_lj[2] != 1.0 || + force->special_coul[2] != 1.0)) error->all(FLERR,"Invalid 1-3 setting for bond style special."); - if (force->special_dihedral != 1 && (force->special_lj[3] != 0.0 || - force->special_coul[3] != 0.0)) + if (force->special_dihedral != 1 && (force->special_lj[3] != 1.0 || + force->special_coul[3] != 1.0)) error->all(FLERR,"Invalid 1-4 setting for bond style special."); } diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h index 52b28e526c..9885e811ed 100644 --- a/src/USER-MISC/bond_special.h +++ b/src/USER-MISC/bond_special.h @@ -63,12 +63,12 @@ Bond style special must be used with zero factors for 1-2 special bonds. E: Invalid 1-3 setting for bond style special. -Bond style special must be used with either zero factors for 1-3 special bonds -or the angle keyword. +Bond style special must be used with 1.0 factors for 1-3 special bonds or the +angle keyword set to yes. E: Invalid 1-4 setting for bond style special. -Bond style special must be used with either zero factors for 1-4 special bonds -or the dihedral keyword. +Bond style special must be used with 1.0 factors for 1-4 special bonds or the +dihedral keyword set to yes. */ From 14dfe538373950360b49b492f16ffd9b046fc97c Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 15:54:01 -0500 Subject: [PATCH 07/25] doc edit --- doc/src/bond_special.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index 63f76f16c3..a3d0230681 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -26,8 +26,7 @@ Description The *special* bond style can be used to impose weighted Lennard Jones and/or Coloumbic interactions on any two particles in the system. It can be used for cases that cannot be handled in :doc:`special_bonds `, such as -1-5 interactions or complex systems that require the use of different -weighting factors for different molecules. It is a potential of the form: +1-5 interactions. It is a potential of the form: .. math:: From aefaab5769c293e006ab376a712eda60c80478c7 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 16:00:16 -0500 Subject: [PATCH 08/25] readme for user-misc --- src/USER-MISC/README | 1 + 1 file changed, 1 insertion(+) diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 9fdc18fbe5..2266165c08 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -26,6 +26,7 @@ angle_style dipole, Mario Orsi, orsimario at gmail.com, 10 Jan 12 angle_style quartic, Loukas Peristeras, loukas.peristeras at scienomics.com, 27 Oct 12 bond_style harmonic/shift, Carsten Svaneborg, science at zqex.dk, 8 Aug 11 bond_style harmonic/shift/cut, Carsten Svaneborg, science at zqex.dk, 8 Aug 11 +bond_style special, David Nicholson, davidanich at gmail.com, 31 Jan 2020 compute ackland/atom, Gerolf Ziegenhain, gerolf at ziegenhain.com, 4 Oct 2007 compute basal/atom, Christopher Barrett, cdb333 at cavs.msstate.edu, 3 Mar 2013 compute cnp/atom, Paulo Branicio (USC), branicio at usc.edu, 31 May 2017 From b35c271a1239eaf0a912dcaad1e7336223f45493 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Fri, 31 Jan 2020 16:31:42 -0500 Subject: [PATCH 09/25] spelling error --- doc/src/bond_special.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index a3d0230681..674e63857c 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -24,7 +24,7 @@ Description """"""""""" The *special* bond style can be used to impose weighted Lennard Jones and/or -Coloumbic interactions on any two particles in the system. It can be used for +Coulombic interactions on any two particles in the system. It can be used for cases that cannot be handled in :doc:`special_bonds `, such as 1-5 interactions. It is a potential of the form: From 7671d12ef8037af6160631405019ef8045722dab Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 1 Jul 2020 14:55:48 -0600 Subject: [PATCH 10/25] added some more detail to the bond special doc page --- doc/src/bond_special.rst | 68 ++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index 674e63857c..bbaf56afe4 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -23,14 +23,24 @@ Examples Description """"""""""" -The *special* bond style can be used to impose weighted Lennard Jones and/or -Coulombic interactions on any two particles in the system. It can be used for -cases that cannot be handled in :doc:`special_bonds `, such as -1-5 interactions. It is a potential of the form: +The *special* bond style can be used to create conceptual bonds which +effectively impose weightings on the pairwise Lennard Jones and/or +Coulombic interactions between selected pairs of particles in the +system. The form of the pairwise interaction will be whatever is +computed by the :doc:`pair_style ` command defined for the +system; this command defines the weightings for its two terms. + +This command can thus be useful to apply weightings that cannot be +handled by the :doc:`special_bonds ` command, such as +on 1-5 or 1-6 interactions. Or it can be used to add pairwise forces +between one or more pairs of atoms that otherwise would not be include +in the :doc:`pair_style ` computation. + +The potential for this bond style has the form .. math:: - E = w_{LJ} E_{LJ} + w_{Coul}E_{Coul} + E = w_{LJ} E_{LJ} + w_{Coul} E_{Coul} The following coefficients must be defined for each bond type via the :doc:`bond_coeff ` command as in the example above, or in @@ -43,19 +53,34 @@ or :doc:`read_restart ` commands: ---------- -This style has strict requirements on the :doc:`special_bonds ` -setting. 1-2 interactions must have weights of zero. 1-3 interactions must -either have weights of one or the *angle* setting must be turned on. 1-4 -interactions must have weights of one or the *dihedral* setting must be turned -on. These requirements ensure that the new bonds created by this style do not -create spurious 1-2, 1-3 or 1-4 interactions. +Normally this bond style should be used in conjunction with one (or +more) other bond styles which compute forces between atoms directly +bonded to each other in a molecule. This means the :doc:`bond_style +hybrid ` command should be used with bond_style special +as one of its sub-styles. -This style should be used in conjunction with a regular bond style via -:doc:`bond_style hybrid `. Since it can be used to create -bonded interactions between particles that are further away than usual -(e.g. 1-5 or 1-6 interactions), this style may require an increase in the -communication cutoff via the :doc:`neigh_modify ` command. +Note that the same as for any other bond style, pairs of bonded atoms +must be enumerated in the data file read by the :doc:`read_data +` command. Thus if this command is used to weight all 1-5 +interactions in the system, all the 1-5 pairs of atoms must be listed +in the "Bonds" section of the data file. +This bond style imposes strict requirements on settings made with the +:doc:`special_bonds ` command. These requirements +ensure that the new bonds created by this style do not create spurious +1-2, 1-3, or 1-4 interactions within the molecular topology. + +Specifically 1-2 interactions must have weights of zero, 1-3 +interactions must either have weights of unity or :doc:`special_bonds +angle yes ` must be used, and 1-4 interactions must +have weights of unity or the *dihedral* setting must be turned on or +:doc:`special_bonds dihedral yes ` must be used. + +If this command is used to create bonded interactions between +particles that are further apart than usual (e.g. 1-5 or 1-6 +interactions), this style may require an increase in the communication +cutoff via the :doc:`comm_modify cutoff ` command. If +LAMMPS cannot find a partner atom in a bond, an error will be issued. Restrictions """""""""""" @@ -64,6 +89,17 @@ This bond style can only be used if LAMMPS was built with the USER-MISC package. See the :doc:`Build package ` doc page for more info. +This bond style requires use of a :doc:`pair_style ` which +computes a pairwise interaction. Many-body potentials do not. + +Q: Does this command work with long-range Coulombics? E.g. if used to +weight 1-5 interactions between charged particles and also used with +PPPM, does it give the right answer? The special bond weight settings +are treated explicity in pair styles like pair lj/cut/coul/long. +Either way, the answer to this Q should be explained on this page. +And if the answer is no, then I think an error check should be made in +the code. + Related commands """""""""""""""" From 187117587187c159df3adb7ff231002b73515d29 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 5 Aug 2020 17:20:13 -0600 Subject: [PATCH 11/25] Patched fix/store --- src/fix_store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_store.cpp b/src/fix_store.cpp index ac663a7913..b693aa94d8 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -301,7 +301,7 @@ void FixStore::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values int m = 0; - for (int i = 0; i < nth; i++) m += (int) ubuf(extra[nlocal][m]).i; + for (int i = 0; i < nth; i++) m += static_cast extra[nlocal][m]; m++; if (vecflag) vstore[nlocal] = extra[nlocal][m]; From 27fe315db7ce7dcb45d37677745691e845e159f2 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 5 Aug 2020 17:25:58 -0600 Subject: [PATCH 12/25] Matching style of other fixes --- src/fix_store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_store.cpp b/src/fix_store.cpp index b693aa94d8..85371d9e34 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -301,7 +301,7 @@ void FixStore::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values int m = 0; - for (int i = 0; i < nth; i++) m += static_cast extra[nlocal][m]; + for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; if (vecflag) vstore[nlocal] = extra[nlocal][m]; From 6b1191b1c024c1b9534c218402460034c6631bdc Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 5 Aug 2020 18:59:33 -0600 Subject: [PATCH 13/25] Forgot to update saving buffer size --- src/fix_store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 85371d9e34..80ffee2ded 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -280,7 +280,7 @@ int FixStore::pack_restart(int i, double *buf) return 1; } - buf[0] = ubuf(nvalues+1).d; + buf[0] = nvalues+1; if (vecflag) buf[1] = vstore[i]; else for (int m = 0; m < nvalues; m++) From 41904f7946994e7ebeea729883919fc918042297 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Sat, 8 Aug 2020 09:15:56 -0600 Subject: [PATCH 14/25] Added cautionary comments --- src/GRANULAR/fix_wall_gran.cpp | 4 +++- src/GRANULAR/fix_wall_gran_region.cpp | 4 +++- src/MISC/fix_gld.cpp | 4 +++- src/MISC/fix_ttm.cpp | 4 +++- src/MOLECULE/fix_cmap.cpp | 4 +++- src/PERI/fix_peri_neigh.cpp | 2 ++ src/USER-ATC/fix_atc.cpp | 0 src/USER-MISC/fix_gle.cpp | 4 +++- src/USER-MISC/fix_pimd.cpp | 2 ++ src/USER-MISC/fix_srp.cpp | 7 +++++-- src/USER-MISC/fix_ti_spring.cpp | 3 ++- src/USER-MISC/fix_ttm_mod.cpp | 2 ++ src/USER-SDPD/fix_meso_move.cpp | 2 ++ src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp | 2 ++ src/fix_move.cpp | 2 ++ src/fix_neigh_history.cpp | 2 ++ src/fix_property_atom.cpp | 2 ++ src/fix_spring_self.cpp | 2 ++ src/fix_store.cpp | 2 ++ src/fix_store_state.cpp | 2 ++ 20 files changed, 47 insertions(+), 9 deletions(-) mode change 100644 => 100755 src/GRANULAR/fix_wall_gran.cpp mode change 100644 => 100755 src/GRANULAR/fix_wall_gran_region.cpp mode change 100644 => 100755 src/MISC/fix_gld.cpp mode change 100644 => 100755 src/MISC/fix_ttm.cpp mode change 100644 => 100755 src/MOLECULE/fix_cmap.cpp mode change 100644 => 100755 src/USER-ATC/fix_atc.cpp mode change 100644 => 100755 src/USER-MISC/fix_gle.cpp mode change 100644 => 100755 src/USER-MISC/fix_pimd.cpp mode change 100644 => 100755 src/USER-MISC/fix_srp.cpp mode change 100644 => 100755 src/USER-MISC/fix_ti_spring.cpp mode change 100644 => 100755 src/USER-MISC/fix_ttm_mod.cpp mode change 100644 => 100755 src/USER-SDPD/fix_meso_move.cpp mode change 100644 => 100755 src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp mode change 100644 => 100755 src/fix_move.cpp mode change 100644 => 100755 src/fix_neigh_history.cpp mode change 100644 => 100755 src/fix_property_atom.cpp mode change 100644 => 100755 src/fix_spring_self.cpp mode change 100644 => 100755 src/fix_store.cpp mode change 100644 => 100755 src/fix_store_state.cpp diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp old mode 100644 new mode 100755 index c856b8ff5f..1cf15604b1 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -1541,6 +1541,7 @@ int FixWallGran::pack_restart(int i, double *buf) if (!use_history) return 0; int n = 0; + // pack buf[0] this way b/c other fixes unpack it buf[n++] = size_history + 1; for (int m = 0; m < size_history; m++) buf[n++] = history_one[i][m]; @@ -1558,7 +1559,8 @@ void FixWallGran::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way b/c other fixes pack them + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp old mode 100644 new mode 100755 index 7ccd90ebf8..34540100ff --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -479,6 +479,7 @@ int FixWallGranRegion::pack_restart(int i, double *buf) for (m = 0; m < size_history; m++) buf[n++] = history_many[i][iwall][m]; } + // pack buf[0] this way b/c other fixes unpack it buf[0] = n; return n; } @@ -496,7 +497,8 @@ void FixWallGranRegion::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way b/c other fixes pack them + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp old mode 100644 new mode 100755 index 380c038e4a..558242aa99 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -547,6 +547,7 @@ int FixGLD::unpack_exchange(int nlocal, double *buf) int FixGLD::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way b/c other fixes unpack it buf[m++] = 3*prony_terms + 1; for (int k = 0; k < 3*prony_terms; k=k+3) { @@ -566,7 +567,8 @@ void FixGLD::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to the nth set of extended variables - + // unpack the Nth first values this way b/c other fixes pack them + int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp old mode 100644 new mode 100755 index e79f7616d9..18d725a3a7 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -656,6 +656,7 @@ void FixTTM::restart(char *buf) int FixTTM::pack_restart(int i, double *buf) { + // pack buf[0] this way b/c other fixes unpack it buf[0] = 4; buf[1] = flangevin[i][0]; buf[2] = flangevin[i][1]; @@ -672,7 +673,8 @@ void FixTTM::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way b/c other fixes pack them + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp old mode 100644 new mode 100755 index 6fbf82e4cc..83a31d4ad8 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1291,6 +1291,7 @@ int FixCMAP::pack_restart(int i, double *buf) buf[n++] = ubuf(crossterm_atom4[i][m]).d; buf[n++] = ubuf(crossterm_atom5[i][m]).d; } + // pack buf[0] this way b/c other fixes unpack it buf[0] = n; return n; @@ -1305,7 +1306,8 @@ void FixCMAP::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + // unpack the Nth first values this way b/c other fixes pack them + int n = 0; for (int i = 0; i < nth; i++) n += static_cast (extra[nlocal][n]); diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 70f46dcdc1..022eb0bab6 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -579,6 +579,7 @@ void FixPeriNeigh::restart(char *buf) int FixPeriNeigh::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way b/c other fixes unpack it if (isVES) buf[m++] = 4*npartner[i] + 4; else if (isEPS) buf[m++] = 3*npartner[i] + 5; else buf[m++] = 2*npartner[i] + 4; @@ -608,6 +609,7 @@ void FixPeriNeigh::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp old mode 100644 new mode 100755 diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp old mode 100644 new mode 100755 index a1cf1ac2e9..b308d4423f --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -822,6 +822,7 @@ int FixGLE::unpack_exchange(int nlocal, double *buf) int FixGLE::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way b/c other fixes unpack it buf[m++] = 3*ns + 1; for (int k = 0; k < 3*ns; k=k+3) { @@ -841,7 +842,8 @@ void FixGLE::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to the nth set of extended variables - + // unpack the Nth first values this way b/c other fixes pack them + int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp old mode 100644 new mode 100755 index c73f802362..3159fb865f --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -794,6 +794,7 @@ int FixPIMD::pack_restart(int i, double *buf) { int offset=0; int pos = i * 3; + // pack buf[0] this way b/c other fixes unpack it buf[offset++] = size_peratom_cols+1; memcpy(buf+offset, nhc_eta[pos], nhc_size_one_1); offset += nhc_offset_one_1; @@ -811,6 +812,7 @@ void FixPIMD::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i=0; i (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp old mode 100644 new mode 100755 index 2a96555fd7..f870a884f0 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -555,6 +555,7 @@ void FixSRP::post_run() int FixSRP::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way b/c other fixes unpack it buf[m++] = 3; buf[m++] = array[i][0]; buf[m++] = array[i][1]; @@ -569,10 +570,12 @@ void FixSRP::unpack_restart(int nlocal, int nth) { double **extra = atom->extra; -// skip to Nth set of extra values + // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them + int m = 0; for (int i = 0; i < nth; i++){ - m += extra[nlocal][m]; + m += static_cast (extra[nlocal][m]); } m++; diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp old mode 100644 new mode 100755 index 8481b34a6b..8dc5dc0c6d --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -315,7 +315,7 @@ int FixTISpring::unpack_exchange(int nlocal, double *buf) int FixTISpring::pack_restart(int i, double *buf) { - buf[0] = 4; + // pack buf[0] this way b/c other fixes unpack it buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; buf[3] = xoriginal[i][2]; @@ -331,6 +331,7 @@ void FixTISpring::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp old mode 100644 new mode 100755 index cd3fbaa721..4015f76a95 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -980,6 +980,7 @@ void FixTTMMod::restart(char *buf) int FixTTMMod::pack_restart(int i, double *buf) { + // pack buf[0] this way b/c other fixes unpack it buf[0] = 4; buf[1] = flangevin[i][0]; buf[2] = flangevin[i][1]; @@ -996,6 +997,7 @@ void FixTTMMod::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp old mode 100644 new mode 100755 index 0406b6f0a3..d72d9667ca --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -948,6 +948,7 @@ int FixMesoMove::unpack_exchange (int nlocal, double *buf) { ------------------------------------------------------------------------- */ int FixMesoMove::pack_restart (int i, double *buf) { + // pack buf[0] this way b/c other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -963,6 +964,7 @@ void FixMesoMove::unpack_restart (int nlocal, int nth) { double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp old mode 100644 new mode 100755 index 6aa23fe3b2..83b9e74b37 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -450,6 +450,7 @@ int FixSMD_TLSPH_ReferenceConfiguration::unpack_exchange(int nlocal, double *buf int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { int m = 0; + // pack buf[0] this way b/c other fixes unpack it buf[m++] = 4 * npartner[i] + 2; buf[m++] = npartner[i]; for (int n = 0; n < npartner[i]; n++) { @@ -470,6 +471,7 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*n // ipage = NULL if being called from granular pair style init() // skip to Nth set of extra values +// unpack the Nth first values this way b/c other fixes pack them // double **extra = atom->extra; // diff --git a/src/fix_move.cpp b/src/fix_move.cpp old mode 100644 new mode 100755 index 770c0fca6b..936fac7481 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -1193,6 +1193,7 @@ int FixMove::pack_restart(int i, double *buf) buf[n++] = qoriginal[i][2]; buf[n++] = qoriginal[i][3]; } + // pack buf[0] this way b/c other fixes unpack it buf[0] = n; return n; } @@ -1206,6 +1207,7 @@ void FixMove::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp old mode 100644 new mode 100755 index 9b632b7ff8..90e0ec78f0 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -853,6 +853,7 @@ int FixNeighHistory::pack_restart(int i, double *buf) memcpy(&buf[m],&valuepartner[i][dnum*n],dnumbytes); m += dnum; } + // pack buf[0] this way b/c other fixes unpack it buf[0] = m; return m; } @@ -868,6 +869,7 @@ void FixNeighHistory::unpack_restart(int nlocal, int nth) if (ipage_atom == NULL) allocate_pages(); // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them double **extra = atom->extra; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp old mode 100644 new mode 100755 index f1262f88c7..251afc4f28 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -579,6 +579,7 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) int FixPropertyAtom::pack_restart(int i, double *buf) { + // pack buf[0] this way b/c other fixes unpack it buf[0] = nvalue+1; int m = 1; @@ -602,6 +603,7 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp old mode 100644 new mode 100755 index c94f21b492..ae723d48fe --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -264,6 +264,7 @@ int FixSpringSelf::unpack_exchange(int nlocal, double *buf) int FixSpringSelf::pack_restart(int i, double *buf) { + // pack buf[0] this way b/c other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -280,6 +281,7 @@ void FixSpringSelf::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_store.cpp b/src/fix_store.cpp old mode 100644 new mode 100755 index 80ffee2ded..d98696b2e8 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -280,6 +280,7 @@ int FixStore::pack_restart(int i, double *buf) return 1; } + // pack buf[0] this way b/c other fixes unpack it buf[0] = nvalues+1; if (vecflag) buf[1] = vstore[i]; else @@ -299,6 +300,7 @@ void FixStore::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp old mode 100644 new mode 100755 index 18dfa026d9..17ca72ecae --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -611,6 +611,7 @@ int FixStoreState::unpack_exchange(int nlocal, double *buf) int FixStoreState::pack_restart(int i, double *buf) { + // pack buf[0] this way b/c other fixes unpack it buf[0] = nvalues+1; for (int m = 0; m < nvalues; m++) buf[m+1] = values[i][m]; return nvalues+1; @@ -625,6 +626,7 @@ void FixStoreState::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values + // unpack the Nth first values this way b/c other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); From d0720794a68a3510c21a3025d1654ef593d548ad Mon Sep 17 00:00:00 2001 From: jtclemm Date: Sat, 8 Aug 2020 09:21:36 -0600 Subject: [PATCH 15/25] Replaced mistakenly dropped line --- src/USER-MISC/fix_ti_spring.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 8dc5dc0c6d..0931f06e15 100755 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -316,6 +316,7 @@ int FixTISpring::unpack_exchange(int nlocal, double *buf) int FixTISpring::pack_restart(int i, double *buf) { // pack buf[0] this way b/c other fixes unpack it + buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; buf[3] = xoriginal[i][2]; From 9bbd6099af3181068036973972fe8ee310bb1f15 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Sat, 8 Aug 2020 16:30:27 -0400 Subject: [PATCH 16/25] unit tests for /soft pair styles --- .../mol-pair-lj_charmm_coul_long_soft.yaml | 102 +++++++++++++++++ .../mol-pair-lj_class2_coul_cut_soft.yaml | 94 ++++++++++++++++ .../mol-pair-lj_class2_coul_long_soft.yaml | 99 ++++++++++++++++ .../tests/mol-pair-lj_class2_soft.yaml | 93 +++++++++++++++ .../tests/mol-pair-lj_cut_coul_cut_soft.yaml | 94 ++++++++++++++++ .../tests/mol-pair-lj_cut_coul_long_soft.yaml | 99 ++++++++++++++++ .../tests/mol-pair-lj_cut_soft.yaml | 92 +++++++++++++++ .../mol-pair-lj_cut_tip4p_long_soft.yaml | 106 ++++++++++++++++++ .../tests/mol-pair-morse_soft.yaml | 102 +++++++++++++++++ 9 files changed, 881 insertions(+) create mode 100644 unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-morse_soft.yaml diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml new file mode 100644 index 0000000000..de7fdfe1e5 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml @@ -0,0 +1,102 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:21:13 202 +epsilon: 7.5e-14 +prerequisites: ! | + atom full + pair lj/charmm/coul/long/soft + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/charmm/coul/long/soft 4.0 2.5 6.4 7.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + lj14_1 2 + lj14_2 2 + lj14_3 2 + lj14_4 2 + lambda 2 + implicit 0 + cut_coul 0 +natoms: 29 +init_vdwl: 0.0870608994865688 +init_coul: 26.4864428259304 +init_stress: ! |- + -9.1272913010153811e-01 -4.3887362745626044e+00 -3.1967462851505650e+00 1.5302397885103485e+00 -2.6618292754008194e-01 1.1864876982964698e+00 +init_forces: ! |2 + 1 2.4616388624063362e-01 -1.5947862794907725e-01 2.4158041308618994e-01 + 2 1.2587373691239814e-01 -3.1086106971524302e-01 -3.9047323576019743e-01 + 3 -3.0916873457587156e-03 3.9271403557591400e-03 9.9651765169532485e-03 + 4 -2.3426637135086047e-02 -8.1547099824937227e-05 -4.5622030716267553e-02 + 5 -8.2707462633545364e-02 6.6423051063919034e-02 1.2920676385370332e-03 + 6 1.4499840598081187e-01 -4.4588145662847867e-01 -1.8014001026677143e-01 + 7 -2.3245247449394858e-02 8.6094351032624181e-02 3.3413715969444502e-01 + 8 -2.3952197666733896e-01 5.2904463738824992e-01 1.2080573263293189e-01 + 9 2.5060076718488522e-01 -6.7492899232646697e-01 4.2045820528378786e-01 + 10 -2.3681443555748527e-02 3.2832366908848915e-02 -4.4683735351083630e-02 + 11 -1.1855803416493231e-01 1.3616148552232207e-01 -8.0559996962475205e-02 + 12 4.1600093346841371e-01 -8.3284008209525917e-02 2.1993202884144883e-01 + 13 1.6047774922041250e-02 -1.6635865133262272e-02 -2.4824905693915541e-02 + 14 -1.4256250235939441e-01 4.6257423658248351e-02 -4.3301028466927204e-02 + 15 4.7738264597211276e-02 1.9463612376800794e-03 -1.3072823943357331e-01 + 16 -3.9283332520492528e-02 -1.1040249111579925e-01 5.6699221482865637e-02 + 17 -3.9061378852029111e-01 8.5797065656962368e-01 -7.0932578105426569e-01 + 18 8.5370699463348521e-03 4.8416531014014791e-01 -3.4873314462740362e-01 + 19 -2.1142785846284939e-02 -2.8987449428038259e-01 3.3660878877871475e-01 + 20 -6.3045884150468551e-02 -1.7977882907281684e-01 2.6665421255513883e-01 + 21 3.9356840262971697e-02 3.7050595844158568e-01 -4.8103365820912036e-01 + 22 -2.6958252833899450e-03 -1.2419152556966964e-01 2.9910542263083340e-01 + 23 -1.0100240076025478e-01 -1.8246987264743492e-01 2.5970364295545934e-01 + 24 -5.8836856393461763e-02 6.0639131792384215e-01 -3.1555178088372526e-01 + 25 3.3442866778699010e-04 -2.7759222484021373e-01 9.7548995160330526e-02 + 26 -2.0747586693553980e-02 -3.6446571556836688e-01 1.3298474329213145e-01 + 27 -1.7551531704171702e-01 6.6588106276847814e-01 -2.5211663664373374e-01 + 28 1.5473142633686865e-01 -3.3070958116386345e-01 1.7192605646732770e-01 + 29 7.9295234000756817e-02 -3.3696482169090269e-01 7.7692317052364929e-02 +run_vdwl: 0.0865454802879452 +run_coul: 26.3541935677558 +run_stress: ! |- + -9.5966819495319222e-01 -4.3941446226053111e+00 -3.1568771272196665e+00 1.5037730423097684e+00 -3.0350157968660951e-01 1.1569330698181230e+00 +run_forces: ! |2 + 1 2.4521222884076485e-01 -1.6086055657684817e-01 2.3890727709466764e-01 + 2 1.1736624317717813e-01 -3.1162687225181640e-01 -3.8761965478873905e-01 + 3 -2.9397470178107211e-03 3.4449772999398404e-03 9.6382941374364185e-03 + 4 -2.1733581187266381e-02 9.5402025505375446e-05 -4.6004840657874191e-02 + 5 -8.1637509297970243e-02 6.6925993223235142e-02 8.5173732336092829e-04 + 6 1.4189875272902974e-01 -4.4079190202677654e-01 -1.7282627914331100e-01 + 7 -2.0301283658280156e-02 8.1257684149718595e-02 3.2277925765230681e-01 + 8 -2.3176063039570383e-01 5.2671226809675886e-01 1.2053172553853687e-01 + 9 2.4851502997934918e-01 -6.8279100017572170e-01 4.2797251478983028e-01 + 10 -2.4005564061921746e-02 3.2665494506592459e-02 -4.5205317615484117e-02 + 11 -1.1843268179239209e-01 1.3673113110807389e-01 -7.8855615918135114e-02 + 12 4.1597764291342687e-01 -8.1785317044642980e-02 2.1998758510599548e-01 + 13 1.4754826472231841e-02 -1.7373529526282367e-02 -2.4742116546111935e-02 + 14 -1.4296016288807473e-01 4.7016645219744843e-02 -4.1094711597367460e-02 + 15 4.9775572369939805e-02 -3.7100239286285905e-04 -1.3337003405538669e-01 + 16 -3.9452087906060015e-02 -1.1223938303599601e-01 5.6594394612351093e-02 + 17 -3.9249180413714146e-01 8.6969704042383988e-01 -7.1560967422273125e-01 + 18 -6.5582088091562969e-03 4.6994263270377179e-01 -3.2849093510825489e-01 + 19 2.9863411122556297e-03 -2.7345780466997288e-01 3.4516149872881963e-01 + 20 -7.0778225573514611e-02 -1.8121331357752646e-01 2.3808694552706999e-01 + 21 4.2611610529174039e-02 3.5416302876012218e-01 -4.7545752535460878e-01 + 22 1.1514478572165697e-02 -1.1066278566656357e-01 3.0020944221363216e-01 + 23 -1.1773373891969874e-01 -1.8142495094717720e-01 2.5204331681638553e-01 + 24 -6.8821583242620554e-02 6.0915382973282572e-01 -3.2115938333173072e-01 + 25 1.4339999292415251e-02 -2.7422591321865630e-01 1.1162318514453656e-01 + 26 -2.2422826391878561e-02 -3.6755245162965111e-01 1.2917485895331829e-01 + 27 -1.8396738355957404e-01 6.7144647923408374e-01 -2.4138764142052668e-01 + 28 1.6141740622512213e-01 -3.3248921877856086e-01 1.6748278322747401e-01 + 29 7.9626886626010862e-02 -3.4038660496515699e-01 7.0778912894540136e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml new file mode 100644 index 0000000000..8e2c0e3e54 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_cut_soft.yaml @@ -0,0 +1,94 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:23:57 202 +epsilon: 5e-12 +prerequisites: ! | + atom full + pair lj/class2/coul/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/class2/coul/cut/soft 4.0 2.5 6.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: -0.0279568869346605 +init_coul: -16.9131718066612 +init_stress: ! |- + -1.2568075459723569e+00 -4.0978664443210082e+00 -5.7677732235218784e+00 7.9760147162786232e-01 -4.9732737933520765e-01 9.7164487925694876e-02 +init_forces: ! |2 + 1 1.3592997896495729e-01 -1.2424537574516284e-01 2.8998619267758802e-01 + 2 2.4127989974844666e-01 -1.7365607699712368e-01 -5.0805967704212107e-01 + 3 -5.0671136353255819e-04 -4.9025301952775602e-03 7.1229022561792137e-03 + 4 2.8810568506803316e-03 -5.6924092084610009e-03 -5.1208526545922659e-02 + 5 -5.7773611865861038e-02 7.3378609119393812e-02 -9.2291313571032790e-03 + 6 1.6802489632881523e-01 -3.7224273267992691e-01 -1.3362702831201553e-01 + 7 -2.3317680550639208e-02 3.7659493108164147e-02 2.8895703703441755e-01 + 8 -2.2027968269268816e-01 4.4360430781128279e-01 6.0414491418214755e-02 + 9 2.7991714840469500e-01 -6.4364696184668180e-01 4.8967810516939242e-01 + 10 -2.6643559786171986e-02 2.9119971025175450e-02 -2.8635709761832509e-02 + 11 -1.2681897404839046e-01 1.4726619480583428e-01 -6.3314091887318139e-02 + 12 4.4886487644161299e-01 -1.1080124308648688e-01 1.9177998321882522e-01 + 13 -3.3898693529075673e-02 -2.1053466617435276e-02 5.6467046538395647e-03 + 14 -1.6296143302208443e-01 5.5901450877572777e-02 -3.0052266145009301e-02 + 15 3.0735564824038091e-02 5.1458090359104355e-03 -1.1967953299671341e-01 + 16 -6.1099906145121612e-02 -1.0907130648341337e-01 8.7688130251292962e-02 + 17 -4.2167495078495293e-01 8.8255771134776784e-01 -8.0787827442479343e-01 + 18 1.4968990753248204e-01 7.2329581634564599e-01 -4.9024394016091583e-01 + 19 -1.3173762545916162e-01 -4.5273532022170526e-01 2.4178725430191852e-01 + 20 -9.3059619093661838e-02 3.1056361615903649e-02 2.0114149246932414e-01 + 21 9.2324620627764878e-02 -1.8071935961239033e-01 -5.5815830628615526e-01 + 22 -9.0022474258754676e-02 1.5374286810874399e-01 3.1420022857285868e-01 + 23 -7.7401546300495269e-02 -1.8850066260860709e-01 3.2100032764793507e-01 + 24 -1.5822951352824235e-01 5.4306364536733065e-01 2.2687823332715684e-01 + 25 1.3211522022163691e-02 -2.4949105163178814e-01 1.0626911089774560e-01 + 26 9.6122265473982567e-03 -4.3095392559598722e-01 -1.2833943392968106e-01 + 27 -2.8153635630686236e-01 6.4443404010992456e-01 -3.0459961833196159e-01 + 28 1.6087710176599712e-01 -4.2329027587759382e-01 1.9390264301028309e-01 + 29 2.3361353867664425e-01 -2.7922358027060867e-01 2.0657270027457103e-01 +run_vdwl: -0.0279409051337663 +run_coul: -17.8524160178072 +run_stress: ! |- + -1.4291891053500811e+00 -4.7726937336417867e+00 -5.7887863563427944e+00 4.8239023891542065e-01 -4.2708193312429249e-01 3.1857255955017738e-01 +run_forces: ! |2 + 1 1.3698045557692529e-01 -1.2653483822273043e-01 2.9204846991156019e-01 + 2 1.8899632255844270e-01 -2.7138082755827064e-01 -4.7308644826518781e-01 + 3 -5.4658571168653136e-04 -5.2433212171929255e-03 7.1525916086689310e-03 + 4 4.5093813701484742e-03 -5.6467411572141100e-03 -5.2414314790801469e-02 + 5 -5.7062361978861303e-02 7.3862111311376571e-02 -1.0864397490678114e-02 + 6 1.6405697733198579e-01 -3.6641315088054893e-01 -1.3406203920934517e-01 + 7 -2.0630213458580807e-02 3.0720287290657594e-02 2.8346481082220043e-01 + 8 -2.1052323546453777e-01 4.4082735810137930e-01 6.7289207681595853e-02 + 9 2.7654530198393618e-01 -6.5186716940524470e-01 4.9234424978060892e-01 + 10 -2.7286871885132555e-02 2.9149989879862042e-02 -3.0254912036148041e-02 + 11 -1.2705593446949909e-01 1.4860516951130073e-01 -6.2694459702265143e-02 + 12 4.5027781712835890e-01 -1.1004603422341599e-01 1.9604733869615679e-01 + 13 -3.5426864572901326e-02 -2.1365847533075039e-02 4.2996964539162956e-03 + 14 -1.6370959204290966e-01 5.7022288370350574e-02 -2.8945034317939218e-02 + 15 3.2369823106643429e-02 2.7196628107690191e-03 -1.2380653441133911e-01 + 16 -6.3417186454514385e-02 -1.0919492310531859e-01 8.1738272452588134e-02 + 17 -4.2181264882891739e-01 8.9448506895663094e-01 -8.0783672503109427e-01 + 18 1.4058089795576939e-01 7.1643723138047699e-01 -4.6383066879808843e-01 + 19 -1.1070418519442088e-01 -4.4039431386058453e-01 2.4858835314022704e-01 + 20 -1.0225717618341726e-01 2.7839100846041194e-02 1.7205514308984293e-01 + 21 9.4693223912728219e-02 -2.0663484146899153e-01 -5.4533175309275717e-01 + 22 -7.6376677283854139e-02 1.7209997110498060e-01 3.1141478757022478e-01 + 23 -9.2778477816302385e-02 -1.8428237909243911e-01 3.0991369137436953e-01 + 24 -1.6499083071028064e-01 5.3960511982550485e-01 2.2352204481494231e-01 + 25 2.5345593993470028e-02 -2.4336206855244683e-01 1.1694349525743708e-01 + 26 6.7425350744113426e-03 -4.3015751098937594e-01 -1.3335175295659357e-01 + 27 -2.9047808261004182e-01 6.4842554326535384e-01 -2.8849125540639670e-01 + 28 2.1009072477591795e-01 -3.2730215032810456e-01 1.5241918713982527e-01 + 29 2.3386786989712011e-01 -2.8197278505973034e-01 1.9572895571446983e-01 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml new file mode 100644 index 0000000000..7f0100291f --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_class2_coul_long_soft.yaml @@ -0,0 +1,99 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:25:25 202 +epsilon: 5e-12 +prerequisites: ! | + atom full + pair lj/class2/coul/long/soft + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/class2/coul/long/soft 4.0 2.5 6.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: -0.0279568869346605 +init_coul: 26.9521621832406 +init_stress: ! |- + -1.0979342688867924e+00 -4.5861640845557456e+00 -3.4258685036821017e+00 1.5698533700384376e+00 -3.0977826363822086e-01 1.2339097540506174e+00 +init_forces: ! |2 + 1 2.4854455083769370e-01 -1.7645673067862744e-01 2.3144035934888740e-01 + 2 1.2071733182670989e-01 -3.1635427470669947e-01 -3.8601058170897934e-01 + 3 3.9690644393985362e-03 -8.0795595233144335e-03 3.8957282208275669e-03 + 4 -1.6383928356971070e-02 8.5405996746991755e-04 -4.0101456759030034e-02 + 5 -8.0124665845449292e-02 7.8217141483281932e-02 -6.8932905911379752e-03 + 6 1.4543881813680898e-01 -4.4794981200921186e-01 -1.8376415910369384e-01 + 7 -1.0353905564352577e-02 8.5384067126106439e-02 3.6994690621540194e-01 + 8 -2.2326370979706600e-01 5.2991941841045509e-01 1.2153025749799547e-01 + 9 2.5331756884916778e-01 -6.8939137006819040e-01 4.1775092128267149e-01 + 10 -2.6669741302926885e-02 3.4168045229501745e-02 -3.9073358860316112e-02 + 11 -1.1990359987471731e-01 1.4247109655639389e-01 -7.5395025419480316e-02 + 12 3.9604857002737098e-01 -8.4530031123850546e-02 2.2827286251388235e-01 + 13 1.0634469508568917e-02 -1.3485622285277917e-02 -2.5474018144612913e-02 + 14 -1.4128376939902654e-01 4.6738775954182757e-02 -3.8352490424791490e-02 + 15 4.8572882034172607e-02 -5.0576168661936741e-03 -1.3446651212334287e-01 + 16 -4.9128565063490434e-02 -9.9370652777369839e-02 6.0717721877563392e-02 + 17 -3.9961640506886942e-01 8.8097371011860670e-01 -7.5010088146431109e-01 + 18 1.0310656032279845e-02 4.9594998756095682e-01 -3.7847864401306447e-01 + 19 -1.2796991707713021e-02 -2.8742123400015113e-01 3.5388587368822871e-01 + 20 -7.3304884813828797e-02 -1.9239408831583721e-01 2.7978086996999058e-01 + 21 4.8503721479407069e-02 3.8164989857466419e-01 -5.1397368605741378e-01 + 22 4.8486699895596659e-03 -1.2449604861696668e-01 3.2035050216495248e-01 + 23 -1.1731254607650360e-01 -1.9384196948964297e-01 2.7105494102433980e-01 + 24 -6.4975367446142046e-02 6.3674181716477229e-01 -3.3158049872499690e-01 + 25 1.4602100392704764e-02 -2.8571022759229037e-01 1.1186561087328276e-01 + 26 -2.8807097995783609e-02 -3.8630367744224536e-01 1.3541587823280968e-01 + 27 -1.8097814888562413e-01 6.9820913337890733e-01 -2.6340710165001457e-01 + 28 1.7042543108693975e-01 -3.4356300367399606e-01 1.8420405608797991e-01 + 29 6.8969492557682449e-02 -3.5687123235543355e-01 7.6959216046372347e-02 +run_vdwl: -0.0279418173888648 +run_coul: 26.8201360341214 +run_stress: ! |- + -1.1474158179052636e+00 -4.5913254242436174e+00 -3.3846887285760752e+00 1.5415499440939435e+00 -3.4927879486424995e-01 1.2022024524829980e+00 +run_forces: ! |2 + 1 2.4785371424044841e-01 -1.7744585501409318e-01 2.2908622448585458e-01 + 2 1.1208574586184081e-01 -3.1728948196584505e-01 -3.8331129955499721e-01 + 3 3.8672958174749885e-03 -8.4638290562189036e-03 3.6804944393340226e-03 + 4 -1.4908210107554554e-02 9.1263670694041396e-04 -4.0582807546513638e-02 + 5 -7.9010469883058737e-02 7.8655044199497925e-02 -7.3456373321684771e-03 + 6 1.4210275150117604e-01 -4.4262469999273130e-01 -1.7622693840330184e-01 + 7 -7.3671818618165526e-03 8.0461163251868140e-02 3.5812783086127464e-01 + 8 -2.1486667164805373e-01 5.2760625595983124e-01 1.2123697649482454e-01 + 9 2.5120326346302924e-01 -6.9738854073180823e-01 4.2544264553181460e-01 + 10 -2.6981423578011067e-02 3.3823491926006359e-02 -3.9727627882606691e-02 + 11 -1.1971285966868087e-01 1.4299991947654064e-01 -7.3606567838715942e-02 + 12 3.9616115191218104e-01 -8.2973575600471777e-02 2.2840969062553673e-01 + 13 9.2089010152039304e-03 -1.4357807115272092e-02 -2.5374002351636657e-02 + 14 -1.4164933289091716e-01 4.7606633868259293e-02 -3.6053447515452981e-02 + 15 5.0466515663197861e-02 -7.5407233516649854e-03 -1.3717507875786389e-01 + 16 -4.9282386378155150e-02 -1.0120792510703974e-01 6.0585078104901109e-02 + 17 -4.0162649553783158e-01 8.9288816584113617e-01 -7.5654097850534352e-01 + 18 -6.2166126605120312e-03 4.8017772312820972e-01 -3.5714456173358294e-01 + 19 1.2477034771840437e-02 -2.6997050692373975e-01 3.6280081675592402e-01 + 20 -8.0743209253462581e-02 -1.9332415162158362e-01 2.4973921501054613e-01 + 21 5.1979772871987143e-02 3.6464922171365610e-01 -5.0824928062082519e-01 + 22 1.9787748090259981e-02 -1.1037985730200084e-01 3.2157468867319638e-01 + 23 -1.3498574986299636e-01 -1.9274302053604020e-01 2.6311576355618921e-01 + 24 -7.5570051489166040e-02 6.3995557872087350e-01 -3.3757635738253905e-01 + 25 2.9520715443940637e-02 -2.8218957231969999e-01 1.2674950009258862e-01 + 26 -3.0757842125759015e-02 -3.8997146868550769e-01 1.3123703696619110e-01 + 27 -1.8994396856382390e-01 7.0415663122604488e-01 -2.5223088765765900e-01 + 28 1.7757264890985036e-01 -3.4548880985210345e-01 1.7971077337889108e-01 + 29 6.9335205947368736e-02 -3.6053264084304387e-01 6.9648738106139821e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml new file mode 100644 index 0000000000..efcd2dc1c8 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_class2_soft.yaml @@ -0,0 +1,93 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:22:39 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/class2/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/class2/soft 4.0 2.5 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 +natoms: 29 +init_vdwl: -0.0279568869346605 +init_coul: 0 +init_stress: ! |- + -2.3558296880624573e-02 -3.1200547290628957e-02 -1.9188671794609813e-02 3.4329076865322054e-03 4.7001698327135471e-03 3.7471627607295757e-03 +init_forces: ! |2 + 1 2.9473075631550882e-03 -1.6255700663301358e-03 -5.2078154667030906e-04 + 2 4.0489030919855114e-05 -1.4269144053835934e-04 3.9025585349759400e-07 + 3 2.5758045073252263e-04 4.6086031362977455e-04 6.6773464139615278e-04 + 4 2.6422006456248031e-05 -8.0558332158881478e-05 -1.2300283965365647e-05 + 5 3.7611311413488783e-05 -8.4873441246067867e-05 -1.5530131125571422e-05 + 6 3.6095683860856084e-03 -1.7486968074908985e-03 -3.8972241885575814e-04 + 7 1.6446348563533234e-03 1.1579935219391674e-03 -7.5406936315700773e-04 + 8 -1.7878960179904802e-03 2.1084680204541484e-03 1.2022913387082842e-03 + 9 1.1463237890232251e-05 1.0167607479406362e-04 -2.8136850262040211e-05 + 10 -1.3840404917041078e-03 1.0799471876661610e-03 -1.5473762872850922e-03 + 11 -1.5156846998994986e-05 2.4510475528695519e-05 -6.4420831064977764e-05 + 12 -1.1633040841691961e-03 1.1503516490156528e-03 -3.8359142472219163e-04 + 13 -1.7021927298992298e-04 -4.4198928654632589e-05 4.6446059108627459e-05 + 14 -1.0907268128202476e-04 -1.5406433729280831e-06 1.4148437672412327e-04 + 15 -1.7099402826189602e-04 -5.1239208334626272e-05 -1.7925523292564315e-05 + 16 6.1081389200175066e-05 3.4753249449512503e-04 -6.8274711842839463e-04 + 17 -5.2609659924428840e-04 4.2588291959557925e-04 4.0287820827044176e-04 + 18 -2.1518617687082691e-03 -3.7262380141849833e-03 3.2399849104654496e-03 + 19 5.8594989715668837e-05 1.8209855098346695e-05 9.9027683554507213e-05 + 20 -8.9782508946392153e-05 -8.9301374525416910e-05 1.4413535313341869e-05 + 21 -9.0841708053557963e-04 1.0105630967097833e-03 9.8153414192552716e-04 + 22 7.2704098589308782e-05 4.9764660203691873e-05 4.6627089035048905e-05 + 23 -9.3407695705731599e-05 -2.5704944417954180e-05 -2.3730804039168847e-05 + 24 -9.4237055526872151e-04 -9.3190972590857942e-04 -1.8453045962420994e-03 + 25 2.2630691257975006e-05 -2.6796595925244310e-06 -5.4219388319802465e-05 + 26 -8.0393940672050156e-05 -4.8391396569057105e-05 -5.4841140734280125e-05 + 27 7.7740979900039434e-04 6.3935242647477069e-04 -4.2466184497333940e-04 + 28 8.3048734749811267e-05 3.1248528966866243e-05 3.0822826083793829e-05 + 29 -5.7532973042045847e-05 -2.7672412467805212e-06 -5.4275513300832731e-05 +run_vdwl: -0.0279415055756731 +run_coul: 0 +run_stress: ! |- + -2.3600292753029325e-02 -3.1234050931138665e-02 -1.9247707998720477e-02 3.4602601994415398e-03 4.7405330909736755e-03 3.7183453784611869e-03 +run_forces: ! |2 + 1 2.9461191709398626e-03 -1.6186860870491483e-03 -5.1694945479188422e-04 + 2 3.7466792722222388e-05 -1.4468218886644094e-04 1.3966909511272580e-06 + 3 2.7812682065410350e-04 4.4590913552799971e-04 6.4297819899768952e-04 + 4 2.4050654370892218e-05 -8.0122099814915152e-05 -1.4106363870070515e-05 + 5 3.7711409385897576e-05 -8.6020820506596226e-05 -1.3836806910756170e-05 + 6 3.6161040572478685e-03 -1.7641009232103740e-03 -3.9803999549915939e-04 + 7 1.6483463512744548e-03 1.1735896532072284e-03 -7.4165852183726575e-04 + 8 -1.8112412873781628e-03 2.1293568387560796e-03 1.2020232557053414e-03 + 9 1.2165248590554398e-05 1.0314413172020949e-04 -2.9748405733251166e-05 + 10 -1.3878814217341794e-03 1.0879706557175700e-03 -1.5462313770384457e-03 + 11 -1.1037554785516019e-05 2.5021131368802229e-05 -6.3131363381438603e-05 + 12 -1.1725161490596422e-03 1.1384318353601138e-03 -3.8599172950790680e-04 + 13 -1.6975841674364453e-04 -4.6039739151595695e-05 4.7451253324091769e-05 + 14 -1.1134529086303964e-04 -4.8074818305833470e-06 1.3832458683156625e-04 + 15 -1.6952425285043099e-04 -4.2877320396484933e-05 -1.4773108759162220e-05 + 16 6.7683902185082333e-05 3.4097779564949937e-04 -6.7940593957424556e-04 + 17 -5.1814120369824670e-04 4.2027922253817785e-04 4.0213091794390996e-04 + 18 -2.1575585922524914e-03 -3.7329276272613015e-03 3.2518676518168339e-03 + 19 5.0502840332106572e-05 1.1303158602344533e-05 9.8730624731965594e-05 + 20 -7.9576904730036045e-05 -8.0665940949843258e-05 1.5122535874939930e-05 + 21 -9.1010799612846591e-04 1.0159537501040340e-03 9.8400919688341072e-04 + 22 7.0646668921940504e-05 4.8270837688354870e-05 4.5452488640379622e-05 + 23 -9.1426907720905685e-05 -2.4058421983277910e-05 -2.2344225963570847e-05 + 24 -9.4400600934426814e-04 -9.3196178272884574e-04 -1.8471362495367906e-03 + 25 2.5888590079299666e-05 1.0168705295242309e-06 -5.1182885649010081e-05 + 26 -8.3683807999153389e-05 -5.1555698330583508e-05 -5.7697602296658660e-05 + 27 7.7778199020865526e-04 6.3924465276693704e-04 -4.2417803977789494e-04 + 28 8.4537818527806631e-05 3.1881437318165007e-05 3.2032875559797422e-05 + 29 -5.9326520152563993e-05 -3.8449747750497481e-06 -5.5108207133542701e-05 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml new file mode 100644 index 0000000000..bf33642d40 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_cut_soft.yaml @@ -0,0 +1,94 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:15:05 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/cut/coul/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/cut/coul/cut/soft 4.0 2.5 6.4 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: 0.0869868307797999 +init_coul: -16.721880512059 +init_stress: ! |- + -1.0613573795549203e+00 -3.8839205137835902e+00 -5.5134910841142846e+00 7.5801818987704728e-01 -4.5644823344739416e-01 4.8871441509553137e-02 +init_forces: ! |2 + 1 1.3301449452185465e-01 -1.0655197491427448e-01 3.0067616789804325e-01 + 2 2.4667817836002159e-01 -1.6790770289694051e-01 -5.1256488740868278e-01 + 3 -7.5491502745029682e-03 7.2105583284790631e-03 1.3188341267198700e-02 + 4 -4.3150767873698925e-03 -6.8536496606041407e-03 -5.6663663037660982e-02 + 5 -6.0423179280680916e-02 6.1083090087391920e-02 -1.0920315921668991e-03 + 6 1.6550266524104881e-01 -3.6904989434000041e-01 -1.2540485919012140e-01 + 7 -3.4880846593007553e-02 3.7777080088750636e-02 2.5038812099526375e-01 + 8 -2.3586022374717203e-01 4.4275889608408880e-01 5.7118091154704148e-02 + 9 2.7651364211263241e-01 -6.2867220051208328e-01 4.9240063377232079e-01 + 10 -2.3350810988213653e-02 2.7224677829616142e-02 -3.4013520354698040e-02 + 11 -1.2509208145665296e-01 1.4033844392410574e-01 -6.8104764936649645e-02 + 12 4.6777417858309556e-01 -1.0827515107210416e-01 1.8267966210204112e-01 + 13 -2.8307440290696897e-02 -2.4491430410129817e-02 6.4494114072639122e-03 + 14 -1.6375953775323787e-01 5.5064007515157123e-02 -3.5025349297420350e-02 + 15 3.0147433796891054e-02 1.2086358887115671e-02 -1.1561719947098127e-01 + 16 -4.9860240119952083e-02 -1.2140633359484271e-01 7.9673514139239524e-02 + 17 -4.1367013823156096e-01 8.6023245236899437e-01 -7.6238198162901716e-01 + 18 1.4743239696176103e-01 7.0816952411423151e-01 -4.5392462688042062e-01 + 19 -1.4060759222800723e-01 -4.5401137506458245e-01 2.2074810268978753e-01 + 20 -8.1709436622194931e-02 4.5390287460576370e-02 1.8488185099146931e-01 + 21 8.1827535546651786e-02 -1.9415330808316492e-01 -5.1885885171043933e-01 + 22 -9.7673967367890718e-02 1.5455840468962617e-01 2.8924600008297519e-01 + 23 -5.9372370218819318e-02 -1.7529518275878075e-01 3.0673265127894611e-01 + 24 -1.5065519915041178e-01 5.0634472366755789e-01 2.4586148490100962e-01 + 25 -2.5246557004812709e-03 -2.3877422496293441e-01 8.9799760942697704e-02 + 26 1.7957561632082175e-02 -4.0515259141354909e-01 -1.3173207377587212e-01 + 27 -2.7476246020103456e-01 6.0493120625631469e-01 -2.9064786520929453e-01 + 28 1.4347513760734865e-01 -4.0704325460185131e-01 1.7976862032283397e-01 + 29 2.4405118264850023e-01 -2.5553143701616343e-01 2.0641926054763102e-01 +run_vdwl: 0.0864716901746354 +run_coul: -17.6587395670533 +run_stress: ! |- + -1.2310312129721028e+00 -4.5583725028040067e+00 -5.5364023232766897e+00 4.4511499980738989e-01 -3.8421601156790053e-01 2.7245801051758678e-01 +run_forces: ! |2 + 1 1.3377812535034600e-01 -1.0924552244195854e-01 3.0239582004374232e-01 + 2 1.9460749443182726e-01 -2.6531388283407620e-01 -4.7746130828464767e-01 + 3 -7.3347251089237678e-03 6.7726180164356786e-03 1.3105788420142546e-02 + 4 -2.4720968172563737e-03 -6.6869065041733379e-03 -5.7765308408484296e-02 + 5 -5.9754628828893659e-02 6.1630076614972391e-02 -2.7107215069287413e-03 + 6 1.6177650967868279e-01 -3.6344034648305823e-01 -1.2604556810786538e-01 + 7 -3.2239571524180818e-02 3.0913302936171783e-02 2.4534996491066566e-01 + 8 -2.2676583476715423e-01 4.3995105114930455e-01 6.3973199849776202e-02 + 9 2.7319683986147475e-01 -6.3675023590992430e-01 4.9490604677475736e-01 + 10 -2.4007119482593237e-02 2.7432938158340029e-02 -3.5492353767146795e-02 + 11 -1.2539511829806502e-01 1.4171637355869635e-01 -6.7569520102284536e-02 + 12 4.6905278568502473e-01 -1.0758310955374528e-01 1.8684895409281049e-01 + 13 -2.9697664050240720e-02 -2.4665398443543356e-02 5.0886376051148818e-03 + 14 -1.6454344876677607e-01 5.6073213873294614e-02 -3.4014308973892751e-02 + 15 3.1922038230522476e-02 9.8295314721195057e-03 -1.1966470952487746e-01 + 16 -5.2189856602250576e-02 -1.2154014338234553e-01 7.3781930151778169e-02 + 17 -4.1368004335324016e-01 8.7196340075264467e-01 -7.6220547504382663e-01 + 18 1.3959047510496031e-01 7.0273728786051104e-01 -4.2880450213821364e-01 + 19 -1.2073764490270647e-01 -4.4273905993924212e-01 2.2727648381069462e-01 + 20 -9.1024270602754434e-02 4.1820961074671939e-02 1.5737208729124524e-01 + 21 8.4018567420766091e-02 -2.1919260947637767e-01 -5.0638967445418503e-01 + 22 -8.4808406581946549e-02 1.7222319120223384e-01 2.8644210773617212e-01 + 23 -7.3803722181464818e-02 -1.7123414848426477e-01 2.9603622690956416e-01 + 24 -1.5687511678945418e-01 5.0269183876489443e-01 2.4272556319363958e-01 + 25 8.7949907645514802e-03 -2.3291170111515980e-01 9.9768489166636165e-02 + 26 1.5326708047237462e-02 -4.0392869905991208e-01 -1.3631522337860857e-01 + 27 -2.8313881941350294e-01 6.0861991277426597e-01 -2.7516392301985793e-01 + 28 1.9217325598129187e-01 -3.1106027014648929e-01 1.3846948667801418e-01 + 29 2.4423029751471897e-01 -2.5808366443428632e-01 1.9606181007606516e-01 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml new file mode 100644 index 0000000000..39531339e9 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml @@ -0,0 +1,99 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:17:39 202 +epsilon: 7.5e-14 +prerequisites: ! | + atom full + pair lj/cut/coul/long/soft + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/cut/coul/long/soft 4.0 2.5 6.4 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 +natoms: 29 +init_vdwl: 0.0869868307797999 +init_coul: 26.4864428259304 +init_stress: ! |- + -9.1249731153318292e-01 -4.3877814604377434e+00 -3.1965493449598563e+00 1.5303690111499872e+00 -2.6633522920029479e-01 1.1862474435756334e+00 +init_forces: ! |2 + 1 2.4618266047458193e-01 -1.5940382283204185e-01 2.4155558227003238e-01 + 2 1.2587373850932029e-01 -3.1086105734708708e-01 -3.9047324262793526e-01 + 3 -3.0916873457587156e-03 3.9271403557591400e-03 9.9651765169532485e-03 + 4 -2.3426637135086047e-02 -8.1547099824937227e-05 -4.5622030716267553e-02 + 5 -8.2707462633545364e-02 6.6423051063919034e-02 1.2920676385370332e-03 + 6 1.4499775649930524e-01 -4.4588100280615017e-01 -1.8013970031681140e-01 + 7 -2.3245247559378984e-02 8.6094350835233757e-02 3.3413715941578892e-01 + 8 -2.3952197666733896e-01 5.2904463738824992e-01 1.2080573263293189e-01 + 9 2.5060076718488522e-01 -6.7492899232646697e-01 4.2045820528378786e-01 + 10 -2.3681443555748527e-02 3.2832366908848915e-02 -4.4683735351083630e-02 + 11 -1.1855812995113742e-01 1.3615969534588498e-01 -8.0561752772585357e-02 + 12 4.1602792670751687e-01 -8.3263145109828740e-02 2.1991194176357087e-01 + 13 1.6047767336155483e-02 -1.6635876713420081e-02 -2.4824906607395784e-02 + 14 -1.4256154796361231e-01 4.6258233384598231e-02 -4.3302042420722817e-02 + 15 4.7739057339461530e-02 1.9471508707134214e-03 -1.3072877777230024e-01 + 16 -3.9283342548712775e-02 -1.1040439854455730e-01 5.6699486568109955e-02 + 17 -3.9061378850130118e-01 8.5797065624286728e-01 -7.0932578071344110e-01 + 18 8.5212146330866934e-03 4.8420593893541936e-01 -3.4873254041374008e-01 + 19 -2.1144305898188220e-02 -2.8987251174401180e-01 3.3660765973885881e-01 + 20 -6.3046427794922519e-02 -1.7978003010661606e-01 2.6665057939597281e-01 + 21 3.9374535730357089e-02 3.7046537987975325e-01 -4.8103394696804652e-01 + 22 -2.6958113185458635e-03 -1.2419152480994021e-01 2.9910542026273873e-01 + 23 -1.0100173860966864e-01 -1.8247034601884243e-01 2.5970333402276663e-01 + 24 -5.8835572288822330e-02 6.0639529336859066e-01 -3.1554602852243341e-01 + 25 3.3443695220869429e-04 -2.7759220302422605e-01 9.7548995925899690e-02 + 26 -2.0747595243037077e-02 -3.6446483968192489e-01 1.3298520952659346e-01 + 27 -1.7556081111367022e-01 6.6578706971019974e-01 -2.5207147463850749e-01 + 28 1.5472943489635349e-01 -3.3071284636771298e-01 1.7192732481352638e-01 + 29 7.9294229865242635e-02 -3.3696681975738607e-01 7.7692084065202061e-02 +run_vdwl: 0.0864714816774496 +run_coul: 26.3541936197395 +run_stress: ! |- + -9.5943500509065494e-01 -4.3931838814803301e+00 -3.1566818906460279e+00 1.5039013339900946e+00 -3.0365435646198807e-01 1.1566928612390874e+00 +run_forces: ! |2 + 1 2.4523107562386903e-01 -1.6078569028728237e-01 2.3888244638374972e-01 + 2 1.1736624438051382e-01 -3.1162685052999267e-01 -3.8761966142324977e-01 + 3 -2.9397469229226845e-03 3.4449773659216186e-03 9.6382943011141982e-03 + 4 -2.1733581870825226e-02 9.5402178044510307e-05 -4.6004841478389714e-02 + 5 -8.1637510267219243e-02 6.6925991791127043e-02 8.5173798023068827e-04 + 6 1.4189806429437651e-01 -4.4079142217864081e-01 -1.7282595371707801e-01 + 7 -2.0301280063735605e-02 8.1257685497630808e-02 3.2277925971411670e-01 + 8 -2.3176063002636704e-01 5.2671227056062875e-01 1.2053172498561873e-01 + 9 2.4851503392872357e-01 -6.8279100291337380e-01 4.2797251627008076e-01 + 10 -2.4005564262187033e-02 3.2665494018744010e-02 -4.5205317316130401e-02 + 11 -1.1843278168067750e-01 1.3672928500970477e-01 -7.8857426677346534e-02 + 12 4.1600468540510127e-01 -8.1764456207382624e-02 2.1996745968645920e-01 + 13 1.4754680963957358e-02 -1.7373619613073755e-02 -2.4742031226991913e-02 + 14 -1.4295920510708943e-01 4.7017453379342669e-02 -4.1095731310254784e-02 + 15 4.9776498137740523e-02 -3.7008089405950011e-04 -1.3337066092899458e-01 + 16 -3.9452099323863399e-02 -1.1224129478450499e-01 5.6594683739796946e-02 + 17 -3.9249180832888381e-01 8.6969704011923854e-01 -7.1560967522838825e-01 + 18 -6.5742744649267340e-03 4.6998380753213276e-01 -3.2849033116391196e-01 + 19 2.9847873425093764e-03 -2.7345575965390795e-01 3.4516019021230460e-01 + 20 -7.0778812687921133e-02 -1.8121462217481474e-01 2.3808324070557918e-01 + 21 4.2629583866925107e-02 3.5412196658243855e-01 -4.7545781642782881e-01 + 22 1.1514494215742289e-02 -1.1066279119021936e-01 3.0020943897738017e-01 + 23 -1.1773303656546849e-01 -1.8142545543954808e-01 2.5204299074099740e-01 + 24 -6.8820300407286955e-02 6.0915783855578642e-01 -3.2115334328347539e-01 + 25 1.4340007371772712e-02 -2.7422588777471385e-01 1.1162318382843600e-01 + 26 -2.2422836566002184e-02 -3.6755159816117794e-01 1.2917531556408018e-01 + 27 -1.8401296920116900e-01 6.7135246775402002e-01 -2.4134247472235965e-01 + 28 1.6141537749494994e-01 -3.3249258592595410e-01 1.6748408084762209e-01 + 29 7.9625904720364071e-02 -3.4038856261611400e-01 7.0778700966832864e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml new file mode 100644 index 0000000000..bad77cd710 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml @@ -0,0 +1,92 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:12:05 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair lj/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: lj/cut/soft 4 6.0 8.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.005 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 +natoms: 29 +init_vdwl: -0.0428396313094945 +init_coul: 0 +init_stress: ! |- + -3.7150294178485088e-02 -4.4269784260765020e-02 -3.3385877908707000e-02 3.9789543272128278e-03 1.2200860941829079e-02 5.0820551468292834e-03 +init_forces: ! |2 + 1 4.9224162524551477e-03 2.8291375761555464e-04 6.2921883367334115e-04 + 2 1.7272698038469888e-05 -1.1415851814696374e-03 -5.2312656177721988e-06 + 3 1.4264025019128102e-03 1.0670241246148614e-03 8.8823185996196792e-04 + 4 -1.5351582371946068e-04 -6.6464966374252938e-04 -5.2747022361288671e-04 + 5 4.2651282018340729e-04 -1.7751836672482975e-03 9.8138832433461003e-05 + 6 4.3197974448043411e-03 -1.3553385964794743e-03 -1.3373791140605681e-04 + 7 4.3589904051316976e-04 9.2466450350160115e-04 -1.6552397633194191e-03 + 8 -2.1083557855005497e-03 3.6409278802919209e-03 -9.8323436709351090e-04 + 9 -1.1703129917679830e-04 4.1134378010949257e-04 -9.7055655087463846e-04 + 10 8.6106886415306702e-04 1.4154833814180021e-03 -1.2696443501403409e-03 + 11 3.2589582731943652e-04 5.0580076521930631e-05 -1.0017587887941793e-04 + 12 -7.1123025510864578e-04 1.0007821424977271e-03 2.3552928880589524e-04 + 13 -8.4725202507300612e-04 -5.5420138607068046e-04 4.7878510903822562e-04 + 14 -1.3737975460143903e-03 -1.5855292841502049e-04 1.2088359918586715e-03 + 15 -1.3520114228393171e-03 -1.8662678991490016e-04 2.9161125371913917e-04 + 16 -4.0093144958594642e-04 8.2601667166526827e-04 -1.4339054243482222e-03 + 17 -6.6674449131672443e-04 3.0050765302101507e-04 8.3850599216460841e-04 + 18 -2.7837913646803583e-03 -5.0375159218276058e-03 4.5434665115820254e-03 + 19 4.6855856198187366e-05 -4.5245890977836599e-05 2.8737799426088435e-04 + 20 -1.5950612939602811e-04 -1.6443955238598627e-04 6.3034524618327722e-05 + 21 -1.5545638660773022e-03 1.7249552099503390e-03 1.7682539203786847e-03 + 22 3.5872282225024178e-05 7.4026897323901746e-05 -9.8287608927810396e-06 + 23 -6.1795224018303338e-05 3.0466099928041098e-05 -4.9779152596896726e-05 + 24 -1.3080854318081583e-03 -1.5329920425676952e-03 -2.6335396655026966e-03 + 25 -3.7697708475401746e-04 -1.9022048335981935e-04 -7.2640697457896264e-04 + 26 -9.2571330695605020e-05 1.3904158824119836e-06 -1.1513624972069054e-04 + 27 1.1801272518921629e-03 8.4343877491515880e-04 -6.0291518540734278e-04 + 28 5.0297112779360527e-05 9.5876022121673079e-05 -2.0039893686618438e-05 + 29 1.9742577290027754e-05 1.1615471308058326e-04 -9.4148494816978075e-05 +run_vdwl: -0.0427945069849374 +run_coul: 0 +run_stress: ! |- + -3.7077026602753520e-02 -4.4304571891824726e-02 -3.3438830487491980e-02 4.0619773242517527e-03 1.2107484872063253e-02 5.0087996826964397e-03 +run_forces: ! |2 + 1 4.8779602458416489e-03 2.4167235416423243e-04 5.8194904228117369e-04 + 2 3.8219046216389241e-06 -1.1278571464746119e-03 -5.3194108737420112e-06 + 3 1.4420451326719666e-03 1.0789598971605156e-03 8.6688922192258515e-04 + 4 -1.1974684890799616e-04 -6.3663796799752221e-04 -5.0434813898866634e-04 + 5 4.1926845981048714e-04 -1.7686339999561645e-03 1.0539619591224379e-04 + 6 4.3576972844038084e-03 -1.3882149719460883e-03 -1.3616194080329750e-04 + 7 4.5212058755108350e-04 9.3883355301563895e-04 -1.6310591540156755e-03 + 8 -2.2302146046123414e-03 3.5790324521175637e-03 -9.7121760766989782e-04 + 9 -1.0550533635039201e-04 4.0156054939886621e-04 -9.5829490460631883e-04 + 10 8.5916672576631214e-04 1.4337462634341999e-03 -1.2745681621108272e-03 + 11 3.2696648572825849e-04 6.3517034152612753e-05 -1.0047641759833470e-04 + 12 -7.4690432551832698e-04 9.7559633855103531e-04 2.3309081974175655e-04 + 13 -8.1087278313617030e-04 -5.4431538064706191e-04 4.6238493027678620e-04 + 14 -1.3616269035648270e-03 -1.6114550030841903e-04 1.1930419316555066e-03 + 15 -1.2988356048942603e-03 -1.3783875198096138e-04 2.7166385519536635e-04 + 16 -4.0216418867975449e-04 8.2820608601573767e-04 -1.4197354103451449e-03 + 17 -6.5426067848996087e-04 2.9465377932046420e-04 8.4324801540805201e-04 + 18 -2.7890073788538919e-03 -5.0435458655068259e-03 4.5580195167431404e-03 + 19 3.3464587924712261e-05 -5.7671397258467865e-05 2.9174099395921818e-04 + 20 -1.4410679478107482e-04 -1.5109108725904223e-04 6.3206967430658374e-05 + 21 -1.5562595549768990e-03 1.7392533542833746e-03 1.7660916000341450e-03 + 22 3.3036353864837681e-05 7.1080653361986140e-05 -7.6107800450805168e-06 + 23 -6.1088350185363964e-05 2.9256205868140015e-05 -4.5685106771347217e-05 + 24 -1.3147368971916822e-03 -1.5225200528371987e-03 -2.6445898558296044e-03 + 25 -3.5875110481443001e-04 -1.8006883640044865e-04 -7.0409438339007896e-04 + 26 -1.0135572040521528e-04 -9.8728435343067203e-06 -1.1820795924276317e-04 + 27 1.1809009905794216e-03 8.4667862926581135e-04 -6.0614495192442251e-04 + 28 5.4684599143430459e-05 9.5202149420063522e-05 -1.5520338657392948e-05 + 29 1.4303717454981147e-05 1.1216450257687707e-04 -9.3688567688039523e-05 +... diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml new file mode 100644 index 0000000000..254b45b510 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml @@ -0,0 +1,106 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:19:13 202 +epsilon: 1e-13 +prerequisites: ! | + atom full + pair lj/cut/tip4p/long/soft + kspace pppm/tip4p +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style pppm/tip4p 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: lj/cut/tip4p/long/soft 5 2 5 1 0.15 4.0 2.5 6.4 10.0 +pair_coeff: ! | + 1 1 0.02 2.5 0.64 + 2 2 0.0 1.0 0.64 + 2 4 0.005 0.5 0.64 + 3 3 0.02 3.2 0.64 + 4 4 0.015 3.1 0.64 + 5 5 0.015 3.1 0.64 +extract: ! | + epsilon 2 + sigma 2 + lambda 2 + cut_coul 0 + qdist 0 + typeO 0 + typeH 0 + typeA 0 + typeB 0 +natoms: 29 +init_vdwl: 0.0532418429363291 +init_coul: 25.1120046635773 +init_stress: ! |- + -1.1823845649927931e+00 -4.2392955721273395e+00 -3.0504224276732574e+00 1.3375722516580166e+00 -4.6999744312072966e-01 1.0363313128899019e+00 +init_forces: ! |2 + 1 2.2512096861770253e-01 -1.8740688078761694e-01 2.2052104900950886e-01 + 2 1.3173879266315808e-01 -3.0359264792129725e-01 -3.7090396697507122e-01 + 3 -1.0124603249607161e-02 3.5759536187944005e-03 1.1914742158738412e-02 + 4 -1.6174724330874829e-02 5.7365694343645306e-04 -3.9211679509312800e-02 + 5 -8.0384042907259701e-02 7.5435110635929878e-02 -6.5961708013806486e-03 + 6 1.3845160760155500e-01 -4.4881943529922014e-01 -1.7623589680851853e-01 + 7 -2.0701399583871505e-02 8.6382491102116030e-02 3.3190977616586281e-01 + 8 -2.2522995294845549e-01 5.3080940562691481e-01 1.1939264212236009e-01 + 9 2.4031945302819147e-01 -6.8341582181422422e-01 4.1191614908293128e-01 + 10 -2.8862978640523868e-02 3.0952590892756097e-02 -4.7641493042652042e-02 + 11 -1.2380846128110251e-01 1.4508525874750464e-01 -7.3513647803193471e-02 + 12 4.2350540832056610e-01 -8.8245613455054633e-02 2.1714097156647225e-01 + 13 1.1089241136062949e-02 -6.7703554742952910e-03 -2.6252357900869543e-02 + 14 -1.3915725295918299e-01 4.7623575951359652e-02 -4.0720822445464842e-02 + 15 4.7691737741476760e-02 -2.8484486688170035e-03 -1.3331698904199077e-01 + 16 -6.5720839951842080e-02 -9.5720083669349740e-02 8.3404349975140860e-02 + 17 -3.6848559949347010e-01 8.6366272148906253e-01 -7.1321686785098026e-01 + 18 8.3610843147371369e-03 4.8341177598296525e-01 -3.5186167592372880e-01 + 19 -2.0989444325957580e-02 -2.8996329236732543e-01 3.3842448506500600e-01 + 20 -6.2897495577854026e-02 -1.8216250555647226e-01 2.6861492030483108e-01 + 21 2.6667761816071455e-02 2.4610772454403823e-01 -3.1483931015868893e-01 + 22 1.0695109869553227e-01 -2.8187422421879341e-02 2.4837146666322471e-01 + 23 -1.8131317693295523e-01 -1.7012181853891384e-01 1.2626515451131032e-01 + 24 -2.2408122810289834e-02 4.0182710900117258e-01 -1.9972843596474568e-01 + 25 7.2496306885383888e-02 -1.2398014854290455e-01 8.9356605678754406e-02 + 26 -1.1843155896821461e-01 -3.0524787880164289e-01 3.2179839155708233e-02 + 27 -1.2560375316578029e-01 4.3585239984075247e-01 -1.6791098393172349e-01 + 28 2.1929824730708886e-01 -1.8521499231588329e-01 1.7256183204536221e-01 + 29 -4.1398301000284597e-02 -2.4960242874190633e-01 -1.0023685346890519e-02 +run_vdwl: 0.0528000604213919 +run_coul: 25.020401368015 +run_stress: ! |- + -1.2152682106213510e+00 -4.2383992440977636e+00 -3.0137001241100956e+00 1.3161599582310535e+00 -5.0255833152626950e-01 1.0102620792386101e+00 +run_forces: ! |2 + 1 2.2521603387743647e-01 -1.8768935702268316e-01 2.1886000788395826e-01 + 2 1.2340816471539112e-01 -3.0369376464518449e-01 -3.6875522119889853e-01 + 3 -9.9864462701352245e-03 2.9690554208496008e-03 1.1524202877801546e-02 + 4 -1.4728603073137763e-02 6.2827922080486195e-04 -3.9702747729673617e-02 + 5 -7.9292408907535597e-02 7.5862894949764198e-02 -7.0207335780499598e-03 + 6 1.3538119212001773e-01 -4.4364841265574684e-01 -1.6906101357078565e-01 + 7 -1.7710564831626134e-02 8.1461218390717835e-02 3.2061074065082196e-01 + 8 -2.1733155328519646e-01 5.2862513141878864e-01 1.1907694319246311e-01 + 9 2.3839745632641282e-01 -6.9119717534365765e-01 4.1971468039517601e-01 + 10 -2.9204353950307196e-02 3.0734531326734569e-02 -4.8221384800030243e-02 + 11 -1.2363687190505000e-01 1.4559085646736353e-01 -7.1753737579386037e-02 + 12 4.2351996560435773e-01 -8.6898582839451829e-02 2.1697353561224830e-01 + 13 9.6748041071259908e-03 -7.6716592550597216e-03 -2.5991964832502584e-02 + 14 -1.3960825609450481e-01 4.8558116820824400e-02 -3.8385674416581701e-02 + 15 4.9534988628362961e-02 -5.3091041865985103e-03 -1.3593867154429479e-01 + 16 -6.5198253620668667e-02 -9.7876170924149325e-02 8.2979949003467765e-02 + 17 -3.7104646597329349e-01 8.7500032779300763e-01 -7.1960058607560573e-01 + 18 -6.6967730021862118e-03 4.6923953918731032e-01 -3.3146459455844518e-01 + 19 3.1353838600166276e-03 -2.7351794216199476e-01 3.4689711564813464e-01 + 20 -7.0674586855426783e-02 -1.8364790640371656e-01 2.3996414120374035e-01 + 21 2.7268030087815295e-02 2.3399931058463413e-01 -3.0605349636359641e-01 + 22 1.1864259704565838e-01 -1.9118895956294703e-02 2.4611128870225038e-01 + 23 -1.9316245289829134e-01 -1.6826372577694942e-01 1.1892678284838995e-01 + 24 -2.8255860984460084e-02 3.9814298046803465e-01 -2.0115633039130043e-01 + 25 7.9352259442701759e-02 -1.1812225604002058e-01 9.9162084213316751e-02 + 26 -1.1769705717312680e-01 -3.0474249942492926e-01 2.7843846870852451e-02 + 27 -1.3066130483271576e-01 4.3788740168428864e-01 -1.6027445220157291e-01 + 28 2.2238377862636136e-01 -1.8583567315176039e-01 1.6966056472713356e-01 + 29 -4.1022840783995984e-02 -2.5146651794492630e-01 -1.4925274989030790e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-morse_soft.yaml b/unittest/force-styles/tests/mol-pair-morse_soft.yaml new file mode 100644 index 0000000000..fb1e8601f5 --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-morse_soft.yaml @@ -0,0 +1,102 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Sat Aug 8 16:27:40 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair morse/soft +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +pair_style: morse/soft 4 0.9 8.0 +pair_coeff: ! | + 1 1 0.0202798941614106 2.78203488021395 2.725417159299 0.5 + 1 2 0.0101167811264648 3.9793050302425 1.90749569018897 0.6 + 1 3 0.0202934330695928 2.43948720203264 3.10711749999622 0.7 + 1 4 0.0175731334238374 2.48316585521317 3.05258880102438 0.2 + 1 5 0.0175731334238374 2.48316585521317 3.05258880102438 0.7 + 2 2 0.00503064360487288 6.98433077606902 1.08960295117864 0.56 + 2 3 0.0101296013842819 3.31380153807866 2.28919067558352 0.82 + 2 4 0.00497405122588691 14.0508902925745 0.544416409093563 0.02 + 2 5 0.00877114211614446 3.39491256196178 2.23466262511073 0.41 + 3 3 0.0203039874239943 2.17204344301477 3.48881895084762 0. + 3 4 0.0175825321440736 2.20660439192238 3.43428999287994 0.37 + 3 5 0.0175825321440736 2.20660439192238 3.43428999287994 0.19 + 4 4 0.0152259201379927 2.24227873774009 3.37976131582396 0.64 + 4 5 0.0152259201379927 2.24227873774009 3.37976131582396 0.92 + 5 5 0.0152259201379927 2.24227873774009 3.37976131582396 0.44 +extract: ! | + d0 2 + r0 2 + alpha 2 + lambda 2 +natoms: 29 +init_vdwl: 22.1281115977958 +init_coul: 0 +init_stress: ! |2- + 4.5926112155551856e+01 5.4756275485445414e+01 4.8287460684927090e+01 -1.3317697661246999e+01 6.1781819397222284e+00 5.9706361032569844e-01 +init_forces: ! |2 + 1 -6.3642875490788606e+00 5.5897137517893798e+00 1.8780543231433221e+01 + 2 1.1436746208072897e+01 9.4101156669970507e+00 -1.3460905092771489e+01 + 3 -4.5422364153954842e+00 -1.3998876050972765e+01 -5.5488205902103314e+00 + 4 -7.2848186696926676e-01 1.5317937428405964e-01 -5.2340779661988290e-01 + 5 -3.0246966633628158e-01 -5.8646862872579886e-01 1.0680962678030779e+00 + 6 -1.7139791824500051e+01 1.3891864776211774e+01 -1.2387092531528296e+01 + 7 -9.7554335981732521e-02 2.6559605163290024e-02 -4.2517444195491727e-01 + 8 -3.1671447165892488e+00 -3.4903772079232147e+00 -3.9056655363166723e+00 + 9 4.9622674819589809e+00 5.3492358490834375e+00 2.1966992251846076e+01 + 10 1.3952488238692712e+01 -1.5778180996840387e+01 -4.3306131695600323e+00 + 11 -1.8390885667027318e-01 -5.1332469171990802e-01 -8.1857308216235636e-01 + 12 1.3479782539781962e+00 2.3415173345444212e-02 -4.7539100923013300e-01 + 13 7.3135404720744923e-01 -2.9053661501450939e-01 -1.2772661590474787e-02 + 14 -3.0248213957422304e-01 6.0184772878951791e-02 -7.6841457603399921e-01 + 15 -6.6675311381954299e-03 7.6707111168297593e-01 2.6636285528337750e-01 + 16 4.5704738414161256e-01 -6.3479079950559381e-01 3.9721558682871944e-01 + 17 -5.0301028600619482e-02 2.3577012385582602e-02 1.7726253898514807e-01 + 18 -2.3807503002293917e-03 -3.7926444746600387e-03 1.6971608232741293e-03 + 19 2.3193189796909461e-05 2.0606433071320604e-05 5.4849340725609120e-05 + 20 -4.3202841322073197e-05 -3.5985082683223355e-05 -4.6371952155626344e-06 + 21 -3.2751708103891264e-01 -3.8629633568156174e-01 1.1124265590396589e+00 + 22 -5.3584465325309472e-01 -1.2984463159747464e-01 -8.4074333373108712e-01 + 23 8.6217992825987666e-01 5.1747844702775336e-01 -2.7027064362346886e-01 + 24 2.1459144955374848e-01 -1.0188522995188376e+00 5.6904997807697888e-01 + 25 -7.5034049686533233e-01 1.2014280914990744e-01 -6.3168185193973636e-01 + 26 5.3457721685296233e-01 8.9760402704572018e-01 6.0400313039938959e-02 + 27 1.9945893157699912e-01 -1.1064997376009176e+00 4.1163026656143853e-01 + 28 -8.3960720022073532e-01 3.6086002530887967e-01 -5.6809627728246892e-01 + 29 6.4234698186864081e-01 7.4685361587103460e-01 1.5589537268892420e-01 +run_vdwl: 20.8194609757227 +run_coul: 0 +run_stress: ! |2- + 4.4517540187996204e+01 5.3173856448125882e+01 4.3917837918314731e+01 -1.3276068462862730e+01 6.1334832747947212e+00 8.8915408516682715e-01 +run_forces: ! |2 + 1 -5.0337726839237993e+00 6.1771644903827667e+00 1.6680597935404812e+01 + 2 1.0039287271090481e+01 8.3817188310460384e+00 -1.1452372555490332e+01 + 3 -4.5304162077570940e+00 -1.3555937022183517e+01 -5.4350777690552974e+00 + 4 -6.9110890027681349e-01 1.4532901465704179e-01 -5.0791496058368790e-01 + 5 -2.9418473819126523e-01 -5.7158384692893272e-01 1.0388640811775314e+00 + 6 -1.6134962069980961e+01 1.3209986173704076e+01 -1.1619729833935788e+01 + 7 -9.5322533797493170e-02 2.4992267581221927e-02 -4.1624338486985635e-01 + 8 -3.3938239385867686e+00 -2.1869022548208688e+00 -1.7286120333922557e+00 + 9 4.3432150704619934e+00 4.4620233745031133e+00 1.8951464692369463e+01 + 10 1.3829154466469513e+01 -1.5579450159957650e+01 -4.3627961624087623e+00 + 11 -1.7027669254013297e-01 -4.6425032964198476e-01 -7.4276071865343629e-01 + 12 1.3279451667684568e+00 6.5508219257311437e-03 -5.4713286971223019e-01 + 13 7.0456720072324097e-01 -2.6567560213165747e-01 -1.0701762305633723e-02 + 14 -2.7727528686323860e-01 4.5139017343686548e-02 -7.0077922634480205e-01 + 15 -1.8509684960693752e-02 7.7534075447411210e-01 2.8290633464429843e-01 + 16 4.4877076725110643e-01 -6.2689283898023940e-01 3.9069362582033612e-01 + 17 -5.0731584218065319e-02 2.4771206014335606e-02 1.7918021011782878e-01 + 18 -2.3782995921447785e-03 -3.7921424009001864e-03 1.6956154518481328e-03 + 19 1.3388025304645558e-05 1.2558197446778542e-05 5.4870914258698521e-05 + 20 -3.4158909680616622e-05 -2.8665798450152757e-05 -2.2628751556387011e-06 + 21 -3.5179138921106462e-01 -3.7805988668413737e-01 1.1335288898077802e+00 + 22 -5.6700348067575146e-01 -1.4753697239319391e-01 -8.5882004928093891e-01 + 23 9.1760341860568995e-01 5.2695258491049568e-01 -2.7328561811878477e-01 + 24 2.7835173872670921e-01 -1.1083528801194287e+00 6.4400041236318883e-01 + 25 -8.6732435183857004e-01 1.1926751654660436e-01 -7.3222393101815275e-01 + 26 5.8781707219281110e-01 9.8800567315096766e-01 8.6031951569037493e-02 + 27 2.2993498803683932e-01 -1.1426022147593762e+00 4.0950818607601075e-01 + 28 -8.8230845652312562e-01 3.7400164630725957e-01 -5.8496900503543836e-01 + 29 6.5456390949452170e-01 7.6980888605544007e-01 1.7489533736415555e-01 +... From 6cea5a9aeff2de513c35b0b6590e95ba531dd777 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Sat, 8 Aug 2020 17:11:25 -0400 Subject: [PATCH 17/25] added missing restart_settings() in morse/soft --- src/USER-FEP/pair_morse_soft.cpp | 31 ++++ src/USER-FEP/pair_morse_soft.h | 2 + .../tests/mol-pair-morse_soft.yaml | 132 +++++++++--------- 3 files changed, 99 insertions(+), 66 deletions(-) diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index 54123bf3cd..c727ea0c2a 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -333,6 +333,37 @@ void PairMorseSoft::read_restart(FILE *fp) } } +/* ---------------------------------------------------------------------- + proc 0 writes to restart file +------------------------------------------------------------------------- */ + +void PairMorseSoft::write_restart_settings(FILE *fp) +{ + fwrite(&nlambda,sizeof(double),1,fp); + fwrite(&shift_range,sizeof(double),1,fp); + fwrite(&cut_global,sizeof(double),1,fp); + fwrite(&offset_flag,sizeof(int),1,fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads from restart file, bcasts +------------------------------------------------------------------------- */ + +void PairMorseSoft::read_restart_settings(FILE *fp) +{ + int me = comm->me; + if (me == 0) { + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); + } + MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); + MPI_Bcast(&shift_range,1,MPI_DOUBLE,0,world); + MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); + MPI_Bcast(&offset_flag,1,MPI_INT,0,world); +} + /* ---------------------------------------------------------------------- proc 0 writes to data file diff --git a/src/USER-FEP/pair_morse_soft.h b/src/USER-FEP/pair_morse_soft.h index 68ce71789c..f5be4de0b0 100644 --- a/src/USER-FEP/pair_morse_soft.h +++ b/src/USER-FEP/pair_morse_soft.h @@ -38,6 +38,8 @@ class PairMorseSoft : public PairMorse { virtual double init_one(int, int); virtual void write_restart(FILE *); virtual void read_restart(FILE *); + virtual void write_restart_settings(FILE *); + virtual void read_restart_settings(FILE *); void write_data(FILE *); void write_data_all(FILE *); diff --git a/unittest/force-styles/tests/mol-pair-morse_soft.yaml b/unittest/force-styles/tests/mol-pair-morse_soft.yaml index fb1e8601f5..2eac54623b 100644 --- a/unittest/force-styles/tests/mol-pair-morse_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-morse_soft.yaml @@ -1,6 +1,6 @@ --- lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:27:40 202 +date_generated: Sat Aug 8 17:10:43 202 epsilon: 5e-14 prerequisites: ! | atom full @@ -8,7 +8,7 @@ prerequisites: ! | pre_commands: ! "" post_commands: ! "" input_file: in.fourmol -pair_style: morse/soft 4 0.9 8.0 +pair_style: morse/soft 4 0.1 8.0 pair_coeff: ! | 1 1 0.0202798941614106 2.78203488021395 2.725417159299 0.5 1 2 0.0101167811264648 3.9793050302425 1.90749569018897 0.6 @@ -17,9 +17,9 @@ pair_coeff: ! | 1 5 0.0175731334238374 2.48316585521317 3.05258880102438 0.7 2 2 0.00503064360487288 6.98433077606902 1.08960295117864 0.56 2 3 0.0101296013842819 3.31380153807866 2.28919067558352 0.82 - 2 4 0.00497405122588691 14.0508902925745 0.544416409093563 0.02 + 2 4 0.00497405122588691 14.0508902925745 0.544416409093563 0.32 2 5 0.00877114211614446 3.39491256196178 2.23466262511073 0.41 - 3 3 0.0203039874239943 2.17204344301477 3.48881895084762 0. + 3 3 0.0203039874239943 2.17204344301477 3.48881895084762 0.24 3 4 0.0175825321440736 2.20660439192238 3.43428999287994 0.37 3 5 0.0175825321440736 2.20660439192238 3.43428999287994 0.19 4 4 0.0152259201379927 2.24227873774009 3.37976131582396 0.64 @@ -31,72 +31,72 @@ extract: ! | alpha 2 lambda 2 natoms: 29 -init_vdwl: 22.1281115977958 +init_vdwl: 108.878402738492 init_coul: 0 init_stress: ! |2- - 4.5926112155551856e+01 5.4756275485445414e+01 4.8287460684927090e+01 -1.3317697661246999e+01 6.1781819397222284e+00 5.9706361032569844e-01 + 2.0616314640468093e+02 2.0694552515100577e+02 3.2253755241146825e+02 -3.7303720548619488e+01 2.3916353883528416e+01 2.9242881772029893e+01 init_forces: ! |2 - 1 -6.3642875490788606e+00 5.5897137517893798e+00 1.8780543231433221e+01 - 2 1.1436746208072897e+01 9.4101156669970507e+00 -1.3460905092771489e+01 - 3 -4.5422364153954842e+00 -1.3998876050972765e+01 -5.5488205902103314e+00 - 4 -7.2848186696926676e-01 1.5317937428405964e-01 -5.2340779661988290e-01 - 5 -3.0246966633628158e-01 -5.8646862872579886e-01 1.0680962678030779e+00 - 6 -1.7139791824500051e+01 1.3891864776211774e+01 -1.2387092531528296e+01 - 7 -9.7554335981732521e-02 2.6559605163290024e-02 -4.2517444195491727e-01 - 8 -3.1671447165892488e+00 -3.4903772079232147e+00 -3.9056655363166723e+00 - 9 4.9622674819589809e+00 5.3492358490834375e+00 2.1966992251846076e+01 - 10 1.3952488238692712e+01 -1.5778180996840387e+01 -4.3306131695600323e+00 - 11 -1.8390885667027318e-01 -5.1332469171990802e-01 -8.1857308216235636e-01 - 12 1.3479782539781962e+00 2.3415173345444212e-02 -4.7539100923013300e-01 - 13 7.3135404720744923e-01 -2.9053661501450939e-01 -1.2772661590474787e-02 - 14 -3.0248213957422304e-01 6.0184772878951791e-02 -7.6841457603399921e-01 - 15 -6.6675311381954299e-03 7.6707111168297593e-01 2.6636285528337750e-01 - 16 4.5704738414161256e-01 -6.3479079950559381e-01 3.9721558682871944e-01 - 17 -5.0301028600619482e-02 2.3577012385582602e-02 1.7726253898514807e-01 - 18 -2.3807503002293917e-03 -3.7926444746600387e-03 1.6971608232741293e-03 - 19 2.3193189796909461e-05 2.0606433071320604e-05 5.4849340725609120e-05 - 20 -4.3202841322073197e-05 -3.5985082683223355e-05 -4.6371952155626344e-06 - 21 -3.2751708103891264e-01 -3.8629633568156174e-01 1.1124265590396589e+00 - 22 -5.3584465325309472e-01 -1.2984463159747464e-01 -8.4074333373108712e-01 - 23 8.6217992825987666e-01 5.1747844702775336e-01 -2.7027064362346886e-01 - 24 2.1459144955374848e-01 -1.0188522995188376e+00 5.6904997807697888e-01 - 25 -7.5034049686533233e-01 1.2014280914990744e-01 -6.3168185193973636e-01 - 26 5.3457721685296233e-01 8.9760402704572018e-01 6.0400313039938959e-02 - 27 1.9945893157699912e-01 -1.1064997376009176e+00 4.1163026656143853e-01 - 28 -8.3960720022073532e-01 3.6086002530887967e-01 -5.6809627728246892e-01 - 29 6.4234698186864081e-01 7.4685361587103460e-01 1.5589537268892420e-01 -run_vdwl: 20.8194609757227 + 1 -3.0944212552810693e+00 2.7528431270297691e+01 3.5084878282204052e+01 + 2 1.7072811991139108e+01 1.4045271856538758e+01 -2.0095944568992625e+01 + 3 -1.4025085996867746e+01 -3.5538505512353709e+01 -1.4266146234771622e+01 + 4 -3.5376204321278601e+00 9.1664299228139023e-01 -2.5211044377337370e+00 + 5 -1.1241238069956936e+00 -1.9082029209833646e+00 5.0529865621374874e+00 + 6 -4.8218002152189477e+01 5.1606236050098254e+01 4.1142630587317633e+01 + 7 -7.7221049787055362e-01 -1.3638968099119190e+01 -8.7287023318719548e+01 + 8 9.7922852984742914e-01 -4.3872500720308913e+00 2.4854499288733074e+01 + 9 7.4225138545971374e+00 8.0074759576987375e+00 3.2868303191766280e+01 + 10 3.2682355772669943e+01 -4.3472141673678330e+01 -1.2345188879033808e+01 + 11 -9.8053636094008834e-01 -2.5162441168715972e+00 -4.0931585953339438e+00 + 12 7.3657281005189583e+00 3.1607948180645460e+00 -3.0753318573910082e+00 + 13 3.7333166161154954e+00 -1.4817905292870637e+00 -6.7097208092423047e-02 + 14 -1.5299206485919137e+00 3.0740619539499275e-01 -3.9337502375107878e+00 + 15 -8.5307685520786741e-02 3.8795827009966617e+00 1.3737663946108636e+00 + 16 2.7996640176038614e+01 -2.2546511796719816e+01 -5.8962960790633304e+01 + 17 -2.3854830997799155e+01 1.6068557300665013e+01 6.6255398581872612e+01 + 18 -2.0467423011750863e-02 -3.1694314292297306e-02 2.7201637979790010e-02 + 19 2.4436294301118436e-04 2.0012905845191923e-04 1.5669679663754508e-04 + 20 -2.8081950070034563e-04 -2.4223821049759885e-04 -4.8875367280606917e-05 + 21 -7.6736757358715622e+00 -9.1050363082586347e+00 2.6104871834050556e+01 + 22 -1.2588927402314571e+01 -3.0507263562631728e+00 -1.9751044277393568e+01 + 23 2.0259444216784011e+01 1.2159535351531510e+01 -6.3501150852564772e+00 + 24 5.0315681710043512e+00 -2.3929675288058473e+01 1.3365378575672175e+01 + 25 -1.7603333330572937e+01 2.8331030368741521e+00 -1.4800144896063490e+01 + 26 1.2562223515891764e+01 2.1092055586422212e+01 1.4199270940493447e+00 + 27 4.6456501792718932e+00 -2.6023140263358044e+01 9.6880319377243431e+00 + 28 -1.9732921668033161e+01 8.4805413222287829e+00 -1.3351550006152580e+01 + 29 1.5089940726667313e+01 1.7544294921333940e+01 3.6625786035313128e+00 +run_vdwl: 97.3341961541961 run_coul: 0 run_stress: ! |2- - 4.4517540187996204e+01 5.3173856448125882e+01 4.3917837918314731e+01 -1.3276068462862730e+01 6.1334832747947212e+00 8.8915408516682715e-01 + 1.9319979778883916e+02 1.9434741743350793e+02 2.8510713154844848e+02 -3.7239727436617017e+01 2.2388547684685680e+01 2.8444127184772217e+01 run_forces: ! |2 - 1 -5.0337726839237993e+00 6.1771644903827667e+00 1.6680597935404812e+01 - 2 1.0039287271090481e+01 8.3817188310460384e+00 -1.1452372555490332e+01 - 3 -4.5304162077570940e+00 -1.3555937022183517e+01 -5.4350777690552974e+00 - 4 -6.9110890027681349e-01 1.4532901465704179e-01 -5.0791496058368790e-01 - 5 -2.9418473819126523e-01 -5.7158384692893272e-01 1.0388640811775314e+00 - 6 -1.6134962069980961e+01 1.3209986173704076e+01 -1.1619729833935788e+01 - 7 -9.5322533797493170e-02 2.4992267581221927e-02 -4.1624338486985635e-01 - 8 -3.3938239385867686e+00 -2.1869022548208688e+00 -1.7286120333922557e+00 - 9 4.3432150704619934e+00 4.4620233745031133e+00 1.8951464692369463e+01 - 10 1.3829154466469513e+01 -1.5579450159957650e+01 -4.3627961624087623e+00 - 11 -1.7027669254013297e-01 -4.6425032964198476e-01 -7.4276071865343629e-01 - 12 1.3279451667684568e+00 6.5508219257311437e-03 -5.4713286971223019e-01 - 13 7.0456720072324097e-01 -2.6567560213165747e-01 -1.0701762305633723e-02 - 14 -2.7727528686323860e-01 4.5139017343686548e-02 -7.0077922634480205e-01 - 15 -1.8509684960693752e-02 7.7534075447411210e-01 2.8290633464429843e-01 - 16 4.4877076725110643e-01 -6.2689283898023940e-01 3.9069362582033612e-01 - 17 -5.0731584218065319e-02 2.4771206014335606e-02 1.7918021011782878e-01 - 18 -2.3782995921447785e-03 -3.7921424009001864e-03 1.6956154518481328e-03 - 19 1.3388025304645558e-05 1.2558197446778542e-05 5.4870914258698521e-05 - 20 -3.4158909680616622e-05 -2.8665798450152757e-05 -2.2628751556387011e-06 - 21 -3.5179138921106462e-01 -3.7805988668413737e-01 1.1335288898077802e+00 - 22 -5.6700348067575146e-01 -1.4753697239319391e-01 -8.5882004928093891e-01 - 23 9.1760341860568995e-01 5.2695258491049568e-01 -2.7328561811878477e-01 - 24 2.7835173872670921e-01 -1.1083528801194287e+00 6.4400041236318883e-01 - 25 -8.6732435183857004e-01 1.1926751654660436e-01 -7.3222393101815275e-01 - 26 5.8781707219281110e-01 9.8800567315096766e-01 8.6031951569037493e-02 - 27 2.2993498803683932e-01 -1.1426022147593762e+00 4.0950818607601075e-01 - 28 -8.8230845652312562e-01 3.7400164630725957e-01 -5.8496900503543836e-01 - 29 6.5456390949452170e-01 7.6980888605544007e-01 1.7489533736415555e-01 + 1 -1.2861689236158784e+00 2.6124775571833457e+01 3.0238621702044544e+01 + 2 1.4224150243987660e+01 1.1766201131718656e+01 -1.6341829843443257e+01 + 3 -1.3984995579871924e+01 -3.1285028739057193e+01 -1.2575280302967942e+01 + 4 -3.3473594528059039e+00 8.7703152903671666e-01 -2.4414113598418896e+00 + 5 -1.0397415103295957e+00 -1.7686521538234090e+00 4.7774139976666676e+00 + 6 -4.2965959632773547e+01 4.5788501008332908e+01 3.0780964589104197e+01 + 7 -2.2405319643293076e-01 -1.2029536192419945e+01 -7.2313478446117216e+01 + 8 -4.0905921418197766e-01 -2.3740611048794991e+00 2.4396591699082343e+01 + 9 6.3828517076449023e+00 6.5929945550547782e+00 2.7775326860615209e+01 + 10 3.0208911016544072e+01 -4.0556055803458612e+01 -1.2389739450444475e+01 + 11 -9.4367369401912182e-01 -2.2762320136153318e+00 -3.7598184234474146e+00 + 12 7.1589233203138241e+00 3.0988532310292505e+00 -3.4462702027649317e+00 + 13 3.5539607180805932e+00 -1.3442600631983403e+00 -5.3277726703797677e-02 + 14 -1.3774167613538149e+00 2.2280711633443001e-01 -3.5107835729532928e+00 + 15 -1.6599974080859461e-01 3.8380488820831258e+00 1.4394284632993852e+00 + 16 2.4655339294769281e+01 -2.0644459521071692e+01 -4.9673945184824333e+01 + 17 -2.0408955961303882e+01 1.3999678648125169e+01 5.7082432128988373e+01 + 18 -2.0415519764652862e-02 -3.1629865924393243e-02 2.7112886381819818e-02 + 19 1.8503878045281037e-04 1.5145652856423606e-04 1.4470529045297712e-04 + 20 -2.1726034031919374e-04 -1.8965028143025351e-04 -3.4849273244762223e-05 + 21 -7.0280784818649487e+00 -7.6737317981520885e+00 2.3064455189377767e+01 + 22 -1.1422385338560913e+01 -2.9414907058328290e+00 -1.7461807267673567e+01 + 23 1.8447200134551053e+01 1.0619117977690159e+01 -5.5988073260761881e+00 + 24 5.7575692689381226e+00 -2.2441828398210717e+01 1.3144700900274648e+01 + 25 -1.7520089936062256e+01 2.5322614167293449e+00 -1.4816077823942399e+01 + 26 1.1752809396468171e+01 1.9905032096165826e+01 1.6562984436553274e+00 + 27 4.4145736295533631e+00 -2.3292454132649759e+01 8.2354615899678194e+00 + 28 -1.7657926613336663e+01 7.5915269420119964e+00 -1.1738450553275785e+01 + 29 1.3246023047795436e+01 1.5702628579900875e+01 3.5020591780011472e+00 ... From e3beec8b958ebaf61b2b1080b6fd31ee770aa6ca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Aug 2020 11:37:52 -0400 Subject: [PATCH 18/25] revert permission change and replace 'b/c' with 'because' --- src/GRANULAR/fix_wall_gran.cpp | 4 ++-- src/GRANULAR/fix_wall_gran_region.cpp | 4 ++-- src/MISC/fix_gld.cpp | 4 ++-- src/MISC/fix_ttm.cpp | 4 ++-- src/MOLECULE/fix_cmap.cpp | 6 +++--- src/USER-ATC/fix_atc.cpp | 0 src/USER-MISC/fix_gle.cpp | 4 ++-- src/USER-MISC/fix_pimd.cpp | 4 ++-- src/USER-MISC/fix_srp.cpp | 6 +++--- src/USER-MISC/fix_ti_spring.cpp | 4 ++-- src/USER-MISC/fix_ttm_mod.cpp | 4 ++-- src/USER-SDPD/fix_meso_move.cpp | 4 ++-- .../fix_smd_tlsph_reference_configuration.cpp | 4 ++-- src/fix_move.cpp | 4 ++-- src/fix_neigh_history.cpp | 20 +++++++++---------- src/fix_property_atom.cpp | 6 +++--- src/fix_spring_self.cpp | 4 ++-- src/fix_store.cpp | 4 ++-- src/fix_store_state.cpp | 4 ++-- 19 files changed, 47 insertions(+), 47 deletions(-) mode change 100755 => 100644 src/GRANULAR/fix_wall_gran.cpp mode change 100755 => 100644 src/GRANULAR/fix_wall_gran_region.cpp mode change 100755 => 100644 src/MISC/fix_gld.cpp mode change 100755 => 100644 src/MISC/fix_ttm.cpp mode change 100755 => 100644 src/MOLECULE/fix_cmap.cpp mode change 100755 => 100644 src/USER-ATC/fix_atc.cpp mode change 100755 => 100644 src/USER-MISC/fix_gle.cpp mode change 100755 => 100644 src/USER-MISC/fix_pimd.cpp mode change 100755 => 100644 src/USER-MISC/fix_srp.cpp mode change 100755 => 100644 src/USER-MISC/fix_ti_spring.cpp mode change 100755 => 100644 src/USER-MISC/fix_ttm_mod.cpp mode change 100755 => 100644 src/USER-SDPD/fix_meso_move.cpp mode change 100755 => 100644 src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp mode change 100755 => 100644 src/fix_move.cpp mode change 100755 => 100644 src/fix_neigh_history.cpp mode change 100755 => 100644 src/fix_property_atom.cpp mode change 100755 => 100644 src/fix_spring_self.cpp mode change 100755 => 100644 src/fix_store.cpp mode change 100755 => 100644 src/fix_store_state.cpp diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp old mode 100755 new mode 100644 index 1cf15604b1..80a121c035 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -1541,7 +1541,7 @@ int FixWallGran::pack_restart(int i, double *buf) if (!use_history) return 0; int n = 0; - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[n++] = size_history + 1; for (int m = 0; m < size_history; m++) buf[n++] = history_one[i][m]; @@ -1559,7 +1559,7 @@ void FixWallGran::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp old mode 100755 new mode 100644 index 34540100ff..6953165af6 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -479,7 +479,7 @@ int FixWallGranRegion::pack_restart(int i, double *buf) for (m = 0; m < size_history; m++) buf[n++] = history_many[i][iwall][m]; } - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = n; return n; } @@ -497,7 +497,7 @@ void FixWallGranRegion::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp old mode 100755 new mode 100644 index 558242aa99..ab601ae8cb --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -547,7 +547,7 @@ int FixGLD::unpack_exchange(int nlocal, double *buf) int FixGLD::pack_restart(int i, double *buf) { int m = 0; - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[m++] = 3*prony_terms + 1; for (int k = 0; k < 3*prony_terms; k=k+3) { @@ -567,7 +567,7 @@ void FixGLD::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to the nth set of extended variables - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp old mode 100755 new mode 100644 index 18d725a3a7..529914ec34 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -656,7 +656,7 @@ void FixTTM::restart(char *buf) int FixTTM::pack_restart(int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = flangevin[i][0]; buf[2] = flangevin[i][1]; @@ -673,7 +673,7 @@ void FixTTM::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp old mode 100755 new mode 100644 index 83a31d4ad8..d3b071ebc6 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1041,7 +1041,7 @@ void FixCMAP::read_data_header(char *line) sscanf(line,BIGINT_FORMAT,&ncmap); } else error->all(FLERR,"Invalid read data header line for fix cmap"); - // didn't set in constructor b/c this fix could be defined + // didn't set in constructor because this fix could be defined // before newton command newton_bond = force->newton_bond; @@ -1291,7 +1291,7 @@ int FixCMAP::pack_restart(int i, double *buf) buf[n++] = ubuf(crossterm_atom4[i][m]).d; buf[n++] = ubuf(crossterm_atom5[i][m]).d; } - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = n; return n; @@ -1306,7 +1306,7 @@ void FixCMAP::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int n = 0; for (int i = 0; i < nth; i++) n += static_cast (extra[nlocal][n]); diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp old mode 100755 new mode 100644 diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp old mode 100755 new mode 100644 index b308d4423f..8459ddf29b --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -822,7 +822,7 @@ int FixGLE::unpack_exchange(int nlocal, double *buf) int FixGLE::pack_restart(int i, double *buf) { int m = 0; - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[m++] = 3*ns + 1; for (int k = 0; k < 3*ns; k=k+3) { @@ -842,7 +842,7 @@ void FixGLE::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to the nth set of extended variables - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp old mode 100755 new mode 100644 index 3159fb865f..8de31f19b3 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -794,7 +794,7 @@ int FixPIMD::pack_restart(int i, double *buf) { int offset=0; int pos = i * 3; - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[offset++] = size_peratom_cols+1; memcpy(buf+offset, nhc_eta[pos], nhc_size_one_1); offset += nhc_offset_one_1; @@ -812,7 +812,7 @@ void FixPIMD::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i=0; i (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp old mode 100755 new mode 100644 index f870a884f0..131fd7d27a --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -114,7 +114,7 @@ void FixSRP::init() error->all(FLERR,"Illegal bond particle type"); // this fix must come before any fix which migrates atoms in its pre_exchange() - // b/c this fix's pre_exchange() creates per-atom data structure + // because this fix's pre_exchange() creates per-atom data structure // that data must be current for atom migration to carry it along for (int i = 0; i < modify->nfix; i++) { @@ -555,7 +555,7 @@ void FixSRP::post_run() int FixSRP::pack_restart(int i, double *buf) { int m = 0; - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[m++] = 3; buf[m++] = array[i][0]; buf[m++] = array[i][1]; @@ -571,7 +571,7 @@ void FixSRP::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++){ diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp old mode 100755 new mode 100644 index 0931f06e15..1f7c84b746 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -315,7 +315,7 @@ int FixTISpring::unpack_exchange(int nlocal, double *buf) int FixTISpring::pack_restart(int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -332,7 +332,7 @@ void FixTISpring::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp old mode 100755 new mode 100644 index 4015f76a95..aaeab5989a --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -980,7 +980,7 @@ void FixTTMMod::restart(char *buf) int FixTTMMod::pack_restart(int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = flangevin[i][0]; buf[2] = flangevin[i][1]; @@ -997,7 +997,7 @@ void FixTTMMod::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp old mode 100755 new mode 100644 index d72d9667ca..6db2aaa478 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -948,7 +948,7 @@ int FixMesoMove::unpack_exchange (int nlocal, double *buf) { ------------------------------------------------------------------------- */ int FixMesoMove::pack_restart (int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -964,7 +964,7 @@ void FixMesoMove::unpack_restart (int nlocal, int nth) { double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp old mode 100755 new mode 100644 index 83b9e74b37..4ade21a6fd --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -450,7 +450,7 @@ int FixSMD_TLSPH_ReferenceConfiguration::unpack_exchange(int nlocal, double *buf int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { int m = 0; - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[m++] = 4 * npartner[i] + 2; buf[m++] = npartner[i]; for (int n = 0; n < npartner[i]; n++) { @@ -471,7 +471,7 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*n // ipage = NULL if being called from granular pair style init() // skip to Nth set of extra values -// unpack the Nth first values this way b/c other fixes pack them +// unpack the Nth first values this way because other fixes pack them // double **extra = atom->extra; // diff --git a/src/fix_move.cpp b/src/fix_move.cpp old mode 100755 new mode 100644 index 936fac7481..8c58146c52 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -1193,7 +1193,7 @@ int FixMove::pack_restart(int i, double *buf) buf[n++] = qoriginal[i][2]; buf[n++] = qoriginal[i][3]; } - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = n; return n; } @@ -1207,7 +1207,7 @@ void FixMove::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp old mode 100755 new mode 100644 index 90e0ec78f0..933bcdc265 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -149,7 +149,7 @@ void FixNeighHistory::init() error->all(FLERR,"Neighbor history requires atoms have IDs"); // this fix must come before any fix which migrates atoms in its pre_exchange() - // b/c this fix's pre_exchange() creates per-atom data structure + // because this fix's pre_exchange() creates per-atom data structure // that data must be current for atom migration to carry it along for (int i = 0; i < modify->nfix; i++) { @@ -215,7 +215,7 @@ void FixNeighHistory::setup_post_neighbor() called during run before atom exchanges, including for restart files called at end of run via post_run() do not call during setup of run (setup_pre_exchange) - b/c there is no guarantee of a current NDS (even on continued run) + because there is no guarantee of a current NDS (even on continued run) if run command does a 2nd run with pre = no, then no neigh list will be built, but old neigh list will still have the info onesided and newton on and newton off versions @@ -242,7 +242,7 @@ void FixNeighHistory::pre_exchange_onesided() double *allvalues,*onevalues; // NOTE: all operations until very end are with nlocal_neigh <= current nlocal - // b/c previous neigh list was built with nlocal_neigh + // because previous neigh list was built with nlocal_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() // clear two paged data structures @@ -335,7 +335,7 @@ void FixNeighHistory::pre_exchange_newton() // NOTE: all operations until very end are with // nlocal_neigh <= current nlocal and nall_neigh - // b/c previous neigh list was built with nlocal_neigh & nghost_neigh + // because previous neigh list was built with nlocal_neigh & nghost_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() // clear two paged data structures @@ -430,7 +430,7 @@ void FixNeighHistory::pre_exchange_newton() // perform reverse comm to augment // owned atom partner/valuepartner with ghost info - // use variable variant b/c size of packed data can be arbitrarily large + // use variable variant because size of packed data can be arbitrarily large // if many touching neighbors for large particle commflag = PERPARTNER; @@ -463,7 +463,7 @@ void FixNeighHistory::pre_exchange_no_newton() double *allvalues,*onevalues,*jvalues; // NOTE: all operations until very end are with nlocal_neigh <= current nlocal - // b/c previous neigh list was built with nlocal_neigh + // because previous neigh list was built with nlocal_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() // clear two paged data structures @@ -708,10 +708,10 @@ void FixNeighHistory::grow_arrays(int nmax) void FixNeighHistory::copy_arrays(int i, int j, int /*delflag*/) { // just copy pointers for partner and valuepartner - // b/c can't overwrite chunk allocation inside ipage_atom,dpage_atom + // because can't overwrite chunk allocation inside ipage_atom,dpage_atom // incoming atoms in unpack_exchange just grab new chunks // so are orphaning chunks for migrating atoms - // OK, b/c will reset ipage_atom,dpage_atom on next reneighboring + // OK, because will reset ipage_atom,dpage_atom on next reneighboring npartner[j] = npartner[i]; partner[j] = partner[i]; @@ -853,7 +853,7 @@ int FixNeighHistory::pack_restart(int i, double *buf) memcpy(&buf[m],&valuepartner[i][dnum*n],dnumbytes); m += dnum; } - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = m; return m; } @@ -869,7 +869,7 @@ void FixNeighHistory::unpack_restart(int nlocal, int nth) if (ipage_atom == NULL) allocate_pages(); // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them double **extra = atom->extra; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp old mode 100755 new mode 100644 index 251afc4f28..374d0069fd --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -192,7 +192,7 @@ int FixPropertyAtom::setmask() void FixPropertyAtom::init() { // error if atom style has changed since fix was defined - // don't allow this b/c user could change to style that defines molecule,q + // don't allow this because user could change to style that defines molecule,q if (strcmp(astyle,atom->atom_style) != 0) error->all(FLERR,"Atom style was redefined after using fix property/atom"); @@ -579,7 +579,7 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) int FixPropertyAtom::pack_restart(int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = nvalue+1; int m = 1; @@ -603,7 +603,7 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp old mode 100755 new mode 100644 index ae723d48fe..4f8a03c8bd --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -264,7 +264,7 @@ int FixSpringSelf::unpack_exchange(int nlocal, double *buf) int FixSpringSelf::pack_restart(int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = 4; buf[1] = xoriginal[i][0]; buf[2] = xoriginal[i][1]; @@ -281,7 +281,7 @@ void FixSpringSelf::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_store.cpp b/src/fix_store.cpp old mode 100755 new mode 100644 index d98696b2e8..3cf3125be5 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -280,7 +280,7 @@ int FixStore::pack_restart(int i, double *buf) return 1; } - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = nvalues+1; if (vecflag) buf[1] = vstore[i]; else @@ -300,7 +300,7 @@ void FixStore::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp old mode 100755 new mode 100644 index 17ca72ecae..e1e2aab663 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -611,7 +611,7 @@ int FixStoreState::unpack_exchange(int nlocal, double *buf) int FixStoreState::pack_restart(int i, double *buf) { - // pack buf[0] this way b/c other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = nvalues+1; for (int m = 0; m < nvalues; m++) buf[m+1] = values[i][m]; return nvalues+1; @@ -626,7 +626,7 @@ void FixStoreState::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - // unpack the Nth first values this way b/c other fixes pack them + // unpack the Nth first values this way because other fixes pack them int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); From 1370090586f57a35501c14d2f9d881e6d79d93ab Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Mon, 10 Aug 2020 15:49:52 -0400 Subject: [PATCH 19/25] Move comm destruction to after modify to leave available for fixes Needed in some cases to cleanup asynchronous inter-step transfers. --- src/lammps.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 890e3bcc27..ded9d93167 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -854,9 +854,6 @@ void LAMMPS::destroy() delete neighbor; neighbor = NULL; - delete comm; - comm = NULL; - delete force; force = NULL; @@ -870,6 +867,10 @@ void LAMMPS::destroy() // since they delete fixes modify = NULL; + delete comm; // comm must come after modify + // since fix destructors may access comm + comm = NULL; + delete domain; // domain must come after modify // since fix destructors access domain domain = NULL; From a83147ce20702af92bcde2eb18164b7cf8d26774 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Mon, 10 Aug 2020 16:01:28 -0400 Subject: [PATCH 20/25] fixed bug in respa neighbor list --- .../pair_lj_charmm_coul_long_soft.cpp | 40 +++++-------------- src/USER-FEP/pair_lj_cut_coul_long_soft.cpp | 36 +++++------------ src/USER-FEP/pair_lj_cut_soft.cpp | 37 +++++------------ .../mol-pair-lj_charmm_coul_long_soft.yaml | 2 +- .../tests/mol-pair-lj_cut_coul_long_soft.yaml | 2 +- .../tests/mol-pair-lj_cut_soft.yaml | 2 +- 6 files changed, 32 insertions(+), 87 deletions(-) diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index f20d351d1c..f0bc491f05 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -688,41 +688,23 @@ void PairLJCharmmCoulLongSoft::init_style() error->all(FLERR, "Pair style lj/charmm/coul/long/soft requires atom attribute q"); - // request regular or rRESPA neighbor lists + // request regular or rRESPA neighbor list int irequest; + int respa = 0; if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; - if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; - if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; + if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + } - if (respa == 0) irequest = neighbor->request(this,instance_me); - else if (respa == 1) { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } else { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respamiddle = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } + irequest = neighbor->request(this,instance_me); - } else irequest = neighbor->request(this,instance_me); + if (respa >= 1) { + neighbor->requests[irequest]->respaouter = 1; + neighbor->requests[irequest]->respainner = 1; + } + if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; // require cut_lj_inner < cut_lj diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index cf80a3e405..5167cb6a54 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -631,41 +631,23 @@ void PairLJCutCoulLongSoft::init_style() if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/soft requires atom attribute q"); - // request regular or rRESPA neighbor lists + // request regular or rRESPA neighbor list int irequest; + int respa = 0; if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + } - if (respa == 0) irequest = neighbor->request(this,instance_me); - else if (respa == 1) { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } else { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respamiddle = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } + irequest = neighbor->request(this,instance_me); - } else irequest = neighbor->request(this,instance_me); + if (respa >= 1) { + neighbor->requests[irequest]->respaouter = 1; + neighbor->requests[irequest]->respainner = 1; + } + if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; cut_coulsq = cut_coul * cut_coul; diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 9d03b4e1e2..53e6e61909 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -509,41 +509,23 @@ void PairLJCutSoft::coeff(int narg, char **arg) void PairLJCutSoft::init_style() { - // request regular or rRESPA neighbor lists + // request regular or rRESPA neighbor list int irequest; + int respa = 0; if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + } - if (respa == 0) irequest = neighbor->request(this,instance_me); - else if (respa == 1) { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } else { - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respainner = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respamiddle = 1; - irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->respaouter = 1; - } + irequest = neighbor->request(this,instance_me); - } else irequest = neighbor->request(this,instance_me); + if (respa >= 1) { + neighbor->requests[irequest]->respaouter = 1; + neighbor->requests[irequest]->respainner = 1; + } + if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; // set rRESPA cutoffs @@ -551,7 +533,6 @@ void PairLJCutSoft::init_style() ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; - } /* ---------------------------------------------------------------------- diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml index de7fdfe1e5..96caf3150f 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml @@ -1,6 +1,6 @@ --- lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:21:13 202 +date_generated: Mon Aug 10 15:02:20 202 epsilon: 7.5e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml index 39531339e9..55a6da404f 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_coul_long_soft.yaml @@ -1,6 +1,6 @@ --- lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:17:39 202 +date_generated: Mon Aug 10 15:56:55 202 epsilon: 7.5e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml index bad77cd710..6c07651895 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_soft.yaml @@ -1,6 +1,6 @@ --- lammps_version: 21 Jul 2020 -date_generated: Sat Aug 8 16:12:05 202 +date_generated: Mon Aug 10 15:51:49 202 epsilon: 5e-14 prerequisites: ! | atom full From a7fee0a96ff53271aeb00b8b3d6d9df3ae92d3f7 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Mon, 10 Aug 2020 16:28:42 -0400 Subject: [PATCH 21/25] replace strstr with utils::strmatch --- src/KSPACE/pair_lj_charmm_coul_long.cpp | 4 ++-- src/KSPACE/pair_lj_cut_coul_long.cpp | 4 ++-- src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp | 6 +++--- src/USER-FEP/pair_lj_cut_coul_long_soft.cpp | 6 +++--- src/USER-FEP/pair_lj_cut_soft.cpp | 6 +++--- src/pair_lj_cut.cpp | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 390005d80e..9ea6739c8e 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -689,7 +689,7 @@ void PairLJCharmmCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -718,7 +718,7 @@ void PairLJCharmmCoulLong::init_style() // set & error check interior rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) { cut_respa = ((Respa *) update->integrate)->cutoff; cut_in_off = cut_respa[0]; diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index ff20dc2570..13d60e92e2 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -659,7 +659,7 @@ void PairLJCutCoulLong::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -676,7 +676,7 @@ void PairLJCutCoulLong::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index f0bc491f05..81c1599508 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -688,12 +688,12 @@ void PairLJCharmmCoulLongSoft::init_style() error->all(FLERR, "Pair style lj/charmm/coul/long/soft requires atom attribute q"); - // request regular or rRESPA neighbor list + // request regular or rRESPA neighbor lists int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -721,7 +721,7 @@ void PairLJCharmmCoulLongSoft::init_style() // set & error check interior rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) { cut_respa = ((Respa *) update->integrate)->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index 5167cb6a54..c22b2ca673 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -631,12 +631,12 @@ void PairLJCutCoulLongSoft::init_style() if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/soft requires atom attribute q"); - // request regular or rRESPA neighbor list + // request regular or rRESPA neighbor lists int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -653,7 +653,7 @@ void PairLJCutCoulLongSoft::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 53e6e61909..92abdf540a 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -509,12 +509,12 @@ void PairLJCutSoft::coeff(int narg, char **arg) void PairLJCutSoft::init_style() { - // request regular or rRESPA neighbor list + // request regular or rRESPA neighbor lists int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -529,7 +529,7 @@ void PairLJCutSoft::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index e31e275a7d..60bb7bceee 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -484,7 +484,7 @@ void PairLJCut::init_style() int irequest; int respa = 0; - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } @@ -499,7 +499,7 @@ void PairLJCut::init_style() // set rRESPA cutoffs - if (strstr(update->integrate_style,"respa") && + if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; else cut_respa = NULL; From 33c97618be510e80ed035cbb1df304b82c40edc1 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Mon, 10 Aug 2020 16:52:32 -0400 Subject: [PATCH 22/25] using hybrid/overaly to add soft repulsion to purely coulombic pair-styles --- .../tests/mol-pair-coul_cut_soft.yaml | 93 ++++++++++++++++ .../tests/mol-pair-coul_long_soft.yaml | 100 ++++++++++++++++++ .../tests/mol-pair-tip4p_long_soft.yaml | 97 +++++++++++++++++ 3 files changed, 290 insertions(+) create mode 100644 unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-coul_long_soft.yaml create mode 100644 unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml diff --git a/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml b/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml new file mode 100644 index 0000000000..16cf63addd --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-coul_cut_soft.yaml @@ -0,0 +1,93 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 16:44:46 202 +epsilon: 5e-14 +prerequisites: ! | + atom full + pair hybrid/overlay + pair lj/cut + pair coul/cut/soft +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic +input_file: in.fourmol +pair_style: hybrid/overlay coul/cut/soft 4.0 6.0 8.0 lj/cut 8.0 +pair_coeff: ! | + 1 1 lj/cut 0.02 2.5 + 2 2 lj/cut 0.005 1.0 + 2 4 lj/cut 0.005 0.5 + 3 3 lj/cut 0.02 3.2 + 4 4 lj/cut 0.015 3.1 + 5 5 lj/cut 0.015 3.1 + * * coul/cut/soft 0.52 +extract: ! "" +natoms: 29 +init_vdwl: 8.07036960332133 +init_coul: -6.57579763044586 +init_stress: ! |2- + 3.3056188525495266e+01 3.8943881243005563e+01 2.4713892609892472e+01 -2.9521605433522784e+00 -9.1087143159719162e+00 -1.7962027131120834e+01 +init_forces: ! |2 + 1 1.5973817166587370e-02 -2.5849512574275112e-02 1.4349314975720284e-01 + 2 1.1661437893992524e-01 -5.4827445223305071e-02 -2.2601116019690834e-01 + 3 -1.0366797632080360e+01 1.0665290898811616e+01 6.9491956291296209e+00 + 4 6.3668415940203442e-04 -3.6245394302267886e-03 -2.0911289827080709e-02 + 5 -2.1975344883455643e-02 2.3185299135022673e-02 -3.9078433083915834e-03 + 6 1.0364219999013660e+01 -1.0737274883671912e+01 -6.9613703537185270e+00 + 7 1.4935880192974396e-03 1.0034674876492126e-02 8.1574702977769628e-02 + 8 -6.8663737105209011e-02 1.2722093437625731e-01 -1.6920023406097086e-02 + 9 1.0434703890749855e-01 -2.2197873426860887e-01 2.0819759336877833e-01 + 10 -2.6597352192025340e+01 -2.4907913480145822e+00 -3.1219562057993855e+00 + 11 -4.5648865767222380e-02 5.3888880600796309e-02 -2.2052443200595209e-02 + 12 1.7560373424840733e+01 1.6574415387592097e+01 -1.1455159766324989e+01 + 13 -1.3229481903479206e-02 -1.1272770895154941e-02 4.2931512148414591e-03 + 14 -5.8406838873095564e-02 1.8967139103433089e-02 -1.3020272870953819e-02 + 15 1.1532655490635991e-02 3.4979119379107081e-03 -4.3221729398660910e-02 + 16 9.2425099727407893e+00 -1.4221175369996539e+01 1.4640083796682012e+01 + 17 -1.7714181591327197e-01 3.4464928098370146e-01 -2.7542575243750161e-01 + 18 5.6848282728599160e-02 2.5572164911305872e-01 -8.9039631561204702e-02 + 19 -8.2805254180793278e-02 -1.9332226615499687e-01 2.9263577064588209e-02 + 20 -5.2300216374039869e-03 6.0834484118361530e-02 2.7379117917867110e-02 + 21 8.3403038342075228e-03 -1.2911896142827550e-01 -1.1278197160549872e-01 + 22 -5.6177026598133825e-02 7.4085260538110084e-02 5.5566396710162412e-02 + 23 1.8305992017088525e-02 -4.0514138001213541e-02 8.7071688124334870e-02 + 24 -4.1612848296087690e-02 1.1220011175255142e-01 1.6712385355709913e-01 + 25 -3.6533415983949220e-02 -6.5585589910651665e-02 -1.5441633500064449e-03 + 26 2.4752386500144913e-02 -1.0320418186961813e-01 -7.1603926797876874e-02 + 27 -9.9836895788385449e-02 1.4297838277829034e-01 -8.3166582485281443e-02 + 28 1.9219157401333040e-02 -1.2519846747100560e-01 4.0097586180285402e-02 + 29 1.2624368927628452e-01 -4.3232086807339080e-02 8.4752873604395568e-02 +run_vdwl: 7.26269331801932 +run_coul: -6.97644456126866 +run_stress: ! |2- + 3.0127651057118101e+01 3.4453839719562993e+01 2.1931283076276625e+01 -2.8900662879329531e+00 -8.5061591823548035e+00 -1.5709082735595215e+01 +run_forces: ! |2 + 1 1.6556394726179854e-02 -2.7823379429844208e-02 1.4399677662288241e-01 + 2 9.4728034633916783e-02 -9.6607229539929881e-02 -2.1057064241428827e-01 + 3 -9.5252899376491769e+00 9.7744730287893145e+00 6.3175856254776654e+00 + 4 1.3655766591042394e-03 -3.5997743625432767e-03 -2.1349661918632211e-02 + 5 -2.1731377938146137e-02 2.3431645306487836e-02 -4.6654114471729909e-03 + 6 9.5191836369739669e+00 -9.8414923421708664e+00 -6.3311607800906744e+00 + 7 2.3517013080299586e-03 6.4887395872065962e-03 8.0968146370040933e-02 + 8 -6.5838979183396623e-02 1.2723201485976468e-01 -1.4419462918936282e-02 + 9 1.0313127627543547e-01 -2.2472548628113920e-01 2.0855309453153736e-01 + 10 -2.3739961682275993e+01 -2.4021039351345070e+00 -2.5419544715889462e+00 + 11 -4.5692627637436159e-02 5.4310758581633464e-02 -2.1901108463684524e-02 + 12 1.5826336404623913e+01 1.4709948043443138e+01 -1.0255550569951657e+01 + 13 -1.3818470838464466e-02 -1.1232611873072887e-02 3.7144773555590370e-03 + 14 -5.8490465389199123e-02 1.9301559724291283e-02 -1.2702918464188331e-02 + 15 1.2275528798406529e-02 2.7004032851716945e-03 -4.4613261269571644e-02 + 16 8.1200565933619018e+00 -1.2447066846418169e+01 1.2859636395191094e+01 + 17 -1.7638808312729590e-01 3.4818610512262499e-01 -2.7525242695298618e-01 + 18 5.6517864566760591e-02 2.5743689521073448e-01 -8.2783753163049645e-02 + 19 -7.7792613266639957e-02 -1.9170617577268992e-01 3.1577861474679558e-02 + 20 -8.8034975891165858e-03 5.8710275590654226e-02 2.0464803602355808e-02 + 21 8.6237157627901892e-03 -1.3793322582438144e-01 -1.0801683428494860e-01 + 22 -5.2927593667993142e-02 7.9773787719114295e-02 5.4085134651948211e-02 + 23 1.4941691289898021e-02 -3.8796926532710010e-02 8.3574667474682035e-02 + 24 -4.2502706797988267e-02 1.0996091704567368e-01 1.6694289564006998e-01 + 25 -3.4188441462138668e-02 -6.3799095585925017e-02 3.7273979200262057e-04 + 26 2.4230764689621518e-02 -1.0154509989638259e-01 -7.2645178020573520e-02 + 27 -1.0128872753518126e-01 1.4355720870604366e-01 -7.8397657663983225e-02 + 28 3.8620989756577413e-02 -8.3428605295058175e-02 2.2781457173507890e-02 + 29 1.2579503093166530e-01 -4.3650648854632823e-02 8.1730063255268340e-02 +... diff --git a/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml new file mode 100644 index 0000000000..fa47d9484d --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-coul_long_soft.yaml @@ -0,0 +1,100 @@ +--- +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 16:47:40 202 +epsilon: 3e-13 +prerequisites: ! | + atom full + pair hybrid/overlay + pair coul/long/soft + pair lj/cut + kspace ewald +pre_commands: ! "" +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style ewald 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: hybrid/overlay coul/long/soft 4.0 6.0 8.0 lj/cut 8.0 +pair_coeff: ! | + 1 1 lj/cut 0.02 2.5 + 2 2 lj/cut 0.005 1.0 + 2 4 lj/cut 0.005 0.5 + 3 3 lj/cut 0.02 3.2 + 4 4 lj/cut 0.015 3.1 + 5 5 lj/cut 0.015 3.1 + * * coul/long/soft 0.23 +extract: ! | + lambda 2 + scale 2 +natoms: 29 +init_vdwl: 8.07036960332133 +init_coul: 0.250616636637181 +init_stress: ! |2- + 3.3318331341780379e+01 4.0258582287659699e+01 2.6723566043088852e+01 -3.2839183131153762e+00 -8.9320581791877558e+00 -1.7911132107077634e+01 +init_forces: ! |2 + 1 -1.2664775714938474e-02 2.6532332250218386e-02 8.8675235967460402e-03 + 2 2.2881614624250101e-03 -3.4718325274176861e-03 -5.6923674871682400e-03 + 3 -1.0366459654154854e+01 1.0666349339503686e+01 6.9464292526455500e+00 + 4 -5.9689442718514789e-06 -2.7564986122111640e-05 -2.0090962250850290e-04 + 5 -7.8024804119438665e-04 6.4214274105036176e-04 -4.1327552517583506e-04 + 6 1.0314488630148473e+01 -1.0616776978871707e+01 -6.9580626725994152e+00 + 7 7.0613584193556572e-03 5.8490065623709271e-03 4.8384847696894906e-03 + 8 1.1781716921971410e-02 -2.4449721450384689e-02 -5.0095864748099283e-03 + 9 2.3382357298030276e-03 -4.9795743974983360e-03 4.7253558082075466e-03 + 10 -2.6590360258707150e+01 -2.4970276351674769e+00 -3.1129601743694533e+00 + 11 -7.3134792923597173e-04 1.9032215032672836e-03 -9.3256681902429458e-04 + 12 1.7392504041553195e+01 1.6614500294616306e+01 -1.1525610409038258e+01 + 13 -4.4725111516160211e-04 6.6683414109912768e-05 -3.9496633116822952e-04 + 14 -9.2661730373943922e-04 1.0140352410632476e-04 3.6534949992148079e-04 + 15 2.9024791889284857e-04 -6.6951656531770280e-04 -1.6089489608169978e-03 + 16 9.2550930968778164e+00 -1.4172764303211066e+01 1.4650722766335498e+01 + 17 -7.1372956122013505e-03 1.1866425429197226e-02 -1.0987945058536855e-02 + 18 -4.6110042616733940e-03 -3.6918674054879285e-03 3.9200722210762330e-03 + 19 -8.3531902264878861e-04 -3.4187691542251252e-03 1.1970472261388270e-03 + 20 4.8722089844996472e-05 -9.0967451046265909e-04 5.8029083649897167e-04 + 21 -1.1990806097734185e-03 2.6709175185908756e-03 -3.6321508238329304e-05 + 22 5.3880228206077779e-05 -9.1632610286722675e-04 4.5622118470204064e-04 + 23 3.2985381911583767e-04 -9.5991952060535976e-04 5.6180196557683779e-04 + 24 5.6668048368229014e-04 2.3650235314503863e-03 -8.5981331877763186e-04 + 25 -1.2694754165569323e-03 -1.2688103177448281e-03 -4.7551120820740658e-04 + 26 -7.2960242884551047e-05 -1.4230179247312527e-03 5.6686642501669303e-04 + 27 -1.4965727761262813e-03 2.5382973054268645e-03 -1.1621717469704692e-03 + 28 5.3244608348053033e-04 -1.5238550051417405e-03 6.4940813491634836e-04 + 29 1.6207581161454922e-03 -1.1057207815271884e-03 5.2719941898918515e-04 +run_vdwl: 7.26365406475285 +run_coul: 0.248568703723301 +run_stress: ! |2- + 3.0455458551527069e+01 3.6060658785946110e+01 2.3963060954014825e+01 -3.0917610764641701e+00 -8.3692413122878833e+00 -1.5762259681730853e+01 +run_forces: ! |2 + 1 -1.2241448393434258e-02 2.5678835346021285e-02 8.6551025659508465e-03 + 2 2.2141682262831661e-03 -3.4548192779372483e-03 -5.6358894590200119e-03 + 3 -9.5274258203311106e+00 9.7780244611750256e+00 6.3165209597242820e+00 + 4 -3.2811588830172249e-06 -2.6819228515587412e-05 -2.1518475973500507e-04 + 5 -7.7415759108086647e-04 6.4407102146438666e-04 -4.0525139680045488e-04 + 6 9.4737117718410655e+00 -9.7260810517073768e+00 -6.3285042083939871e+00 + 7 7.0425307253221521e-03 5.7709245539115696e-03 4.7653372189467146e-03 + 8 1.1398612415401431e-02 -2.3627301955902472e-02 -4.8618995958358531e-03 + 9 2.3359916535966785e-03 -5.0329472804706947e-03 4.7522391301401462e-03 + 10 -2.3734753080885344e+01 -2.4097202312244441e+00 -2.5316780905568450e+00 + 11 -7.2829817664630018e-04 1.9125242121991804e-03 -9.2494743303999445e-04 + 12 1.5659329657060242e+01 1.4751610959352956e+01 -1.0328793684751705e+01 + 13 -4.4580690123627005e-04 4.5558037008791715e-05 -3.8438956158700824e-04 + 14 -9.5984490482516126e-04 7.9693734429197576e-05 3.5395752765417639e-04 + 15 3.1625630081963450e-04 -6.6553770631136617e-04 -1.5826845213627427e-03 + 16 8.1343632186169703e+00 -1.2399514212841058e+01 1.2873016002623592e+01 + 17 -7.1074247952365261e-03 1.1926215502945592e-02 -1.1009929932674739e-02 + 18 -4.5970055016503111e-03 -3.6143197105911154e-03 3.9584488744033308e-03 + 19 -8.3200916550028306e-04 -3.4741972394973001e-03 1.2266616877061479e-03 + 20 7.4081426229622829e-05 -8.7350906552230933e-04 4.9764218126009034e-04 + 21 -1.1906009089604943e-03 2.5756563144885654e-03 -4.2302404729008136e-07 + 22 8.1412767645127314e-05 -8.7201669043244362e-04 4.3407541600694560e-04 + 23 3.0266704925954112e-04 -9.3347119735523009e-04 5.3885441015159310e-04 + 24 5.4003503505448407e-04 2.3414457884219351e-03 -8.7864315011120843e-04 + 25 -1.1998517807961144e-03 -1.2195798451887995e-03 -3.9268574712746714e-04 + 26 -9.4397579697665411e-05 -1.4188935351813869e-03 5.4472747495768327e-04 + 27 -1.5112178836960491e-03 2.5509163238533351e-03 -1.1115968431743000e-03 + 28 5.6209546531181933e-04 -1.5103589786084138e-03 6.2212850427396894e-04 + 29 1.5917473748970931e-03 -1.1219938783333908e-03 4.9337178773007230e-04 +... diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml new file mode 100644 index 0000000000..0f3866e61d --- /dev/null +++ b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml @@ -0,0 +1,97 @@ +--- +lammps_version: 30 Jun 2020 +date_generated: Sun Jul 12 19:14:20 202 +epsilon: 1e-13 +prerequisites: ! | + atom full + pair tip4p/long/soft +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_modify mix arithmetic + pair_modify table 0 + kspace_style pppm/tip4p 1.0e-6 + kspace_modify gewald 0.3 + kspace_modify compute no +input_file: in.fourmol +pair_style: tip4p/long/soft 5 2 5 1 0.15 10.0 +pair_coeff: ! | + * * +extract: ! | + cut_coul 0 + qdist 0 + typeO 0 + typeH 0 + typeA 0 + typeB 0 +natoms: 29 +init_vdwl: 0 +init_coul: 220.904555359383 +init_stress: ! |- + -3.1383522071804158e+01 -4.1960152113677644e+01 -3.8477634382983439e+01 1.2128496669147679e-01 -1.1198183080297536e+01 6.5268065842458656e+00 +init_forces: ! |2 + 1 2.6118798121573339e+00 -5.1644240368157168e-01 1.8001437196967410e-01 + 2 -1.9557407939667784e-01 -2.8434279090485344e+00 -1.2037666274486341e+00 + 3 1.3516729385656326e-02 -8.3981675119811638e-02 1.3800938031093543e-02 + 4 -7.9314978889013857e-02 1.6212643266693107e-02 -2.3663785465653561e-01 + 5 -5.4637120859630939e-01 6.5600989679059629e-01 -6.8980117595427104e-02 + 6 1.4667908736646822e+00 -3.8991837337279565e+00 -2.5411858592494596e+00 + 7 -6.7512752271559159e-02 8.9321193431929236e-01 3.8067644595952399e+00 + 8 -1.4944738413316052e+00 4.5568557152238283e+00 2.3556173395822269e+00 + 9 1.5618105874324246e+00 -5.8578891996706437e+00 1.3701350515471384e+00 + 10 -2.6110782215753048e-01 3.6476179750311333e-01 -2.2728997157574121e-01 + 11 -9.3766462457826905e-01 1.0563563299185068e+00 -5.5775022539970631e-01 + 12 2.8818522397941928e+00 -5.4162419106234894e-01 1.4389000151728266e+00 + 13 -7.5720425159299595e-02 3.8772041103398963e-02 -1.8346431648817585e-01 + 14 -1.0557020156519512e+00 3.6717714938726143e-01 -1.0728817695848940e-01 + 15 3.5162907632314466e-01 -1.9165325094615621e-01 -1.0148660141104417e+00 + 16 -9.0625899241785468e-01 -4.0978261630457780e-01 2.0869169313568565e+00 + 17 -2.2809774497744830e+00 6.2063926325737908e+00 -6.6646229271776178e+00 + 18 3.7211451024737952e-01 4.7949556440316261e+00 -7.9026298092983307e+00 + 19 1.9911596893384120e+00 -7.2195675725850206e-01 5.5334689749229105e+00 + 20 -2.9127135301570397e+00 -4.0021946638596519e+00 4.1375019377447915e+00 + 21 1.5279890933802478e+00 3.2050983299936133e+00 -6.7676269505726276e+00 + 22 4.4657588078956723e+00 1.0585032152255676e+00 5.8268290139589860e+00 + 23 -6.2938601634201303e+00 -3.9616631352879410e+00 1.3192732707154482e+00 + 24 -1.0816004906486070e+00 6.8108467987003323e+00 -3.6672013590293373e+00 + 25 4.9746167445264264e+00 -5.2361422570157790e-01 3.9262159421100877e+00 + 26 -4.3769290854851999e+00 -6.4816134554785325e+00 -8.1534775153570904e-01 + 27 -1.5366446134631597e+00 7.3612903591829397e+00 -2.7208483294328234e+00 + 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 + 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 +run_vdwl: 0 +run_coul: 220.048510859325 +run_stress: ! |- + -3.2535424832930019e+01 -4.2286524075903131e+01 -3.8162313208279478e+01 -4.1743354710271896e-01 -1.2139232458029813e+01 5.8729467776122277e+00 +run_forces: ! |2 + 1 2.6131680688578154e+00 -4.8342036562208102e-01 1.7840269686868443e-01 + 2 -2.6939190738423663e-01 -2.8744087695580736e+00 -1.1967949910131610e+00 + 3 1.2241135645135771e-02 -8.6362308224595855e-02 1.1995426233952385e-02 + 4 -7.0078081577080231e-02 1.4086570549491383e-02 -2.4078706748322398e-01 + 5 -5.3142632409359181e-01 6.5625319261530102e-01 -7.2314716767237025e-02 + 6 1.4298787244106805e+00 -3.8679855040858215e+00 -2.4359356032175739e+00 + 7 -2.8086280811704004e-02 8.7464586204498906e-01 3.6888214179346623e+00 + 8 -1.4124231673653769e+00 4.5103522011087218e+00 2.3342920102440403e+00 + 9 1.5527910417285362e+00 -5.9309328825446554e+00 1.4750790176848587e+00 + 10 -2.6235523448699766e-01 3.5757233063187277e-01 -2.3417827221851351e-01 + 11 -9.3594524483215680e-01 1.0583932974703241e+00 -5.4054985783631648e-01 + 12 2.8734736478986935e+00 -5.2369178235061564e-01 1.4455704041055824e+00 + 13 -8.4886264911342699e-02 2.7649029763421085e-02 -1.8007451630217339e-01 + 14 -1.0584924718013251e+00 3.7660596014862868e-01 -9.7984064821398389e-02 + 15 3.6566431724606685e-01 -2.1408413234424195e-01 -1.0347874829171970e+00 + 16 -9.0367323048165127e-01 -4.2277164147395230e-01 2.1071808187769565e+00 + 17 -2.3201090242227158e+00 6.3375931983791283e+00 -6.7748042498550483e+00 + 18 -1.0367666932119959e-01 4.2968689902744623e+00 -7.6416292443809883e+00 + 19 2.4130269465315481e+00 -3.6969316688457571e-01 5.7255888895370948e+00 + 20 -2.8499218759756748e+00 -3.8615438627050023e+00 3.6703556042733458e+00 + 21 1.6073193457487478e+00 3.0641132400813054e+00 -6.7626431241090277e+00 + 22 4.7465924706127307e+00 1.2150404360141627e+00 5.8893302084534209e+00 + 23 -6.6490042695559275e+00 -3.9871914593958206e+00 1.2434831896174121e+00 + 24 -1.2659428719544588e+00 6.9952347078745021e+00 -3.8287643151949902e+00 + 25 5.4119777555846147e+00 -3.6930902052235925e-01 4.3221517005393322e+00 + 26 -4.6115306062268111e+00 -6.7996016068395502e+00 -1.0144993079163778e+00 + 27 -1.6939299606678804e+00 7.5603905691193454e+00 -2.6741555445541247e+00 + 28 6.6722824605425552e+00 -2.2264192462822541e+00 4.2717918034742217e+00 + 29 -4.6475424291369931e+00 -5.3273838372420599e+00 -1.6341408291562105e+00 +... From 5ee434670037bb7add4a5522b8776026f7a475f7 Mon Sep 17 00:00:00 2001 From: abhishandy Date: Mon, 10 Aug 2020 17:16:07 -0400 Subject: [PATCH 23/25] fixed test for tip4p_long_soft, and mentioned the required coefficients for coul/*/soft sub-styles --- doc/src/pair_fep_soft.rst | 8 +- .../tests/mol-pair-tip4p_long_soft.yaml | 150 +++++++++--------- 2 files changed, 84 insertions(+), 74 deletions(-) diff --git a/doc/src/pair_fep_soft.rst b/doc/src/pair_fep_soft.rst index eafd6b5e9b..fb10039e44 100644 --- a/doc/src/pair_fep_soft.rst +++ b/doc/src/pair_fep_soft.rst @@ -161,11 +161,11 @@ Examples pair_style coul/long/soft 1.0 10.0 9.5 pair_coeff * * 1.0 - pair_coeff 1 1 1.0 9.5 + pair_coeff 1 1 1.0 pair_style tip4p/long/soft 1 2 7 8 0.15 2.0 0.5 10.0 9.8 pair_coeff * * 1.0 - pair_coeff 1 1 1.0 9.5 + pair_coeff 1 1 1.0 pair_style morse/soft 4 0.9 10.0 pair_coeff * * 100.0 2.0 1.5 1.0 @@ -284,7 +284,9 @@ core. Hence, if used by themselves, there will be no repulsion to keep two oppositely charged particles from overlapping each other. In this case, if :math:`\lambda = 1`, a singularity may occur. These sub-styles are suitable to represent charges embedded in the Lennard-Jones radius of another site (for -example hydrogen atoms in several water models). +example hydrogen atoms in several water models). The :math:`\lambda` must +be defined for each pair, and *coul/cut/soft* can accept an optional cutoff as +the second coefficient. .. note:: diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml index 0f3866e61d..c55d60adf9 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml @@ -1,10 +1,12 @@ --- -lammps_version: 30 Jun 2020 -date_generated: Sun Jul 12 19:14:20 202 +lammps_version: 21 Jul 2020 +date_generated: Mon Aug 10 17:03:53 202 epsilon: 1e-13 prerequisites: ! | atom full + pair hybrid/overlay pair tip4p/long/soft + pair lj/cut pre_commands: ! | variable newton_pair delete variable newton_pair index on @@ -15,83 +17,89 @@ post_commands: ! | kspace_modify gewald 0.3 kspace_modify compute no input_file: in.fourmol -pair_style: tip4p/long/soft 5 2 5 1 0.15 10.0 +pair_style: hybrid/overlay tip4p/long/soft 5 2 5 1 0.15 4.0 2.5 10.0 lj/cut 8.0 pair_coeff: ! | - * * + 1 1 lj/cut 0.02 2.5 + 2 2 lj/cut 0.005 1.0 + 2 4 lj/cut 0.005 0.5 + 3 3 lj/cut 0.02 3.2 + 4 4 lj/cut 0.015 3.1 + 5 5 lj/cut 0.015 3.1 + * * tip4p/long/soft 0.83 extract: ! | - cut_coul 0 qdist 0 typeO 0 typeH 0 typeA 0 typeB 0 + lambda 2 natoms: 29 -init_vdwl: 0 -init_coul: 220.904555359383 -init_stress: ! |- - -3.1383522071804158e+01 -4.1960152113677644e+01 -3.8477634382983439e+01 1.2128496669147679e-01 -1.1198183080297536e+01 6.5268065842458656e+00 +init_vdwl: 8.07036960332134 +init_coul: 100.236229731909 +init_stress: ! |2- + 2.0560777882594444e+01 2.1654965423904063e+01 1.0056493693519297e+01 -2.4240063285208659e+00 -1.3467251681546395e+01 -1.4781331319647906e+01 init_forces: ! |2 - 1 2.6118798121573339e+00 -5.1644240368157168e-01 1.8001437196967410e-01 - 2 -1.9557407939667784e-01 -2.8434279090485344e+00 -1.2037666274486341e+00 - 3 1.3516729385656326e-02 -8.3981675119811638e-02 1.3800938031093543e-02 - 4 -7.9314978889013857e-02 1.6212643266693107e-02 -2.3663785465653561e-01 - 5 -5.4637120859630939e-01 6.5600989679059629e-01 -6.8980117595427104e-02 - 6 1.4667908736646822e+00 -3.8991837337279565e+00 -2.5411858592494596e+00 - 7 -6.7512752271559159e-02 8.9321193431929236e-01 3.8067644595952399e+00 - 8 -1.4944738413316052e+00 4.5568557152238283e+00 2.3556173395822269e+00 - 9 1.5618105874324246e+00 -5.8578891996706437e+00 1.3701350515471384e+00 - 10 -2.6110782215753048e-01 3.6476179750311333e-01 -2.2728997157574121e-01 - 11 -9.3766462457826905e-01 1.0563563299185068e+00 -5.5775022539970631e-01 - 12 2.8818522397941928e+00 -5.4162419106234894e-01 1.4389000151728266e+00 - 13 -7.5720425159299595e-02 3.8772041103398963e-02 -1.8346431648817585e-01 - 14 -1.0557020156519512e+00 3.6717714938726143e-01 -1.0728817695848940e-01 - 15 3.5162907632314466e-01 -1.9165325094615621e-01 -1.0148660141104417e+00 - 16 -9.0625899241785468e-01 -4.0978261630457780e-01 2.0869169313568565e+00 - 17 -2.2809774497744830e+00 6.2063926325737908e+00 -6.6646229271776178e+00 - 18 3.7211451024737952e-01 4.7949556440316261e+00 -7.9026298092983307e+00 - 19 1.9911596893384120e+00 -7.2195675725850206e-01 5.5334689749229105e+00 - 20 -2.9127135301570397e+00 -4.0021946638596519e+00 4.1375019377447915e+00 - 21 1.5279890933802478e+00 3.2050983299936133e+00 -6.7676269505726276e+00 - 22 4.4657588078956723e+00 1.0585032152255676e+00 5.8268290139589860e+00 - 23 -6.2938601634201303e+00 -3.9616631352879410e+00 1.3192732707154482e+00 - 24 -1.0816004906486070e+00 6.8108467987003323e+00 -3.6672013590293373e+00 - 25 4.9746167445264264e+00 -5.2361422570157790e-01 3.9262159421100877e+00 - 26 -4.3769290854851999e+00 -6.4816134554785325e+00 -8.1534775153570904e-01 - 27 -1.5366446134631597e+00 7.3612903591829397e+00 -2.7208483294328234e+00 - 28 6.4035032875423159e+00 -2.1779017025677483e+00 4.1727109672631357e+00 - 29 -4.5201953782892055e+00 -5.1735155675050022e+00 -1.4886429234413563e+00 -run_vdwl: 0 -run_coul: 220.048510859325 -run_stress: ! |- - -3.2535424832930019e+01 -4.2286524075903131e+01 -3.8162313208279478e+01 -4.1743354710271896e-01 -1.2139232458029813e+01 5.8729467776122277e+00 + 1 1.1274640438568120e+00 -2.7751438713476445e-01 1.8790157920119499e-01 + 2 -8.1752474659205140e-03 -1.2699647841871851e+00 -6.6459159127307632e-01 + 3 -1.0359163487629111e+01 1.0628743132498057e+01 6.9531443122386021e+00 + 4 -3.8774507719289648e-02 6.8713592138544667e-03 -1.1229959830689475e-01 + 5 -2.5662749622784636e-01 3.0016453264313309e-01 -3.0975775200070998e-02 + 6 1.0960634574125447e+01 -1.2382387659312155e+01 -8.0618970130884442e+00 + 7 -2.2832342249723914e-02 4.0208606857513818e-01 1.6920699571811064e+00 + 8 -6.8521757840727771e-01 2.0368233934687781e+00 9.7118125999477067e-01 + 9 7.4909470156608438e-01 -2.6744666902612630e+00 7.6981273184827481e-01 + 10 -2.6708236457335047e+01 -2.3350711235384516e+00 -3.2210899693251669e+00 + 11 -4.3462661520328849e-01 4.9338265093982914e-01 -2.5789183190888032e-01 + 12 1.8728378079288682e+01 1.6353733318327308e+01 -1.0844583731336934e+01 + 13 -2.4463327596094566e-02 1.2857926819797217e-02 -8.6110469907762582e-02 + 14 -4.9151265846168884e-01 1.7025446557900215e-01 -6.2082087769697814e-02 + 15 1.6354568305672246e-01 -7.7698250077885903e-02 -4.6974575369116089e-01 + 16 8.8587570764212451e+00 -1.4378065918299963e+01 1.5533451154012512e+01 + 17 -1.0936837040746663e+00 2.9076882464810643e+00 -3.0280186326297125e+00 + 18 1.4165835835894441e-01 2.1223098841030583e+00 -3.2865754977449257e+00 + 19 7.5955373016364403e-01 -4.4338928207346051e-01 2.3485104425164778e+00 + 20 -1.1613012874078987e+00 -1.6523434765045006e+00 1.7676741920085632e+00 + 21 6.0531811555082471e-01 1.3729063968893083e+00 -2.7923868706589650e+00 + 22 1.7600151197582461e+00 3.8208254002861425e-01 2.3799251532831041e+00 + 23 -2.5067133471709186e+00 -1.6128262839507992e+00 5.9072667161630799e-01 + 24 -4.3247234229563630e-01 2.8558353857286596e+00 -1.5284257874942948e+00 + 25 1.9422682067556065e+00 -2.8471459149302958e-01 1.5547858160286778e+00 + 26 -1.7355243132931133e+00 -2.6615580136173165e+00 -2.8544328258369955e-01 + 27 -6.6046529049546032e-01 3.0880567198108069e+00 -1.1428285831811784e+00 + 28 2.5715778047995865e+00 -9.5077350547568862e-01 1.6962019769146084e+00 + 29 -1.7484754906688658e+00 -2.1330220551799459e+00 -5.7043877074333793e-01 +run_vdwl: 7.24904956330063 +run_coul: 99.911855870525 +run_stress: ! |2- + 1.7268554752664841e+01 1.7311029436658394e+01 7.4057024614157427e+00 -2.3588244888881453e+00 -1.3227628622475972e+01 -1.2896658593010248e+01 run_forces: ! |2 - 1 2.6131680688578154e+00 -4.8342036562208102e-01 1.7840269686868443e-01 - 2 -2.6939190738423663e-01 -2.8744087695580736e+00 -1.1967949910131610e+00 - 3 1.2241135645135771e-02 -8.6362308224595855e-02 1.1995426233952385e-02 - 4 -7.0078081577080231e-02 1.4086570549491383e-02 -2.4078706748322398e-01 - 5 -5.3142632409359181e-01 6.5625319261530102e-01 -7.2314716767237025e-02 - 6 1.4298787244106805e+00 -3.8679855040858215e+00 -2.4359356032175739e+00 - 7 -2.8086280811704004e-02 8.7464586204498906e-01 3.6888214179346623e+00 - 8 -1.4124231673653769e+00 4.5103522011087218e+00 2.3342920102440403e+00 - 9 1.5527910417285362e+00 -5.9309328825446554e+00 1.4750790176848587e+00 - 10 -2.6235523448699766e-01 3.5757233063187277e-01 -2.3417827221851351e-01 - 11 -9.3594524483215680e-01 1.0583932974703241e+00 -5.4054985783631648e-01 - 12 2.8734736478986935e+00 -5.2369178235061564e-01 1.4455704041055824e+00 - 13 -8.4886264911342699e-02 2.7649029763421085e-02 -1.8007451630217339e-01 - 14 -1.0584924718013251e+00 3.7660596014862868e-01 -9.7984064821398389e-02 - 15 3.6566431724606685e-01 -2.1408413234424195e-01 -1.0347874829171970e+00 - 16 -9.0367323048165127e-01 -4.2277164147395230e-01 2.1071808187769565e+00 - 17 -2.3201090242227158e+00 6.3375931983791283e+00 -6.7748042498550483e+00 - 18 -1.0367666932119959e-01 4.2968689902744623e+00 -7.6416292443809883e+00 - 19 2.4130269465315481e+00 -3.6969316688457571e-01 5.7255888895370948e+00 - 20 -2.8499218759756748e+00 -3.8615438627050023e+00 3.6703556042733458e+00 - 21 1.6073193457487478e+00 3.0641132400813054e+00 -6.7626431241090277e+00 - 22 4.7465924706127307e+00 1.2150404360141627e+00 5.8893302084534209e+00 - 23 -6.6490042695559275e+00 -3.9871914593958206e+00 1.2434831896174121e+00 - 24 -1.2659428719544588e+00 6.9952347078745021e+00 -3.8287643151949902e+00 - 25 5.4119777555846147e+00 -3.6930902052235925e-01 4.3221517005393322e+00 - 26 -4.6115306062268111e+00 -6.7996016068395502e+00 -1.0144993079163778e+00 - 27 -1.6939299606678804e+00 7.5603905691193454e+00 -2.6741555445541247e+00 - 28 6.6722824605425552e+00 -2.2264192462822541e+00 4.2717918034742217e+00 - 29 -4.6475424291369931e+00 -5.3273838372420599e+00 -1.6341408291562105e+00 + 1 1.1278716657036829e+00 -2.6258678041342415e-01 1.9538437509672252e-01 + 2 -3.9676823681212982e-02 -1.2850233836949423e+00 -6.6803498770516612e-01 + 3 -9.4760567468241792e+00 9.6957989045886777e+00 6.2944176336550850e+00 + 4 -3.3168171571644096e-02 5.7704850010495169e-03 -1.1426546444723396e-01 + 5 -2.5048894068746391e-01 3.0038236609978475e-01 -3.3751199287618265e-02 + 6 1.0055350163583444e+01 -1.1431044936813379e+01 -7.3653563187915854e+00 + 7 -4.6209803855489368e-03 3.8543231435584174e-01 1.6515226454394019e+00 + 8 -6.5234607389721311e-01 2.0255440893673859e+00 9.5127903951105719e-01 + 9 7.4452791812005681e-01 -2.7066417590171179e+00 8.1503724100149588e-01 + 10 -2.3829098729829035e+01 -2.2599021701791333e+00 -2.6314817812596623e+00 + 11 -4.3274368894391779e-01 4.9145021406791028e-01 -2.4945411427223665e-01 + 12 1.6980364542766559e+01 1.4489682516099752e+01 -9.6372227483708528e+00 + 13 -3.0499236362302704e-02 8.5704383262029168e-03 -8.4575528296466557e-02 + 14 -4.8927749265401771e-01 1.7489541546329301e-01 -5.6958241413008877e-02 + 15 1.7309877483511280e-01 -8.8541792285525320e-02 -4.8073433757675438e-01 + 16 7.7170020069871450e+00 -1.2582802138795630e+01 1.3749590325801609e+01 + 17 -1.1014220836499897e+00 2.9517040521006654e+00 -3.0758280750634763e+00 + 18 -5.3109684989899320e-02 1.9235656396790723e+00 -3.1515066237287179e+00 + 19 9.2467038597949081e-01 -3.0844991584141779e-01 2.4155443336900446e+00 + 20 -1.1282027113852207e+00 -1.5870971471270534e+00 1.5624094409756832e+00 + 21 6.2530066466767331e-01 1.3012413310446329e+00 -2.7547234320822804e+00 + 22 1.8558491629776710e+00 4.4201627758048212e-01 2.3787636307402855e+00 + 23 -2.6209180821234201e+00 -1.6054037314698315e+00 5.5158435669485273e-01 + 24 -5.0167023518445786e-01 2.8919413595177517e+00 -1.5751546389610793e+00 + 25 2.0828183410931089e+00 -2.2433373855840710e-01 1.6879138663646718e+00 + 26 -1.7999157459828961e+00 -2.7490806231475635e+00 -3.5718231595876937e-01 + 27 -7.1445352480310931e-01 3.1361391652740100e+00 -1.1076521775768413e+00 + 28 2.6447579347741770e+00 -9.6083364912278246e-01 1.7125826632673491e+00 + 29 -1.7739426085325893e+00 -2.1723928021003038e+00 -6.2214756744651156e-01 ... From 46021a57a65a1ae868b084b26fe31a9148c6fa37 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Tue, 11 Aug 2020 12:22:07 -0400 Subject: [PATCH 24/25] addressed incompatibility with long range coulombics --- doc/src/bond_special.rst | 13 ++++--------- src/USER-MISC/bond_special.cpp | 3 +++ src/USER-MISC/bond_special.h | 4 ++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index bbaf56afe4..8c90179e96 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -73,8 +73,8 @@ ensure that the new bonds created by this style do not create spurious Specifically 1-2 interactions must have weights of zero, 1-3 interactions must either have weights of unity or :doc:`special_bonds angle yes ` must be used, and 1-4 interactions must -have weights of unity or the *dihedral* setting must be turned on or -:doc:`special_bonds dihedral yes ` must be used. +have weights of unity or :doc:`special_bonds dihedral yes ` +must be used. If this command is used to create bonded interactions between particles that are further apart than usual (e.g. 1-5 or 1-6 @@ -92,13 +92,8 @@ page for more info. This bond style requires use of a :doc:`pair_style ` which computes a pairwise interaction. Many-body potentials do not. -Q: Does this command work with long-range Coulombics? E.g. if used to -weight 1-5 interactions between charged particles and also used with -PPPM, does it give the right answer? The special bond weight settings -are treated explicity in pair styles like pair lj/cut/coul/long. -Either way, the answer to this Q should be explained on this page. -And if the answer is no, then I think an error check should be made in -the code. +This command is not compatible with long-range Coulombic interactions. If a +`kspace_style ` is declared, an error will be issued. Related commands """""""""""""""" diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 4621640f51..30630147ce 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -61,6 +61,9 @@ void BondSpecial::init_style() force->special_coul[3] != 1.0)) error->all(FLERR,"Invalid 1-4 setting for bond style special."); + if (force->kspace != NULL) + error->all(FLERR,"Bond style special is not compatible with long range " + "Coulombic interactions"); } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h index 9885e811ed..389990b1d7 100644 --- a/src/USER-MISC/bond_special.h +++ b/src/USER-MISC/bond_special.h @@ -71,4 +71,8 @@ E: Invalid 1-4 setting for bond style special. Bond style special must be used with 1.0 factors for 1-4 special bonds or the dihedral keyword set to yes. +E: Bond style special is not compatible with long range Coulombic interactions. + +Self-explanatory. + */ From 3cae295f5bf3728973b3d073cbbccab76d0bfb76 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Aug 2020 15:04:03 -0400 Subject: [PATCH 25/25] make test for unsupported pair styles more restrictive and improve docs about that EAM styles have a single function but are not compatible, so we test for single_enable == 0 and manybody_flag != 0. Improve explanation in the documentation about which pair styles are not supported. --- doc/src/bond_special.rst | 7 +++++-- src/USER-MISC/bond_special.cpp | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index 8c90179e96..f7dc43a1b2 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -89,8 +89,11 @@ This bond style can only be used if LAMMPS was built with the USER-MISC package. See the :doc:`Build package ` doc page for more info. -This bond style requires use of a :doc:`pair_style ` which -computes a pairwise interaction. Many-body potentials do not. +This bond style requires the use of a :doc:`pair_style ` which +computes a pairwise additive interaction and provides the ability to +compute interactions for individual pairs of atoms. Manybody potentials +are not compatible in general, but also some other pair styles are missing +the required functionality and thus will cause an error. This command is not compatible with long-range Coulombic interactions. If a `kspace_style ` is declared, an error will be issued. diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 30630147ce..6c734d482e 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -47,7 +47,8 @@ BondSpecial::~BondSpecial() void BondSpecial::init_style() { - if (force->pair == NULL || force->pair->single_enable == 0) + if (force->pair == NULL) error->all(FLERR,"No pair style defined"); + else if ((force->pair->single_enable == 0) || force->pair->manybody_flag) error->all(FLERR,"Pair style does not support bond style special"); if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0)