aboutsummaryrefslogtreecommitdiff
path: root/src/patch/patch.cc
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-02 17:11:34 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-02 17:11:34 +0000
commitf9b9b1e0d2a91d1628bc599e0c31bd710cb815a5 (patch)
treefb7f4dd76b01f65968c2de7955caaba22ef95786 /src/patch/patch.cc
parentd56cb86b3116873675ff49bf493521be6cb91a1a (diff)
switch back to explicit set_ghost_zone() and set_patch_frontier()
fns in patch:: git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@421 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/patch.cc')
-rw-r--r--src/patch/patch.cc115
1 files changed, 51 insertions, 64 deletions
diff --git a/src/patch/patch.cc b/src/patch/patch.cc
index d575f70..62b76b3 100644
--- a/src/patch/patch.cc
+++ b/src/patch/patch.cc
@@ -10,17 +10,12 @@
//
// patch::minmax_ang_ghost_zone
// patch::ghost_zone_on_edge
-// patch::ghost_zone_ptr
-// patch::patch_frontier_ptr
+// patch::interpatch_ghost_zone_on_edge
// patch::setup_mirror_symmetry_ghost_zone
// patch::setup_periodic_symmetry_ghost_zone
// patch::setup_interpatch_ghost_zone
// patch::set_ghost_zone
-// patch::minmax_ang_ghost_zone
-// patch::ghost_zone_on_edge
-// patch::frontier_ptr_on_edge
// patch::edge_adjacent_to_patch
-// patch::interpatch_ghost_zone_on_edge
// patch::assert_all_ghost_zones_fully_setup
//
// patch::print_gridfn
@@ -199,47 +194,17 @@ return minmax_ang_ghost_zone(edge.is_min(), edge.is_rho());
//******************************************************************************
//
-// This function returns a reference to the specified ghost zone
-// pointer data member of this patch, asserting that the current
-// value of this pointer is NULL. This is used (only) by
-// patch::setup_*_ghost_zone()
-// to set the ghost zone pointers; the assert() ensures that it can't
-// be used to overwrite a non-NULL pointer.
-//
-ghost_zone*& patch::ghost_zone_ptr(const patch_edge& edge)
-{
-assert(& edge.my_patch() == this);
-
-ghost_zone*& gzp = edge.is_min() ? (edge.is_rho() ? min_rho_ghost_zone_
- : min_sigma_ghost_zone_)
- : (edge.is_rho() ? max_rho_ghost_zone_
- : max_sigma_ghost_zone_);
-assert(gzp == NULL);
-return gzp;
-}
-
-//******************************************************************************
-
-//
-// This function returns a reference to the specified patch frontier
-// pointer data member of this patch, asserting that the current
-// value of this pointer is NULL. This is used (only) by the other
-// patch's
-// interpatch_ghost_zone::setup_other_frontier()
-// to set this patch's patch frontier pointers; the assert() ensures that
-// it can't be used to overwrite a non-NULL pointer.
+// This function verifies that the ghost zone on a specified edge
+// is indeed interpatch, and returns a reference to it as an
+// interpatch_ghost_zone .
//
-patch_frontier*& patch::patch_frontier_ptr(const patch_edge& edge)
+interpatch_ghost_zone& patch::interpatch_ghost_zone_on_edge
+ (const patch_edge &e)
+ const
{
-assert(& edge.my_patch() == this);
-
-patch_frontier*& pfp
- = edge.is_min() ? (edge.is_rho() ? min_rho_patch_frontier_
- : min_sigma_patch_frontier_)
- : (edge.is_rho() ? max_rho_patch_frontier_
- : max_sigma_patch_frontier_);
-assert(pfp == NULL);
-return pfp;
+ghost_zone &g = ghost_zone_on_edge(e);
+assert(g.is_interpatch());
+return static_cast<interpatch_ghost_zone &>(g);
}
//******************************************************************************
@@ -257,7 +222,7 @@ symmetry_ghost_zone& patch::setup_mirror_symmetry_ghost_zone
assert(& my_edge.my_patch() == this);
symmetry_ghost_zone *temp = new symmetry_ghost_zone(my_edge);
-set_ghost_zone(temp, my_edge);
+set_ghost_zone(my_edge, temp);
return *temp;
}
@@ -285,7 +250,7 @@ symmetry_ghost_zone *temp
= new symmetry_ghost_zone(my_edge, symmetry_edge,
my_sample_ipar, symmetry_sample_ipar,
is_ipar_map_plus);
-ghost_zone_ptr(my_edge) = temp;
+set_ghost_zone(my_edge, temp);
return *temp;
}
@@ -307,13 +272,51 @@ assert(& my_edge.my_patch() == this);
interpatch_ghost_zone *temp
= new interpatch_ghost_zone(my_edge, other_edge,
N_overlap_points);
-ghost_zone_ptr(my_edge) = temp;
+set_ghost_zone(my_edge, temp);
return *temp;
}
//******************************************************************************
//
+// This is a helper function for setup_*_ghost_zone(). This function
+// assert()s that one of the ghost zone pointers (which one is selected
+// by edge ) is NULL, then stores a value in it.
+//
+void patch::set_ghost_zone(const patch_edge& edge, ghost_zone* gzp)
+{
+ghost_zone*& gzp
+ = edge.is_min()
+ ? (edge.is_rho() ? min_rho_ghost_zone_ : min_sigma_ghost_zone_)
+ : (edge.is_rho() ? max_rho_ghost_zone_ : max_sigma_ghost_zone_);
+
+assert(gzp == NULL);
+gzp = gzp;
+}
+
+//******************************************************************************
+
+//
+// This is a helper function for (our friend)
+// interpatch_ghost_zone::setup_other_patch_frontier().
+// This function assert()s that one of the patch frontier pointers
+// (which one is selected by edge ) is NULL, then stores a value in it.
+//
+void patch::set_patch_frontier(const patch_edge& edge, patch_frontier* pfp)
+{
+patch_frontier*& pfp = edge.is_min()
+ ? (edge.is_rho() ? min_rho_patch_frontier_
+ : min_sigma_patch_frontier_)
+ : (edge.is_rho() ? max_rho_patch_frontier_
+ : max_sigma_patch_frontier_);
+
+assert(pfp == NULL);
+pfp = pfp;
+}
+
+//******************************************************************************
+
+//
// This function finds which patch edge is adjacent to a neighboring
// patch q, or does an error_exit() if q isn't actually a neighboring patch.
// The computation is done using only (rho,sigma) coordinate sets and
@@ -420,22 +423,6 @@ return p.minmax_ang_patch_edge(common_is_p_min_q_max, common_is_p_rho);
//******************************************************************************
//
-// This function verifies that the ghost zone on a specified edge
-// is indeed interpatch, and returns a reference to it as an
-// interpatch_ghost_zone .
-//
-interpatch_ghost_zone& patch::interpatch_ghost_zone_on_edge
- (const patch_edge &e)
- const
-{
-ghost_zone &g = ghost_zone_on_edge(e);
-assert(g.is_interpatch());
-return static_cast<interpatch_ghost_zone &>(g);
-}
-
-//******************************************************************************
-
-//
// This function verifies (via assert()) that all ghost zones of this
// patch, and all frontiers to which they should point, have been fully
// set up.