fix up change_box and displace_atoms lost atoms error message
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user