diff options
author | jthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef> | 2007-01-15 12:06:36 +0000 |
---|---|---|
committer | jthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef> | 2007-01-15 12:06:36 +0000 |
commit | 74bc9ba83ebec82716597f9dac42551eea8185f6 (patch) | |
tree | 6829988d4769c0118e9a9c8c573c3dce3f038594 /src/util.c | |
parent | 9cb0ef8e18b65bb8b28924b598c8475abe16ab92 (diff) |
add a debugging feature: setting the parameter
AEILocalInterp::log_interp_coords = true
causes this thorn to write a log file on each processor
giving the grid and (some of) the interpolation coordinates
git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@45 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -78,3 +78,50 @@ case CCTK_VARIABLE_FPOINTER: return 0; default: return -1; } } + +/******************************************************************************/ + +/*@@ + @routine AEILocalInterp_get_int_param + @date 12 Jan 2007 + @author Jonathan Thornburg <jthorn@aei.mpg.de> + @desc This function gets the (scalar) value of a CCTK_INT or Boolean + Cactus parameter. + @enddesc + + @var thorn_or_implementation_name + @vdesc The name of the thorn (for private parameters) or implementation + (for restricted parameters), eg "AEILocalInterp". + @vtype const char* + @endvar + + @var parameter_name + @vdesc The name of the parameter, e.g. "log_interp_coords" + @vtype const char* + @endvar + + @returntype int + @returndesc This function returns the value of the parameter. + If an error occurs, this function calls + CCTK_VWarn(CCTK_WARN_ABORT, ...) + (and does not return to the caller). + @endreturndesc + @@*/ +int AEILocalInterp_get_int_param(const char* const thorn_or_implementation_name, + const char* const parameter_name) +{ +CCTK_INT data_type; +const CCTK_INT* const value_ptr + = (const CCTK_INT*) CCTK_ParameterGet(parameter_name, + thorn_or_implementation_name, + NULL); + +if (value_ptr == NULL) + then CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, +"***** AEILocalInterp_decode_N_parts():\n" +" can't get value of parameter %s::%s!\n" + , + thorn_or_implementation_name, parameter_name); /*NOTREACHED*/ + +return *value_ptr; +} |