diff options
Diffstat (limited to 'src/Startup.c')
-rw-r--r-- | src/Startup.c | 117 |
1 files changed, 92 insertions, 25 deletions
diff --git a/src/Startup.c b/src/Startup.c index 19a75bd..2e86a42 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -1,9 +1,19 @@ + /*@@ + @header Startup.c + @date + @author + @desc + Register known elliptic interfaces + @enddesc + @version $Header$ + @@*/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "cctk.h" + #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -14,14 +24,29 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusElliptic_EllSOR_Startup_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + void EllSOR_Register(CCTK_ARGUMENTS); void SORConfMetric(cGH *GH, - int *MetricPsiI, - int FieldI, - int MI, - int NI, - CCTK_REAL *AbsTol, - CCTK_REAL *RelTol); + int *MetricPsiI, + int FieldI, + int MI, + int NI, + CCTK_REAL *AbsTol, + CCTK_REAL *RelTol); +void SORMetric(cGH *GH, + int *MetricI, + int FieldI, + int MI, + int NI, + CCTK_REAL *AbsTol, + CCTK_REAL *RelTol); void SORFlat(cGH *GH, int FieldI, int MI, @@ -29,10 +54,41 @@ void SORFlat(cGH *GH, CCTK_REAL *AbsTol, CCTK_REAL *RelTol); -/* routine registers the SOR solver "SORConfMetric" under the name "sor" - with the Elliptic Class "LinConfMetric". -*/ +/******************************************************************** + ***************** Scheduled Routine Prototypes ********************* + ********************************************************************/ + +void EllSOR_Register(CCTK_ARGUMENTS); + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + +/*@@ + @routine EllSOR_Register + @date + @author + @desc + Scheduled routine to register the SOR solvers SORConfMetric and + SORFlatunder with the name "sor" for the Elliptic Classes + LinConfMetric and LinFlat + @enddesc + @calls + @calledby + @history + + @endhistory + + @@*/ void EllSOR_Register(CCTK_ARGUMENTS) { @@ -41,43 +97,54 @@ void EllSOR_Register(CCTK_ARGUMENTS) int err; - /* Register the solver with the elliptic classes */ + if (Ell_RegisterSolver(SORConfMetric,"sor","Ell_LinConfMetric") + != ELL_SUCCESS) + { + CCTK_WARN(0, + "EllSOR_Register: Failed to register sor for Ell_LinConfMetric"); + } - err = Ell_RegisterSolver(SORConfMetric,"sor","Ell_LinConfMetric"); - if (!err==ELL_SUCCESS) + if (Ell_RegisterSolver(SORMetric,"sor","Ell_LinMetric") + != ELL_SUCCESS) { - CCTK_WARN(0,"EllSOR_Register: Failed to register sor for Ell_LinConfMetric"); + CCTK_WARN(0, + "EllSOR_Register: Failed to register sor for Ell_LinMetric"); } - err = Ell_RegisterSolver(SORFlat,"sor","Ell_LinFlat"); - if (!err==ELL_SUCCESS) + if (Ell_RegisterSolver(SORFlat,"sor","Ell_LinFlat") != ELL_SUCCESS) { CCTK_WARN(0,"EllSOR_Register: Failed to register sor for Ell_LinFlat"); } - /* These "keys" have to be same in other elliptic solver and in + /* These "keys" have to be same in other elliptic solvers and in the routines that sets them ! */ - /* Register boundary SOR can handle */ + /* Register boundaries which SOR can handle */ err = Ell_CreateKey(CCTK_VARIABLE_STRING,"EllLinFlat::Bnd::Robin"); + if (err != ELL_SUCCESS) + { + CCTK_WARN(1, + "EllSOR_Register: Failed to create key EllLinFlat::Bnd::Robin"); + } err = Ell_CreateKey(CCTK_VARIABLE_STRING,"EllLinFlat::Bnd::Const"); + if (err != ELL_SUCCESS) + { + CCTK_WARN(1, + "EllSOR_Register: Failed to create key EllLinFlat::Bnd::Const"); + } - /* Create a key to be associated with the maximum number of iterations - allowed. */ + /* Create a key for the maximum number of iterations allowed. */ err = Ell_CreateKey(CCTK_VARIABLE_INT, "Ell::SORmaxit"); if (err != ELL_SUCCESS) { - CCTK_WARN(0, "EllSOR_Register: " - "Failed to create integer key Ell::SORmaxit"); + CCTK_WARN(0, "EllSOR_Register: Failed to create key Ell::SORmaxit"); } - /* Create a key to be associated with the type of acceleration to be - used. */ + /* Create a key for the type of acceleration to be used. */ err = Ell_CreateKey(CCTK_VARIABLE_STRING, "Ell::SORaccel"); if (err != ELL_SUCCESS) { - CCTK_WARN(0, "EllSOR_Register: " - "Failed to create integer key Ell::SORaccel"); + CCTK_WARN(0, "EllSOR_Register: Failed to create key Ell::SORaccel"); } } |