aboutsummaryrefslogtreecommitdiff
path: root/src/get_coeffs.c
diff options
context:
space:
mode:
authorschnetter <schnetter@f69c4107-0314-4c4f-9ad4-17e986b73f4a>2005-02-27 14:13:58 +0000
committerschnetter <schnetter@f69c4107-0314-4c4f-9ad4-17e986b73f4a>2005-02-27 14:13:58 +0000
commitd6111c2ac4d5acad4c2b1cfa0141aa59e1be1b96 (patch)
tree19b3f734a517b91df8081bec63e9747cb5dbe491 /src/get_coeffs.c
parente7afd87b652aa32e05ef5b1db130bee66ea83283 (diff)
Analyse the options table more gracefully, and abort with a nice error
message if something is wrong. git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/SummationByParts/trunk@28 f69c4107-0314-4c4f-9ad4-17e986b73f4a
Diffstat (limited to 'src/get_coeffs.c')
-rw-r--r--src/get_coeffs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/get_coeffs.c b/src/get_coeffs.c
index 0d8e365..af1df67 100644
--- a/src/get_coeffs.c
+++ b/src/get_coeffs.c
@@ -1,10 +1,12 @@
+#include <assert.h>
+#include <stdio.h>
+
#include "cctk.h"
#include "cctk_Parameters.h"
#include "cctk_Arguments.h"
-#include "util_Table.h"
-#include <stdio.h>
-#include <assert.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
void DiffCoeff ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir,
const CCTK_INT nsize, CCTK_INT *imin, CCTK_INT *imax,
@@ -65,7 +67,11 @@ void DiffCoeff ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir,
if ( table_handle >=0 ) {
nelements = Util_TableGetInt ( table_handle, &loc_order, "order" );
- assert(nelements>0);
+ if ( nelements == UTIL_ERROR_TABLE_NO_SUCH_KEY ) {
+ loc_order = order;
+ } else if ( nelements != 1) {
+ CCTK_WARN (0, "The options table has an entry \"order\", but it does not have the right properties");
+ }
} else {
loc_order = order;
}