From ec23aef20b2257d825d982bef677889e5218f254 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Thu, 20 Jul 2017 18:19:53 -0400 Subject: [PATCH] fix reaxc division by zero bug also for USER-OMP variant --- src/USER-OMP/reaxc_bonds_omp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/USER-OMP/reaxc_bonds_omp.cpp b/src/USER-OMP/reaxc_bonds_omp.cpp index 2b7ab7e5e8..7522df2f60 100644 --- a/src/USER-OMP/reaxc_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_bonds_omp.cpp @@ -119,7 +119,8 @@ void BondsOMP( reax_system *system, control_params *control, bo_ij = &( bonds->select.bond_list[pj].bo_data ); /* calculate the constants */ - pow_BOs_be2 = pow( bo_ij->BO_s, twbp->p_be2 ); + if (bo_ij->BO_s == 0.0) pow_BOs_be2 = 0.0; + else pow_BOs_be2 = pow( bo_ij->BO_s, twbp->p_be2 ); exp_be12 = exp( twbp->p_be1 * ( 1.0 - pow_BOs_be2 ) ); CEbo = -twbp->De_s * exp_be12 * ( 1.0 - twbp->p_be1 * twbp->p_be2 * pow_BOs_be2 ); -- GitLab