queso-0.51.1
Public Attributes | Private Member Functions | Private Attributes | List of all members
QUESO::MonteCarloSGOptions Class Reference

This class reads the options for the Monte Carlo sequence generator from an input file. More...

#include <MonteCarloSGOptions.h>

Collaboration diagram for QUESO::MonteCarloSGOptions:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 MonteCarloSGOptions (const BaseEnvironment &env, const char *prefix)
 Constructor: reads options from the input file. More...
 
 MonteCarloSGOptions (const BaseEnvironment &env, const char *prefix, const McOptionsValues &alternativeOptionsValues)
 Constructor: with alternative option values. More...
 
 ~MonteCarloSGOptions ()
 Destructor. More...
 
I/O methods
void scanOptionsValues ()
 It scans the option values from the options input file. More...
 
void print (std::ostream &os) const
 It prints the option values. More...
 

Public Attributes

McOptionsValues m_ov
 
std::string m_prefix
 

Private Member Functions

void defineMyOptions (po::options_description &optionsDesc) const
 Defines the options for the Monte Carlo sequence generator as the default options. More...
 
void getMyOptionValues (po::options_description &optionsDesc)
 Gets the sequence options. More...
 

Private Attributes

const BaseEnvironmentm_env
 
po::options_description * m_optionsDesc
 
std::string m_option_help
 
std::string m_option_dataOutputFileName
 
std::string m_option_dataOutputAllowedSet
 
std::string m_option_pseq_dataOutputPeriod
 
std::string m_option_pseq_dataOutputFileName
 
std::string m_option_pseq_dataOutputFileType
 
std::string m_option_pseq_dataOutputAllowedSet
 
std::string m_option_qseq_dataInputFileName
 
std::string m_option_qseq_dataInputFileType
 
std::string m_option_qseq_size
 
std::string m_option_qseq_displayPeriod
 
std::string m_option_qseq_measureRunTimes
 
std::string m_option_qseq_dataOutputPeriod
 
std::string m_option_qseq_dataOutputFileName
 
std::string m_option_qseq_dataOutputFileType
 
std::string m_option_qseq_dataOutputAllowedSet
 

Detailed Description

This class reads the options for the Monte Carlo sequence generator from an input file.

Monte Carlo sequence generator expects options for its methods. This class reads the options for the Monte Carlo sequence generator from an input file provided by the user. The class expects the prefix '<prefix>_mc_'. For instance, if 'prefix' is 'foo_775_fp_', then the constructor will read all options that begin with 'foo_775_fp_mc_'.

Definition at line 141 of file MonteCarloSGOptions.h.

Constructor & Destructor Documentation

QUESO::MonteCarloSGOptions::MonteCarloSGOptions ( const BaseEnvironment env,
const char *  prefix 
)

Constructor: reads options from the input file.

Definition at line 127 of file MonteCarloSGOptions.C.

