diff options
author | schnetter <> | 2003-06-18 16:24:00 +0000 |
---|---|---|
committer | schnetter <> | 2003-06-18 16:24:00 +0000 |
commit | ea0d204e9bfe5daa6123970f2c1c323bd7e75b36 (patch) | |
tree | c48a4a122dfec847afa10475dd19ac1b94617e39 /Carpet/CarpetReduce/src | |
parent | 343af5d6432feecd65a217c3cb1731394b55d315 (diff) |
Major update after a quiet time.
Major update after a quiet time.
Carpet: The flesh now has new cGH fields cctk_levoff[],
cctk_levoffdenom[], and cctk_timefac that describe the spatial offset
and temporal refinement factor between the base and the current
refinement level. These fields are now set and used; they change how
coordinates are handled.
CarpetIOASCII: Fix bugs regarding choosing the output hyperslab and
the output coordinates.
ID*, *Toy*: New WaveToy examples with various formulations and
different integrations methods. Currently, none of them converge to
second order except the standard WaveToy formulation.
These updates require the recent flesh, base thorn (and MoL) updates.
darcs-hash:20030618162427-07bb3-70761f74bce6ae246b5a2943a385647657d46d34.gz
Diffstat (limited to 'Carpet/CarpetReduce/src')
-rw-r--r-- | Carpet/CarpetReduce/src/reduce.cc | 90 |
1 files changed, 20 insertions, 70 deletions
diff --git a/Carpet/CarpetReduce/src/reduce.cc b/Carpet/CarpetReduce/src/reduce.cc index 1a5bc0271..3996385f1 100644 --- a/Carpet/CarpetReduce/src/reduce.cc +++ b/Carpet/CarpetReduce/src/reduce.cc @@ -1,4 +1,4 @@ -// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.23 2003/05/21 14:31:03 schnetter Exp $ +// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.24 2003/06/18 18:24:28 schnetter Exp $ #include <assert.h> #include <float.h> @@ -22,7 +22,7 @@ #include "reduce.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.23 2003/05/21 14:31:03 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.24 2003/06/18 18:24:28 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetReduce_reduce_cc); } @@ -716,7 +716,11 @@ namespace CarpetReduce { Initialise (cgh, proc, num_outvals, &myoutvals[0], outtype, &mycounts[0], red); - if (reduce_arrays) { + int const saved_component = component; + if (component!=-1) { + set_component ((cGH*)cgh, -1); + } + BEGIN_LOCAL_COMPONENT_LOOP(cgh, reduce_arrays ? CCTK_ARRAY : CCTK_GF) { assert (grpdim<=dim); int lsh[dim], bbox[2*dim], nghostzones[dim]; @@ -727,34 +731,34 @@ namespace CarpetReduce { ierr = CCTK_GroupnghostzonesVI(cgh, grpdim, nghostzones, vi); assert (!ierr); for (int d=0; d<grpdim; ++d) { - assert (lsh[d]>=0); - assert (nghostzones[d]>=0 && 2*nghostzones[d]<=lsh[d]); + assert (lsh[d]>=0); + assert (nghostzones[d]>=0 && 2*nghostzones[d]<=lsh[d]); } vector<const void*> inarrays (num_invars); for (int n=0; n<num_invars; ++n) { - inarrays[n] = CCTK_VarDataPtrI(cgh, 0, invars[n]); - assert (inarrays[n]); + inarrays[n] = CCTK_VarDataPtrI(cgh, 0, invars[n]); + assert (inarrays[n]); } const int intype = CCTK_VarTypeI(vi); for (int n=0; n<num_invars; ++n) { - assert (CCTK_VarTypeI(invars[n]) == intype); + assert (CCTK_VarTypeI(invars[n]) == intype); } vect<int,dim> mylsh, mynghostzones; vect<vect<int,2>,dim> mybbox; for (int d=0; d<grpdim; ++d) { - mylsh[d] = lsh[d]; + mylsh[d] = lsh[d]; mybbox[d][0] = bbox[2*d ]; mybbox[d][1] = bbox[2*d+1]; - mynghostzones[d] = nghostzones[d]; + mynghostzones[d] = nghostzones[d]; } for (int d=grpdim; d<dim; ++d) { - mylsh[d] = 1; + mylsh[d] = 1; mybbox[d][0] = 0; mybbox[d][1] = 0; - mynghostzones[d] = 0; + mynghostzones[d] = 0; } Reduce (cgh, proc, &mylsh[0], &mybbox[0][0], &mynghostzones[0], @@ -762,64 +766,10 @@ namespace CarpetReduce { num_outvals, &myoutvals[0], outtype, &mycounts[0], red); - } else { // ! reduce_arrays - - int const saved_component = component; - if (component!=-1) { - set_component ((cGH*)cgh, -1); - } - BEGIN_LOCAL_COMPONENT_LOOP(cgh) { - - assert (grpdim<=dim); - int lsh[dim], bbox[2*dim], nghostzones[dim]; - ierr = CCTK_GrouplshVI(cgh, grpdim, lsh, vi); - assert (!ierr); - ierr = CCTK_GroupbboxVI(cgh, 2*grpdim, bbox, vi); - assert (!ierr); - ierr = CCTK_GroupnghostzonesVI(cgh, grpdim, nghostzones, vi); - assert (!ierr); - for (int d=0; d<grpdim; ++d) { - assert (lsh[d]>=0); - assert (nghostzones[d]>=0 && 2*nghostzones[d]<=lsh[d]); - } - - vector<const void*> inarrays (num_invars); - for (int n=0; n<num_invars; ++n) { - inarrays[n] = CCTK_VarDataPtrI(cgh, 0, invars[n]); - assert (inarrays[n]); - } - - const int intype = CCTK_VarTypeI(vi); - for (int n=0; n<num_invars; ++n) { - assert (CCTK_VarTypeI(invars[n]) == intype); - } - - vect<int,dim> mylsh, mynghostzones; - vect<vect<int,2>,dim> mybbox; - for (int d=0; d<grpdim; ++d) { - mylsh[d] = lsh[d]; - mybbox[d][0] = bbox[2*d ]; - mybbox[d][1] = bbox[2*d+1]; - mynghostzones[d] = nghostzones[d]; - } - for (int d=grpdim; d<dim; ++d) { - mylsh[d] = 1; - mybbox[d][0] = 0; - mybbox[d][1] = 0; - mynghostzones[d] = 0; - } - - Reduce (cgh, proc, &mylsh[0], &mybbox[0][0], &mynghostzones[0], - num_invars, &inarrays[0], intype, - num_outvals, &myoutvals[0], outtype, - &mycounts[0], red); - - } END_LOCAL_COMPONENT_LOOP(cgh); - if (saved_component!=-1) { - set_component ((cGH*)cgh, saved_component); - } - - } // ! reduce_arrays + } END_LOCAL_COMPONENT_LOOP; + if (saved_component!=-1) { + set_component ((cGH*)cgh, saved_component); + } Finalise (cgh, proc, num_outvals, outvals, outtype, &myoutvals[0], &mycounts[0], |