From 9a60ab0c23063f790b2509dfdef63b860afa16c3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 4 Aug 2021 21:31:42 -0400 Subject: [PATCH] correctly insert atoms/molecules any nfreq timesteps even with multiple run this changes the computation of "next_reneighbor" so that it is based on "nfirst" which is set during the constructor of the class. This still maintains the property that the first deposit attempt is not done during setup, but on the next step. --- src/fix_deposit.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index f3b175fc78..7f153cd172 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -195,7 +195,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : force_reneighbor = 1; next_reneighbor = update->ntimestep + 1; - nfirst = next_reneighbor; + nfirst = next_reneighbor-nfreq; ninserted = 0; } @@ -288,8 +288,7 @@ void FixDeposit::init() double separation = MAX(2.0*maxradinsert,maxradall+maxradinsert); if (sqrt(nearsq) < separation && comm->me == 0) - error->warning(FLERR,"Fix deposit near setting < possible " - "overlap separation {}",separation); + error->warning(FLERR,"Fix deposit near setting < possible overlap separation {}",separation); } } @@ -297,7 +296,7 @@ void FixDeposit::init() void FixDeposit::setup_pre_exchange() { - if (ninserted < ninsert) next_reneighbor = update->ntimestep+1; + if (ninserted < ninsert) next_reneighbor = nfirst + ((update->ntimestep - nfirst)/nfreq)*nfreq + nfreq; else next_reneighbor = 0; }