From f2db7c903184bf680f8d61d292189cea0d390ba1 Mon Sep 17 00:00:00 2001 From: bzink <> Date: Fri, 4 Jun 2004 08:17:00 +0000 Subject: Added option "divisor" to out3D_criterion. darcs-hash:20040604081756-5b8bb-9b67f6d827ffd5f5cf152c1ff815a0d4c73b3431.gz --- Carpet/CarpetIOHDF5/src/iohdf5.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetIOHDF5/src/iohdf5.cc') 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")) { -- cgit v1.2.3