RSTT: slbm::GridProfile Class Reference

RSTT 3.1.0 Regional Seismic Travel Time

Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
slbm::GridProfile Class Reference

Manages all information related to a single node in a Grid object. More...

`#include <GridProfile.h>`

Inheritance diagram for slbm::GridProfile:

## Public Member Functions
| GridProfile ()
| GridProfile (const int &i, const double &lat, const double &lon, const double &elev)
| GridProfile (const int &i, Location &location)
virtual | ~GridProfile ()
| Destructor. More...
const int | getNodeId () const
| Retrieve the node index of this node in the model grid. More...
virtual int | getGeoStackId ()
| Retrieve the index of the GeoStack that holds the information about model interfaces, velocities and gradients. More...
virtual double | getEarthRadius ()
virtual void | getData (double *depths, double *pvelocity, double *svelocity, double *gradient)
| Retrieve all the data associated with this Profile. More...
virtual void | setData (double *depths, double *pvelocities, double *svelocities, double *gradients)
| Set the P and S velocities and gradients associated with this GridProfile object to specified values. More...
virtual void | setDepths (const vector< double > &depths)
| Set the layer depths to specified values. More...
virtual void | setVelocity (const int &waveType, const vector< double > &velocity)
| Set the P or S velocity to specified values. More...
virtual void | setGradient (const vector< double > &gradient)
| Set the P and S velocity gradients to specified values. More...
virtual double | getInterfaceRadius (const int &k)
| Retrieve the radius of the k'th interval, in km. More...
virtual double | getInterfaceDepth (const int &k)
| Retrieve the depth of the k'th interval, in km relative sea level. More...
virtual double | getVelocity (const int &waveType, const int &k)
| Retrieve the P or S velocity of the k'th interval, in km/sec. More...
virtual double | getMantleGradient (const int &waveType)
| Retrieve the P or S velocity gradient in the mantle, in 1/sec. More...
virtual void | getInterfaceDepths (vector< double > &depths)
| Retrieve the depths of all intervals, in km. More...
virtual void | getVelocity (const int &waveType, double *velocity)
| Retrieve the P or S velocities of all intervals, in km/sec. More...
virtual void | getMantleGradient (double *gradients)
| Retrieve the P and S velocity gradients in the mantle, in 1/sec. More...
virtual double | getWaterThick ()
double | getWeight ()
| A temporary weight storage assignment function (returned reference) used exclusively by the GreatCircle::getWeights(...) function. More...
void | addWeight (const double &w)
void | setWeight (const double &w)
void | clearHitCount ()
void | incrementHitCount ()
int | getHitCount ()
int | getActiveNodeId ()
void | setActiveNodeId (int id)
void | depthsToRadii (double depths[NLAYERS], vector< vector< float > > &radii)
void | depthsToRadii (const vector< double > &depths, vector< vector< float > > &radii)
Public Member Functions inherited from slbm::Location
| Location ()
virtual | ~Location ()
| Location (const Location &location)
| Location (const double &lat, const double &lon, const double &depth=0)
| Location (const double v[], const double &radius)
| Location (const Location &loc1, const Location &loc2)
Location & | operator= (const Location &other)
bool | operator== (const Location &other) const
bool | operator!= (const Location &other)
string | toString () const
void | setLocation (const double &lat, const double &lon, const double &depth)
void | setLocation (const double *u, const double &r)
void | setRadius (const double &r)
double | getRadius () const
double | getEarthRadius () const
double | getDepth () const
void | setDepth (const double &depth)
double | distance (const Location &other) const
double | distanceKm (Location &other) const
double | distanceDegrees (const Location &other) const
double | azimuth (const Location &other) const
| Find the azimuth from this Location to some other Location. Result will be between 0 and 2*PI radians. More...
double | azimuthDegrees (const Location &other) const
| Find the azimuth from this Location to some other Location. Result will be between 0 and 360 degrees. More...
double | azimuth (const Location &other, const double &errorValue) const
| Find the azimuth from this Location to some other Location. Result will be between 0 and 2*PI radians. If current position is the north or south pole, or if current position and other position are conincident, returns specified errorValue. More...
double | azimuthDegrees (const Location &other, const double &errorValue) const
| Find the azimuth from this Location to some other Location. Result will be between 0 and 360 degrees. If current position is the north or south pole, or if current position and other position are conincident, returns specified errorValue. More...
double | getLat () const
| Retrieve the geographic latitude of this Location, radians. More...
double | getGeocentricLat () const
| Retrieve the geocentric latitude of this Location, radians. More...
double | getGeocentricLatDegrees () const
| Retrieve the geocentric latitude of this Location, degrees. More...
double | getLon () const
| Retrieve the longitude of this Location. Value will be between -PI and PI radians. More...
double | getLatDegrees () const
| Retrieve the geographic latitude of this Location, degrees. More...
double | getLonDegrees () const
| Retrieve the longitude of this Location. Value will be between -180 and 180 degrees. More...
const double * | getUnitVector ()
void | getUnitVector (double x[3])
void | setUnitVector (double x[3])
void | move (const double &azimuth, const double &distance, Location &loc) const
| Retrieve a Location that is a specified distance away from this Location, in a specified direction. More...
bool | cross (const Location &x, Location &loc) const
void | rotate (Location &pole, double angle, Location &loc) const
bool | vectorTripleProduct (const Location &other, double vtp[]) const
| Compute the vector triple product (this x other) x this, normalized to unit length. Returns true if valid, false if triple product has zero length, which will happen when this and other are coincident or PI radians apart. More...
void | move (const double vtp[], const double &a, Location &loc) const
| Move this Location object a specified angular distance (radians) in the direction specified by vtp. More...
void | move_north (const double x[], const double &distance, double z[]) const
void | move_north (const double &distance, Location &loc) const
void | rotate (const double x[], const double p[], const double &a, double z[]) const
double | scalarTripleProduct (const Location &loc1, const Location &loc2) const
double | scalarTripleProduct (const double u[], const double w[]) const
double | scalarTripleProduct (const double u[], const double v[], const double w[]) const
bool | vectorTripleProduct (const double u[], const double v[], double vtp[]) const
| Compute the normalized vector triple product (u x v) x u and and store result in vtp. More...
bool | vectorTripleProductNorthPole (const double u[], double w[]) const
| Compute the normalized vector triple product (u x northPole) x u and store result in w. Returns true if w has finite length, false if length(w) is zero. More...
void | move (const double v[], const double vtp[], const double &a, double u[]) const
| Move unit vector v in direction of vtp by distance a and store result in u. vtp is assumed to be a unit vector normal to v. More...
double | angle (const double u[], const double v[]) const
double | dot (const Location &other) const
double | dot (const double u[], const double v[]) const
double | cross (const double u[], const double v[], double w[]) const
double | crossNorth (const double u[], double w[]) const
double | normalize (double v[]) const
double | length (const double v[]) const

