From 7d176cb66ea4028be2ab8bc371da02fdadc5b664 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 31 Aug 2024 07:01:44 -0400 Subject: [PATCH] fix logic bug --- src/atom.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index f8a9bdd79b..e0fceffe9c 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2752,11 +2752,12 @@ for an example where checking ghost communication is necessary. int Atom::find_custom_ghost(const char *name, int &flag, int &cols, int &ghost) { int i = find_custom(name, flag, cols); + ghost = 0; if (i == -1) return i; if ((flag == 0) && (cols == 0)) ghost = ivghost[i]; else if ((flag == 1) && (cols == 0)) ghost = dvghost[i]; - else if ((flag == 0) && (cols == 1)) ghost = iaghost[i]; - else if ((flag == 1) && (cols == 1)) ghost = daghost[i]; + else if ((flag == 0) && (cols > 0)) ghost = iaghost[i]; + else if ((flag == 1) && (cols > 0)) ghost = daghost[i]; return i; }