fix up change_box and displace_atoms lost atoms error message

This commit is contained in:
Axel Kohlmeyer
2020-06-04 21:40:13 -04:00
parent 54a8b4e08b
commit 48b7b7d722
2 changed files with 11 additions and 12 deletions

View File

@ -26,6 +26,8 @@
#include "group.h"
#include "error.h"
#include "force.h"
#include "utils.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
@ -388,12 +390,10 @@ void ChangeBox::command(int narg, char **arg)
bigint natoms;
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (natoms != atom->natoms && comm->me == 0) {
char str[128];
sprintf(str,"Lost atoms via change_box: original " BIGINT_FORMAT
" current " BIGINT_FORMAT,atom->natoms,natoms);
error->warning(FLERR,str);
}
if (natoms != atom->natoms && comm->me == 0)
error->warning(FLERR,fmt::format("Lost atoms via change_box: "
"original {} current {}",
atom->natoms,natoms));
}
/* ----------------------------------------------------------------------