queso-0.56.0
SimulationModelOptions.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <boost/program_options.hpp>
27 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
28 
29 #include <queso/SimulationModelOptions.h>
30 #include <queso/Miscellaneous.h>
31 
32 namespace QUESO {
33 
35  :
36  m_prefix("sm_"),
39  //m_dataOutputAllowedSet(),
41  m_zeroRelativeSingularValue(UQ_SIMULATION_MODEL_ZERO_RELATIVE_SINGULAR_VALUE_ODV),
51 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
52  m_parser(NULL),
53 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
54  m_option_help(m_prefix + "help"),
55  m_option_dataOutputFileName(m_prefix + "dataOutputFileName"),
56  m_option_dataOutputAllowAll(m_prefix + "dataOutputAllowAll"),
57  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet"),
58  m_option_p_eta(m_prefix + "p_eta"),
59  m_option_zeroRelativeSingularValue(m_prefix + "zeroRelativeSingularValue"),
60  m_option_cdfThresholdForPEta(m_prefix + "cdfThresholdForPEta"),
61  m_option_a_w(m_prefix + "a_w"),
62  m_option_b_w(m_prefix + "b_w"),
63  m_option_a_rho_w(m_prefix + "a_rho_w"),
64  m_option_b_rho_w(m_prefix + "b_rho_w"),
65  m_option_a_eta(m_prefix + "a_eta"),
66  m_option_b_eta(m_prefix + "b_eta"),
67  m_option_a_s(m_prefix + "a_s"),
68  m_option_b_s(m_prefix + "b_s")
69 {
70 }
71 
73  prefix)
74  :
75  m_prefix((std::string)(prefix) + "sm_"),
78  //m_dataOutputAllowedSet(),
80  m_zeroRelativeSingularValue(UQ_SIMULATION_MODEL_ZERO_RELATIVE_SINGULAR_VALUE_ODV),
90 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
91  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
92 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
93  m_option_help(m_prefix + "help"),
94  m_option_dataOutputFileName(m_prefix + "dataOutputFileName"),
95  m_option_dataOutputAllowAll(m_prefix + "dataOutputAllowAll"),
96  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet"),
97  m_option_p_eta(m_prefix + "p_eta"),
98  m_option_zeroRelativeSingularValue(m_prefix + "zeroRelativeSingularValue"),
99  m_option_cdfThresholdForPEta(m_prefix + "cdfThresholdForPEta"),
100  m_option_a_w(m_prefix + "a_w"),
101  m_option_b_w(m_prefix + "b_w"),
102  m_option_a_rho_w(m_prefix + "a_rho_w"),
103  m_option_b_rho_w(m_prefix + "b_rho_w"),
104  m_option_a_eta(m_prefix + "a_eta"),
105  m_option_b_eta(m_prefix + "b_eta"),
106  m_option_a_s(m_prefix + "a_s"),
107  m_option_b_s(m_prefix + "b_s")
108 {
109 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
110  m_parser->registerOption(m_option_help, "produce help message for simulation model options");
113  m_parser->registerOption<std::string >(m_option_dataOutputAllowedSet, UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOWED_SET_ODV , "subEnvs that will write to data output file" );
125 
127 
131  m_parser->getOption<unsigned int>(m_option_p_eta, m_p_eta);
134  m_parser->getOption<double >(m_option_a_w, m_a_w);
135  m_parser->getOption<double >(m_option_b_w, m_b_w);
140  m_parser->getOption<double >(m_option_a_s, m_a_s);
141  m_parser->getOption<double >(m_option_b_s, m_b_s);
142 #else
145 
146  // UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
147  unsigned int size = env->input().vector_variable_size(m_option_dataOutputAllowedSet);
148  for (unsigned int i = 0; i < size; i++) {
149  // We default to empty set, so the default values are actually never
150  // used here
151  unsigned int allowed = env->input()(m_option_dataOutputAllowedSet, i, i);
152  m_dataOutputAllowedSet.insert(allowed);
153  }
154 
166 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
167 }
168 
170 {
171 }
172 
174 {
175  this->copy(src);
176 }
177 
180 {
181  this->copy(rhs);
182  return *this;
183 }
184 
185 // void
186 // SmOptionsValues::defineOptions()
187 // {
188 // (*m_optionsDescription).add_options()
189 // (m_option_help.c_str(), "produce help message for simulation model options")
190 // (m_option_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file" )
191 // (m_option_dataOutputAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOW_ALL_ODV ), "allow all or not" )
192 // (m_option_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write to data output file" )
193 // (m_option_p_eta.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SIMULATION_MODEL_P_ETA_ODV ), "p_eta" )
194 // (m_option_zeroRelativeSingularValue.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_ZERO_RELATIVE_SINGULAR_VALUE_ODV), "zeroRelativeSingularValue" )
195 // (m_option_cdfThresholdForPEta.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_CDF_THRESHOLD_FOR_P_ETA_ODV ), "cdfThresholdForPEta" )
196 // (m_option_a_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_W_ODV ), "a_w" )
197 // (m_option_b_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_W_ODV ), "b_w" )
198 // (m_option_a_rho_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_RHO_W_ODV ), "a_rho_w" )
199 // (m_option_b_rho_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_RHO_W_ODV ), "b_rho_w" )
200 // (m_option_a_eta.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_ETA_ODV ), "a_eta" )
201 // (m_option_b_eta.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_ETA_ODV ), "b_eta" )
202 // (m_option_a_s.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_S_ODV ), "a_s" )
203 // (m_option_b_s.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_S_ODV ), "b_s" )
204 // ;
205 // }
206 //
207 // void
208 // SmOptionsValues::getOptionValues()
209 // {
210 // if ((*m_optionsMap).count(m_option_help)) {
211 // if (m_env->subDisplayFile()) {
212 // *m_env->subDisplayFile() << (*m_optionsDescription)
213 // << std::endl;
214 // }
215 // }
216 //
217 // if ((*m_optionsMap).count(m_option_dataOutputFileName)) {
218 // m_dataOutputFileName = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_dataOutputFileName]).as<std::string>();
219 // }
220 //
221 // if ((*m_optionsMap).count(m_option_dataOutputAllowAll)) {
222 // m_dataOutputAllowAll = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_dataOutputAllowAll]).as<bool>();
223 // }
224 //
225 // if (m_dataOutputAllowAll) {
226 // m_dataOutputAllowedSet.insert(m_env->subId());
227 // }
228 // else if ((*m_optionsMap).count(m_option_dataOutputAllowedSet)) {
229 // m_dataOutputAllowedSet.clear();
230 // std::vector<double> tmpAllow(0,0.);
231 // std::string inputString = (*m_optionsMap)[m_option_dataOutputAllowedSet].as<std::string>();
232 // MiscReadDoublesFromString(inputString,tmpAllow);
233 //
234 // if (tmpAllow.size() > 0) {
235 // for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
236 // m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
237 // }
238 // }
239 // }
240 //
241 // if ((*m_optionsMap).count(m_option_p_eta)) {
242 // m_p_eta = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_p_eta]).as<unsigned int>();
243 // }
244 //
245 // if ((*m_optionsMap).count(m_option_zeroRelativeSingularValue)) {
246 // m_zeroRelativeSingularValue = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_zeroRelativeSingularValue]).as<double>();
247 // }
248 //
249 // if ((*m_optionsMap).count(m_option_cdfThresholdForPEta)) {
250 // m_cdfThresholdForPEta = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_cdfThresholdForPEta]).as<double>();
251 // }
252 //
253 // if ((*m_optionsMap).count(m_option_a_w)) {
254 // m_a_w = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_a_w]).as<double>();
255 // }
256 //
257 // if ((*m_optionsMap).count(m_option_b_w)) {
258 // m_b_w = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_b_w]).as<double>();
259 // }
260 //
261 // if ((*m_optionsMap).count(m_option_a_rho_w)) {
262 // m_a_rho_w = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_a_rho_w]).as<double>();
263 // }
264 //
265 // if ((*m_optionsMap).count(m_option_b_rho_w)) {
266 // m_b_rho_w = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_b_rho_w]).as<double>();
267 // }
268 //
269 // if ((*m_optionsMap).count(m_option_a_eta)) {
270 // m_a_eta = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_a_eta]).as<double>();
271 // }
272 //
273 // if ((*m_optionsMap).count(m_option_b_eta)) {
274 // m_b_eta = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_b_eta]).as<double>();
275 // }
276 //
277 // if ((*m_optionsMap).count(m_option_a_s)) {
278 // m_a_s = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_a_s]).as<double>();
279 // }
280 //
281 // if ((*m_optionsMap).count(m_option_b_s)) {
282 // m_b_s = ((const boost::program_options::variable_value&) (*m_optionsMap)[m_option_b_s]).as<double>();
283 // }
284 // }
285 
286 void
288 {
292  m_p_eta = src.m_p_eta;
295  m_a_w = src.m_a_w;
296  m_b_w = src.m_b_w;
297  m_a_rho_w = src.m_a_rho_w;
298  m_b_rho_w = src.m_b_rho_w;
299  m_a_eta = src.m_a_eta;
300  m_b_eta = src.m_b_eta;
301  m_a_s = src.m_a_s;
302  m_b_s = src.m_b_s;
303 
304  return;
305 }
306 
308  const BaseEnvironment& env,
309  const char* prefix)
310  :
311  m_ov (),
312  m_prefix ((std::string)(prefix) + "sm_"),
313  m_env (env),
314 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
315  m_optionsDesc (new boost::program_options::options_description("Simulation model options")),
316 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
317  m_option_help (m_prefix + "help" ),
318  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
319  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
320  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
321  m_option_p_eta (m_prefix + "p_eta" ),
322  m_option_zeroRelativeSingularValue(m_prefix + "zeroRelativeSingularValue"),
323  m_option_cdfThresholdForPEta (m_prefix + "cdfThresholdForPEta" ),
324  m_option_a_w (m_prefix + "a_w" ),
325  m_option_b_w (m_prefix + "b_w" ),
326  m_option_a_rho_w (m_prefix + "a_rho_w" ),
327  m_option_b_rho_w (m_prefix + "b_rho_w" ),
328  m_option_a_eta (m_prefix + "a_eta" ),
329  m_option_b_eta (m_prefix + "b_eta" ),
330  m_option_a_s (m_prefix + "a_s" ),
331  m_option_b_s (m_prefix + "b_s" )
332 {
333  queso_require_not_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the abscense of an options input file"));
334 }
335 
337  const BaseEnvironment& env,
338  const char* prefix,
339  const SmOptionsValues& alternativeOptionsValues)
340  :
341  m_ov (alternativeOptionsValues),
342  m_prefix ((std::string)(prefix) + "sm_"),
343  m_env (env),
344 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
345  m_optionsDesc (NULL),
346 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
347  m_option_help (m_prefix + "help" ),
348  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
349  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
350  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
351  m_option_p_eta (m_prefix + "p_eta" ),
352  m_option_zeroRelativeSingularValue(m_prefix + "zeroRelativeSingularValue"),
353  m_option_cdfThresholdForPEta (m_prefix + "cdfThresholdForPEta" ),
354  m_option_a_w (m_prefix + "a_w" ),
355  m_option_b_w (m_prefix + "b_w" ),
356  m_option_a_rho_w (m_prefix + "a_rho_w" ),
357  m_option_b_rho_w (m_prefix + "b_rho_w" ),
358  m_option_a_eta (m_prefix + "a_eta" ),
359  m_option_b_eta (m_prefix + "b_eta" ),
360  m_option_a_s (m_prefix + "a_s" ),
361  m_option_b_s (m_prefix + "b_s" )
362 {
364 
365  queso_require_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"));
366 
367  if (m_env.subDisplayFile() != NULL) {
368  *m_env.subDisplayFile() << "In SimulationModelOptions::constructor(2)"
369  << ": after setting values of options with prefix '" << m_prefix
370  << "', state of object is:"
371  << "\n" << *this
372  << std::endl;
373  }
374 }
375 
377 {
379 
380 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
381  if (m_optionsDesc) delete m_optionsDesc;
382 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
383 }
384 
385 void
387 {
389 
390 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
391  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
392 
395  //std::cout << "scan 000\n"
396  // << std::endl;
398  //std::cout << "scan 001\n"
399  // << std::endl;
400 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
401 
402  if (m_env.subDisplayFile() != NULL) {
403  *m_env.subDisplayFile() << "In SimulationModelOptions::scanOptionsValues()"
404  << ": after reading values of options with prefix '" << m_prefix
405  << "', state of object is:"
406  << "\n" << *this
407  << std::endl;
408  }
409 
410  return;
411 }
412 
413 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
414 void
415 SimulationModelOptions::defineMyOptions(boost::program_options::options_description& optionsDesc) const
416 {
418 
419  optionsDesc.add_options()
420  (m_option_help.c_str(), "produce help message for simulation model options")
421  (m_option_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file" )
422  (m_option_dataOutputAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOW_ALL_ODV ), "allow all or not" )
423  (m_option_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write to data output file" )
424  (m_option_p_eta.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SIMULATION_MODEL_P_ETA_ODV ), "p_eta" )
425  (m_option_zeroRelativeSingularValue.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_ZERO_RELATIVE_SINGULAR_VALUE_ODV), "zeroRelativeSingularValue" )
426  (m_option_cdfThresholdForPEta.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_CDF_THRESHOLD_FOR_P_ETA_ODV ), "cdfThresholdForPEta" )
427  (m_option_a_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_W_ODV ), "a_w" )
428  (m_option_b_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_W_ODV ), "b_w" )
429  (m_option_a_rho_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_RHO_W_ODV ), "a_rho_w" )
430  (m_option_b_rho_w.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_RHO_W_ODV ), "b_rho_w" )
431  (m_option_a_eta.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_ETA_ODV ), "a_eta" )
432  (m_option_b_eta.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_ETA_ODV ), "b_eta" )
433  (m_option_a_s.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_A_S_ODV ), "a_s" )
434  (m_option_b_s.c_str(), boost::program_options::value<double >()->default_value(UQ_SIMULATION_MODEL_B_S_ODV ), "b_s" )
435  ;
436 
437  return;
438 }
439 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
440 
441 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
442 void
443 SimulationModelOptions::getMyOptionValues(boost::program_options::options_description& optionsDesc)
444 {
445  if (m_env.allOptionsMap().count(m_option_help)) {
446  if (m_env.subDisplayFile()) {
447  *m_env.subDisplayFile() << optionsDesc
448  << std::endl;
449  }
450  }
451 
453  m_ov.m_dataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>();
454  }
455 
457  m_ov.m_dataOutputAllowAll = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputAllowAll]).as<bool>();
458  }
459 
462  }
465  std::vector<double> tmpAllow(0,0.);
466  std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>();
467  MiscReadDoublesFromString(inputString,tmpAllow);
468 
469  if (tmpAllow.size() > 0) {
470  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
471  m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
472  }
473  }
474  }
475 
476  if (m_env.allOptionsMap().count(m_option_p_eta)) {
477  m_ov.m_p_eta = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_p_eta]).as<unsigned int>();
478  }
479 
481  m_ov.m_zeroRelativeSingularValue = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_zeroRelativeSingularValue]).as<double>();
482  }
483 
485  m_ov.m_cdfThresholdForPEta = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_cdfThresholdForPEta]).as<double>();
486  }
487 
488  if (m_env.allOptionsMap().count(m_option_a_w)) {
489  m_ov.m_a_w = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_a_w]).as<double>();
490  }
491 
492  if (m_env.allOptionsMap().count(m_option_b_w)) {
493  m_ov.m_b_w = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_b_w]).as<double>();
494  }
495 
496  if (m_env.allOptionsMap().count(m_option_a_rho_w)) {
497  m_ov.m_a_rho_w = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_a_rho_w]).as<double>();
498  }
499 
500  if (m_env.allOptionsMap().count(m_option_b_rho_w)) {
501  m_ov.m_b_rho_w = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_b_rho_w]).as<double>();
502  }
503 
504  if (m_env.allOptionsMap().count(m_option_a_eta)) {
505  m_ov.m_a_eta = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_a_eta]).as<double>();
506  }
507 
508  if (m_env.allOptionsMap().count(m_option_b_eta)) {
509  m_ov.m_b_eta = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_b_eta]).as<double>();
510  }
511 
512  if (m_env.allOptionsMap().count(m_option_a_s)) {
513  m_ov.m_a_s = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_a_s]).as<double>();
514  }
515 
516  if (m_env.allOptionsMap().count(m_option_b_s)) {
517  m_ov.m_b_s = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_b_s]).as<double>();
518  }
519 
520  return;
521 }
522 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
523 
524 void
525 SimulationModelOptions::print(std::ostream& os) const
526 {
528 
529  os << "\n" << m_option_dataOutputFileName << " = " << m_ov.m_dataOutputFileName
531  << "\n" << m_option_dataOutputAllowedSet << " = ";
532  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
533  os << *setIt << " ";
534  }
535  os << "\n" << m_option_p_eta << " = " << m_ov.m_p_eta
538  << "\n" << m_option_a_w << " = " << m_ov.m_a_w
539  << "\n" << m_option_b_w << " = " << m_ov.m_b_w
540  << "\n" << m_option_a_rho_w << " = " << m_ov.m_a_rho_w
541  << "\n" << m_option_b_rho_w << " = " << m_ov.m_b_rho_w
542  << "\n" << m_option_a_eta << " = " << m_ov.m_a_eta
543  << "\n" << m_option_b_eta << " = " << m_ov.m_b_eta
544  << "\n" << m_option_a_s << " = " << m_ov.m_a_s
545  << "\n" << m_option_b_s << " = " << m_ov.m_b_s
546  << std::endl;
547 
548  return;
549 }
550 
551 std::ostream& operator<<(std::ostream& os, const SimulationModelOptions& obj)
552 {
554 
555  obj.print(os);
556 
557  return os;
558 }
559 
560 } // End namespace QUESO
SmOptionsValues & operator=(const SmOptionsValues &rhs)
#define UQ_SIMULATION_MODEL_B_W_ODV
const GetPot & input() const
The GetPot input file parser.
Definition: Environment.C:1148
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::set< unsigned int > m_dataOutputAllowedSet
#define UQ_SIMULATION_MODEL_A_W_ODV
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:353
#define UQ_SIMULATION_MODEL_A_ETA_ODV
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:197
#define UQ_SIMULATION_MODEL_B_RHO_W_ODV
void print(std::ostream &os) const
boost::program_options::options_description * m_optionsDesc
BoostInputOptionsParser * m_parser
unsigned vector_variable_size(const char *VarName) const
Definition: getpot.h:2532
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
#define UQ_SIMULATION_MODEL_DATA_OUTPUT_FILE_NAME_ODV
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
boost::program_options::variables_map & allOptionsMap() const
Definition: Environment.C:385
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
Definition: Environment.C:341
#define queso_deprecated()
Definition: Defines.h:134
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
Definition: Environment.C:396
#define UQ_SIMULATION_MODEL_B_ETA_ODV
void scanInputFile()
This is the method that parses the input file.
#define UQ_SIMULATION_MODEL_B_S_ODV
void copy(const SmOptionsValues &src)
std::string m_option_zeroRelativeSingularValue
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:74
#define UQ_SIMULATION_MODEL_A_RHO_W_ODV
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define UQ_SIMULATION_MODEL_ZERO_RELATIVE_SINGULAR_VALUE_ODV
#define UQ_SIMULATION_MODEL_CDF_THRESHOLD_FOR_P_ETA_ODV
#define UQ_SIMULATION_MODEL_A_S_ODV
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
#define UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_SIMULATION_MODEL_P_ETA_ODV
SimulationModelOptions(const BaseEnvironment &env, const char *prefix)
#define UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOW_ALL_ODV
void defineMyOptions(boost::program_options::options_description &optionsDesc) const

Generated on Tue Nov 29 2016 10:53:11 for queso-0.56.0 by  doxygen 1.8.5