aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface.ccl3
-rw-r--r--src/call_derivs.c18
2 files changed, 16 insertions, 5 deletions
diff --git a/interface.ccl b/interface.ccl
index e3c2d98..007620b 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -13,7 +13,8 @@ PROVIDES FUNCTION Diff_gf WITH DiffGf LANGUAGE C
SUBROUTINE Diff_gv ( CCTK_POINTER_TO_CONST IN cctkGH, \
CCTK_INT IN dir, \
CCTK_REAL IN ARRAY var, \
- CCTK_REAL OUT ARRAY dvar )
+ CCTK_REAL OUT ARRAY dvar, \
+ CCTK_INT IN table_handle )
PROVIDES FUNCTION Diff_gv WITH DiffGv LANGUAGE C
SUBROUTINE Diff_coeff ( CCTK_POINTER_TO_CONST IN cctkGH, \
diff --git a/src/call_derivs.c b/src/call_derivs.c
index 7bb420c..d42a77b 100644
--- a/src/call_derivs.c
+++ b/src/call_derivs.c
@@ -1,20 +1,23 @@
#include "cctk.h"
#include "cctk_Parameters.h"
#include "cctk_Arguments.h"
+#include "util_Table.h"
#include <assert.h>
void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir,
- const CCTK_REAL *var, CCTK_REAL *dvar )
+ const CCTK_REAL *var, CCTK_REAL *dvar,
+ const CCTK_INT table_handle )
{
cGH const * restrict const cctkGH = cctkGH_;
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_ARGUMENTS
- CCTK_INT ni, nj, nk, gsize, ic;
+ CCTK_INT ni, nj, nk, gsize, ic, loc_order;
CCTK_REAL delta;
CCTK_INT ierr;
CCTK_INT lsh[3], bbox[6], bb[2], nghostzones[3];
+ int nelements;
void CCTK_FCALL CCTK_FNAME(deriv_gf_2_1)(const CCTK_REAL *var,
const CCTK_INT *ni,
const CCTK_INT *nj,
@@ -72,6 +75,13 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir,
ni = cctk_lsh[0]; nj = cctk_lsh[1]; nk = cctk_lsh[2];
+
+ if ( table_handle >=0 ) {
+ nelements = Util_TableGetInt ( table_handle, &loc_order, "order" );
+ assert(nelements>0);
+ } else {
+ loc_order = order;
+ }
switch(dir) {
case 0: {
@@ -97,7 +107,7 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir,
}
if ( CCTK_Equals(norm_type,"Diagonal") ) {
- switch(order) {
+ switch(loc_order) {
case 2: {
CCTK_FNAME(deriv_gf_2_1)(var,&ni,&nj,&nk,&dir,bb,&gsize,&delta,dvar);
break;
@@ -118,7 +128,7 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir,
assert(0);
}
} else {
- switch(order) {
+ switch(loc_order) {
case 4: {
CCTK_FNAME(deriv_gf_4_3)(var,&ni,&nj,&nk,&dir,bb,&gsize,&delta,dvar);
break;