RSTT  3.2.0
Regional Seismic Travel Time
All Classes Namespaces Files Functions Variables Typedefs Friends Macros
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 
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 
231 
237  double weight;
238 
246  int nHits;
247 
248  double earthRadius;
249 
251 
252 };
253 
254 } // end slbm namespace
255 
256 #endif // GridProfile.h
#define SLBM_EXP_IMP
Definition: SLBMGlobals.h:180
Manages all information related to a single node in a Grid object.
Definition: GridProfile.h:71
virtual ~GridProfile()
Destructor.
virtual void getInterfaceDepths(vector< double > &depths)
Retrieve the depths of all intervals, in km.
virtual double getEarthRadius()
Definition: GridProfile.h:105
virtual void getMantleGradient(double *gradients)
Retrieve the P and S velocity gradients in the mantle, in 1/sec.
void setActiveNodeId(int id)
Definition: GridProfile.h:216
void depthsToRadii(const vector< double > &depths, vector< vector< float > > &radii)
int nHits
The number of times this node has been 'touched' by a GreatCircle.
Definition: GridProfile.h:246
virtual double getVelocity(const int &waveType, const int &k)
Retrieve the P or S velocity of the k'th interval, in km/sec.
virtual int getGeoStackId()
Retrieve the index of the GeoStack that holds the information about model interfaces,...
static string class_name()
Definition: GridProfile.h:89
void setWeight(const double &w)
Definition: GridProfile.h:206
virtual void getData(double *depths, double *pvelocity, double *svelocity, double *gradient)
Retrieve all the data associated with this Profile.
void depthsToRadii(double depths[NLAYERS], vector< vector< float > > &radii)
virtual void setDepths(const vector< double > &depths)
Set the layer depths to specified values.
double getWeight()
A temporary weight storage assignment function (returned reference) used exclusively by the GreatCirc...
Definition: GridProfile.h:202
double weight
A temporary weight storage location used exclusively by the GreatCircle::getWeights(....
Definition: GridProfile.h:237
virtual double getWaterThick()
virtual double getInterfaceRadius(const int &k)
Retrieve the radius of the k'th interval, in km.
void incrementHitCount()
Definition: GridProfile.h:210
virtual void getVelocity(const int &waveType, double *velocity)
Retrieve the P or S velocities of all intervals, in km/sec.
GridProfile(const int &i, const double &lat, const double &lon, const double &elev)
void addWeight(const double &w)
Definition: GridProfile.h:204
int nodeId
The node id of this GridProfile.
Definition: GridProfile.h:228
virtual void setVelocity(const int &waveType, const vector< double > &velocity)
Set the P or S velocity to specified values.
static int getClassCount()
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.
virtual double getMantleGradient(const int &waveType)
Retrieve the P or S velocity gradient in the mantle, in 1/sec.
const int getNodeId() const
Retrieve the node index of this node in the model grid.
Definition: GridProfile.h:94
virtual void setGradient(const vector< double > &gradient)
Set the P and S velocity gradients to specified values.
static int gridProfileClassCount
Definition: GridProfile.h:250
virtual double getInterfaceDepth(const int &k)
Retrieve the depth of the k'th interval, in km relative sea level.
GridProfile(const int &i, Location &location)
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.
Definition: Location.h:78