aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknarf <knarf@16f5cafb-89ad-4b9f-9d0b-9d7a0a37d03b>2013-05-09 17:52:07 +0000
committerknarf <knarf@16f5cafb-89ad-4b9f-9d0b-9d7a0a37d03b>2013-05-09 17:52:07 +0000
commit6372a39964f24bfb0d55f297b8212bbc09bc16fd (patch)
treef2dfa3fb781660c9a3ce7df43dbd289e5c572122
parent73bca47833c721976cc32d8df2948584d413a7ff (diff)
fix suspicious logic, see #1261
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/NewRad/trunk@21 16f5cafb-89ad-4b9f-9d0b-9d7a0a37d03b
-rw-r--r--src/extrap.cc17
-rw-r--r--src/newrad.cc17
2 files changed, 10 insertions, 24 deletions
diff --git a/src/extrap.cc b/src/extrap.cc
index 8d91472..ac6e86e 100644
--- a/src/extrap.cc
+++ b/src/extrap.cc
@@ -119,13 +119,10 @@ void newrad_extrap_loop (cGH const* restrict const cctkGH,
// one of the faces is a boundary
bool have_bnd = false;
- // all boundary faces are physical boundaries
- bool all_physbnd = true;
// at least one boundary face is a physical boundary
bool any_physbnd = false;
- // all boundary faces are either physical boundaries or
- // ghost zones
- bool all_physbnd_or_ghostbnd = true;
+ // all boundary faces are not inter-processor boundaries
+ bool all_not_ipbnd = true;
int bmin[3], bmax[3];
for (int d=0; d<3; ++d) {
@@ -134,10 +131,8 @@ void newrad_extrap_loop (cGH const* restrict const cctkGH,
bmin[d] = 0;
bmax[d] = imin[d];
have_bnd = true;
- all_physbnd = all_physbnd and is_physbnd[2*d+0];
any_physbnd = any_physbnd or is_physbnd[2*d+0];
- all_physbnd_or_ghostbnd = all_physbnd_or_ghostbnd and
- (is_physbnd[2*d+0] or is_ipbnd[2*d+0]);
+ all_not_ipbnd = all_not_ipbnd and not is_ipbnd[2*d+0];
break;
case 0:
bmin[d] = imin[d];
@@ -147,16 +142,14 @@ void newrad_extrap_loop (cGH const* restrict const cctkGH,
bmin[d] = imax[d];
bmax[d] = cctkGH->cctk_lsh[d];
have_bnd = true;
- all_physbnd = all_physbnd and is_physbnd[2*d+1];
any_physbnd = any_physbnd or is_physbnd[2*d+1];
- all_physbnd_or_ghostbnd = all_physbnd_or_ghostbnd and
- (is_physbnd[2*d+1] or not is_ipbnd[2*d+1]);
+ all_not_ipbnd = all_not_ipbnd and not is_ipbnd[2*d+1];
break;
}
}
assert (have_bnd); // must be true since nnz>0
- if (have_bnd and any_physbnd and all_physbnd_or_ghostbnd) {
+ if (have_bnd and any_physbnd and all_not_ipbnd) {
extrap_kernel (cctkGH, bmin, bmax, dir, var);
}
diff --git a/src/newrad.cc b/src/newrad.cc
index 94f9ccf..e1b4382 100644
--- a/src/newrad.cc
+++ b/src/newrad.cc
@@ -308,13 +308,10 @@ void newrad_loop (cGH const* restrict const cctkGH,
// one of the faces is a boundary
bool have_bnd = false;
- // all boundary faces are physical boundaries
- bool all_physbnd = true;
// at least one boundary face is a physical boundary
bool any_physbnd = false;
- // all boundary faces are either physical boundaries or
- // ghost zones
- bool all_physbnd_or_ghostbnd = true;
+ // all boundary faces are not inter-processor boundaries
+ bool all_not_ipbnd = true;
int bmin[3], bmax[3];
for (int d=0; d<3; ++d) {
@@ -323,10 +320,8 @@ void newrad_loop (cGH const* restrict const cctkGH,
bmin[d] = 0;
bmax[d] = imin[d];
have_bnd = true;
- all_physbnd = all_physbnd and is_physbnd[2*d+0];
any_physbnd = any_physbnd or is_physbnd[2*d+0];
- all_physbnd_or_ghostbnd = all_physbnd_or_ghostbnd and
- (is_physbnd[2*d+0] or not is_ipbnd[2*d+0]);
+ all_not_ipbnd = all_not_ipbnd and not is_ipbnd[2*d+0];
break;
case 0:
bmin[d] = imin[d];
@@ -336,16 +331,14 @@ void newrad_loop (cGH const* restrict const cctkGH,
bmin[d] = imax[d];
bmax[d] = cctkGH->cctk_lsh[d];
have_bnd = true;
- all_physbnd = all_physbnd and is_physbnd[2*d+1];
any_physbnd = any_physbnd or is_physbnd[2*d+1];
- all_physbnd_or_ghostbnd = all_physbnd_or_ghostbnd and
- (is_physbnd[2*d+1] or not is_ipbnd[2*d+1]);
+ all_not_ipbnd = all_not_ipbnd and not is_ipbnd[2*d+1];
break;
}
}
assert (have_bnd); // must be true since nnz>0
- if (have_bnd and any_physbnd and all_physbnd_or_ghostbnd) {
+ if (have_bnd and any_physbnd and all_not_ipbnd) {
newrad_kernel (cctkGH, bmin, bmax, dir,
var, rhs, x,y,z,r, var0, v0, radpower);
}