From 83291fdd67d5f0db86b1cdc893c7b1bfac5be136 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Jul 2020 18:07:25 -0400 Subject: [PATCH] may not use pair_style kim before box is defined NOTE: this will not happen when the kim_init and kim_interactions commands are used. --- src/KIM/pair_kim.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 354b660c0b..e408fae856 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -285,6 +285,13 @@ void PairKIM::allocate() void PairKIM::settings(int narg, char **arg) { + // some of the code below needs to know the number of atom types, + // but that is not set until the simulation box is created. + + if (domain->box_exist == 0) + error->all(FLERR,"May not use 'pair_style kim' command before " + "simulation box is defined"); + // This is called when "pair_style kim ..." is read from input // may be called multiple times ++settings_call_count;