diff options
-rw-r--r-- | src/call_derivs.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/call_derivs.c b/src/call_derivs.c index d42a77b..2932e24 100644 --- a/src/call_derivs.c +++ b/src/call_derivs.c @@ -1,9 +1,9 @@ #include "cctk.h" #include "cctk_Parameters.h" #include "cctk_Arguments.h" -#include "util_Table.h" -#include <assert.h> +#include "util_ErrorCodes.h" +#include "util_Table.h" void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, const CCTK_REAL *var, CCTK_REAL *dvar, @@ -78,7 +78,11 @@ void DiffGv ( 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; } @@ -103,7 +107,7 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, break; } default: - assert(0); + CCTK_WARN (0, "Wrong direction specified"); } if ( CCTK_Equals(norm_type,"Diagonal") ) { @@ -125,7 +129,7 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, break; } default: - assert(0); + CCTK_WARN (0, "Unknown stencil specified"); } } else { switch(loc_order) { @@ -138,7 +142,7 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, break; } default: - assert(0); + CCTK_WARN (0, "Unknown stencil specified"); } } } |