(re-)add example uses of {fmt}

This commit is contained in:
Axel Kohlmeyer
2020-05-26 15:16:35 -04:00
parent 56cb761b04
commit b5b71bbb92
11 changed files with 144 additions and 204 deletions

View File

@ -36,6 +36,7 @@
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "fmt/format.h"
#include "lmprestart.h"
@ -498,36 +499,24 @@ void ReadRestart::command(int narg, char **arg)
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " atoms\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",natoms);
}
if (me == 0)
utils::logmesg(lmp,fmt::format(" {} atoms\n",natoms));
if (natoms != atom->natoms)
error->all(FLERR,"Did not assign all restart atoms correctly");
if (me == 0) {
if (atom->nbonds) {
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",atom->nbonds);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",atom->nbonds);
utils::logmesg(lmp,fmt::format(" {} bonds\n",atom->nbonds));
}
if (atom->nangles) {
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",
atom->nangles);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",
atom->nangles);
utils::logmesg(lmp,fmt::format(" {} angles\n",atom->nangles));
}
if (atom->ndihedrals) {
if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",
atom->ndihedrals);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",
atom->ndihedrals);
utils::logmesg(lmp,fmt::format(" {} dihedrals\n",atom->ndihedrals));
}
if (atom->nimpropers) {
if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",
atom->nimpropers);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",
atom->nimpropers);
utils::logmesg(lmp,fmt::format(" {} impropers\n",atom->nimpropers));
}
}