From 51b4ae69948e0624025be006687a9e0dc9c916b6 Mon Sep 17 00:00:00 2001 From: jthorn Date: Mon, 1 Jul 2002 14:18:34 +0000 Subject: fix a bug where the default value for the Jacobian-query parameter-table entry Jacobian_part_stride (= stride in Jacobian array for real/complex part) wasn't handled: docs have always said this is optional, and defaults to 0 if omitted from the parameter table, but the code treated this as an error --> fix to supply the default value (0) git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalInterp/trunk@73 df1f8a13-aa1d-4dd4-9681-27ded5b42416 --- .../InterpLocalUniform.c | 45 +++++++++++++++------- 1 file changed, 32 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.c b/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.c index f4f2631..a137b06 100644 --- a/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.c +++ b/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.c @@ -1137,10 +1137,7 @@ if (status) N_dims, Jacobian_info.Jacobian_m_strides, "Jacobian_m_strides"); - status3 = Util_TableGetInt(param_table_handle, - & Jacobian_info.Jacobian_part_stride, - "Jacobian_part_stride"); - if ((status1 < 0) || (status2 != N_dims) || (status3 < 0)) + if ((status1 < 0) || (status2 != N_dims)) then { free(operation_codes); free(operand_indices); @@ -1150,15 +1147,37 @@ if (status) CCTK_VWarn(ERROR_MSG_SEVERITY_LEVEL, __LINE__, __FILE__, CCTK_THORNSTRING, "\n" -" CCTK_InterpLocalUniform(): bad \"Jacobian_interp_point_stride and/or\n" -" \"Jacobian_m_strides\" and/or\n" -" \"Jacobian_part_stride\" table entry/entries!\n" -" error status1=%d status2=%d status3=%d" - , - status1, status2, status3); - return (status1 < 0) ? status1 /*** ERROR RETURN ***/ - : (status2 < 0) ? status2 /*** ERROR RETURN ***/ - : status3; /*** ERROR RETURN ***/ +" CCTK_InterpLocalUniform(): bad \"Jacobian_interp_point_stride\" and/or\n" +" \"Jacobian_m_strides\" table entry/entries!\n" +" error status1=%d status2=%d" +, + status1, status2); + return (status1 < 0) ? status1 : status2; /*** ERROR RETURN ***/ + } + + status = Util_TableGetInt(param_table_handle, + & Jacobian_info.Jacobian_part_stride, + "Jacobian_part_stride"); + if (status == 1) + then { + /* ok ==> no-op here */ + } + else if (status == UTIL_ERROR_TABLE_NO_SUCH_KEY) + then Jacobian_info.Jacobian_part_stride = 0; /* default */ + else { + free(operation_codes); + free(operand_indices); + free(input_array_offsets); + free(Jacobian_info.Jacobian_pointer); + free(Jacobian_info.Jacobian_offset); + CCTK_VWarn(ERROR_MSG_SEVERITY_LEVEL, + __LINE__, __FILE__, CCTK_THORNSTRING, +"\n" +" CCTK_InterpLocalUniform(): bad \"Jacobian_part_stride\" table entry!\n" +" error status=%d" +, + status); + return status; /*** ERROR RETURN ***/ } p_Jacobian_info = & Jacobian_info; -- cgit v1.2.3