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 | |
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')
-rw-r--r-- | src/GHExtension.c | 7 | ||||
-rw-r--r-- | src/Output.c | 11 | ||||
-rw-r--r-- | src/OutputInfo.c | 45 |
3 files changed, 41 insertions, 22 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c index c16bc19..30b5061 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -15,7 +15,6 @@ #include "cctk.h" #include "cctk_Parameters.h" -#include "cctk_ParameterFunctions.h" #include "CactusBase/IOUtil/src/ioGH.h" #include "iobasicGH.h" @@ -44,7 +43,7 @@ int IOBasic_InitGH (cGH *GH) DECLARE_CCTK_PARAMETERS int i; iobasicGH *myGH; - t_param_prop *param_prop; + cParamData *paramdata; /* get the handles for IOBasic extensions */ myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")]; @@ -64,8 +63,8 @@ int IOBasic_InitGH (cGH *GH) /* Check whether "outdirScalar" was set. If so take this dir otherwise default to "IO::outdir" */ - param_prop = CCTK_ParameterInfo ("outdirScalar", CCTK_THORNSTRING); - if (param_prop && param_prop->n_set > 0) + paramdata = CCTK_ParameterData ("outdirScalar", CCTK_THORNSTRING); + if (paramdata && paramdata->n_set > 0) myGH->outdirScalar = strdup (outdirScalar); else myGH->outdirScalar = strdup (outdir); diff --git a/src/Output.c b/src/Output.c index f4f30c2..4c8bf02 100644 --- a/src/Output.c +++ b/src/Output.c @@ -15,7 +15,6 @@ #include "cctk.h" #include "cctk_Parameters.h" -#include "cctk_ParameterFunctions.h" #include "CactusBase/IOUtil/src/ioGH.h" #include "iobasicGH.h" @@ -26,7 +25,7 @@ int IOBasic_OutputGH (cGH *GH) int index; const char *name; iobasicGH *myGH; - t_param_prop *param_prop; + cParamData *paramdata; static int outScalar_vars_lastset = 0; @@ -38,18 +37,18 @@ int IOBasic_OutputGH (cGH *GH) return (0); /* Check the 'outScalar_vars' parameter */ - param_prop = CCTK_ParameterInfo ("outScalar_vars", CCTK_THORNSTRING); - if (! param_prop) { + paramdata = CCTK_ParameterData ("outScalar_vars", CCTK_THORNSTRING); + if (! paramdata) { CCTK_WARN (3, "Couldn't get info on parameter 'outScalar_vars'"); return (0); } /* re-parse the 'outScalar_vars' parameter if it was changed */ - if (param_prop->n_set != outScalar_vars_lastset) { + if (paramdata->n_set != outScalar_vars_lastset) { ParseVarsForOutput (outScalar_vars, myGH->do_outScalar); /* Save the last setting of 'outScalar_vars' parameter */ - outScalar_vars_lastset = param_prop->n_set; + outScalar_vars_lastset = paramdata->n_set; } /* Loop over all variables */ 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 */ |