GPLIB++
Member2Aniso.h
Go to the documentation of this file.
1 #ifndef MEMBER2ANISO_H_
2 #define MEMBER2ANISO_H_
3 
4 #include "C1DAnisoMTSynthData.h"
5 #include "Adaptors.h"
6 #include <algorithm>
7 namespace gplib
8  {
9  //! This function sets the properties for the 1D MT anisotropic forward calculation, from the variable member as used in the genetic algorithm
10  void inline Member2Aniso(const ttranscribed &member,
11  C1DAnisoMTSynthData &Synth)
12  {
13  const int nlayers = member.size() / 4; //the model has the format resistivity/thickness/anisotropy/strike
14  // so the actual numer of layers is quarter the length
15  trealdata rho1(nlayers, 0);
16  trealdata rho2(nlayers, 0);
17  trealdata zeros(nlayers, 0);
18  trealdata strike(nlayers, 0);
19  trealdata thick(nlayers, 0);
20 
21  transform(member.begin(), member.begin() + nlayers, rho1.begin(),
22  boost::bind(gplib::fopow<double, double>(), 10., _1)); //member contains log resistivity
23  // transform to normal resistivity
24  copy(member.begin() + nlayers, member.begin() + 2 * nlayers,
25  thick.begin()); //copy thickness values
26  //anisotropy factors are stored in logarithmic form, we first copy them into rho2
27  transform(member.begin() + 2 * nlayers, member.begin() + 3 * nlayers,
28  rho2.begin(), boost::bind(gplib::fopow<double, double>(), 10., _1));
29  //and then multiply the anisotropy factor by the resistivity rho1, to get the second resistivity
30  transform(rho2.begin(), rho2.end(), rho1.begin(), rho2.begin(),
31  std::multiplies<double>());
32  //the strike angles are taken directly from member
33  copy(member.begin() + 3 * nlayers, member.end(), strike.begin());
34  Synth.SetThicknesses(thick); //set them in the MTSynth object for forward calculation
35  Synth.SetRho1(rho1);
36  Synth.SetRho2(rho2);
37  Synth.SetRho3(rho1); //we only have horizontal anisotropy => Rho3 has no influence
38  Synth.SetStrikes(strike);
39  Synth.SetSlants(zeros); //we only care about strike,slant and dip are all 0
40  Synth.SetDips(zeros);
41  }
42  }
43 #endif /*MEMBER2ANISO_H_*/
ublas::vector< double > ttranscribed
Definition: gentypes.h:21
void SetRho1(const trealdata &a)
Set the first principal resistivity for each layer in Ohm.m.
void SetThicknesses(const trealdata &thick)
Set the thicknes in km.
void SetRho2(const trealdata &a)
Set the second principal resistivity for each layer in Ohm.m.
Calculate response of a 1D anisotropic model, code is based on Pek and Santos fortran code...
void Member2Aniso(const ttranscribed &member, C1DAnisoMTSynthData &Synth)
This function sets the properties for the 1D MT anisotropic forward calculation, from the variable me...
Definition: Member2Aniso.h:10
void SetStrikes(const trealdata &a)
Set the anisotropy strike for each layer in degree.
void SetDips(const trealdata &a)
Set the anisotropy dip for each layer in degree.
void SetSlants(const trealdata &a)
Set the anisotropy slant for each layer in degree.
void SetRho3(const trealdata &a)
Set the first principal resistivity for each layer in Ohm.m.