From 9e5b419e4eeb4c194e1fe25f92fe7dbdbc44f826 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 16 Dec 2022 08:33:26 -0700 Subject: [PATCH] Fix bug when atoms are added after run --- src/read_data.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/read_data.cpp b/src/read_data.cpp index 9d9d7139a5..7cb1209ed1 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -375,6 +375,14 @@ void ReadData::command(int narg, char **arg) if (addflag == NONE) { domain->box_exist = 1; update->ntimestep = 0; + } else { + + // clear ghost count and any ghost bonus data internal to AtomVec + // same logic as beginning of Comm::exchange() + // do it now b/c creating atoms will overwrite ghost atoms + + atom->nghost = 0; + atom->avec->clear_bonus(); } // compute atomID and optionally moleculeID offset for addflag = APPEND