RSTT  3.2.0
Regional Seismic Travel Time
All Classes Namespaces Files Functions Variables Typedefs Friends Macros
slbm::GridSLBM Class Reference

A 2 dimensional, horizontal grid of GirdProfile objects. More...

#include <GridSLBM.h>

Inheritance diagram for slbm::GridSLBM:
slbm::Grid

Public Member Functions

 GridSLBM ()
 Default constructor. More...
 
 ~GridSLBM ()
 Destructor. More...
 
void clear ()
 Clears and releases all memory held by this GridSLBM object. More...
 
void loadFromFile (const string &filename)
 Load the depth, velocity and gradient information from an ascii flat file. More...
 
void loadFromDirectory (const string &dirName)
 Load the depth, velocity and gradient information from binary files in specified directory. More...
 
void loadFromDataBuffer (util::DataBuffer &buffer)
 Load the depth, velocity and gradient information from DataBuffer. More...
 
void saveVelocityModel (const string &destination, const int &format)
 Save the Earth model currently in memory, to file(s) More...
 
void saveVelocityModel (util::DataBuffer &buffer)
 Save the Earth model currently in memory, to a DataBuffer. More...
 
int getBufferSize () const
 
double getAverageMantleVelocity (const int &waveType)
 Retreive the average P or S wave velocity of the mantle, in km/sec. More...
 
void setAverageMantleVelocity (const int &waveType, const double &velocity)
 Retreive the average P or S wave velocity of the mantle, in km/sec. More...
 
virtual bool findProfile (Location &location, vector< GridProfile * > &neighbors, vector< int > &nodeIds, vector< double > &coefficients)
 Find the neighboring GridProfile objects and associated interpolation coefficients at a specified Location. More...
 
void getNodeNeighbors (const int &nodeId, int neighbors[], int &nNeighbors)
 Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node. More...
 
void getNodeNeighbors (const int &nodeId, vector< int > &neighbors)
 Retrieve the grid node ids of the nodes that are direct neighbors of the specified grid node. More...
 
void getActiveNodeNeighbors (const int &nodeid, int neighbors[], int &nNeighbors)
 
void getActiveNodeNeighbors (const int &nodeid, vector< int > &neighbors)
 
size_t memSize ()
 
string getTessId ()
 
int addGeoStack (GeoStack *geoStack)
 
string toString ()
 
void setInterpolatorType (const string &interpolatorType)
 
string getInterpolatorType ()
 
- Public Member Functions inherited from slbm::Grid
 Grid ()
 Default constructor. More...
 
virtual ~Grid ()
 Destructor. More...
 
virtual bool operator== (const Grid &other)
 Equality operator. More...
 
virtual bool operator!= (const Grid &other)
 Inequality operator. More...
 
virtual bool is_directory (const string &dir)
 
virtual int getNNodes ()
 Retrieve the number of nodes in the model. More...
 
virtual int getNIntervals ()
 Retrieve the number of intervals in each Profile. More...
 
virtual GridProfilegetProfile (const int &nodeId)
 Retrieve a pointer to the GridProfile that is node (i, j) in this Grid. More...
 
virtual GreatCirclegetGreatCircle (const int &phase, const double &latSource, const double &lonSource, const double &depthSource, const double &latReceiver, const double &lonReceiver, const double &depthReceiver, const double &delta, const double &ch_max)
 Retrieve a GreatCircle object between a source and a receiver. More...
 
virtual CrustalProfilegetReceiverProfile (const int &phase, const double &lat, const double &lon, const double &depth)
 Retrieve a CrustalProfile containing data appropriate for the specified phase at the specified location. More...
 
virtual CrustalProfilegetSourceProfile (const int &phase, const double &lat, const double &lon, const double &depth)
 
virtual void clearCrustalProfiles ()
 Delete all the CrustalProfile objects managed by this Grid. More...
 
virtual LayerProfilegetLayerProfile (GreatCircle *greatCircle, Location &location)
 Retrieve a LayerProfile containing data appropriate for the specified GreatCircle, at the specified geographic latitude and longitude. More...
 
virtual QueryProfilegetQueryProfile (Location &location)
 Retrieve a QueryProfile containing all available model information, at the latitude and longitude of the specified Location. More...
 
vector< vector< UncertaintyPIU * > > & getUncertainty ()
 
vector< vector< UncertaintyPIU * > > & getUncertaintyPIU ()
 
UncertaintyPIUgetUncertaintyPIU (int phase, int attribute)
 
vector< UncertaintyPDU * > & getUncertaintyPDU ()
 
UncertaintyPDUgetUncertaintyPDU (int phase)
 
virtual int getNCrustalProfiles ()
 
void initializeActiveNodes (double activeNodeLatMin, double activeNodeLonMin, double activeNodeLatMax, double activeNodeLonMax)
 Specify the latitude, longitude range in radians that will define which grid nodes are also active nodes. More...
 
void initializeActiveNodes (GeoTessPolygon *polygon)
 Specify the Polygon that will define which grid nodes are also active nodes. More...
 
virtual int getNActiveNodes ()
 Retrieve the number of active nodes. More...
 
