GPLIB++
SWAnisoRoughness.cpp
Go to the documentation of this file.
1 #include "SWAnisoRoughness.h"
2 
3 namespace gplib
4  {
6  veldiffweight(0.0), anisovelweight(1.0), strikediffweight(0.0),
7  deltastrikediffweight(0.0)
8  {
9  }
10 
12  {
13  }
14 
16  {
17  const unsigned int length = member.size() / 6; //we have 6 parameters in the model, so size/6 layers
18  double roughness = std::abs(member(2 * length)); // the loop starts at 1, so we skip this value in the 2nd summation
19  const int fitexp = GetFitExponent();
20  const double anglescale = 90.; //value for phi from 0 to 180
21  for (unsigned int i = 1; i < length; ++i) // for all layers except the top
22  {
23  roughness += veldiffweight * std::pow((member(i + 1 * length)
24  - member(i - 1 + 1 * length)), fitexp); //minimize difference in S velocity between layers
25  roughness += anisovelweight * std::pow(std::abs(member(i + 5
26  * length)), fitexp); //minimize anisovel factor in each layer
27  roughness += strikediffweight * std::pow((member(i + 2 * length))
28  / anglescale, fitexp); //minimize strike within each layer
29  roughness += deltastrikediffweight * std::pow(std::abs(member(i + 3
30  * length) / 30), fitexp); //minimize deltaangle in each layer (for a range :-60/ 60)
31  }
32  SetRMS(std::pow(roughness, 1. / fitexp));
33  }
34 
36  {
37  return GetRMS();
38  }
39 
41  GeneralObjective(Old), veldiffweight(Old.veldiffweight), anisovelweight(
42  Old.anisovelweight), strikediffweight(Old.strikediffweight),
43  deltastrikediffweight(Old.deltastrikediffweight)
44  {
45 
46  }
48  const SWAnisoRoughness& source)
49  {
50  if (this == &source)
51  return *this;
53  veldiffweight = source.veldiffweight;
54  anisovelweight = source.anisovelweight;
55  strikediffweight = source.strikediffweight;
56  deltastrikediffweight = source.deltastrikediffweight;
57  return *this;
58  }
59  }
virtual double PostParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done after, returns the misfit value...
ublas::vector< double > ttranscribed
Definition: gentypes.h:21
GeneralObjective & operator=(const GeneralObjective &source)
virtual void SafeParallel(const ttranscribed &member)
The core performance calculation, has to be safe to be done in parallel.
int GetFitExponent()
Get the Fit exponent.
SWAnisoRoughness & operator=(const SWAnisoRoughness &source)
double GetRMS()
Get the current RMS.
The basic object for any objective function, mainly an interface class and some storage.
Calculate the roughness for anisotropic SW models.
void SetRMS(const double x)