Member2Aniso.h

Go to the documentation of this file.
00001 #ifndef MEMBER2ANISO_H_
00002 #define MEMBER2ANISO_H_
00003 
00004 #include "C1DAnisoMTSynthData.h"
00005 #include "Adaptors.h"
00006 #include <algorithm>
00007 namespace gplib
00008   {
00009     //! This function sets the properties for the 1D MT anisotropic forward calculation, from the variable member as used in the genetic algorithm
00010     void inline Member2Aniso(const ttranscribed &member,
00011         C1DAnisoMTSynthData &Synth)
00012       {
00013         const int nlayers = member.size() / 4; //the model has the format resistivity/thickness/anisotropy/strike
00014         // so the actual numer of layers is quarter the length
00015         trealdata rho1(nlayers, 0);
00016         trealdata rho2(nlayers, 0);
00017         trealdata zeros(nlayers, 0);
00018         trealdata strike(nlayers, 0);
00019         trealdata thick(nlayers, 0);
00020 
00021         transform(member.begin(), member.begin() + nlayers, rho1.begin(),
00022             boost::bind(gplib::fopow<double, double>(), 10., _1)); //member contains log resistivity
00023         // transform to normal resistivity
00024         copy(member.begin() + nlayers, member.begin() + 2 * nlayers,
00025             thick.begin()); //copy thickness values
00026         //anisotropy factors are stored in logarithmic form, we first copy them into rho2
00027         transform(member.begin() + 2 * nlayers, member.begin() + 3 * nlayers,
00028             rho2.begin(), boost::bind(gplib::fopow<double, double>(), 10., _1));
00029         //and then multiply the anisotropy factor by the resistivity rho1, to get the second resistivity
00030         transform(rho2.begin(), rho2.end(), rho1.begin(), rho2.begin(),
00031             std::multiplies<double>());
00032         //the strike angles are taken directly from member
00033         copy(member.begin() + 3 * nlayers, member.end(), strike.begin());
00034         Synth.SetThicknesses(thick); //set them in the MTSynth object for forward calculation
00035         Synth.SetRho1(rho1);
00036         Synth.SetRho2(rho2);
00037         Synth.SetRho3(rho1); //we only have horizontal anisotropy => Rho3 has no influence
00038         Synth.SetStrikes(strike);
00039         Synth.SetSlants(zeros); //we only care about strike,slant and dip are all 0
00040         Synth.SetDips(zeros);
00041       }
00042   }
00043 #endif /*MEMBER2ANISO_H_*/

Generated on Tue Nov 3 13:24:14 2009 for GPLIB++ by  doxygen 1.5.8