remove .c_str() and simplify output in several places

This commit is contained in:
Axel Kohlmeyer
2020-06-03 16:37:30 -04:00
parent 9f3f53cc6b
commit dd11fb3964
18 changed files with 110 additions and 143 deletions

View File

@ -500,10 +500,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
}
infile = fopen(arg[inflag],"r");
if (infile == NULL) {
str = fmt::format("Cannot open input script {}",arg[inflag]);
error->one(FLERR,str.c_str());
}
if (infile == NULL)
error->one(FLERR,fmt::format("Cannot open input script {}",arg[inflag]));
}
// screen and logfile messages for universe and world
@ -614,13 +612,13 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
if (restart2data || restart2dump) {
std::string cmd = fmt::format("read_restart {}",restartfile);
if (restartremap) cmd += " remap\n";
input->one(cmd.c_str());
input->one(cmd);
if (restart2data) cmd = "write_data ";
else cmd = "write_dump";
for (iarg = wfirst; iarg < wlast; iarg++)
cmd += fmt::format(" {}", arg[iarg]);
if (restart2data) cmd += " noinit";
input->one(cmd.c_str());
input->one(cmd);
error->done(0);
}
}