74 GeoStack(
const int& index,
double* depths,
double* pvelocities,
75 double* svelocities,
double* gradients);
123 void getData(
double* depths,
124 double* pvelocity,
double* svelocity,
double* gradient);
136 void setData(
double* depths,
double* pvelocities,
double* svelocities,
double* gradients);
142 void setDepth(
const vector<double>& z);
149 void setVelocity(
const int& waveType,
const vector<double>& velocity);
155 void setGradient(
const vector<double>& gradient);
160 double getDepth(
const int& k) {
return depth[k]; };
170 double getVelocity(
const int& waveType,
const int& k);
176 double getMantleGradient(
const int& waveType);
183 void getVelocity(
const int& waveType,
double* velocity);
225 double depth[NLAYERS];
232 double pvelocity[NLAYERS];
233 double svelocity[NLAYERS];
248 inline void GeoStack::getData(
double* d,
double* pv,
double* sv,
double* g)
250 for (
int i=0; i<NLAYERS; i++)
253 pv[i] = pvelocity[i];
254 sv[i] = svelocity[i];
256 g[PWAVE] = gradient[PWAVE];
257 g[SWAVE] = gradient[SWAVE];
260 inline void GeoStack::setData(
double* depths,
double* pvelocities,
261 double* svelocities,
double* gradients)
263 for (
int i=0; i<NLAYERS; i++)
265 depth[i] = depths[i];
266 pvelocity[i] = pvelocities[i];
267 svelocity[i] = svelocities[i];
269 gradient[PWAVE] = gradients[PWAVE];
270 gradient[SWAVE] = gradients[SWAVE];
275 inline double GeoStack::getVelocity(
const int& waveType,
const int& k)
277 if (waveType == PWAVE)
282 inline double GeoStack::getMantleGradient(
const int& waveType)
284 return gradient[waveType];
287 inline void GeoStack::getVelocity(
const int& waveType,
double* v)
289 if (waveType == PWAVE)
290 for (
int k=0; k<NLAYERS; ++k)
293 for (
int k=0; k<NLAYERS; ++k)
297 inline void GeoStack::setDepth(
const vector<double>& z)
299 for (
int i=0; i<NLAYERS; i++)
305 inline void GeoStack::setVelocity(
const int& waveType,
const vector<double>& v)
307 if (waveType == PWAVE)
308 for (
int i=0; i<NLAYERS; i++)
310 else if (waveType == SWAVE)
311 for (
int i=0; i<NLAYERS; i++)
315 inline void GeoStack::setGradient(
const vector<double>& g)
317 gradient[PWAVE] = g[PWAVE];
318 gradient[SWAVE] = g[SWAVE];
Manages all information related to a single node in a Grid object.
double getDepth(const int &k)
Retrieve the depth of the k'th interval, in km.
GeoStack(const GeoStack &GeoStack)
Copy constructor.
void setRefCount(const int &count)
bool hasLowVelocityZone()
Return true if (1) any finite thickness layer above the middle crust has a velocity that exceeds the ...
GeoStack & operator=(const GeoStack &other)
Equal operator.
static int geoStackClassCount
void setIndex(const int &idx)
bool operator==(const GeoStack &other)
Equality operator.
void getMantleGradient(double *g)
Retrieve the P and S velocity gradients in the mantle, in 1/sec.
GeoStack(const int &index, double *depths, double *pvelocities, double *svelocities, double *gradients)
bool operator!=(const GeoStack &other)
Inequality operator.
static int getClassCount()
GeoStack()
Default constructor.
string toString()
Return the information content of this GeoStack formatted in small text table.