References m_env, QUESO::BaseEnvironment::optionsInputFileName(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().

130  :
131 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
132  m_ov (NULL,NULL),
133  m_pseqStatisticalOptionsObj (NULL),
134  m_qseqStatisticalOptionsObj (NULL),
135 #else
136  m_ov (),
137 #endif
138  m_prefix ((std::string)(prefix) + "mc_"),
139  m_env (env),
140  m_optionsDesc (new po::options_description("Monte Carlo options")),
141  m_option_help (m_prefix + "help" ),
142  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
143  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
144  m_option_pseq_dataOutputPeriod (m_prefix + "pseq_dataOutputPeriod" ),
145  m_option_pseq_dataOutputFileName (m_prefix + "pseq_dataOutputFileName" ),
146  m_option_pseq_dataOutputFileType (m_prefix + "pseq_dataOutputFileType" ),
147  m_option_pseq_dataOutputAllowedSet(m_prefix + "pseq_dataOutputAllowedSet" ),
148 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
149  m_option_pseq_computeStats (m_prefix + "pseq_computeStats" ),
150 #endif
151  m_option_qseq_dataInputFileName (m_prefix + "qseq_dataInputFileName" ),
152  m_option_qseq_dataInputFileType (m_prefix + "qseq_dataInputFileType" ),
153  m_option_qseq_size (m_prefix + "qseq_size" ),
154  m_option_qseq_displayPeriod (m_prefix + "qseq_displayPeriod" ),
155  m_option_qseq_measureRunTimes (m_prefix + "qseq_measureRunTimes" ),
156  m_option_qseq_dataOutputPeriod (m_prefix + "qseq_dataOutputPeriod" ),
157  m_option_qseq_dataOutputFileName (m_prefix + "qseq_dataOutputFileName" ),
158  m_option_qseq_dataOutputFileType (m_prefix + "qseq_dataOutputFileType" ),
159  m_option_qseq_dataOutputAllowedSet(m_prefix + "qseq_dataOutputAllowedSet" )
160 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
161  ,
162  m_option_qseq_computeStats (m_prefix + "qseq_computeStats" )
163 #endif
164 {
166  m_env.worldRank(),
167  "MonteCarloSGOptions::constructor(1)",
168  "this constructor is incompatible with the absence of an options input file");
169 }
std::string m_option_pseq_dataOutputAllowedSet
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
const BaseEnvironment & m_env
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:341
std::string m_option_qseq_dataOutputAllowedSet
po::options_description * m_optionsDesc
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
QUESO::MonteCarloSGOptions::MonteCarloSGOptions ( const BaseEnvironment env,
const char *  prefix,
const McOptionsValues alternativeOptionsValues 
)

Constructor: with alternative option values.

In this constructor, the input options are given by alternativeOptionsValues, thus, they are not read from an input file.

Definition at line 171 of file MonteCarloSGOptions.C.