void clearActiveNodes ()
 
virtual int getGridNodeId (int activeNodeId)
 Retrieve the grid node id that corresponds to a specified active node id. More...
 
virtual int getActiveNodeId (int nodeId)
 Retrieve the grid node id that corresponds to a specified active node id. More...
 
virtual void getNodeNeighborInfo (const int &nodeId, int neighbors[], double distance[], double azimuth[], int &nNeighbors)
 Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node. More...
 
virtual void getNodeNeighborInfo (const int &nodeId, vector< int > &neighbors, vector< double > &distance, vector< double > &azimuth)
 Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node. More...
 
virtual void getActiveNodeNeighborInfo (const int &nid, int neighbors[], double distance[], double azimuth[], int &nNeighbors)
 
virtual void getActiveNodeNeighborInfo (const int &nid, vector< int > &neighbors, vector< double > &distance, vector< double > &azimuth)
 
virtual void getNodeSeparation (const int &node1, const int &node2, double &distance)
 Retrieve the angular separation in radians between any pair of. More...
 
virtual void getNodeAzimuth (const int &node1, const int &node2, double &azimuth)
 Retrieve the azimuth in radians from one grid node to another. More...
 
virtual void getNodeHitCount (const int &nodeId, int &hitCount)
 
virtual void clearNodeHitCount ()
 
virtual size_t memSizeCrustalProfiles ()
 
string & getModelPath ()
 
const string getOutputDirectory ()
 
void specifyOutputDirectory (const string &outputDir)
 
virtual GeoTessModelSLBMgetModel ()
 

Static Public Member Functions

static string class_name ()
 
- Static Public Member Functions inherited from slbm::Grid
static GridgetGrid (const string &modelDirectory)
 
static GridgetGrid (util::DataBuffer &buffer)
 
static bool fileExists (const string &fileName)
 
static string class_name ()
 

Additional Inherited Members

- Protected Member Functions inherited from slbm::Grid
void writeBufferToFile (util::DataBuffer &buffer, string fileName)
 
void reaDataBuffererFromFile (util::DataBuffer &buffer, string dirname, string fileName)
 
- Protected Attributes inherited from slbm::Grid
string modelPath
 The name of the file or directory from which the velocity model was loaded. More...
 
vector< GridProfile * > profiles
 The GridProfile objects which constitute the nodes in a Grid object. More...
 
vector< int > activeNodes
 
GeoTessModelSLBMmodel
 
GeoTessPolygon * polygon
 
CrustalProfileStoresources
 
CrustalProfileStorereceivers
 
vector< vector< UncertaintyPIU * > > piu
 
vector< UncertaintyPDU * > pdu
 

Detailed Description

A 2 dimensional, horizontal grid of GirdProfile objects.

A 2 dimensional, horizontal grid of GridProfile objects.

When an application or another object in the slbm library requests a CrustalProfile object by calling GridSLBM::getCrustalProfile() GridSLBM will check to see if it already has a pointer to a CrustalProfile object for the same phase and at the same Location. If it does, it will return a pointer to the existing CrustalProfile object. If it does not, it will create a new CrustalProfile object and return that. The map of crustalProfiles can be cleared by calling clearCrustalProfiles(). The CrustalProfile objects owned by a GridSLBM object are deleted in the GridSLBM destructor.

Definition at line 87 of file GridSLBM.h.

Constructor & Destructor Documentation

◆ GridSLBM()

slbm::GridSLBM::GridSLBM ( )

Default constructor.

Default constructor.

◆ ~GridSLBM()

slbm::GridSLBM::~GridSLBM ( )

Destructor.

Destructor.

Member Function Documentation

◆ addGeoStack()

int slbm::GridSLBM::addGeoStack ( GeoStack geoStack)
inlinevirtual

Reimplemented from slbm::Grid.

Definition at line 209 of file GridSLBM.h.

◆ class_name()

static string slbm::GridSLBM::class_name ( )
inlinestatic

Returns the class name.

Definition at line 105 of file GridSLBM.h.

◆ clear()

void slbm::GridSLBM::clear ( )
virtual

Clears and releases all memory held by this GridSLBM object.

Clears and releases all memory held by this GridSLBM object.

Reimplemented from slbm::Grid.

◆ findProfile()

bool slbm::GridSLBM::findProfile ( Location location,
vector< GridProfile * > &  neighbors,
vector< int > &  nodeIds,
vector< double > &  coefficients 
)
inlinevirtual

Find the neighboring GridProfile objects and associated interpolation coefficients at a specified Location.

Given a Location, find the GridProfile objects that surround the Location and compute the interpolation coefficient for each of those surrounding GridProfile objects. Interpolated values will equal the sum of the values at the GridProfile objects times the corresponding interpolation coefficient.

This method is called by getCrustalProfile() and getMantleProfile() to compute InterpolatedProfile objects.

Parameters
locationthe Location of the desired profile.
neighborsthe GridProfile objects which surround the specified Location.
nodeIdsthe node indices of the neighbors
coefficientsthe interpolation coefficient corresponding to each neighbor.
Returns
true if successful, false if location is outside valid range of the model.

