RSTT  3.2.0
Regional Seismic Travel Time
All Classes Namespaces Files Functions Variables Typedefs Friends Macros
taup::TPZeroFunctional Class Reference

The primary layer search functional used by Brents zeroIn(...) function to find layers that contain a turning ray whose distance matches the distance between the source and receiver. More...

#include <TauPSiteFunctionals.h>

Public Member Functions

 TPZeroFunctional ()
 Default constructor. More...
 
 TPZeroFunctional (TauPSite *tps)
 Standard constructor. Assigns the TauPSite for this TPZeroFunctional. More...
 
 TPZeroFunctional (const TPZeroFunctional &tpzf)
 Copy constructor. More...
 
virtual ~TPZeroFunctional ()
 Destructor. More...
 
TPZeroFunctionaloperator= (const TPZeroFunctional &tpzf)
 Assignment operator. More...
 
double operator() (double p)
 The function objects operator() definition which is used by a Brents::zeroIn(...) function to find the value of the ray parameter p that gives a source to receiver distance of tpzD. More...
 
void setTurningZero ()
 Sets the turning zero for the operator() function (tpzIsTurningZero is set to true). More...
 
bool isTurningZero ()
 Returns true if the turning zero is set for return by the operator() function (tpzIsTurningZero is true). More...
 
double getTurningZero ()
 Returns the turning leg zero evaluation from the last distance() function evaluation. More...
 
bool isTurningRayValid ()
 Returns true if the turning ray, receiver, and source legs are valid in the last distance() function call evaluation. More...
 
void setUpGoingZero ()
 Sets the upgoing zero for the operator() function (tpzIsTurningZero is set to false). More...
 
bool isUpGoingZero ()
 Returns true if the upgoing zero is set for return by the operator() function (tpzIsTurningZero is false). More...
 
double getUpGoingZero ()
 Returns the upgoing leg zero evaluation from the last distance() function evaluation. More...
 
bool isUpGoingRayValid ()
 Returns true if the upgoing receiver and source legs are valid in the last distance() function call evaluation. More...
 
double getMinP ()
 Returns the minimum allowable ray parameter for a ray to transfer between the source and receiver depths. More...
 
void setTauPSite (TauPSite *tps)
 Sets the TauPSite. More...
 
TauPSitegetTauPSite ()
 Gets the TauPSite. More...
 
void setPlanetRadius (double pr)
 Sets the planet radius (default to Earth = 6371.0 km) More...
 
double getPlanetRadius () const
 Returns the planet radius (default to Earth = 6371.0 km) More...
 
void setSourceRadius (double r)
 Sets the source radius and sign. More...
 
double getSourceRadius () const
 Returns the source radius. More...
 
void setSourceDepth (double d)
 Sets the source radius and sign from the input depth. More...
 
double getSourceDepth () const
 Returns the source depth. More...
 
void setReceiverRadius (double r)
 Sets the receiver radius and sign. More...
 
double getReceiverRadius () const
 Returns the receiver radius. More...
 
void setReceiverDepth (double d)
 Sets the receiver radius and sign from the input depth. More...
 
double getReceiverDepth () const
 Returns the receiver depth. More...
 
void setDist (double d)
 Sets the search distance between the source and receiver. More...
 
double getDist () const
 Sets the search distance between the source and receiver. More...
 
void setPTop (double p)
 Sets the layer top ray parameter p for the current search layer. More...
 
double getPTop () const
 Gets the layer top ray parameter p for the current search layer. More...
 
void distance (double p)
 The primary function of this object which calculates the ray travel distance between the source and the receiver positions as a function of the input ray parameter p. The entire surface-to-surface ray leg is evaluated in addition to the surface-to-source and surface-to-receiver legs. More...
 
double time (double p)
 Calculates the travel time between the source and receiver for the current layer at the zero in ray parameter value p. This function is only called once the zero in functional determines the critical ray parameter that gives a source to receiver distance equal to tpzD. More...
 
double getRayDistance () const
 Returns the surface-to-surface ray distance. More...
 
double getRayTime () const
 Returns the surface-to-surface ray time. More...
 
double getSourceLegDistance () const
 Returns the surface-to-source ray distance. More...
 
double getSourceLegTime () const
 Returns the surface-to-source ray time. More...
 
double getReceiverLegDistance () const
 Returns the surface-to-receiver ray distance. More...
 
double getReceiverLegTime () const
 Returns the surface-to-receiver ray time. More...
 
int getSourceLayerId () const
 Return the layer containing the source position. More...
 
int getReceiverLayerId () const
 Return the layer containing the receiver position. More...
 
int getRadiusLayerId (double r) const
 Return the layer containing the input radius r. More...
 

Detailed Description

The primary layer search functional used by Brents zeroIn(...) function to find layers that contain a turning ray whose distance matches the distance between the source and receiver.

The objects operator()(double p) function finds the zero-in value at the input ray parameter p from

zero-in functional = tpzD - 2.0 * tpzRayLegDist + tpzRSrcSgn * tpzSrcLegDist + tpzRRcvrSgn * tpzRcvrLegDist;

for a bottoming ray or

