aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/patch/ghost_zone.cc127
-rw-r--r--src/patch/ghost_zone.hh249
-rw-r--r--src/patch/patch_interp.cc22
-rw-r--r--src/patch/patch_interp.hh32
-rw-r--r--src/patch/patch_system.cc3
-rw-r--r--src/patch/patch_system.hh2
6 files changed, 349 insertions, 86 deletions
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc
index ecb397e..8516241 100644
--- a/src/patch/ghost_zone.cc
+++ b/src/patch/ghost_zone.cc
@@ -12,7 +12,9 @@
// interpatch_ghost_zone::[min,max]_ipar
// interpatch_ghost_zone::finish_setup
// interpatch_ghost_zone::assert_fully_setup
+// interpatch_ghost_zone::verify_caller_wants_all_of_ghost_zone
// interpatch_ghost_zone::synchronize
+// interpatch_ghost_zone::compute_Jacobian
//
#include <stdio.h>
@@ -123,7 +125,6 @@ void symmetry_ghost_zone::synchronize(int ghosted_min_gfn, int ghosted_max_gfn,
bool want_min_par_corner,
bool want_non_corner,
bool want_max_par_corner)
- const
{
for (int gfn = ghosted_min_gfn ; gfn <= ghosted_max_gfn ; ++gfn)
{
@@ -173,7 +174,8 @@ interpatch_ghost_zone::interpatch_ghost_zone(const patch_edge& my_edge_in,
other_iperp_(NULL),
min_ipar_used_(NULL), max_ipar_used_(NULL),
other_par_(NULL),
- interp_result_buffer_(NULL)
+ interp_result_buffer_(NULL),
+ Jacobian_oipar_posn_(NULL), Jacobian_buffer_(NULL) // no comma
{
//
// verify that we have the expected relationships between
@@ -327,6 +329,8 @@ other_iperp_ = new jtutil::cpm_map<fp>(min_iperp(), max_iperp(),
//
interpatch_ghost_zone::~interpatch_ghost_zone()
{
+delete Jacobian_buffer_;
+delete Jacobian_oipar_posn_;
delete interp_result_buffer_;
delete other_par_;
delete max_ipar_used_;
@@ -387,10 +391,8 @@ return max_par_adjacent_ghost_zone().is_symmetry()
void interpatch_ghost_zone::finish_setup(int interp_handle,
int interp_par_table_handle)
{
-const int other_min_iperp = std::min(other_iperp(min_iperp()),
- other_iperp(max_iperp()));
-const int other_max_iperp = std::max(other_iperp(min_iperp()),
- other_iperp(max_iperp()));
+min_other_iperp_ = std::min(other_iperp(min_iperp()), other_iperp(max_iperp()));
+max_other_iperp_ = std::max(other_iperp(min_iperp()), other_iperp(max_iperp()));
//
@@ -400,16 +402,16 @@ const int other_max_iperp = std::max(other_iperp(min_iperp()),
// ... we will pass these arrays by reference to the other patch's
// patch_interp object, with ipar being parindex there
//
-int extreme_min_ipar = +INT_MAX;
-int extreme_max_ipar = -INT_MAX;
-min_ipar_used_ = new jtutil::array1d<int>(other_min_iperp, other_max_iperp);
-max_ipar_used_ = new jtutil::array1d<int>(other_min_iperp, other_max_iperp);
+extreme_min_ipar_ = INT_MAX;
+extreme_max_ipar_ = INT_MIN;
+min_ipar_used_ = new jtutil::array1d<int>(min_other_iperp_, max_other_iperp_);
+max_ipar_used_ = new jtutil::array1d<int>(min_other_iperp_, max_other_iperp_);
for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp)
{
const int min_ipar_here = min_ipar(iperp);
const int max_ipar_here = max_ipar(iperp);
- extreme_min_ipar = std::min(extreme_min_ipar, min_ipar_here);
- extreme_max_ipar = std::max(extreme_max_ipar, max_ipar_here);
+ extreme_min_ipar_ = std::min(extreme_min_ipar_, min_ipar_here);
+ extreme_max_ipar_ = std::max(extreme_max_ipar_, max_ipar_here);
(*min_ipar_used_)(other_iperp(iperp)) = min_ipar_here;
(*max_ipar_used_)(other_iperp(iperp)) = max_ipar_here;
}
@@ -419,8 +421,8 @@ max_ipar_used_ = new jtutil::array1d<int>(other_min_iperp, other_max_iperp);
// set up array giving other patch's par coordinate for interpolation
//
-other_par_ = new jtutil::array2d<fp>(other_min_iperp, other_max_iperp,
- extreme_min_ipar, extreme_max_ipar);
+other_par_ = new jtutil::array2d<fp>(min_other_iperp_, max_other_iperp_,
+ extreme_min_ipar_, extreme_max_ipar_);
for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp)
{
@@ -449,16 +451,16 @@ other_par_ = new jtutil::array2d<fp>(other_min_iperp, other_max_iperp,
// set up interpolation result buffer
//
interp_result_buffer_
- = new jtutil::array3d<fp>
- (my_patch().ghosted_min_gfn(), my_patch().ghosted_max_gfn(),
- other_min_iperp, other_max_iperp,
- extreme_min_ipar, extreme_max_ipar);
+ = new jtutil::array3d<fp>(my_patch().ghosted_min_gfn(),
+ my_patch().ghosted_max_gfn(),
+ min_other_iperp_, max_other_iperp_,
+ extreme_min_ipar_, extreme_max_ipar_);
//
// construct the patch_interp object to interpolate from the *other* patch
//
other_patch_interp_ = new patch_interp(other_edge(),
- other_min_iperp, other_max_iperp,
+ min_other_iperp_, max_other_iperp_,
*min_ipar_used_, *max_ipar_used_,
*other_par_,
interp_handle, interp_par_table_handle);
@@ -490,17 +492,12 @@ assert( my_patch() == other_patch()
//******************************************************************************
//
-// This function "synchronizes" a ghost zone, i.e. it updates the
-// ghost-zone values of the specified gridfns via the appropriate
-// interpatch interpolations.
-//
-// The flags specify which part(s) of the ghost zone we want, but
-// the present implementation only supports the case where all the
-// flags are true , i.e. we want the entire ghost zone.
+// This function verifies (no-op if ok, error_exit() if not) that the
+// caller wants to operate on the entire ghost zone, since our implementations
+// of synchronize() and compute_Jacobian() only support this case.
//
-void interpatch_ghost_zone::synchronize
- (int ghosted_min_gfn, int ghosted_max_gfn,
- bool want_min_par_corner,
+void interpatch_ghost_zone::verify_caller_wants_all_of_ghost_zone
+ (bool want_min_par_corner,
bool want_non_corner,
bool want_max_par_corner)
const
@@ -508,17 +505,39 @@ void interpatch_ghost_zone::synchronize
// make sure the caller wants the entire ghost zone
if (! (want_min_par_corner && want_non_corner && want_max_par_corner))
then error_exit(ERROR_EXIT,
-"***** interpatch_ghost_zone::synchronize(ghosted_[min,max]_gfn=[%d,%d]):\n"
-" can only handle full ghost zone, not partial,\n"
-" but not all flags are true!\n"
+"***** interpatch_ghost_zone::verify_caller_wants_all_of_ghost_zone():\n"
+" our implementations of synchronize() and compute_Jacobian()\n"
+" only support operating on the *entire* ghost zone,\n"
+" but we were passed flags specifying a proper subset!\n"
" want_min_par_corner=(int)%d\n"
" want_non_corner=(int)%d\n"
" want_max_par_corner=(int)%d\n"
,
- ghosted_min_gfn, ghosted_max_gfn,
want_min_par_corner,
want_non_corner,
want_max_par_corner); /*NOTREACHED*/
+}
+
+//******************************************************************************
+
+//
+// This function "synchronizes" a ghost zone, i.e. it updates the
+// ghost-zone values of the specified gridfns via the appropriate
+// interpatch interpolations.
+//
+// The flags specify which part(s) of the ghost zone we want, but
+// the present implementation only supports the case where all the
+// flags are true , i.e. we want the entire ghost zone.
+//
+void interpatch_ghost_zone::synchronize
+ (int ghosted_min_gfn, int ghosted_max_gfn,
+ bool want_min_par_corner,
+ bool want_non_corner,
+ bool want_max_par_corner)
+{
+verify_caller_wants_all_of_ghost_zone(want_min_par_corner,
+ want_non_corner,
+ want_max_par_corner);
// do the interpolation into our result buffer
other_patch_interp_->interpolate(ghosted_min_gfn, ghosted_max_gfn,
@@ -543,3 +562,45 @@ other_patch_interp_->interpolate(ghosted_min_gfn, ghosted_max_gfn,
}
}
}
+
+//******************************************************************************
+
+//
+// This function allocates the internal buffers for the Jacobian, and
+// computes that Jacobian
+// partial synchronize gridfn(ghosted_gfn, iperp, ipar)
+// ------------------------------------------------------------
+// partial other patch gridfn(ghosted_gfn, oiperp, posn+ipar_m)
+// where
+// oiperp = Jacobian_oiperp(iperp)
+// posn = Jacobian_oipar_posn(iperp, ipar)
+// into the internal buffers.
+//
+void interpatch_ghost_zone::compute_Jacobian
+ (int ghosted_min_gfn, int ghosted_max_gfn,
+ bool want_min_par_corner,
+ bool want_non_corner,
+ bool want_max_par_corner)
+{
+verify_caller_wants_all_of_ghost_zone(want_min_par_corner,
+ want_non_corner,
+ want_max_par_corner);
+assert(other_patch_interp_ != NULL);
+
+other_patch_interp_->verify_Jacobian_sparsity_pattern_ok();
+
+other_patch_interp_->molecule_minmax_ipar_m(min_oipar_m_, max_oipar_m_);
+
+if (Jacobian_oipar_posn_ == NULL)
+ then Jacobian_oipar_posn_ = new jtutil::array2d<CCTK_INT>
+ (min_other_iperp_, max_other_iperp_,
+ extreme_min_ipar_, extreme_max_ipar_);
+other_patch_interp_->molecule_posn(*Jacobian_oipar_posn_);
+
+if (Jacobian_buffer_ == NULL)
+ then Jacobian_buffer_ = new jtutil::array3d<fp>
+ (min_other_iperp_, max_other_iperp_,
+ extreme_min_ipar_, extreme_max_ipar_,
+ min_oipar_m_, max_oipar_m_);
+other_patch_interp_->Jacobian(*Jacobian_buffer_);
+}
diff --git a/src/patch/ghost_zone.hh b/src/patch/ghost_zone.hh
index 4764fd9..70b7f3b 100644
--- a/src/patch/ghost_zone.hh
+++ b/src/patch/ghost_zone.hh
@@ -213,9 +213,9 @@
//
// N.b. const qualifiers on member functions of ghost_zone and its derived
-// classes refer to the underlying gridfn data, since this is much more
-// useful than applying the qualifiers only to the ghost zone (& derived)
-// objects themselves.
+// classes refer to the union of the class functions and the underlying
+// gridfn data. That is, anything which changes the gridfn data is taken
+// to be non-const.
//
// forward declarations
@@ -227,20 +227,88 @@ class ghost_zone
{
public:
//
- // main client interface: "synchronize" a ghost zone,
- // i.e. update the ghost-zone values of the specified gridfns
- // via the appropriate sequence of symmetry operations
- // and interpatch interpolations
+ // ***** main client interface *****
+ //
+ // "synchronize" a ghost zone, i.e. update the ghost-zone values
+ // of the specified gridfns via the appropriate sequence of
+ // symmetry operations and interpatch interpolations
// (flags specify which part(s) of the ghost zone we want)
//
virtual void synchronize(int ghosted_min_gfn, int ghosted_max_gfn,
bool want_min_par_corner,
bool want_noncorner,
bool want_max_par_corner)
- const
= 0;
+
+public:
+ //
+ // ***** Jacobian of synchronize() *****
+ //
+ // This function computes the Jacobian of the synchronize()
+ // operation into internal buffers; the following functions
+ // provide access to that Jacobian.
+ //
+ // FIXME: should these be moved out into a separate Jacobian
+ // object/class?
+ //
+ virtual void compute_Jacobian(int ghosted_min_gfn, int ghosted_max_gfn,
+ bool want_min_par_corner,
+ bool want_noncorner,
+ bool want_max_par_corner)
+ = 0;
+
+ //
+ // The API in the remaining functions implicitly assumes that
+ // the Jacobian is independent of ghosted_gfn , and also that
+ // the structure of the Jacobian is "simple", in that the set of
+ // points (with nonzero Jacobian values) in a single row of the
+ // Jacobian matrix (i.e. the set of points on which a single
+ // ghost-zone point depends),
+ // - lies entirely within a single patch
+ // - has the same number of points for every point in this ghost zone
+ // - has a single oiperp value (= iperp value in their patch)
+ // (depending on our iperp, of course)
+ // - have a contiguous interval of oipar (= ipar in their patch)
+ // (depending on our iperp and ipar, of course), whose
+ // size is
+ // [or can be taken to be without an unreasonable
+ // amount of zero-padding]
+ // independent of our iperp and ipar; we parameterize this
+ // interval as oipar = posn+m where posn is determined by
+ // our iperp and ipar, and m has a fixed range independent
+ // of our iperp and ipar
+ //
+
+ // to which patch/edge do the points in this Jacobian row belong?
+ virtual const patch& Jacobian_patch() const = 0;
+ virtual const patch_edge& Jacobian_edge() const = 0;
+
+ // what is the [min,max] range of m for this ghost zone?
+ virtual int Jacobian_min_oipar_m() const = 0;
+ virtual int Jacobian_max_oipar_m() const = 0;
+
+ // what is the oiperp of the Jacobian points (= iperp in their patch)?
+ virtual int Jacobian_oiperp(int iperp) const = 0;
+
+ // what is the posn value of the points in this Jacobian row?
+ virtual int Jacobian_oipar_posn(int iperp, int ipar) const = 0;
+
+ // what is the Jacobian
+ // partial synchronize gridfn(ghosted_gfn, iperp, ipar)
+ // ------------------------------------------------------------
+ // partial other patch gridfn(ghosted_gfn, oiperp, posn+ipar_m)
+ // where
+ // oiperp = Jacobian_oiperp(iperp)
+ // posn = Jacobian_oipar_posn(iperp, ipar)
+ virtual fp Jacobian(int iperp, int ipar, int ipar_m) const = 0;
+
+
public:
+ //
+ // ***** low-level client interface *****
+ //
+
// to which patch/edge do we belong?
patch& my_patch() const { return my_patch_; }
const patch_edge& my_edge() const { return my_edge_; }
@@ -376,9 +444,6 @@ private:
// (that is, the two +/- signs are multiplied).
//
-// Note const qualifiers refer to the results of
-// iperp_map_coord()
-// ipar_map_coord()
// Since all the member functions are const , a symmetry_ghost_zone
// object is effectively always const .
//
@@ -387,18 +452,60 @@ class symmetry_ghost_zone
{
public:
//
- // main client interface: "synchronize" a ghost zone,
- // i.e. update the ghost-zone values of the specified gridfns
- // via the appropriate symmetry operations
+ // ***** main client interface *****
+ //
+ // "synchronize" a ghost zone, i.e. update the ghost-zone values
+ // of the specified gridfns via the appropriate symmetry operations
// (flags specify which part(s) of the ghost zone we want)
//
void synchronize(int ghosted_min_gfn, int ghosted_max_gfn,
bool want_min_par_corner,
bool want_noncorner,
- bool want_max_par_corner)
- const;
+ bool want_max_par_corner);
+
+ //
+ // ***** Jacobian of synchronize() *****
+ //
+
+ // allocate internal buffers, compute Jacobian
+ // ... this function is a no-op in this class
+ void compute_Jacobian(int ghosted_min_gfn, int ghosted_max_gfn,
+ bool want_min_par_corner,
+ bool want_noncorner,
+ bool want_max_par_corner)
+ { }
+
+ // to which patch/edge do the points in this Jacobian row belong?
+ const patch& Jacobian_patch() const { return symmetry_patch_; }
+ const patch_edge& Jacobian_edge() const { return symmetry_edge_; }
+
+ // what is the [min,max] range of m for this ghost zone?
+ int Jacobian_min_oipar_m() const { return 0; }
+ int Jacobian_max_oipar_m() const { return 0; }
+
+ // what is the oiperp of the Jacobian points (= iperp in their patch)?
+ virtual int Jacobian_oiperp(int iperp) const
+ { return iperp_map_of_iperp(iperp); }
+
+ // what is the posn value of the points in this Jacobian row?
+ int Jacobian_oipar_posn(int iperp, int ipar) const
+ { return ipar_map_of_ipar(ipar); }
- // low-level client interface: symmetry-map coordinates
+ // what is the Jacobian
+ // partial synchronize gridfn(ghosted_gfn, iperp, ipar)
+ // ------------------------------------------------------------
+ // partial other patch gridfn(ghosted_gfn, oiperp, posn+ipar_m)
+ // where
+ // oiperp = Jacobian_oiperp(iperp)
+ // posn = Jacobian_oipar_posn(iperp, ipar)
+ fp Jacobian(int iperp, int ipar, int ipar_m) const { return 1.0; }
+
+
+ //
+ // ***** low-level client interface *****
+ //
+
+ // symmetry-map coordinates
const patch& symmetry_patch() const { return symmetry_patch_; }
const patch_edge& symmetry_edge() const { return symmetry_edge_; }
int iperp_map_of_iperp(int iperp) const
@@ -456,11 +563,6 @@ private:
// patch_interp object to interpolate the other patch's data to those
// coordinates.
//
-// Note const qualifiers refer to the data stored by
-// synchronize()
-// Since there are no nonconst member functions, once an interpatch_ghost_zone
-// object is contructed, it's effectively always taken as const .
-//
// Note that as described in the "design notes for ghost zones"
// comments above, interpatch_ghost_zone objects are constructed in
// the 2nd and 3rd phase of the overall construction process described
@@ -482,16 +584,70 @@ class interpatch_ghost_zone
{
public:
//
- // main client interface: "synchronize" a ghost zone,
- // i.e. update the ghost-zone values of the specified gridfns
- // via the appropriate interpatch interpolations
+ // ***** main client interface *****
+ //
+ // "synchronize" a ghost zone, i.e. update the ghost-zone
+ // values of the specified gridfns via the appropriate
+ // interpatch interpolations
// (flags specify which part(s) of the ghost zone we want)
//
+ // ... the present implementation only supports the case where
+ // all of the flags are set
+ //
void synchronize(int ghosted_min_gfn, int ghosted_max_gfn,
bool want_min_par_corner,
bool want_noncorner,
- bool want_max_par_corner)
- const;
+ bool want_max_par_corner);
+
+ //
+ // ***** Jacobian of synchronize() *****
+ //
+
+ // allocate internal buffers, compute Jacobian
+ //
+ // ... the present implementation only supports the case where
+ // all of the flags are set
+ //
+ void compute_Jacobian(int ghosted_min_gfn, int ghosted_max_gfn,
+ bool want_min_par_corner,
+ bool want_noncorner,
+ bool want_max_par_corner);
+
+ // to which patch/edge do the points in this Jacobian row belong?
+ const patch& Jacobian_patch() const { return other_patch_; }
+ const patch_edge& Jacobian_edge() const { return other_edge_; }
+
+ // what is the [min,max] range of m for this ghost zone?
+ int Jacobian_min_oipar_m() const { return min_oipar_m_; }
+ int Jacobian_max_oipar_m() const { return max_oipar_m_; }
+
+ // what is the oiperp of the Jacobian points (= iperp in their patch)?
+ int Jacobian_oiperp(int iperp) const { return other_iperp(iperp); }
+
+ // what is the posn value of the points in this Jacobian row?
+ int Jacobian_oipar_posn(int iperp, int ipar) const
+ {
+ assert(Jacobian_oipar_posn_ != NULL);
+ const int oiperp = other_iperp(iperp);
+ return (*Jacobian_oipar_posn_)(oiperp, ipar);
+ }
+
+ // what is the Jacobian
+ // partial synchronize gridfn(ghosted_gfn, iperp, ipar)
+ // ------------------------------------------------------------
+ // partial other patch gridfn(ghosted_gfn, oiperp, posn+ipar_m)
+ // where
+ // posn = Jacobian_oipar_posn(iperp, ipar)
+ fp Jacobian(int iperp, int ipar, int ipar_m) const
+ {
+ assert(Jacobian_buffer_ != NULL);
+ const int oiperp = other_iperp(iperp);
+ return (*Jacobian_buffer_)(oiperp, ipar, ipar_m);
+ }
+
+ //
+ // ***** low-level client interface *****
+ //
// basic connectivity info
const patch& other_patch() const
@@ -503,7 +659,9 @@ public:
// and patch_interp objects
void assert_fully_setup() const;
+ //
// constructor, finish setup, destructor
+ //
interpatch_ghost_zone(const patch_edge& my_edge_in,
const patch_edge& other_edge_in,
int N_overlap_points);
@@ -516,6 +674,14 @@ public:
~interpatch_ghost_zone();
private:
+ // verify (no-op if ok, error_exit() if not) that caller wants
+ // to operate on the entire ghost zone, since our implementations
+ // of synchronize() and compute_Jacobian() only support this case
+ void verify_caller_wants_all_of_ghost_zone(bool want_min_par_corner,
+ bool want_non_corner,
+ bool want_max_par_corner)
+ const;
+
// min/max/size ipar of the ghost zone for specified iperp
// taking into account how we treat the corners
// (cf. the example at the start of this file)
@@ -541,9 +707,12 @@ private:
const patch_edge& other_edge_;
//
- // all the remaining subobjects are initialized to NULL
- // pointers in our constructor, then properly set up by
- // finish_setup()
+ // all the remaining pointers are initialized to NULL pointers
+ // in our constructor, then finally allocated and set up by
+ // finish_setup() or compute_Jacobian() as appropriate
+ //
+ // FIXME: should these be moved out into a separate object/class
+ // for the interp stuff and/or another one for the Jacobian?
//
// see comment in "patch_interp.hh" for why this is "const"
@@ -553,6 +722,10 @@ private:
// ... maps my_iperp --> other_iperp
jtutil::cpm_map<fp>* other_iperp_;
+ // min/max values of other patch's iperp coordinates
+ // of our ghost zone points
+ int min_other_iperp_, max_other_iperp_;
+
// [min,max]_ipar used at each other_iperp
// ... we will pass these arrays by reference
// to the other patch's patch_interp object
@@ -560,6 +733,9 @@ private:
jtutil::array1d<int>* min_ipar_used_;
jtutil::array1d<int>* max_ipar_used_;
+ // extreme values of [min,max]_ipar used at each other_iperp
+ int extreme_min_ipar_, extreme_max_ipar_;
+
// other patch's (fp) parallel coordinates of our ghost zone points
// ... we will pass this array by reference
// to the other patch's patch_interp object
@@ -574,4 +750,17 @@ private:
// using my_ipar as the patch_interp's parindex
// ... subscripts are (gfn, other_iperp,my_ipar)
jtutil::array3d<fp>* interp_result_buffer_;
+
+ //
+ // stuff computed by compute_Jacobian()
+ //
+ int min_oipar_m_, max_oipar_m_;
+
+ // other patch's ipar posn for a Jacobian row
+ // ... subscripts are (oiperp, ipar)
+ jtutil::array2d<CCTK_INT>* Jacobian_oipar_posn_;
+
+ // Jacobian values
+ // ... subscripts are (oiperp, ipar, oipar_m)
+ jtutil::array3d<fp>* Jacobian_buffer_;
};
diff --git a/src/patch/patch_interp.cc b/src/patch/patch_interp.cc
index 0784f74..e23ce04 100644
--- a/src/patch/patch_interp.cc
+++ b/src/patch/patch_interp.cc
@@ -1,4 +1,4 @@
-// patch_interp.cc -- patch interpolation region
+// patch_interp.cc -- interpolation from a patch
// $Id$
//
@@ -9,7 +9,7 @@
//
// patch_interp::query_interpolator
// patch_interp::verify_Jacobian_sparsity_pattern_ok
-// patch_interp::molecule_minmax_m_ipar
+// patch_interp::molecule_minmax_ipar_m
// patch_interp::molecule_posn
// patch_interp::Jacobian
//
@@ -413,13 +413,13 @@ if ( MSS_is_fn_of_interp_coords || MSS_is_fn_of_input_array_values
//******************************************************************************
//
-// This function queries the interpolator to get the [min,max] m ipar
+// This function queries the interpolator to get the [min,max] ipar m
// coordinates of the interpolation molecules.
//
// (This API implicitly assumes that the Jacobian sparsity is one which
// is "ok" as verified by verify_Jacobian_sparsity_pattern_ok() .)
//
-void patch_interp::molecule_minmax_m_ipar(int& min_m_ipar, int& max_m_ipar)
+void patch_interp::molecule_minmax_ipar_m(int& min_ipar_m, int& max_ipar_m)
const
{
const int N_dims = 1;
@@ -434,7 +434,7 @@ status2 = Util_TableSetInt(interp_par_table_handle_,
0, "molecule_max_m");
if ((status1 < 0) || (status2 < 0))
then error_exit(ERROR_EXIT,
-"***** patch_interp::molecule_minmax_m_ipar():\n"
+"***** patch_interp::molecule_minmax_ipar_m():\n"
" can't set molecule min/max m queries\n"
" in interpolator parmameter table!\n"
" error status1=%d status2=%d\n"
@@ -444,7 +444,7 @@ if ((status1 < 0) || (status2 < 0))
//
// query the interpolator
//
-query_interpolator("molecule_minmax_m_ipar");
+query_interpolator("molecule_minmax_ipar_m");
//
// get molecule min/max m query results from parameter table
@@ -459,14 +459,14 @@ status2 = Util_TableGetIntArray(interp_par_table_handle_,
"molecule_max_m");
if ((status1 < 0) || (status2 < 0))
then error_exit(ERROR_EXIT,
-"***** patch_interp::molecule_maxmax_m_ipar():\n"
+"***** patch_interp::molecule_maxmax_ipar_m():\n"
" can't get molecule min/max m query results\n"
" from interpolator parmameter table!\n"
" error status1=%d status2=%d\n"
,
status1, status2); /*NOTREACHED*/
-min_m_ipar = molecule_min_m;
-max_m_ipar = molecule_min_m;
+min_ipar_m = molecule_min_m;
+max_ipar_m = molecule_min_m;
//
// delete Jacobian-sparsity-pattern query entries from the parameter table
@@ -556,10 +556,10 @@ if (jtutil::how_many_in_range(min_iperp(), max_iperp()) > 0)
// ghosted gridfns,
// partial interpolate() data_buffer(ghosted_gfn, iperp, parindex)
// ---------------------------------------------------------------
-// partial ghosted_gridfn(ghosted_gfn, iperp, posn+m_ipar)
+// partial ghosted_gridfn(ghosted_gfn, iperp, posn+ipar_m)
//
// This function stores the Jacobian in
-// Jacobian_buffer(iperp, parindex, m_ipar)
+// Jacobian_buffer(iperp, parindex, ipar_m)
// where we implicitly assume the Jacobian to be independent of
// ghosted_gfn[*], and where
// posn = posn_buffer(iperp, parindex)
diff --git a/src/patch/patch_interp.hh b/src/patch/patch_interp.hh
index 92bc127..b98d39f 100644
--- a/src/patch/patch_interp.hh
+++ b/src/patch/patch_interp.hh
@@ -24,15 +24,20 @@
//*****************************************************************************
//
-// patch_interp - patch interpolation region
+// patch_interp - interpolation from a patch
//
//
// A patch_interp object is responsible for interpolating gridfn data
// from its owning patch for use by another patch's ghost_zone object
// (in setting up the gridfn in the other ghost zone). A patch_interp
-// also defines a "patch interpolation region", the region of its owning
-// patch from which this interpolation will use gridfn data.
+// object deals only in its own patch's coordinates; other code elsewhere
+// (in practice in ghost_zone::) is responsible for translating other
+// patch's coordinates into our coordinates.
+//
+
+// A patch_interp defines a "patch interpolation region", the region of
+// its owning patch from which this interpolation will use gridfn data.
//
//
@@ -113,10 +118,10 @@ public:
const patch_edge& my_edge() const { return my_edge_; }
+public:
//
// ***** main client interface *****
//
-public:
// interpolate specified range of ghosted gridfns
// at all the coordinates specified when we were constructed,
// store interpolated data in
@@ -126,6 +131,11 @@ public:
jtutil::array3d<fp>& data_buffer)
const;
+public:
+ //
+ // ***** Jacobian of interpolate() *****
+ //
+
// verify (no-op if ok, error_exit() if not) that interpolator
// has a Jacobian sparsity pattern which we grok: at present this
// means molecules are fixed-sized hypercubes, with size/shape
@@ -134,13 +144,13 @@ public:
void verify_Jacobian_sparsity_pattern_ok() const;
//
- // the remaining functions in the main client interface all
- // implicitly assume that the Jacobian sparsity pattern is "ok"
- // as verified by verify_Jacobian_sparsity_pattern_ok()
+ // the API for the remaining Jacobian functions implicitly
+ // assumes that the Jacobian sparsity pattern is "ok" as
+ // verified by verify_Jacobian_sparsity_pattern_ok()
//
- // get [min,max] m ipar coordinates of interpolation molecules
- void molecule_minmax_m_ipar(int& min_m_ipar, int& max_m_ipar) const;
+ // get [min,max] ipar m coordinates of interpolation molecules
+ void molecule_minmax_ipar_m(int& min_ipar_m, int& max_ipar_m) const;
// get interpolation molecule ipar positions in
// molecule_posn_buffer(iperp, parindex)
@@ -152,9 +162,9 @@ public:
// ghosted gridfns,
// partial interpolate() data_buffer(ghosted_gfn, iperp, parindex)
// ---------------------------------------------------------------
- // partial ghosted_gridfn(ghosted_gfn, iperp, posn+m_ipar)
+ // partial ghosted_gridfn(ghosted_gfn, iperp, posn+ipar_m)
// store Jacobian in
- // Jacobian_buffer(iperp, parindex, m_ipar)
+ // Jacobian_buffer(iperp, parindex, ipar_m)
// where we implicitly assume the Jacobian to be independent of
// ghosted_gfn, and where
// posn = posn_buffer(iperp, parindex)
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc
index 2cbf953..fb30ded 100644
--- a/src/patch/patch_system.cc
+++ b/src/patch/patch_system.cc
@@ -18,6 +18,7 @@
// patch_system::name_of_type
// patch_system::type_of_name
// patch_system::patch_number_of_name
+//
// patch_system::synchronize_ghost_zones
//
// patch_system::print_unknown_gridfn
@@ -953,6 +954,8 @@ error_exit(ERROR_EXIT,
}
//******************************************************************************
+//******************************************************************************
+//******************************************************************************
//
// This function "synchronizes" all ghost zones of all patches, i.e.
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh
index f6e1a86..e00758f 100644
--- a/src/patch/patch_system.hh
+++ b/src/patch/patch_system.hh
@@ -212,7 +212,7 @@ private:
//
- // ***** misc stuff *****
+ // ***** ghost zone operations *****
//
public:
// "synchronize" all ghost zones of all patches,