Unverified Commit 48b7b7d7 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

fix up change_box and displace_atoms lost atoms error message

parent 54a8b4e0
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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));
}

/* ----------------------------------------------------------------------
+5 −6
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "math_extra.h"
#include "memory.h"
#include "error.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace MathConst;
@@ -353,12 +354,10 @@ void DisplaceAtoms::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 displace_atoms: 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 displace_atoms: "
                                     "original {} current {}",
                                     atom->natoms,natoms);
}

/* ----------------------------------------------------------------------