zero-in functional = tpzd - tpzRSrcSgn * tpzSrcLegDist - tpzRRcvrSgn * tpzRcvrLegDist;

for an upgoing or downgoing ray.

where

tpzD = The input distance between source and receiver, tpzRayLegDist = 1/2 the integrated distance from planet surface to planet surface at the input ray parameter, tpzSrcLegDist = The integrated distance from planet surface to the source depth at the input ray parameter, tpzRcvrLegDist = The integrated distance from planet surface to the receiver depth at the input ray parameter, tpzRSrcSgn = The sign (+-1.0) of the source (-1.0 if the source is elevated above the planet surface). tpzRRcvrSgn = The sign (+-1.0) of the receiver (-1.0 if the receiver is elevated above the planet surface).

This function is called in TauPSite::calculateTravelTimes(...) to evaluate each layer as a possible solution for the input source to receiver distance tpzD.

Definition at line 150 of file TauPSiteFunctionals.h.

Constructor & Destructor Documentation

◆ TPZeroFunctional() [1/3]

taup::TPZeroFunctional::TPZeroFunctional ( )
inline

Default constructor.

Definition at line 157 of file TauPSiteFunctionals.h.

◆ TPZeroFunctional() [2/3]

taup::TPZeroFunctional::TPZeroFunctional ( TauPSite tps)
inline

Standard constructor. Assigns the TauPSite for this TPZeroFunctional.

Definition at line 169 of file TauPSiteFunctionals.h.

◆ TPZeroFunctional() [3/3]

taup::TPZeroFunctional::TPZeroFunctional ( const TPZeroFunctional tpzf)
inline

Copy constructor.

Definition at line 181 of file TauPSiteFunctionals.h.

◆ ~TPZeroFunctional()

virtual taup::TPZeroFunctional::~TPZeroFunctional ( )
inlinevirtual

Destructor.

Definition at line 200 of file TauPSiteFunctionals.h.

Member Function Documentation

◆ distance()

void taup::TPZeroFunctional::distance ( double  p)

The primary function of this object which calculates the ray travel distance between the source and the receiver positions as a function of the input ray parameter p. The entire surface-to-surface ray leg is evaluated in addition to the surface-to-source and surface-to-receiver legs.

◆ getDist()

double taup::TPZeroFunctional::getDist ( ) const
inline

Sets the search distance between the source and receiver.

Definition at line 413 of file TauPSiteFunctionals.h.

◆ getMinP()

double taup::TPZeroFunctional::getMinP ( )

Returns the minimum allowable ray parameter for a ray to transfer between the source and receiver depths.

◆ getPlanetRadius()

double taup::TPZeroFunctional::getPlanetRadius ( ) const
inline

Returns the planet radius (default to Earth = 6371.0 km)

Definition at line 348 of file TauPSiteFunctionals.h.

◆ getPTop()

double taup::TPZeroFunctional::getPTop ( ) const
inline

Gets the layer top ray parameter p for the current search layer.

Definition at line 426 of file TauPSiteFunctionals.h.

◆ getRadiusLayerId()

int taup::TPZeroFunctional::getRadiusLayerId ( double  r) const

Return the layer containing the input radius r.

◆ getRayDistance()

double taup::TPZeroFunctional::getRayDistance ( ) const
inline

Returns the surface-to-surface ray distance.

Definition at line 446 of file TauPSiteFunctionals.h.

◆ getRayTime()

double taup::TPZeroFunctional::getRayTime ( ) const
inline

Returns the surface-to-surface ray time.

Definition at line 449 of file TauPSiteFunctionals.h.

◆ getReceiverDepth()

double taup::TPZeroFunctional::getReceiverDepth ( ) const
inline

Returns the receiver depth.

Definition at line 400 of file TauPSiteFunctionals.h.

◆ getReceiverLayerId()

int taup::TPZeroFunctional::getReceiverLayerId ( ) const
inline

Return the layer containing the receiver position.

Definition at line 470 of file TauPSiteFunctionals.h.

◆ getReceiverLegDistance()

double taup::TPZeroFunctional::getReceiverLegDistance ( ) const
inline

Returns the surface-to-receiver ray distance.

Definition at line 458 of file TauPSiteFunctionals.h.

◆ getReceiverLegTime()

double taup::TPZeroFunctional::getReceiverLegTime ( ) const
inline

Returns the surface-to-receiver ray time.

Definition at line 464 of file TauPSiteFunctionals.h.

◆ getReceiverRadius()

double taup::TPZeroFunctional::getReceiverRadius ( ) const
inline

Returns the receiver radius.

Definition at line 388 of file TauPSiteFunctionals.h.

◆ getSourceDepth()

double taup::TPZeroFunctional::getSourceDepth ( ) const
inline

Returns the source depth.

Definition at line 374 of file TauPSiteFunctionals.h.

◆ getSourceLayerId()

int taup::TPZeroFunctional::getSourceLayerId ( ) const
inline

Return the layer containing the source position.

Definition at line 467 of file TauPSiteFunctionals.h.

◆ getSourceLegDistance()

double taup::TPZeroFunctional::getSourceLegDistance ( ) const
inline

Returns the surface-to-source ray distance.