References m_env, m_ov, m_prefix, QUESO::BaseEnvironment::optionsInputFileName(), QUESO::BaseEnvironment::subDisplayFile(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().

175  :
176  m_ov (alternativeOptionsValues),
177 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
178  m_pseqStatisticalOptionsObj (NULL),
179  m_qseqStatisticalOptionsObj (NULL),
180 #endif
181  m_prefix ((std::string)(prefix) + "mc_"),
182  m_env (env),
183  m_optionsDesc (NULL),
184  m_option_help (m_prefix + "help" ),
185  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
186  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
187  m_option_pseq_dataOutputPeriod (m_prefix + "pseq_dataOutputPeriod" ),
188  m_option_pseq_dataOutputFileName (m_prefix + "pseq_dataOutputFileName" ),
189  m_option_pseq_dataOutputFileType (m_prefix + "pseq_dataOutputFileType" ),
190  m_option_pseq_dataOutputAllowedSet(m_prefix + "pseq_dataOutputAllowedSet"),
191 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
192  m_option_pseq_computeStats (m_prefix + "pseq_computeStats" ),
193 #endif
194  m_option_qseq_dataInputFileName (m_prefix + "qseq_dataInputFileName" ),
195  m_option_qseq_dataInputFileType (m_prefix + "qseq_dataInputFileType" ),
196  m_option_qseq_size (m_prefix + "qseq_size" ),
197  m_option_qseq_displayPeriod (m_prefix + "qseq_displayPeriod" ),
198  m_option_qseq_measureRunTimes (m_prefix + "qseq_measureRunTimes" ),
199  m_option_qseq_dataOutputPeriod (m_prefix + "qseq_dataOutputPeriod" ),
200  m_option_qseq_dataOutputFileName (m_prefix + "qseq_dataOutputFileName" ),
201  m_option_qseq_dataOutputFileType (m_prefix + "qseq_dataOutputFileType" ),
202  m_option_qseq_dataOutputAllowedSet(m_prefix + "qseq_dataOutputAllowedSet")
203 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
204  ,
205  m_option_qseq_computeStats (m_prefix + "qseq_computeStats" )
206 #endif
207 {
209  m_env.worldRank(),
210  "MonteCarloSGOptions::constructor(2)",
211  "this constructor is incompatible with the existence of an options input file");
212 
213  if (m_env.subDisplayFile() != NULL) {
214  *m_env.subDisplayFile() << "In MonteCarloSGOptions::constructor(2)"
215  << ": after setting values of options with prefix '" << m_prefix
216  << "', state of object is:"
217  << "\n" << *this
218  << std::endl;
219  }
220 
221  // dakota
222 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
223  if (m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
224  new SequenceStatisticalOptions(m_env,m_prefix + "pseq_",m_ov.m_alternativePSsOptionsValues);
225  if (m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
226  new SequenceStatisticalOptions(m_env,m_prefix + "qseq_",m_ov.m_alternativeQSsOptionsValues);
227 #endif
228 }
std::string m_option_pseq_dataOutputAllowedSet
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:305
const BaseEnvironment & m_env
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:341
std::string m_option_qseq_dataOutputAllowedSet
po::options_description * m_optionsDesc
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
QUESO::MonteCarloSGOptions::~MonteCarloSGOptions ( )

Destructor.

Definition at line 230 of file MonteCarloSGOptions.C.

References m_optionsDesc.

231 {
232 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
233  if (m_pseqStatisticalOptionsObj) delete m_pseqStatisticalOptionsObj; // dakota
234  if (m_qseqStatisticalOptionsObj) delete m_qseqStatisticalOptionsObj; // dakota
235 #endif
236  if (m_optionsDesc ) delete m_optionsDesc;
237 }
po::options_description * m_optionsDesc

Member Function Documentation

void QUESO::MonteCarloSGOptions::defineMyOptions ( po::options_description &  optionsDesc) const
private

Defines the options for the Monte Carlo sequence generator as the default options.

Definition at line 270 of file MonteCarloSGOptions.C.

References m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_option_pseq_dataOutputAllowedSet, m_option_pseq_dataOutputFileName, m_option_pseq_dataOutputFileType, m_option_pseq_dataOutputPeriod, m_option_qseq_dataInputFileName, m_option_qseq_dataInputFileType, m_option_qseq_dataOutputAllowedSet, m_option_qseq_dataOutputFileName, m_option_qseq_dataOutputFileType, m_option_qseq_dataOutputPeriod, m_option_qseq_displayPeriod, m_option_qseq_measureRunTimes, m_option_qseq_size, UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV, UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV, UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV, UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV, UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV, UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV, UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV, and UQ_MOC_SG_QSEQ_SIZE_ODV.

Referenced by scanOptionsValues().

271 {
272  optionsDesc.add_options()
273  (m_option_help.c_str(), "produce help message for Monte Carlo distribution calculator")
274  (m_option_dataOutputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV ), "name of generic data output file" )
275  (m_option_dataOutputAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write to generic data output file" )
276  (m_option_pseq_dataOutputPeriod.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV ), "period of message display during param sequence generation" )
277  (m_option_pseq_dataOutputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file for parameters" )
278  (m_option_pseq_dataOutputFileType.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV ), "type of data output file for parameters" )
279  (m_option_pseq_dataOutputAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV), "subEnvs that will write to data output file for parameters" )
280 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
281  (m_option_pseq_computeStats.c_str(), po::value<bool >()->default_value(UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV ), "compute statistics on sequence of parameter" )
282 #endif
283  (m_option_qseq_dataInputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV ), "name of data input file for qois" )
284  (m_option_qseq_dataInputFileType.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV ), "type of data input file for qois" )
285  (m_option_qseq_size.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_SIZE_ODV ), "size of qoi sequence" )
286  (m_option_qseq_displayPeriod.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV ), "period of message display during qoi sequence generation" )
287  (m_option_qseq_measureRunTimes.c_str(), po::value<bool >()->default_value(UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV ), "measure run times" )
288  (m_option_qseq_dataOutputPeriod.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV ), "period of message display during qoi sequence generation" )
289  (m_option_qseq_dataOutputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file for qois" )
290  (m_option_qseq_dataOutputFileType.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV ), "type of data output file for qois" )
291  (m_option_qseq_dataOutputAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV), "subEnvs that will write to data output file for qois" )
292 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
293  (m_option_qseq_computeStats.c_str(), po::value<bool >()->default_value(UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV ), "compute statistics on sequence of qoi" )
294 #endif
295  ;
296 
297  return;
298 }
#define UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV
std::string m_option_pseq_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV
std::string m_option_qseq_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV
#define UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_QSEQ_SIZE_ODV
#define UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV
#define UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV
void QUESO::MonteCarloSGOptions::getMyOptionValues ( po::options_description &  optionsDesc)
private

