replace more uses of XXXINT_FORMAT with fmtlib

This commit is contained in:
Axel Kohlmeyer
2022-03-30 13:53:25 -04:00
parent 9aad583c7d
commit c4729b39b4
10 changed files with 89 additions and 79 deletions

View File

@ -289,19 +289,21 @@ void DumpAtom::header_item(bigint ndump)
{
if (unit_flag && !unit_count) {
++unit_count;
fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style);
fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style);
}
if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time());
if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time());
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr);
fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi);
fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi);
fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi);
fprintf(fp,"ITEM: ATOMS %s\n",columns);
fmt::print(fp,"ITEM: TIMESTEP\n{}\n"
"ITEM: NUMBER OF ATOMS\n{}\n",
update->ntimestep, ndump);
fmt::print(fp,"ITEM: BOX BOUNDS {}\n"
"{:>1.16e} {:>1.16e}\n"
"{:>1.16e} {:>1.16e}\n"
"{:>1.16e} {:>1.16e}\n",
boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi);
fmt::print(fp,"ITEM: ATOMS {}\n",columns);
}
/* ---------------------------------------------------------------------- */
@ -310,19 +312,21 @@ void DumpAtom::header_item_triclinic(bigint ndump)
{
if (unit_flag && !unit_count) {
++unit_count;
fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style);
fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style);
}
if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time());
if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time());
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
fprintf(fp,"ITEM: NUMBER OF ATOMS\n");
fprintf(fp,BIGINT_FORMAT "\n",ndump);
fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr);
fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy);
fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz);
fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz);
fprintf(fp,"ITEM: ATOMS %s\n",columns);
fmt::print(fp,"ITEM: TIMESTEP\n{}\n"
"ITEM: NUMBER OF ATOMS\n{}\n",
update->ntimestep, ndump);
fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n"
"{:>1.16e} {:>1.16e} {:>1.16e}\n"
"{:>1.16e} {:>1.16e} {:>1.16e}\n"
"{:>1.16e} {:>1.16e} {:>1.16e}\n",
boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz);
fmt::print(fp,"ITEM: ATOMS {}\n",columns);
}
/* ---------------------------------------------------------------------- */