diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-08-11 20:32:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-08-11 20:32:00 +0000 |
commit | e10a9a13e504a21015193dfea78e98475b4e754b (patch) | |
tree | 65206baf9a75cd9ed80b3d6fbe26807261d5286c /Carpet/CarpetIOASCII | |
parent | f4d1e053ec04cb59dae7d7e13cb621916c1bd9ee (diff) |
CarpetIOASCII: Correct error in determining symmetry boundaries
Correct an error in determining which boundaries are symmetry
boundaries. This is relevant only if symmetry boundaries should not
be output. The error was that boundaries of grid arrays and grid
scalars were treated in the same way as the corresponding grid
function boundaries. This is wrong since grid arrays have their own
symmetry specifications.
darcs-hash:20060811203224-dae7b-f468b5f1e9f17bf660b4e6ee908449819fca40ab.gz
Diffstat (limited to 'Carpet/CarpetIOASCII')
-rw-r--r-- | Carpet/CarpetIOASCII/interface.ccl | 5 | ||||
-rw-r--r-- | Carpet/CarpetIOASCII/src/ioascii.cc | 45 |
2 files changed, 38 insertions, 12 deletions
diff --git a/Carpet/CarpetIOASCII/interface.ccl b/Carpet/CarpetIOASCII/interface.ccl index 2c06d7399..e2cad7979 100644 --- a/Carpet/CarpetIOASCII/interface.ccl +++ b/Carpet/CarpetIOASCII/interface.ccl @@ -34,6 +34,11 @@ CCTK_INT FUNCTION \ SymmetryTableHandleForGrid (CCTK_POINTER_TO_CONST IN cctkGH) REQUIRES FUNCTION SymmetryTableHandleForGrid +CCTK_INT FUNCTION \ + SymmetryTableHandleForGI (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_INT IN group_index) +REQUIRES FUNCTION SymmetryTableHandleForGI + # Return a pointer to an unmodifiable C string diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc index 05a41404a..52ce33c0a 100644 --- a/Carpet/CarpetIOASCII/src/ioascii.cc +++ b/Carpet/CarpetIOASCII/src/ioascii.cc @@ -766,8 +766,17 @@ namespace CarpetIOASCII { int const ierr = CCTK_GroupData (group, & groupdata); assert (not ierr); } + + cGroupDynamicData dyndata; + { + int const ierr = CCTK_GroupDynamicData + (cctkGH, group, & dyndata); + assert (not ierr); + } + if (groupdata.disttype != CCTK_DISTRIB_CONSTANT - or component == 0) { + or component == 0) + { const ggf* const ff = arrdata.at(group).at(Carpet::map).data.at(var); @@ -785,37 +794,49 @@ namespace CarpetIOASCII { // Ignore symmetry and ghost zones if desired { - CCTK_INT const symtable - = SymmetryTableHandleForGrid (cctkGH); - if (symtable < 0) CCTK_WARN (0, "internal error"); + CCTK_INT symtable; + // TODO: This is a bit ad hoc + if (groupdata.grouptype == CCTK_GF + and groupdata.dim == cctkGH->cctk_dim) + { + symtable + = SymmetryTableHandleForGrid (cctkGH); + if (symtable < 0) CCTK_WARN (0, "internal error"); + } else { + symtable + = SymmetryTableHandleForGI (cctkGH, group); + 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"); + (symtable, 2*groupdata.dim, symbnd, "symmetry_handle"); + if (ierr != 2*groupdata.dim) { + CCTK_WARN (0, "internal error"); + } bool is_symbnd[2*dim]; - for (int d=0; d<2*dim; ++d) { + for (int d=0; d<2*groupdata.dim; ++d) { is_symbnd[d] = symbnd[d] >= 0; } - for (int d=0; d<dim; ++d) { + for (int d=0; d<groupdata.dim; ++d) { bool const output_lower_ghosts = - cctkGH->cctk_bbox[2*d] + dyndata.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] + dyndata.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]; + lo[d] += dyndata.nghostzones[d] * str[d]; } if (not output_upper_ghosts) { - hi[d] -= cctkGH->cctk_nghostzones[d] * str[d]; + hi[d] -= dyndata.nghostzones[d] * str[d]; } } } |