Gets the sequence options.

Definition at line 301 of file MonteCarloSGOptions.C.

References QUESO::BaseEnvironment::allOptionsMap(), QUESO::McOptionsValues::m_dataOutputAllowedSet, QUESO::McOptionsValues::m_dataOutputFileName, m_env, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_option_pseq_dataOutputAllowedSet, m_option_pseq_dataOutputFileName, m_option_pseq_dataOutputFileType, m_option_pseq_dataOutputPeriod, m_option_qseq_dataInputFileName, m_option_qseq_dataInputFileType, m_option_qseq_dataOutputAllowedSet, m_option_qseq_dataOutputFileName, m_option_qseq_dataOutputFileType, m_option_qseq_dataOutputPeriod, m_option_qseq_displayPeriod, m_option_qseq_measureRunTimes, m_option_qseq_size, m_ov, QUESO::McOptionsValues::m_pseqDataOutputAllowedSet, QUESO::McOptionsValues::m_pseqDataOutputFileName, QUESO::McOptionsValues::m_pseqDataOutputFileType, QUESO::McOptionsValues::m_pseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDataInputFileName, QUESO::McOptionsValues::m_qseqDataInputFileType, QUESO::McOptionsValues::m_qseqDataOutputAllowedSet, QUESO::McOptionsValues::m_qseqDataOutputFileName, QUESO::McOptionsValues::m_qseqDataOutputFileType, QUESO::McOptionsValues::m_qseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDisplayPeriod, QUESO::McOptionsValues::m_qseqMeasureRunTimes, QUESO::McOptionsValues::m_qseqSize, QUESO::MiscReadDoublesFromString(), and QUESO::BaseEnvironment::subDisplayFile().

Referenced by scanOptionsValues().

