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

Constant velocity model returns a single value for velocity irregardless of the input radius value. This object overrides the numerical distance and time integration with analytic definitions. More...

#include <TPVelocityModels.h>

Inheritance diagram for taup::VelocityConst:
taup::VelocityIntegrate< VelocityConst > taup::TPVelocityLayer

Public Member Functions

 VelocityConst ()
 Default constructor. Sets velocity to zero. More...
 
 VelocityConst (double c, double rt, double rb, const string &layrnam="")
 Standard constructor. Sets velocity to c. More...
 
 VelocityConst (const VelocityConst &vcst)
 Copy constructor. More...
 
 VelocityConst (DataBuffer &buffer)
 DataBuffer constructor. More...
 
virtual ~VelocityConst ()
 Destructor. More...
 
VelocityConstoperator= (const VelocityConst &vcst)
 Assignment Operator. More...
 
virtual double operator() (double r)
 
virtual double rAtP (double p)
 
virtual double integrateDistance (double p, double ra, bool r_open=false)
 The analytic constant velocity distance integration function that calculates the ray travel distance from the start of the layer boundary (vlRt) to depth r given the input ray parameter p. More...
 
virtual double integrateDistance (double p, double ra, double rb, bool r_open=false)
 The analytic constant velocity distance integration function that calculates the ray travel distance from the start of the layer boundary (vlRt) to depth r given the input ray parameter p. More...
 
virtual double integrateTime (double p, double ra)
 The analytic constant velocity time integration function that calculates the ray travel time from the start of the layer boundary (vlRt) to depth r given the input ray parameter p. More...
 
virtual double integrateTime (double p, double ra, double rb)
 The analytic constant velocity time integration function that calculates the ray travel time from the start of the layer boundary (vlRt) to depth r given the input ray parameter p. More...
 
virtual bool isTimeIntegralTau () const
 The constant velocity time integral returns time and not tau. More...
 
virtual void writeVelocity (ostream &os) const
 Writes the velocity definition to the input stream os. More...
 
virtual void toStream (ostream &os, string indent) const
 Print object data to input stream os. More...
 
virtual string get_class_name () const
 Virtual function that returns the class name. More...
 
virtual int classSize () const
 Returns the class size. More...
 
virtual bool isVelocityConstant () const
 Virtual function that returns true for a Constant model. More...
 
virtual int bufferSize () const
 Returns the size of a DataBuffer required to contain all serialized information for a VelocityConst object. More...
 
virtual void serialize (DataBuffer &buffer)
 Writes the content of the VelocityConst object into the input DataBuffer buffer. More...
 
virtual void deserialize (DataBuffer &buffer)
 Reads the content of the VelocityConst object from the input DataBuffer buffer. More...
 
- Public Member Functions inherited from taup::VelocityIntegrate< VelocityConst >
 VelocityIntegrate ()
 Default constructor. Sets top radius to zero. More...
 
 VelocityIntegrate (double rt, double rb, const string &layrnam)
 Standard constructor. Sets top radius to rt. More...
 
 VelocityIntegrate (const VelocityIntegrate &vi)
 Copy constructor. More...
 
virtual ~VelocityIntegrate ()
 Destructor. More...
 
VelocityIntegrateoperator= (const VelocityIntegrate &vi)
 Assignment Operator. More...
 
void setIntegTolerance (double tol)
 Sets the integration tolerance limit for this velocity layer. If the integration objects are not yet instantiated this function will create them before setting their tolerance. More...
 
- Public Member Functions inherited from taup::TPVelocityLayer
 TPVelocityLayer ()
 Default constructor. Sets top and bottom layer radius to zero. More...
 
 TPVelocityLayer (double rt, double rb, const string &layrnam)
 
 TPVelocityLayer (const TPVelocityLayer &vl)
 Copy constructor. More...
 
virtual ~TPVelocityLayer ()
 Destructor. More...
 
TPVelocityLayeroperator= (const TPVelocityLayer &vl)
 Assignment Operator. More...
 
void init ()
 Initializes the velocity layer evaluating vlVt, vlVb, vlPt, and vlPb;. More...
 
virtual void writeNormRadius (ostream &os) const
 Used to write the normalized radius parameter (if defined) to a CLR output stream os. More...
 
double pAtR (double r)
 
double integDistance (double p, double r=-1.0)
 The distance integration function which gives the distance of the ray travel from the surface of the Earth to the ray turning depth as a function of the ray parameter p (slowness). The integration terminates before the turning depth if the radius r is positive. More...
 
