GPLIB++
AnisoJointConf.cpp
Go to the documentation of this file.
1 //============================================================================
2 // Name : AnisoJointConf.cpp
3 // Author : Apr 1, 2011
4 // Version :
5 // Copyright : 2011, mmoorkamp
6 //============================================================================
7 
8 
9 #include "AnisoJointConf.h"
10 #include <boost/program_options.hpp>
11 #include "VectorOptions.h"
12 
13 namespace gplib
14  {
15 
16  using namespace boost::program_options;
17 
19  {
20 
21  }
22 
24  {
25  }
26 
27  void AnisoJointConf::GetData(std::ifstream &instream)
28  {
29  DummyVec<double> Test;
30 
31  options_description desc("Joint inversion options");
32  desc.add_options()("outputbase", value<std::string> (&outputbase),
33  "The start of the name of the output files")("verbose", value(
34  &verbose)->default_value(false), "")("ptensordata", value(
35  &ptensordata), "The name of a file containing phase tensor MT data")
36 
37  ("conddiffweight", value(&conddiffweight),
38  "The weight for regularizing the difference in conductivity between layers")(
39  "anisotropyweight", value(&anisotropyweight),
40  "The weight for regularizing the anisotropy")("strikediffweight",
41  value(&strikediffweight),
42  "The weight for regularizing the difference in strike between layers")(
43  "veldiffweight", value(&veldiffweight),
44  "The weight for regularizing the difference in velocity")(
45  "anisovelweight", value(&anisovelweight),
46  "The weight for regularizing the anisotropy of the velocity")(
47  "deltastrikediffweight", value(&deltastrikediffweight),
48  "The weight for regularizing the difference in strike between MT and seismics")(
49  "avelratio", value(&avelratio), "")("thickstep", value<DummyVec<
50  double> > (), "")("resstep", value<DummyVec<double> > (), "")(
51  "velstep", value<DummyVec<double> > (), "")("aresstep", value<
52  DummyVec<double> > (), "")("avelstep", value<DummyVec<double> > (),
53  "")("strikestep", value<DummyVec<double> > (), "")("dstrikestep",
54  value<DummyVec<double> > (), "")("thickstep", value<
55  DummyVec<double> > (), "")("thickbase",
56  value<DummyVec<double> > (), "")("resbase",
57  value<DummyVec<double> > (), "")("velbase",
58  value<DummyVec<double> > (), "")("aresbase",
59  value<DummyVec<double> > (), "")("avelbase",
60  value<DummyVec<double> > (), "")("strikebase", value<DummyVec<
61  double> > (), "")("dstrikebase", value<DummyVec<double> > (), "")(
62  "thicksizes", value<DummyVec<int> > (), "")("ressizes", value<
63  DummyVec<int> > (), "")("velsizes", value<DummyVec<int> > (), "")(
64  "aressizes", value<DummyVec<int> > (), "")("avelsizes", value<
65  DummyVec<int> > (), "")("strikesizes", value<DummyVec<int> > (), "")(
66  "dstrikesizes", value<DummyVec<int> > (), "")("weights", value<
67  DummyVec<double> > (), "");
68 
69  variables_map vm;
70  store(parse_config_file(instream, desc, true), vm);
71  notify(vm);
72 
73  if (vm.count("thickbase"))
74  {
75  thickbase = vm["thickbase"].as<DummyVec<double> > ().VecVal;
76  }
77  if (vm.count("thickstep"))
78  {
79  thickstep = vm["thickstep"].as<DummyVec<double> > ().VecVal;
80  }
81  if (vm.count("thicksizes"))
82  {
83  thicksizes = vm["thicksize"].as<DummyVec<int> > ().VecVal;
84  }
85 
86  if (vm.count("resbase"))
87  {
88  resbase = vm["resbase"].as<DummyVec<double> > ().VecVal;
89  }
90  if (vm.count("resstep"))
91  {
92  resstep = vm["resstep"].as<DummyVec<double> > ().VecVal;
93  }
94  if (vm.count("ressizes"))
95  {
96  ressizes = vm["ressizes"].as<DummyVec<int> > ().VecVal;
97  }
98 
99  if (vm.count("velbase"))
100  {
101  velbase = vm["velbase"].as<DummyVec<double> > ().VecVal;
102  }
103  if (vm.count("velstep"))
104  {
105  velstep = vm["velstep"].as<DummyVec<double> > ().VecVal;
106  }
107  if (vm.count("velsizes"))
108  {
109  velsizes = vm["velsizes"].as<DummyVec<int> > ().VecVal;
110  }
111 
112  if (vm.count("aresbase"))
113  {
114  aresbase = vm["aresbase"].as<DummyVec<double> > ().VecVal;
115  }
116  if (vm.count("aresstep"))
117  {
118  aresstep = vm["aresstep"].as<DummyVec<double> > ().VecVal;
119  }
120  if (vm.count("aressizes"))
121  {
122  aressizes = vm["aressizes"].as<DummyVec<int> > ().VecVal;
123  }
124 
125  if (vm.count("avelbase"))
126  {
127  avelbase = vm["avelbase"].as<DummyVec<double> > ().VecVal;
128  }
129  if (vm.count("avelstep"))
130  {
131  avelstep = vm["avelstep"].as<DummyVec<double> > ().VecVal;
132  }
133  if (vm.count("avelsizes"))
134  {
135  avelsizes = vm["avelsizes"].as<DummyVec<int> > ().VecVal;
136  }
137 
138  if (vm.count("strikebase"))
139  {
140  strikebase = vm["strikebase"].as<DummyVec<double> > ().VecVal;
141  }
142  if (vm.count("strikestep"))
143  {
144  strikestep = vm["strikestep"].as<DummyVec<double> > ().VecVal;
145  }
146  if (vm.count("strikesizes"))
147  {
148  strikesizes = vm["strikesizes"].as<DummyVec<int> > ().VecVal;
149  }
150 
151  if (vm.count("dstrikebase"))
152  {
153  dstrikebase = vm["dstrikebase"].as<DummyVec<double> > ().VecVal;
154  }
155  if (vm.count("dstrikestep"))
156  {
157  dstrikestep = vm["dstrikestep"].as<DummyVec<double> > ().VecVal;
158  }
159  if (vm.count("dstrikesizes"))
160  {
161  dstrikesizes = vm["dstrikesizes"].as<DummyVec<int> > ().VecVal;
162  }
163  if (vm.count("weights"))
164  {
165  weights = vm["weights"].as<DummyVec<double> > ().VecVal;
166  }
167  }
168 
169  }
void GetData(std::ifstream &instream)