From d3549e3ccb05225d65425735a2ad2d44227fb9c3 Mon Sep 17 00:00:00 2001 From: bzink <> Date: Thu, 3 Jun 2004 08:03:00 +0000 Subject: Added the option "divisor" to out?d_criterion. darcs-hash:20040603080347-5b8bb-9375277326973c1c75fe326db70081817fdc31fd.gz --- Carpet/CarpetIOASCII/src/ioascii.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetIOASCII/src') diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc index 13923fa80..4622ea479 100644 --- a/Carpet/CarpetIOASCII/src/ioascii.cc +++ b/Carpet/CarpetIOASCII/src/ioascii.cc @@ -31,7 +31,7 @@ #include "ioascii.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.71 2004/05/27 12:23:03 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.72 2004/06/03 10:03:47 bzink Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOASCII_ioascii_cc); } @@ -680,6 +680,23 @@ namespace CarpetIOASCII { output_this_iteration = false; } + } else if (CCTK_EQUALS (myoutcriterion, "divisor")) { + + int myoutevery = GetIntParameter("out%dD_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")) { CCTK_REAL myoutdt = GetRealParameter("out%dD_dt"); -- cgit v1.2.3