GPLIB++
IsoJointConf.cpp
Go to the documentation of this file.
1 //============================================================================
2 // Name : IsoJointConf.cpp
3 // Author : Apr 8, 2010
4 // Version :
5 // Copyright : 2010, mmoorkamp
6 //============================================================================
7 
8 
9 #include "IsoJointConf.h"
10 #include "convert.h"
11 #include "VecMat.h"
12 #include "VectorOptions.h"
13 #include <boost/program_options.hpp>
14 #include <cmath>
15 #include <boost/tokenizer.hpp>
16 
17 namespace gplib
18  {
19 
20  using namespace boost::program_options;
21 
23  {
24 
25  }
26 
28  {
29  }
30 
31  void IsoJointConf::GetData(std::ifstream &instream)
32  {
33  DummyVec<double> Test;
34 
35  options_description desc("Joint inversion options");
36  desc.add_options()("outputbase", value<std::string> (&outputbase),
37  "The start of the name of the output files")("verbose", value(
38  &verbose)->default_value(false), "")("poisson", value<double> (
39  &poisson), "Poisson's ration")("usevrefmodel",
40  value(&usevrefmodel)->default_value(false), "")("vrefmodel", value(
41  &vrefmodel), "")("thickbase", value<DummyVec<double> > (), "")(
42  "thickstep", value<DummyVec<double> > (), "")("thicksizes", value<
43  DummyVec<int> > (), "")("resbase", value<DummyVec<double> > (), "")(
44  "resstep", value<DummyVec<double> > (), "")("ressizes", value<
45  DummyVec<int> > (), "")("svelbase", value<DummyVec<double> > (), "")(
46  "svelstep", value<DummyVec<double> > (), "")("svelsizes", value<
47  DummyVec<int> > (), "")("weights", value<DummyVec<double> > (), "");
48 
49  variables_map vm;
50  store(parse_config_file(instream, desc, true), vm);
51  notify(vm);
52 
53  if (vm.count("thickbase"))
54  {
55  thickbase = vm["thickbase"].as<DummyVec<double> > ().VecVal;
56  }
57  if (vm.count("thickstep"))
58  {
59  thickstep = vm["thickstep"].as<DummyVec<double> > ().VecVal;
60  }
61  if (vm.count("thicksizes"))
62  {
63  thicksizes = vm["thicksizes"].as<DummyVec<int> > ().VecVal;
64  }
65 
66  if (vm.count("resbase"))
67  {
68  resbase = vm["resbase"].as<DummyVec<double> > ().VecVal;
69  }
70  if (vm.count("resstep"))
71  {
72  resstep = vm["resstep"].as<DummyVec<double> > ().VecVal;
73  }
74  if (vm.count("ressizes"))
75  {
76  ressizes = vm["ressizes"].as<DummyVec<int> > ().VecVal;
77  }
78 
79  if (vm.count("svelbase"))
80  {
81  svelbase = vm["svelbase"].as<DummyVec<double> > ().VecVal;
82  }
83  if (vm.count("svelstep"))
84  {
85  svelstep = vm["svelstep"].as<DummyVec<double> > ().VecVal;
86  }
87  if (vm.count("svelsizes"))
88  {
89  svelsizes = vm["svelsizes"].as<DummyVec<int> > ().VecVal;
90  }
91 
92  if (vm.count("weights"))
93  {
94  weights = vm["weights"].as<DummyVec<double> > ().VecVal;
95  }
96  }
97  }
void GetData(std::ifstream &instream)