RSTT 3.2.1 Regional Seismic Travel Time

Loading...
Searching...
No Matches
CrustalProfile.h
Go to the documentation of this file.
1//- ****************************************************************************
2//-
3//- Copyright 2009 National Technology & Engineering Solutions of Sandia, LLC
4//- (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
5//- Government retains certain rights in this software.
6//-
7//- BSD Open Source License
8//- All rights reserved.
9//-
10//- Redistribution and use in source and binary forms, with or without
11//- modification, are permitted provided that the following conditions are met:
12//-
13//- 1. Redistributions of source code must retain the above copyright notice,
14//- this list of conditions and the following disclaimer.
15//-
16//- 2. Redistributions in binary form must reproduce the above copyright
17//- notice, this list of conditions and the following disclaimer in the
18//- documentation and/or other materials provided with the distribution.
19//-
20//- 3. Neither the name of the copyright holder nor the names of its
21//- contributors may be used to endorse or promote products derived from
22//- this software without specific prior written permission.
23//-
24//- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25//- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26//- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27//- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28//- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29//- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30//- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31//- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32//- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33//- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34//- POSSIBILITY OF SUCH DAMAGE.
35//-
36//- ****************************************************************************
37
38#ifndef CrustalProfile_H
39#define CrustalProfile_H
40
41// **** _SYSTEM INCLUDES_ ******************************************************
42
43#include <vector>
44#include <set>
45
46 using namespace std;
47
48// **** _LOCAL INCLUDES_ *******************************************************
49
50#include "SLBMGlobals.h"
51#include "InterpolatedProfile.h"
52#include "Location.h"
53#include "GreatCircle.h"
54#include "TauPSite.h"
55//#include "Grid.h"
56
57// **** _BEGIN SLBM NAMESPACE_ **************************************************
58
59 namespace slbm {
60
61 class GridProfile;
62
63 class SLBM_EXP_IMP CrustalProfile : public InterpolatedProfile
101{
102
103 public:
104
108 CrustalProfile();
109
113 CrustalProfile(const CrustalProfile& CrustalProfile);
114
115 virtual ~CrustalProfile();
116
120 CrustalProfile& operator=(const CrustalProfile& other);
121
125 bool operator==(const CrustalProfile& other);
126
130 bool operator!=(const CrustalProfile& other) {return ! (*this == other);};
131
143 void setup(Grid& grid, const int& phase,
144 const double& lat, const double& lon, const double& depth);
145
152 const Location& getLocation() const { return location; };
153
154 double getEarthRadius() { return location.getEarthRadius(); };
155
159 int getNIntervals() { return NLAYERS; };
160
166 void getData(vector<double>& depths, vector<double>& velocities);
167
171 double getInterfaceRadius(const int& k) { return radius[k]; };
172
176 void getDepths(double* depths);
177
181 double* getVelocities() { return velocity; };
182
186 double getDepth(const int& k);
187
191 double getVelocity(const int& k) { return velocity[k]; };
192
205 double getPCrit(GreatCircle* greatCircle);
206
233 void xtCrust(
234 GreatCircle* greatCircle,
235 const double& rayParameter,
236 double &xTotal,
237 double &zTotal,
238 double &sTotal,
239 double &tTotal);
240
280 void xtCrust(
281 GreatCircle* greatCircle,
282 const double& rayParameter,
283 int layid[],
284 double x[],
285 double r[],
286 double v[],
287 double t[],
288 int& npoints);
289
290 const int* getLayid() { return layid; };
291
292 int getNLayid() { return nlay; };
293
294 int getTopLayid() { return topLayid; };
295
304 string toString(GreatCircle* greatCircle, double rayParameter);
305 string toString();
306
307 size_t memSize();
308
310 void setTauPSite(taup::TauPSite* tps);
311
313 taup::TauPSite* getTauPSite();
314
315 static int getClassCount();
316
320 bool isInCrust() { return inCrust; };
321
322 private:
323
324 static int crustalProfileClassCount;
325
332 Location location;
333
337 bool inCrust;
338
343 int phase;
344
348 double radius[NLAYERS];
349
353 double velocity[NLAYERS];
354
358 int layid[NLAYERS];
359
363 int nlay;
364
370 int topLayid;
371
377 int nMiddleCrust;
378
388 double fudgeFactor;
389
396 taup::TauPSite* cpTPS;
397};
398
399//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
400//
401// INLINE FUNCTIONS
402//
403//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404
405 inline void CrustalProfile::getData(vector<double>& depths,
406 vector<double>& velocities)
407{
408 depths.clear();
409 velocities.clear();
410 double R = getEarthRadius();
411 for (int i=0; i<getNIntervals(); i++)
412 {
413 depths.push_back(R - radius[i]);
414 velocities.push_back(velocity[i]);
415 }
416}
417
418 inline double CrustalProfile::getDepth(const int& k)
419{
420 return getEarthRadius() - radius[k];
421}
422
423 inline void CrustalProfile::getDepths(double* depths)
424{
425 double R = getEarthRadius();
426 for (int i=0; i<getNIntervals(); i++)
427 depths[i] = R - radius[i];
428}
429
430 inline double CrustalProfile::getPCrit(GreatCircle* greatCircle)
431{
432 return radius[greatCircle->getHeadWaveInterface()]
433 / velocity[greatCircle->getHeadWaveInterface()];
434}
435
436} // end slbm namespace
437
438#endif // CrustalProfile.h
GreatCircle.h
InterpolatedProfile.h
Location.h
SLBMGlobals.h
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition SLBMGlobals.h:180
TauPSite.h
slbm::CrustalProfile::getNIntervals
int getNIntervals()
Retrieve the number of intervals associated with this Profile.
Definition CrustalProfile.h:159
slbm::CrustalProfile::getPCrit
double getPCrit(GreatCircle *greatCircle)
Retrieve the critical spherical ray parameter for this profile, in radians/seconds.
Definition CrustalProfile.h:430
slbm::CrustalProfile::CrustalProfile
CrustalProfile()
Default constructor.
slbm::CrustalProfile::getDepth
double getDepth(const int &k)
Retrieve the depth of the top of the k'th interval, in km.
Definition CrustalProfile.h:418
slbm::CrustalProfile::getInterfaceRadius
double getInterfaceRadius(const int &k)
Retrieve the radius of the top of the k'th interval, in km.
Definition CrustalProfile.h:171
slbm::CrustalProfile::getVelocities
double * getVelocities()
Retrieve the P or S wave velocity of each interval, in km/sec.
Definition CrustalProfile.h:181
slbm::CrustalProfile::getDepths
void getDepths(double *depths)
Retrieve the depths of the top of each intervals, in km.
Definition CrustalProfile.h:423
slbm::CrustalProfile::memSize
size_t memSize()
slbm::CrustalProfile::getEarthRadius
double getEarthRadius()
Definition CrustalProfile.h:154
slbm::CrustalProfile::getLocation
const Location & getLocation() const
Retrieve a const reference to the Location associated with this Profile.
Definition CrustalProfile.h:152
slbm::CrustalProfile::xtCrust
void xtCrust(GreatCircle *greatCircle, const double &rayParameter, double &xTotal, double &zTotal, double &sTotal, double &tTotal)
Compute the horizontal offset (radians) and the travel time (sec) of the ray through the crust.
slbm::CrustalProfile::xtCrust
void xtCrust(GreatCircle *greatCircle, const double &rayParameter, int layid[], double x[], double r[], double v[], double t[], int &npoints)
Compute the horizontal offset (radians) and the travel time (sec) of the ray through the crust.
slbm::CrustalProfile::getClassCount
static int getClassCount()
slbm::CrustalProfile::getLayid
const int * getLayid()
Definition CrustalProfile.h:290
slbm::CrustalProfile::~CrustalProfile
virtual ~CrustalProfile()
slbm::CrustalProfile::getData
void getData(vector< double > &depths, vector< double > &velocities)
Retrieve all the interval depth and velocity information contained in this CrustalProfile object.
Definition CrustalProfile.h:405
slbm::CrustalProfile::operator!=
bool operator!=(const CrustalProfile &other)
Inequality operator.
Definition CrustalProfile.h:130
slbm::CrustalProfile::getVelocity
double getVelocity(const int &k)
Retrieve the P or S wave velocity of the k'th interval, in km/sec.
Definition CrustalProfile.h:191
slbm::CrustalProfile::toString
string toString(GreatCircle *greatCircle, double rayParameter)
Returns a formatted string containing detailed information about this Profile.
slbm::CrustalProfile::getTopLayid
int getTopLayid()
Definition CrustalProfile.h:294
slbm::CrustalProfile::getTauPSite
taup::TauPSite * getTauPSite()
Return this CrustalProfiles TauPSite object;.
slbm::CrustalProfile::CrustalProfile
CrustalProfile(const CrustalProfile &CrustalProfile)
Copy constructor.
slbm::CrustalProfile::setup
void setup(Grid &grid, const int &phase, const double &lat, const double &lon, const double &depth)
Parameterized constructor.
slbm::CrustalProfile::isInCrust
bool isInCrust()
true location radius > moho radius.
Definition CrustalProfile.h:320
slbm::CrustalProfile::operator=
CrustalProfile & operator=(const CrustalProfile &other)
Equal operator.
slbm::CrustalProfile::getNLayid
int getNLayid()
Definition CrustalProfile.h:292
slbm::CrustalProfile::setTauPSite
void setTauPSite(taup::TauPSite *tps)
Set the input TauPSite into this CrustalProfile;.
slbm::CrustalProfile::toString
string toString()
slbm::CrustalProfile::operator==
bool operator==(const CrustalProfile &other)
Equality operator.
slbm::GreatCircle
The GreatCircle class manages information related to a great circle path between two Locations on the...
Definition GreatCircle.h:114
slbm::GreatCircle::getHeadWaveInterface
const int & getHeadWaveInterface()
Retrieve the index of the head wave interface (SLBMGlobals::MANTLE for Pn, Sn; SLBMGlobals::MIDDLE_CR...
Definition GreatCircle.h:186
slbm::Grid
A 2 dimensional, horizontal grid of GirdProfile objects.
Definition Grid.h:91
slbm::GridProfile
Manages all information related to a single node in a Grid object.
Definition GridProfile.h:71
slbm::InterpolatedProfile::InterpolatedProfile
InterpolatedProfile()
Default constructor.
slbm::Location
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.
Definition Location.h:78
taup::TauPSite
Definition TauPSite.h:121
slbm
Definition CrustalProfile.h:59