GPLIB++
MTAnisoRoughness.cpp
Go to the documentation of this file.
1 #include "MTAnisoRoughness.h"
2 #include <cmath>
3 
4 namespace gplib
5  {
7  conddiffweight(), anisotropyweight(), strikediffweight()
8  {
9  }
10 
12  {
13  }
14 
16  {
17  const unsigned int length = member.size() / 4; //we have 4 parameters in the model, so size/4 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 if phi varies from 0 to 180
21  for (unsigned int i = 1; i < length; ++i) // for all layers except the top
22  {
23  roughness += conddiffweight * std::pow((member(i) - member(i - 1)),
24  fitexp); //minimize difference in conductivity between layers
25  roughness += anisotropyweight * std::pow(std::abs(member(i + 2
26  * length)), fitexp); //minimize anisotropy factor in each layer
27  roughness += strikediffweight * std::pow((member(i + 3 * length))
28  / anglescale, fitexp); //minimize strike within each layer
29  }
30  SetRMS(std::pow(roughness, 1. / fitexp));
31  }
32 
34  {
35  return GetRMS();
36  }
37 
39  GeneralObjective(Old), conddiffweight(Old.conddiffweight),
40  anisotropyweight(Old.anisotropyweight), strikediffweight(
41  Old.strikediffweight)
42  {
43  }
44 
46  const MTAnisoRoughness& source)
47  {
48  if (this == &source)
49  return *this;
51  conddiffweight = source.conddiffweight;
52  anisotropyweight = source.anisotropyweight;
53  strikediffweight = source.strikediffweight;
54  return *this;
55  }
56  }
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
Caclulate the roughness for anisotropic MT models.
virtual void SafeParallel(const ttranscribed &member)
The core performance calculation, has to be safe to be done in parallel.
GeneralObjective & operator=(const GeneralObjective &source)
int GetFitExponent()
Get the Fit exponent.
double GetRMS()
Get the current RMS.
MTAnisoRoughness & operator=(const MTAnisoRoughness &source)
The basic object for any objective function, mainly an interface class and some storage.
void SetRMS(const double x)