Repository: einsteintoolkit/Cactus — pull request #2 (cpp)
Title: Add missing WaveMoLRegister.c in CactusExamples/WaveMoL

This PR adds the missing source file WaveMoLRegister.c to complete the CactusExamples/WaveMoL thorn implementation.

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

## Thorn Information:
- Name: WaveMoL
- Target file: WaveMoLRegister.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/CactusExamples/WaveMoL/src/WaveMoLRegister.c b/arrangements/CactusExamples/WaveMoL/src/WaveMoLRegister.c
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/arrangements/CactusExamples/WaveMoL/src/WaveMoLRegister.c
@@ -0,0 +1,93 @@
+ /*@@
+   @file      WaveMoLRegister.c
+   @date      Fri Nov  9 13:47:07 2001
+   @author    Ian Hawke
+   @desc 
+   Routine to register the variables with the MoL thorn.
+   @enddesc 
+ @@*/
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+static const char *rcsid = "$Header$";
+
+CCTK_FILEVERSION(CactusExamples_WaveMoL_WaveMoLRegister_c)
+
+/*
+#ifndef DEBUG_MOL
+#define DEBUG_MOL
+#endif
+*/
+
+void WaveMoL_RegisterVars(CCTK_ARGUMENTS);
+
+ /*@@
+   @routine    WaveMoL_RegisterVars
+   @date       Fri Nov  9 13:47:41 2001
+   @author     Ian Hawke
+   @desc 
+   The registration routine.
+   @enddesc 
+   @calls     
+   @calledby   
+   @history 
+ 
+   @endhistory 
+
+@@*/
+
+void WaveMoL_RegisterVars(CCTK_ARGUMENTS)
+{
+
+  DECLARE_CCTK_ARGUMENTS;
+  DECLARE_CCTK_PARAMETERS;
+
+  CCTK_INT ierr = 0, group, rhs, var;
+
+  group = CCTK_GroupIndex("wavemol::scalarevolvemol_scalar");
+  rhs = CCTK_GroupIndex("wavemol::scalarrhsmol_scalar");
+
+  if (CCTK_IsFunctionAliased("MoLRegisterEvolvedGroup"))
+  {
+    ierr += MoLRegisterEvolvedGroup(group, rhs);
+  }
+  else
+  {
+    CCTK_WARN(0, "MoL function not aliased");
+    ierr++;
+  }
+
+  group = CCTK_GroupIndex("wavemol::scalarevolvemol_vector");
+  rhs = CCTK_GroupIndex("wavemol::scalarrhsmol_vector");
+
+  if (CCTK_IsFunctionAliased("MoLRegisterEvolvedGroup"))
+  {
+    ierr += MoLRegisterEvolvedGroup(group, rhs);
+  }
+  else
+  {
+    CCTK_WARN(0, "MoL function MoLRegisterEvolvedGroup not aliased");
+    ierr++;
+  }
+
+  var = CCTK_VarIndex("wavemol::energy");
+
+  if (CCTK_IsFunctionAliased("MoLRegisterConstrained"))
+  {
+    ierr += MoLRegisterConstrained(var);
+  }
+  else
+  {
+    CCTK_WARN(0, "MoL function MoLRegisterConstrained not aliased");
+    ierr++;
+  }      
+  
+  if (ierr) CCTK_WARN(0,"Problems registering with MoL");
+
+#ifdef DEBUG_MOL
+  printf("If we've got this far, then we've done with wavetoy registration.\n");
+#endif  
+
+}

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,1 @@
+gaussian