Unverified Commit 0c115736 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1830 from lammps/fix-bond-create-warn

add warning to fix bond/create
parents 7b8498fa cb8313d9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -195,6 +195,12 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*Fix SRD walls overlap but fix srd overlap not set*
   You likely want to set this in your input script.

* Fix bond/create is used multiple times or with fix bond/break - may not work as expected*
   When using fix bond/create multiple times or in combination with
   fix bond/break, the individual fix instances do not share information
   about changes they made at the same time step and thus it may result
   in unexpected behavior.

*Fix bond/swap will ignore defined angles*
   See the doc page for fix bond/swap for more info on this
   restriction.
+7 −0
Original line number Diff line number Diff line
@@ -239,6 +239,13 @@ will be truncated to attempt to prevent the bond from blowing up. :dd

You likely want to set this in your input script. :dd

{ Fix bond/create is used multiple times or with fix bond/break - may not work as expected} :dt

When using fix bond/create multiple times or in combination with
fix bond/break, the individual fix instances do not share information
about changes they made at the same time step and thus it may result
in unexpected behavior. :dd

{Fix bond/swap will ignore defined angles} :dt

See the doc page for fix bond/swap for more info on this
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ using namespace FixConst;

FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg),
  partner(NULL), finalpartner(NULL), distsq(NULL), probability(NULL), broken(NULL), copy(NULL), random(NULL)
  partner(NULL), finalpartner(NULL), distsq(NULL), probability(NULL), 
  broken(NULL), copy(NULL), random(NULL)
{
  if (narg < 6) error->all(FLERR,"Illegal fix bond/break command");

+14 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "respa.h"
#include "atom.h"
#include "force.h"
#include "modify.h"
#include "pair.h"
#include "comm.h"
#include "neighbor.h"
@@ -216,6 +217,19 @@ void FixBondCreate::init()
  if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype])
    error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff");

  // warn if more than one fix bond/create or also a fix bond/break
  // because this fix stores per-atom state in bondcount
  //   if other fixes create/break bonds, this fix will not know about it

  int count = 0;
  for (int i = 0; i < modify->nfix; i++) {
    if (strcmp(modify->fix[i]->style,"bond/create") == 0) count++;
    if (strcmp(modify->fix[i]->style,"bond/break") == 0) count++;
  }
  if (count > 1 && me == 0) 
    error->warning(FLERR,"Fix bond/create is used multiple times "
                   " or with fix bond/break - may not work as expected");

  // enable angle/dihedral/improper creation if atype/dtype/itype
  //   option was used and a force field has been specified

+7 −0
Original line number Diff line number Diff line
@@ -170,4 +170,11 @@ See the read_data command for info on setting the "extra special per
atom" header value to allow for additional special values to be
stored.

W: Fix bond/create is used multiple times or with fix bond/break - may not work as expected

When using fix bond/create multiple times or in combination with
fix bond/break, the individual fix instances do not share information
about changes they made at the same time step and thus it may result
in unexpected behavior.

*/