aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2005-01-10 10:59:00 +0000
committerThomas Radke <tradke@aei.mpg.de>2005-01-10 10:59:00 +0000
commit1f656eaba009595d9008c308f86761380bd81f52 (patch)
treeb7d296e4579563ba27a2d485c228224b614cd64f /Carpet
parente0a55ca10e88a32f4a71b71ff9bf3b3cddeced32 (diff)
CarpetIOHDF5/src/Output.cc: fix calculation of "origin" attribute; don't output "cctk_bbox" and "cctk_nghostzones" attributes for unchunked data
darcs-hash:20050110105925-776a0-610cbdb983ac67dcb5a28bf558cba4937d20fe60.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetIOHDF5/src/Output.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Output.cc b/Carpet/CarpetIOHDF5/src/Output.cc
index 03fbeea58..32749d043 100644
--- a/Carpet/CarpetIOHDF5/src/Output.cc
+++ b/Carpet/CarpetIOHDF5/src/Output.cc
@@ -306,7 +306,7 @@ int WriteVar (const cGH* const cctkGH, const hid_t writer,
}
// Don't create zero-sized components
- if (num_elems <= 0)
+ if (num_elems == 0)
{
continue;
}
@@ -837,19 +837,17 @@ static void AddAttributes (const cGH *const cctkGH, const char *fullname,
Util_TableGetIntArray (coord_system_handle, vdim,
coord_handles, "COORDINATES") >= 0)
{
+ const ibbox& baseext =
+ vdd.at(Carpet::map)->bases.at(reflevel).at(mglevel).exterior;
+
+ const ivect pos = (bbox->lower() - baseext.lower()) / bbox->stride();
+
for (int d = 0; d < vdim; d++)
{
Util_TableGetReal (coord_handles[d], &origin[d], "COMPMIN");
Util_TableGetReal (coord_handles[d], &delta[d], "DELTA");
delta[d] /= cctk_levfac[d];
- origin[d] += delta[d]*cctk_levoff[d]/cctk_levoffdenom[d] +
- cctk_lbnd[d] * delta[d];
-
- // it's the interior bbox so we have to substract the ghostzones
- if (! cctk_bbox[2*d])
- {
- origin[d] += cctk_nghostzones[d] * delta[d];
- }
+ origin[d] += delta[d] * (cctk_levoff[d] / cctk_levoffdenom[d] + pos[d]);
}
WriteAttribute (dataset, "origin", origin, vdim);
@@ -869,9 +867,12 @@ static void AddAttributes (const cGH *const cctkGH, const char *fullname,
WriteAttribute (dataset, "name", fullname);
WriteAttribute (dataset, "group_timelevel", -request->timelevel);
+#if 0
+ // FIXME TR: output bbox and nghostzones again for chunked output
// Cactus arguments
WriteAttribute (dataset, "cctk_bbox", cctk_bbox, 2*vdim);
WriteAttribute (dataset, "cctk_nghostzones", cctk_nghostzones, vdim);
+#endif
// Carpet arguments
WriteAttribute (dataset, "carpet_mglevel", mglevel);