RSTT 3.2.1 Regional Seismic Travel Time

Loading...
Searching...
No Matches
GridProfile.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 GridProfile_H
39#define GridProfile_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 "Location.h"
52#include "GeoStack.h"
53
54// **** _BEGIN SLBM NAMESPACE_ **************************************************
55
56 namespace slbm {
57
58 class InterpolatedProfile;
59 class Grid;
60
61 class SLBM_EXP_IMP GridProfile : public Location
71{
72
73 public:
74
75 GridProfile() { ++gridProfileClassCount; };
76
77 GridProfile(const int& i, const double& lat, const double& lon, const double& elev);
78
79 GridProfile(const int& i, Location& location);
80
84 // virtual GridProfile *clone() = 0;
85
89 virtual ~GridProfile();
90
94 static string class_name() {return "GridProfile"; };
95
99 const int getNodeId() const { return nodeId; };
100
108 virtual int getGeoStackId() = ABSTRACT;
109
110 virtual double getEarthRadius() { return earthRadius; }
111
121 virtual void getData(double* depths, double* pvelocity, double* svelocity, double* gradient) = ABSTRACT;
122
133 virtual void setData(double* depths, double* pvelocities,
134 double* svelocities, double* gradients) = ABSTRACT;
135
140 virtual void setDepths(const vector<double>& depths) = ABSTRACT;
141
147 virtual void setVelocity(const int& waveType, const vector<double>& velocity) = ABSTRACT;
148
153 virtual void setGradient(const vector<double>& gradient) = ABSTRACT;
154
158 virtual double getInterfaceRadius(const int& k) = ABSTRACT;
159
165 virtual double getInterfaceDepth(const int& k) = ABSTRACT;
166
173 virtual double getVelocity(const int& waveType, const int& k) = ABSTRACT;
174
179 virtual double getMantleGradient(const int& waveType) = ABSTRACT;
180
184 virtual void getInterfaceDepths(vector<double>& depths) = ABSTRACT;
185
191 virtual void getVelocity(const int& waveType, double* velocity) = ABSTRACT;
192
196 virtual void getMantleGradient(double* gradients) = ABSTRACT;
197
198 virtual double getWaterThick() = ABSTRACT;
199
207 double getWeight() { return weight; };
208
209 void addWeight(const double& w) { weight += w; };
210
211 void setWeight(const double& w) { weight = w; };
212
213 void clearHitCount() { nHits = 0; };
214
215 void incrementHitCount() { ++nHits; };
216
217 int getHitCount() { return nHits; };
218
219 int getActiveNodeId() { return activeNodeId; };
220
221 void setActiveNodeId(int id) { activeNodeId = id; };
222
223 static int getClassCount();
224
225 void depthsToRadii(double depths[NLAYERS], vector<vector<float> >& radii);
226 void depthsToRadii(const vector<double>& depths, vector<vector<float> >& radii);
227
228 protected:
229
233 int nodeId;
234
235 int activeNodeId;
236
242 double weight;
243
251 int nHits;
252
253 double earthRadius;
254
255 static int gridProfileClassCount;
256
257};
258
259} // end slbm namespace
260
261#endif // GridProfile.h
GeoStack.h
Location.h
SLBMGlobals.h
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition SLBMGlobals.h:180
slbm::Grid
A 2 dimensional, horizontal grid of GirdProfile objects.
Definition Grid.h:91
slbm::GridProfile::~GridProfile
virtual ~GridProfile()
Virtual copy constructor.
slbm::GridProfile::getInterfaceDepths
virtual void getInterfaceDepths(vector< double > &depths)
Retrieve the depths of all intervals, in km.
slbm::GridProfile::getEarthRadius
virtual double getEarthRadius()
Definition GridProfile.h:110
slbm::GridProfile::getMantleGradient
virtual void getMantleGradient(double *gradients)
Retrieve the P and S velocity gradients in the mantle, in 1/sec.
slbm::GridProfile::setActiveNodeId
void setActiveNodeId(int id)
Definition GridProfile.h:221
slbm::GridProfile::depthsToRadii
void depthsToRadii(const vector< double > &depths, vector< vector< float > > &radii)
slbm::GridProfile::nHits
int nHits
The number of times this node has been 'touched' by a GreatCircle.
Definition GridProfile.h:251
slbm::GridProfile::activeNodeId
int activeNodeId
Definition GridProfile.h:235
slbm::GridProfile::getVelocity
virtual double getVelocity(const int &waveType, const int &k)
Retrieve the P or S velocity of the k'th interval, in km/sec.
slbm::GridProfile::getGeoStackId
virtual int getGeoStackId()
Retrieve the index of the GeoStack that holds the information about model interfaces,...
slbm::GridProfile::earthRadius
double earthRadius
Definition GridProfile.h:253
slbm::GridProfile::class_name
static string class_name()
Definition GridProfile.h:94
slbm::GridProfile::setWeight
void setWeight(const double &w)
Definition GridProfile.h:211
slbm::GridProfile::clearHitCount
void clearHitCount()
Definition GridProfile.h:213
slbm::GridProfile::getData
virtual void getData(double *depths, double *pvelocity, double *svelocity, double *gradient)
Retrieve all the data associated with this Profile.
slbm::GridProfile::depthsToRadii
void depthsToRadii(double depths[NLAYERS], vector< vector< float > > &radii)
slbm::GridProfile::setDepths
virtual void setDepths(const vector< double > &depths)
Set the layer depths to specified values.
slbm::GridProfile::getWeight
double getWeight()
A temporary weight storage assignment function (returned reference) used exclusively by the GreatCirc...
Definition GridProfile.h:207
slbm::GridProfile::weight
double weight
A temporary weight storage location used exclusively by the GreatCircle::getWeights(....
Definition GridProfile.h:242
slbm::GridProfile::getWaterThick
virtual double getWaterThick()
slbm::GridProfile::GridProfile
GridProfile()
Definition GridProfile.h:75
slbm::GridProfile::getInterfaceRadius
virtual double getInterfaceRadius(const int &k)
Retrieve the radius of the k'th interval, in km.
slbm::GridProfile::getHitCount
int getHitCount()
Definition GridProfile.h:217
slbm::GridProfile::incrementHitCount
void incrementHitCount()
Definition GridProfile.h:215
slbm::GridProfile::getVelocity
virtual void getVelocity(const int &waveType, double *velocity)
Retrieve the P or S velocities of all intervals, in km/sec.
slbm::GridProfile::GridProfile
GridProfile(const int &i, const double &lat, const double &lon, const double &elev)
slbm::GridProfile::addWeight
void addWeight(const double &w)
Definition GridProfile.h:209
slbm::GridProfile::nodeId
int nodeId
The node id of this GridProfile.
Definition GridProfile.h:233
slbm::GridProfile::setVelocity
virtual void setVelocity(const int &waveType, const vector< double > &velocity)
Set the P or S velocity to specified values.
slbm::GridProfile::getClassCount
static int getClassCount()
slbm::GridProfile::setData
virtual void setData(double *depths, double *pvelocities, double *svelocities, double *gradients)
Set the P and S velocities and gradients associated with this GridProfile object to specified values.
slbm::GridProfile::getMantleGradient
virtual double getMantleGradient(const int &waveType)
Retrieve the P or S velocity gradient in the mantle, in 1/sec.
slbm::GridProfile::getNodeId
const int getNodeId() const
Retrieve the node index of this node in the model grid.
Definition GridProfile.h:99
slbm::GridProfile::setGradient
virtual void setGradient(const vector< double > &gradient)
Set the P and S velocity gradients to specified values.
slbm::GridProfile::getActiveNodeId
int getActiveNodeId()
Definition GridProfile.h:219
slbm::GridProfile::gridProfileClassCount
static int gridProfileClassCount
Definition GridProfile.h:255
slbm::GridProfile::getInterfaceDepth
virtual double getInterfaceDepth(const int &k)
Retrieve the depth of the k'th interval, in km relative sea level.
slbm::GridProfile::GridProfile
GridProfile(const int &i, Location &location)
slbm::InterpolatedProfile
A Profile object based on values interpolated from nearby GridProfile objects.
Definition InterpolatedProfile.h:67
slbm::Location::Location
Location()
slbm
Definition CrustalProfile.h:59