Reimplemented from slbm::Grid.

Definition at line 309 of file GridSLBM.h.

◆ getActiveNodeNeighbors() [1/2]

void slbm::GridSLBM::getActiveNodeNeighbors ( const int &  nodeid,
int  neighbors[],
int &  nNeighbors 
)
virtual

Reimplemented from slbm::Grid.

◆ getActiveNodeNeighbors() [2/2]

void slbm::GridSLBM::getActiveNodeNeighbors ( const int &  nodeid,
vector< int > &  neighbors 
)
virtual

Reimplemented from slbm::Grid.

◆ getAverageMantleVelocity()

double slbm::GridSLBM::getAverageMantleVelocity ( const int &  waveType)
inlinevirtual

Retreive the average P or S wave velocity of the mantle, in km/sec.

Retreive the average P or S wave velocity of the mantle. These values are retrieved from the header information in the velocity model file.

Parameters
waveTypeeither SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.
Returns
the average P or S wave mantle velocity, in km/sec.

Reimplemented from slbm::Grid.

Definition at line 153 of file GridSLBM.h.

◆ getBufferSize()

int slbm::GridSLBM::getBufferSize ( ) const
virtual

Reimplemented from slbm::Grid.

◆ getInterpolatorType()

string slbm::GridSLBM::getInterpolatorType ( )
inlinevirtual

Reimplemented from slbm::Grid.

Definition at line 216 of file GridSLBM.h.

◆ getNodeNeighbors() [1/2]

void slbm::GridSLBM::getNodeNeighbors ( const int &  nodeId,
int  neighbors[],
int &  nNeighbors 
)
virtual

Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node.

Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node.

Reimplemented from slbm::Grid.

◆ getNodeNeighbors() [2/2]

void slbm::GridSLBM::getNodeNeighbors ( const int &  nodeId,
vector< int > &  neighbors 
)
virtual

Retrieve the grid node ids of the nodes that are direct neighbors of the specified grid node.

Retrieve the grid node ids of the nodes that are direct neighbors of the specified grid node.

Reimplemented from slbm::Grid.

◆ getTessId()

string slbm::GridSLBM::getTessId ( )
inlinevirtual

Reimplemented from slbm::Grid.

Definition at line 207 of file GridSLBM.h.

◆ loadFromDataBuffer()

void slbm::GridSLBM::loadFromDataBuffer ( util::DataBuffer buffer)
virtual

Load the depth, velocity and gradient information from DataBuffer.

Load the Earth model information from DataBuffer

Parameters
bufferthe DataBuffer from which to load the model

Reimplemented from slbm::Grid.

◆ loadFromDirectory()

void slbm::GridSLBM::loadFromDirectory ( const string &  dirName)
virtual

Load the depth, velocity and gradient information from binary files in specified directory.

Load the Earth model information from binary files in specified directory

Parameters
dirNamethe name of directory from which to load the model

Reimplemented from slbm::Grid.

◆ loadFromFile()

void slbm::GridSLBM::loadFromFile ( const string &  filename)
virtual

Load the depth, velocity and gradient information from an ascii flat file.

Load the Earth model information from an ascii flat file.

Parameters
filenamethe name of the ascii flat file containing the data.

Reimplemented from slbm::Grid.

◆ memSize()

size_t slbm::GridSLBM::memSize ( )
virtual

Reimplemented from slbm::Grid.

◆ saveVelocityModel() [1/2]

void slbm::GridSLBM::saveVelocityModel ( const string &  destination,
const int &  format 
)
virtual

Save the Earth model currently in memory, to file(s)

Save the Earth model currently in memory, to to file(s) An exception will be thrown if the speficied filename is the same as the name of the file from which the Earth model was originally loaded with loadVelocityModel()

Parameters
destinationthe name of the file or directory where the model information is to be saved.
formatinteger in range 1 to 4

Reimplemented from slbm::Grid.

◆ saveVelocityModel() [2/2]

void slbm::GridSLBM::saveVelocityModel ( util::DataBuffer buffer)
virtual

Save the Earth model currently in memory, to a DataBuffer.

Save the Earth model currently in memory, to to a DataBuffer.

Parameters
bufferthe DataBuffer to which to save the model

Reimplemented from slbm::Grid.

◆ setAverageMantleVelocity()

void slbm::GridSLBM::setAverageMantleVelocity ( const int &  waveType,
const double &  velocity 
)
inlinevirtual

Retreive the average P or S wave velocity of the mantle, in km/sec.

Retreive the average P or S wave velocity of the mantle. These values are retrieved from the header information in the velocity model file.

Parameters
waveTypeeither SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.
velocity(output) the average P or S wave mantle velocity, in km/sec.

Reimplemented from slbm::Grid.

Definition at line 161 of file GridSLBM.h.

◆ setInterpolatorType()

void slbm::GridSLBM::setInterpolatorType ( const string &  interpolatorType)
inlinevirtual

Reimplemented from slbm::Grid.

Definition at line 328 of file GridSLBM.h.

◆ toString()

string slbm::GridSLBM::toString ( )
virtual

Reimplemented from slbm::Grid.


The documentation for this class was generated from the following file: