diff options
Diffstat (limited to 'src/patch/ghost_zone.cc')
-rw-r--r-- | src/patch/ghost_zone.cc | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc index bb3e99e..d41c26c 100644 --- a/src/patch/ghost_zone.cc +++ b/src/patch/ghost_zone.cc @@ -17,16 +17,17 @@ #include <stdio.h> #include <assert.h> +#include <stdlib.h> #include <limits.h> #include <math.h> +#include "cctk.h" + #include "jt/stdc.h" #include "jt/util.hh" #include "jt/array.hh" #include "jt/cpm_map.hh" #include "jt/linear_map.hh" -#include "jt/interpolate.hh" - using jtutil::error_exit; #include "fp.hh" @@ -164,7 +165,7 @@ interpatch_ghost_zone::interpatch_ghost_zone(const patch_edge& my_edge_in, : ghost_zone(my_edge_in, ghost_zone_is_interpatch), other_patch_(other_edge_in.my_patch()), other_edge_(other_edge_in), - other_frontier_(NULL), // set by setup_other_frontier() + other_frontier_(NULL), // set by setup_other_patch_frontier() // remaining subobjects are all set properly in ctor body other_iperp_(NULL), other_min_iperp_(0), other_max_iperp_(0), @@ -274,7 +275,7 @@ const fp fp_other_sample_iperp = other_edge() .fp_iperp_of_perp(other_sample_perp); // verify that this is fuzzily a grid point -if (! fuzzy<fp>::is_integer(fp_other_sample_iperp)) +if (! jtutil::fuzzy<fp>::is_integer(fp_other_sample_iperp)) then error_exit(ERROR_EXIT, "***** interpatch_ghost_zone::interpatch_ghost_zone:\n" " my_patch().name()=\"%s\" my_edge().name()=%s\n" @@ -321,12 +322,12 @@ other_max_iperp_ = jtutil::max(other_iperp(min_iperp()), // ... we will pass these arrays by reference to the other patch's // patch_frontier object, with ipar being parindex there // -min_ipar_used_ = new array1d<int>(other_min_iperp_, other_max_iperp_); -max_ipar_used_ = new array1d<int>(other_min_iperp_, other_max_iperp_); +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_); for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { - min_ipar_used_(other_iperp(iperp)) = min_ipar(iperp); - max_ipar_used_(other_iperp(iperp)) = max_ipar(iperp); + (*min_ipar_used_)(other_iperp(iperp)) = min_ipar(iperp); + (*max_ipar_used_)(other_iperp(iperp)) = max_ipar(iperp); } @@ -339,8 +340,9 @@ max_ipar_used_ = new array1d<int>(other_min_iperp_, other_max_iperp_); // (since that depends on the type of our patch's adjacent ghost zones) // ==> we include the corners on the chance we may want them later, // and use the appropriate parts of them in synchronize() below -other_par_ = new array2d<fp>(other_min_iperp_, other_max_iperp_, - ghost_zone_min_ipar(), ghost_zone_max_ipar()); +other_par_ = new jtutil::array2d<fp> + (other_min_iperp_, other_max_iperp_, + ghost_zone_min_ipar(), ghost_zone_max_ipar()); for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { @@ -362,7 +364,7 @@ other_par_ = new array2d<fp>(other_min_iperp_, other_max_iperp_, const fp other_par = other_patch() .modulo_reduce_ang(other_edge().par_is_rho(), tau); - other_par_(other_iperp(iperp),ipar) = other_par; + (*other_par_)(other_iperp(iperp),ipar) = other_par; } } @@ -371,8 +373,8 @@ other_par_ = new array2d<fp>(other_min_iperp_, other_max_iperp_, // set up interpolation result buffer // interp_result_buffer_ - = new array3d<fp> - (my_patch().min_ghosted_gfn(), my_patch().max_ghosted_gfn(), + = new jtutil::array3d<fp> + (my_patch().ghosted_min_gfn(), my_patch().ghosted_max_gfn(), other_min_iperp_, other_max_iperp_, ghost_zone_min_ipar(), ghost_zone_max_ipar()); } @@ -385,7 +387,7 @@ interp_result_buffer_ interpatch_ghost_zone::~interpatch_ghost_zone() { delete interp_result_buffer_; -deleete other_par_; +delete other_par_; delete max_ipar_used_; delete min_ipar_used_; delete other_iperp_; @@ -440,10 +442,9 @@ return max_par_adjacent_ghost_zone().is_symmetry() void interpatch_ghost_zone::setup_other_patch_frontier (int interp_handle, int interp_par_table_handle) { -const other_frontier_ +other_frontier_ = new patch_frontier(other_edge(), other_min_iperp_, other_max_iperp_, - ghost_zone_min_ipar(), ghost_zone_max_ipar(), *min_ipar_used_, *max_ipar_used_, *other_par_, interp_handle, interp_par_table_handle); @@ -500,16 +501,16 @@ if (! (want_min_par_corner && want_non_corner && want_max_par_corner)) " want_max_par_corner=(int)%d\n" , ghosted_min_gfn, ghosted_max_gfn, - bool want_min_par_corner, - bool want_non_corner, - bool want_max_par_corner); /*NOTREACHED*/ + want_min_par_corner, + want_non_corner, + want_max_par_corner); /*NOTREACHED*/ // do the interpolation into our result buffer other_frontier_->interpolate(ghosted_min_gfn, ghosted_max_gfn, - interp_result_buffer_); + *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) { @@ -518,7 +519,7 @@ other_frontier_->interpolate(ghosted_min_gfn, ghosted_max_gfn, 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, iperp,ipar); + = (*interp_result_buffer_)(gfn, iperp,ipar); } } } |