GPLIB++
Public Types | Public Member Functions | List of all members
gplib::SeismicModel Class Referenceabstract

The class SeismicModel is the base class for some of the model format for seismic codes. More...

#include <SeismicModel.h>

Inheritance diagram for gplib::SeismicModel:
Inheritance graph
[legend]

Public Types

enum  tArrivalType { DirectS, DirectP }
 Do we want to calculate the arrival of a direct S-Wave or a P-wave. More...
 

Public Member Functions

unsigned int GetNpts () const
 Get the number of points for synthetic seismogram calculation. More...
 
void SetNpts (const unsigned int s)
 Set the number of points for synthetic seismogram calculation. More...
 
double GetSourceDepth () const
 Get the depth to the seismic source that generates the wavefield. More...
 
void SetSourceDepth (const double s)
 Set the depth to the seismic source. More...
 
double GetDt () const
 Get the time between two samples in s, this is for synthetic forward calculations. More...
 
void SetDt (const double s)
 Set the time between two samples in s, this is for synthetic forward calculations. More...
 
const trealdata & GetPVelocity () const
 Read-only access to the vector of P-velocities in km/s in each layer. More...
 
trealdata & SetPVelocity ()
 Read-write access to the vector of P-velocities in km/s in each layer. More...
 
const trealdata & GetSVelocity () const
 Read-only access to the vector of S-velocities in km/s in each layer. More...
 
trealdata & SetSVelocity ()
 Read-write access to the vector of S-velocities in km/s in each layer. More...
 
const trealdata & GetDensity () const
 Read-only access to the vector of densities in g/cm^3 in each layer. More...
 
trealdata & SetDensity ()
 Read-write access to the vector of densities in g/cm^3 in each layer. More...
 
const trealdata & GetThickness () const
 Read-only access to the vector of thicknesses in km in each layer. More...
 
trealdata & SetThickness ()
 Read-write access to the vector of thicknesses in km in each layer. More...
 
const trealdata & GetQp () const
 Read-only access to the vector of P quality factors for each layer. More...
 
trealdata & SetQp ()
 Read-write access to the vector of P quality factors for each layer. More...
 
const trealdata & GetQs () const
 Read-only access to the vector of S quality factors for each layer. More...
 
trealdata & SetQs ()
 Read-write access to the vector of S quality factors for each layer. More...
 
void SetSVelErrors (const trealdata &sve)
 Set error bars on S-velocities for plotting. More...
 
void SetThickErrors (const trealdata &te)
 Set error bars on Thicknesses for plotting. More...
 
int FindLayer (const double depth)
 Returns the index of the layer that correponds to depth in km. More...
 
double MatchSlowness (const double slowness, const tArrivalType mode)
 Given a slowness in s/km and a wave type calculate the distance that matches this slowness. More...
 
double CalcArrival (const tArrivalType mode, const double recdist)
 
double CalcTravelTime (const tArrivalType mode, const double sdepth, const double rdepth, const double p)
 
virtual void ReadModel (const std::string filename)=0
 Read the model in its native format from a file. More...
 
virtual void WriteModel (const std::string filename)=0
 Write the model in its native format to a file. More...
 
virtual void WriteRunFile (const std::string &filename)=0
 Write out a script that performs a forward calculation for the current model. More...
 
void WritePlot (const std::string &filename)
 Write out an ascii file for plotting with xmgrace etc. More...
 
void PlotVelWithErrors (const std::string &filename)
 Write out an ascii file with error bars for plotting with xmgrace etc. More...
 
void Init (const int nlayers)
 Init provides a convenient way to allocate memory in all structures for a given number of layers. More...
 
 SeismicModel (const int nlayers=0)
 
 SeismicModel (const SeismicModel &source)
 
SeismicModeloperator= (const SeismicModel &source)
 
virtual ~SeismicModel ()
 

Detailed Description

The class SeismicModel is the base class for some of the model format for seismic codes.

We store the basic seismic parameters here and implement some of the common functionailty.

Definition at line 17 of file SeismicModel.h.

Member Enumeration Documentation

Do we want to calculate the arrival of a direct S-Wave or a P-wave.

Enumerator
DirectS 
DirectP 

Definition at line 21 of file SeismicModel.h.

Constructor & Destructor Documentation

gplib::SeismicModel::SeismicModel ( const int  nlayers = 0)

Definition at line 13 of file SeismicModel.cpp.

References Init().

gplib::SeismicModel::SeismicModel ( const SeismicModel source)

Definition at line 23 of file SeismicModel.cpp.

gplib::SeismicModel::~SeismicModel ( )
virtual

Definition at line 19 of file SeismicModel.cpp.

Member Function Documentation

double gplib::SeismicModel::CalcArrival ( const tArrivalType  mode,
const double  recdist 
)

Definition at line 157 of file SeismicModel.cpp.

References CalcTravelTime(), DirectS, and MatchSlowness().

double gplib::SeismicModel::CalcTravelTime ( const tArrivalType  mode,
const double  sdepth,
const double  rdepth,
const double  p 
)

Definition at line 130 of file SeismicModel.cpp.

References DirectS, FindLayer(), and MatchSlowness().

Referenced by CalcArrival().

int gplib::SeismicModel::FindLayer ( const double  depth)

Returns the index of the layer that correponds to depth in km.

Definition at line 89 of file SeismicModel.cpp.

Referenced by CalcTravelTime(), MatchSlowness(), and gplib::FkModel::WriteModel().

const trealdata& gplib::SeismicModel::GetDensity ( ) const
inline

Read-only access to the vector of densities in g/cm^3 in each layer.

Definition at line 91 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().

double gplib::SeismicModel::GetDt ( ) const
inline

Get the time between two samples in s, this is for synthetic forward calculations.

