diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-07-01 14:28:09 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-07-01 14:28:09 +0000 |
commit | a7199f14b38e1be3896e896bfaa88aa09e656beb (patch) | |
tree | 4959555f1e061c890aee3c6970419305afe21824 /src/patch/ghost_zone.cc | |
parent | f810b4a745054a4d69578116b493c693cd44c186 (diff) |
* redo min_ipar() and max_ipar() functions in ghost_zone::
--> now these are virtual and take iperp as an argument
(ignored for symmetry_ghost_zone)
--> new functions extreme_min_ipar() and extreme_max_ipar()
to give the extreme range (may even be a bit conservative),
i.e. the range including all of the corners
* fix a bug in patch_interp::molecule_minmax_ipar_m()
where we mistakenly returned the min ipar m for both the min and max
returns :(
* finish modifying the src/util/test_patch_system.cc test driver
to test the Jacobian computation
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@603 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/ghost_zone.cc')
-rw-r--r-- | src/patch/ghost_zone.cc | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc index 3197e2e..ab40101 100644 --- a/src/patch/ghost_zone.cc +++ b/src/patch/ghost_zone.cc @@ -60,7 +60,7 @@ iperp_map_ = new jtutil::cpm_map<fp>(min_iperp(), max_iperp(), my_edge_in.fp_grid_outer_iperp()); // ipar_map_: identity map -ipar_map_ = new jtutil::cpm_map<fp>(min_ipar(), max_ipar()); +ipar_map_ = new jtutil::cpm_map<fp>(extreme_min_ipar(), extreme_max_ipar()); } //****************************************************************************** @@ -96,7 +96,7 @@ iperp_map_ = new jtutil::cpm_map<fp>(min_iperp(), max_iperp(), // // parallel map // -ipar_map_ = new jtutil::cpm_map<fp>(min_ipar(), max_ipar(), +ipar_map_ = new jtutil::cpm_map<fp>(extreme_min_ipar(), extreme_max_ipar(), my_edge_sample_ipar, symmetry_edge_sample_ipar, ipar_map_is_plus); @@ -130,7 +130,7 @@ void symmetry_ghost_zone::synchronize(int ghosted_min_gfn, int ghosted_max_gfn, { for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { - for (int ipar = min_ipar() ; ipar <= max_ipar() ; ++ipar) + for (int ipar = min_ipar(iperp) ; ipar <= max_ipar(iperp) ; ++ipar) { // do we want to do this point? if (! my_edge().ipar_is_in_selected_corner(want_min_par_corner, @@ -396,24 +396,17 @@ max_other_iperp_ = std::max(other_iperp(min_iperp()), other_iperp(max_iperp())); // -// compute extreme range of ipar that we'll use, -// and set up arrays giving actual [min,max] ipar that we'll use -// at each other_iperp +// set up arrays giving actual [min,max] ipar that we'll use +// at each other_iperp // ... we will pass these arrays by reference to the other patch's // patch_interp object, with ipar being parindex there // -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); - (*min_ipar_used_)(other_iperp(iperp)) = min_ipar_here; - (*max_ipar_used_)(other_iperp(iperp)) = max_ipar_here; + (*min_ipar_used_)(other_iperp(iperp)) = min_ipar(iperp); + (*max_ipar_used_)(other_iperp(iperp)) = max_ipar(iperp); } @@ -422,7 +415,7 @@ max_ipar_used_ = new jtutil::array1d<int>(min_other_iperp_, max_other_iperp_); // other_par_ = new jtutil::array2d<fp>(min_other_iperp_, max_other_iperp_, - extreme_min_ipar_, extreme_max_ipar_); + extreme_min_ipar(), extreme_max_ipar()); for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { @@ -454,7 +447,7 @@ interp_result_buffer_ = 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_); + extreme_min_ipar(), extreme_max_ipar()); // // construct the patch_interp object to interpolate from the *other* patch @@ -544,23 +537,21 @@ other_patch_interp_->interpolate(ghosted_min_gfn, ghosted_max_gfn, *interp_result_buffer_); // store the results back into our gridfns - for (int gfn = ghosted_min_gfn ; gfn <= ghosted_max_gfn ; ++gfn) - { + for (int gfn = ghosted_min_gfn ; gfn <= ghosted_max_gfn ; ++gfn) + { for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { const int oiperp = other_iperp(iperp); - for (int ipar = min_ipar(iperp) ; - ipar <= max_ipar(iperp) ; - ++ipar) - { - int irho = my_edge(). irho_of_iperp_ipar(iperp,ipar); - int isigma = my_edge().isigma_of_iperp_ipar(iperp,ipar); - my_patch().ghosted_gridfn(gfn, irho,isigma) - = (*interp_result_buffer_)(gfn, oiperp,ipar); - } + for (int ipar = min_ipar(iperp) ; ipar <= max_ipar(iperp) ; ++ipar) + { + int irho = my_edge(). irho_of_iperp_ipar(iperp,ipar); + int isigma = my_edge().isigma_of_iperp_ipar(iperp,ipar); + my_patch().ghosted_gridfn(gfn, irho,isigma) + = (*interp_result_buffer_)(gfn, oiperp,ipar); } } + } } //****************************************************************************** @@ -594,13 +585,13 @@ other_patch_interp_->molecule_minmax_ipar_m(min_y_ipar_m_, max_y_ipar_m_); if (Jacobian_y_ipar_posn_ == NULL) then Jacobian_y_ipar_posn_ = new jtutil::array2d<CCTK_INT> (min_other_iperp_, max_other_iperp_, - extreme_min_ipar_, extreme_max_ipar_); + extreme_min_ipar(), extreme_max_ipar()); 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_, + extreme_min_ipar(), extreme_max_ipar(), min_y_ipar_m_, max_y_ipar_m_); other_patch_interp_->Jacobian(*Jacobian_buffer_); } |