From 861b88ff2f0e393eff74c7b86f569c740b9d10a4 Mon Sep 17 00:00:00 2001 From: lanfer Date: Mon, 11 Oct 1999 11:13:39 +0000 Subject: Added support for two more elliptic classes in EllBase: BrBrConfMetric: solves the Brandt/Bruegmann Data PolyConfMetric: solves the elliptic equation which contains powers of phi git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllBase/trunk@13 57bc7290-fb3d-4efd-a9b1-28e84cce6043 --- src/Ell_Interface.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/Startup.c | 21 ++++++++++----- 2 files changed, 93 insertions(+), 6 deletions(-) diff --git a/src/Ell_Interface.c b/src/Ell_Interface.c index 7d086a6..e235b9e 100644 --- a/src/Ell_Interface.c +++ b/src/Ell_Interface.c @@ -12,6 +12,8 @@ static pNamedData *LinConfMetricSolverDB; static pNamedData *LinMetricSolverDB; static pNamedData *LinFlatSolverDB; +static pNamedData *BrBrConfMetricSolverDB; +static pNamedData *PolyConfMetricSolverDB; #define ELLBASE_NOSOLVER 1 #define ELLBASE_OK 0 @@ -70,6 +72,7 @@ void FMODIFIER FORTRAN_NAME(Ell_LinConfMetricSolver) } + /*########## Elliptic Equation class: LinEllMetric */ void Ell_LinMetricRegistry(void (*function), const char *sname) { @@ -101,6 +104,8 @@ void FMODIFIER FORTRAN_NAME(Ell_LinMetricSolver) } + + /*########## Elliptic Equation class: LinEllFlat */ void Ell_LinFlatRegistry(void (*function), const char *sname) { @@ -130,3 +135,76 @@ void FMODIFIER FORTRAN_NAME(Ell_LinFlatSolver) *ierr = Ell_LinFlatSolver(GH, *FieldIndex, *MIndex, *NIndex, AbsTol, RelTol, sname); free(sname); } + + + +/*########## Elliptic Equation class: BrBrConfMetric + (Brandt-Bruemann Data with conformal metric) */ + +void Ell_BrBrConfMetricRegistry(void (*function), const char *sname) { + StoreNamedData(&BrBrConfMetricSolverDB,sname, (void*)function); +} + +int Ell_BrBrConfMetricSolver(cGH *GH, int *MetricPsi, int FieldIndex, + int MIndex, int NIndex, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol, + const char *sname) { + + void (*fn)(cGH *GH,int *MetricPsi, int FieldIndex, int MIndex, int NIndex, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol); + + fn = (void(*))GetNamedData(BrBrConfMetricSolverDB,sname); + + if (!fn) { + CCTK_WARN(2,"Cannot find solver! "); + return(ELLBASE_NOSOLVER); + } + + fn(GH, MetricPsi, FieldIndex, MIndex, NIndex, AbsTol, RelTol); + return(ELLBASE_OK); +} + +void FMODIFIER FORTRAN_NAME(Ell_BrBrConfMetricSolver) + (int *ierr, cGH *GH, int *MetricPsi, int *FieldIndex, + int *MIndex, int *NIndex, CCTK_REAL *AbsTol, CCTK_REAL *RelTol, ONE_FORTSTRING_ARG) { + + ONE_FORTSTRING_CREATE(sname); + *ierr = Ell_BrBrConfMetricSolver(GH, MetricPsi, *FieldIndex, *MIndex, *NIndex, + AbsTol, RelTol, sname); + free(sname); +} + + +/*########## Elliptic Equation class: PolyConfMetric */ + +void Ell_PolyConfMetricRegistry(void (*function), const char *sname) { + StoreNamedData(&PolyConfMetricSolverDB,sname, (void*)function); +} + +int Ell_PolyConfMetricSolver(cGH *GH, int *MetricPsi, int FieldIndex, + int *PIndex, int Pcount, CCTK_REAL *AbsTol, CCTK_REAL *RelTol, + const char *sname) { + + void (*fn)(cGH *GH,int *MetricPsi, int FieldIndex, int *PIndex, int Pcount, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol); + + fn = (void(*))GetNamedData(PolyConfMetricSolverDB,sname); + + if (!fn) { + CCTK_WARN(2,"Cannot find solver! "); + return(ELLBASE_NOSOLVER); + } + + fn(GH, MetricPsi, FieldIndex, PIndex, Pcount, AbsTol, RelTol); + return(ELLBASE_OK); +} + +void FMODIFIER FORTRAN_NAME(Ell_PolyConfMetricSolver) + (int *ierr, cGH *GH, int *MetricPsi, int *FieldIndex, + int *PIndex, int *Pcount, CCTK_REAL *AbsTol, CCTK_REAL *RelTol, ONE_FORTSTRING_ARG) { + + ONE_FORTSTRING_CREATE(sname); + *ierr = Ell_PolyConfMetricSolver(GH, MetricPsi, *FieldIndex, PIndex, *Pcount, + AbsTol, RelTol, sname); + free(sname); +} diff --git a/src/Startup.c b/src/Startup.c index 39fe81f..36e452e 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -14,18 +14,27 @@ void Ell_RegisterBaseEqTypes(cGH *GH) { void Ell_LinConfMetricRegistry(void (*function),const char *); void Ell_LinMetricRegistry(void (*function),const char *); void Ell_LinFlatRegistry(void (*function),const char *); + void Ell_BrBrConfMetricRegistry(void (*function),const char *); + void Ell_PolyConfMetricRegistry(void (*function),const char *); + + DECLARE_CCTK_PARAMETERS - printf("Registering Ell_LinConfMetric...."); + + if CCTK_EQUALS(elliptic_verbose,"yes") CCTK_INFO("Registering class: Ell_LinConfMetric....done"); Ell_RegisterEq(Ell_LinConfMetricRegistry,"Ell_LinConfMetric"); - printf("...done\n"); - printf("Registering Ell_LinMetric...."); + if CCTK_EQUALS(elliptic_verbose,"yes") CCTK_INFO("Registering class: Ell_BrBrConfMetric....done"); + Ell_RegisterEq(Ell_BrBrConfMetricRegistry,"Ell_LinFlat"); + + if CCTK_EQUALS(elliptic_verbose,"yes") CCTK_INFO("Registering class: Ell_PolyConfMetric....done"); + Ell_RegisterEq(Ell_PolyConfMetricRegistry,"Ell_LinFlat"); + + if CCTK_EQUALS(elliptic_verbose,"yes") CCTK_INFO("Registering class: Ell_LinMetric....done"); Ell_RegisterEq(Ell_LinMetricRegistry,"Ell_LinMetric"); - printf("...done\n"); - printf("Registering Ell_LinFlat...."); + if CCTK_EQUALS(elliptic_verbose,"yes") CCTK_INFO("Registering class: Ell_LinFlat....done"); Ell_RegisterEq(Ell_LinFlatRegistry,"Ell_LinFlat"); - printf("...done\n"); + } -- cgit v1.2.3