diff options
Diffstat (limited to 'Carpet/CarpetIOASCII/src/ioascii.cc')
-rw-r--r-- | Carpet/CarpetIOASCII/src/ioascii.cc | 73 |
1 files changed, 36 insertions, 37 deletions
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; |