RSTT: rstt/SLBM/include/GridProfile.h Source File

RSTT 3.1.0 Regional Seismic Travel Time

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();
85
89 static string class_name() {return "GridProfile"; };
90
94 const int getNodeId() const { return nodeId; };
95
103 virtual int getGeoStackId() = ABSTRACT;
104
105 virtual double getEarthRadius() { return earthRadius; }
106
116 virtual void getData(double* depths, double* pvelocity, double* svelocity, double* gradient) = ABSTRACT;
117
128 virtual void setData(double* depths, double* pvelocities,
129 double* svelocities, double* gradients) = ABSTRACT;
130
135 virtual void setDepths(const vector<double>& depths) = ABSTRACT;
136
142 virtual void setVelocity(const int& waveType, const vector<double>& velocity) = ABSTRACT;
143
148 virtual void setGradient(const vector<double>& gradient) = ABSTRACT;
149
153 virtual double getInterfaceRadius(const int& k) = ABSTRACT;
154
160 virtual double getInterfaceDepth(const int& k) = ABSTRACT;
161
168 virtual double getVelocity(const int& waveType, const int& k) = ABSTRACT;
169
174 virtual double getMantleGradient(const int& waveType) = ABSTRACT;
175
179 virtual void getInterfaceDepths(vector<double>& depths) = ABSTRACT;
180
186 virtual void getVelocity(const int& waveType, double* velocity) = ABSTRACT;
187
191 virtual void getMantleGradient(double* gradients) = ABSTRACT;
192
193 virtual double getWaterThick() = ABSTRACT;
194
202 double getWeight() { return weight; };
203
204 void addWeight(const double& w) { weight += w; };
205
206 void setWeight(const double& w) { weight = w; };
207
208 void clearHitCount() { nHits = 0; };
209
210 void incrementHitCount() { ++nHits; };
211
212 int getHitCount() { return nHits; };
213
214 int getActiveNodeId() { return activeNodeId; };
215
216 void setActiveNodeId(int id) { activeNodeId = id; };
217
218 static int getClassCount();
219
220 void depthsToRadii(double depths[NLAYERS], vector<vector<float> >& radii);
221 void depthsToRadii(const vector<double>& depths, vector<vector<float> >& radii);
222
223 protected:
224
228 int nodeId;
229
230 int activeNodeId;
231
237 double weight;
238
246 int nHits;
247
248 double earthRadius;
249
250 static int gridProfileClassCount;
251
252 };
253
254 } // end slbm namespace
255
256 #endif // GridProfile.h
slbm::GridProfile::nHits
int nHits
The number of times this node has been 'touched' by a GreatCircle.
Definition: GridProfile.h:246
slbm::GridProfile::getInterfaceDepth
virtual double getInterfaceDepth(const int &k)
Retrieve the depth of the k'th interval, in km relative sea level.
slbm::GridProfile::activeNodeId
int activeNodeId
Definition: GridProfile.h:230
slbm::GridProfile::class_name
static string class_name()
Definition: GridProfile.h:89
slbm::GridProfile::nodeId
int nodeId
The node id of this GridProfile.
Definition: GridProfile.h:228
slbm::GridProfile::setDepths
virtual void setDepths(const vector< double > &depths)
Set the layer depths to specified values.
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::GridProfile::getEarthRadius
virtual double getEarthRadius()
Definition: GridProfile.h:105
slbm::GridProfile::setVelocity
virtual void setVelocity(const int &waveType, const vector< double > &velocity)
Set the P or S velocity to specified values.
slbm::GridProfile::getHitCount
int getHitCount()
Definition: GridProfile.h:212
GeoStack.h
slbm::GridProfile::getActiveNodeId
int getActiveNodeId()
Definition: GridProfile.h:214
slbm::GridProfile::clearHitCount
void clearHitCount()
Definition: GridProfile.h:208
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::getWaterThick
virtual double getWaterThick()
slbm::GridProfile::getNodeId
const int getNodeId() const
Retrieve the node index of this node in the model grid.
Definition: GridProfile.h:94
SLBMGlobals.h
slbm::GridProfile
Manages all information related to a single node in a Grid object.
Definition: GridProfile.h:71
slbm::GridProfile::getInterfaceDepths
virtual void getInterfaceDepths(vector< double > &depths)
Retrieve the depths of all intervals, in km.
slbm::GridProfile::depthsToRadii
void depthsToRadii(const vector< double > &depths, vector< vector< float > > &radii)
slbm::GridProfile::getData
virtual void getData(double *depths, double *pvelocity, double *svelocity, double *gradient)
Retrieve all the data associated with this Profile.
slbm::GridProfile::getClassCount
static int getClassCount()
slbm::GridProfile::~GridProfile
virtual ~GridProfile()
Destructor.
slbm::GridProfile::getWeight
double getWeight()
A temporary weight storage assignment function (returned reference) used exclusively by the GreatCirc...
Definition: GridProfile.h:202
slbm::GridProfile::depthsToRadii
void depthsToRadii(double depths[NLAYERS], vector< vector< float > > &radii)
slbm::GridProfile::getMantleGradient
virtual void getMantleGradient(double *gradients)
Retrieve the P and S velocity gradients in the mantle, in 1/sec.
SLBM_EXP_IMP
#define SLBM_EXP_IMP
Definition: SLBMGlobals.h:180
Location.h
slbm::GridProfile::setGradient
virtual void setGradient(const vector< double > &gradient)
Set the P and S velocity gradients to specified values.
slbm::GridProfile::earthRadius
double earthRadius
Definition: GridProfile.h:248
slbm::GridProfile::weight
double weight
A temporary weight storage location used exclusively by the GreatCircle::getWeights(....
Definition: GridProfile.h:237
slbm::GridProfile::getInterfaceRadius
virtual double getInterfaceRadius(const int &k)
Retrieve the radius of the k'th interval, in km.
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::getMantleGradient
virtual double getMantleGradient(const int &waveType)
Retrieve the P or S velocity gradient in the mantle, in 1/sec.
slbm::GridProfile::gridProfileClassCount
static int gridProfileClassCount
Definition: GridProfile.h:250
slbm::GridProfile::GridProfile
GridProfile()
Definition: GridProfile.h:75
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::setActiveNodeId
void setActiveNodeId(int id)
Definition: GridProfile.h:216
slbm::GridProfile::GridProfile
GridProfile(const int &i, const double &lat, const double &lon, const double &elev)
slbm::GridProfile::setWeight
void setWeight(const double &w)
Definition: GridProfile.h:206
slbm::GridProfile::addWeight
void addWeight(const double &w)
Definition: GridProfile.h:204
slbm::GridProfile::GridProfile
GridProfile(const int &i, Location &location)
slbm::GridProfile::getGeoStackId
virtual int getGeoStackId()
Retrieve the index of the GeoStack that holds the information about model interfaces,...
slbm::GridProfile::incrementHitCount
void incrementHitCount()
Definition: GridProfile.h:210
slbm
Definition: CrustalProfile.h:59