diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2001-09-07 12:28:12 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2001-09-07 12:28:12 +0000 |
commit | a7434ea8854d5334b72e38ce82465fad408ed17c (patch) | |
tree | 5651eeec33fa5eed9f8d4058f1a437beda48c833 /src/patch/ghost_zone.cc | |
parent | 18b3325259083b02b002d3dab320ab3e307197ab (diff) |
rework yet again how we set up ghost zone iperp mapping
to try and cure problems with empty ghost zones causing assertion failures
from out-of-range mappings --> still not working... :(
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@291 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/ghost_zone.cc')
-rw-r--r-- | src/patch/ghost_zone.cc | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc index fe65b7a..0e780c4 100644 --- a/src/patch/ghost_zone.cc +++ b/src/patch/ghost_zone.cc @@ -264,33 +264,39 @@ if (! local_coords::fuzzy_EQ_ang(my_edge().grid_outer_perp(), // set up the iperp interpatch coordinate mapping // -// compute the other_iperp corresponding to inner_iperp -// using the fact that perp is the same coordinate in both cases -// (modulo 2*pi radians = 360 degrees) -const fp inner_perp = my_edge().perp_of_iperp(inner_iperp()); -const fp other_inner_perp - = other_patch().modulo_reduce_ang(other_edge().perp_is_rho(), - inner_perp); -const fp fp_other_inner_iperp = other_edge() - .fp_iperp_of_perp(other_inner_perp); +// compute the iperp --> other_iperp mapping for a sample point; +// ... if the ghost zone is empty, then the sample point will necessarily +// be out-of-range in the ghost zone, so we use the *unchecked* +// conversions to avoid errors in this case +// ... we do the computation using the fact that perp is the same +// coordinate in both patches (modulo 2*pi radians = 360 degrees) +const int sample_iperp = outer_iperp(); +const fp sample_perp = my_edge().perp_map() + .fp_of_int_unchecked(sample_iperp); + // unchecked conversion here! +const fp other_sample_perp = other_patch() + .modulo_reduce_ang(other_edge().perp_is_rho(), + sample_perp); +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_inner_iperp)) +if (! 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" " other_patch().name()=\"%s\" other_edge().name()=%s\n" -" inner_iperp()=%d inner_perp=%g\n" -" other_inner_perp=%g\n" -" ==> fp_other_inner_iperp=%g isn't fuzzily an integer\n" +" sample_iperp=%d sample_perp=%g\n" +" other_sample_perp=%g fp_other_sample_iperp=%g\n" +" ==> fp_other_sample_iperp isn't fuzzily an integer!\n" " ==> patches aren't commensurate in the perpendicular coordinate!\n" , my_patch().name(), my_edge().name(), other_patch().name(), other_edge().name(), - inner_iperp(), double(inner_perp), - double(other_inner_perp), - double(fp_other_inner_iperp)); /*NOTREACHED*/ -const int other_inner_iperp = round<fp>::to_integer(fp_other_inner_iperp); + sample_iperp, double(sample_perp), + double(other_sample_perp), + double(fp_other_sample_iperp)); /*NOTREACHED*/ +const int other_sample_iperp = round<fp>::to_integer(fp_other_sample_iperp); // compute the +/- sign (direction) of the iperp --> other_iperp mapping // @@ -306,7 +312,7 @@ const double iperp_map_sign_pm1 // now we finally know enough to set up the iperp interpatch coordinate mapping other_iperp_ = new cpm_map<fp> (min_iperp(), max_iperp(), - inner_iperp(), other_inner_iperp, + sample_iperp, other_sample_iperp, (iperp_map_sign_pm1 > 0.0) ? cpm_map<fp>::plus_map : cpm_map<fp>::minus_map); |