aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-11 12:04:21 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-11 12:04:21 +0000
commit9128392f35f5afb6467292bbac6c5688cc2e0a0a (patch)
tree81dc582dd53b4051118634cd8235b17afb993cd1
parent9e972a6ffb98b844e22a81c5150c02479d768b73 (diff)
change semantics of status returns from true=error to true=ok
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@710 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--src/gr/horizon_function.cc34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/gr/horizon_function.cc b/src/gr/horizon_function.cc
index 3749ea0..3bbed78 100644
--- a/src/gr/horizon_function.cc
+++ b/src/gr/horizon_function.cc
@@ -108,9 +108,10 @@ void compute_H(patch_system& ps,
// various (gridwise) norms of H.
//
// Results:
-// This function returns an error flag: normally this is false, but if
-// the geometry interpolation would need data outside the Cactus grid,
-// or data from an excised region, then this function returns true.
+// This function returns true for a successful computation, or false
+// if the computation failed because the geometry interpolation would
+// need data outside the Cactus grid, or data from an excised region.
+// FIXME: excision isn't implemented yet :(
//
bool horizon_function(patch_system& ps,
const struct cactus_grid_info& cgi,
@@ -132,8 +133,8 @@ setup_xyz_posns(ps, print_msg_flag);
switch (gi.geometry_method)
{
case geometry__interpolate_from_Cactus_grid:
- if (interpolate_geometry(ps, cgi, gi, print_msg_flag))
- then return true; // *** ERROR RETURN ***
+ if (! interpolate_geometry(ps, cgi, gi, print_msg_flag))
+ then return false; // *** ERROR RETURN ***
break;
case geometry__Schwarzschild_EF:
Schwarzschild_EF_geometry(ps, gi, print_msg_flag);
@@ -150,7 +151,7 @@ default:
// by algebraic ops and angular finite differencing
compute_H(ps, Jacobian_flag, H_norms_ptr, print_msg_flag);
-return false; // *** NORMAL RETURN ***
+return true; // *** NORMAL RETURN ***
}
//******************************************************************************
@@ -179,8 +180,10 @@ if (print_msg_flag)
const fp r = p.ghosted_gridfn(gfns::gfn__h, irho,isigma);
const fp rho = p.rho_of_irho(irho);
const fp sigma = p.sigma_of_isigma(isigma);
+
fp local_x, local_y, local_z;
p.xyz_of_r_rho_sigma(r,rho,sigma, local_x,local_y,local_z);
+
const fp global_x = ps.global_x_of_local_x(local_x);
const fp global_y = ps.global_y_of_local_y(local_y);
const fp global_z = ps.global_z_of_local_z(local_z);
@@ -222,9 +225,10 @@ if (print_msg_flag)
// parameter table.
//
// Results:
-// This function returns an error flag: normally this is false, but if
-// the interpolation would need data outside the Cactus grid, or data
-// from an excised region, then this function returns true.
+// This function returns true for a successful computation, or false
+// if the computation failed because the geometry interpolation would
+// need data outside the Cactus grid, or data from an excised region.
+// FIXME: excision isn't implemented yet :(
//
namespace {
bool interpolate_geometry(patch_system& ps,
@@ -439,12 +443,16 @@ if (status == CCTK_ERROR_INTERP_POINT_X_RANGE)
const char end = (out_of_range_end == -1) ? '-' : '+';
CCTK_VInfo(CCTK_THORNSTRING,
- "*** the trial-horizon-surface point (%g,%g,%g)",
+ "*** the trial-horizon-surface point");
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "*** (%g,%g,%g)",
global_x, global_y, global_z);
CCTK_VInfo(CCTK_THORNSTRING,
- "*** is outside the grid in the %c%c direction!",
+ "*** is outside the grid (or too to the grid boundary)");
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "*** in the %c%c direction!",
end, axis);
- return true; // *** ERROR RETURN ***
+ return false; // *** ERROR RETURN ***
}
if (status < 0)
then error_exit(ERROR_EXIT,
@@ -453,7 +461,7 @@ if (status < 0)
,
status); /*NOTREACHED*/
-return false; // *** NORMAL RETURN ***
+return true; // *** NORMAL RETURN ***
}
}