## Static Public Member Functions
static string | class_name ()
static int | getClassCount ()
Static Public Member Functions inherited from slbm::Location
static int | getClassCount ()

## Protected Attributes
int | nodeId
| The node id of this GridProfile. More...
int | activeNodeId
double | weight
| A temporary weight storage location used exclusively by the GreatCircle::getWeights(...) function. More...
int | nHits
| The number of times this node has been 'touched' by a GreatCircle. More...
double | earthRadius
Protected Attributes inherited from slbm::Location
double | v [3]
double | radius

## Static Protected Attributes
static int | gridProfileClassCount
Static Protected Attributes inherited from slbm::Location
static int | locationClassCount

## Additional Inherited Members
Static Public Attributes inherited from slbm::Location
static double | EARTH_RADIUS

## Detailed Description

Manages all information related to a single node in a Grid object.

Manages all information related to a single node in a Grid object including: the Location of the node, the depths of all model interfaces, the P and S velocities of each model interval, and the P and S velocity gradients in the mantle.

GridProfile objects are created in Grid::loadVelocityModel() and deleted in Grid::~Grid.

Definition at line 61 of file GridProfile.h.

## Constructor & Destructor Documentation

## ◆ GridProfile() [1/3]

slbm::GridProfile::GridProfile | ( |  | ) |
| inline

Definition at line 75 of file GridProfile.h.

## ◆ GridProfile() [2/3]

slbm::GridProfile::GridProfile | ( | const int & | i,
|  | const double & | lat,
|  | const double & | lon,
|  | const double & | elev
| ) |  |

## ◆ GridProfile() [3/3]

slbm::GridProfile::GridProfile | ( | const int & | i,
|  | Location & | location
| ) |  |

## ◆ ~GridProfile()

virtual slbm::GridProfile::~GridProfile | ( |  | ) |
| virtual

Destructor.

Destructor.

## Member Function Documentation

