From acd20512f0ddcb079c3526615e29146275c9ed31 Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Fri, 15 Jun 2018 17:40:14 -0400
Subject: [PATCH] require that box is defined before molecule command is issued

---
 src/molecule.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/molecule.cpp b/src/molecule.cpp
index e9baf515c4..dfbe3e1e08 100644
--- a/src/molecule.cpp
+++ b/src/molecule.cpp
@@ -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]);
-- 
GitLab