replace more uses of XXXINT_FORMAT with fmtlib
This commit is contained in:
@ -242,8 +242,7 @@ int DumpLocal::modify_param(int narg, char **arg)
|
||||
// use of &str[1] removes leading '%' from BIGINT_FORMAT string
|
||||
char *ptr = strchr(format_int_user,'d');
|
||||
if (ptr == nullptr)
|
||||
error->all(FLERR,
|
||||
"Dump_modify int format does not contain d character");
|
||||
error->all(FLERR, "Dump_modify int format does not contain d character");
|
||||
char str[8];
|
||||
sprintf(str,"%s",BIGINT_FORMAT);
|
||||
*ptr = '\0';
|
||||
@ -273,26 +272,29 @@ void DumpLocal::write_header(bigint ndump)
|
||||
if (me == 0) {
|
||||
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());
|
||||
|
||||
fmt::print(fp,"ITEM: TIMESTEP\n{}\n"
|
||||
"ITEM: NUMBER OF {}\n{}\n",
|
||||
update->ntimestep, label, ndump);
|
||||
|
||||
fprintf(fp,"ITEM: TIMESTEP\n");
|
||||
fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep);
|
||||
fprintf(fp,"ITEM: NUMBER OF %s\n",label);
|
||||
fprintf(fp,BIGINT_FORMAT "\n",ndump);
|
||||
if (domain->triclinic) {
|
||||
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);
|
||||
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);
|
||||
} else {
|
||||
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);
|
||||
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);
|
||||
}
|
||||
fprintf(fp,"ITEM: %s %s\n",label,columns);
|
||||
|
||||
fmt::print(fp,"ITEM: {} {}\n", label, columns);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user