diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp index a7f5c8ce2e..3f352846a1 100644 --- a/src/REAX/pair_reax.cpp +++ b/src/REAX/pair_reax.cpp @@ -335,7 +335,8 @@ void PairREAX::write_reax_vlist() iii = j+1; jjj = i+1; } - if (nvpair >= nvpairmax) break; + if (nvpair >= nvpairmax) + error->one("reax_defs.h::NNEIGHMAXDEF too small"); FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii; FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj; @@ -393,7 +394,8 @@ void PairREAX::write_reax_vlist() iii = i+1; jjj = j+1; - if (nvpair >= nvpairmax) break; + if (nvpair >= nvpairmax) + error->one("reax_defs.h::NNEIGHMAXDEF too small"); FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii; FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;