RSTT
3.1.0
Regional Seismic Travel Time
|
Go to the documentation of this file.
38 #ifndef TPVELOCITYMODELS_H
39 #define TPVELOCITYMODELS_H
59 using namespace geotess;
70 class TPVelocityLayer;
74 class VelocityQuadratic;
131 double pv = diP * diV(r);
132 double d = fabs(r - pv) * (r + pv);
134 return 1.0 / sqrt(DBL_EPSILON * (r + pv));
136 return pv / r / sqrt(d);
140 void setP(
double p) {diP = p;};
204 double pv = tiP * vr;
206 return sqrt(fabs(r - pv) * (r + pv)) / r / vr;
210 void setP(
double p) {tiP = p;};
272 vlPt(-1.0), vlPb(-1.0), vlRLast(-1.0),
273 vlDistT(0.0), vlDistB(0.0), vlIRt(0.0), vlIRb(0.0),
274 vlPmin(-1.0), vlLayerType(-1),
275 vlPCrit(-1.0), vlRTurn(-1.0), vlDistCrit(-1.0),
276 vlSplitLayer(false), vlInvalidRay(false),
277 vlPassingRay(false), vlTurningRay(false),
278 vldDistdP_T(0.0), vldDistdP_B(0.0), vlVTurn(-1.0),
279 vlPhaseUpperIDef(false), vlPhaseLowerIDef(false),
282 vlPhase = vlPhaseUpper = vlPhaseLower = vlPhaseType=
"";
283 vlPhaseIUpper = vlPhaseILower =
"";
289 vlRt(rt), vlRb(rb), vlVt(-1.0), vlVb(-1.0),
290 vlPt(-1.0), vlPb(-1.0), vlRLast(-1.0),
291 vlDistT(0.0), vlDistB(0.0), vlIRt(0.0), vlIRb(0.0),
292 vldDistdP_T(0.0), vldDistdP_B(0.0), vlRTurn(-1.0),
293 vlPmin(-1.0), vlLayerType(-1), vlPCrit(-1.0),
294 vlDistCrit(-1.0), vlSplitLayer(false), vlVTurn(-1.0),
295 vlInvalidRay(false), vlPassingRay(false),
296 vlPhaseUpperIDef(false), vlPhaseLowerIDef(false),
297 vlTurningRay(false), vlLayerName(layrnam)
299 vlPhase = vlPhaseUpper = vlPhaseLower = vlPhaseType =
"";
300 vlPhaseIUpper = vlPhaseILower =
"";
305 vlVt(vl.vlVt), vlVb(vl.vlVb), vlPt(vl.vlPt), vlPb(vl.vlPb),
306 vlRLast(vl.vlRLast), vlIRt(vl.vlIRt), vlIRb(vl.vlIRb),
307 vlDistT(vl.vlDistT), vlDistB(vl.vlDistB),
308 vldDistdP_T(vl.vldDistdP_T), vldDistdP_B(vl.vldDistdP_B),
309 vlInvalidRay(vl.vlInvalidRay), vlRTurn(vl.vlRTurn),
310 vlPmin(vl.vlPmin), vlLayerType(vl.vlLayerType),
311 vlPCrit(vl.vlPCrit), vlDistCrit(vl.vlDistCrit),
312 vlSplitLayer(vl.vlSplitLayer), vlVTurn(vl.vlVTurn),
313 vlPassingRay(vl.vlPassingRay),
314 vlTurningRay(vl.vlTurningRay), vlLayerName(vl.vlLayerName),
315 vlPhase(vl.vlPhase), vlPhaseUpper(vl.vlPhaseUpper),
316 vlPhaseLower(vl.vlPhaseLower), vlPhaseType(vl.vlPhaseType),
317 vlPhaseIUpper(vl.vlPhaseIUpper),
318 vlPhaseUpperIDef(vl.vlPhaseUpperIDef),
319 vlPhaseLowerIDef(vl.vlPhaseLowerIDef),
320 vlPhaseILower(vl.vlPhaseILower)
381 vlVt = operator()(vlRt);
382 vlVb = operator()(vlRb);
409 virtual double rAtP(
double p) = ABSTRACT;
414 double pAtR(
double r) {
return r / operator()(r);};
434 bool tflg = vlTurningRay;
435 if ((r != -1.0) && (r > vlRTurn))
444 dist = integrateDistance(p, rb, tflg);
462 setUpDownRay(p, r1, r2);
464 dist = integrateDistance(p, vlIRb, vlIRt, vlTurningRay);
465 else if (vlTurningRay)
466 dist = integrateDistance(p, vlRTurn, vlIRt,
true);
483 double d = integDistance(p, r);
488 tim = integrateTime(p, vlRLast);
489 if (isTimeIntegralTau()) tim += p * d;
505 setUpDownRay(p, r1, r2);
509 else if (vlTurningRay)
514 tim = integrateTime(p, r, vlIRt);
515 if (isTimeIntegralTau()) tim += p * integrateDistance(p, r, vlIRt);
531 bool r_open =
false) = ABSTRACT;
544 bool r_open =
false) = ABSTRACT;
557 double rb) = ABSTRACT;
565 double getRt()
const {
return vlRt;};
568 double getRb()
const {
return vlRb;};
571 double getVt()
const {
return vlVt;};
574 double getVb()
const {
return vlVb;};
577 double getPt()
const {
return vlPt;};
580 double getPb()
const {
return vlPb;};
663 {vlPhaseType = phtype;};
676 {vlPhaseUpper = name;};
683 {vlPhaseLower = name;};
690 {vlPhaseIUpper = name;};
697 {vlPhaseILower = name;};
707 {vlPhaseUpperIDef = def;};
714 {vlPhaseLowerIDef = def;};
718 {
return vlPhaseUpperIDef;};
722 {
return vlPhaseLowerIDef;};
761 virtual void toStream(ostream& os,
string indent)
const;
785 int bs = (int) vlLayerName.size() + (int) vlPhaseType.size() +
786 (int) vlPhase.size() + (int) vlPhaseUpper.size() +
787 (int) vlPhaseLower.size() + (int) vlPhaseIUpper.size() +
788 (int) vlPhaseILower.size() + 14 *
sizeof(int);
789 bs += 2 *
sizeof(int) + 3 *
sizeof(
char) + 16 *
sizeof(double);
844 vlPhaseUpperIDef = buffer.
readByte();
845 vlPhaseLowerIDef = buffer.
readByte();
871 vlInvalidRay = vlPassingRay = vlTurningRay =
false;
900 vlVTurn = operator()(vlRTurn);
919 vlPassingRay = vlTurningRay =
false;
924 if ((r2 < vlRt) && (r1 > vlRb))
929 if (r1 < vlRt) rtt = r1;
934 if (r2 > vlRb) rbb = r2;
938 double ptt = pAtR(rtt);
939 double pbb = pAtR(rbb);
958 vlInvalidRay =
false;
965 vlVTurn = operator()(vlRTurn);
970 if (p == pmin) vlInvalidRay =
false;
1162 vmDist(NULL), vmTau(NULL),
1163 vmDistNI(NULL), vmTauNI(NULL),
1168 vmDist(NULL), vmTau(NULL),
1205 TPVelocityLayer::operator=(vi);
1222 bool r_open =
false)
1226 if (!vmDist) createNumericObjects(*((V*)
this));
1232 return vmDistNI->integrateAOpenS(ra, rb);
1234 return vmDistNI->integrateClosed(ra, rb);
1247 bool r_open =
false)
1249 return integrateDistance(p, ra, vlRt, r_open);
1261 if (!vmTau) createNumericObjects(*((V*)
this));
1267 return vmTauNI->integrateAOpenS(ra, rb);
1269 return vmTauNI->integrateClosed(ra, rb);
1279 return integrateTime(p, ra, vlRt);
1289 if (!vmDist) createNumericObjects(*((V*)
this));
1293 vmDistNI->setTolerance(tol);
1294 vmTauNI->setTolerance(tol);
1371 virtual double rAtP(
double p) {
return p * vc;};
1380 bool r_open =
false)
1382 return integrateDistance(p, ra, vlRt, r_open);
1392 bool r_open =
false)
1394 if (vc == 0.0)
return 0.0;
1397 double prt = pv / rb;
1398 double prb = pv / ra;
1400 return asin(min(prb, 1.0)) - asin(min(prt, 1.0));
1410 return integrateTime(p, ra, vlRt);
1420 if (vc == 0.0)
return 0.0;
1421 double pt = rb / vc;
1422 double pr = ra / vc;
1423 return sqrt(fabs(pt - p) * (pt + p)) - sqrt(fabs(pr - p) * (pr + p));
1433 virtual void toStream(ostream& os,
string indent)
const;
1452 return 2 *
sizeof(double) + TPVelocityLayer::bufferSize();
1460 TPVelocityLayer::serialize(buffer);
1468 TPVelocityLayer::deserialize(buffer);
1499 const string& layrnam =
"") :
1503 vpB = log(vb / vt) / log(vlRb / vlRt);
1510 vp0(vp.vp0), vp1(vp.vp1), vp1_B(vp.vp1_B),
1538 return vp0 * pow(r / vlRt, vpB);
1548 return pow(p * vp0 * pow(1.0 / vlRt, vpB), 1.0 / vp1_B);
1552 double B()
const {
return vpB;};
1561 bool r_open =
false)
1563 double pva = p * operator()(ra);
1564 double pvb = p * vlVt;
1565 return (asin(min(pva / ra, 1.0)) - asin(min(pvb / vlRt, 1.0))) / vp1_B;
1575 bool r_open =
false)
1577 double pva = p * operator()(ra);
1578 double pvb = p * operator()(rb);
1579 return (asin(min(pva / ra, 1.0)) - asin(min(pvb / rb, 1.0))) / vp1_B;
1589 double prb = vlRt / vlVt;
1590 double pra = ra / operator()(ra);
1591 return (sqrt(fabs(prb - p) * (prb + p)) -
1592 sqrt(fabs(pra - p) * (pra + p))) / vp1_B;
1602 double pra = ra / operator()(ra);
1603 double prb = rb / operator()(rb);
1605 return (sqrt(fabs(pra - p) * (pra + p)) -
1606 sqrt(fabs(prb - p) * (prb + p))) / vp1_B;
1616 virtual void toStream(ostream& os,
string indent)
const;
1635 return 5 *
sizeof(double) + TPVelocityLayer::bufferSize();
1646 TPVelocityLayer::serialize(buffer);
1657 TPVelocityLayer::deserialize(buffer);
1698 const string& layrnam =
"",
double normradius = 1.0) :
1699 va0(a0), va1(a1), vNormRadius(normradius),
1721 vNormRadius = vl.vNormRadius;
1730 double rn = r / vNormRadius;
1731 return va1 * rn + va0;
1741 return (p * va0) / (1 - p * va1 / vNormRadius);
1751 bool r_open =
false)
1753 double v1, pv, pv1, pv0, rslt, a, b, c;
1758 v1 = va1 / vNormRadius;
1759 pv = p * (va0 + v1 * r) / r;
1764 pv = p * vlVt / vlRt;
1778 double arg = (c * r + b) / pv0;
1780 rslt += pv1 * (PI / 2.0 - asin((c * vlRt + b) / pv0)) / sqrt(-c);
1782 rslt += pv1 * (asin(arg) - asin((c * vlRt + b) / pv0)) / sqrt(-c);
1786 rslt += sqrt(-2.0 * v1 * r / va0 - 1.0) -
1787 sqrt(-2.0 * v1 * vlRt / va0 - 1.0);
1791 b = - 2.0 * pv0 * pv1;
1794 double sc = sqrt(c);
1795 double Rrt = a + vlRt * (b + c * vlRt);
1796 double Rr = a + r * (b + c * r);
1797 rslt += pv1 * (log(2.0 * sc * sqrt(fabs(Rrt)) + 2.0 * c * vlRt + b) -
1798 log(2.0 * sc * sqrt(fabs(Rr)) + 2.0 * c * r + b)) / sc;
1813 bool r_open =
false)
1815 double v1, pv, pv1, pv0, rslt, a, b, c;
1820 v1 = va1 / vNormRadius;
1821 pv = p * (va0 + v1 * ra) / ra;
1827 pv = p * (va0 + v1 * rb) / rb;
1844 double arg = (c * ra + b) / pv0;
1846 rslt += pv1 * (PI / 2.0 - asin((c * rb + b) / pv0)) / sqrt(-c);
1848 rslt += pv1 * (asin(arg) - asin((c * rb + b) / pv0)) / sqrt(-c);
1852 rslt += sqrt(-2.0 * v1 * ra / va0 - 1.0) -
1853 sqrt(-2.0 * v1 * rb / va0 - 1.0);
1857 b = - 2.0 * pv0 * pv1;
1860 double sc = sqrt(c);
1861 double Rrb = a + rb * (b + c * rb);
1862 double Rra = a + ra * (b + c * ra);
1863 rslt += pv1 * (log(2.0 * sc * sqrt(fabs(Rrb)) + 2.0 * c * rb + b) -
1864 log(2.0 * sc * sqrt(fabs(Rra)) + 2.0 * c * ra + b)) / sc;
1879 virtual void toStream(ostream& os,
string indent)
const;
1898 return 4 *
sizeof(double) + TPVelocityLayer::bufferSize();
1908 TPVelocityLayer::serialize(buffer);
1918 TPVelocityLayer::deserialize(buffer);
1954 const string& layrnam =
"",
double normradius = 1.0) :
1955 va0(a0), va1(a1), va2(a2), vNormRadius(normradius),
1960 va0(vq.va0), va1(vq.va1), va2(vq.va2),
1979 vNormRadius = vq.vNormRadius;
1988 double rn = r / vNormRadius;
1989 return va0 + rn * (va1 + rn * va2);
2001 if (p == 0.0)
return 0.0;
2006 double a = p * va2 / vNormRadius / vNormRadius;
2007 double b = p * va1 / vNormRadius - 1.0;
2013 double sqarg = b * b - 4.0 * a * c;
2019 else if (sqarg == 0.0)
2023 return -b / 2.0 / a;
2029 double cc = 2.0 * a;
2030 double aa = -b / cc;
2031 double sq = sqrt(sqarg) / cc;
2032 double r1 = aa - sq;
2033 if ((r1 <= vlRt) && (r1 >= vlRb))
2047 virtual void toStream(ostream& os,
string indent)
const;
2066 return 5 *
sizeof(double) + TPVelocityLayer::bufferSize();
2077 TPVelocityLayer::serialize(buffer);
2088 TPVelocityLayer::deserialize(buffer);
2129 double rt,
double rb,
const string& layrnam =
"",
2130 double normradius = 1.0) :
2131 va0(a0), va1(a1), va2(a2), va3(a3), vNormRadius(normradius),
2136 va0(vc.va0), va1(vc.va1), va2(vc.va2), va3(vc.va3),
2156 vNormRadius = vc.vNormRadius;
2165 double rn = r / vNormRadius;
2166 return va0 + rn * (va1 + rn * (va2 + rn * va3));
2183 virtual void toStream(ostream& os,
string indent)
const;
2202 return 6 *
sizeof(double) + TPVelocityLayer::bufferSize();
2214 TPVelocityLayer::serialize(buffer);
2226 TPVelocityLayer::deserialize(buffer);
2272 VZero(
double p, V& v) : vzP(p), vzV(v) {};
2306 #endif // TPVelocityModels.h
virtual void writeNormRadius(ostream &os) const
Writes the normalized radius definition to input stream os.
void setIntegTolerance(double tol)
Sets the integration tolerance limit for this velocity layer. If the integration objects are not yet ...
virtual bool isTimeIntegralTau() const
The Default time integral is really Tau function which must be added to p * distance....
virtual int classSize() const
Returns the class size.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityLinear object from the input DataBuffer buffer.
double readRawDouble()
Read a double ... don't check for alignment ... fast but client is responsible for alignment.
double vlPt
The layer top ray parameter (vlRt / vlVt).
void setdDistdPB(double dDdP)
Sets the derivative of the distance wrt. the ray parameter at the bottom of the layer.
virtual double rAtP(double p)
virtual double integrateTime(double p, double ra, double rb)
The time (or tau) integration function that calculates the ray travel time from the start of the laye...
TPVelocityLayer & operator=(const TPVelocityLayer &vl)
Assignment Operator.
VelocityCubic(DataBuffer &buffer)
DataBuffer constructor.
virtual double rAtP(double p)
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityCubic object into the input DataBuffer buffer.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityQuadrat...
static TPVelocityLayer * newModelCopy(const string &cnam, DataBuffer &buffer)
TPVelocityLayer factory method that returns a new TPVelocityLayer object of derived type name,...
VelocityIntegrate(const VelocityIntegrate &vi)
Copy constructor.
virtual ~VZero()
Destructor.
void setPhaseDiffDef(bool def)
Sets the upper diffracted wave phase for this layer to true even if it has no formal phase name defin...
double vlPmin
The minimum allowed valid ray parameter that marks a passing limit in the layer. If vlPmin >= vlPt th...
double vlDistCrit
The distance to the minimum of the retrograde layer if the layer is retrograde. Otherwise ignored.
VelocityQuadratic()
Default constructor. Sets velocity to zero.
VelocityConst & operator=(const VelocityConst &vcst)
Assignment Operator.
virtual void serialize(DataBuffer &buffer)
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...
VelocityQuadratic(double a0, double a1, double a2, double rt, double rb, const string &layrnam="", double normradius=1.0)
Standard constructor.
Constant velocity model returns a single value for velocity irregardless of the input radius value....
TPdTaudr & operator=(const TPdTaudr &ti)
Assignment Operator.
virtual double integrateDistance(double p, double ra, double rb, bool r_open=false)
The distance integration function that calculates the ray travel distance from the start of the layer...
Class supports numerical integration of an arbitrary function using a fourth order Simpsons rule for ...
virtual double operator()(double r)
virtual double integrateDistance(double p, double ra, bool r_open=false)
The analytic power law velocity distance integration function that calculates the ray travel distance...
virtual void writeNormRadius(ostream &os) const
Writes the normalized radius definition to input stream os.
TPdTaudr(const TPdTaudr &ti)
Copy constructor.
double getDistT() const
Returns the accumulated distance through all layers upto the top of this layer given a ray parameter ...
double vlDistB
The integrated distance to the bottom of the layer using the bottom ray parameter (vlPb or vlPmin if ...
void setPhaseNameDiff(const string &name)
Sets the upper interface phase name.
static TPVelocityLayer * newModelCopy(TPVelocityLayer *tpvl)
TPVelocityLayer factory method that returns a new TPVelocityLayer object copied from the input object...
virtual double integrateTime(double p, double ra, double rb)
The time (or tau) integration function that calculates the ray travel time from the start of the laye...
VelocityConst(DataBuffer &buffer)
DataBuffer constructor.
virtual string get_class_name() const
Virtual function that returns the class name.
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
VelocityIntegrate & operator=(const VelocityIntegrate &vi)
Assignment Operator.
const string & getPhaseNameDiffLower() const
Returns the lower interface phase name if assigned.
TPVelocityLayer()
Default constructor. Sets top and bottom layer radius to zero.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityQuadratic object from the input DataBuffer buffer.
string vlLayerName
The descriptive name of the velocity layer.
virtual ~VelocityCubic()
Destructor.
double vlRt
The layer top radius.
double vlPCrit
The ray parameter that gives the distance minimum of a retrograde layer. If the layer is not retrogra...
VelocityQuadratic & operator=(const VelocityQuadratic &vq)
Assignment operator.
virtual ~TPdDistdr()
Destructor.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityLinear object into the input DataBuffer buffer.
bool isSplitLayer() const
Returns true if the layer is a retrograde layer.
double vlRb
The layer bottom radius.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityQuadratic object into the input DataBuffer buffer.
virtual double integrateTime(double p, double ra)
The analytic power law velocity time integration function that calculates the ray travel time from th...
bool passingRay() const
Returns true if the last evaluated ray parameter passed through this layer.
void setP(double p)
Sets the ray parameter to the input value p.
virtual int bufferSize() const
double vlVt
The layer top velocity.
double vlDistT
The integrated distance to the top of the layer using the top ray parameter (vlPt or vlPmin if the la...
void setSplitLayer(double pcrit, double dcrit)
Sets the layers retrograde parameters if the layer was found to contain a retrograde minimum.
virtual double operator()(double r)
void writeString(const string &in_string)
Write the string in_string into 'this' DataBuffer.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual string get_class_name() const
Virtual function that returns the class name.
void setPhaseType(const string &phtype)
Sets the layer phase type to phtype.
static string class_name()
Static function that returns the class name.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityCubic object from the input DataBuffer buffer.
static string class_name()
Static function that returns the class name.
TPdTaudr(V &v)
Standard constructor.
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...
void setPhaseDiffLowerDef(bool def)
Sets the lower diffracted wave phase for this layer to true even if it has no formal phase name defin...
double B() const
Returns the power law exponent.
VelocityPower(const VelocityPower &vp)
Copy constructor.
double getTurningVelocity() const
TPdDistdr & operator=(const TPdDistdr< V > &di)
Assignment Operator.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityConst object from the input DataBuffer buffer.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityPower object from the input DataBuffer buffer.
virtual bool isVelocityLinear() const
bool isPhaseDiffDefined() const
Returns true if the upper diffracted phase is defined for this layer.
string toString() const
Print object data to string.
VelocityLinear(const VelocityLinear &vl)
Copy constructor.
virtual bool isVelocityCubic() const
void setPhaseNameUpper(const string &name)
Sets the upper phase name if the layer is a retrograde layer.
virtual void writeVelocity(ostream &os) const
Used to write the CLR formatted velocity profile to the input output stream os.
string vlPhaseILower
The name of the diffracted phase of a ray that bottoms in the layer and uses the next layers top velo...
double vlIRb
The last integration bottom radius for this layer.
virtual double integrateDistance(double p, double r, bool r_open=false)
The analytic linear velocity distance integration function that calculates the ray travel distance fr...
double vlVb
The layer bottom velocity.
Quadratic velocity model returns a quadraticly modeled velocity between the top and bottom of the lay...
string vlPhaseType
The phase type name ... either "P" or "S".
void setPhaseNameDiffLower(const string &name)
Sets the lower interface phase name.
virtual int classSize() const
Returns the class size.
void setPmin(double pmin)
Sets the minimum ray parameter for the layer. If less than getPt() then the top half of the layer is ...
TPdDistdr(V &v)
Standard constructor.
const string & getLayerName() const
Returns the descriptive layer name.
virtual ~VelocityQuadratic()
Destructor.
Cubic velocity model returns a cubicly modeled velocity between the top and bottom of the layer as a ...
VelocityQuadratic(DataBuffer &buffer)
DataBuffer constructor.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityConst o...
Distance Integrand. Integrating this function over radius yields distance.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
double getDistCrit() const
virtual bool isVelocityPowerLaw() const
virtual double integrateDistance(double p, double ra, bool r_open=false)
The distance integration function that calculates the ray travel distance from the start of the layer...
VelocityLinear(double a0, double a1, double rt, double rb, const string &layrnam="", double normradius=1.0)
Standard constructor.
virtual string get_class_name() const
Virtual function that returns the class name.
const string & getPhaseNameLower() const
Returns the lower phase name if the layer is a retrograde layer.
int vlLayerType
An integer value that describes the layer type.
virtual string get_class_name() const
Virtual function that returns the class name.
double getRb() const
Returns the bottom of the layer radius.
virtual double integrateDistance(double p, double ra, bool r_open=false)
The distance integration function that calculates the ray travel distance from the start of the layer...
bool isPhaseDiffLowerDefined() const
Returns true if the lower diffracted phase is defined for this layer.
virtual double rAtP(double p)
VelocityCubic & operator=(const VelocityCubic &vc)
Assignment operator.
static string class_name()
Static function that returns the class name.
VelocityLinear(DataBuffer &buffer)
DataBuffer constructor.
virtual bool isVelocityLinear() const
Virtual function that returns true for a Linear model.
void writeRawDouble(double d)
Write a double (d) ... do not check for alignment or size ... fast but the client is responsible for ...
double getPmin() const
Returns the minimum passing ray parameter for the layer. if less than getPt() then the top half of th...
bool vlPhaseUpperIDef
Set to true if the upper diffracted phase for this layer is to be evaluated.
bool vlPhaseLowerIDef
Set to true if the lower diffracted phase for this layer is to be evaluated.
const string & getPhaseNameDiff() const
Returns the upper interface phase name if assigned.
virtual bool isTimeIntegralTau() const
The power law velocity time integral returns time and not tau.
void setPhaseTypeS()
Sets the layer phase type to "S".
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityCubic o...
TPdDistdr< V > * vmDist
The distance integrand object templated on the velocity.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityLinear ...
static string class_name()
Static function that returns the class name.
virtual string get_class_name() const
Virtual function that returns the class name.
double getPt() const
Returns the top of the layer ray parameter (slowness).
double vlPb
The layer bottom ray parameter (vlRb / vlVb).
TPVelocityLayer(const TPVelocityLayer &vl)
Copy constructor.
double getdDistdPB() const
Returns the derivative of the distance wrt. the ray parameter at the bottom of the layer.
virtual int classSize() const
Returns the class size.
double operator()(double r)
virtual void writeNormRadius(ostream &os) const
Writes the normalized radius definition to input stream os.
void setdDistdPT(double dDdP)
Sets the derivative of the distance wrt. the ray parameter at the top of the layer.
virtual bool isVelocityPowerLaw() const
Virtual function that returns true for a Power Law model.
VelocityConst(const VelocityConst &vcst)
Copy constructor.
uByte readByte()
Read a byte from the buffer and update the iterator.
A function object used to zero-in on the velocity at r that gives the input ray parameter (vzP)....
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...
const string & getPhaseNameUpper() const
Returns the upper phase name if the layer is a retrograde layer.
VelocityCubic(const VelocityCubic &vc)
Copy constructor.
virtual bool isVelocityConstant() const
virtual ~VelocityLinear()
Destructor.
double vlIRt
The last integration top radius for this layer.
string vlPhaseIUpper
The name of the diffracted phase for a ray that bottoms in the layer and uses the layers bottom veloc...
VelocityPower(double vt, double vb, double rt, double rb, const string &layrnam="")
Standard constructor.
static string class_name()
Static function that returns the class name.
virtual bool isVelocityCubic() const
Virtual function that returns true for a Cubic model.
virtual double rAtP(double p)
bool vlInvalidRay
Boolean flag that is true if the last distance / time evaluation for this velocity layer was invalid.
VelocityLinear & operator=(const VelocityLinear &vl)
Assignment operator.
VelocityLinear()
Default constructor. Sets velocity to zero.
virtual double integrateDistance(double p, double ra, double rb, bool r_open=false)
The analytic power law velocity distance integration function that calculates the ray travel distance...
virtual int classSize() const
Returns the class size.
virtual double rAtP(double p)
virtual double integrateTime(double p, double ra)
The time (or tau) integration function that calculates the ray travel time from the start of the laye...
virtual double operator()(double r)
VZero(const VZero &vz)
Copy constructor.
string vlPhaseLower
The name of the phase for a ray that turns in the bottom half of a retro-grade layer....
virtual double integrateTime(double p, double ra, double rb)
The analytic constant velocity time integration function that calculates the ray travel time from the...
TPdDistdr(const TPdDistdr< V > &di)
Copy constructor.
bool vlTurningRay
Boolean flag that is true if the last distance / time evaluation for this velocity layer was a turnin...
virtual string get_class_name() const
Virtual function that returns the class name.
double getTurningRadius() const
double getdDistdPT() const
Returns the derivative of the distance wrt. the ray parameter at the top of the layer.
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
void setRay(double p)
Sets the ray as invalid, passing, or turning given an input ray parameter p. This function also sets ...
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual double integrateDistance(double p, double ra, double rb, bool r_open=false)
The analytic linear velocity distance integration function that calculates the ray travel distance fr...
TPVelocityLayer(double rt, double rb, const string &layrnam)
VelocityCubic()
Default constructor. Sets velocity to zero.
void init()
Initializes the velocity layer evaluating vlVt, vlVb, vlPt, and vlPb;.
void setPhaseName(const string &name)
Sets the layer default phase name.
Linear velocity model returns a linearly modeled velocity between the top and bottom of the layer as ...
virtual double integrateDistance(double p, double ra, bool r_open=false)
The analytic constant velocity distance integration function that calculates the ray travel distance ...
VZero & operator=(const VZero &vz)
Assignment operator.
VelocityConst()
Default constructor. Sets velocity to zero.
virtual ~VelocityPower()
Destructor.
bool turningRay() const
Returns true if the last evaluated ray parameter produced a turning ray in this layer.
virtual void writeNormRadius(ostream &os) const
Used to write the normalized radius parameter (if defined) to a CLR output stream os.
const string & getPhaseName() const
Returns the layer default phase name.
double vlRLast
Contains the last evaluated turning depth (or vlRb).
virtual double operator()(double r)
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityPower o...
static const double vmIntegTol
The default integration tolerance.
virtual double integrateTime(double p, double ra)
The time (or tau) integration function that calculates the ray travel time from the start of the laye...
void setPhaseNameLower(const string &name)
Sets the lower phase name if the layer is a retrograde layer.
virtual int classSize() const
Returns the class size.
double getVb() const
Returns the bottom of the layer velocity.
Power Law velocity model returns a power law modeled velocity between the top and bottom of the layer...
virtual double integrateDistance(double p, double ra, double rb, bool r_open=false)
The distance integration function that calculates the ray travel distance from the start of the layer...
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 ...
double getDistB() const
Returns the accumulated distance through all layers including this one given a ray parameter of vlPb(...
VelocityIntegrate(double rt, double rb, const string &layrnam)
Standard constructor. Sets top radius to rt.
string vlPhase
The phase name of a ray that turns in the layer. This name is optional and used to define the phase u...
const string & getPhaseType() const
Returns the layer phase type string.
void writeInt32(int i)
Write an Int32 (i) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly b...
double readDouble()
Read a double from the buffer. Make sure the buffer is 8byte alligned before reading.
void setP(double p)
Sets the ray parameter to the input value p.
virtual ~TPdTaudr()
Destructor.
void writeByte(uByte b)
Write a byte (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing.
virtual double operator()(double r)
void setLayerType(int lt)
double getVt() const
Returns the top of the layer velocity.
virtual ~TPVelocityLayer()
Destructor.
virtual int classSize() const
Returns the class size.
void setDistT(double d)
Sets the accumulated distance through all layers upto the top of this layer given a ray parameter of ...
void setPhaseTypeP()
Sets the layer phase type to "P".
VelocityConst(double c, double rt, double rb, const string &layrnam="")
Standard constructor. Sets velocity to c.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
const string & readString()
Read a string and return a reference to be assigned to another string in the client....
virtual double integrateTime(double p, double ra, double rb)
The analytic power law velocity time integration function that calculates the ray travel time from th...
double getRt() const
Returns the top of the layer radius.
VZero(double p, V &v)
Standard constructor.
virtual ~VelocityConst()
Destructor.
VelocityQuadratic(const VelocityQuadratic &vq)
Copy constructor.
static string class_name()
Static function that returns the class name.
double operator()(double r)
Function operator that returns the result of the tau integrand evaluated at the input radius r.
virtual bool isVelocityQuadratic() const
Virtual function that returns true for a Quadratic model.
VelocityPower(DataBuffer &buffer)
DataBuffer constructor.
double getPb() const
Returns the bottom of the layer ray parameter (slowness).
void setDistB(double d)
Sets the accumulated distance through all layers including this one given a ray parameter of vlPb() o...
virtual bool isVelocityConstant() const
Virtual function that returns true for a Constant model.
VelocityPower & operator=(const VelocityPower &vp)
Assignment operator.
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityPower object into the input DataBuffer buffer.
void createNumericObjects(V &v)
Used to create the distance and tau integrand functions vmDist, and vmTau, and their associated integ...
virtual bool isVelocityQuadratic() const
virtual double operator()(double r)
virtual ~VelocityIntegrate()
Destructor.
virtual bool isTimeIntegralTau() const
The constant velocity time integral returns time and not tau.
util::IntegrateFunction< TPdDistdr< V > > * vmDistNI
The numerical integration object templated on vmDist.
virtual double rAtP(double p)
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 ...
string vlPhaseUpper
The name of the phase for a ray that turns in the top half of a retro-grade layer....
int readInt32()
Read an int from the buffer. Make sure the buffer is 4byte alligned before reading.
void writeDouble(double d)
Write a double (d) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly b...
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
double operator()(double r)
Function operator that returns the result of the distance integrand evaluated at the input radius r.
VelocityIntegrate()
Default constructor. Sets top radius to zero.
VelocityCubic(double a0, double a1, double a2, double a3, double rt, double rb, const string &layrnam="", double normradius=1.0)
Standard constructor.
util::IntegrateFunction< TPdTaudr< V > > * vmTauNI
The numerical integration object templated on vmTau.
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...
A byte array container used to hold binary data in the same manner as disk based file system.
bool vlPassingRay
Boolean flag that is true if the last distance / time evaluation for this velocity layer was a passin...
double vldDistdP_T
The derivative of distance wrt. the ray parameter at the top of the layer.
bool invalidRay() const
Returns true if the last evaluated ray parameter was unable to pass through this layer.
Abstract base class velocity layer model inherited by all concrete velocity layer classes....
bool vlSplitLayer
Boolean flag that is true if the velocity layer is a retrograde layer.
TPdTaudr< V > * vmTau
The tau integrand object templated on the velocity.
VelocityPower()
Default constructor. Sets velocity to zero.
virtual void deserialize(DataBuffer &buffer)
virtual double integrateTime(double p, double ra)
The analytic constant velocity time integration function that calculates the ray travel time from the...
double vldDistdP_B
The derivative of distance wrt. the ray parameter at the bottom of the layer.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityConst object into the input DataBuffer buffer.