From b96028eaf2490554cfffa5021455dc737c81fe72 Mon Sep 17 00:00:00 2001 From: Christoph Scherer Date: Sat, 22 Oct 2022 16:38:37 +0200 Subject: [PATCH] Update pair_threebody_table.cpp Correcting for hard coded ntheta = 79 in the extreme case that theta is exactly equal to 180.0 degrees. --- src/MANYBODY/pair_threebody_table.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MANYBODY/pair_threebody_table.cpp b/src/MANYBODY/pair_threebody_table.cpp index 044f69a8da..74367defba 100644 --- a/src/MANYBODY/pair_threebody_table.cpp +++ b/src/MANYBODY/pair_threebody_table.cpp @@ -708,7 +708,7 @@ void PairThreebodyTable::uf_lookup(Param *pm, double r12, double r13, double the if (r13 == (pm->mltable->rmin - 0.5 * dr)) { nr13 = 0; } nr13 -= nr12; ntheta = (theta - 0.00000001) / dtheta; - if (theta == 180.0) { ntheta = 79; } + if (theta == 180.0) { ntheta = (pm->mltable->ninput * 2)-1; } itable = 0; for (i = 0; i < nr12; i++) { itable += (pm->mltable->ninput - i); } itable += nr13; @@ -721,7 +721,7 @@ void PairThreebodyTable::uf_lookup(Param *pm, double r12, double r13, double the nr13 = (r13 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr; if (r13 == (pm->mltable->rmin - 0.5 * dr)) { nr13 = 0; } ntheta = (theta - 0.00000001) / dtheta; - if (theta == 180.0) { ntheta = 79; } + if (theta == 180.0) { ntheta = (pm->mltable->ninput * 2)-1; } itable = nr12 * (pm->mltable->ninput); itable += nr13; itable *= (pm->mltable->ninput * 2);