diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-05-07 16:01:59 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-05-07 16:01:59 +0000 |
commit | 948e53bf202d3ced82ce5198bc9c5e32ebf20ef5 (patch) | |
tree | 4093b9b97e4e79a5f6d7ff86c5609500d2587234 /src/gr | |
parent | b3852cae4be58229e86db870c91adab644e0fd3b (diff) |
change error handling if geometry interpolator
returns CCTK_ERROR_INTERP_POINT_OUTSIDE:
if the interpolator sets the error_{pt,axis,direction} variables
in the parameter table, fine --> use them in our message
but if not, don't abort, rather just produce a slightly less informative msg
also, only bother doing all this if we're going to print a msg
-- if not, skip testing the error_* variables entirely
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1052 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/gr')
-rw-r--r-- | src/gr/expansion.cc | 94 |
1 files changed, 51 insertions, 43 deletions
diff --git a/src/gr/expansion.cc b/src/gr/expansion.cc index 7e962d0..dd024c3 100644 --- a/src/gr/expansion.cc +++ b/src/gr/expansion.cc @@ -641,61 +641,69 @@ default: // if (status == CCTK_ERROR_INTERP_POINT_OUTSIDE) then { - // look in interpolator output table entries - // to see *which* point is out-of-range - CCTK_INT error_pt, error_axis, error_direction; - if ( (Util_TableGetInt(gi.param_table_handle, - &error_pt, - "error_pt") < 0) - || (Util_TableGetInt(gi.param_table_handle, - &error_axis, - "error_axis") < 0) - || (Util_TableGetInt(gi.param_table_handle, - &error_direction, - "error_direction") < 0) ) - then error_exit(ERROR_EXIT, -"***** interpolate_geometry():\n" -" point out of range when interpolating geometry info from 3-D grid!\n" -" (one or more points on the trial horizon surface\n" -" are outside the grid or too close to the boundary),\n" -" but we can't get info about the bad point(s)!\n" -" ==> maybe an interpolator problem?\n"); /*NOTREACHED*/ - - assert(error_pt >= 0); - assert(error_pt < ps_ptr->N_grid_points()); - const double global_x - = ps_ptr->gridfn_data(gfns::gfn__global_x)[error_pt]; - const double global_y - = ps_ptr->gridfn_data(gfns::gfn__global_y)[error_pt]; - const double global_z - = ps_ptr->gridfn_data(gfns::gfn__global_z)[error_pt]; - - assert(error_axis >= 0); - assert(error_axis < N_GRID_DIMS); - const char axis = "xyz"[error_axis]; - - assert((error_direction == -1) || (error_direction == +1)); - const char direction = (error_direction == -1) ? '-' : '+'; - if (print_msg_flag) then { const int warn_level = initial_flag ? error_info.warn_level__point_outside__initial : error_info.warn_level__point_outside__subsequent; - CCTK_VWarn(warn_level, __LINE__, __FILE__, CCTK_THORNSTRING, + // look in interpolator output table entries + // to see *which* point is out-of-range + CCTK_INT error_pt, error_axis, error_direction; + const int status_pt + = Util_TableGetInt(gi.param_table_handle, + &error_pt, "error_pt"); + const int status_axis + = Util_TableGetInt(gi.param_table_handle, + &error_axis, "error_axis"); + const int status_direction + = Util_TableGetInt(gi.param_table_handle, + &error_direction, "error_direction"); + if ( (status_pt > 0) + && (status_axis > 0) + && (status_direction > 0) ) + then { + assert(error_pt >= 0); + assert(error_pt < ps_ptr->N_grid_points()); + const double global_x + = ps_ptr->gridfn_data(gfns::gfn__global_x)[error_pt]; + const double global_y + = ps_ptr->gridfn_data(gfns::gfn__global_y)[error_pt]; + const double global_z + = ps_ptr->gridfn_data(gfns::gfn__global_z)[error_pt]; + + assert(error_axis >= 0); + assert(error_axis < N_GRID_DIMS); + const char axis = "xyz"[error_axis]; + + assert( (error_direction == -1) + || (error_direction == +1) ); + const char direction + = (error_direction == -1) ? '-' : '+'; + + CCTK_VWarn(warn_level, __LINE__, __FILE__, + CCTK_THORNSTRING, "\n" "interpolate_geometry():\n" " the trial-horizon-surface point [pt=%d]\n" " global_(x,y,z)=(%g,%g,%g)\n" " is outside the grid (or too close to the boundary)" " in the %c%c direction!\n" -" (in a uniprocessor run, this can also be caused by having\n" -" driver::ghost_size too small for this geometry interpolator)\n" - , - error_pt, - global_x, global_y, global_z, - direction, axis); +" ... in a single-processor run, this may also mean that\n" +" driver::ghost_size is too small for this geometry interpolator\n" + , + error_pt, + global_x, global_y, global_z, + direction, axis); + } + else CCTK_VWarn(warn_level, __LINE__, __FILE__, + CCTK_THORNSTRING, +"\n" +"interpolate_geometry():\n" +" one or more points on the trial horizon surface point" +" is outside the grid (or too close to the boundary)" +" ... in a single-processor run, this may also mean that\n" +" driver::ghost_size is too small for this geometry interpolator\n"); } return expansion_failure__surface_outside_grid; // *** ERROR RETURN *** } |