diff options
author | bzink <> | 2004-06-04 08:17:00 +0000 |
---|---|---|
committer | bzink <> | 2004-06-04 08:17:00 +0000 |
commit | a1fa979c6bb98a45768d5ae0dd5f4104eb0984f3 (patch) | |
tree | a55b3d60085550b9c84d03f212714ddfa0a44d54 | |
parent | d3549e3ccb05225d65425735a2ad2d44227fb9c3 (diff) |
Added option "divisor" to out3D_criterion.
darcs-hash:20040604081756-5b8bb-9b67f6d827ffd5f5cf152c1ff815a0d4c73b3431.gz
-rw-r--r-- | Carpet/CarpetIOHDF5/param.ccl | 3 | ||||
-rw-r--r-- | Carpet/CarpetIOHDF5/src/iohdf5.cc | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/Carpet/CarpetIOHDF5/param.ccl b/Carpet/CarpetIOHDF5/param.ccl index ef2232d52..915098d4b 100644 --- a/Carpet/CarpetIOHDF5/param.ccl +++ b/Carpet/CarpetIOHDF5/param.ccl @@ -1,5 +1,5 @@ # Parameter definitions for thorn CarpetIOHDF5 -# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/param.ccl,v 1.11 2004/06/02 14:06:08 bzink Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/param.ccl,v 1.12 2004/06/04 10:17:56 bzink Exp $ @@ -57,6 +57,7 @@ KEYWORD out3D_criterion "Criterion to select 3D CarpetIOHDF5 output intervals, o "default" :: "Use IO::out_criterion" "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if (iteration % out_every) == 0." "time" :: "Output every that much coordinate time" } "default" diff --git a/Carpet/CarpetIOHDF5/src/iohdf5.cc b/Carpet/CarpetIOHDF5/src/iohdf5.cc index 56d47035a..c05f401ea 100644 --- a/Carpet/CarpetIOHDF5/src/iohdf5.cc +++ b/Carpet/CarpetIOHDF5/src/iohdf5.cc @@ -17,7 +17,7 @@ #include "cctk_Parameters.h" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5.cc,v 1.31 2004/05/31 18:59:20 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5.cc,v 1.32 2004/06/04 10:17:56 bzink Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOHDF5_iohdf5_cc); } @@ -616,6 +616,23 @@ namespace CarpetIOHDF5 { // we want no output at this iteration output_this_iteration = false; } + + } else if (CCTK_EQUALS (myoutcriterion, "divisor")) { + + int myoutevery = out3D_every; + if (myoutevery == -2) { + myoutevery = out_every; + } + if (myoutevery <= 0) { + // output is disabled + output_this_iteration = false; + } else if ((cctk_iteration % myoutevery) == 0) { + // we already decided to output this iteration + output_this_iteration = true; + } else { + // we want no output at this iteration + output_this_iteration = false; + } } else if (CCTK_EQUALS (myoutcriterion, "time")) { |