RSTT: slbm::Grid Class Reference

RSTT 3.1.0 Regional Seismic Travel Time

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
slbm::Grid Class Reference

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

`#include <Grid.h>`

Inheritance diagram for slbm::Grid:

## Public Member Functions
| 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 void | clear ()
| Clears and releases all memory held by this Grid object. More...
virtual void | loadFromFile (const string &filename)
| Load the depth, velocity and gradient information from an ascii flat file. More...
virtual void | loadFromDirectory (const string &dirName)
| Load the depth, velocity and gradient information from binary files in specified directory. More...
virtual void | loadFromDataBuffer (util::DataBuffer &buffer)
| Load the depth, velocity and gradient information from DataBuffer. More...
virtual void | saveVelocityModel (util::DataBuffer &buffer)
| Save the Earth model currently in memory, to a DataBuffer. More...
virtual void | saveVelocityModel (const string &filename, const int &format)
| Save the Earth model currently in memory, to an ascii flat file. More...
virtual int | getBufferSize () const
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 GridProfile * | getProfile (const int &nodeId)
| Retrieve a pointer to the GridProfile that is node (i, j) in this Grid. More...
virtual GreatCircle * | getGreatCircle (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 CrustalProfile * | getReceiverProfile (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 CrustalProfile * | getSourceProfile (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 LayerProfile * | getLayerProfile (GreatCircle *greatCircle, Location &location)
| Retrieve a LayerProfile containing data appropriate for the specified GreatCircle, at the specified geographic latitude and longitude. More...
virtual QueryProfile * | getQueryProfile (Location &location)
| Retrieve a QueryProfile containing all available model information, at the latitude and longitude of the specified Location. More...
vector< vector< Uncertainty * > > & | getUncertainty ()
Uncertainty & | getUncertainty (int phase, int attribute)
vector< UncertaintyPathDep * > & | getUncertaintyPathDep ()
UncertaintyPathDep & | getUncertaintyPathDep (int phase)
virtual double | getAverageMantleVelocity (const int &waveType)
| Retrieve the average P or S wave velocity of the mantle, in km/sec. More...
virtual void | setAverageMantleVelocity (const int &waveType, const double &velocity)
| Retrieve the average P or S wave velocity of the mantle, in km/sec. More...
virtual int | getNCrustalProfiles ()
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 | 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 | 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...
virtual 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...
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 | getActiveNodeNeighbors (const int &nodeid, int neighbors[], int &nNeighbors)
virtual void | getActiveNodeNeighbors (const int &nodeid, vector< int > &neighbors)
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 int | addGeoStack (GeoStack *geoStack)
virtual size_t | memSize ()
virtual size_t | memSizeCrustalProfiles ()
virtual string | getTessId ()
string & | getModelPath ()
virtual string | toString ()
virtual void | setInterpolatorType (const string &interpolatorType)
virtual string | getInterpolatorType ()
const string | getOutputDirectory ()
void | specifyOutputDirectory (const string &outputDir)

## Static Public Member Functions
static Grid * | getGrid (const string &modelDirectory)
static Grid * | getGrid (util::DataBuffer &buffer)
static bool | fileExists (const string &fileName)
static string | class_name ()

## Protected Member Functions
void | writeBufferToFile (util::DataBuffer &buffer, string fileName)
void | reaDataBuffererFromFile (util::DataBuffer &buffer, string dirname, string fileName)

## Protected Attributes
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
GeoTessPolygon * | polygon
CrustalProfileStore * | sources
CrustalProfileStore * | receivers
vector< vector< Uncertainty * > > | uncertainty
vector< UncertaintyPathDep * > | uncertaintyPathDep

## 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 Grid::getCrustalProfile() Grid 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 Grid object are deleted in the Grid destructor.

Definition at line 89 of file Grid.h.

## Constructor & Destructor Documentation

## ◆ Grid()

slbm::Grid::Grid | ( |  | ) |

Default constructor.

Default constructor.

## ◆ ~Grid()

virtual slbm::Grid::~Grid | ( |  | ) |
| virtual

Destructor.

Destructor.

## Member Function Documentation

## ◆ addGeoStack()

virtual int slbm::Grid::addGeoStack | ( | GeoStack * | geoStack | ) |
| virtual

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ class_name()

static string slbm::Grid::class_name | ( |  | ) |
| inlinestatic

Returns the class name.

Definition at line 123 of file Grid.h.

## ◆ clear()

virtual void slbm::Grid::clear | ( |  | ) |
| virtual

Clears and releases all memory held by this Grid object.

Clears and releases all memory held by this Grid object.

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ clearActiveNodes()

void slbm::Grid::clearActiveNodes | ( |  | ) |

## ◆ clearCrustalProfiles()

void slbm::Grid::clearCrustalProfiles | ( |  | ) |
| inlinevirtual

Delete all the CrustalProfile objects managed by this Grid.

Delete all the CrustalProfile objects managed by this Grid.

Definition at line 562 of file Grid.h.

## ◆ clearNodeHitCount()

void slbm::Grid::clearNodeHitCount | ( |  | ) |
| inlinevirtual

Definition at line 579 of file Grid.h.

## ◆ fileExists()

bool slbm::Grid::fileExists | ( | const string & | fileName | ) |
| inlinestatic

Definition at line 585 of file Grid.h.

## ◆ findProfile()

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

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

  location | the Location of the desired profile
  neighbors | the GridProfile objects which surround the specified Location.
  nodeIds | the indices of the nodes correspondingn to each neighbor.
  coefficients | the interpolation coefficient corresponding to each neighbor.

Returns
  true if successful, false if location is outside valid range of the model.

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getActiveNodeId()

virtual int slbm::Grid::getActiveNodeId | ( | int | nodeId | ) |
| inlinevirtual

Retrieve the grid node id that corresponds to a specified active node id.

Retrieve the grid node id that corresponds to a specified active node id.

Definition at line 401 of file Grid.h.

## ◆ getActiveNodeNeighborInfo() [1/2]

virtual void slbm::Grid::getActiveNodeNeighborInfo | ( | const int & | nid,
|  | int | neighbors[],
|  | double | distance[],
|  | double | azimuth[],
|  | int & | nNeighbors
| ) |  |
| virtual

## ◆ getActiveNodeNeighborInfo() [2/2]

virtual void slbm::Grid::getActiveNodeNeighborInfo | ( | const int & | nid,
|  | vector< int > & | neighbors,
|  | vector< double > & | distance,
|  | vector< double > & | azimuth
| ) |  |
| virtual

## ◆ getActiveNodeNeighbors() [1/2]

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

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getActiveNodeNeighbors() [2/2]

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

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getAverageMantleVelocity()

virtual double slbm::Grid::getAverageMantleVelocity | ( | const int & | waveType | ) |
| virtual

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

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

Parameters

  waveType | either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE.

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

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getBufferSize()

virtual int slbm::Grid::getBufferSize | ( |  | ) | const
| virtual

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getGreatCircle()

virtual GreatCircle* slbm::Grid::getGreatCircle | ( | 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
| ) |  |
| virtual

Retrieve a GreatCircle object between a source and a receiver.

Retrieve a GreatCircle object composed of two CrustalProfile objects, one at either end of the GreatCircle, and a number of equally spaced LayerProfile objects positioned along the interface where the head wave will travel.

Parameters

  phase | the phase that this GreatCircle is to support. Must be one of SLBMGlobals::Pn, SLBMGlobals::Sn, SLBMGlobals::Pg or SLBMGlobals::Lg.
  latSource | the geographic latitude at the source end of the GreatCircle, in radians.
  lonSource | the geographic longitude at the source end of the GreatCircle, in radians.
  depthSource | the depth of the source, km
  latReceiver | the geographic latitude at the receiver end of the GreatCircle, in radians.
  lonReceiver | the geographic longitude at the receiver end of the GreatCircle, in radians.
  depthReceiver | the depth of the receiver, in km.
  delta | the desired horizontal separation of the LayerProfile objects along the head wave interface, in radians. The actual separation will be reduced from the requested value somewhat in order that some number of equal sized increments will exactly fit between the source and receiver.
  ch_max | c is the zhao c parameter and h is the turning depth of the ray below the moho. Zhao method only valid for c*h << 1. When c*h > ch_max, then slbm will throw an exception.

## ◆ getGrid() [1/2]

static Grid* slbm::Grid::getGrid | ( | const string & | modelDirectory | ) |
| static

## ◆ getGrid() [2/2]

static Grid* slbm::Grid::getGrid | ( | util::DataBuffer & | buffer | ) |
| static

## ◆ getGridNodeId()

virtual int slbm::Grid::getGridNodeId | ( | int | activeNodeId | ) |
| inlinevirtual

Retrieve the grid node id that corresponds to a specified active node id.

Retrieve the grid node id that corresponds to a specified active node id.

Definition at line 393 of file Grid.h.

## ◆ getInterpolatorType()

virtual string slbm::Grid::getInterpolatorType | ( |  | ) |
| virtual

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ getLayerProfile()

LayerProfile * slbm::Grid::getLayerProfile | ( | GreatCircle * | greatCircle,
|  | Location & | location
| ) |  |
| inlinevirtual

Retrieve a LayerProfile containing data appropriate for the specified GreatCircle, at the specified geographic latitude and longitude.

Retrieve a LayerProfile containing data appropriate for the specified GreatCircle, at the specified geographic latitude and longitude. For phases Pn and Sn the profile will include data for the mantle. For Pg and Lg, the profile will include data for the middle crust. For Pn and Pg, the velocity stored in the profile will be the P wave velocity and for Sn and Lg the velocity will be the S wave velocity. For Pn and Sn, the gradient will be the P or S wave velocity gradient in the mantle. For Pg and Lg the gradient will be SLBMGlobals::NA_VALUE.

Parameters

  greatCircle | the GreatCircle that the returned LayerProfile object is to support.
  location | the Location of the LayerProfile

Definition at line 534 of file Grid.h.

## ◆ getModelPath()

string& slbm::Grid::getModelPath | ( |  | ) |
| inline

Definition at line 473 of file Grid.h.

## ◆ getNActiveNodes()

virtual int slbm::Grid::getNActiveNodes | ( |  | ) |
| inlinevirtual

Retrieve the number of active nodes.

Retrieve the number of active nodes.

Definition at line 384 of file Grid.h.

## ◆ getNCrustalProfiles()

int slbm::Grid::getNCrustalProfiles | ( |  | ) |
| inlinevirtual

Definition at line 568 of file Grid.h.

## ◆ getNIntervals()

virtual int slbm::Grid::getNIntervals | ( |  | ) |
| inlinevirtual

Retrieve the number of intervals in each Profile.

Retrieve the number of intervals in each Profile. There will be one interval for each layer in the crust, plus one more for the mantle.

Definition at line 178 of file Grid.h.

## ◆ getNNodes()

virtual int slbm::Grid::getNNodes | ( |  | ) |
| inlinevirtual

Retrieve the number of nodes in the model.

Retrieve the number of nodes in the model.

Definition at line 172 of file Grid.h.

## ◆ getNodeAzimuth()

virtual void slbm::Grid::getNodeAzimuth | ( | const int & | node1,
|  | const int & | node2,
|  | double & | azimuth
| ) |  |
| virtual

Retrieve the azimuth in radians from one grid node to another.

Retrieve the azimuth in radians from one grid node to another.

Reimplemented in slbm::GridGeoTess.

## ◆ getNodeHitCount()

virtual void slbm::Grid::getNodeHitCount | ( | const int & | nodeId,
|  | int & | hitCount
| ) |  |
| inlinevirtual

Definition at line 460 of file Grid.h.

## ◆ getNodeNeighborInfo() [1/2]

virtual void slbm::Grid::getNodeNeighborInfo | ( | const int & | nodeId,
|  | int | neighbors[],
|  | double | distance[],
|  | double | azimuth[],
|  | 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. Also returs the angular distance and azimuth from the specified grid node to each of its neighbors. Distances and azimuths are in radians.

Reimplemented in slbm::GridGeoTess.

## ◆ getNodeNeighborInfo() [2/2]

virtual void slbm::Grid::getNodeNeighborInfo | ( | const int & | nodeId,
|  | vector< int > & | neighbors,
|  | vector< double > & | distance,
|  | vector< double > & | azimuth
| ) |  |
| 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. Also returns the angular distance and azimuth from the specified grid node to each of its neighbors. Distances and azimuths are in radians.

Reimplemented in slbm::GridGeoTess.

## ◆ getNodeNeighbors() [1/2]

virtual void slbm::Grid::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 in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getNodeNeighbors() [2/2]

virtual void slbm::Grid::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 in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ getNodeSeparation()

virtual void slbm::Grid::getNodeSeparation | ( | const int & | node1,
|  | const int & | node2,
|  | double & | distance
| ) |  |
| virtual

Retrieve the angular separation in radians between any pair of.

Retrieve the angular separation in radians between any pair of

Reimplemented in slbm::GridGeoTess.

## ◆ getOutputDirectory()

const string slbm::Grid::getOutputDirectory | ( |  | ) |
| inline

Definition at line 481 of file Grid.h.

## ◆ getProfile()

GridProfile * slbm::Grid::getProfile | ( | const int & | nodeId | ) |
| inlinevirtual

Retrieve a pointer to the GridProfile that is node (i, j) in this Grid.

Retrieve a pointer to the GridProfile that is node (i, j) in this Grid.

Parameters

  nodeId | the node index of the desired grid node.

Definition at line 520 of file Grid.h.

## ◆ getQueryProfile()

QueryProfile * slbm::Grid::getQueryProfile | ( | Location & | location | ) |
| inlinevirtual

Retrieve a QueryProfile containing all available model information, at the latitude and longitude of the specified Location.

Retrieve a QueryProfile containing all available model information, at the latitude and longitude of the specified Location.

Parameters

  location | the Location of the QueryProfile

Returns
  the QueryProfile

Definition at line 545 of file Grid.h.

## ◆ getReceiverProfile()

CrustalProfile * slbm::Grid::getReceiverProfile | ( | const int & | phase,
|  | const double & | lat,
|  | const double & | lon,
|  | const double & | depth
| ) |  |
| inlinevirtual

Retrieve a CrustalProfile containing data appropriate for the specified phase at the specified location.

Retrieve a CrustalProfile at the specified location. For phases Pn and Sn the profile will include all intervals down to and including the mantle. For Pg and Lg, the profile will include intervals down to and including the middle crust. For Pn and Pg, the velocities stored in the profile will be P wave velocities and for Sn and Lg the velocities will be S wave velocities. No gradient information is stored in CrustalProfile objects.

Parameters

  phase | the phase for which the CrustalProfile is appropriate. Must be one of Pn, Sn, Pg, Lg which are int constants defined in SLBMGlobals.h
  lat | the geographic latitude in radians.
  lon | the geographic longitude in radians.
  depth | the depth of the source or receiver, in km.

Definition at line 556 of file Grid.h.

## ◆ getSourceProfile()

CrustalProfile * slbm::Grid::getSourceProfile | ( | const int & | phase,
|  | const double & | lat,
|  | const double & | lon,
|  | const double & | depth
| ) |  |
| inlinevirtual

Definition at line 550 of file Grid.h.

## ◆ getTessId()

virtual string slbm::Grid::getTessId | ( |  | ) |
| virtual

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ getUncertainty() [1/2]

vector<vector<Uncertainty*> >& slbm::Grid::getUncertainty | ( |  | ) |
| inline

Retrieve an nPhases by nAttributes array of Uncertainty objects. The 4 phases are 0:Pn, 1:Sn, 2:Pg, 3:Lg. The 3 attributes are 0:TT, 1:SH, 2:AZ.

Definition at line 293 of file Grid.h.

## ◆ getUncertainty() [2/2]

Uncertainty& slbm::Grid::getUncertainty | ( | int | phase,
|  | int | attribute
| ) |  |
| inline

Retrieve the uncertainty for specified phase and attribute

Parameters

  phase | one of 0:Pn, 1:Sn, 2:Pg, 3:Lg.
  attribute | one of 0:TT, 1:SH, 2:AZ.

Returns
  reference to an uncertainty object.

Definition at line 301 of file Grid.h.

## ◆ getUncertaintyPathDep() [1/2]

vector<UncertaintyPathDep*>& slbm::Grid::getUncertaintyPathDep | ( |  | ) |
| inline

Retrieve an nPhases array of UncertaintyPathDep objects. The 4 phases are 0:Pn, 1:Sn, 2:Pg, 3:Lg.

Definition at line 307 of file Grid.h.

## ◆ getUncertaintyPathDep() [2/2]

UncertaintyPathDep& slbm::Grid::getUncertaintyPathDep | ( | int | phase | ) |
| inline

Retrieve the uncertaintyPathDep for specified phase

Parameters

  phase | one of 0:Pn, 1:Sn, 2:Pg, 3:Lg.

Returns
  reference to an uncertaintyPathDep object.

Definition at line 314 of file Grid.h.

## ◆ initializeActiveNodes() [1/2]

void slbm::Grid::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.

Specify the latitude, longitude range in radians that will define which grid nodes are also active nodes. Active nodes are defined as follows: Each triangle in the tessellation is visited. If any one of the three nodes which define the triangle is located within the specified latitude, longitude range, then all three of the nodes are active nodes.

## ◆ initializeActiveNodes() [2/2]

void slbm::Grid::initializeActiveNodes | ( | GeoTessPolygon * | polygon | ) |

Specify the Polygon that will define which grid nodes are also active nodes.

Specify the Polygon that will define which grid nodes are also active nodes. Active nodes are defined as follows: Visit every node in the grid. If it is inside the polygon, then set it to be an active node and set all of its immediate neighbors active as well.

## ◆ is_directory()

virtual bool slbm::Grid::is_directory | ( | const string & | dir | ) |
| virtual

## ◆ loadFromDataBuffer()

virtual void slbm::Grid::loadFromDataBuffer | ( | util::DataBuffer & | buffer | ) |
| virtual

Load the depth, velocity and gradient information from DataBuffer.

Load the Earth model information from DataBuffer

Parameters

  buffer | the DataBuffer from which to load the model

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ loadFromDirectory()

virtual void slbm::Grid::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

  dirName | the name of directory from which to load the model

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ loadFromFile()

virtual void slbm::Grid::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

  filename | the name of the ascii flat file containing the data.

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ memSize()

virtual size_t slbm::Grid::memSize | ( |  | ) |
| virtual

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ memSizeCrustalProfiles()

size_t slbm::Grid::memSizeCrustalProfiles | ( |  | ) |
| inlinevirtual

Definition at line 574 of file Grid.h.

## ◆ operator!=()

virtual bool slbm::Grid::operator!= | ( | const Grid & | other | ) |
| inlinevirtual

Inequality operator.

Inequality operator

Definition at line 118 of file Grid.h.

## ◆ operator==()

virtual bool slbm::Grid::operator== | ( | const Grid & | other | ) |
| virtual

Equality operator.

Equality operator.

## ◆ reaDataBuffererFromFile()

void slbm::Grid::reaDataBuffererFromFile | ( | util::DataBuffer & | buffer,
|  | string | dirname,
|  | string | fileName
| ) |  |
| protected

## ◆ saveVelocityModel() [1/2]

virtual void slbm::Grid::saveVelocityModel | ( | const string & | filename,
|  | const int & | format
| ) |  |
| virtual

Save the Earth model currently in memory, to an ascii flat file.

Save the Earth model currently in memory, to an ascii flat file. 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()

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ saveVelocityModel() [2/2]

virtual void slbm::Grid::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

  buffer | the DataBuffer to which to save the model

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ setAverageMantleVelocity()

virtual void slbm::Grid::setAverageMantleVelocity | ( | const int & | waveType,
|  | const double & | velocity
| ) |  |
| virtual

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

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

Parameters

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

Reimplemented in slbm::GridSLBM, and slbm::GridGeoTess.

## ◆ setInterpolatorType()

virtual void slbm::Grid::setInterpolatorType | ( | const string & | interpolatorType | ) |
| virtual

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ specifyOutputDirectory()

void slbm::Grid::specifyOutputDirectory | ( | const string & | outputDir | ) |

## ◆ toString()

virtual string slbm::Grid::toString | ( |  | ) |
| virtual

Reimplemented in slbm::GridGeoTess, and slbm::GridSLBM.

## ◆ writeBufferToFile()

void slbm::Grid::writeBufferToFile | ( | util::DataBuffer & | buffer,
|  | string | fileName
| ) |  |
| protected

## Member Data Documentation

## ◆ activeNodes

vector<int> slbm::Grid::activeNodes
| protected

Definition at line 497 of file Grid.h.

## ◆ modelPath

string slbm::Grid::modelPath
| protected

The name of the file or directory from which the velocity model was loaded.

The name of the file or directory from which the velocity model was loaded.

Definition at line 490 of file Grid.h.

## ◆ polygon

GeoTessPolygon* slbm::Grid::polygon
| protected

Definition at line 499 of file Grid.h.

## ◆ profiles

vector<GridProfile*> slbm::Grid::profiles
| protected

The GridProfile objects which constitute the nodes in a Grid object.

The GridProfile objects which constitute the nodes in a Grid object.

Definition at line 495 of file Grid.h.

## ◆ receivers

CrustalProfileStore* slbm::Grid::receivers
| protected

Definition at line 502 of file Grid.h.

## ◆ sources

CrustalProfileStore* slbm::Grid::sources
| protected

Definition at line 501 of file Grid.h.

## ◆ uncertainty

vector<vector<Uncertainty*> > slbm::Grid::uncertainty
| protected

Definition at line 504 of file Grid.h.

## ◆ uncertaintyPathDep

vector<UncertaintyPathDep*> slbm::Grid::uncertaintyPathDep
| protected

Definition at line 506 of file Grid.h.

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

- rstt/SLBM/include/Grid.h