00001 #ifndef SURFACEWAVEOBJECTIVE_H_ 00002 #define SURFACEWAVEOBJECTIVE_H_ 00003 00004 #include "PlottableObjective.h" 00005 #include "SurfaceWaveData.h" 00006 #include "SurfaceWaveSynthetic.h" 00007 #include <string> 00008 00009 namespace gplib 00010 { 00011 /** \addtogroup seistools Seismic data analysis and modeling */ 00012 /* @{ */ 00013 00014 //! This class calculates the misfit between observed surface wave dispersion data and the data calculated from a seismic model 00015 class SurfaceWaveObjective: public PlottableObjective 00016 { 00017 private: 00018 //! The data that has been measured 00019 SurfaceWaveData MeasuredData; 00020 //! The synthetic data that corresponds to the current model 00021 SurfaceWaveData SynthData; 00022 //! The object used to calculate the synthetic data 00023 SurfaceWaveSynthetic Synthetic; 00024 //! The relative error of the measurements 00025 double errorlevel; 00026 //! Poisson's ratio Vp/Vs 00027 double poisson; 00028 public: 00029 //! Set Poisson's ratio Vp/Vs 00030 void SetPoisson(const double p) 00031 { 00032 poisson = p; 00033 } 00034 //! Set the relative error for each measurement 00035 void SetErrorLevel(const double level) 00036 { 00037 errorlevel = level; 00038 } 00039 //! We need clone and create for building an array of derived objects, see FAQ lite 20.8, the return type depends on the derived class 00040 virtual GeneralObjective *clone() const 00041 { 00042 return new SurfaceWaveObjective(*this); 00043 } 00044 ; 00045 //! Some operations cannot be done in parallel, these are done before 00046 virtual void PreParallel(const ttranscribed &member); 00047 //! Some operations cannot be done in parallel, these are done after, returns the misfit value 00048 virtual double PostParallel(const ttranscribed &member); 00049 //! The core performance calculation, has to be safe to be done in parallel 00050 virtual void SafeParallel(const ttranscribed &member); 00051 //! Write the synthetic data to a sac file with name filename 00052 virtual void WriteData(const std::string &filename) 00053 { 00054 SynthData.WriteAscii(filename); 00055 } 00056 //! Write the current model to ascii file for calculations 00057 virtual void WriteModel(const std::string &filename) 00058 { 00059 Synthetic.GetModel().WriteModel(filename); 00060 } 00061 //! Write the current model to ascii file for plotting 00062 virtual void WritePlot(const std::string &filename) 00063 { 00064 Synthetic.GetModel().WritePlot(filename); 00065 } 00066 SurfaceWaveObjective& operator=(const SurfaceWaveObjective& source); 00067 SurfaceWaveObjective(const SurfaceWaveObjective &Old); 00068 SurfaceWaveObjective(const SurfaceWaveData &Data); 00069 virtual ~SurfaceWaveObjective(); 00070 }; 00071 /* @} */ 00072 } 00073 #endif /*SURFACEWAVEOBJECTIVE_H_*/
1.5.8