From 2a38d7eb6a6db8b150a9f6fd5f1c844b8d0ef74a Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 1 Jan 2005 18:22:00 +0000 Subject: global: Turn CarpetLib templates into classes Turn most of the templates in CarpetLib, which used to have the form template class XXX into classes, i.e., into something like class XXX by setting D to the new global integer constant dim, which in turn is set to 3. The templates gf and data, which used to be of the form template class XXX are now of the form template class XXX The templates vect, bbox, and bboxset remain templates. This change simplifies the code somewhat. darcs-hash:20050101182234-891bb-c3063528841f0d078b12cc506309ea27d8ce730d.gz --- Carpet/CarpetSlab/src/GetHyperslab.cc | 16 ++++++++-------- Carpet/CarpetSlab/src/slab.cc | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'Carpet/CarpetSlab') diff --git a/Carpet/CarpetSlab/src/GetHyperslab.cc b/Carpet/CarpetSlab/src/GetHyperslab.cc index c84691e6e..c22e0b1b4 100644 --- a/Carpet/CarpetSlab/src/GetHyperslab.cc +++ b/Carpet/CarpetSlab/src/GetHyperslab.cc @@ -107,9 +107,9 @@ namespace CarpetSlab { // } // Get insider information about variable - const gh* myhh; - const dh* mydd; - const ggf* myff; + const gh* myhh; + const dh* mydd; + const ggf* myff; assert (group < (int)arrdata.size()); myhh = arrdata.at(group).at(m).hh; assert (myhh); @@ -141,7 +141,7 @@ namespace CarpetSlab { } // Get sample data - const gdata* mydata; + const gdata* mydata; mydata = (*myff)(tl, rl, 0, 0); // Stride of data in memory @@ -171,13 +171,13 @@ namespace CarpetSlab { // Create collector data object void* myhdata = rank==collect_proc ? hdata : 0; - gdata* const alldata = mydata->make_typed(-1); + gdata* const alldata = mydata->make_typed(-1); alldata->allocate (hextent, collect_proc, myhdata); // Done with the temporary stuff mydata = 0; - for (comm_state state; !state.done(); state.step()) { + for (comm_state state; !state.done(); state.step()) { // Loop over all components, copying data from them BEGIN_LOCAL_COMPONENT_LOOP (cgh, gp.grouptype) { @@ -207,8 +207,8 @@ namespace CarpetSlab { // Copy result to all processors if (dest_proc == -1) { - vector*> tmpdata(CCTK_nProcs(cgh)); - vector > state; + vector tmpdata(CCTK_nProcs(cgh)); + vector state; for (int proc=0; proc* myhh; - const dh* mydd; - const ggf* myff; + const gh* myhh; + const dh* mydd; + const ggf* myff; assert (group < (int)arrdata.size()); myhh = arrdata.at(group).at(m).hh; assert (myhh); @@ -173,7 +173,7 @@ namespace CarpetSlab { } // Get sample data - const gdata* mydata; + const gdata* mydata; mydata = (*myff)(tl, rl, 0, 0); // Stride of data in memory @@ -203,13 +203,13 @@ namespace CarpetSlab { // Create collector data object void* myhdata = rank==collect_proc ? hdata : 0; - gdata* const alldata = mydata->make_typed(-1); + gdata* const alldata = mydata->make_typed(-1); alldata->allocate (hextent, collect_proc, myhdata); // Done with the temporary stuff mydata = 0; - for (comm_state state; !state.done(); state.step()) { + for (comm_state state; !state.done(); state.step()) { // Loop over all components, copying data from them BEGIN_LOCAL_COMPONENT_LOOP (cgh, gp.grouptype) { @@ -239,8 +239,8 @@ namespace CarpetSlab { // Copy result to all processors if (dest_proc == -1) { - vector*> tmpdata(CCTK_nProcs(cgh)); - vector > state; + vector tmpdata(CCTK_nProcs(cgh)); + vector state; for (int proc=0; proc