diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-11-15 15:09:40 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-11-15 15:09:40 +0000 |
commit | 6eeeb90d9cb364e58d5a9c10ba56ed6e4daa63a3 (patch) | |
tree | ad77578282ca5a1d4ab13020ec595b8662f92275 /src | |
parent | ed23958494a8606ed8d815f9354b08893f0e1778 (diff) |
add explicit degree/radian conversions for rho/sigma
add tests for whether a given drho/dsigma is valid"
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@889 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r-- | src/patch/grid.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/patch/grid.hh b/src/patch/grid.hh index eebfbd5..e8ebf38 100644 --- a/src/patch/grid.hh +++ b/src/patch/grid.hh @@ -639,6 +639,14 @@ public: } // ... angles in degrees + fp rho_of_drho(fp drho) const + { return jtutil::radians_of_degrees(drho); } + fp sigma_of_dsigma(fp dsigma) const + { return jtutil::radians_of_degrees(dsigma); } + fp drho_of_rho(fp rho) const + { return jtutil::degrees_of_radians(rho); } + fp dsigma_of_sigma(fp sigma) const + { return jtutil::degrees_of_radians(sigma); } fp drho_of_irho(int irho) const { return jtutil::degrees_of_radians(rho_of_irho(irho)); } fp dsigma_of_isigma(int isigma) const @@ -709,6 +717,12 @@ public: fp ghosted_max_sigma() const { return sigma_of_isigma(ghosted_max_isigma()); } + // is a given (drho,dsigma) within the grid? + bool is_valid_drho(fp drho) const + { return (drho >= min_drho()) && (drho <= max_drho()); } + bool is_valid_dsigma(fp dsigma) const + { return (dsigma >= min_dsigma()) && (dsigma <= max_dsigma()); } + // 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 |