aboutsummaryrefslogtreecommitdiff
path: root/src/patch
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-07-08 13:52:34 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-07-08 13:52:34 +0000
commit75a52836516dc22f60133fa132fe5f63b07a7309 (patch)
tree8ccb2d2c6bd4d54c262a7bb138babca0083aa9c1 /src/patch
parentd7f9c48e97fef4ee571f0e5ae5b493cce36bc981 (diff)
* make want_*_corner arguments optional (default = true) for interpatch ghost
zone synchronize and Jacobian fns * rename Jacobian_y_min_ipar_m() --> Jacobian_min_y_ipar_m() etc etc * change interpatch_ghost_zone::Jacobian() to only accept in-range y_ipar_m coords (assert failure if out of range) git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@612 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch')
-rw-r--r--src/patch/ghost_zone.cc30
-rw-r--r--src/patch/ghost_zone.hh65
2 files changed, 46 insertions, 49 deletions
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc
index 0b7825e..72d9738 100644
--- a/src/patch/ghost_zone.cc
+++ b/src/patch/ghost_zone.cc
@@ -122,9 +122,9 @@ delete iperp_map_;
// we want.
//
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)
+ bool want_min_par_corner = true,
+ bool want_non_corner = true,
+ bool want_max_par_corner = true)
{
for (int gfn = ghosted_min_gfn ; gfn <= ghosted_max_gfn ; ++gfn)
{
@@ -537,9 +537,9 @@ if (! (want_min_par_corner && want_non_corner && want_max_par_corner))
//
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)
+ bool want_min_par_corner = true,
+ bool want_non_corner = true,
+ bool want_max_par_corner = true)
{
verify_caller_wants_all_of_ghost_zone(want_min_par_corner,
want_non_corner,
@@ -582,9 +582,9 @@ other_patch_interp_->interpolate(ghosted_min_gfn, ghosted_max_gfn,
//
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)
+ bool want_min_par_corner = true,
+ bool want_non_corner = true,
+ bool want_max_par_corner = true)
{
verify_caller_wants_all_of_ghost_zone(want_min_par_corner,
want_non_corner,
@@ -593,7 +593,8 @@ assert(other_patch_interp_ != NULL);
other_patch_interp_->verify_Jacobian_sparsity_pattern_ok();
-other_patch_interp_->molecule_minmax_ipar_m(min_y_ipar_m_, max_y_ipar_m_);
+other_patch_interp_->molecule_minmax_ipar_m(Jacobian_min_y_ipar_m_,
+ Jacobian_max_y_ipar_m_);
if (Jacobian_y_ipar_posn_ == NULL)
then Jacobian_y_ipar_posn_ = new jtutil::array2d<CCTK_INT>
@@ -602,9 +603,10 @@ if (Jacobian_y_ipar_posn_ == NULL)
other_patch_interp_->molecule_posn(*Jacobian_y_ipar_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_y_ipar_m_, max_y_ipar_m_);
+ then Jacobian_buffer_
+ = new jtutil::array3d<fp>
+ (min_other_iperp_, max_other_iperp_,
+ extreme_min_ipar(), extreme_max_ipar(),
+ Jacobian_min_y_ipar_m_, Jacobian_max_y_ipar_m_);
other_patch_interp_->Jacobian(*Jacobian_buffer_);
}
diff --git a/src/patch/ghost_zone.hh b/src/patch/ghost_zone.hh
index 99da6a9..3a8e21d 100644
--- a/src/patch/ghost_zone.hh
+++ b/src/patch/ghost_zone.hh
@@ -37,7 +37,7 @@
// to compute gridfns there (we usually speak of "synchronizing" the
// ghost zone or zones) based on either the patch system's symmetry
// or interpolation from a neighboring patch. ghost_zone is an abstract
-// base class, from which we derive two classes:
+// base class, from which we derive two concrete classes:
// * A symmetry_ghost_zone object describes a ghost zone which is a
// (discrete) symmetry of spacetime, either mirror-image or periodic.
// Such an object knows how to fill in ghost-zone gridfn data from
@@ -236,9 +236,9 @@ public:
// (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)
+ bool want_min_par_corner = true,
+ bool want_noncorner = true,
+ bool want_max_par_corner = true)
= 0;
@@ -265,9 +265,9 @@ public:
// partial gridfn at y
//
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)
+ bool want_min_par_corner = true,
+ bool want_noncorner = true,
+ bool want_max_par_corner = true)
= 0;
//
@@ -295,8 +295,8 @@ public:
virtual const patch_edge& Jacobian_y_edge() const = 0;
// what is the [min,max] range of m for this ghost zone?
- virtual int Jacobian_y_min_ipar_m() const = 0;
- virtual int Jacobian_y_max_ipar_m() const = 0;
+ virtual int Jacobian_min_y_ipar_m() const = 0;
+ virtual int Jacobian_max_y_ipar_m() const = 0;
// what is the iperp of the Jacobian y points in their (y) patch?
virtual int Jacobian_y_iperp(int x_iperp) const = 0;
@@ -474,9 +474,9 @@ public:
// (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);
+ bool want_min_par_corner = true,
+ bool want_noncorner = true,
+ bool want_max_par_corner = true);
//
// ***** Jacobian of synchronize() *****
@@ -490,9 +490,9 @@ public:
// 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)
+ bool want_min_par_corner = true,
+ bool want_noncorner = true,
+ bool want_max_par_corner = true)
{ }
// to which patch/edge do the y points in this Jacobian row belong?
@@ -500,8 +500,8 @@ public:
const patch_edge& Jacobian_y_edge() const { return symmetry_edge_; }
// what is the [min,max] range of m for this ghost zone?
- int Jacobian_y_min_ipar_m() const { return 0; }
- int Jacobian_y_max_ipar_m() const { return 0; }
+ int Jacobian_min_y_ipar_m() const { return 0; }
+ int Jacobian_max_y_ipar_m() const { return 0; }
// what is the oiperp of the Jacobian points (= iperp in their patch)?
virtual int Jacobian_y_iperp(int x_iperp) const
@@ -616,9 +616,9 @@ public:
// 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);
+ bool want_min_par_corner = true,
+ bool want_noncorner = true,
+ bool want_max_par_corner = true);
//
// ***** Jacobian of synchronize() *****
@@ -635,17 +635,17 @@ public:
// 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);
+ bool want_min_par_corner = true,
+ bool want_noncorner = true,
+ bool want_max_par_corner = true);
// to which patch/edge do the y points in this Jacobian row belong?
patch& Jacobian_y_patch() const { return other_patch_; }
const patch_edge& Jacobian_y_edge() const { return other_edge_; }
// what is the [min,max] range of m for this ghost zone?
- int Jacobian_y_min_ipar_m() const { return min_y_ipar_m_; }
- int Jacobian_y_max_ipar_m() const { return max_y_ipar_m_; }
+ int Jacobian_min_y_ipar_m() const { return Jacobian_min_y_ipar_m_; }
+ int Jacobian_max_y_ipar_m() const { return Jacobian_max_y_ipar_m_; }
// what is the iperp of the Jacobian y points in their (y) patch?
// ... the ipar row of grid points is actually the same, so
@@ -670,15 +670,10 @@ public:
fp Jacobian(int x_iperp, int x_ipar, int y_ipar_m) const
{
assert(Jacobian_buffer_ != NULL);
- // we're actually only supposed to be called with y_ipar_m
- // in range, but as a backup we validate this here and return
- // 0.0 for out of range
- if ((y_ipar_m >= min_y_ipar_m_) && (y_ipar_m <= max_y_ipar_m_))
- then {
- const int y_iperp = Jacobian_y_iperp(x_iperp);
- return (*Jacobian_buffer_)(y_iperp, x_ipar, y_ipar_m);
- }
- else return 0.0;
+ assert(y_ipar_m >= Jacobian_min_y_ipar_m_);
+ assert(y_ipar_m <= Jacobian_max_y_ipar_m_);
+ const int y_iperp = Jacobian_y_iperp(x_iperp);
+ return (*Jacobian_buffer_)(y_iperp, x_ipar, y_ipar_m);
}
//
@@ -791,7 +786,7 @@ private:
// -------------------
// partial gridfn at y
//
- int min_y_ipar_m_, max_y_ipar_m_;
+ int Jacobian_min_y_ipar_m_, Jacobian_max_y_ipar_m_;
// other patch's y ipar posn for a Jacobian row
// ... subscripts are (oiperp, ipar)