Merge branch 'master' of https://github.com/lammps/lammps into lammps-master2

This commit is contained in:
Jacob Gissinger
2021-08-20 10:53:04 -04:00
4453 changed files with 106551 additions and 73942 deletions

View File

@ -5130,16 +5130,10 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) :
if (style == Variable::ATOMFILE) {
if (atom->map_style == Atom::MAP_NONE)
error->all(FLERR,"Cannot use atomfile-style "
"variable unless an atom map exists");
std::string cmd = name + std::string("_VARIABLE_STORE");
id_fix = utils::strdup(cmd);
cmd += " all STORE peratom 0 1";
modify->add_fix(cmd);
fixstore = (FixStore *) modify->fix[modify->nfix-1];
error->all(FLERR,"Cannot use atomfile-style variable unless an atom map exists");
id_fix = utils::strdup(std::string(name) + "_VARIABLE_STORE");
fixstore = (FixStore *) modify->add_fix(std::string(id_fix) + " all STORE peratom 0 1");
buffer = new char[CHUNK*MAXLINE];
}
}
@ -5187,7 +5181,7 @@ int VarReader::read_scalar(char *str)
if (n == 1) continue; // skip if blank line
break;
}
memmove(str,ptr,n); // move trimmed string back
if (n > 0) memmove(str,ptr,n); // move trimmed string back
}
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) return 1;