aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@10716dce-81a3-4424-a2c8-48026a0d3035>2004-12-16 14:29:07 +0000
committertradke <tradke@10716dce-81a3-4424-a2c8-48026a0d3035>2004-12-16 14:29:07 +0000
commitaf2c4d01ef463c88b459d840c096f8452341c156 (patch)
tree9c93916b4ac67d6d5f4fbb2b51c05a76013ced99
parentb8d09c81f7df8495b32ba90b162f059fe95dd02e (diff)
Fixed bug in calculating the hyperslab size for diagonals with periodic BCs
in some dimension but non-periodic in others. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@133 10716dce-81a3-4424-a2c8-48026a0d3035
-rw-r--r--src/Mapping.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/Mapping.c b/src/Mapping.c
index 548db56..b5abe17 100644
--- a/src/Mapping.c
+++ b/src/Mapping.c
@@ -398,11 +398,35 @@ static CCTK_INT DefineMapping (const cGH *GH,
}
/* now fill out the hyperslab mapping structure */
+ mapping->global_hsize[0] = 0;
for (vdim = dim = 0; vdim < vinfo.dim; vdim++)
{
mapping->downsample[vdim] = 1;
- if (mapping->do_dir[vdim] && dim < mapping->hdim)
+ if (mapping->is_diagonal_in_3D)
+ {
+ mapping->totals =
+ (real_extent[0] + mapping->downsample[0]-1) / mapping->downsample[0];
+
+ /* subtract ghostzones for periodic BC */
+ if (! with_ghostzones)
+ {
+ if (GA->connectivity->perme[vdim])
+ {
+ mapping->totals -= 2 * extras->nghostzones[vdim];
+ }
+ else if (GA->connectivity->perme[(vdim + 1) % 3] ||
+ GA->connectivity->perme[(vdim + 2) % 3])
+ {
+ mapping->totals -= extras->nghostzones[vdim];
+ }
+ }
+ if (mapping->global_hsize[0] < mapping->totals)
+ {
+ mapping->global_hsize[0] = mapping->totals;
+ }
+ }
+ else if (mapping->do_dir[vdim] && dim < mapping->hdim)
{
if (downsample)
{
@@ -418,21 +442,6 @@ static CCTK_INT DefineMapping (const cGH *GH,
}
dim++;
}
- else if (mapping->is_diagonal_in_3D)
- {
- mapping->totals =
- (real_extent[0] + mapping->downsample[0]-1) / mapping->downsample[0];
-
- /* subtract ghostzones for periodic BC */
- if (! with_ghostzones && GA->connectivity->perme[vdim])
- {
- mapping->totals -= 2 * extras->nghostzones[vdim];
- }
- if (mapping->global_hsize[0] > mapping->totals)
- {
- mapping->global_hsize[0] = mapping->totals;
- }
- }
}
/* check whether the full local data patch was requested as hyperslab */