diff options
author | allen <allen@89daf98e-ef62-4674-b946-b8ff9de2216c> | 2001-11-11 21:39:59 +0000 |
---|---|---|
committer | allen <allen@89daf98e-ef62-4674-b946-b8ff9de2216c> | 2001-11-11 21:39:59 +0000 |
commit | 8be2dead296133de0c1ba7de0c02265b6b5b4f95 (patch) | |
tree | ecd35b9b0198c5be604da7d6f2d1752ddd3f8364 /src | |
parent | 0e1241aeb6a0355731bd10d9ab2ec9464ef9995f (diff) |
Schedule AHFInder at ANALYSIS instead of POSTSTEP
AHFinder is always triggered
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinder/trunk@257 89daf98e-ef62-4674-b946-b8ff9de2216c
Diffstat (limited to 'src')
-rw-r--r-- | src/Output.c | 87 | ||||
-rw-r--r-- | src/Startup.c | 45 | ||||
-rw-r--r-- | src/make.code.defn | 3 |
3 files changed, 134 insertions, 1 deletions
diff --git a/src/Output.c b/src/Output.c new file mode 100644 index 0000000..d598afe --- /dev/null +++ b/src/Output.c @@ -0,0 +1,87 @@ + /*@@ + @file Output.c + @date November 10 2001 + @author Gabrielle Allen + @desc + Functions to deal with making AHFinder an IO method + @enddesc + @version $Id$ + @@*/ + +#include "cctk.h" +#include "cctk_Parameters.h" + +static const char *rcsid = "$Header$"; + +CCTK_FILEVERSION(CactusEinstein_AHFinder_Output_c) + +static int ahf_ncall=0; + +int AHFinder_TimeForOutput (const cGH *GH, int vindex); + + /*@@ + @routine AHFinder_TimeForOutput + @date June 31 1999 + @author Gabrielle Allen + @desc + Decides if it is time to output a variable using info output + @enddesc + @calls CheckSteerableParameters + + @var GH + @vdesc Pointer to CCTK GH + @vtype const cGH * + @vio in + @endvar + @var vindex + @vdesc index of variable to check for output + @vtype int + @vio in + @endvar + + @returntype int + @returndesc + true/false (1 or 0) if analysis should be called + @endreturndesc +@@*/ +int AHFinder_TimeForOutput (const cGH *GH, int vindex) +{ + DECLARE_CCTK_PARAMETERS + + int retval=1; + int ahfafter; + + if (vindex==CCTK_VarIndex("ahfinder::triggervar")) + { + + if (ahf_findaftertime <= 0) + { + ahfafter = ahf_findafter; + if (GH->cctk_iteration < ahfafter) {retval=0;} + } + else + { + if (GH->cctk_time < ahf_findaftertime) {retval=0;} + if (ahf_ncall == 0) {ahfafter = GH->cctk_iteration;} + } + + if ( ((GH->cctk_iteration-ahfafter) % ahf_findevery) ) + { + retval = 0; + } + + if (retval==1) {ahf_ncall == 0;} + + } + else + { + retval = 0; + } + + return retval; +} + + + + + diff --git a/src/Startup.c b/src/Startup.c new file mode 100644 index 0000000..6331e11 --- /dev/null +++ b/src/Startup.c @@ -0,0 +1,45 @@ + /*@@ + @file Startup.c + @date Sat 10th November 2001 + @author Gabrielle Allen + @desc + Startup routines for AHFinder. + @enddesc + @version $Id$ + @@*/ + +#include "cctk.h" + +static const char *rcsid = "$Header$"; + +CCTK_FILEVERSION(CactusEinstein_AHFinder_Startup_c) + +int AHFinder_TimeForOutput (const cGH *GH, int vindex); + +/******************************************************************** + ******************** External Routines ************************ + ********************************************************************/ +void AHFinder_Startup (void); + + /*@@ + @routine AHfinder_Startup + @date Sat 10th November 2001 + @author Gabrielle Allen + @desc + The startup registration routine for AHFinder. + Registers AHFinder as an IO Method and provide the + only necessary method TimeForOutput + @enddesc + @calls CCTK_RegisterGHExtensionSetupGH +@@*/ +void AHFinder_Startup (void) +{ + int handle; + + handle = CCTK_RegisterIOMethod ("AHFinder"); + CCTK_RegisterIOMethodTimeToOutput (handle, AHFinder_TimeForOutput); +} + + + + diff --git a/src/make.code.defn b/src/make.code.defn index 76d20eb..5c7e669 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -6,4 +6,5 @@ SRCS += AHFinder_dat.F AHFinder.F \ AHFinder_min.F AHFinder_pow.F AHFinder_leg.F \ AHFinder_flow.F AHFinder_mask.F AHFinder_output.F \ AHFinder_find3.F AHFinder_calcsigma.F \ - AHFinder_initguess.F AHFinder_gau.F SetSym.F + AHFinder_initguess.F AHFinder_gau.F SetSym.F \ + Startup.c Output.c |