diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-01-27 23:18:16 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-01-27 23:18:16 +0000 |
commit | 1a53d2c962018be2fa3f7299f4fbdae342149768 (patch) | |
tree | 3c3b8afc80b4190cfe2839d172fa1391b6dbf4f6 /src/main/CactusDefaultInitialise.c | |
parent | 56543d22f0bdfe6c45d557ecf1d7872b4ad47a98 (diff) |
Added the mechanism for allowing drivers to specify a function to be
called at the bottm of a schedule traverse, and changed the flesh to
use the new calls. rfrTraverse is now obsolete and will be removed
soon.
Drivers may now call
int CCTK_RegisterGHExtensionScheduleTraverseGH(int handle,
int (*func)(cGH *, const char *))
to register a ScheduleTraverse function. This is precisely
equivalent to the deprecated CCTK_RegisterGHExtensionrfrTraverseGH
except the registered function now takes a string and not a
constant.
The registered function should then fill out the cGH as per normal,
and call
int CCTK_ScheduleTraverse(const char *where,
void *GH,
int (*CallFunction)(void *, cFunctionData *, void *))
with the string and GH passed in, and either NULL or a function
which takes a function pointer, a cFunctionData data structure, and a cGH.
This function, in turn, may call
int CCTK_CallFunction(void *function,
cFunctionData *fdata,
void *data)
with these arguments, or may call the function in some other way if it
desires.
This allows a driver to loop over all sub-grids at a particular level
filling out the cGH at this level of the schedule tree rather than at
the top, which was the only option available before. Unigrid
drivers should probably still fill out at the top and pass NULL down
as it's more efficient to fill out the cGH only once, but AMR or
multi-block/patch drivers can now use this mechanism.
The old CCTK_rfrTraverse routine has similarly been replaced by
int CCTK_Traverse(cGH *GH, const char *where)
which loops over all GH extensions calling their registered
ScheduleTraverseGH routines.
Tom
NB these names may change at the next naming meeting, but the
functionality should remain.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1317 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/CactusDefaultInitialise.c')
-rw-r--r-- | src/main/CactusDefaultInitialise.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/main/CactusDefaultInitialise.c b/src/main/CactusDefaultInitialise.c index 6aa2cf9f..35580673 100644 --- a/src/main/CactusDefaultInitialise.c +++ b/src/main/CactusDefaultInitialise.c @@ -20,15 +20,12 @@ #include "CactusrfrInterface.h" #include "CactusMainDefaults.h" #include "CactusCommFunctions.h" -#include "rfrConstants.h" -#include "rfrInterface.h" static char *rcsid = "$Id$"; /* Local function prototypes */ int CactusInitialiseGH(cGH *GH); - /*@@ @routine CactusDefaultInitialise @date Tue Sep 29 12:45:04 1998 @@ -113,10 +110,6 @@ int CactusInitialiseGH(cGH *GH) CCTK_PRINTSEPARATOR #endif - /* Setup the rfr_top on this GH */ - - GH->rfr_top = NULL; - /* Do the rfr initialisation on this GH */ CCTKi_ScheduleGHInit((void *)GH); @@ -126,25 +119,25 @@ int CactusInitialiseGH(cGH *GH) #define PUGH #ifdef PUGH - /* Do various rfr traversals. Will tidy up later. */ + /* Do various schedule traversals. Will tidy up later. */ /* FIXME : PARAM_CHECK SHOULD BE BEFORE HERE */ - CCTK_rfrTraverse(GH, CCTK_PARAMCHECK); + CCTK_Traverse(GH, "CCTK_PARAMCHECK"); CCTKi_FinaliseParamWarn(); - CCTK_rfrTraverse(GH, CCTK_BASEGRID); + CCTK_Traverse(GH, "CCTK_BASEGRID"); /* Traverse routines setting up initial data */ - CCTK_rfrTraverse(GH,CCTK_INITIAL); + CCTK_Traverse(GH, "CCTK_INITIAL"); /* Traverse poststep initial routines which should only be done once */ - CCTK_rfrTraverse(GH,CCTK_POSTINITIAL); + CCTK_Traverse(GH, "CCTK_POSTINITIAL"); /* Traverse recovery and ID checkpoint routines */ - CCTK_rfrTraverse(GH,CCTK_RECOVER_VARIABLES); - CCTK_rfrTraverse(GH,CCTK_CPINITIAL); + CCTK_Traverse(GH, "CCTK_RECOVER_VARIABLES"); + CCTK_Traverse(GH, "CCTK_CPINITIAL"); - CCTK_rfrTraverse(GH,CCTK_POSTSTEP); + CCTK_Traverse(GH, "CCTK_POSTSTEP"); #endif |