GPLIB++
SurfaceWaveObjective.h
Go to the documentation of this file.
1 #ifndef SURFACEWAVEOBJECTIVE_H_
2 #define SURFACEWAVEOBJECTIVE_H_
3 
4 #include "PlottableObjective.h"
5 #include "SurfaceWaveData.h"
6 #include "SurfaceWaveSynthetic.h"
7 #include <string>
8 
9 namespace gplib
10  {
11  /** \addtogroup seistools Seismic data analysis and modeling */
12  /* @{ */
13 
14  //! This class calculates the misfit between observed surface wave dispersion data and the data calculated from a seismic model
16  {
17  private:
18  //! The data that has been measured
19  SurfaceWaveData MeasuredData;
20  //! The synthetic data that corresponds to the current model
21  SurfaceWaveData SynthData;
22  //! The object used to calculate the synthetic data
23  SurfaceWaveSynthetic Synthetic;
24  //! The relative error of the measurements
25  double errorlevel;
26  //! Poisson's ratio Vp/Vs
27  double poisson;
28  public:
29  //! Set Poisson's ratio Vp/Vs
30  void SetPoisson(const double p)
31  {
32  poisson = p;
33  }
34  //! Set the relative error for each measurement
35  void SetErrorLevel(const double level)
36  {
37  errorlevel = level;
38  }
39  //! 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
40  virtual GeneralObjective *clone() const
41  {
42  return new SurfaceWaveObjective(*this);
43  }
44  ;
45  //! Some operations cannot be done in parallel, these are done before
46  virtual void PreParallel(const ttranscribed &member);
47  //! Some operations cannot be done in parallel, these are done after, returns the misfit value
48  virtual double PostParallel(const ttranscribed &member);
49  //! The core performance calculation, has to be safe to be done in parallel
50  virtual void SafeParallel(const ttranscribed &member);
51  //! Write the synthetic data to a sac file with name filename
52  virtual void WriteData(const std::string &filename)
53  {
54  SynthData.WriteAscii(filename);
55  }
56  //! Write the current model to ascii file for calculations
57  virtual void WriteModel(const std::string &filename)
58  {
59  Synthetic.GetModel().WriteModel(filename);
60  }
61  //! Write the current model to ascii file for plotting
62  virtual void WritePlot(const std::string &filename)
63  {
64  Synthetic.GetModel().WritePlot(filename);
65  }
69  virtual ~SurfaceWaveObjective();
70  };
71  /* @} */
72  }
73 #endif /*SURFACEWAVEOBJECTIVE_H_*/
ublas::vector< double > ttranscribed
Definition: gentypes.h:21
void WritePlot(const std::string &filename) const
Write out an ascii file for plotting with xmgrace or similar programs.
This only adds a few plotting functions to GeneralObjective to define a common interface.
This class calculates the misfit between observed surface wave dispersion data and the data calculate...
virtual double PostParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done after, returns the misfit value...
void SetPoisson(const double p)
Set Poisson's ratio Vp/Vs.
A class to read, write and store fundamental mode surface wave dispersion data.
const SurfaceWaveModel & GetModel()
Read only access to the current seismic model.
virtual void WritePlot(const std::string &filename)
Write the current model to ascii file for plotting.
SurfaceWaveObjective & operator=(const SurfaceWaveObjective &source)
virtual void WriteModel(const std::string &filename) const =0
Write the model to a file.
virtual void WriteData(const std::string &filename)
Write the synthetic data to a sac file with name filename.
virtual void SafeParallel(const ttranscribed &member)
The core performance calculation, has to be safe to be done in parallel.
The basic object for any objective function, mainly an interface class and some storage.
SurfaceWaveObjective(const SurfaceWaveObjective &Old)
Calculate synthetic fundamental mode Rayleigh phase velocity data from an isotropic 1D model...
virtual void WriteModel(const std::string &filename)
Write the current model to ascii file for calculations.
virtual void PreParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done before.
virtual void WriteAscii(const std::string &filename) const
Write the data in simple ascii format.
virtual GeneralObjective * clone() const
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.
void SetErrorLevel(const double level)
Set the relative error for each measurement.