diff options
Diffstat (limited to 'src/GRHydro_Jacobian_state.c')
-rw-r--r-- | src/GRHydro_Jacobian_state.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/GRHydro_Jacobian_state.c b/src/GRHydro_Jacobian_state.c index 4dd6f47..0c26460 100644 --- a/src/GRHydro_Jacobian_state.c +++ b/src/GRHydro_Jacobian_state.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -15,13 +17,29 @@ GRHydro_check_Jacobian_state (CCTK_ARGUMENTS) DECLARE_CCTK_PARAMETERS int ierr; + static CCTK_INT idxJacobian_state = -1, idxiJacobian_state = -1; + + if (!CCTK_IsImplementationActive("Coordinates")) + return; /* Multipatch infrastructure not active */ + + if (idxJacobian_state == -1) + { + idxJacobian_state = CCTK_VarIndex("Coordinates::jacobian_state"); + assert(idxJacobian_state >= 0); + } + + if (idxiJacobian_state == -1) + { + idxiJacobian_state = CCTK_VarIndex("Coordinates::inverse_jacobian_state"); + assert(idxiJacobian_state >= 0); + } - if (*jacobian_state == 0) + if (*(CCTK_INT *)CCTK_VarDataPtrI(cctkGH, 0, idxJacobian_state) == 0) { CCTK_WARN(0, "GRHydro requires storage for Jacobians. Please tell your Coordinates implementation to store the Jacobians!"); } - if (*inverse_jacobian_state == 0) + if (*(CCTK_INT *)CCTK_VarDataPtrI(cctkGH, 0, idxiJacobian_state) == 0) { CCTK_WARN(0, "GRHydro requires storage for inverse Jacobians. Please tell your Coordinates implementation to store the inverse Jacobians!"); } |