25 #include <boost/program_options.hpp>
27 #include <queso/Defines.h>
28 #include <queso/StatisticalForwardProblemOptions.h>
29 #include <queso/Miscellaneous.h>
48 m_option_help (m_prefix +
"help" ),
49 m_option_computeSolution (m_prefix +
"computeSolution" ),
50 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
51 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
52 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
53 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
54 #ifdef UQ_SFP_READS_SOLVER_OPTION
55 m_option_solver (m_prefix +
"solver" ),
56 m_solverString (UQ_SFP_SOLVER_ODV )
64 m_prefix ((std::string)(prefix) +
"fp_"),
72 m_option_help (m_prefix +
"help" ),
73 m_option_computeSolution (m_prefix +
"computeSolution" ),
74 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
75 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
76 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
77 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
78 #ifdef UQ_SFP_READS_SOLVER_OPTION
79 m_option_solver (m_prefix +
"solver" ),
80 m_solverString (UQ_SFP_SOLVER_ODV )
89 #ifdef UQ_SFP_READS_SOLVER_OPTION
101 #ifdef UQ_SFP_READS_SOLVER_OPTION
140 #ifdef UQ_SFP_READS_SOLVER_OPTION
141 m_solverString = src.m_solverString;
152 os << (*(obj.
m_parser)) << std::endl;
162 #ifdef UQ_SFP_READS_SOLVER_OPTION
163 <<
"\n" << obj.m_option_solver <<
" = " << obj.m_solverString
179 m_prefix ((std::string)(prefix) +
"fp_" ),
181 m_optionsDesc (new boost::program_options::options_description(
"Statistical Forward Problem options")),
182 m_option_help (m_prefix +
"help" ),
183 m_option_computeSolution (m_prefix +
"computeSolution" ),
184 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
185 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
186 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
187 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
188 #ifdef UQ_SFP_READS_SOLVER_OPTION
189 m_option_solver (m_prefix +
"solver" )
202 m_ov (alternativeOptionsValues ),
203 m_prefix ((std::string)(prefix) +
"fp_" ),
205 m_optionsDesc (NULL),
206 m_option_help (m_prefix +
"help" ),
207 m_option_computeSolution (m_prefix +
"computeSolution" ),
208 m_option_computeCovariances (m_prefix +
"computeCovariances" ),
209 m_option_computeCorrelations (m_prefix +
"computeCorrelations" ),
210 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
211 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
212 #ifdef UQ_SFP_READS_SOLVER_OPTION
213 m_option_solver (m_prefix +
"solver" )
222 <<
": after setting values of options with prefix '" <<
m_prefix
223 <<
"', state of object is:"
250 <<
": after reading values of options with prefix '" <<
m_prefix
251 <<
"', state of object is:"
272 #ifdef UQ_SFP_READS_SOLVER_OPTION
273 <<
"\n" << m_option_solver <<
" = " <<
m_ov.m_solverString
286 optionsDesc.add_options()
287 (
m_option_help.c_str(),
"produce help message for statistical forward problem")
293 #ifdef UQ_SFP_READS_SOLVER_OPTION
294 (m_option_solver.c_str(), boost::program_options::value<std::string>()->default_value(UQ_SFP_SOLVER_ODV ),
"algorithm for propagation" )
331 std::vector<double> tmpAllow(0,0.);
335 if (tmpAllow.size() > 0) {
336 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
342 #ifdef UQ_SFP_READS_SOLVER_OPTION
344 m_ov.m_solverString = ((
const boost::program_options::variable_value&)
m_env.
allOptionsMap()[m_option_solver]).as<std::string>();
#define UQ_SFP_COMPUTE_SOLUTION_ODV
std::string m_option_computeSolution
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
StatisticalForwardProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
~StatisticalForwardProblemOptions()
Destructor.
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.
bool m_computeCorrelations
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
std::string m_option_help
std::string m_option_dataOutputFileName
std::string m_option_computeCovariances
#define UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::set< unsigned int > m_dataOutputAllowedSet
This class reads option values for a Statistical Forward Problem from an input file.
This class provides options for a Statistical Forward Problem if no input file is available...
boost::program_options::variables_map & allOptionsMap() const
boost::program_options::options_description * m_optionsDesc
const BaseEnvironment & m_env
#define queso_require_equal_to_msg(expr1, expr2, msg)
std::string m_option_help
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
void scanInputFile()
This is the method that parses the input file.
std::string m_option_computeCorrelations
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
#define queso_require_msg(asserted, msg)
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
void print(std::ostream &os) const
It prints the option values.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
SfpOptionsValues & operator=(const SfpOptionsValues &rhs)
Assignment operator; it copies rhs to this.
std::string m_dataOutputFileName
std::string m_option_dataOutputAllowedSet
SfpOptionsValues()
Constructor/Destructor methods.
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SFP.
std::string m_option_computeCorrelations
std::string m_help
If non-empty string, options and values are printed to the output file.
std::string m_option_computeSolution
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
#define queso_deprecated()
bool m_computeCovariances
BoostInputOptionsParser * m_parser
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SFP options as the default options.
std::string m_option_dataOutputAllowedSet
#define UQ_SFP_COMPUTE_COVARIANCES_ODV
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
std::string m_option_dataOutputFileName
virtual ~SfpOptionsValues()
Destructor.
std::string m_option_computeCovariances
void scanOptionsValues()
It scans the option values from the options input file.