Merge branch 'master' of https://github.com/lammps/lammps into lammps-master2
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user