Repository: einsteintoolkit/Cactus — pull request #7 (cpp)
Title: Add missing GRHydro_Jacobian_state.c in EinsteinEvolve/GRHydro

This PR adds the missing source file GRHydro_Jacobian_state.c to complete the EinsteinEvolve/GRHydro thorn implementation.

Resolved issues:
title: Implement the full functionality of GRHydro
body: Please implement the full functionality of `GRHydro` by finishing the code in `GRHydro_Jacobian_state.c`.

## Thorn Information:
- Name: GRHydro
- Target file: GRHydro_Jacobian_state.c

## Interface Definition in interface.ccl:

## Schedule Definition in schedule.ccl:

## Parameters Definition in param.ccl:

## Configuration Definition in configuration.ccl:

## Documentation Context in readme.md and doc/documentation.tex

## Related Code Context in src folder



Hints:

Fix patch:
diff --git a/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_Jacobian_state.c b/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_Jacobian_state.c
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_Jacobian_state.c
@@ -0,0 +1,49 @@
+#include <assert.h>
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+
+
+
+/**
+   Checks states for Jacobians
+*/
+void
+GRHydro_check_Jacobian_state (CCTK_ARGUMENTS)
+{
+  DECLARE_CCTK_ARGUMENTS
+  DECLARE_CCTK_PARAMETERS
+
+  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 (*(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 (*(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!");
+  }
+  
+}
+
+
+

Test patch:
diff --git a/all_tests.txt b/all_tests.txt
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/all_tests.txt
@@ -0,0 +1,10 @@
+GRHydro_test_shock
+GRHydro_test_shock_mp5
+GRHydro_test_shock_ppm
+GRHydro_test_tov_ppm_ML
+GRHydro_test_tov_ppm_ML_disable_internal_excision
+GRHydro_test_tov_ppm_no_trp_ML
+test_one_hybrid
+tov_carpetevolutionmask
+tov_carpetevolutionmask2
+tov_slowsector