aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Ell_Interface.c34
-rw-r--r--src/Startup.c5
2 files changed, 36 insertions, 3 deletions
diff --git a/src/Ell_Interface.c b/src/Ell_Interface.c
index 78058e7..33fe70e 100644
--- a/src/Ell_Interface.c
+++ b/src/Ell_Interface.c
@@ -11,8 +11,10 @@
static pNamedData *LinConfMetricSolverDB;
static pNamedData *LinMetricSolverDB;
+static pNamedData *LinFlatSolverDB;
+
+/*########## Elliptic Equation class: LinEllConfMetric */
-/* Elliptic Equation class: LinEllConfMetric */
/* Registers the Equation class wrapper (the function which is called for a
specific class of problems by passing all the necessay arguments PLUS
@@ -58,8 +60,8 @@ void FMODIFIER FORTRAN_NAME(Ell_LinConfMetricSolver)
}
-/* Elliptic Equation class: LinEllMetric */
-/* sam idea as described above */
+/*########## Elliptic Equation class: LinEllMetric */
+
void Ell_LinMetricRegistry(void (*function), const char *sname) {
StoreNamedData(&LinMetricSolverDB,sname,(void*)function);
}
@@ -84,3 +86,29 @@ void FMODIFIER FORTRAN_NAME(Ell_LinMetricSolver)
free(sname);
}
+
+/*########## Elliptic Equation class: LinEllFlat */
+
+void Ell_LinFlatRegistry(void (*function), const char *sname) {
+ StoreNamedData(&LinFlatSolverDB,sname,(void*)function);
+}
+
+void Ell_LinFlatSolver(cGH *GH, int *FieldIndex, int *MIndex, int *NIndex,
+ int *AbsTol, int *RelTol, const char *sname) {
+
+ void (*fn)(cGH *GH, int *FieldIndex, int *MIndex, int *NIndex,
+ int *AbsTol, int *RelTol);
+
+ fn = (void(*))GetNamedData(LinFlatSolverDB,sname);
+ if (!fn) CCTK_WARN(0,"Cannot find solver! ");
+
+ fn(GH, FieldIndex, MIndex, NIndex, AbsTol, RelTol);
+}
+
+void FMODIFIER FORTRAN_NAME(Ell_LinFlatSolver)
+ (cGH *GH, int *FieldIndex,
+ int *MIndex, int *NIndex, int *AbsTol, int *RelTol, ONE_FORTSTRING_ARG) {
+ ONE_FORTSTRING_CREATE(sname);
+ Ell_LinFlatSolver(GH, FieldIndex, MIndex, NIndex, AbsTol, RelTol, sname);
+ free(sname);
+}
diff --git a/src/Startup.c b/src/Startup.c
index 02ac4d2..39fe81f 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -13,6 +13,7 @@ void Ell_RegisterBaseEqTypes(cGH *GH) {
void Ell_RegisterEq(void (*function),const char *);
void Ell_LinConfMetricRegistry(void (*function),const char *);
void Ell_LinMetricRegistry(void (*function),const char *);
+ void Ell_LinFlatRegistry(void (*function),const char *);
printf("Registering Ell_LinConfMetric....");
Ell_RegisterEq(Ell_LinConfMetricRegistry,"Ell_LinConfMetric");
@@ -22,6 +23,10 @@ void Ell_RegisterBaseEqTypes(cGH *GH) {
Ell_RegisterEq(Ell_LinMetricRegistry,"Ell_LinMetric");
printf("...done\n");
+ printf("Registering Ell_LinFlat....");
+ Ell_RegisterEq(Ell_LinFlatRegistry,"Ell_LinFlat");
+ printf("...done\n");
+
}