9 SeismicModelDiff::SeismicModelDiff(
const ResPkModel &Seis) :
36 const unsigned int length = member.size() / 3;
37 double roughness = 0.0;
39 vector<double> memberdepth, refdepth;
40 partial_sum(member.begin() + length, member.begin() + 2 * length,
41 back_inserter(memberdepth));
43 back_inserter(refdepth));
44 refdepth.back() += 1000.0;
45 vector<double> layerthick(memberdepth);
46 copy(refdepth.begin(), refdepth.end(), back_inserter(layerthick));
47 sort(layerthick.begin(), layerthick.end());
48 adjacent_difference(layerthick.begin(), layerthick.end(),
50 layerthick.erase(
remove(layerthick.begin(), layerthick.end(), 0.0),
52 unsigned int refindex = 0;
53 unsigned int memberindex = 0;
54 unsigned int thickindex = 0;
55 double currthick = 0.0;
56 while (refindex < Model.
GetThickness().size() && memberindex < length)
58 int difference = fcmp(memberdepth.at(memberindex), refdepth.at(
59 refindex), std::numeric_limits<double>::epsilon());
60 currthick = layerthick.at(thickindex);
61 roughness += pow2((member(memberindex + 2 * length)
63 refindex) * currthick);
ublas::vector< double > ttranscribed
virtual void SafeParallel(const ttranscribed &member)
Calculate the roughness of the model given by the parameter member.
virtual ~SeismicModelDiff()
GeneralObjective & operator=(const GeneralObjective &source)
SeismicModelDiff calculates the roughness of a joint MT- receiver functions model compared to a seism...
double GetRMS()
Get the current RMS.
const trealdata & GetSVelocity() const
Read-only access to the vector of S-velocities in km/s in each layer.
The basic object for any objective function, mainly an interface class and some storage.
SeismicModelDiff & operator=(const SeismicModelDiff &source)
virtual double PostParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done after, returns the misfit value...
void SetRMS(const double x)
This class stores and writes model for the respktn 1D seismic code that we use for receiver function ...
const trealdata & GetThickness() const
Read-only access to the vector of thicknesses in km in each layer.
SeismicModelDiff(const ResPkModel &Seis)