aboutsummaryrefslogtreecommitdiff
path: root/src/Startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Startup.c')
-rw-r--r--src/Startup.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/Startup.c b/src/Startup.c
new file mode 100644
index 0000000..323ffd0
--- /dev/null
+++ b/src/Startup.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "CactusBase/IOUtil/src/ioGH.h"
+
+int IOJpeg_Output2DGH(cGH *GH);
+int IOJpeg_TriggerOutput2D(cGH *GH, int);
+int IOJpeg_TimeFor2D(cGH *GH, int);
+int IOJpeg_Output2DVarAs(cGH *GH, const char *var, const char *alias);
+
+void *IOJpeg_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH);
+int IOJpeg_InitGH (cGH *GH);
+
+void IOJpeg_Startup (void)
+{
+ DECLARE_CCTK_PARAMETERS
+ int IO_GHExtension;
+ int IOMethod;
+
+
+ if (CCTK_GHExtensionHandle ("IO") < 0)
+ {
+ CCTK_WARN (1, "Thorn IOUtil was not activated. "
+ "No IOJpeg IO methods will be enabled.");
+ return;
+ }
+ if (CCTK_GHExtensionHandle ("PUGH") < 0)
+ {
+ CCTK_WARN (1, "Thorn PUGH was not activated. "
+ "No IOJpeg IO methods will be enabled.");
+ return;
+ }
+
+ IO_GHExtension = CCTK_RegisterGHExtension ("IOJpeg");
+ CCTK_RegisterGHExtensionSetupGH (IO_GHExtension, IOJpeg_SetupGH);
+ CCTK_RegisterGHExtensionInitGH (IO_GHExtension, IOJpeg_InitGH);
+
+ /* Register the 2D IOJpeg routines as output methods */
+
+ IOMethod = CCTK_RegisterIOMethod ("IOJpeg_2D");
+ CCTK_RegisterIOMethodOutputGH (IOMethod, IOJpeg_Output2DGH);
+ CCTK_RegisterIOMethodOutputVarAs (IOMethod, IOJpeg_Output2DVarAs);
+ CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOJpeg_TimeFor2D);
+ CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOJpeg_TriggerOutput2D);
+
+}