aboutsummaryrefslogtreecommitdiff
path: root/src/Ell_Interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ell_Interface.c')
-rw-r--r--src/Ell_Interface.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/Ell_Interface.c b/src/Ell_Interface.c
index 1ddca73..78058e7 100644
--- a/src/Ell_Interface.c
+++ b/src/Ell_Interface.c
@@ -12,32 +12,54 @@
static pNamedData *LinConfMetricSolverDB;
static pNamedData *LinMetricSolverDB;
+/* 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
+ the name of the desired solver */
void Ell_LinConfMetricRegistry(void (*function), const char *sname) {
StoreNamedData(&LinConfMetricSolverDB,sname,(void*)function);
}
+/* The Equation class wrapper, for the ellitpic class LinConfMetric
+ (linar elliptic problem that requires the metric plus a
+ conformal factor). It derives the function to call from the
+ passed registration name of the solver "sname".
+ Specifically it takes:
+ grid hierarchy, integer array of the metric+conf.factor indeces,
+ field index, Mindex, Nindex, real array for absolute tolerances
+ and relative tolerances, the registration name of the solver */
void Ell_LinConfMetricSolver(cGH *GH, int *MetricPsi, int *FieldIndex,
- int *MIndex, int *NIndex, int *AbsTol, int *RelTol, const char *sname) {
-
+ int *MIndex, int *NIndex,
+ CCTK_REAL *AbsTol, CCTK_REAL *RelTol,
+ const char *sname) {
+ /* prototype for the equation class wrapper */
void (*fn)(cGH *GH,int *MetricPsi, int *FieldIndex,
- int *MIndex, int *NIndex, int *AbsTol, int *RelTol);
-
+ int *MIndex, int *NIndex,
+ int *AbsTol, int *RelTol);
+
+ /* derive the fucntion name from the requested name and hope it is there */
fn = (void(*))GetNamedData(LinConfMetricSolverDB,sname);
if (!fn) CCTK_WARN(0,"Cannot find solver! ");
+ /* Call the solver and pass through all the necessary arguments */
fn(GH, MetricPsi, FieldIndex, MIndex, NIndex, AbsTol, RelTol);
}
+
+/* Fortran wrappr for the routine Ell_LinConfMetricSolver */
void FMODIFIER FORTRAN_NAME(Ell_LinConfMetricSolver)
(cGH *GH, int *MetricPsi, int *FieldIndex,
int *MIndex, int *NIndex, int *AbsTol, int *RelTol, ONE_FORTSTRING_ARG) {
ONE_FORTSTRING_CREATE(sname);
- Ell_LinConfMetricSolver(GH, MetricPsi, FieldIndex, MIndex, NIndex, AbsTol, RelTol, sname);
+ Ell_LinConfMetricSolver(GH, MetricPsi, FieldIndex, MIndex, NIndex,
+ AbsTol, RelTol, sname);
free(sname);
}
-
+/* Elliptic Equation class: LinEllMetric */
+/* sam idea as described above */
void Ell_LinMetricRegistry(void (*function), const char *sname) {
StoreNamedData(&LinMetricSolverDB,sname,(void*)function);
}