aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOASCII
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-05-01 22:53:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-05-01 22:53:00 +0000
commit4c49c9c905c9583a087d5ce2ad748b0fdf29bcb6 (patch)
treedc0dd77ac9f8a6fdeca7ff7d13201bf44be117f9 /Carpet/CarpetIOASCII
parentd935f3b9f4411115d8338e853ab32f45e3cac740 (diff)
CarpetIOASCII: Correct handling of "output_symmetry_points"
Only apply the parameter output_symmetry_points at outer boundaries. Only apply the parameter out3D_outer_ghosts if this is not a symmetry boundary. Unify handling of output_symmetry_points, out3D_ghosts, and out3D_outer_ghosts. darcs-hash:20060501225333-dae7b-e7afe3acb60c898967c562885f3601eb4eb4e6bb.gz
Diffstat (limited to 'Carpet/CarpetIOASCII')
-rw-r--r--Carpet/CarpetIOASCII/param.ccl6
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc73
2 files changed, 39 insertions, 40 deletions
diff --git a/Carpet/CarpetIOASCII/param.ccl b/Carpet/CarpetIOASCII/param.ccl
index 7e5959320..b75f2e836 100644
--- a/Carpet/CarpetIOASCII/param.ccl
+++ b/Carpet/CarpetIOASCII/param.ccl
@@ -364,15 +364,15 @@ CCTK_REAL out2D_yzplane_x "x coordinate for 2D planes in yz-direction" STEERABLE
-BOOLEAN output_symmetry_points "Output symmetry points"
+BOOLEAN output_symmetry_points "Output symmetry points (assuming that there are nghostzones symmetry points)"
{
} "yes"
-BOOLEAN out3D_ghosts "Output ghost zones as well"
+BOOLEAN out3D_ghosts "Output ghost zones"
{
} "yes"
-BOOLEAN out3D_outer_ghosts "Output outer boundary ghost zones as well"
+BOOLEAN out3D_outer_ghosts "Output outer boundary zones (assuming that there are nghostzones boundary points)"
{
} "yes"
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index e080e8c55..1f6f55e6c 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -764,47 +764,46 @@ namespace CarpetIOASCII {
ivect lo = ext.lower();
ivect hi = ext.upper();
ivect str = ext.stride();
-
- // Ignore symmetry boundaries if desired
- if (! output_symmetry_points) {
- if (grouptype == CCTK_GF) {
- CCTK_INT const symtable
- = SymmetryTableHandleForGrid (cctkGH);
- if (symtable < 0) CCTK_WARN (0, "internal error");
- CCTK_INT symbnd[2*dim];
- int const ierr = Util_TableGetIntArray
- (symtable, 2*dim, symbnd, "symmetry_handle");
- if (ierr != 2*dim) CCTK_WARN (0, "internal error");
- for (int d=0; d<dim; ++d) {
- if (symbnd[2*d] < 0) {
- // lower boundary is a symmetry boundary
- lo[d] += cctkGH->cctk_nghostzones[d] * str[d];
- }
- if (symbnd[2*d+1] < 0) {
- // upper boundary is a symmetry boundary
- hi[d] -= cctkGH->cctk_nghostzones[d] * str[d];
- }
- }
- }
- }
-
- // Ignore ghost zones if desired
- for (int d=0; d<dim; ++d) {
- bool output_lower_ghosts
- = cctkGH->cctk_bbox[2*d] ? out3D_outer_ghosts : out3D_ghosts;
- bool output_upper_ghosts
- = cctkGH->cctk_bbox[2*d+1] ? out3D_outer_ghosts : out3D_ghosts;
-
- if (! output_lower_ghosts) {
- lo[d] += cctkGH->cctk_nghostzones[d] * str[d];
+
+ // Ignore symmetry and ghost zones if desired
+ {
+ CCTK_INT const symtable
+ = SymmetryTableHandleForGrid (cctkGH);
+ if (symtable < 0) CCTK_WARN (0, "internal error");
+ CCTK_INT symbnd[2*dim];
+ int const ierr = Util_TableGetIntArray
+ (symtable, 2*dim, symbnd, "symmetry_handle");
+ if (ierr != 2*dim) CCTK_WARN (0, "internal error");
+ bool is_symbnd[2*dim];
+ for (int d=0; d<2*dim; ++d) {
+ is_symbnd[d] = symbnd[d] < 0;
}
- if (! output_upper_ghosts) {
- hi[d] -= cctkGH->cctk_nghostzones[d] * str[d];
+
+ for (int d=0; d<dim; ++d) {
+ bool const output_lower_ghosts =
+ cctkGH->cctk_bbox[2*d]
+ ? (is_symbnd[2*d]
+ ? output_symmetry_points
+ : out3D_outer_ghosts)
+ : out3D_ghosts;
+ bool const output_upper_ghosts =
+ cctkGH->cctk_bbox[2*d+1]
+ ? (is_symbnd[2*d+1]
+ ? output_symmetry_points
+ : out3D_outer_ghosts)
+ : out3D_ghosts;
+
+ if (not output_lower_ghosts) {
+ lo[d] += cctkGH->cctk_nghostzones[d] * str[d];
+ }
+ if (not output_upper_ghosts) {
+ hi[d] -= cctkGH->cctk_nghostzones[d] * str[d];
+ }
}
}
+
ext = ibbox(lo,hi,str);
-
-
+
// coordinates
const CCTK_REAL coord_time = cctkGH->cctk_time;
rvect global_lower;