diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 9c66d1d19b..f070d0a53f 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -441,10 +441,12 @@ void CreateAtoms::command(int narg, char **arg) MPI_Barrier(world); double time1 = platform::walltime(); + // clear global->local map for owned and ghost atoms // 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 + if (atom->map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); diff --git a/src/read_data.cpp b/src/read_data.cpp index 7cb1209ed1..757954ff0e 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -377,10 +377,12 @@ void ReadData::command(int narg, char **arg) update->ntimestep = 0; } else { + // clear global->local map for owned and ghost atoms // 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 + // do it now b/c adding atoms will overwrite ghost atoms + if (atom->map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); }