GPLIB++
SurfaceWaveModel.h
Go to the documentation of this file.
1 #ifndef SURFACEWAVEMODEL_H_
2 #define SURFACEWAVEMODEL_H_
3 #include "types.h"
4 #include <string>
5 #include <vector>
6 
7 namespace gplib
8  {
9  /** \addtogroup seistools Seismic data analysis and modeling */
10  /* @{ */
11 
12  //! A class to store 1D model for calculation of synthetic surface wave data
13  /*! This is the base class for general 1D surface wave models.
14  *
15  */
17  {
18  private:
19  trealdata pvvelocities;
20  trealdata phvelocities;
21  trealdata svvelocities;
22  trealdata shvelocities;
23  trealdata densities;
24  trealdata thicknesses;
25  trealdata eta;
26  trealdata qmu;
27  trealdata qkappa;
28  double refperiod;
29  int anisotropic;
30  std::string name;
31  int carddeckmodel;
32  int ninnercore;
33  int noutercore;
34  void WriteLayer(std::ostream &stream, const unsigned int index,
35  const trealdata &depth) const;
36  protected:
37  void CheckConsistency() const;
38  public:
39  const trealdata &GetPvVelocities() const
40  {
41  return pvvelocities;
42  }
43  const trealdata &GetPhVelocities() const
44  {
45  return phvelocities;
46  }
47  const trealdata &GetSvVelocities() const
48  {
49  return svvelocities;
50  }
51  const trealdata &GetShVelocities() const
52  {
53  return shvelocities;
54  }
55  const trealdata &GetDensities() const
56  {
57  return densities;
58  }
59  const trealdata &GetThicknesses() const
60  {
61  return thicknesses;
62  }
63  const trealdata &GetEta() const
64  {
65  return eta;
66  }
67  const trealdata &GetQmu() const
68  {
69  return qmu;
70  }
71  const trealdata &GetQkappa() const
72  {
73  return qkappa;
74  }
75  std::string GetName() const
76  {
77  return name;
78  }
79  trealdata &SetPvVelocities()
80  {
81  return pvvelocities;
82  }
83  trealdata &SetPhVelocities()
84  {
85  return phvelocities;
86  }
87  trealdata &SetSvVelocities()
88  {
89  return svvelocities;
90  }
91  trealdata &SetShVelocities()
92  {
93  return shvelocities;
94  }
95  trealdata &SetDensities()
96  {
97  return densities;
98  }
99  trealdata &SetThicknesses()
100  {
101  return thicknesses;
102  }
103  trealdata &SetEta()
104  {
105  return eta;
106  }
107  trealdata &SetQmu()
108  {
109  return qmu;
110  }
111  trealdata &SetQkappa()
112  {
113  return qkappa;
114  }
115  double GetMaxDepth(const double depth);
116  //! Splits a layer into several layers with a maximum thickness of maxthick, but otherwise identical properties
117  int SplitLayer(const int index, const double maxthick);
118  //! Insert a layer with 0 thickness to create a discontinuity for the forward code
119  void AddDiscontinuity(const int index);
120  //! Merge this model with another background model, the depth range below this model will be filled with the values from the background model
121  void MergeModel(const SurfaceWaveModel &Background);
122  //! Read a model from a file
123  virtual void ReadModel(const std::string &filename) = 0;
124  //! Write the model to a file
125  virtual void WriteModel(const std::string &filename) const = 0;
126  //! Write out a script that when executed performs a forward calculation for this model
127  virtual void WriteRunFile(const std::string &filename, const std::vector<
128  double> periods) const = 0;
129  //! Write out an ascii file for plotting with xmgrace or similar programs
130  void WritePlot(const std::string &filename) const;
134  virtual ~SurfaceWaveModel();
135  };
136  /* @} */
137  }
138 #endif /*SURFACEWAVEMODEL_H_*/
const trealdata & GetPvVelocities() const
void AddDiscontinuity(const int index)
Insert a layer with 0 thickness to create a discontinuity for the forward code.
double GetMaxDepth(const double depth)
const trealdata & GetPhVelocities() const
const trealdata & GetSvVelocities() const
void WritePlot(const std::string &filename) const
Write out an ascii file for plotting with xmgrace or similar programs.
A class to store 1D model for calculation of synthetic surface wave data.
const trealdata & GetQmu() const
std::string GetName() const
SurfaceWaveModel & operator=(const SurfaceWaveModel &source)
trealdata & SetShVelocities()
void MergeModel(const SurfaceWaveModel &Background)
Merge this model with another background model, the depth range below this model will be filled with ...
const trealdata & GetShVelocities() const
int SplitLayer(const int index, const double maxthick)
Splits a layer into several layers with a maximum thickness of maxthick, but otherwise identical prop...
virtual void WriteModel(const std::string &filename) const =0
Write the model to a file.
const trealdata & GetDensities() const
trealdata & SetSvVelocities()
const trealdata & GetEta() const
virtual void ReadModel(const std::string &filename)=0
Read a model from a file.
trealdata & SetThicknesses()
trealdata & SetPvVelocities()
virtual void WriteRunFile(const std::string &filename, const std::vector< double > periods) const =0
Write out a script that when executed performs a forward calculation for this model.
const trealdata & GetThicknesses() const
const trealdata & GetQkappa() const
trealdata & SetPhVelocities()