aboutsummaryrefslogtreecommitdiff
path: root/CarpetAttic
diff options
context:
space:
mode:
authorschnetter <>2002-01-14 13:59:00 +0000
committerschnetter <>2002-01-14 13:59:00 +0000
commit73ec4cfa7dc629b3f8c57503a5f22985a61d7489 (patch)
tree5e9001b63b9cc80aeb4a5c8b1047f2f8a67eacad /CarpetAttic
parent45a9266999b72677844cd2761ff733727e62344e (diff)
Added explicit type conversions to make it compile with gcc 3.0.
darcs-hash:20020114135924-07bb3-96fa13db24c22b0b6ed8e8672548fff5a3800a35.gz
Diffstat (limited to 'CarpetAttic')
-rw-r--r--CarpetAttic/CarpetIOFlexIO/param.ccl30
-rw-r--r--CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc20
2 files changed, 28 insertions, 22 deletions
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);