302 {
303  if (m_env.allOptionsMap().count(m_option_help)) {
304  if (m_env.subDisplayFile()) {
305  *m_env.subDisplayFile() << optionsDesc
306  << std::endl;
307  }
308  }
309 
311  m_ov.m_dataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>();
312  }
313 
316  std::vector<double> tmpAllow(0,0.);
317  std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>();
318  MiscReadDoublesFromString(inputString,tmpAllow);
319 
320  if (tmpAllow.size() > 0) {
321  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
322  m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
323  }
324  }
325  }
326 
328  m_ov.m_pseqDataOutputPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputPeriod]).as<unsigned int>();
329  }
330 
332  m_ov.m_pseqDataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileName]).as<std::string>();
333  }
334 
336  m_ov.m_pseqDataOutputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileType]).as<std::string>();
337  }
338 
341  std::vector<double> tmpAllow(0,0.);
342  std::string inputString = m_env.allOptionsMap()[m_option_pseq_dataOutputAllowedSet].as<std::string>();
343  MiscReadDoublesFromString(inputString,tmpAllow);
344 
345  if (tmpAllow.size() > 0) {
346  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
347  m_ov.m_pseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
348  }
349  }
350  }
351 
352 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
353  if (m_env.allOptionsMap().count(m_option_pseq_computeStats)) {
354  m_ov.m_pseqComputeStats = ((const po::variable_value&) m_env.allOptionsMap()[m_option_pseq_computeStats]).as<bool>();
355  }
356 #endif
358  m_ov.m_qseqDataInputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileName]).as<std::string>();
359  }
360 
362  m_ov.m_qseqDataInputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileType]).as<std::string>();
363  }
364 
365  if (m_env.allOptionsMap().count(m_option_qseq_size)) {
366  m_ov.m_qseqSize = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_size]).as<unsigned int>();
367  }
368 
370  m_ov.m_qseqDisplayPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_displayPeriod]).as<unsigned int>();
371  }
372 
374  m_ov.m_qseqMeasureRunTimes = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_measureRunTimes]).as<bool>();
375  }
376 
378  m_ov.m_qseqDataOutputPeriod = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputPeriod]).as<unsigned int>();
379  }
380 
382  m_ov.m_qseqDataOutputFileName = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileName]).as<std::string>();
383  }
384 
386  m_ov.m_qseqDataOutputFileType = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileType]).as<std::string>();
387  }
388 
391  std::vector<double> tmpAllow(0,0.);
392  std::string inputString = m_env.allOptionsMap()[m_option_qseq_dataOutputAllowedSet].as<std::string>();
393  MiscReadDoublesFromString(inputString,tmpAllow);
394 
395  if (tmpAllow.size() > 0) {
396  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
397  m_ov.m_qseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
398  }
399  }
400  }
401 
402 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
403  if (m_env.allOptionsMap().count(m_option_qseq_computeStats)) {
404  m_ov.m_qseqComputeStats = ((const po::variable_value&) m_env.allOptionsMap()[m_option_qseq_computeStats]).as<bool>();
405  }
406 #endif
407  return;
408 }
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:305
const BaseEnvironment & m_env
po::variables_map & allOptionsMap() const
Definition: Environment.C:368
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:39
unsigned int m_pseqDataOutputPeriod
std::string m_pseqDataOutputFileType
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_pseqDataOutputFileName
void QUESO::MonteCarloSGOptions::print ( std::ostream &  os) const

It prints the option values.

Definition at line 411 of file MonteCarloSGOptions.C.

References QUESO::McOptionsValues::m_dataOutputAllowedSet, QUESO::McOptionsValues::m_dataOutputFileName, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_pseq_dataOutputAllowedSet, m_option_pseq_dataOutputFileName, m_option_pseq_dataOutputFileType, m_option_pseq_dataOutputPeriod, m_option_qseq_dataInputFileName, m_option_qseq_dataInputFileType, m_option_qseq_dataOutputAllowedSet, m_option_qseq_dataOutputFileName, m_option_qseq_dataOutputFileType, m_option_qseq_dataOutputPeriod, m_option_qseq_displayPeriod, m_option_qseq_measureRunTimes, m_option_qseq_size, m_ov, QUESO::McOptionsValues::m_pseqDataOutputAllowedSet, QUESO::McOptionsValues::m_pseqDataOutputFileName, QUESO::McOptionsValues::m_pseqDataOutputFileType, QUESO::McOptionsValues::m_pseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDataInputFileName, QUESO::McOptionsValues::m_qseqDataInputFileType, QUESO::McOptionsValues::m_qseqDataOutputAllowedSet, QUESO::McOptionsValues::m_qseqDataOutputFileName, QUESO::McOptionsValues::m_qseqDataOutputFileType, QUESO::McOptionsValues::m_qseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDisplayPeriod, QUESO::McOptionsValues::m_qseqMeasureRunTimes, and QUESO::McOptionsValues::m_qseqSize.

Referenced by QUESO::operator<<().

