25 #include <queso/StatisticalForwardProblemOptions.h>
26 #include <queso/Miscellaneous.h>
42 #ifdef UQ_SFP_READS_SOLVER_OPTION
43 m_solverString (UQ_SFP_SOLVER_ODV ),
72 #ifdef UQ_SFP_READS_SOLVER_OPTION
73 m_solverString = src.m_solverString;
92 m_prefix ((std::string)(prefix) +
"fp_" ),
94 m_optionsDesc (new po::options_description(
"Statistical Forward Problem options")),
95 m_option_help (m_prefix +
"help" ),
96 m_option_computeSolution (m_prefix +
"computeSolution" ),
97 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
98 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
99 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
100 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
101 #ifdef UQ_SFP_READS_SOLVER_OPTION
102 m_option_solver (m_prefix +
"solver" )
107 "StatisticalForwardProblemOptions::constructor(1)",
108 "this constructor is incompatible with the absence of an options input file");
116 m_ov (alternativeOptionsValues ),
117 m_prefix ((std::string)(prefix) +
"fp_" ),
119 m_optionsDesc (NULL),
120 m_option_help (m_prefix +
"help" ),
121 m_option_computeSolution (m_prefix +
"computeSolution" ),
122 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
123 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
124 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
125 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
126 #ifdef UQ_SFP_READS_SOLVER_OPTION
127 m_option_solver (m_prefix +
"solver" )
132 "StatisticalForwardProblemOptions::constructor(2)",
133 "this constructor is incompatible with the existence of an options input file");
137 <<
": after setting values of options with prefix '" <<
m_prefix
138 <<
"', state of object is:"
155 "StatisticalForwardProblemOptions::scanOptionsValues()",
156 "m_optionsDesc variable is NULL");
164 <<
": after reading values of options with prefix '" <<
m_prefix
165 <<
"', state of object is:"
184 #ifdef UQ_SFP_READS_SOLVER_OPTION
185 <<
"\n" << m_option_solver <<
" = " <<
m_ov.m_solverString
196 optionsDesc.add_options()
197 (
m_option_help.c_str(),
"produce help message for statistical forward problem")
203 #ifdef UQ_SFP_READS_SOLVER_OPTION
204 (m_option_solver.c_str(), po::value<std::string>()->default_value(UQ_SFP_SOLVER_ODV ),
"algorithm for propagation" )
239 std::vector<double> tmpAllow(0,0.);
243 if (tmpAllow.size() > 0) {
244 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
250 #ifdef UQ_SFP_READS_SOLVER_OPTION
252 m_ov.m_solverString = ((
const po::variable_value&)
m_env.
allOptionsMap()[m_option_solver]).as<std::string>();
std::string m_option_computeCovariances
std::string m_option_computeSolution
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.
void scanOptionsValues()
It scans the option values from the options input file.
StatisticalForwardProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
bool m_computeCovariances
int worldRank() const
Returns the process world rank.
This class provides options for a Statistical Forward Problem if no input file is available...
std::string m_option_computeCorrelations
void defineMyOptions(po::options_description &optionsDesc) const
Define my SFP options as the default options.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
This class reads option values for a Statistical Forward Problem from an input file.
po::options_description * m_optionsDesc
po::variables_map & allOptionsMap() const
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
const BaseEnvironment & m_env
bool m_computeCorrelations
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
SfpOptionsValues()
Constructor/Destructor methods.
#define UQ_SFP_COMPUTE_SOLUTION_ODV
std::string m_option_dataOutputFileName
std::string m_option_dataOutputAllowedSet
#define UQ_SFP_COMPUTE_COVARIANCES_ODV
std::set< unsigned int > m_dataOutputAllowedSet
SfpOptionsValues & operator=(const SfpOptionsValues &rhs)
Assignment operator; it copies rhs to this.
std::string m_dataOutputFileName
~StatisticalForwardProblemOptions()
Destructor.
std::string m_option_help
void getMyOptionValues(po::options_description &optionsDesc)
Gets the option values of the SFP.
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
~SfpOptionsValues()
Destructor.
void print(std::ostream &os) const
It prints the option values.
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.