create_atoms error in 3.8

Submitted by tjleps on Thu, 01/18/2018 - 20:25

There is an error in create_atoms.cpp::Line 130
It uses arg[2] as the random number seed instead of arg[3]

} else if (strcmp(arg[1],"random") == 0) {
style = RANDOM;
if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
nrandom = force->inumeric(FLERR,arg[2]);
if (seed_char)
delete [] seed_char;
seed_char = new char [strlen(arg[2])+1];
-->---> strcpy(seed_char, arg[2]); should be 3 not 2 <-------------------------------------------------
if (strcmp(arg[4],"NULL") == 0) nregion = -1;
else {
nregion = domain->find_region(arg[4]);
if (nregion == -1) error->all(FLERR,
"Create_atoms region ID does not exist");
domain->regions[nregion]->init();
}

arnom's picture

arnom | Mon, 01/22/2018 - 18:05

Thank you for reporting this. My fault actually, I fixed it and it will be included in the next release.
For anybody wanting to fix it themselves: The line above (129) has the same mistake.

DCS team member & LIGGGHTS(R) core developer