38 #ifndef TPVELOCITYMODELS_H
39 #define TPVELOCITYMODELS_H
59 using namespace geotess;
70 class TPVelocityLayer;
74 class VelocityQuadratic;
77 template<
class V>
class TPdDistdr;
78 template<
class V>
class TPdTaudr;
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) {};
Abstract base class velocity layer model inherited by all concrete velocity layer classes....
void setdDistdPT(double dDdP)
Sets the derivative of the distance wrt. the ray parameter at the top of the layer.
double vldDistdP_B
The derivative of distance wrt. the ray parameter at the bottom of the layer.
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 getDistT() const
Returns the accumulated distance through all layers upto the top of this layer given a ray parameter ...
void setPhaseNameDiffLower(const string &name)
Sets the lower interface phase name.
virtual int classSize() const
Returns the class size.
bool passingRay() const
Returns true if the last evaluated ray parameter passed through this layer.
void setDistB(double d)
Sets the accumulated distance through all layers including this one given a ray parameter of vlPb() o...
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...
const string & getPhaseNameDiff() const
Returns the upper interface phase name if assigned.
void setPhaseNameLower(const string &name)
Sets the lower phase name if the layer is a retrograde layer.
string vlPhaseIUpper
The name of the diffracted phase for a ray that bottoms in the layer and uses the layers bottom veloc...
virtual bool isVelocityConstant() const
double getTurningVelocity() const
double getDistCrit() const
const string & getPhaseNameUpper() const
Returns the upper phase name if the layer is a retrograde layer.
const string & getPhaseNameDiffLower() const
Returns the lower interface phase name if assigned.
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...
TPVelocityLayer & operator=(const TPVelocityLayer &vl)
Assignment Operator.
double vldDistdP_T
The derivative of distance wrt. the ray parameter at the top 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...
void init()
Initializes the velocity layer evaluating vlVt, vlVb, vlPt, and vlPb;.
void setPhaseNameDiff(const string &name)
Sets the upper interface phase name.
void setPhaseTypeS()
Sets the layer phase type to "S".
double getRb() const
Returns the bottom of the layer radius.
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...
string vlPhaseType
The phase type name ... either "P" or "S".
double getPb() const
Returns the bottom of the layer ray parameter (slowness).
int vlLayerType
An integer value that describes the layer type.
virtual void serialize(DataBuffer &buffer)
double getPmin() const
Returns the minimum passing ray parameter for the layer. if less than getPt() then the top half of th...
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 setdDistdPB(double dDdP)
Sets the derivative of the distance wrt. the ray parameter at the bottom of the layer.
double vlPt
The layer top ray parameter (vlRt / vlVt).
const string & getPhaseNameLower() const
Returns the lower phase name if the layer is a retrograde layer.
virtual double rAtP(double p)
string vlLayerName
The descriptive name of the velocity layer.
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...
bool vlPhaseUpperIDef
Set to true if the upper diffracted phase for this layer is to be evaluated.
const string & getLayerName() const
Returns the descriptive layer name.
static TPVelocityLayer * newModelCopy(TPVelocityLayer *tpvl)
TPVelocityLayer factory method that returns a new TPVelocityLayer object copied from the input object...
virtual double operator()(double r)
bool vlSplitLayer
Boolean flag that is true if the velocity layer is a retrograde layer.
virtual ~TPVelocityLayer()
Destructor.
void setPhaseName(const string &name)
Sets the layer default phase name.
double vlRb
The layer bottom radius.
double vlPb
The layer bottom ray parameter (vlRb / vlVb).
const string & getPhaseName() const
Returns the layer default phase name.
double getTurningRadius() const
bool isPhaseDiffLowerDefined() const
Returns true if the lower diffracted phase is defined for this layer.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
void setPhaseNameUpper(const string &name)
Sets the upper phase name if the layer is a retrograde layer.
virtual bool isVelocityQuadratic() const
virtual bool isVelocityPowerLaw() const
string vlPhaseUpper
The name of the phase for a ray that turns in the top half of a retro-grade layer....
double vlPmin
The minimum allowed valid ray parameter that marks a passing limit in the layer. If vlPmin >= vlPt th...
double getPt() const
Returns the top of the layer ray parameter (slowness).
bool vlPassingRay
Boolean flag that is true if the last distance / time evaluation for this velocity layer was a passin...
double vlIRt
The last integration top radius for this layer.
string vlPhase
The phase name of a ray that turns in the layer. This name is optional and used to define the phase u...
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 ...
TPVelocityLayer()
Default constructor. Sets top and bottom layer radius to zero.
void setPhaseTypeP()
Sets the layer phase type to "P".
TPVelocityLayer(const TPVelocityLayer &vl)
Copy constructor.
virtual void deserialize(DataBuffer &buffer)
virtual int bufferSize() 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 ...
double getVb() const
Returns the bottom of the layer velocity.
bool turningRay() const
Returns true if the last evaluated ray parameter produced a turning ray in this layer.
static TPVelocityLayer * newModelCopy(const string &cnam, DataBuffer &buffer)
TPVelocityLayer factory method that returns a new TPVelocityLayer object of derived type name,...
double vlDistCrit
The distance to the minimum of the retrograde layer if the layer is retrograde. Otherwise ignored.
string vlPhaseILower
The name of the diffracted phase of a ray that bottoms in the layer and uses the next layers top velo...
bool vlTurningRay
Boolean flag that is true if the last distance / time evaluation for this velocity layer was a turnin...
void setRay(double p)
Sets the ray as invalid, passing, or turning given an input ray parameter p. This function also sets ...
bool vlInvalidRay
Boolean flag that is true if the last distance / time evaluation for this velocity layer was invalid.
virtual void writeVelocity(ostream &os) const
Used to write the CLR formatted velocity profile to the input output stream os.
static string class_name()
Static function that returns the class name.
bool vlPhaseLowerIDef
Set to true if the lower diffracted phase for this layer is to be evaluated.
virtual bool isVelocityCubic() const
double vlDistT
The integrated distance to the top of the layer using the top ray parameter (vlPt or vlPmin if the la...
bool invalidRay() const
Returns true if the last evaluated ray parameter was unable to pass through this layer.
void setDistT(double d)
Sets the accumulated distance through all layers upto the top of this layer given a ray parameter of ...
virtual bool isTimeIntegralTau() const
The Default time integral is really Tau function which must be added to p * distance....
string vlPhaseLower
The name of the phase for a ray that turns in the bottom half of a retro-grade layer....
virtual void writeNormRadius(ostream &os) const
Used to write the normalized radius parameter (if defined) to a CLR output stream os.
double vlPCrit
The ray parameter that gives the distance minimum of a retrograde layer. If the layer is not retrogra...
double vlRt
The layer top radius.
double getdDistdPB() const
Returns the derivative of the distance wrt. the ray parameter at the bottom of the layer.
void setSplitLayer(double pcrit, double dcrit)
Sets the layers retrograde parameters if the layer was found to contain a retrograde minimum.
void setPhaseDiffLowerDef(bool def)
Sets the lower diffracted wave phase for this layer to true even if it has no formal phase name defin...
bool isPhaseDiffDefined() const
Returns true if the upper diffracted phase is defined for this layer.
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...
virtual string get_class_name() const
Virtual function that returns the class name.
string toString() const
Print object data to string.
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...
double getDistB() const
Returns the accumulated distance through all layers including this one given a ray parameter of vlPb(...
double vlVt
The layer top velocity.
void setPhaseType(const string &phtype)
Sets the layer phase type to phtype.
double getVt() const
Returns the top of the layer velocity.
const string & getPhaseType() const
Returns the layer phase type string.
double vlVb
The layer bottom velocity.
double vlIRb
The last integration bottom radius for this layer.
double getRt() const
Returns the top of the layer radius.
virtual bool isVelocityLinear() const
TPVelocityLayer(double rt, double rb, const string &layrnam)
double getdDistdPT() const
Returns the derivative of the distance wrt. the ray parameter at the top of the layer.
double vlRLast
Contains the last evaluated turning depth (or vlRb).
void setLayerType(int lt)
double vlDistB
The integrated distance to the bottom of the layer using the bottom ray parameter (vlPb or vlPmin if ...
bool isSplitLayer() const
Returns true if the layer is a retrograde layer.
Distance Integrand. Integrating this function over radius yields distance.
virtual ~TPdDistdr()
Destructor.
TPdDistdr(const TPdDistdr< V > &di)
Copy constructor.
double operator()(double r)
Function operator that returns the result of the distance integrand evaluated at the input radius r.
void setP(double p)
Sets the ray parameter to the input value p.
TPdDistdr(V &v)
Standard constructor.
TPdDistdr & operator=(const TPdDistdr< V > &di)
Assignment Operator.
virtual ~TPdTaudr()
Destructor.
TPdTaudr & operator=(const TPdTaudr &ti)
Assignment Operator.
double operator()(double r)
Function operator that returns the result of the tau integrand evaluated at the input radius r.
TPdTaudr(V &v)
Standard constructor.
void setP(double p)
Sets the ray parameter to the input value p.
TPdTaudr(const TPdTaudr &ti)
Copy constructor.
A function object used to zero-in on the velocity at r that gives the input ray parameter (vzP)....
virtual ~VZero()
Destructor.
VZero(const VZero &vz)
Copy constructor.
VZero & operator=(const VZero &vz)
Assignment operator.
double operator()(double r)
VZero(double p, V &v)
Standard constructor.
Constant velocity model returns a single value for velocity irregardless of the input radius value....
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual bool isTimeIntegralTau() const
The constant velocity time integral returns time and not tau.
VelocityConst()
Default constructor. Sets velocity to zero.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityConst o...
VelocityConst(const VelocityConst &vcst)
Copy constructor.
virtual double rAtP(double p)
virtual double integrateTime(double p, double ra)
The analytic constant velocity time integration function that calculates the ray travel time from the...
virtual double integrateDistance(double p, double ra, bool r_open=false)
The analytic constant velocity distance integration function that calculates the ray travel distance ...
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
virtual bool isVelocityConstant() const
Virtual function that returns true for a Constant model.
virtual double integrateTime(double p, double ra, double rb)
The analytic constant velocity time integration function that calculates the ray travel time from the...
virtual ~VelocityConst()
Destructor.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityConst object from the input DataBuffer buffer.
VelocityConst(double c, double rt, double rb, const string &layrnam="")
Standard constructor. Sets velocity to c.
virtual double operator()(double r)
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 ...
virtual string get_class_name() const
Virtual function that returns the class name.
virtual int classSize() const
Returns the class size.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityConst object into the input DataBuffer buffer.
VelocityConst & operator=(const VelocityConst &vcst)
Assignment Operator.
VelocityConst(DataBuffer &buffer)
DataBuffer constructor.
static string class_name()
Static function that returns the class name.
Cubic velocity model returns a cubicly modeled velocity between the top and bottom of the layer as a ...
VelocityCubic(const VelocityCubic &vc)
Copy 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.
VelocityCubic()
Default constructor. Sets velocity to zero.
VelocityCubic & operator=(const VelocityCubic &vc)
Assignment operator.
VelocityCubic(DataBuffer &buffer)
DataBuffer constructor.
static string class_name()
Static function that returns the class name.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityCubic object into the input DataBuffer buffer.
virtual ~VelocityCubic()
Destructor.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityCubic o...
virtual void writeNormRadius(ostream &os) const
Writes the normalized radius definition to input stream os.
virtual double operator()(double r)
virtual double rAtP(double p)
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityCubic object from the input DataBuffer buffer.
VelocityCubic(double a0, double a1, double a2, double a3, double rt, double rb, const string &layrnam="", double normradius=1.0)
Standard constructor.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual bool isVelocityCubic() const
Virtual function that returns true for a Cubic model.
virtual int classSize() const
Returns the class size.
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...
util::IntegrateFunction< TPdDistdr< V > > * vmDistNI
The numerical integration object templated on vmDist.
virtual ~VelocityIntegrate()
Destructor.
TPdDistdr< V > * vmDist
The distance integrand object templated on the velocity.
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...
util::IntegrateFunction< TPdTaudr< V > > * vmTauNI
The numerical integration object templated on vmTau.
VelocityIntegrate(double rt, double rb, const string &layrnam)
Standard constructor. Sets top radius to rt.
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...
TPdTaudr< V > * vmTau
The tau integrand object templated on the velocity.
VelocityIntegrate & operator=(const VelocityIntegrate &vi)
Assignment Operator.
VelocityIntegrate()
Default constructor. Sets top radius to zero.
void createNumericObjects(V &v)
Used to create the distance and tau integrand functions vmDist, and vmTau, and their associated integ...
static const double vmIntegTol
The default integration tolerance.
void setIntegTolerance(double tol)
Sets the integration tolerance limit for this velocity layer. If the integration objects are not yet ...
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...
VelocityIntegrate(const VelocityIntegrate &vi)
Copy constructor.
Linear velocity model returns a linearly modeled velocity between the top and bottom of the layer as ...
VelocityLinear(const VelocityLinear &vl)
Copy constructor.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityLinear object into the input DataBuffer buffer.
virtual string get_class_name() const
Virtual function that returns the class name.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual double rAtP(double p)
virtual void writeNormRadius(ostream &os) const
Writes the normalized radius definition to input stream os.
VelocityLinear()
Default constructor. Sets velocity to zero.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityLinear object from the input DataBuffer buffer.
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...
VelocityLinear(double a0, double a1, double rt, double rb, const string &layrnam="", double normradius=1.0)
Standard constructor.
virtual double operator()(double r)
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...
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityLinear ...
virtual ~VelocityLinear()
Destructor.
virtual bool isVelocityLinear() const
Virtual function that returns true for a Linear model.
static string class_name()
Static function that returns the class name.
VelocityLinear & operator=(const VelocityLinear &vl)
Assignment operator.
VelocityLinear(DataBuffer &buffer)
DataBuffer constructor.
virtual int classSize() const
Returns the class size.
Power Law velocity model returns a power law modeled velocity between the top and bottom of the layer...
VelocityPower()
Default constructor. Sets velocity to zero.
virtual string get_class_name() const
Virtual function that returns the class name.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityPower object from the input DataBuffer buffer.
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 double operator()(double r)
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...
virtual double integrateTime(double p, double ra)
The analytic power law velocity time integration function that calculates the ray travel time from th...
VelocityPower & operator=(const VelocityPower &vp)
Assignment operator.
virtual double rAtP(double p)
VelocityPower(const VelocityPower &vp)
Copy constructor.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityPower object into the input DataBuffer buffer.
virtual bool isVelocityPowerLaw() const
Virtual function that returns true for a Power Law model.
virtual int classSize() const
Returns the class size.
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 bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityPower o...
virtual bool isTimeIntegralTau() const
The power law velocity time integral returns time and not tau.
double B() const
Returns the power law exponent.
static string class_name()
Static function that returns the class name.
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
VelocityPower(double vt, double vb, double rt, double rb, const string &layrnam="")
Standard constructor.
virtual ~VelocityPower()
Destructor.
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
VelocityPower(DataBuffer &buffer)
DataBuffer constructor.
Quadratic velocity model returns a quadraticly modeled velocity between the top and bottom of the lay...
virtual bool isVelocityQuadratic() const
Virtual function that returns true for a Quadratic model.
virtual void serialize(DataBuffer &buffer)
Writes the content of the VelocityQuadratic object into the input DataBuffer buffer.
virtual double operator()(double r)
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
virtual void writeVelocity(ostream &os) const
Writes the velocity definition to the input stream os.
virtual double rAtP(double p)
VelocityQuadratic()
Default constructor. Sets velocity to zero.
VelocityQuadratic(DataBuffer &buffer)
DataBuffer constructor.
virtual int bufferSize() const
Returns the size of a DataBuffer required to contain all serialized information for a VelocityQuadrat...
VelocityQuadratic(double a0, double a1, double a2, double rt, double rb, const string &layrnam="", double normradius=1.0)
Standard constructor.
VelocityQuadratic & operator=(const VelocityQuadratic &vq)
Assignment operator.
virtual int classSize() const
Returns the class size.
static string class_name()
Static function that returns the class name.
virtual void deserialize(DataBuffer &buffer)
Reads the content of the VelocityQuadratic object from the input DataBuffer buffer.
virtual void writeNormRadius(ostream &os) const
Writes the normalized radius definition to input stream os.
VelocityQuadratic(const VelocityQuadratic &vq)
Copy constructor.
virtual ~VelocityQuadratic()
Destructor.
virtual string get_class_name() const
Virtual function that returns the class name.
A byte array container used to hold binary data in the same manner as disk based file system.
void writeDouble(double d)
Write a double (d) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly b...
int readInt32()
Read an int from the buffer. Make sure the buffer is 4byte alligned before reading.
void writeByte(uByte b)
Write a byte (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing.
void writeString(const string &in_string)
Write the string in_string into 'this' DataBuffer.
void writeRawDouble(double d)
Write a double (d) ... do not check for alignment or size ... fast but the client is responsible for ...
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.
uByte readByte()
Read a byte from the buffer and update the iterator.
const string & readString()
Read a string and return a reference to be assigned to another string in the client....
double readRawDouble()
Read a double ... don't check for alignment ... fast but client is responsible for alignment.
Class supports numerical integration of an arbitrary function using a fourth order Simpsons rule for ...