aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/patch/patch.cc10
-rw-r--r--src/patch/patch.hh1
2 files changed, 8 insertions, 3 deletions
diff --git a/src/patch/patch.cc b/src/patch/patch.cc
index 80dfba2..cc8239c 100644
--- a/src/patch/patch.cc
+++ b/src/patch/patch.cc
@@ -294,17 +294,23 @@ return *temp;
//
symmetry_ghost_zone& patch::setup_periodic_symmetry_ghost_zone
(const patch_edge& my_edge, const patch_edge& symmetry_edge,
- int my_edge_sample_ipar, int symmetry_edge_sample_ipar,
bool ipar_map_sign) // one of cpm_map::{plus,minus}_map
{
// make sure we belong to the right patch
assert(& my_edge.my_patch() == this);
+bool par_map_is_plus = (ipar_map_sign == cpm_map::plus_map);
+int my_sample_ipar = my_edge.min_ipar_without_corners();
+int symmetry_sample_ipar
+ = par_map_is_plus ? symmetry_edge.min_ipar_without_corners()
+ : symmetry_edge.max_ipar_without_corners();
+
symmetry_ghost_zone *temp
= new symmetry_ghost_zone(my_edge, symmetry_edge,
- my_edge_sample_ipar, symmetry_edge_sample_ipar,
+ my_sample_ipar, symmetry_sample_ipar,
ipar_map_sign);
set_ghost_zone(temp, my_edge);
+
return *temp;
}
diff --git a/src/patch/patch.hh b/src/patch/patch.hh
index 99abf28..229c365 100644
--- a/src/patch/patch.hh
+++ b/src/patch/patch.hh
@@ -298,7 +298,6 @@ public:
// ... return reference to new ghost zone
symmetry_ghost_zone& setup_periodic_symmetry_ghost_zone
(const patch_edge& my_edge, const patch_edge& symmetry_edge,
- int my_edge_sample_ipar, int symmetry_edge_sample_ipar,
bool ipar_map_sign); // one of cpm_map::{plus,minus}_map
// set up one of our ghost zones as interpatch