diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-02-22 07:59:46 -0800 |
---|---|---|
committer | Roland Haas <roland.haas@physics.gatech.edu> | 2012-02-22 07:59:46 -0800 |
commit | e7bf8036ba2356ce3fdcbeb1ca1437de1af0bb5d (patch) | |
tree | 73edbbc019dd0fb32ccf1c9a512ab3e4797cbc65 /Carpet/CarpetIOBasic | |
parent | 09e85351f1781b6511acf81440a74b2984c99570 (diff) |
CarpetIOBasic: Add output criterion "divisor"
Support output criterion "divisor" in CarpetIOBasic.
---
Carpet/CarpetIOBasic/param.ccl | 1 +
Carpet/CarpetIOBasic/src/iobasic.cc | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
Diffstat (limited to 'Carpet/CarpetIOBasic')
-rw-r--r-- | Carpet/CarpetIOBasic/param.ccl | 1 | ||||
-rw-r--r-- | Carpet/CarpetIOBasic/src/iobasic.cc | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Carpet/CarpetIOBasic/param.ccl b/Carpet/CarpetIOBasic/param.ccl index 252e873e8..8d105ff6a 100644 --- a/Carpet/CarpetIOBasic/param.ccl +++ b/Carpet/CarpetIOBasic/param.ccl @@ -28,6 +28,7 @@ KEYWORD outInfo_criterion "Criterion to select scalar output intervals, override { "never" :: "Never output" "iteration" :: "Output every so many iterations" + "divisor" :: "Output if iteration mod divisor == 0." "time" :: "Output every that much coordinate time" } "iteration" diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc index 2d0dcb895..2c413e3c2 100644 --- a/Carpet/CarpetIOBasic/src/iobasic.cc +++ b/Carpet/CarpetIOBasic/src/iobasic.cc @@ -562,6 +562,23 @@ namespace CarpetIOBasic { output_this_iteration = false; } + } else if (CCTK_EQUALS (myoutcriterion, "divisor")) { + + int myoutevery = outInfo_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 = outInfo_dt; |