SeismicModel.h
Go to the documentation of this file.00001 #ifndef CSEISMICMODEL_H
00002 #define CSEISMICMODEL_H
00003
00004 #include "types.h"
00005
00006 namespace gplib
00007 {
00008
00009
00010
00011
00012
00013
00014
00015
00016 class SeismicModel
00017 {
00018 public:
00019
00020 enum tArrivalType
00021 {
00022 DirectS, DirectP
00023 };
00024 private:
00025 trealdata SVelErrors;
00026 trealdata ThickErrors;
00027 bool
00028 FuzzComp(const double elem1, const double elem2, const double tolerance);
00029 trealdata PVelocity;
00030 trealdata SVelocity;
00031 trealdata Density;
00032 trealdata Thickness;
00033 trealdata Qp;
00034 trealdata Qs;
00035 double SourceDepth;
00036 double dt;
00037 unsigned int npts;
00038 public:
00039
00040 unsigned int GetNpts() const
00041 {
00042 return npts;
00043 }
00044
00045 void SetNpts(const unsigned int s)
00046 {
00047 npts = s;
00048 }
00049
00050 double GetSourceDepth() const
00051 {
00052 return SourceDepth;
00053 }
00054
00055 void SetSourceDepth(const double s)
00056 {
00057 SourceDepth = s;
00058 }
00059
00060 double GetDt() const
00061 {
00062 return dt;
00063 }
00064
00065 void SetDt(const double s)
00066 {
00067 dt = s;
00068 }
00069
00070 const trealdata &GetPVelocity() const
00071 {
00072 return PVelocity;
00073 }
00074
00075 trealdata &SetPVelocity()
00076 {
00077 return PVelocity;
00078 }
00079
00080 const trealdata &GetSVelocity() const
00081 {
00082 return SVelocity;
00083 }
00084
00085 trealdata &SetSVelocity()
00086 {
00087 return SVelocity;
00088 }
00089
00090 const trealdata &GetDensity() const
00091 {
00092 return Density;
00093 }
00094
00095 trealdata &SetDensity()
00096 {
00097 return Density;
00098 }
00099
00100 const trealdata &GetThickness() const
00101 {
00102 return Thickness;
00103 }
00104
00105 trealdata &SetThickness()
00106 {
00107 return Thickness;
00108 }
00109
00110 const trealdata &GetQp() const
00111 {
00112 return Qp;
00113 }
00114
00115 trealdata &SetQp()
00116 {
00117 return Qp;
00118 }
00119
00120 const trealdata &GetQs() const
00121 {
00122 return Qs;
00123 }
00124
00125 trealdata &SetQs()
00126 {
00127 return Qs;
00128 }
00129
00130 void SetSVelErrors(const trealdata &sve)
00131 {
00132 SVelErrors = sve;
00133 }
00134
00135 void SetThickErrors(const trealdata &te)
00136 {
00137 ThickErrors = te;
00138 }
00139
00140 int FindLayer(const double depth);
00141
00142 double MatchSlowness(const double slowness, const tArrivalType mode);
00143 double CalcArrival(const tArrivalType mode, const double recdist);
00144 double CalcTravelTime(const tArrivalType mode, const double sdepth,
00145 const double rdepth, const double p);
00146
00147 virtual void ReadModel(const std::string filename)=0;
00148
00149 virtual void WriteModel(const std::string filename)=0;
00150
00151 virtual void WriteRunFile(const std::string &filename)=0;
00152
00153 void WritePlot(const std::string &filename);
00154
00155 void PlotVelWithErrors(const std::string &filename);
00156
00157 void Init(const int nlayers);
00158 SeismicModel(const int nlayers = 0);
00159 SeismicModel(const SeismicModel& source);
00160 SeismicModel& operator=(const SeismicModel& source);
00161 virtual ~SeismicModel();
00162 };
00163
00164 }
00165 #endif // CSEISMICMODEL_H