aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev
diff options
context:
space:
mode:
authorIan Hawke <ih@maths.soton.ac.uk>2005-03-04 12:07:00 +0000
committerIan Hawke <ih@maths.soton.ac.uk>2005-03-04 12:07:00 +0000
commit8019074673f2a58fdf20b8fcf865672f51f9c87d (patch)
tree74b7d949a9bd54c3267bd7b1702ebaa555802c5e /CarpetDev
parentca48212aab5d31b0971341d7ca757d949d912ef4 (diff)
CarpetAdaptiveRegrid: ASCII pictures of the mask
Print to screen (using cout; not good on multiprocs) an ASCII art picture of the mask for debugging purposes. darcs-hash:20050304120741-58c7f-9cc7fbbb8462dafc558b974dcc1a04a28b5e7987.gz
Diffstat (limited to 'CarpetDev')
-rw-r--r--CarpetDev/CarpetAdaptiveRegrid/param.ccl4
-rw-r--r--CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc14
2 files changed, 18 insertions, 0 deletions
diff --git a/CarpetDev/CarpetAdaptiveRegrid/param.ccl b/CarpetDev/CarpetAdaptiveRegrid/param.ccl
index 0ce964b32..646c36ce3 100644
--- a/CarpetDev/CarpetAdaptiveRegrid/param.ccl
+++ b/CarpetDev/CarpetAdaptiveRegrid/param.ccl
@@ -43,6 +43,10 @@ CCTK_BOOLEAN veryverbose "Should we be very verbose"
{
} "no"
+CCTK_BOOLEAN maskpicture "Should we print a picture of the mask"
+{
+} "no"
+
CCTK_INT refinement_levels "Number of initial refinement levels (including the base level)" STEERABLE=always
{
1:* :: "must be positive, and must not be larger than Carpet::max_refinement_levels"
diff --git a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
index 157d6f8f1..3199c55e5 100644
--- a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
+++ b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
@@ -561,7 +561,13 @@ namespace CarpetAdaptiveRegrid {
//
bool should_regrid = false;
for (CCTK_INT k = 0; k < imax[2] - imin[2] + 1; k++) {
+ if (maskpicture) {
+ cout << endl << "k = " << k << endl;
+ }
for (CCTK_INT j = 0; j < imax[1] - imin[1] + 1; j++) {
+ if (maskpicture) {
+ cout << endl;
+ }
for (CCTK_INT i = 0; i < imax[0] - imin[0] + 1; i++) {
CCTK_INT index = i +
(imax[0]-imin[0] + 1)*(j + (imax[1] - imin[1] + 1) * k);
@@ -571,6 +577,14 @@ namespace CarpetAdaptiveRegrid {
"\n[%d,%d,%d]",
i,j,k);
}
+ if (maskpicture) {
+ if (mask[index]) {
+ cout << "x";
+ }
+ else {
+ cout << " ";
+ }
+ }
should_regrid |= (mask[index]);
did_regrid |= should_regrid;
}