diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2010-10-02 11:54:31 -0400 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 18:25:32 +0000 |
commit | ef7b24209851a3350f5f75dd264aa397c5f1df4b (patch) | |
tree | e90b80c5ba28096d781ab1d74c339a824a6863fa /Carpet/CarpetIOHDF5 | |
parent | 0a0f7d0d13b297fb19eca89554aa65f735400d21 (diff) |
CarpetIOHDF5: turn on 3d output in OutputSlice.cc
Register new-style output code as an IO method with IOUtil for 3d output.
The new code is not quite as capable as the old code, since it does not
include Ian Hinder's indexing facility and so far outputs all data on the
root processor. It does support the new-style output_symmetry_points etc.
options however.
Diffstat (limited to 'Carpet/CarpetIOHDF5')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc | 1 | ||||
-rw-r--r-- | Carpet/CarpetIOHDF5/src/OutputSlice.cc | 21 |
2 files changed, 13 insertions, 9 deletions
diff --git a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc index cee765395..669d57e2d 100644 --- a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc +++ b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc @@ -101,6 +101,7 @@ int CarpetIOHDF5_Startup (void) IOHDF5<0>::Startup(); IOHDF5<1>::Startup(); IOHDF5<2>::Startup(); + IOHDF5<3>::Startup(); return (0); } diff --git a/Carpet/CarpetIOHDF5/src/OutputSlice.cc b/Carpet/CarpetIOHDF5/src/OutputSlice.cc index ec5cdcd2f..4f2f8dc47 100644 --- a/Carpet/CarpetIOHDF5/src/OutputSlice.cc +++ b/Carpet/CarpetIOHDF5/src/OutputSlice.cc @@ -29,7 +29,8 @@ namespace Carpet { #define GetParameter(parameter) \ outdim == 0 ? out0D_##parameter : \ - outdim == 1 ? out1D_##parameter : out2D_##parameter + outdim == 1 ? out1D_##parameter : \ + outdim == 2 ? out2D_##parameter : out_##parameter namespace CarpetIOHDF5 { @@ -416,7 +417,7 @@ namespace CarpetIOHDF5 { assert (do_global_mode); } - if (outdim >= groupdata.dim) { + if (outdim > groupdata.dim) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "Cannot produce %dD slice HDF5 output file '%s' for variable '%s' " "because it has only %d dimensions", @@ -748,6 +749,8 @@ namespace CarpetIOHDF5 { if (maps > 1 and grouptype == CCTK_GF) { filenamebuf << "." << m; } + // historically 3d output files do not carry a label so the files created + // here do not conflict with the old-style output files filenamebuf << "."; for (int d=0; d<outdim; ++d) { const char* const coords = "xyzd"; @@ -838,9 +841,9 @@ namespace CarpetIOHDF5 { if (dirs[0]==1 and dirs[1]==2) return out2D_yz; assert (0); -// case 3: -// // Output is always requested (if switched on) -// return true; + case 3: + // Output is always requested (if switched on) + return true; default: assert (0); @@ -943,9 +946,9 @@ namespace CarpetIOHDF5 { } break; -// case 3: -// // 3D output: the offset does not matter -// break; + case 3: + // 3D output: the offset does not matter + break; default: assert (0); @@ -1463,6 +1466,6 @@ namespace CarpetIOHDF5 { template class IOHDF5<0>; template class IOHDF5<1>; template class IOHDF5<2>; -// template class IOHDF5<3>; + template class IOHDF5<3>; } // namespace CarpetIOHDF5 |