diff options
-rw-r--r-- | Carpet/Carpet/src/Initialise.cc | 7 | ||||
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 7 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/regrid.cc | 16 | ||||
-rw-r--r-- | CarpetAttic/CarpetIOFlexIO/param.ccl | 30 | ||||
-rw-r--r-- | CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc | 20 |
5 files changed, 48 insertions, 32 deletions
diff --git a/Carpet/Carpet/src/Initialise.cc b/Carpet/Carpet/src/Initialise.cc index 24127da2f..e885280e3 100644 --- a/Carpet/Carpet/src/Initialise.cc +++ b/Carpet/Carpet/src/Initialise.cc @@ -9,7 +9,7 @@ #include "carpet.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Initialise.cc,v 1.6 2002/01/11 17:19:45 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Initialise.cc,v 1.7 2002/01/14 14:59:24 schnetter Exp $"; @@ -21,12 +21,17 @@ namespace Carpet { int Initialise (tFleshConfig* fc) { + cout << "zwei..." << endl; DECLARE_CCTK_PARAMETERS; + cout << "zwei..." << endl; // Initialise stuff const int convlev = 0; + cout << "zwei..." << endl; cGH* const cgh = CCTK_SetupGH (fc, convlev); + cout << "zwei..." << endl; CCTKi_AddGH (fc, convlev, cgh); + cout << "zwei..." << endl; // Delay checkpoint until MPI has been initialised Waypoint ("starting Initialise..."); diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index 5fec5e2ae..a8f7ce2d3 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -12,7 +12,7 @@ #include "carpet.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/SetupGH.cc,v 1.21 2002/01/11 17:19:46 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/SetupGH.cc,v 1.22 2002/01/14 14:59:24 schnetter Exp $"; @@ -24,17 +24,22 @@ namespace Carpet { void* SetupGH (tFleshConfig* fc, int convLevel, cGH* cgh) { + cout << "eins..." << endl; DECLARE_CCTK_PARAMETERS; + cout << "eins..." << endl; assert (cgh->cctk_dim == dim); // Not sure what to do with that assert (convLevel==0); + cout << "eins..." << endl; dist::pseudoinit(); + cout << "eins..." << endl; CCTK_VInfo (CCTK_THORNSTRING, "Carpet is running on %d processors", CCTK_nProcs(cgh)); + cout << "eins..." << endl; Waypoint ("starting SetupGH..."); diff --git a/Carpet/CarpetRegrid/src/regrid.cc b/Carpet/CarpetRegrid/src/regrid.cc index fc2a62d75..a8417a1f3 100644 --- a/Carpet/CarpetRegrid/src/regrid.cc +++ b/Carpet/CarpetRegrid/src/regrid.cc @@ -19,7 +19,7 @@ #include "carpet.hh" #include "regrid.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/regrid.cc,v 1.6 2002/01/11 17:37:13 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/regrid.cc,v 1.7 2002/01/14 14:59:27 schnetter Exp $"; @@ -126,7 +126,7 @@ namespace CarpetRegrid { assert (vi-v1 < (int)arrdata[gi].data.size()); assert (arrdata[gi].data[vi-v1]); const gf<CCTK_REAL,dim>& error - = *(const gf<CCTK_REAL,dim>*)arrdata[gi].data[vi-v1]; + = *dynamic_cast<const gf<CCTK_REAL,dim>*>(arrdata[gi].data[vi-v1]); MakeRegions_Adaptively (cctkGH, minwidth, minfraction, maxerror, error, bbl); @@ -303,8 +303,8 @@ namespace CarpetRegrid { const int rl = reflevel+1; - const vect<int,dim> ilower = map(floor, (lower[rl-1] - global_lower) / (global_upper - global_lower) * global_extent + 0.5); - const vect<int,dim> iupper = map(floor, (upper[rl-1] - global_lower) / (global_upper - global_lower) * global_extent + 0.5); + const vect<int,dim> ilower = vect<int,dim>(map((CCTK_REAL(*)(CCTK_REAL))(floor), (lower[rl-1] - global_lower) / (global_upper - global_lower) * vect<CCTK_REAL,dim>(global_extent) + 0.5)); + const vect<int,dim> iupper = vect<int,dim>(map((CCTK_REAL(*)(CCTK_REAL))(floor), (upper[rl-1] - global_lower) / (global_upper - global_lower) * vect<CCTK_REAL,dim>(global_extent) + 0.5)); MakeRegions_AsSpecified_OneLevel (cctkGH, reflevels, ilower, iupper, bbl); } @@ -430,7 +430,7 @@ namespace CarpetRegrid { ibb1 = bbl1.erase(ibb1); ibb2 = bbl2.erase(ibb2); ++numcombinedboxes; - cout << "MRA: Combining along " << "xyz"[dir] << " to " << bbl.back() << " size " << bbl.back().num_points() << endl; +// cout << "MRA: Combining along " << "xyz"[dir] << " to " << bbl.back() << " size " << bbl.back().num_points() << endl; goto continue_search; } @@ -504,7 +504,7 @@ namespace CarpetRegrid { const vect<int,dim> up(region.upper()); const vect<int,dim> str(region.stride()); bbl.push_back (bbox<int,dim>(lo,up+str-str/reffact,str/reffact)); - cout << "MRA: Refining to " << bbl.back() << " size " << bbl.back().num_points() << " fraction " << fraction << endl; +// cout << "MRA: Refining to " << bbl.back() << " size " << bbl.back().num_points() << " fraction " << fraction << endl; } else { // Split the region and check recursively const int dir = maxloc(region.shape()); @@ -557,7 +557,7 @@ namespace CarpetRegrid { const int tl = 0; const int ml = 0; - cout << endl << "MRA: Choosing regions to refine in " << hh->components(rl) << " components" << endl; +// cout << endl << "MRA: Choosing regions to refine in " << hh->components(rl) << " components" << endl; for (int c=0; c<hh->components(rl); ++c) { const bbox<int,dim> region = hh->extents[rl][c][ml]; @@ -573,7 +573,7 @@ namespace CarpetRegrid { for (list<bbox<int,dim> >::const_iterator ibb = bbl.begin(); ibb != bbl.end(); ++ibb) { numpoints += ibb->num_points(); } - cout << "MRA: Chose " << bbl.size() << " regions with a total size of " << numpoints << " to refine." << endl << endl; +// cout << "MRA: Chose " << bbl.size() << " regions with a total size of " << numpoints << " to refine." << endl << endl; } } // namespace CarpetRegrid diff --git a/CarpetAttic/CarpetIOFlexIO/param.ccl b/CarpetAttic/CarpetIOFlexIO/param.ccl index a8a8ba0cc..5edaf1339 100644 --- a/CarpetAttic/CarpetIOFlexIO/param.ccl +++ b/CarpetAttic/CarpetIOFlexIO/param.ccl @@ -1,5 +1,5 @@ # Parameter definitions for thorn CarpetIOFlexIO -# $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIO/param.ccl,v 1.4 2002/01/09 21:14:24 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIO/param.ccl,v 1.5 2002/01/14 14:59:25 schnetter Exp $ @@ -21,16 +21,6 @@ BOOLEAN verbose "Produce log output" -BOOLEAN out3D_ghosts "Output ghost zones as well" -{ -} "yes" - -BOOLEAN out3D_outer_ghosts "Output outer boundary ghost zones as well" -{ -} "yes" - - - CCTK_STRING outdir3D "Name of 3D FlexIO output directory, overrides outdir" STEERABLE = ALWAYS { .* :: "A regex which matches everything" @@ -60,6 +50,24 @@ CCTK_INT out3D_every "How often to do 3D FlexIO output, overrides out_every" STE +CCTK_INT out3D_max_num_lower_ghosts "Maximum number of lower ghost zones that are output" +{ + -1 :: "output all ghost zones" + 0:* :: "output that many ghost zones" +} -1 + +CCTK_INT out3D_max_num_upper_ghosts "Maximum number of upper ghost zones that are output" +{ + -1 :: "output all ghost zones" + 0:* :: "output that many ghost zones" +} -1 + +BOOLEAN out3D_output_outer_boundary "Output all of the outer boundary ghost zones even if not all ghost zones are output" +{ +} "yes" + + + CCTK_STRING indir3D "Name of 3D FlexIO input directory" STEERABLE = ALWAYS { .* :: "A regex which matches everything" diff --git a/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc b/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc index 859e75c4b..bf9610059 100644 --- a/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc +++ b/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc @@ -7,6 +7,7 @@ #include <sys/stat.h> #include <sys/types.h> +#include <algorithm> #include <fstream> #include <vector> @@ -32,7 +33,7 @@ #include "ioflexio.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc,v 1.14 2002/01/09 21:14:25 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc,v 1.15 2002/01/14 14:59:26 schnetter Exp $"; @@ -264,17 +265,14 @@ namespace CarpetIOFlexIO { // Ignore ghost zones if desired for (int d=0; d<dim; ++d) { - bool output_lower_ghosts - = cgh->cctk_bbox[2*d] ? out3D_outer_ghosts : out3D_ghosts; - bool output_upper_ghosts - = cgh->cctk_bbox[2*d+1] ? out3D_outer_ghosts : out3D_ghosts; + const int max_lower_ghosts = (cgh->cctk_bbox[2*d ] && !out3D_output_outer_boundary) ? -1 : out3D_max_num_lower_ghosts; + const int max_upper_ghosts = (cgh->cctk_bbox[2*d+1] && !out3D_output_outer_boundary) ? -1 : out3D_max_num_upper_ghosts; - if (! output_lower_ghosts) { - lo[d] += cgh->cctk_nghostzones[d] * str[d]; - } - if (! output_upper_ghosts) { - hi[d] -= cgh->cctk_nghostzones[d] * str[d]; - } + const int num_lower_ghosts = max_lower_ghosts == -1 ? cgh->cctk_nghostzones[d] : min(out3D_max_num_lower_ghosts, cgh->cctk_nghostzones[d]); + const int num_upper_ghosts = max_upper_ghosts == -1 ? cgh->cctk_nghostzones[d] : min(out3D_max_num_upper_ghosts, cgh->cctk_nghostzones[d]); + + lo[d] += (cgh->cctk_nghostzones[d] - num_lower_ghosts) * str[d]; + hi[d] -= (cgh->cctk_nghostzones[d] - num_upper_ghosts) * str[d]; } ext = bbox<int,dim>(lo,hi,str); |