diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2001-08-09 15:01:14 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2001-08-09 15:01:14 +0000 |
commit | 5891f8554eb811ad1fbc7f4cf2a8aedd01000c8f (patch) | |
tree | 44da8c61bf4138f5ddda64a8ea4ac750ed2c68a9 /src/patch/grid.hh | |
parent | 1be7596b795dd5a5abb75f914fee9b2ff1228393 (diff) |
coords.{cc,hh}: add modulo-2pi functions
grid.hh: add rho/sigma mod 2pi functions
ghost_zone.cc: always reduce angles (mod 2*pi) to the other patch's range
when computing other-patch angles in setting up interpatch
ghost zones
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@256 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/grid.hh')
-rw-r--r-- | src/patch/grid.hh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/patch/grid.hh b/src/patch/grid.hh index cb54ab9..656f6b7 100644 --- a/src/patch/grid.hh +++ b/src/patch/grid.hh @@ -368,7 +368,7 @@ public: // ***** single-axis coordinate conversions ***** // - // ... angules in radians + // ... angles in radians fp rho_of_irho(int irho) const { return rho_map().fp_of_int(irho); } fp sigma_of_isigma(int isigma) const { return sigma_map().fp_of_int(isigma); } @@ -473,6 +473,26 @@ public: fp ghosted_max_sigma() const { return sigma_of_isigma(ghosted_max_isigma()); } + // reduce a rho/sigma coordinate modulo 2*pi radians (360 degrees) + // to be within the ghosted grid, + // or error_exit() if no such value exists + fp modulo_reduce_rho(fp rho_in) const + { + return local_coords + ::modulo_reduce_ang(rho_in, ghosted_min_rho(), + ghosted_max_rho()); + } + fp modulo_reduce_sigma(fp sigma_in) const + { + return local_coords + ::modulo_reduce_ang(sigma_in, ghosted_min_sigma(), + ghosted_max_sigma()); + } + fp modulo_reduce_ang(bool want_rho, fp ang_in) const + { + return want_rho ? modulo_reduce_rho(ang_in) + : modulo_reduce_sigma(ang_in); + } // // ***** misc stuff ***** |