diff --git a/doc/src/fix_bond_create.rst b/doc/src/fix_bond_create.rst index 7850e9c27a..62319751e0 100644 --- a/doc/src/fix_bond_create.rst +++ b/doc/src/fix_bond_create.rst @@ -124,6 +124,8 @@ potentials are simultaneously introduced after the formation of the new bond. Without a restriction on the permissible angle, and for stiffer angle potentials very large energies can arise and lead to uncontrolled behavior. +The *aconstrain* keyword is only available +when LAMMPS was built with the FixBondCreateAngle class. Any bond that is created is assigned a bond type of *bondtype*. @@ -255,9 +257,6 @@ This fix is part of the MC package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -The *aconstrain* keyword is only available -when LAMMPS was built with the FixBondCreateAngle class. - Related commands """""""""""""""" diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 0647bfc0e6..69b1e312f0 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -27,9 +27,11 @@ #include "random_mars.h" #include "memory.h" #include "error.h" +#include "math_const.h" using namespace LAMMPS_NS; using namespace FixConst; +using namespace MathConst; #define BIG 1.0e20 #define DELTA 16 @@ -126,7 +128,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : if (itype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"aconstrain") == 0 && - strcmp(arg[2],"bond/create/angle") == 0) { + strcmp(style,"bond/create/angle") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create/angle command"); amin = force->numeric(FLERR,arg[iarg+1]); @@ -137,8 +139,8 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix bond/create/angle command"); if (amax < 0 || amax > 180) error->all(FLERR,"Illegal fix bond/create/angle command"); - amin = (3.14159265358979323846/180.0) * amin; - amax = (3.14159265358979323846/180.0) * amax; + amin = (MY_PI/180.0) * amin; + amax = (MY_PI/180.0) * amax; constrainflag = 1; iarg += 3; } else error->all(FLERR,"Illegal fix bond/create command"); diff --git a/src/MC/fix_bond_create_angle.cpp b/src/MC/fix_bond_create_angle.cpp index 3a1eac7947..9b069e0782 100644 --- a/src/MC/fix_bond_create_angle.cpp +++ b/src/MC/fix_bond_create_angle.cpp @@ -49,6 +49,8 @@ int FixBondCreateAngle::constrain(int i, int j, double amin, double amax) double v2y = 0.0; double v2z = 0.0; + double angle1,angle2; + int flag = 0; // pass if both atoms have no neighbors: bond is always formed diff --git a/src/MC/fix_bond_create_angle.h b/src/MC/fix_bond_create_angle.h index 836a056783..41fe5909f8 100644 --- a/src/MC/fix_bond_create_angle.h +++ b/src/MC/fix_bond_create_angle.h @@ -29,7 +29,6 @@ class FixBondCreateAngle : public FixBondCreate { FixBondCreateAngle(class LAMMPS *, int, char **); private: - double angle1,angle2,amin,amax; int constrain(int, int, double, double); };