diff options
Diffstat (limited to 'src/Ell_Interface.c')
-rw-r--r-- | src/Ell_Interface.c | 34 |
1 files changed, 31 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); +} |