guard against extracting too many elements from the MEAM library into the statically sized arrays
this will abort with a meaningful error message and people can fix up their LAMMPS binary as needed.
This commit is contained in:
@ -226,6 +226,9 @@ void PairMEAMC::coeff(int narg, char **arg)
|
||||
}
|
||||
nelements = narg - 4 - atom->ntypes;
|
||||
if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
if (nelements > maxelt)
|
||||
error->all(FLERR,"Too many elements extracted from MEAM library. "
|
||||
"Increase 'maxelt' in meam.h and recompile.");
|
||||
elements = new char*[nelements];
|
||||
mass = new double[nelements];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user