Definition at line 452 of file TauPSiteFunctionals.h.

◆ getSourceLegTime()

double taup::TPZeroFunctional::getSourceLegTime ( ) const
inline

Returns the surface-to-source ray time.

Definition at line 455 of file TauPSiteFunctionals.h.

◆ getSourceRadius()

double taup::TPZeroFunctional::getSourceRadius ( ) const
inline

Returns the source radius.

Definition at line 362 of file TauPSiteFunctionals.h.

◆ getTauPSite()

TauPSite& taup::TPZeroFunctional::getTauPSite ( )
inline

Gets the TauPSite.

Definition at line 335 of file TauPSiteFunctionals.h.

◆ getTurningZero()

double taup::TPZeroFunctional::getTurningZero ( )
inline

Returns the turning leg zero evaluation from the last distance() function evaluation.

Definition at line 280 of file TauPSiteFunctionals.h.

◆ getUpGoingZero()

double taup::TPZeroFunctional::getUpGoingZero ( )
inline

Returns the upgoing leg zero evaluation from the last distance() function evaluation.

Definition at line 309 of file TauPSiteFunctionals.h.

◆ isTurningRayValid()

bool taup::TPZeroFunctional::isTurningRayValid ( )
inline

Returns true if the turning ray, receiver, and source legs are valid in the last distance() function call evaluation.

Definition at line 288 of file TauPSiteFunctionals.h.

◆ isTurningZero()

bool taup::TPZeroFunctional::isTurningZero ( )
inline

Returns true if the turning zero is set for return by the operator() function (tpzIsTurningZero is true).

Definition at line 273 of file TauPSiteFunctionals.h.

◆ isUpGoingRayValid()

bool taup::TPZeroFunctional::isUpGoingRayValid ( )
inline

Returns true if the upgoing receiver and source legs are valid in the last distance() function call evaluation.

Definition at line 318 of file TauPSiteFunctionals.h.

◆ isUpGoingZero()

bool taup::TPZeroFunctional::isUpGoingZero ( )
inline

Returns true if the upgoing zero is set for return by the operator() function (tpzIsTurningZero is false).

Definition at line 302 of file TauPSiteFunctionals.h.

◆ operator()()

double taup::TPZeroFunctional::operator() ( double  p)
inline

The function objects operator() definition which is used by a Brents::zeroIn(...) function to find the value of the ray parameter p that gives a source to receiver distance of tpzD.

Definition at line 240 of file TauPSiteFunctionals.h.

◆ operator=()

TPZeroFunctional& taup::TPZeroFunctional::operator= ( const TPZeroFunctional tpzf)
inline

Assignment operator.

Definition at line 205 of file TauPSiteFunctionals.h.

◆ setDist()

void taup::TPZeroFunctional::setDist ( double  d)
inline

Sets the search distance between the source and receiver.

Definition at line 406 of file TauPSiteFunctionals.h.

◆ setPlanetRadius()

void taup::TPZeroFunctional::setPlanetRadius ( double  pr)
inline

Sets the planet radius (default to Earth = 6371.0 km)

Definition at line 341 of file TauPSiteFunctionals.h.

◆ setPTop()

void taup::TPZeroFunctional::setPTop ( double  p)
inline

Sets the layer top ray parameter p for the current search layer.

Definition at line 419 of file TauPSiteFunctionals.h.

◆ setReceiverDepth()

void taup::TPZeroFunctional::setReceiverDepth ( double  d)
inline

Sets the receiver radius and sign from the input depth.

Definition at line 394 of file TauPSiteFunctionals.h.

◆ setReceiverRadius()

void taup::TPZeroFunctional::setReceiverRadius ( double  r)
inline

Sets the receiver radius and sign.

Definition at line 380 of file TauPSiteFunctionals.h.

◆ setSourceDepth()

void taup::TPZeroFunctional::setSourceDepth ( double  d)
inline

Sets the source radius and sign from the input depth.

Definition at line 368 of file TauPSiteFunctionals.h.

◆ setSourceRadius()

void taup::TPZeroFunctional::setSourceRadius ( double  r)
inline

Sets the source radius and sign.

Definition at line 354 of file TauPSiteFunctionals.h.

◆ setTauPSite()

void taup::TPZeroFunctional::setTauPSite ( TauPSite tps)
inline

Sets the TauPSite.

Definition at line 328 of file TauPSiteFunctionals.h.

◆ setTurningZero()

void taup::TPZeroFunctional::setTurningZero ( )
inline

Sets the turning zero for the operator() function (tpzIsTurningZero is set to true).

Definition at line 266 of file TauPSiteFunctionals.h.

◆ setUpGoingZero()

void taup::TPZeroFunctional::setUpGoingZero ( )
inline

Sets the upgoing zero for the operator() function (tpzIsTurningZero is set to false).

Definition at line 295 of file TauPSiteFunctionals.h.

◆ time()

double taup::TPZeroFunctional::time ( double  p)

Calculates the travel time between the source and receiver for the current layer at the zero in ray parameter value p. This function is only called once the zero in functional determines the critical ray parameter that gives a source to receiver distance equal to tpzD.


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