double integDistance (double p, double r1, double r2)
 The distance integration function which gives the distance of the ray travel from radius r1 to radius r2 as a function of the ray parameter p (slowness). The integration terminates at the turning depth if that occurs before reaching r2. More...
 
double integTime (double p, double r=-1.0)
 The time integration function which gives the time of the ray travel from the surface of the Earth to the ray turning depth as a function of the ray parameter p (slowness). The integration terminates before the turning depth if the radius r is positive. More...
 
double integTime (double p, double r1, double r2)
 The time integration function which gives the time of the ray travel from radius r1 to radius r2 as a function of the ray parameter p (slowness). The integration terminates at the turning depth if that occurs before reaching r2. More...
 
double getRt () const
 Returns the top of the layer radius. More...
 
double getRb () const
 Returns the bottom of the layer radius. More...
 
double getVt () const
 Returns the top of the layer velocity. More...
 
double getVb () const
 Returns the bottom of the layer velocity. More...
 
double getPt () const
 Returns the top of the layer ray parameter (slowness). More...
 
double getPb () const
 Returns the bottom of the layer ray parameter (slowness). More...
 
double getTurningRadius () const
 
double getTurningVelocity () const
 
void setPmin (double pmin)
 Sets the minimum ray parameter for the layer. If less than getPt() then the top half of the layer is shadowed. More...
 
double getPmin () const
 Returns the minimum passing ray parameter for the layer. if less than getPt() then the top half of the layer is shadowed. More...
 
void setDistT (double d)
 Sets the accumulated distance through all layers upto the top of this layer given a ray parameter of vlPt() or vlPmin(), whichever is smaller. More...
 
double getDistT () const
 Returns the accumulated distance through all layers upto the top of this layer given a ray parameter of vlPt() or vlPmin(), whichever is smaller. More...
 
void setDistB (double d)
 Sets the accumulated distance through all layers including this one given a ray parameter of vlPb() or vlPmin(), whichever is smaller. More...
 
double getDistB () const
 Returns the accumulated distance through all layers including this one given a ray parameter of vlPb() or vlPmin(), whichever is smaller. More...
 
void setdDistdPT (double dDdP)
 Sets the derivative of the distance wrt. the ray parameter at the top of the layer. More...
 
double getdDistdPT () const
 Returns the derivative of the distance wrt. the ray parameter at the top of the layer. More...
 
void setdDistdPB (double dDdP)
 Sets the derivative of the distance wrt. the ray parameter at the bottom of the layer. More...
 
double getdDistdPB () const
 Returns the derivative of the distance wrt. the ray parameter at the bottom of the layer. More...
 
void setLayerType (int lt)
 
int getLayerType () const
 
const string & getLayerName () const
 Returns the descriptive layer name. More...
 
void setPhaseTypeP ()
 Sets the layer phase type to "P". More...
 
void setPhaseTypeS ()
 Sets the layer phase type to "S". More...
 
void setPhaseType (const string &phtype)
 Sets the layer phase type to phtype. More...
 
const string & getPhaseType () const
 Returns the layer phase type string. More...
 
void setPhaseName (const string &name)
 Sets the layer default phase name. More...
 
const string & getPhaseName () const
 Returns the layer default phase name. More...
 
void setPhaseNameUpper (const string &name)
 Sets the upper phase name if the layer is a retrograde layer. More...
 
const string & getPhaseNameUpper () const
 Returns the upper phase name if the layer is a retrograde layer. More...
 
void setPhaseNameLower (const string &name)
 Sets the lower phase name if the layer is a retrograde layer. More...
 
const string & getPhaseNameLower () const
 Returns the lower phase name if the layer is a retrograde layer. More...
 
void setPhaseNameDiff (const string &name)
 Sets the upper interface phase name. More...
 
const string & getPhaseNameDiff () const
 Returns the upper interface phase name if assigned. More...
 
void setPhaseNameDiffLower (const string &name)
 Sets the lower interface phase name. More...
 
const string & getPhaseNameDiffLower () const
 Returns the lower interface phase name if assigned. More...
 
void setPhaseDiffDef (bool def)
 Sets the upper diffracted wave phase for this layer to true even if it has no formal phase name definition. This will default to use the default evaluated names of X::i+ where # is the layer # and X is "P" or "S". More...
 
void setPhaseDiffLowerDef (bool def)
 Sets the lower diffracted wave phase for this layer to true even if it has no formal phase name definition. This will default to use the default evaluated names of X::i- where # is the layer # and X is "P" or "S". More...
 
