require that box is defined before molecule command is issued

This commit is contained in:
Axel Kohlmeyer
2018-06-15 17:40:14 -04:00
parent 5fcdfe6dcb
commit acd20512f0

View File

@ -52,6 +52,9 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) :
if (index >= narg) error->all(FLERR,"Illegal molecule command");
if (domain->box_exist == 0)
error->all(FLERR,"Molecule command before simulation box is defined");
int n = strlen(arg[0]) + 1;
id = new char[n];
strcpy(id,arg[0]);