more output simplification with fmtlib, std::string, and utils::logmesg()

This commit is contained in:
Axel Kohlmeyer
2020-06-25 23:48:17 -04:00
parent 84ec2cc39b
commit f2a4d12f7e
4 changed files with 111 additions and 166 deletions

View File

@ -146,24 +146,17 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) :
// stats
if (me == 0) {
if (screen)
fprintf(screen,"Read molecule template %s:\n %d molecules\n"
" %d atoms with max type %d\n %d bonds with max type %d\n"
" %d angles with max type %d\n %d dihedrals with max type %d\n"
" %d impropers with max type %d\n",
id,nmolecules,natoms,ntypes,
nbonds,nbondtypes,nangles,nangletypes,
ndihedrals,ndihedraltypes,nimpropers,nimpropertypes);
if (logfile)
fprintf(logfile,"Read molecule template %s:\n %d molecules\n"
" %d atoms with max type %d\n %d bonds with max type %d\n"
" %d angles with max type %d\n %d dihedrals with max type %d\n"
" %d impropers with max type %d\n",
id,nmolecules,natoms,ntypes,
nbonds,nbondtypes,nangles,nangletypes,
ndihedrals,ndihedraltypes,nimpropers,nimpropertypes);
}
if (me == 0)
utils::logmesg(lmp,fmt::format("Read molecule template {}:\n"
" {} molecules\n"
" {} atoms with max type {}\n"
" {} bonds with max type {}\n"
" {} angles with max type {}\n"
" {} dihedrals with max type {}\n"
" {} impropers with max type {}\n",
id,nmolecules,natoms,ntypes,
nbonds,nbondtypes,nangles,nangletypes,
ndihedrals,ndihedraltypes,nimpropers,nimpropertypes));
}
/* ---------------------------------------------------------------------- */