From 4c49c9c905c9583a087d5ce2ad748b0fdf29bcb6 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Mon, 1 May 2006 22:53:00 +0000 Subject: 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 --- Carpet/CarpetIOASCII/src/ioascii.cc | 73 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 37 deletions(-) (limited to 'Carpet/CarpetIOASCII/src/ioascii.cc') 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; dcctk_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; dcctk_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; dcctk_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; -- cgit v1.2.3