Spherical harmonic sums for a circle. More...
#include <CircularEngine.hpp>
Public Member Functions | |
CircularEngine () | |
Math::real | operator() (real sinlon, real coslon) const |
Math::real | operator() (real lon) const |
Math::real | operator() (real sinlon, real coslon, real &gradx, real &grady, real &gradz) const |
Math::real | operator() (real lon, real &gradx, real &grady, real &gradz) const |
Private Types | |
enum | normalization { FULL = SphericalEngine::FULL, SCHMIDT = SphericalEngine::SCHMIDT } |
typedef Math::real | real |
Private Member Functions | |
CircularEngine (int M, bool gradp, unsigned norm, real a, real r, real u, real t) | |
void | SetCoeff (int m, real wc, real ws) |
void | SetCoeff (int m, real wc, real ws, real wrc, real wrs, real wtc, real wts) |
Math::real | Value (bool gradp, real sl, real cl, real &gradx, real &grady, real &gradz) const |
Private Attributes | |
real | _a |
bool | _gradp |
int | _M |
unsigned | _norm |
real | _q |
real | _r |
real | _t |
real | _u |
real | _uq |
real | _uq2 |
std::vector< real > | _wc |
std::vector< real > | _wrc |
std::vector< real > | _wrs |
std::vector< real > | _ws |
std::vector< real > | _wtc |
std::vector< real > | _wts |
Friends | |
class | SphericalEngine |
Spherical harmonic sums for a circle.
The class is a companion to SphericalEngine. If the results of a spherical harmonic sum are needed for several points on a circle of constant latitude lat and height h, then SphericalEngine::Circle can compute the inner sum, which is independent of longitude lon, and produce a CircularEngine object. CircularEngine::operator()() can then be used to perform the outer sum for particular vales of lon. This can lead to substantial improvements in computational speed for high degree sum (approximately by a factor of N / 2 where N is the maximum degree).
CircularEngine is tightly linked to the internals of SphericalEngine. For that reason, the constructor for this class is private. Use SphericalHarmonic::Circle, SphericalHarmonic1::Circle, and SphericalHarmonic2::Circle to create instances of this class.
CircularEngine stores the coefficients needed to allow the summation over order to be performed in 2 or 6 vectors of length M + 1 (depending on whether gradients are to be calculated). For this reason the constructor may throw a std::bad_alloc exception.
Example of use:
Definition at line 52 of file CircularEngine.hpp.
|
private |
Definition at line 54 of file CircularEngine.hpp.
|
private |
Enumerator | |
---|---|
FULL | |
SCHMIDT |
Definition at line 55 of file CircularEngine.hpp.
|
inlineprivate |
Definition at line 70 of file CircularEngine.hpp.
|
inline |
A default constructor. CircularEngine::operator()() on the resulting object returns zero. The resulting object can be assigned to the result of SphericalHarmonic::Circle.
Definition at line 110 of file CircularEngine.hpp.
|
inline |
Evaluate the sum for a particular longitude given in terms of its sine and cosine.
[in] | sinlon | the sine of the longitude. |
[in] | coslon | the cosine of the longitude. |
The arguments must satisfy sinlon2 + coslon2 = 1.
Definition at line 128 of file CircularEngine.hpp.
|
inline |
Evaluate the sum for a particular longitude.
[in] | lon | the longitude (degrees). |
Definition at line 139 of file CircularEngine.hpp.
|
inline |
Evaluate the sum and its gradient for a particular longitude given in terms of its sine and cosine.
[in] | sinlon | the sine of the longitude. |
[in] | coslon | the cosine of the longitude. |
[out] | gradx | x component of the gradient. |
[out] | grady | y component of the gradient. |
[out] | gradz | z component of the gradient. |
The gradients will only be computed if the CircularEngine object was created with this capability (e.g., via gradp = true in SphericalHarmonic::Circle). If not, gradx, etc., will not be touched. The arguments must satisfy sinlon2 + coslon2 = 1.
Definition at line 162 of file CircularEngine.hpp.
|
inline |
Evaluate the sum and its gradient for a particular longitude.
[in] | lon | the longitude (degrees). |
[out] | gradx | x component of the gradient. |
[out] | grady | y component of the gradient. |
[out] | gradz | z component of the gradient. |
The gradients will only be computed if the CircularEngine object was created with this capability (e.g., via gradp = true in SphericalHarmonic::Circle). If not, gradx, etc., will not be touched.
Definition at line 181 of file CircularEngine.hpp.
Definition at line 91 of file CircularEngine.hpp.
|
inlineprivate |
Definition at line 94 of file CircularEngine.hpp.
|
private |
Definition at line 16 of file src/CircularEngine.cpp.
|
friend |
Definition at line 69 of file CircularEngine.hpp.
|
private |
Definition at line 62 of file CircularEngine.hpp.
|
private |
Definition at line 60 of file CircularEngine.hpp.
|
private |
Definition at line 59 of file CircularEngine.hpp.
|
private |
Definition at line 61 of file CircularEngine.hpp.
|
private |
Definition at line 64 of file CircularEngine.hpp.
|
private |
Definition at line 62 of file CircularEngine.hpp.
|
private |
Definition at line 62 of file CircularEngine.hpp.
|
private |
Definition at line 62 of file CircularEngine.hpp.
|
private |
Definition at line 64 of file CircularEngine.hpp.
|
private |
Definition at line 64 of file CircularEngine.hpp.
|
private |
Definition at line 63 of file CircularEngine.hpp.
|
private |
Definition at line 63 of file CircularEngine.hpp.
|
private |
Definition at line 63 of file CircularEngine.hpp.
|
private |
Definition at line 63 of file CircularEngine.hpp.
|
private |
Definition at line 63 of file CircularEngine.hpp.
|
private |
Definition at line 63 of file CircularEngine.hpp.