From 6f78b74a9f6d920c6d906eafb10b3ae5bf4971b4 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 12 Feb 2009 20:55:54 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2582 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/REAX/pair_reax.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp index 1e730a8f95..58ea666633 100644 --- a/src/REAX/pair_reax.cpp +++ b/src/REAX/pair_reax.cpp @@ -500,7 +500,6 @@ void PairREAX::coeff(int narg, char **arg) continue; } map[i-2] = atoi(arg[i]); - if (map[i-2] < 1) error->all("Incorrect args for pair coefficients"); } int n = atom->ntypes; @@ -553,10 +552,16 @@ void PairREAX::init_style() rcutbsq=vlbora*vlbora; // parameters for charge equilibration from ReaxFF input, fort.4 + // verify that no LAMMPS type to REAX type mapping was invalid + + int nelements; + FORTRAN(getnso, GETNSO)(&nelements); FORTRAN(getswa, GETSWA)(&swa); double chi, eta, gamma; for (int itype = 1; itype <= atom->ntypes; itype++) { + if (map[itype] < 1 || map[itype] > nelements) + error->all("Invalid REAX atom type"); chi = FORTRAN(cbkchb, CBKCHB).chi[map[itype]-1]; eta = FORTRAN(cbkchb, CBKCHB).eta[map[itype]-1]; gamma = FORTRAN(cbkchb, CBKCHB).gam[map[itype]-1];