aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOHDF5
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-02-13 18:33:30 -0600
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 16:45:26 +0000
commit3b52b3721d634461b2d3840db16735b78a4a8cad (patch)
treebf192abc623573e7124f3810a7336d1f85fe3c54 /Carpet/CarpetIOHDF5
parent23a591ba88475bf0842257215f04c9f76a1c3fc4 (diff)
Combine CarpetLib's INSTANTIATE and Carpet's TYPECASE mechanism into a
single mechanism provided by CarpetLib. Use this mechanism everywhere.
Diffstat (limited to 'Carpet/CarpetIOHDF5')
-rw-r--r--Carpet/CarpetIOHDF5/interface.ccl3
-rw-r--r--Carpet/CarpetIOHDF5/src/Output.cc5
-rw-r--r--Carpet/CarpetIOHDF5/src/OutputSlice.cc6
3 files changed, 10 insertions, 4 deletions
diff --git a/Carpet/CarpetIOHDF5/interface.ccl b/Carpet/CarpetIOHDF5/interface.ccl
index 521e023a9..e14a9c143 100644
--- a/Carpet/CarpetIOHDF5/interface.ccl
+++ b/Carpet/CarpetIOHDF5/interface.ccl
@@ -18,6 +18,9 @@ uses include header: gdata.hh
uses include header: ggf.hh
uses include header: gh.hh
+uses include header: typecase.hh
+uses include header: typeprops.hh
+
CCTK_INT next_output_iteration TYPE=scalar
diff --git a/Carpet/CarpetIOHDF5/src/Output.cc b/Carpet/CarpetIOHDF5/src/Output.cc
index 62f9d9778..70aa35af9 100644
--- a/Carpet/CarpetIOHDF5/src/Output.cc
+++ b/Carpet/CarpetIOHDF5/src/Output.cc
@@ -9,6 +9,7 @@
#include "util_Table.h"
#include "operators.hh"
+#include "typeprops.hh"
#include "CarpetIOHDF5.hh"
#include "CactusBase/IOUtil/src/ioGH.h"
@@ -530,10 +531,10 @@ int WriteVarChunkedParallel (const cGH* const cctkGH,
if (group.disttype == CCTK_DISTRIB_CONSTANT) {
MPI_Datatype datatype;
- switch (group.vartype) {
+ switch (specific_cactus_type(group.vartype)) {
#define TYPECASE(N,T) \
case N: { T dummy; datatype = dist::mpi_datatype(dummy); } break;
-#include "carpet_typecase.hh"
+#include "typecase.hh"
#undef TYPECASE
default: assert (0 and "invalid datatype");
}
diff --git a/Carpet/CarpetIOHDF5/src/OutputSlice.cc b/Carpet/CarpetIOHDF5/src/OutputSlice.cc
index 77d0680e4..09005e9a7 100644
--- a/Carpet/CarpetIOHDF5/src/OutputSlice.cc
+++ b/Carpet/CarpetIOHDF5/src/OutputSlice.cc
@@ -15,6 +15,8 @@
#include "CarpetTimers.hh"
+#include "typeprops.hh"
+
#include "CarpetIOHDF5.hh"
@@ -1393,14 +1395,14 @@ namespace CarpetIOHDF5 {
ivect const pos = ivect(i,i,i);
if(gfext.contains(pos)) {
for (size_t n = 0; n < gfdatas.size(); n++) {
- switch (groupdata.vartype) {
+ switch (specific_cactus_type(groupdata.vartype)) {
#define TYPECASE(N,T) \
case N: { T* typed_buffer = (T*) &buffer.front(); \
typed_buffer[offset + n*npoints] = \
(*(const data<T>*)gfdatas.at(n))[pos]; \
break; \
}
-#include "carpet_typecase.hh"
+#include "typecase.hh"
#undef TYPECASE
}
}