RSTT 3.2.1 Regional Seismic Travel Time

Loading...
Searching...
No Matches
GridProfileGeoTess.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 GRIDPROFILEGEOTESS_H_
39#define GRIDPROFILEGEOTESS_H_
40
41// **** _SYSTEM INCLUDES_ ******************************************************
42
43#include <vector>
44#include <set>
45#include <map>
46
47 using namespace std;
48
49// **** _LOCAL INCLUDES_ *******************************************************
50
51#include "CPPGlobals.h"
52#include "GeoTessProfile.h"
53
54 using namespace geotess;
55
56#include "SLBMGlobals.h"
57#include "Location.h"
58#include "GeoStack.h"
59
60// **** _BEGIN SLBM NAMESPACE_ **************************************************
61
62 namespace slbm {
63
64 class InterpolatedProfile;
65 class Grid;
66
67 class SLBM_EXP_IMP GridProfileGeoTess : public GridProfile
77{
78
79// let Grid objects access protected members of GridProfileGeoTess.
80 friend class Grid;
81
82 public:
83
89 GridProfileGeoTess(Grid& g, const int& nodeId, Location& location);
90
94 // GridProfileGeoTess(const GridProfileGeoTess &other);
95 // GridProfile *clone() { return new GridProfileGeoTess(*this); }
96
100 ~GridProfileGeoTess();
101
102 static string class_name() { return "GridProfileGeoTess"; };
103
111 int getGeoStackId() { return -1; };
112
122 void getData(double* depths, double* pvelocity, double* svelocity, double* gradient);
123
134 void setData(double depths[NLAYERS], double pvelocities[NLAYERS],
135 double svelocities[NLAYERS], double gradients[2]);
136
141 void setDepths(const vector<double>& depths);
142
148 void setVelocity(const int& waveType, const vector<double>& velocity);
149
154 void setGradient(const vector<double>& gradient);
155
159 double getInterfaceRadius(const int& k)
160 { return gtProfiles[NLAYERS-k]->getRadiusTop(); }
161
167 double getInterfaceDepth(const int& k)
168 { return earthRadius - gtProfiles[NLAYERS-k]->getRadiusTop(); }
169
176 double getVelocity(const int& waveType, const int& k)
177 { return gtProfiles[NLAYERS-k]->getValueTop(waveType); };
178
183 double getMantleGradient(const int& waveType)
184 { return gtProfiles[0]->getValueTop(waveType); };
185
189 void getInterfaceDepths(vector<double>& depths);
190
198 void getVelocity(const int& waveType, double* velocities)
199 { for (int k=0; k<NLAYERS; k++) velocities[k] = gtProfiles[NLAYERS-k]->getValueTop(waveType); }
200
206 void getMantleGradient(double* g)
207 { g[PWAVE] = gtProfiles[0]->getValueTop(PWAVE); g[SWAVE] = gtProfiles[0]->getValueTop(SWAVE); }
208
209 double getWaterThick()
210 { return gtProfiles[NLAYERS]->getRadiusTop()-gtProfiles[NLAYERS-1]->getRadiusTop(); }
211
212 protected:
213
214 GeoTessModelSLBM* model;
215
216 // A 1D array of GeoTess Profile objects with NLAYERS elements.
217 // Each Profile spans one of the layers of the model.
218 GeoTessProfile** gtProfiles;
219
220 bool hasLowVelocityZone();
221
222};
223
224//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225//
226// INLINE FUNCTIONS
227//
228//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
229
230 inline void GridProfileGeoTess::getData(double* d,
231 double* pv, double* sv, double* g)
232{
233 for (int k=0; k<NLAYERS; k++)
234 {
235 d[k] = getEarthRadius()-gtProfiles[NLAYERS-k]->getRadiusTop();
236 pv[k] = gtProfiles[NLAYERS-k]->getValueTop(PWAVE);
237 sv[k] = gtProfiles[NLAYERS-k]->getValueTop(SWAVE);
238 }
239 g[PWAVE] = gtProfiles[0]->getValueTop(PWAVE);
240 g[SWAVE] = gtProfiles[0]->getValueTop(SWAVE);
241}
242
243 inline void GridProfileGeoTess::getInterfaceDepths(vector<double>& depths)
244{
245 depths.resize(NLAYERS);
246 for (int k=0; k<NLAYERS; k++)
247 depths[k] = earthRadius - gtProfiles[NLAYERS-k]->getRadiusTop();
248}
249
250} // end slbm namespace
251
252#endif // GRIDPROFILEGEOTESS_H_.h
GeoStack.h
Location.h
SLBMGlobals.h
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition SLBMGlobals.h:180
slbm::GeoTessModelSLBM
Definition GeoTessModelSLBM.h:84
slbm::Grid
A 2 dimensional, horizontal grid of GirdProfile objects.
Definition Grid.h:91
slbm::GridProfileGeoTess::setDepths
void setDepths(const vector< double > &depths)
Set the layer depths to specified values.
slbm::GridProfileGeoTess::setGradient
void setGradient(const vector< double > &gradient)
Set the P and S velocity gradients to specified values.
slbm::GridProfileGeoTess::getData
void getData(double *depths, double *pvelocity, double *svelocity, double *gradient)
Retrieve all the data associated with this Profile.
Definition GridProfileGeoTess.h:230
slbm::GridProfileGeoTess::getGeoStackId
int getGeoStackId()
Retrieve the index of the GeoStack that holds the information about model interfaces,...
Definition GridProfileGeoTess.h:111
slbm::GridProfileGeoTess::Grid
friend class Grid
Definition GridProfileGeoTess.h:80
slbm::GridProfileGeoTess::getInterfaceDepths
void getInterfaceDepths(vector< double > &depths)
Retrieve the depths of all intervals, in km.
Definition GridProfileGeoTess.h:243
slbm::GridProfileGeoTess::getVelocity
double getVelocity(const int &waveType, const int &k)
Retrieve the P or S velocity of the k'th interval, in km/sec.
Definition GridProfileGeoTess.h:176
slbm::GridProfileGeoTess::~GridProfileGeoTess
~GridProfileGeoTess()
Copy constructor.
slbm::GridProfileGeoTess::getInterfaceDepth
double getInterfaceDepth(const int &k)
Retrieve the depth of the k'th interval, in km relative sea level.
Definition GridProfileGeoTess.h:167
slbm::GridProfileGeoTess::GridProfileGeoTess
GridProfileGeoTess(Grid &g, const int &nodeId, Location &location)
Parameterized constructor.
slbm::GridProfileGeoTess::setVelocity
void setVelocity(const int &waveType, const vector< double > &velocity)
Set the P or S velocity to specified values.
slbm::GridProfileGeoTess::gtProfiles
GeoTessProfile ** gtProfiles
Definition GridProfileGeoTess.h:218
slbm::GridProfileGeoTess::getWaterThick
double getWaterThick()
Definition GridProfileGeoTess.h:209
slbm::GridProfileGeoTess::class_name
static string class_name()
Definition GridProfileGeoTess.h:102
slbm::GridProfileGeoTess::getMantleGradient
double getMantleGradient(const int &waveType)
Retrieve the P or S velocity gradient in the mantle, in 1/sec.
Definition GridProfileGeoTess.h:183
slbm::GridProfileGeoTess::getInterfaceRadius
double getInterfaceRadius(const int &k)
Retrieve the radius of the k'th interval, in km.
Definition GridProfileGeoTess.h:159
slbm::GridProfileGeoTess::hasLowVelocityZone
bool hasLowVelocityZone()
slbm::GridProfileGeoTess::model
GeoTessModelSLBM * model
Definition GridProfileGeoTess.h:214
slbm::GridProfileGeoTess::getMantleGradient
void getMantleGradient(double *g)
Retrieve the P and S velocity gradients in the mantle, in 1/sec.
Definition GridProfileGeoTess.h:206
slbm::GridProfileGeoTess::setData
void setData(double depths[NLAYERS], double pvelocities[NLAYERS], double svelocities[NLAYERS], double gradients[2])
Set the P and S velocities and gradients associated with this GridProfileGeoTess object to specified ...
slbm::GridProfileGeoTess::getVelocity
void getVelocity(const int &waveType, double *velocities)
Retrieve the P or S velocities of all intervals, in km/sec.
Definition GridProfileGeoTess.h:198
slbm::GridProfile::getEarthRadius
virtual double getEarthRadius()
Definition GridProfile.h:110
slbm::GridProfile::earthRadius
double earthRadius
Definition GridProfile.h:253
slbm::GridProfile::GridProfile
GridProfile()
Definition GridProfile.h:75
slbm::GridProfile::nodeId
int nodeId
The node id of this GridProfile.
Definition GridProfile.h:233
slbm::InterpolatedProfile
A Profile object based on values interpolated from nearby GridProfile objects.
Definition InterpolatedProfile.h:67
slbm::Location
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.
Definition Location.h:78
slbm
Definition CrustalProfile.h:59