38 #ifndef GRIDPROFILESLBM_H_
39 #define GRIDPROFILESLBM_H_
58 class InterpolatedProfile;
84 const int& i,
const double& lat,
85 const double& lon,
const double& elev,
86 const double& zwater,
GeoStack* gstack);
98 static string class_name() {
return "GridProfileSLBM"; };
118 void getData(
double* depths,
double* pvelocity,
double* svelocity,
double* gradient);
130 void setData(
double* depths,
double* pvelocities,
131 double* svelocities,
double* gradients);
144 void setVelocity(
const int& waveType,
const vector<double>& velocity);
155 double getInterfaceRadius(
const int& k);
162 double getInterfaceDepth(
const int& k);
171 {
return geoStack->getVelocity(waveType, k); };
178 {
return geoStack->getMantleGradient(waveType); };
183 void getInterfaceDepths(vector<double>& depths);
191 { geoStack->getVelocity(waveType, velocity); };
221 inline double GridProfileSLBM::getInterfaceRadius(
const int& k)
232 return radius - geoStack->getDepth(k);
233 return radius + waterThick;
236 inline void GridProfileSLBM::getData(
double* d,
237 double* pv,
double* sv,
double* g)
239 double r = getEarthRadius();
240 for (
int k=0; k<NLAYERS; k++)
242 d[k] = r - getInterfaceRadius(k);
243 pv[k] = geoStack->getVelocity(PWAVE, k);
244 sv[k] = geoStack->getVelocity(SWAVE, k);
246 g[PWAVE] = geoStack->getMantleGradient(PWAVE);
247 g[SWAVE] = geoStack->getMantleGradient(SWAVE);
250 inline double GridProfileSLBM::getInterfaceDepth(
const int& k)
253 return getEarthRadius() - getInterfaceRadius(k);
256 inline void GridProfileSLBM::getInterfaceDepths(vector<double>& depths)
258 depths.resize(NLAYERS);
259 double r = getEarthRadius();
260 for (
int k=0; k<NLAYERS; k++)
261 depths[k] = r - getInterfaceRadius(k);
Manages all information related to a single node in a Grid object.
A 2 dimensional, horizontal grid of GirdProfile objects.
Manages all information related to a single node in a Grid object.
Manages all information related to a single node in a Grid object.
GeoStack * geoStack
The GeoStack object that holds all the interface depths, velocities and gradients.
GridProfileSLBM(const GridProfileSLBM &other)
Copy constructor.
~GridProfileSLBM()
Destructor.
double getVelocity(const int &waveType, const int &k)
Retrieve the P or S velocity of the k'th interval, in km/sec.
void setDepths(const vector< double > &depths)
Set the layer depths to specified values.
int getGeoStackId()
Retrieve the index of the GeoStack that holds the information about model interfaces,...
void setVelocity(const int &waveType, const vector< double > &velocity)
Set the P or S velocity to specified values.
void setData(double *depths, double *pvelocities, double *svelocities, double *gradients)
Set the P and S velocities and gradients associated with this GridProfileSLBM object to specified val...
static string class_name()
void setGradient(const vector< double > &gradient)
Set the P and S velocity gradients to specified values.
double getMantleGradient(const int &waveType)
Retrieve the P or S velocity gradient in the mantle, in 1/sec.
GridProfileSLBM(Grid &g, const int &i, const double &lat, const double &lon, const double &elev, const double &zwater, GeoStack *gstack)
Parameterized constructor.
void getMantleGradient(double *g)
Retrieve the P and S velocity gradients in the mantle, in 1/sec.
void getVelocity(const int &waveType, double *velocity)
Retrieve the P or S velocities of all intervals, in km/sec.