25 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <boost/program_options.hpp>
29 #include <queso/Defines.h>
30 #include <queso/StatisticalForwardProblemOptions.h>
31 #include <queso/Miscellaneous.h>
49 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
52 m_option_help (m_prefix +
"help" ),
53 m_option_computeSolution (m_prefix +
"computeSolution" ),
54 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
55 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
56 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
57 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
58 #ifdef UQ_SFP_READS_SOLVER_OPTION
59 m_option_solver (m_prefix +
"solver" ),
60 m_solverString (UQ_SFP_SOLVER_ODV )
68 m_prefix ((std::string)(prefix) +
"fp_"),
75 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
78 m_option_help (m_prefix +
"help" ),
79 m_option_computeSolution (m_prefix +
"computeSolution" ),
80 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
81 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
82 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
83 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
84 #ifdef UQ_SFP_READS_SOLVER_OPTION
85 m_option_solver (m_prefix +
"solver" ),
86 m_solverString (UQ_SFP_SOLVER_ODV )
89 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
96 #ifdef UQ_SFP_READS_SOLVER_OPTION
108 #ifdef UQ_SFP_READS_SOLVER_OPTION
120 for (
unsigned int i = 0; i < size; i++) {
127 #ifdef UQ_SFP_READS_SOLVER_OPTION
128 m_solver = env->
input()(m_option_solver, UQ_SFP_SOLVER_ODV);
130 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
167 #ifdef UQ_SFP_READS_SOLVER_OPTION
168 m_solverString = src.m_solverString;
179 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
180 os << (*(obj.
m_parser)) << std::endl;
181 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
191 #ifdef UQ_SFP_READS_SOLVER_OPTION
192 <<
"\n" << obj.m_option_solver <<
" = " << obj.m_solverString
208 m_prefix ((std::string)(prefix) +
"fp_" ),
210 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
211 m_optionsDesc (new boost::program_options::options_description(
"Statistical Forward Problem options")),
213 m_option_help (m_prefix +
"help" ),
214 m_option_computeSolution (m_prefix +
"computeSolution" ),
215 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
216 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
217 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
218 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
219 #ifdef UQ_SFP_READS_SOLVER_OPTION
220 m_option_solver (m_prefix +
"solver" )
233 m_ov (alternativeOptionsValues ),
234 m_prefix ((std::string)(prefix) +
"fp_" ),
236 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
237 m_optionsDesc (NULL),
239 m_option_help (m_prefix +
"help" ),
240 m_option_computeSolution (m_prefix +
"computeSolution" ),
241 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
242 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
243 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
244 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
245 #ifdef UQ_SFP_READS_SOLVER_OPTION
246 m_option_solver (m_prefix +
"solver" )
255 <<
": after setting values of options with prefix '" <<
m_prefix
256 <<
"', state of object is:"
266 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
268 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
277 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
283 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
287 <<
": after reading values of options with prefix '" <<
m_prefix
288 <<
"', state of object is:"
309 #ifdef UQ_SFP_READS_SOLVER_OPTION
310 <<
"\n" << m_option_solver <<
" = " <<
m_ov.m_solverString
317 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
324 optionsDesc.add_options()
325 (
m_option_help.c_str(),
"produce help message for statistical forward problem")
331 #ifdef UQ_SFP_READS_SOLVER_OPTION
332 (m_option_solver.c_str(), boost::program_options::value<std::string>()->default_value(UQ_SFP_SOLVER_ODV ),
"algorithm for propagation" )
338 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
340 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
372 std::vector<double> tmpAllow(0,0.);
376 if (tmpAllow.size() > 0) {
377 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
383 #ifdef UQ_SFP_READS_SOLVER_OPTION
385 m_ov.m_solverString = ((
const boost::program_options::variable_value&)
m_env.
allOptionsMap()[m_option_solver]).as<std::string>();
391 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
SfpOptionsValues()
Constructor/Destructor methods.
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
StatisticalForwardProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
const BaseEnvironment & m_env
std::string m_option_computeSolution
const GetPot & input() const
The GetPot input file parser.
std::string m_help
If non-empty string, options and values are printed to the output file.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SFP options as the default options.
#define UQ_SFP_COMPUTE_SOLUTION_ODV
std::string m_option_computeCovariances
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
#define UQ_SFP_COMPUTE_COVARIANCES_ODV
unsigned vector_variable_size(const char *VarName) const
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
#define queso_require_equal_to_msg(expr1, expr2, msg)
bool m_computeCorrelations
boost::program_options::variables_map & allOptionsMap() const
bool m_computeCovariances
#define queso_deprecated()
std::string m_option_help
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
void scanInputFile()
This is the method that parses the input file.
std::string m_option_computeCorrelations
void scanOptionsValues()
It scans the option values from the options input file.
std::string m_option_help
std::string m_option_dataOutputFileName
std::string m_dataOutputFileName
virtual ~SfpOptionsValues()
Destructor.
~StatisticalForwardProblemOptions()
Destructor.
std::string m_option_dataOutputAllowedSet
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
void print(std::ostream &os) const
It prints the option values.
std::string m_option_computeCorrelations
BoostInputOptionsParser * m_parser
This class provides options for a Statistical Forward Problem if no input file is available...
std::string m_option_computeCovariances
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)
std::string m_option_dataOutputFileName
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.
std::set< unsigned int > m_dataOutputAllowedSet
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SFP.
std::string m_option_dataOutputAllowedSet
std::string m_option_computeSolution
SfpOptionsValues & operator=(const SfpOptionsValues &rhs)
Assignment operator; it copies rhs to this.
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV
boost::program_options::options_description * m_optionsDesc
This class reads option values for a Statistical Forward Problem from an input file.