aboutsummaryrefslogtreecommitdiff
path: root/src/Output3D.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-01-21 18:00:59 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-01-21 18:00:59 +0000
commit400e340a12e6019f91ded50e5ba1791ee04edda0 (patch)
treed1e719baf82aa32efd45d36bf6b3ec7aec66713e /src/Output3D.c
parentd58e1c47d498896b0c1f208724c7d138abce6349 (diff)
Added several stuff to IOFlexIO:
- checkpointing/recovery of parameters - made 'out2D_every', 'out2D_vars', 'out3D_every' and 'out3D_vars' steerable - fixed compiler warnings - grdocs git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@78 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output3D.c')
-rw-r--r--src/Output3D.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/src/Output3D.c b/src/Output3D.c
index 5ca53a6..b7227ff 100644
--- a/src/Output3D.c
+++ b/src/Output3D.c
@@ -18,11 +18,15 @@
#include "cctk.h"
#include "cctk_parameters.h"
+#include "cctk_ParameterFunctions.h"
+#include "CactusBase/IOUtil/src/ioGH.h"
#include "ioFlexGH.h"
+/* local function prototypes */
int IOFlexIO_Output3DVarAs (cGH *GH, const char *var, const char *alias);
int IOFlexIO_TimeFor3D (cGH *GH, int index);
+
/*@@
@routine IOFlexIO_Output3DGH
@date Sat March 6 1999
@@ -30,13 +34,7 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index);
@desc
Loops over all variables and outputs them if necessary
@enddesc
- @calls CCTK_GHExtensionHandle
- CCTK_NumVars
- CCTK_ImplementationFromVar
- CCTK_VarName
- IOFlexIO_TimeFor3D
- IOFlexIO_Output3DVarAs
- @calledby
+ @calledby CCTK_OutputGH ("IOFlexIO_3D")
@history
@endhistory
@@ -50,12 +48,14 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index);
int IOFlexIO_Output3DGH (cGH *GH)
{
+ DECLARE_CCTK_PARAMETERS
int i;
flexioGH *myGH;
- char *implementation;
char *name;
char *fullname;
- DECLARE_CCTK_PARAMETERS
+ t_param_prop *param_prop;
+ static int out3D_vars_lastset = 0;
+
/* Get the GH extension for IOFlexIO */
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
@@ -63,6 +63,21 @@ int IOFlexIO_Output3DGH (cGH *GH)
if (myGH->out3D_every <= 0)
return (0);
+ /* Check the 'out3D_vars' parameter */
+ param_prop = CCTK_ParameterInfo ("out3D_vars", CCTK_THORNSTRING);
+ if (! param_prop) {
+ CCTK_WARN (3, "Couldn't get info on parameter 'out3D_vars'");
+ return (0);
+ }
+
+ /* re-parse the 'out3D_vars' parameter if it was changed */
+ if (param_prop->n_set != out3D_vars_lastset) {
+ ParseVarsForOutput (out3D_vars, myGH->do_out3D);
+
+ /* Save the last setting of 'out3D_vars' parameter */
+ out3D_vars_lastset = param_prop->n_set;
+ }
+
/* Loop over all variables */
for (i = 0; i < CCTK_NumVars (); i++) {
if (IOFlexIO_TimeFor3D (GH, i)) {
@@ -86,7 +101,6 @@ int IOFlexIO_Output3DGH (cGH *GH)
return (0);
USE_CCTK_PARAMETERS
-
}
@@ -97,11 +111,7 @@ int IOFlexIO_Output3DGH (cGH *GH)
@desc
unconditional output of a variable using the IOFlexIO 3D output method
@enddesc
- @calls CCTK_DecomposeName
- CCTK_VarIndex
- CCTK_GHExtensionHandle
- IOFlexIO_Write3D
- @calledby IOFlexIO_Output3DGH
+ @calledby IOFlexIO_Output3DGH, CCTK_OutputVarAsByMethod ("IOFlexIO_3D")
@history
@endhistory
@@ -130,6 +140,7 @@ int IOFlexIO_Output3DVarAs (cGH *GH, const char *fullname, const char *alias)
DECLARE_CCTK_PARAMETERS
int index;
+
index = CCTK_VarIndex(fullname);
if (verbose) {
@@ -145,7 +156,6 @@ int IOFlexIO_Output3DVarAs (cGH *GH, const char *fullname, const char *alias)
return (0);
USE_CCTK_PARAMETERS
-
}
@@ -157,9 +167,7 @@ int IOFlexIO_Output3DVarAs (cGH *GH, const char *fullname, const char *alias)
Decides if it is time to output a variable using the IOFlexIO 3D output
method
@enddesc
- @calls CCTK_GHExtensionHandle
- CCTK_WARN
- @calledby IOFlexIO_Output3DGH
+ @calledby IOFlexIO_Output3DGH
@history
@endhistory
@@ -181,6 +189,7 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index)
{
flexioGH *myGH;
+
/* Get the GH extension for IOFlexIO */
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
@@ -206,10 +215,7 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index)
Triggers the output a variable using the IOFlexIO 3D output
method
@enddesc
- @calls CCTK_GHExtensionHandle
- CCTK_VarName
- IOFlexIO_Write3D
- @calledby
+ @calledby CCTK scheduler
@history
@endhistory
@@ -233,6 +239,7 @@ int IOFlexIO_TriggerOutput3D (cGH *GH, int index)
flexioGH *myGH;
char *varname;
+
varname = CCTK_VarName (index);
/* Get the GH extension for IOFlexIO */
@@ -253,5 +260,4 @@ int IOFlexIO_TriggerOutput3D (cGH *GH, int index)
return (0);
USE_CCTK_PARAMETERS
-
}