Definition at line 61 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteRunFile().

unsigned int gplib::SeismicModel::GetNpts ( ) const
inline

Get the number of points for synthetic seismogram calculation.

Definition at line 41 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteRunFile().

const trealdata& gplib::SeismicModel::GetPVelocity ( ) const
inline

Read-only access to the vector of P-velocities in km/s in each layer.

Definition at line 71 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().

const trealdata& gplib::SeismicModel::GetQp ( ) const
inline

Read-only access to the vector of P quality factors for each layer.

Definition at line 111 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().

const trealdata& gplib::SeismicModel::GetQs ( ) const
inline

Read-only access to the vector of S quality factors for each layer.

Definition at line 121 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().

double gplib::SeismicModel::GetSourceDepth ( ) const
inline

Get the depth to the seismic source that generates the wavefield.

Definition at line 51 of file SeismicModel.h.

Referenced by gplib::FkModel::WriteModel().

const trealdata& gplib::SeismicModel::GetSVelocity ( ) const
inline

Read-only access to the vector of S-velocities in km/s in each layer.

Definition at line 81 of file SeismicModel.h.

Referenced by main(), gplib::SeismicModelDiff::SafeParallel(), gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().

const trealdata& gplib::SeismicModel::GetThickness ( ) const
inline

Read-only access to the vector of thicknesses in km in each layer.

Definition at line 101 of file SeismicModel.h.

Referenced by main(), gplib::SeismicModelDiff::SafeParallel(), gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().

void gplib::SeismicModel::Init ( const int  nlayers)

Init provides a convenient way to allocate memory in all structures for a given number of layers.

Definition at line 71 of file SeismicModel.cpp.

Referenced by main(), gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), gplib::ResPkModel::ReadModel(), and SeismicModel().

double gplib::SeismicModel::MatchSlowness ( const double  slowness,
const tArrivalType  mode 
)

Given a slowness in s/km and a wave type calculate the distance that matches this slowness.

Definition at line 108 of file SeismicModel.cpp.

References DirectS, and FindLayer().

Referenced by CalcArrival(), and CalcTravelTime().

SeismicModel & gplib::SeismicModel::operator= ( const SeismicModel source)

Definition at line 42 of file SeismicModel.cpp.

Referenced by gplib::ResPkModel::operator=(), and gplib::ResPkModel::ResPkModel().

void gplib::SeismicModel::PlotVelWithErrors ( const std::string &  filename)

Write out an ascii file with error bars for plotting with xmgrace etc.

Definition at line 186 of file SeismicModel.cpp.

References size.

virtual void gplib::SeismicModel::ReadModel ( const std::string  filename)
pure virtual

Read the model in its native format from a file.

Implemented in gplib::ResPkModel, and gplib::FkModel.

trealdata& gplib::SeismicModel::SetDensity ( )
inline

Read-write access to the vector of densities in g/cm^3 in each layer.

Definition at line 96 of file SeismicModel.h.

Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().

void gplib::SeismicModel::SetDt ( const double  s)
inline

Set the time between two samples in s, this is for synthetic forward calculations.

Definition at line 66 of file SeismicModel.h.

Referenced by gplib::C1DRecObjective::PreParallel(), and gplib::FkModel::ReadModel().

void gplib::SeismicModel::SetNpts ( const unsigned int  s)
inline

Set the number of points for synthetic seismogram calculation.

Definition at line 46 of file SeismicModel.h.

Referenced by gplib::C1DRecObjective::PreParallel(), and gplib::FkModel::ReadModel().

trealdata& gplib::SeismicModel::SetPVelocity ( )
inline

Read-write access to the vector of P-velocities in km/s in each layer.

Definition at line 76 of file SeismicModel.h.

Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().

trealdata& gplib::SeismicModel::SetQp ( )
inline

Read-write access to the vector of P quality factors for each layer.

Definition at line 116 of file SeismicModel.h.

Referenced by gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().

trealdata& gplib::SeismicModel::SetQs ( )
inline

Read-write access to the vector of S quality factors for each layer.

Definition at line 126 of file SeismicModel.h.

Referenced by gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().

void gplib::SeismicModel::SetSourceDepth ( const double  s)
inline

Set the depth to the seismic source.

Definition at line 56 of file SeismicModel.h.

Referenced by gplib::FkModel::ReadModel().

void gplib::SeismicModel::SetSVelErrors ( const trealdata &  sve)
inline

Set error bars on S-velocities for plotting.

Definition at line 131 of file SeismicModel.h.

trealdata& gplib::SeismicModel::SetSVelocity ( )
inline

Read-write access to the vector of S-velocities in km/s in each layer.

Definition at line 86 of file SeismicModel.h.

Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().

void gplib::SeismicModel::SetThickErrors ( const trealdata &  te)
inline

Set error bars on Thicknesses for plotting.

Definition at line 136 of file SeismicModel.h.

trealdata& gplib::SeismicModel::SetThickness ( )
inline

Read-write access to the vector of thicknesses in km in each layer.

Definition at line 106 of file SeismicModel.h.

Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().

virtual void gplib::SeismicModel::WriteModel ( const std::string  filename)
pure virtual

Write the model in its native format to a file.

Implemented in gplib::ResPkModel, and gplib::FkModel.

void gplib::SeismicModel::WritePlot ( const std::string &  filename)

Write out an ascii file for plotting with xmgrace etc.

Definition at line 208 of file SeismicModel.cpp.

References size.

Referenced by main(), and gplib::C1DRecObjective::WritePlot().

virtual void gplib::SeismicModel::WriteRunFile ( const std::string &  filename)
pure virtual

Write out a script that performs a forward calculation for the current model.

Implemented in gplib::ResPkModel.


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