## ◆ addWeight()

void slbm::GridProfile::addWeight | ( | const double & | w | ) |
| inline

Definition at line 204 of file GridProfile.h.

## ◆ class_name()

static string slbm::GridProfile::class_name | ( |  | ) |
| inlinestatic

Returns the class name.

Definition at line 89 of file GridProfile.h.

## ◆ clearHitCount()

void slbm::GridProfile::clearHitCount | ( |  | ) |
| inline

Definition at line 208 of file GridProfile.h.

## ◆ depthsToRadii() [1/2]

void slbm::GridProfile::depthsToRadii | ( | const vector< double > & | depths,
|  | vector< vector< float > > & | radii
| ) |  |

## ◆ depthsToRadii() [2/2]

void slbm::GridProfile::depthsToRadii | ( | double | depths[NLAYERS],
|  | vector< vector< float > > & | radii
| ) |  |

## ◆ getActiveNodeId()

int slbm::GridProfile::getActiveNodeId | ( |  | ) |
| inline

Definition at line 214 of file GridProfile.h.

## ◆ getClassCount()

static int slbm::GridProfile::getClassCount | ( |  | ) |
| static

## ◆ getData()

virtual void slbm::GridProfile::getData | ( | double * | depths,
|  | double * | pvelocity,
|  | double * | svelocity,
|  | double * | gradient
| ) |  |
| virtual

Retrieve all the data associated with this Profile.

Retrieve all the data associated with this Profile.

Parameters

  depths | the depths of the top of each interval associated with this Profile.
  pvelocity | the P velocities of each interval, in km/sec.
  svelocity | the S velocities of each interval, in km/sec.
  gradient | a 2-element array specifying the P and S velocity gradient in the mantle, in 1/sec.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getEarthRadius()

virtual double slbm::GridProfile::getEarthRadius | ( |  | ) |
| inlinevirtual

Definition at line 105 of file GridProfile.h.

## ◆ getGeoStackId()

virtual int slbm::GridProfile::getGeoStackId | ( |  | ) |
| virtual

Retrieve the index of the GeoStack that holds the information about model interfaces, velocities and gradients.

Retrieve the index of the GeoStack that holds the information about model interfaces, velocities and gradients.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getHitCount()

int slbm::GridProfile::getHitCount | ( |  | ) |
| inline

Definition at line 212 of file GridProfile.h.

## ◆ getInterfaceDepth()

virtual double slbm::GridProfile::getInterfaceDepth | ( | const int & | k | ) |
| virtual

Retrieve the depth of the k'th interval, in km relative sea level.

brief Retrieve the depth of the k'th interval, in km relative sea level.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getInterfaceDepths()

virtual void slbm::GridProfile::getInterfaceDepths | ( | vector< double > & | depths | ) |
| virtual

Retrieve the depths of all intervals, in km.

Retrieve the depths of all intervals, in km.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getInterfaceRadius()

virtual double slbm::GridProfile::getInterfaceRadius | ( | const int & | k | ) |
| virtual

Retrieve the radius of the k'th interval, in km.

Retrieve the radius of the k'th interval, in km.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getMantleGradient() [1/2]

virtual double slbm::GridProfile::getMantleGradient | ( | const int & | waveType | ) |
| virtual

Retrieve the P or S velocity gradient in the mantle, in 1/sec.

Retrieve the P or S velocity gradient in the mantle, in 1/sec.

Parameters

  waveType | either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getMantleGradient() [2/2]

virtual void slbm::GridProfile::getMantleGradient | ( | double * | gradients | ) |
| virtual

Retrieve the P and S velocity gradients in the mantle, in 1/sec.

Retrieve the P and S velocity gradients in the mantle, in 1/sec.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getNodeId()

const int slbm::GridProfile::getNodeId | ( |  | ) | const
| inline

Retrieve the node index of this node in the model grid.

Retrieve the node index of this node in the model grid.

Definition at line 94 of file GridProfile.h.

## ◆ getVelocity() [1/2]

virtual double slbm::GridProfile::getVelocity | ( | const int & | waveType,
|  | const int & | k
| ) |  |
| virtual

Retrieve the P or S velocity of the k'th interval, in km/sec.

Retrieve the P or S velocity of the k'th interverroral, in km/sec.

Parameters

  waveType | either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.
  k | the index of the desired interval. The shallowest interval is index 0.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getVelocity() [2/2]

