SurfaceWaveModel.h

Go to the documentation of this file.
00001 #ifndef SURFACEWAVEMODEL_H_
00002 #define SURFACEWAVEMODEL_H_
00003 #include "types.h"
00004 #include <string>
00005 #include <vector>
00006 
00007 namespace gplib
00008   {
00009     /** \addtogroup seistools Seismic data analysis and modeling */
00010     /* @{ */
00011 
00012     //! A class to store 1D model for calculation of synthetic surface wave data
00013     /*! This is the base class for general 1D surface wave models.
00014      *
00015      */
00016     class SurfaceWaveModel
00017       {
00018     private:
00019       trealdata pvvelocities;
00020       trealdata phvelocities;
00021       trealdata svvelocities;
00022       trealdata shvelocities;
00023       trealdata densities;
00024       trealdata thicknesses;
00025       trealdata eta;
00026       trealdata qmu;
00027       trealdata qkappa;
00028       double refperiod;
00029       int anisotropic;
00030       std::string name;
00031       int carddeckmodel;
00032       int ninnercore;
00033       int noutercore;
00034       void WriteLayer(std::ostream &stream, const unsigned int index,
00035           const trealdata &depth) const;
00036     protected:
00037       void CheckConsistency() const;
00038     public:
00039       const trealdata &GetPvVelocities() const
00040         {
00041           return pvvelocities;
00042         }
00043       const trealdata &GetPhVelocities() const
00044         {
00045           return phvelocities;
00046         }
00047       const trealdata &GetSvVelocities() const
00048         {
00049           return svvelocities;
00050         }
00051       const trealdata &GetShVelocities() const
00052         {
00053           return shvelocities;
00054         }
00055       const trealdata &GetDensities() const
00056         {
00057           return densities;
00058         }
00059       const trealdata &GetThicknesses() const
00060         {
00061           return thicknesses;
00062         }
00063       const trealdata &GetEta() const
00064         {
00065           return eta;
00066         }
00067       const trealdata &GetQmu() const
00068         {
00069           return qmu;
00070         }
00071       const trealdata &GetQkappa() const
00072         {
00073           return qkappa;
00074         }
00075       std::string GetName() const
00076         {
00077           return name;
00078         }
00079       trealdata &SetPvVelocities()
00080         {
00081           return pvvelocities;
00082         }
00083       trealdata &SetPhVelocities()
00084         {
00085           return phvelocities;
00086         }
00087       trealdata &SetSvVelocities()
00088         {
00089           return svvelocities;
00090         }
00091       trealdata &SetShVelocities()
00092         {
00093           return shvelocities;
00094         }
00095       trealdata &SetDensities()
00096         {
00097           return densities;
00098         }
00099       trealdata &SetThicknesses()
00100         {
00101           return thicknesses;
00102         }
00103       trealdata &SetEta()
00104         {
00105           return eta;
00106         }
00107       trealdata &SetQmu()
00108         {
00109           return qmu;
00110         }
00111       trealdata &SetQkappa()
00112         {
00113           return qkappa;
00114         }
00115       double GetMaxDepth(const double depth);
00116       //! Splits a layer into several layers with a maximum thickness of maxthick, but otherwise identical properties
00117       int SplitLayer(const int index, const double maxthick);
00118       //! Insert a layer with 0 thickness to create a discontinuity for the forward code
00119       void AddDiscontinuity(const int index);
00120       //! Merge this model with another background model, the depth range below this model will be filled with the values from the background model
00121       void MergeModel(const SurfaceWaveModel &Background);
00122       //! Read a model from a file
00123       virtual void ReadModel(const std::string &filename) = 0;
00124       //! Write the model to a file
00125       virtual void WriteModel(const std::string &filename) const = 0;
00126       //! Write out a script that when executed performs a forward calculation for this model
00127       virtual void WriteRunFile(const std::string &filename, const std::vector<
00128           double> periods) const = 0;
00129       //! Write out an ascii file for plotting with xmgrace or similar programs
00130       void WritePlot(const std::string &filename) const;
00131       SurfaceWaveModel& operator=(const SurfaceWaveModel& source);
00132       SurfaceWaveModel(const SurfaceWaveModel &Old);
00133       SurfaceWaveModel();
00134       virtual ~SurfaceWaveModel();
00135       };
00136   /* @} */
00137   }
00138 #endif /*SURFACEWAVEMODEL_H_*/

Generated on Tue May 4 16:52:15 2010 for GPLIB++ by  doxygen 1.5.8