diff --git a/src/angle.cpp b/src/angle.cpp index 9c2e29188a..b668171d75 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -58,7 +58,8 @@ Angle::~Angle() void Angle::init() { - if (!allocated) error->all(FLERR,"Angle coeffs are not set"); + if (!allocated && atom->nangletypes) + error->all(FLERR,"Angle coeffs are not set"); for (int i = 1; i <= atom->nangletypes; i++) if (setflag[i] == 0) error->all(FLERR,"All angle coeffs are not set"); diff --git a/src/bond.cpp b/src/bond.cpp index 941bb7e9a4..ec560b7199 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -59,7 +59,8 @@ Bond::~Bond() void Bond::init() { - if (!allocated) error->all(FLERR,"Bond coeffs are not set"); + if (!allocated && atom->nbondtypes) + error->all(FLERR,"Bond coeffs are not set"); for (int i = 1; i <= atom->nbondtypes; i++) if (setflag[i] == 0) error->all(FLERR,"All bond coeffs are not set"); init_style(); diff --git a/src/dihedral.cpp b/src/dihedral.cpp index 6f9f69ca06..26976d5801 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -59,7 +59,8 @@ Dihedral::~Dihedral() void Dihedral::init() { - if (!allocated) error->all(FLERR,"Dihedral coeffs are not set"); + if (!allocated && atom->ndihedraltypes) + error->all(FLERR,"Dihedral coeffs are not set"); for (int i = 1; i <= atom->ndihedraltypes; i++) if (setflag[i] == 0) error->all(FLERR,"All dihedral coeffs are not set"); init_style(); diff --git a/src/improper.cpp b/src/improper.cpp index f9dd99c5f2..91753cb9f4 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -56,7 +56,8 @@ Improper::~Improper() void Improper::init() { - if (!allocated) error->all(FLERR,"Improper coeffs are not set"); + if (!allocated && atom->nimpropertypes) + error->all(FLERR,"Improper coeffs are not set"); for (int i = 1; i <= atom->nimpropertypes; i++) if (setflag[i] == 0) error->all(FLERR,"All improper coeffs are not set"); }