aboutsummaryrefslogtreecommitdiff
path: root/src/GRHydro_EOS.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/GRHydro_EOS.c')
-rw-r--r--src/GRHydro_EOS.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/GRHydro_EOS.c b/src/GRHydro_EOS.c
new file mode 100644
index 0000000..4452609
--- /dev/null
+++ b/src/GRHydro_EOS.c
@@ -0,0 +1,70 @@
+ /*@@
+ @file GRHydro_EOS.c
+ @date Wed Feb 6 18:25:33 2002
+ @author
+ @desc
+ Sets the EOS handle number from EOS_Base for use by
+ all the GRHydro routines
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "EOS_Base.h"
+
+ /*@@
+ @routine GRHydro_EOSHandle
+ @date Wed Feb 6 18:28:01 2002
+ @author Ian Hawke
+ @desc
+ Sets the EOS handle number
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+void GRHydro_EOSHandle(CCTK_ARGUMENTS)
+{
+
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ int ierr = 0;
+ char *infoline;
+
+ *GRHydro_eos_handle = EOS_Handle(GRHydro_eos_table);
+
+ if (*GRHydro_eos_handle < 0) {
+ ierr = *GRHydro_eos_handle;
+ CCTK_WARN(0, "Table handle is incorrect");
+ }
+
+ *GRHydro_polytrope_handle = EOS_Handle("2D_Polytrope");
+
+ if (*GRHydro_polytrope_handle < 0) {
+ ierr = *GRHydro_polytrope_handle;
+ CCTK_WARN(0, "GRHydro requires the 2D_Polytrope or the 2D_HybridPolytrope EoSs to be registered, for the atmosphere");
+ }
+
+ infoline = (char *)malloc(100*sizeof(char));
+ if (!infoline) {
+ CCTK_WARN(0, "Failed to malloc an array of 100 chars in GRHydro_EOS.");
+ }
+ else {
+ sprintf(infoline,"GRHydro will use the %s equation of state.",
+ GRHydro_eos_table);
+ CCTK_INFO(infoline);
+ }
+ free(infoline);
+ infoline = NULL;
+
+}