virtual void slbm::GridProfile::getVelocity | ( | const int & | waveType,
|  | double * | velocity
| ) |  |
| virtual

Retrieve the P or S velocities of all intervals, in km/sec.

Retrieve the P or S velocities of all intervals, in km/sec.

Parameters

  waveType | either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.
  velocity | (output) the P or S velocity of all the intervals, in km/sec

Reimplemented in slbm::GridProfileSLBM, and slbm::GridProfileGeoTess.

## ◆ getWaterThick()

virtual double slbm::GridProfile::getWaterThick | ( |  | ) |
| virtual

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ getWeight()

double slbm::GridProfile::getWeight | ( |  | ) |
| inline

A temporary weight storage assignment function (returned reference) used exclusively by the GreatCircle::getWeights(...) function.

A temporary weight storage assignment function (returned reference) used exclusively by the GreatCircle::getWeights(...) function.

Definition at line 202 of file GridProfile.h.

## ◆ incrementHitCount()

void slbm::GridProfile::incrementHitCount | ( |  | ) |
| inline

Definition at line 210 of file GridProfile.h.

## ◆ setActiveNodeId()

void slbm::GridProfile::setActiveNodeId | ( | int | id | ) |
| inline

Definition at line 216 of file GridProfile.h.

## ◆ setData()

virtual void slbm::GridProfile::setData | ( | double * | depths,
|  | double * | pvelocities,
|  | double * | svelocities,
|  | double * | gradients
| ) |  |
| virtual

Set the P and S velocities and gradients associated with this GridProfile object to specified values.

Set the P and S velocities and gradients associated with this GridProfile object to specified values.

Parameters

  depths | the depths of the interfaces, in km below sea level.
  pvelocities | the P velocities stored in this GridProfile, in km/sec.
  svelocities | the S velocities stored in this GridProfile, in km/sec.
  gradients | a 2-element vector specifying the P and S velocity gradients in the mantle, in 1/sec.

Reimplemented in slbm::GridProfileSLBM.

## ◆ setDepths()

virtual void slbm::GridProfile::setDepths | ( | const vector< double > & | depths | ) |
| virtual

Set the layer depths to specified values.

Set the layer depths to specified values.

Parameters

  depths | the layer depths, in km below sea level.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ setGradient()

virtual void slbm::GridProfile::setGradient | ( | const vector< double > & | gradient | ) |
| virtual

Set the P and S velocity gradients to specified values.

Set the P and S velocity gradients to specified values.

Parameters

  gradient | the P and S velocity gradients, in km/sec.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ setVelocity()

virtual void slbm::GridProfile::setVelocity | ( | const int & | waveType,
|  | const vector< double > & | velocity
| ) |  |
| virtual

Set the P or S velocity to specified values.

Set the P or S velocity to specified values.

Parameters

  waveType | either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.
  velocity | the P or S velocity, in km/sec.

Reimplemented in slbm::GridProfileGeoTess, and slbm::GridProfileSLBM.

## ◆ setWeight()

void slbm::GridProfile::setWeight | ( | const double & | w | ) |
| inline

Definition at line 206 of file GridProfile.h.

## Member Data Documentation

## ◆ activeNodeId

int slbm::GridProfile::activeNodeId
| protected

Definition at line 230 of file GridProfile.h.

## ◆ earthRadius

double slbm::GridProfile::earthRadius
| protected

Definition at line 248 of file GridProfile.h.

## ◆ gridProfileClassCount

int slbm::GridProfile::gridProfileClassCount
| staticprotected

Definition at line 250 of file GridProfile.h.

## ◆ nHits

int slbm::GridProfile::nHits
| protected

The number of times this node has been 'touched' by a GreatCircle.

The number of times this node has been 'touched' by a GreatCircle. This attribute is incremented in getWeights() once each time this node contributes any weight to any profile object in a GreatCircle.

Definition at line 246 of file GridProfile.h.

## ◆ nodeId

int slbm::GridProfile::nodeId
| protected

The node id of this GridProfile.

The node id of this GridProfile.

Definition at line 228 of file GridProfile.h.

## ◆ weight

double slbm::GridProfile::weight
| protected

A temporary weight storage location used exclusively by the GreatCircle::getWeights(...) function.

A temporary weight storage location used exclusively by the GreatCircle::getWeights(...) function.

Definition at line 237 of file GridProfile.h.

The documentation for this class was generated from the following file:

- rstt/SLBM/include/GridProfile.h