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

This PR adds the missing source file GRHydro_LastMoLPostStep.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_LastMoLPostStep.c`.

## Thorn Information:
- Name: GRHydro
- Target file: GRHydro_LastMoLPostStep.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_LastMoLPostStep.c b/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_LastMoLPostStep.c
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_LastMoLPostStep.c
@@ -0,0 +1,39 @@
+// GRHydro_LastMoLPostStep.c
+//
+// Compute is this is the last MoL PostStep call. Code taken from Christian
+// Reisswig's rejected MoL changes.
+//
+// Roland Haas
+// Sun Jun  3 17:35:53 PDT 2012
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+void GRHydro_SetLastMoLPostStep(CCTK_ARGUMENTS)
+{
+  DECLARE_CCTK_ARGUMENTS;
+
+  const CCTK_INT *MoL_Intermediate_Step = 
+    CCTK_VarDataPtr(cctkGH,0,"MoL::MoL_Intermediate_Step");
+  if(NULL == MoL_Intermediate_Step)
+  {
+    CCTK_WARN(CCTK_WARN_ABORT,
+              "Could not get data pointer for MoL::MoL_Intermediate_Step");
+  }
+
+  // If counter becomes zero, the only thing left to do is to call PostStep!
+  // NOTE: MoL's counter is uninitialised during initial data setup!
+  *InLastMoLPostStep = cctk_iteration == 0 || *MoL_Intermediate_Step == 0;
+}
+
+void GRHydro_ClearLastMoLPostStep(CCTK_ARGUMENTS)
+{
+  DECLARE_CCTK_ARGUMENTS;
+
+  *InLastMoLPostStep = 0;
+}

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