diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2000-02-25 17:12:57 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2000-02-25 17:12:57 +0000 |
commit | 0e96493692789d2492379290fdbf2e4a7e72aceb (patch) | |
tree | c662ec7528fd06bda4482ae58a6669cfdf046175 /src/Output3D.c | |
parent | 5c5bb01905900966cc2aef4c9ba424694a63194b (diff) |
More stuff for steering parameters.
Thomas
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@94 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output3D.c')
-rw-r--r-- | src/Output3D.c | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/src/Output3D.c b/src/Output3D.c index 7d0bec8..bcaca3f 100644 --- a/src/Output3D.c +++ b/src/Output3D.c @@ -21,9 +21,10 @@ #include "CactusBase/IOUtil/src/ioGH.h" #include "ioFlexGH.h" -/* local function prototypes */ +/* function prototypes */ int IOFlexIO_Output3DVarAs (cGH *GH, const char *var, const char *alias); int IOFlexIO_TimeFor3D (cGH *GH, int index); +static void CheckSteerableParameters (flexioGH *myGH); /*@@ @@ -52,32 +53,15 @@ int IOFlexIO_Output3DGH (cGH *GH) flexioGH *myGH; const char *name; char *fullname; - cParamData *paramdata; - static int out3D_vars_lastset = 0; /* Get the GH extension for IOFlexIO */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (myGH->out3D_every <= 0) - return (0); + CheckSteerableParameters (myGH); - /* Check the 'out3D_vars' parameter */ - paramdata = CCTK_ParameterData ("out3D_vars", CCTK_THORNSTRING); - if (! paramdata) - { - CCTK_WARN (3, "Couldn't get info on parameter 'out3D_vars'"); + if (myGH->out3D_every <= 0) return (0); - } - - /* re-parse the 'out3D_vars' parameter if it was changed */ - if (paramdata->n_set != out3D_vars_lastset) - { - ParseVarsForOutput (out3D_vars, myGH->do_out3D); - - /* Save the last setting of 'out3D_vars' parameter */ - out3D_vars_lastset = paramdata->n_set; - } /* Loop over all variables */ for (i = 0; i < CCTK_NumVars (); i++) { @@ -194,6 +178,8 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index) /* Get the GH extension for IOFlexIO */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; + CheckSteerableParameters (myGH); + /* Check this var should be output */ if (! (myGH->do_out3D [index] && GH->cctk_iteration % myGH->out3D_every == 0)) return (0); @@ -260,5 +246,37 @@ int IOFlexIO_TriggerOutput3D (cGH *GH, int index) return (0); - +} + + +/**************************** local functions ******************************/ +static void CheckSteerableParameters (flexioGH *myGH) +{ + DECLARE_CCTK_PARAMETERS + cParamData *paramdata; + static int out3D_vars_lastset = 0; + + + /* How often to output */ + myGH->out3D_every = out_every > 0 ? out_every : -1; + if (out3D_every > 0) + myGH->out3D_every = out3D_every; + + /* Check the 'out3D_vars' parameter */ + paramdata = CCTK_ParameterData ("out3D_vars", CCTK_THORNSTRING); + if (! paramdata) + { + CCTK_WARN (1, "Couldn't get info on parameter 'out3D_vars'"); + return; + } + + /* re-parse the 'out3D_vars' parameter if it was changed */ + if (paramdata->n_set != out3D_vars_lastset) + { + ParseVarsForOutput (out3D_vars, myGH->do_out3D); + + /* Save the last setting of 'out3D_vars' parameter */ + out3D_vars_lastset = paramdata->n_set; + } + } |