diff options
author | allen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2000-02-03 12:37:07 +0000 |
---|---|---|
committer | allen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2000-02-03 12:37:07 +0000 |
commit | 20df261706857e3e3b250b1e42c750864bb1b4f0 (patch) | |
tree | f2eb6abd02291d628d46351bc2a977dd7ded464a /src/OutputInfo.c | |
parent | 2faa3ae020bd528bf3f33b211d547662a8f5d838 (diff) |
New function and structure names
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@32 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/OutputInfo.c')
-rw-r--r-- | src/OutputInfo.c | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/src/OutputInfo.c b/src/OutputInfo.c index 28210c2..0abcaf8 100644 --- a/src/OutputInfo.c +++ b/src/OutputInfo.c @@ -16,7 +16,6 @@ #include "cctk.h" #include "cctk_Parameters.h" -#include "cctk_ParameterFunctions.h" #include "CactusBase/IOUtil/src/ioGH.h" #include "iobasicGH.h" @@ -51,31 +50,37 @@ CCTK_REAL IOBasic_WriteInfo (cGH *GH, int index, const char *operator, int IOBasic_OutputInfoGH (cGH *GH) { + DECLARE_CCTK_PARAMETERS - int i; + int i; const char *name; - iobasicGH *myGH; - t_param_prop *param_prop; - static int outInfo_vars_lastset = 0; + iobasicGH *myGH; + cParamData *paramdata; + static int outInfo_vars_lastset = 0; /* Get the GH extensions for IOBasic */ myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")]; /* Return if no output is required */ - if (myGH->outInfo_every < 1 || GH->cctk_iteration % myGH->outInfo_every != 0) + if (myGH->outInfo_every < 1 || + GH->cctk_iteration % myGH->outInfo_every != 0) + { return (0); + } /* Check the 'outInfo_vars' parameter */ - param_prop = CCTK_ParameterInfo ("outInfo_vars", CCTK_THORNSTRING); - if (! param_prop) { + paramdata = CCTK_ParameterData ("outInfo_vars", CCTK_THORNSTRING); + if (! paramdata) + { CCTK_WARN (3, "Couldn't get info on parameter 'outInfo_vars'"); return (0); } /* re-parse the 'outInfo_vars' parameter if it was changed and also print a header */ - if (param_prop->n_set != outInfo_vars_lastset) { + if (paramdata->n_set != outInfo_vars_lastset) + { char l1[1024],l2[1024],l3[1024]; ParseVarsForOutput (outInfo_vars, myGH->do_outInfo); @@ -99,24 +104,32 @@ int IOBasic_OutputInfoGH (cGH *GH) fflush(stdout); /* Save the last setting of 'outInfo_vars' parameter */ - outInfo_vars_lastset = param_prop->n_set; + outInfo_vars_lastset = paramdata->n_set; } /* Print the iteration/timestep information for all variables */ if (USE_DECIMAL_NOTATION (GH->cctk_time)) + { printf("%4d |%9.3f|",GH->cctk_iteration,GH->cctk_time); + } else + { printf("%4d |%7.3e|",GH->cctk_iteration,GH->cctk_time); + } /* Loop over all variables */ - for (i = 0; i < CCTK_NumVars (); i++) { + for (i = 0; i < CCTK_NumVars (); i++) + { /* Check this Variable should be output */ if (! myGH->do_outInfo [i]) + { continue; + } /* Check variable not already output this iteration */ - if (myGH->outInfo_last [i] != GH->cctk_iteration) { + if (myGH->outInfo_last [i] != GH->cctk_iteration) + { /* Get the variable name for this index (for filename) */ name = CCTK_VarName(i); @@ -138,13 +151,21 @@ int IOBasic_OutputInfoGH (cGH *GH) /* finally print out the stuff */ if (USE_DECIMAL_NOTATION (myGH->infovals [i][0])) + { printf ("%12.8f |", myGH->infovals [i][0]); + } else + { printf ("%10.6e |", myGH->infovals [i][0]); + } if (USE_DECIMAL_NOTATION (myGH->infovals [i][1])) + { printf ("%12.8f |", myGH->infovals [i][1]); + } else + { printf ("%10.6e |", myGH->infovals [i][1]); + } } /* end of loop over all variables */ |