aboutsummaryrefslogtreecommitdiff
path: root/src/patch
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-08-06 11:46:37 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-08-06 11:46:37 +0000
commit5244f2ba770c2523741944855754f873fac31c17 (patch)
treedb128b4db5d269dcd17c5b151d4769985d7637b2 /src/patch
parent72c67069fa28cfe9b27cc37b94efbbfcd6700eca (diff)
switch to new do-everything-in-one-call synchronize Jacobian interface
in patch_system:: git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@687 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch')
-rw-r--r--src/patch/patch_system.cc147
-rw-r--r--src/patch/patch_system.hh62
2 files changed, 59 insertions, 150 deletions
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc
index 142ad97..698bea6 100644
--- a/src/patch/patch_system.cc
+++ b/src/patch/patch_system.cc
@@ -1431,7 +1431,7 @@ void patch_system::synchronize(int ghosted_min_gfn_to_sync,
// ==> "fold" the interpatch ghost zone's Jacobian
// to reflect the phase 1 symmetry operation
//
-// It also properly sets global_{min,max}_m_ .
+// It also properly sets global_{min,max}_ym_ .
//
// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
// pass all the Jacobian operations down to the ghost zones
@@ -1440,8 +1440,8 @@ void patch_system::compute_synchronize_Jacobian(int ghosted_min_gfn_to_sync,
int ghosted_max_gfn_to_sync)
const
{
-global_min_m_ = +INT_MAX;
-global_max_m_ = -INT_MAX;
+global_min_ym_ = +INT_MAX;
+global_max_ym_ = -INT_MAX;
for (int pn = 0 ; pn < N_patches() ; ++pn)
{
patch& p = ith_patch(pn);
@@ -1455,10 +1455,10 @@ global_max_m_ = -INT_MAX;
gz.compute_Jacobian(ghosted_min_gfn_to_sync,
ghosted_max_gfn_to_sync);
- global_min_m_ = jtutil::min(global_min_m_,
- gz.Jacobian_min_y_ipar_m());
- global_max_m_ = jtutil::max(global_max_m_,
- gz.Jacobian_max_y_ipar_m());
+ global_min_ym_ = jtutil::min(global_min_ym_,
+ gz.Jacobian_min_y_ipar_m());
+ global_max_ym_ = jtutil::max(global_max_ym_,
+ gz.Jacobian_max_y_ipar_m());
}
}
}
@@ -1471,125 +1471,52 @@ global_max_m_ = -INT_MAX;
// function computes the global min/max m over all ghost zone points.
// This is useful for sizing the buffer for synchronize_Jacobian().
//
-void patch_system::synchronize_Jacobian_global_minmax_y_ipar_m
- (int& min_m, int& max_m)
+void patch_system::synchronize_Jacobian_global_minmax_ym
+ (int& min_ym, int& max_ym)
const
{
-min_m = global_min_m_;
-max_m = global_max_m_;
+min_ym = global_min_ym_;
+max_ym = global_max_ym_;
}
//******************************************************************************
//
// Given that compute_synchronize_Jacobian() has been called, this
-// function computes the patch containing the y points in a Jacobian row.
-//
-// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
-// pass the operation down to the ghost zone
-//
-patch& patch_system::synchronize_Jacobian_y_patch(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const
-{
-return xgz.Jacobian_y_patch();
-}
-
-//******************************************************************************
-
-//
-// Given that compute_synchronize_Jacobian() has been called, this
-// function computes the patch_edge containing the y points in a
-// Jacobian row.
-//
-// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
-// pass the operation down to the ghost zone
-//
-const patch_edge& patch_system::synchronize_Jacobian_y_edge
- (const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const
-{
-return xgz.Jacobian_y_edge();
-}
-
-//******************************************************************************
-
-//
-// Given that compute_synchronize_Jacobian() has been called, this
-// function computes the iperp value of the y points in a Jacobian row.
-//
-// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
-// pass the operation down to the ghost zones
-//
-int patch_system::synchronize_Jacobian_y_iperp(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const
-{
-return xgz.Jacobian_y_iperp(x_iperp);
-}
-
-//******************************************************************************
-
-//
-// Given that compute_synchronize_Jacobian() has been called, this
-// function computes the posn value of the y points in a Jacobian row.
-//
-// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
-// pass all the operation down to the ghost zones
-//
-int patch_system::synchronize_Jacobian_y_ipar_posn(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const
-{
-return xgz.Jacobian_y_ipar_posn(x_iperp, x_ipar);
-}
-
-//******************************************************************************
-
-//
-// Given that compute_synchronize_Jacobian() has been called, this
-// function computes the min/max m values of the y points in a Jacobian row.
-//
-// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
-// pass all the operation down to the ghost zones
-//
-void patch_system::synchronize_Jacobian_minmax_y_ipar_m(const ghost_zone& xgz,
- int x_iperp, int x_ipar,
- int& min_m, int& max_m)
- const
-{
-min_m = xgz.Jacobian_min_y_ipar_m();
-max_m = xgz.Jacobian_max_y_ipar_m();
-}
-
-//******************************************************************************
-
-//
-// Given that compute_synchronize_Jacobian() has been called, this
-// function stores the Jacobian
+// function computes a single row of the Jacobian:
+// - It returns the edge to which the y point belongs (the caller can get
+// the patch from this edge).
+// - It stores y_iperp and y_posn and min/max ym in the named arguments.
+// - It stores the Jacobian elements
// partial synchronize() gridfn(ghosted_gfn, px, x_iperp, x_ipar)
// -------------------------------------------------------------
-// partial gridfn(ghosted_gfn, py, y_iperp, y_posn+y_ipar_m)
-// (taking into account synchronize()'s full 3-phase algorithm)
-// in the caller-supplied buffer
-// Jacobian_buffer(m)
-// for each m , where
-// y_iperp = Jacobian_y_iperp(x_iperp)
-// y_posn = Jacobian_y_ipar_posn(x_iperp, x_ipar)
+// partial gridfn(ghosted_gfn, py, y_iperp, y_posn+ym)
+// (taking into account synchronize()'s full 3-phase algorithm)
+// in the caller-supplied buffer
+// Jacobian_buffer(ym)
+// for each ym in the min/max ym range
//
// FIXME FIXME: at the moment we ignore the 3-phase algorithm and just
// pass all the operation down to the ghost zones
//
-void patch_system::synchronize_Jacobian(const ghost_zone& xgz,
- int x_iperp, int x_ipar,
- jtutil::array1d<fp>& Jacobian_buffer)
+const patch_edge&
+ patch_system::synchronize_Jacobian(const ghost_zone& xgz,
+ int x_iperp, int x_ipar,
+ int& y_iperp,
+ int& y_posn, int& min_ym, int& max_ym,
+ jtutil::array1d<fp>& Jacobian_buffer)
const
{
-const int min_m = xgz.Jacobian_min_y_ipar_m();
-const int max_m = xgz.Jacobian_max_y_ipar_m();
- for (int m = min_m ; m <= max_m ; ++m)
+y_iperp = xgz.Jacobian_y_iperp(x_iperp);
+
+y_posn = xgz.Jacobian_y_ipar_posn(x_iperp, x_ipar);
+min_ym = xgz.Jacobian_min_y_ipar_m();
+max_ym = xgz.Jacobian_max_y_ipar_m();
+
+ for (int ym = min_ym ; ym <= max_ym ; ++ym)
{
- Jacobian_buffer(m) = xgz.Jacobian(x_iperp, x_ipar, m);
+ Jacobian_buffer(ym) = xgz.Jacobian(x_iperp, x_ipar, ym);
}
+
+return xgz.Jacobian_y_edge();
}
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh
index 44f8304..6c42fa8 100644
--- a/src/patch/patch_system.hh
+++ b/src/patch/patch_system.hh
@@ -146,8 +146,9 @@ public:
//
- // compute Jacobian of synchronize() into internal buffers,
- // taking into account synchronize()'s full 3-phase algorithm
+ // do any precomputation necessary to compute Jacobian of
+ // synchronize() , taking into account synchronize()'s
+ // full 3-phase algorithm
//
void compute_synchronize_Jacobian(int ghosted_min_gfn_to_sync,
int ghosted_max_gfn_to_sync)
@@ -182,53 +183,34 @@ public:
// what are the global min/max m over all ghost zone points?
// (this is useful for sizing the buffer for synchronize_Jacobian())
- void synchronize_Jacobian_global_minmax_y_ipar_m
- (int& min_m, int& max_m)
+ void synchronize_Jacobian_global_minmax_ym(int& min_ym, int& max_ym)
const;
- // to which patch/edge do the y points in a Jacobian row belong?
- patch& synchronize_Jacobian_y_patch(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const;
- const patch_edge& synchronize_Jacobian_y_edge(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const;
-
- // what is the iperp of the Jacobian y points in their (y) patch?
- int synchronize_Jacobian_y_iperp(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const;
-
- // what are the posn and min/max m for a given x point?
- int synchronize_Jacobian_y_ipar_posn(const ghost_zone& xgz,
- int x_iperp, int x_ipar)
- const;
- void synchronize_Jacobian_minmax_y_ipar_m(const ghost_zone& xgz,
- int x_iperp, int x_ipar,
- int& min_m, int& max_m)
- const;
-
-public:
- // store the Jacobian
+ // compute a single row of the Jacobian:
+ // - return value is edge to which y point belongs
+ // (caller can get patch from this edge)
+ // - store y_iperp and y_posn and min/max ym in named arguments
+ // - stores the Jacobian elements
// partial synchronize() gridfn(ghosted_gfn, px, x_iperp, x_ipar)
// -------------------------------------------------------------
- // partial gridfn(ghosted_gfn, py, y_iperp, y_posn+y_ipar_m)
- // (taking into account synchronize()'s full 3-phase algorithm)
- // in the caller-supplied buffer
- // Jacobian_buffer(m)
- // for each m , where
- // y_iperp = Jacobian_y_iperp(x_iperp)
- // y_posn = Jacobian_y_ipar_posn(x_iperp, x_ipar)
- void synchronize_Jacobian(const ghost_zone& xgz,
- int x_iperp, int x_ipar,
- jtutil::array1d<fp>& Jacobian_buffer)
+ // partial gridfn(ghosted_gfn, py, y_iperp, y_posn+ym)
+ // (taking into account synchronize()'s full 3-phase algorithm)
+ // in the caller-supplied buffer
+ // Jacobian_buffer(ym)
+ // for each ym in the min/max ym range
+ const patch_edge&
+ synchronize_Jacobian(const ghost_zone& xgz,
+ int x_iperp, int x_ipar,
+ int& y_iperp,
+ int& y_posn, int& min_ym, int& max_ym,
+ jtutil::array1d<fp>& Jacobian_buffer)
const;
//
// ***** gridfn operations *****
//
-
+public:
// dst = src
void gridfn_copy(int src_gfn, int dst_gfn);
@@ -464,5 +446,5 @@ private:
fp* ghosted_gridfn_storage_;
// min/max m over all ghost zone points
- mutable int global_min_m_, global_max_m_;
+ mutable int global_min_ym_, global_max_ym_;
};