412 {
414  << "\n" << m_option_dataOutputAllowedSet << " = ";
415  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
416  os << *setIt << " ";
417  }
421  << "\n" << m_option_pseq_dataOutputAllowedSet << " = ";
422  for (std::set<unsigned int>::iterator setIt = m_ov.m_pseqDataOutputAllowedSet.begin(); setIt != m_ov.m_pseqDataOutputAllowedSet.end(); ++setIt) {
423  os << *setIt << " ";
424  }
425  os
426 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
427  << "\n" << m_option_pseq_computeStats << " = " << m_ov.m_pseqComputeStats
428 #endif
431  << "\n" << m_option_qseq_size << " = " << m_ov.m_qseqSize
437  << "\n" << m_option_qseq_dataOutputAllowedSet << " = ";
438  for (std::set<unsigned int>::iterator setIt = m_ov.m_qseqDataOutputAllowedSet.begin(); setIt != m_ov.m_qseqDataOutputAllowedSet.end(); ++setIt) {
439  os << *setIt << " ";
440  }
441 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
442  os << "\n" << m_option_qseq_computeStats << " = " << m_ov.m_qseqComputeStats;
443 #endif
444 
445  return;
446 }
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
unsigned int m_pseqDataOutputPeriod
std::string m_pseqDataOutputFileType
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_pseqDataOutputFileName
void QUESO::MonteCarloSGOptions::scanOptionsValues ( )

It scans the option values from the options input file.

Definition at line 240 of file MonteCarloSGOptions.C.

References defineMyOptions(), getMyOptionValues(), m_env, m_optionsDesc, m_ov, m_prefix, QUESO::BaseEnvironment::scanInputFileForMyOptions(), QUESO::BaseEnvironment::subDisplayFile(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().

241 {
243  m_env.worldRank(),
244  "MonteCarloSGOptions::scanOptionsValues()",
245  "m_optionsDesc variable is NULL");
246 
250 
251  if (m_env.subDisplayFile() != NULL) {
252  *m_env.subDisplayFile() << "In MonteCarloSGOptions::scanOptionsValues()"
253  << ": after reading values of options with prefix '" << m_prefix
254  << "', state of object is:"
255  << "\n" << *this
256  << std::endl;
257  }
258 
259  // dakota
260 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
261  if (m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
262  new SequenceStatisticalOptions(m_env,m_prefix + "pseq_");
263  if (m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
264  new SequenceStatisticalOptions(m_env,m_prefix + "qseq_");
265 #endif
266  return;
267 }
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
void getMyOptionValues(po::options_description &optionsDesc)
Gets the sequence options.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:305
void defineMyOptions(po::options_description &optionsDesc) const
Defines the options for the Monte Carlo sequence generator as the default options.
const BaseEnvironment & m_env
po::options_description * m_optionsDesc
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
Definition: Environment.C:378

Member Data Documentation

const BaseEnvironment& QUESO::MonteCarloSGOptions::m_env
private
std::string QUESO::MonteCarloSGOptions::m_option_dataOutputAllowedSet
private

Definition at line 187 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_dataOutputFileName
private

Definition at line 186 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_help
private

Definition at line 185 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), and getMyOptionValues().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputAllowedSet
private

Definition at line 192 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputFileName
private

Definition at line 190 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputFileType
private

Definition at line 191 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputPeriod
private

Definition at line 189 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataInputFileName
private

Definition at line 197 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataInputFileType
private

Definition at line 198 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputAllowedSet
private

Definition at line 205 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputFileName
private

Definition at line 203 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputFileType
private

Definition at line 204 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputPeriod
private

Definition at line 202 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_displayPeriod
private

Definition at line 200 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_measureRunTimes
private

Definition at line 201 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_size
private

Definition at line 199 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

po::options_description* QUESO::MonteCarloSGOptions::m_optionsDesc
private

Definition at line 183 of file MonteCarloSGOptions.h.

Referenced by scanOptionsValues(), and ~MonteCarloSGOptions().

McOptionsValues QUESO::MonteCarloSGOptions::m_ov
std::string QUESO::MonteCarloSGOptions::m_prefix

Definition at line 173 of file MonteCarloSGOptions.h.

Referenced by MonteCarloSGOptions(), and scanOptionsValues().


The documentation for this class was generated from the following files:

Generated on Thu Apr 23 2015 19:26:18 for queso-0.51.1 by  doxygen 1.8.5