From af2c4d01ef463c88b459d840c096f8452341c156 Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 16 Dec 2004 14:29:07 +0000 Subject: 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 --- src/Mapping.c | 41 +++++++++++++++++++++++++---------------- 1 file 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 */ -- cgit v1.2.3