Merge branch 'lammps:master' into type-labels
This commit is contained in:
@ -66,7 +66,7 @@ void WriteRestart::command(int narg, char **arg)
|
||||
// if filename contains a "*", replace with current timestep
|
||||
|
||||
std::string file = arg[0];
|
||||
std::size_t found = file.find("*");
|
||||
std::size_t found = file.find('*');
|
||||
if (found != std::string::npos)
|
||||
file.replace(found,1,fmt::format("{}",update->ntimestep));
|
||||
|
||||
@ -206,7 +206,7 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller,
|
||||
file = final file name to write, except may contain a "%"
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void WriteRestart::write(std::string file)
|
||||
void WriteRestart::write(const std::string &file)
|
||||
{
|
||||
// special case where reneighboring is not done in integrator
|
||||
// on timestep restart file is written (due to build_once being set)
|
||||
@ -229,7 +229,7 @@ void WriteRestart::write(std::string file)
|
||||
|
||||
if (me == 0) {
|
||||
std::string base = file;
|
||||
if (multiproc) base.replace(base.find("%"),1,"base");
|
||||
if (multiproc) base.replace(base.find('%'),1,"base");
|
||||
|
||||
fp = fopen(base.c_str(),"wb");
|
||||
if (fp == nullptr)
|
||||
@ -291,7 +291,7 @@ void WriteRestart::write(std::string file)
|
||||
}
|
||||
|
||||
std::string multiname = file;
|
||||
multiname.replace(multiname.find("%"),1,fmt::format("{}",icluster));
|
||||
multiname.replace(multiname.find('%'),1,fmt::format("{}",icluster));
|
||||
|
||||
if (filewriter) {
|
||||
fp = fopen(multiname.c_str(),"wb");
|
||||
|
||||
Reference in New Issue
Block a user