diff --git a/src/atom.cpp b/src/atom.cpp index 9e1b39e044..c224ff6fd2 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1126,6 +1126,15 @@ void Atom::set_shape(const char *str) if (shape[itype][0] < 0.0 || shape[itype][1] < 0.0 || shape[itype][2] < 0.0) error->all("Invalid shape value"); + if (shape[itype][0] == 0.0 && + (shape[itype][1] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][1] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][2] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][1] != 0.0)) + error->all("Invalid shape value"); } /* ---------------------------------------------------------------------- @@ -1153,6 +1162,15 @@ void Atom::set_shape(int narg, char **arg) if (shape[itype][0] < 0.0 || shape[itype][1] < 0.0 || shape[itype][2] < 0.0) error->all("Invalid shape value"); + if (shape[itype][0] == 0.0 && + (shape[itype][1] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][1] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][2] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][1] != 0.0)) + error->all("Invalid shape value"); } }