bool isPhaseDiffDefined () const
 Returns true if the upper diffracted phase is defined for this layer. More...
 
bool isPhaseDiffLowerDefined () const
 Returns true if the lower diffracted phase is defined for this layer. More...
 
double getPCrit () const
 
double getDistCrit () const
 
bool isSplitLayer () const
 Returns true if the layer is a retrograde layer. More...
 
void setSplitLayer (double pcrit, double dcrit)
 Sets the layers retrograde parameters if the layer was found to contain a retrograde minimum. More...
 
bool invalidRay () const
 Returns true if the last evaluated ray parameter was unable to pass through this layer. More...
 
bool passingRay () const
 Returns true if the last evaluated ray parameter passed through this layer. More...
 
bool turningRay () const
 Returns true if the last evaluated ray parameter produced a turning ray in this layer. More...
 
string toString () const
 Print object data to string. More...
 
virtual bool isVelocityPowerLaw () const
 
virtual bool isVelocityLinear () const
 
virtual bool isVelocityQuadratic () const
 
virtual bool isVelocityCubic () const
 

Static Public Member Functions

static string class_name ()
 Static function that returns the class name. More...
 
- Static Public Member Functions inherited from taup::TPVelocityLayer
static TPVelocityLayernewModelCopy (TPVelocityLayer *tpvl)
 TPVelocityLayer factory method that returns a new TPVelocityLayer object copied from the input object tpvl. More...
 
static TPVelocityLayernewModelCopy (const string &cnam, DataBuffer &buffer)
 TPVelocityLayer factory method that returns a new TPVelocityLayer object of derived type name, /em cnam. The data used to define the layer is given in the DataBuffer buffer. More...
 
static string class_name ()
 Static function that returns the class name. More...
 

Additional Inherited Members

- Protected Member Functions inherited from taup::VelocityIntegrate< VelocityConst >
void createNumericObjects (VelocityConst &v)
 Used to create the distance and tau integrand functions vmDist, and vmTau, and their associated integration objects vmDistNI and vmTauNI. More...
 
- Protected Member Functions inherited from taup::TPVelocityLayer
void setRay (double p)
 Sets the ray as invalid, passing, or turning given an input ray parameter p. This function also sets the turning radius and velocity (vlRTurn and vlVTurn). More...
 
void setUpDownRay (double p, double r1, double r2)
 Sets the upgoing / downgoing flags for an integration between r1 and r2 for the input ray parameter p. If the ray turns between r1 and r2 in the layer, or the ray parameter is larger than the largest ray parameter evaluated at r1 and r2, or the r2 > r1 then the invalid ray flag is set. More...
 
- Protected Attributes inherited from taup::VelocityIntegrate< VelocityConst >
TPdDistdr< VelocityConst > * vmDist
 The distance integrand object templated on the velocity. More...
 
TPdTaudr< VelocityConst > * vmTau
 The tau integrand object templated on the velocity. More...
 
util::IntegrateFunction< TPdDistdr< VelocityConst > > * vmDistNI
 The numerical integration object templated on vmDist. More...
 
util::IntegrateFunction< TPdTaudr< VelocityConst > > * vmTauNI
 The numerical integration object templated on vmTau. More...
 
- Protected Attributes inherited from taup::TPVelocityLayer
string vlLayerName
 The descriptive name of the velocity layer. More...
 
string vlPhaseType
 The phase type name ... either "P" or "S". More...
 
string vlPhase
 The phase name of a ray that turns in the layer. This name is optional and used to define the phase unless overidden by vlPhaseUpper or vlPhaseLower for retrograde layers. More...
 
string vlPhaseUpper
 The name of the phase for a ray that turns in the top half of a retro-grade layer. This name is optional and only used if assigned to a retrograde layer. More...
 
string vlPhaseLower
 The name of the phase for a ray that turns in the bottom half of a retro-grade layer. This name is optional and only used if assigned to a retrograde layer. More...
 
string vlPhaseIUpper
 The name of the diffracted phase for a ray that bottoms in the layer and uses the layers bottom velocity to travel along the layer boundary. This name is optional and only required if the phase is to be supported. More...
 
string vlPhaseILower
 The name of the diffracted phase of a ray that bottoms in the layer and uses the next layers top velocity to travel along the layer boundary. This name is optional and only required if the phase is to be supported. More...
 
