diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-02-22 07:59:46 -0800 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:03 +0100 |
commit | 07d12df03f216b25fef1d4b930cb3b1e9e68c108 (patch) | |
tree | 15854f53f4dfa4ddac2d2fa63bfbfd5d94eae84a /Carpet/CarpetIOBasic | |
parent | ef28ac317f734b5edb8d7d5f8c4de0582359a643 (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; |