Small Body Geophysical Analysis Tool (SBGAT)
|
Computes/evaluates the outer spherical harmonics expansion of the exterior gravity field around a constant density polyhedron. More...
#include <SBGATSphericalHarmo.hpp>
Public Member Functions | |
vtkTypeMacro (SBGATSphericalHarmo, vtkPolyDataAlgorithm) | |
void | PrintSelf (std::ostream &os, vtkIndent indent) override |
void | PrintHeader (std::ostream &os, vtkIndent indent) override |
void | PrintTrailer (std::ostream &os, vtkIndent indent) override |
void | SetDegree (const unsigned int deg) |
void | SetReferenceRadius (const double ref_radius) |
void | SetDensity (const double density) |
void | IsNormalized () |
void | IsNonNormalized () |
arma::mat | GetCnm () |
void | GetCnm (arma::mat &C_nm) |
arma::mat | GetSnm () |
void | GetSnm (arma::mat &S_nm) |
arma::vec::fixed< 3 > | GetAcceleration (const arma::vec::fixed< 3 > &pos) |
void | GetGravityGradientMatrix (const arma::vec::fixed< 3 > &pos, arma::mat::fixed< 3, 3 > &dAccdPos) |
void | GetPartialHarmonics (const arma::vec::fixed< 3 > &pos, arma::mat &partial_C, arma::mat &partial_S) |
void | SetScaleMeters () |
void | SetScaleKiloMeters () |
void | SaveToJson (std::string path) const |
void | LoadFromJson (std::string path) |
void | SetCnm (arma::mat Cnm) |
void | SetSnm (arma::mat Snm) |
Static Public Member Functions | |
static SBGATSphericalHarmo * | New () |
Protected Member Functions | |
SBGATSphericalHarmo () | |
~SBGATSphericalHarmo () override | |
int | RequestData (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override |
Protected Attributes | |
arma::mat | Cnm |
arma::mat | Snm |
double | referenceRadius |
double | density |
double | totalMass |
double | scaleFactor = 1 |
bool | normalized |
unsigned int | degree |
int | n_facets |
int | n_vertices |
bool | degreeSet |
bool | densitySet |
bool | referenceRadiusSet |
bool | scaleFactorSet |
bool | setFromJSON |
Private Member Functions | |
SBGATSphericalHarmo (const SBGATSphericalHarmo &)=delete | |
void | operator= (const SBGATSphericalHarmo &)=delete |
Computes/evaluates the outer spherical harmonics expansion of the exterior gravity field around a constant density polyhedron.
Computes/evaluates the outer spherical harmonics expansion of the exterior gravity field around a constant density polyhedron. Normalized or non-normalized coefficients can be computed. The computed coefficients are completely independent of the mass and density of the considered object as they are only a geometric construct, thanks to the constant-density assumption. This class will always use results expressed in meters
as their distance unit (e.g accelerations in m/s^2, potentials in m^2/s^2,...) . Unit consistency is enforced through the use of the SetScaleMeters() and SetScaleKiloMeters() method.
Adapted from the works of Yu Takahashi and Siamak Hesar by Benjamin Bercovici, University of Colorado Boulder for more details, see Werner, R. a. (1997). Spherical harmonic coefficients for the potential of a constant-density polyhedron. Computers & Geosciences, 23(10), 1071–1077. https://doi.org/10.1016/S0098-3004(97)00110-6
Definition at line 50 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 57 of file SBGATSphericalHarmo.cpp.
|
overrideprotected |
Definition at line 72 of file SBGATSphericalHarmo.cpp.
|
privatedelete |
arma::vec::fixed< 3 > SBGATSphericalHarmo::GetAcceleration | ( | const arma::vec::fixed< 3 > & | pos | ) |
Return the acceleration due to gravity at the specified point
pos | position at which the acceleration must be evaluated (meters) |
Definition at line 191 of file SBGATSphericalHarmo.cpp.
|
inline |
Definition at line 118 of file SBGATSphericalHarmo.hpp.
|
inline |
Definition at line 134 of file SBGATSphericalHarmo.hpp.
void SBGATSphericalHarmo::GetGravityGradientMatrix | ( | const arma::vec::fixed< 3 > & | pos, |
arma::mat::fixed< 3, 3 > & | dAccdPos | ||
) |
Evaluates the gravity gradient matrix (the partial derivative of the spherical harmonics acceleration with respect to the position vector) at the prescribed location. Note that this gravity gradient matrix is expressed in the body-fixed frame of the considered object.
[in] | pos | position at which the gravity gradient matrix must be evaluated, expressed in the same frame/same unit L as the shape used to build the spherical harmonics expansion. |
[out] | dAccdPos | container holding the gravity gradient matrix (1 / s ^ 2) |
Definition at line 271 of file SBGATSphericalHarmo.cpp.
void SBGATSphericalHarmo::GetPartialHarmonics | ( | const arma::vec::fixed< 3 > & | pos, |
arma::mat & | partial_C, | ||
arma::mat & | partial_S | ||
) |
Evaluates the partial derivative of the spherical harmonics acceleration with respect to the spherical harmonics coefficients. The coefficients and the partials of the acceleration w/r to the coefficients are ordered like so:
Cnm : (C_00 == 1) 0 0 0 0 0 C_10 C_11 0 0 0 0 C_20 C_21 C_22 0 0 0
C_30 C_31 C_32 C_33 0 0
C_40 C_41 C_42 C_43 C_44 0 C_50 C_51 C_52 C_53 C_54 C_55
Snm : 0 0 0 0 0 0 0 S_11 0 0 0 0 0 S_21 S_22 0 0 0 0 S_31 S_32 S_33 0 0 0 S_41 S_42 S_43 S_44 0 0 S_51 S_52 S_53 S_54 S_55
so
partial_C = [ dA/C_00,dA/C_10,dA/C_11,dA/C_20,dA/C_21,dA/C_22,...] partial_S = [ dA/S_11,dA/C_21,dA/S_22,dA/S_31,dA/S_32,dA/S_33,...]
[in] | pos | position at which the partial derivatives must be evaluated, expressed in the same frame/same unit as the shape used to build the spherical harmonics expansion. |
[out] | partial_C | container holding the partial derivative of the acceleration with respect to the Cnm spherical harmonic coefficients. If the degree/order is n, then there are (n+1) * (n + 2)/2 non-zero Cnm coefficients |
[out] | partial_S | container holding the partial derivative of the acceleration with respect to the Snm spherical harmonic coefficients. If the degree/order is n, then there are (n+1) * (n + 2)/2 - n non-zero Snm coefficients |
Definition at line 393 of file SBGATSphericalHarmo.cpp.
|
inline |
Definition at line 151 of file SBGATSphericalHarmo.hpp.
|
inline |
Definition at line 165 of file SBGATSphericalHarmo.hpp.
|
inline |
Definition at line 101 of file SBGATSphericalHarmo.hpp.
|
inline |
Definition at line 94 of file SBGATSphericalHarmo.hpp.
void SBGATSphericalHarmo::LoadFromJson | ( | std::string | path | ) |
Loads a previously computed spherical harmonics expansion from a JSON file. Will set the appropriate fields in the SBGATSphericalHarmo object to allow calls to other methods. The loadable fields are:
path | JSON file storing the spherical harmonics model |
Definition at line 540 of file SBGATSphericalHarmo.cpp.
|
static |
Constructs with initial values of zero.
|
privatedelete |
|
override |
Definition at line 470 of file SBGATSphericalHarmo.cpp.
|
override |
Definition at line 598 of file SBGATSphericalHarmo.cpp.
|
override |
Definition at line 473 of file SBGATSphericalHarmo.cpp.
|
overrideprotected |
Definition at line 81 of file SBGATSphericalHarmo.cpp.
void SBGATSphericalHarmo::SaveToJson | ( | std::string | path | ) | const |
Exports the computed spherical harmonics expansion to a JSON file. The saved fields are:
path | JSON file where the spherical harmonics model will be saved |
Definition at line 478 of file SBGATSphericalHarmo.cpp.
|
inline |
Sets the Cnm coefficients. There is normally no need to use this method outside of Sbgat's tests
[in] | Cnm | coefficients |
Definition at line 275 of file SBGATSphericalHarmo.hpp.
|
inline |
Sets degree of spherical harmonics expansion
deg | degree of spherical harmonics expansion |
Definition at line 66 of file SBGATSphericalHarmo.hpp.
|
inline |
Sets polyhedron density
density | bulk density of polyhedron (kg/m^3) |
Definition at line 85 of file SBGATSphericalHarmo.hpp.
|
inline |
Sets reference radius in spherical harmonics expansion. Must be consistent with the units in which the shape coordinates are expressed
ref_radius | reference radius in spherical harmonics expansion |
Definition at line 76 of file SBGATSphericalHarmo.hpp.
|
inline |
Sets the scale factor to 1000, indicative that the polydata has its coordinates expressed in kilometers
Definition at line 233 of file SBGATSphericalHarmo.hpp.
|
inline |
Sets the scale factor to 1, indicative that the polydata has its coordinates expressed in meters
Definition at line 228 of file SBGATSphericalHarmo.hpp.
|
inline |
Sets the Snm coefficients. There is normally no need to use this method outside of Sbgat's tests
[in] | Snm | coefficients |
Definition at line 281 of file SBGATSphericalHarmo.hpp.
SBGATSphericalHarmo::vtkTypeMacro | ( | SBGATSphericalHarmo | , |
vtkPolyDataAlgorithm | |||
) |
|
protected |
Definition at line 293 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 302 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 307 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 297 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 308 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 304 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 305 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 301 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 296 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 309 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 299 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 310 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 311 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 294 of file SBGATSphericalHarmo.hpp.
|
protected |
Definition at line 298 of file SBGATSphericalHarmo.hpp.