int vlLayerType
 An integer value that describes the layer type. More...
 
bool vlSplitLayer
 Boolean flag that is true if the velocity layer is a retrograde layer. More...
 
bool vlInvalidRay
 Boolean flag that is true if the last distance / time evaluation for this velocity layer was invalid. More...
 
bool vlPassingRay
 Boolean flag that is true if the last distance / time evaluation for this velocity layer was a passing ray. More...
 
bool vlTurningRay
 Boolean flag that is true if the last distance / time evaluation for this velocity layer was a turning ray. More...
 
bool vlPhaseUpperIDef
 Set to true if the upper diffracted phase for this layer is to be evaluated. More...
 
bool vlPhaseLowerIDef
 Set to true if the lower diffracted phase for this layer is to be evaluated. More...
 
double vlRt
 The layer top radius. More...
 
double vlRb
 The layer bottom radius. More...
 
double vlIRt
 The last integration top radius for this layer. More...
 
double vlIRb
 The last integration bottom radius for this layer. More...
 
double vlVt
 The layer top velocity. More...
 
double vlVb
 The layer bottom velocity. More...
 
double vlPt
 The layer top ray parameter (vlRt / vlVt). More...
 
double vlPb
 The layer bottom ray parameter (vlRb / vlVb). More...
 
double vlRTurn
 
double vlVTurn
 
double vlRLast
 Contains the last evaluated turning depth (or vlRb). More...
 
double vlDistT
 The integrated distance to the top of the layer using the top ray parameter (vlPt or vlPmin if the layer is partially shadowed). More...
 
double vlDistB
 The integrated distance to the bottom of the layer using the bottom ray parameter (vlPb or vlPmin if the layer is partially shadowed). More...
 
double vldDistdP_T
 The derivative of distance wrt. the ray parameter at the top of the layer. More...
 
double vldDistdP_B
 The derivative of distance wrt. the ray parameter at the bottom of the layer. More...
 
double vlPmin
 The minimum allowed valid ray parameter that marks a passing limit in the layer. If vlPmin >= vlPt then all rays can penentrate the layer. If vlPMin < vlPb then the layer is a shadow layer and only passing rays (p < vlPb) can pass. If in between then vlPmin marks the boundary where a valid turning ray is allowed and a bounding shadow region exists above or below vlPmin. More...
 
double vlPCrit
 The ray parameter that gives the distance minimum of a retrograde layer. If the layer is not retrograde this value is ignored. More...
 
double vlDistCrit
 The distance to the minimum of the retrograde layer if the layer is retrograde. Otherwise ignored. More...
 
- Static Protected Attributes inherited from taup::VelocityIntegrate< VelocityConst >
static const double vmIntegTol
 The default integration tolerance. More...
 

Detailed Description

Constant velocity model returns a single value for velocity irregardless of the input radius value. This object overrides the numerical distance and time integration with analytic definitions.

Definition at line 1327 of file TPVelocityModels.h.

Constructor & Destructor Documentation

◆ VelocityConst() [1/4]

taup::VelocityConst::VelocityConst ( )
inline

Default constructor. Sets velocity to zero.

Definition at line 1334 of file TPVelocityModels.h.

◆ VelocityConst() [2/4]

taup::VelocityConst::VelocityConst ( double  c,
double  rt,
double  rb,
const string &  layrnam = "" 
)
inline

Standard constructor. Sets velocity to c.

Definition at line 1337 of file TPVelocityModels.h.

◆ VelocityConst() [3/4]

taup::VelocityConst::VelocityConst ( const VelocityConst vcst)
inline

Copy constructor.

Definition at line 1341 of file TPVelocityModels.h.

◆ VelocityConst() [4/4]

taup::VelocityConst::VelocityConst ( DataBuffer buffer)
inline

DataBuffer constructor.

Definition at line 1345 of file TPVelocityModels.h.

◆ ~VelocityConst()

virtual taup::VelocityConst::~VelocityConst ( )
inlinevirtual

Destructor.

Definition at line 1348 of file TPVelocityModels.h.

Member Function Documentation

◆ bufferSize()

virtual int taup::VelocityConst::bufferSize ( ) const
inlinevirtual

Returns the size of a DataBuffer required to contain all serialized information for a VelocityConst object.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1450 of file TPVelocityModels.h.

◆ class_name()

static string taup::VelocityConst::class_name ( )
inlinestatic

Static function that returns the class name.

Definition at line 1436 of file TPVelocityModels.h.

◆ classSize()

virtual int taup::VelocityConst::classSize ( ) const
inlinevirtual

Returns the class size.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1442 of file TPVelocityModels.h.

◆ deserialize()

virtual void taup::VelocityConst::deserialize ( DataBuffer buffer)
inlinevirtual

Reads the content of the VelocityConst object from the input DataBuffer buffer.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1465 of file TPVelocityModels.h.

◆ get_class_name()

virtual string taup::VelocityConst::get_class_name ( ) const
inlinevirtual

Virtual function that returns the class name.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1439 of file TPVelocityModels.h.

◆ integrateDistance() [1/2]

virtual double taup::VelocityConst::integrateDistance ( double  p,
double  ra,
bool  r_open = false 
)
inlinevirtual

The analytic constant velocity distance integration function that calculates the ray travel distance from the start of the layer boundary (vlRt) to depth r given the input ray parameter p.

This function overrides the numerical version and ignores the input parameter r_open.

Reimplemented from taup::VelocityIntegrate< VelocityConst >.

Definition at line 1379 of file TPVelocityModels.h.

◆ integrateDistance() [2/2]

virtual double taup::VelocityConst::integrateDistance ( double  p,
double  ra,
double  rb,
bool  r_open = false 
)
inlinevirtual

The analytic constant velocity distance integration function that calculates the ray travel distance from the start of the layer boundary (vlRt) to depth r given the input ray parameter p.

This function overrides the numerical version and ignores the input parameter r_open.

Reimplemented from taup::VelocityIntegrate< VelocityConst >.

Definition at line 1391 of file TPVelocityModels.h.

◆ integrateTime() [1/2]

virtual double taup::VelocityConst::integrateTime ( double  p,
double  ra 
)
inlinevirtual

The analytic constant velocity time integration function that calculates the ray travel time from the start of the layer boundary (vlRt) to depth r given the input ray parameter p.

This function overrides the numerical version.

Reimplemented from taup::VelocityIntegrate< VelocityConst >.

Definition at line 1408 of file TPVelocityModels.h.

◆ integrateTime() [2/2]

virtual double taup::VelocityConst::integrateTime ( double  p,
double  ra,
double  rb 
)
inlinevirtual

The analytic constant velocity time integration function that calculates the ray travel time from the start of the layer boundary (vlRt) to depth r given the input ray parameter p.

This function overrides the numerical version.

Reimplemented from taup::VelocityIntegrate< VelocityConst >.

Definition at line 1418 of file TPVelocityModels.h.

◆ isTimeIntegralTau()

virtual bool taup::VelocityConst::isTimeIntegralTau ( ) const
inlinevirtual

The constant velocity time integral returns time and not tau.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1427 of file TPVelocityModels.h.

◆ isVelocityConstant()

virtual bool taup::VelocityConst::isVelocityConstant ( ) const
inlinevirtual

Virtual function that returns true for a Constant model.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1446 of file TPVelocityModels.h.

◆ operator()()

virtual double taup::VelocityConst::operator() ( double  r)
inlinevirtual

Standard operator() overload which returns the velocity at radius r. The radius is defined from the center of the Earth. For a constant velocity the same value is returned regardless of r.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1364 of file TPVelocityModels.h.

◆ operator=()

VelocityConst& taup::VelocityConst::operator= ( const VelocityConst vcst)
inline

Assignment Operator.

Definition at line 1353 of file TPVelocityModels.h.

◆ rAtP()

virtual double taup::VelocityConst::rAtP ( double  p)
inlinevirtual

Standard function that returns the radius as function of the turning ray parameter p. The turning ray parameter is defined as p = r / v(r) where v(r) is the radial velocity

Reimplemented from taup::TPVelocityLayer.

Definition at line 1371 of file TPVelocityModels.h.

◆ serialize()

virtual void taup::VelocityConst::serialize ( DataBuffer buffer)
inlinevirtual

Writes the content of the VelocityConst object into the input DataBuffer buffer.

Reimplemented from taup::TPVelocityLayer.

Definition at line 1457 of file TPVelocityModels.h.

◆ toStream()

virtual void taup::VelocityConst::toStream ( ostream &  os,
string  indent 
) const
virtual

Print object data to input stream os.

Reimplemented from taup::TPVelocityLayer.

◆ writeVelocity()

virtual void taup::VelocityConst::writeVelocity ( ostream &  os) const
virtual

Writes the velocity definition to the input stream os.

Reimplemented from taup::TPVelocityLayer.


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