25 #include <boost/program_options.hpp>
27 #include <queso/Defines.h>
28 #include <queso/StatisticalInverseProblemOptions.h>
29 #include <queso/Miscellaneous.h>
46 m_option_help (m_prefix +
"help" ),
47 m_option_computeSolution (m_prefix +
"computeSolution" ),
48 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
49 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
50 #ifdef UQ_SIP_READS_SOLVER_OPTION
51 m_option_solver (m_prefix +
"solver" ),
52 m_solverString (UQ_SIP_SOLVER_ODV)
60 m_prefix((std::string)(prefix) +
"ip_"),
66 m_option_help (m_prefix +
"help" ),
67 m_option_computeSolution (m_prefix +
"computeSolution" ),
68 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
69 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
70 #ifdef UQ_SIP_READS_SOLVER_OPTION
71 m_option_solver (m_prefix +
"solver" ),
72 m_solverString (UQ_SIP_SOLVER_ODV)
79 #ifdef UQ_SIP_READS_SOLVER_OPTION
89 #ifdef UQ_SIP_READS_SOLVER_OPTION
125 #ifdef UQ_SIP_READS_SOLVER_OPTION
126 m_solverString = src.m_solverString;
142 #ifdef UQ_SIP_READS_SOLVER_OPTION
143 <<
"\n" << obj.m_option_solver <<
" = " << obj.m_solverString
159 m_prefix ((std::string)(prefix) +
"ip_"),
161 m_optionsDesc (new boost::program_options::options_description(
"Statistical Inverse Problem options")),
162 m_option_help (m_prefix +
"help" ),
163 m_option_computeSolution (m_prefix +
"computeSolution" ),
164 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
165 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
166 #ifdef UQ_SIP_READS_SOLVER_OPTION
167 m_option_solver (m_prefix +
"solver" )
180 m_ov (alternativeOptionsValues),
181 m_prefix ((std::string)(prefix) +
"ip_"),
183 m_optionsDesc (NULL),
184 m_option_help (m_prefix +
"help" ),
185 m_option_computeSolution (m_prefix +
"computeSolution" ),
186 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
187 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet")
188 #ifdef UQ_SIP_READS_SOLVER_OPTION
189 m_option_solver (m_prefix +
"solver" )
198 <<
": after setting values of options with prefix '" <<
m_prefix
199 <<
"', state of object is:"
227 <<
": after reading values of options with prefix '" <<
m_prefix
228 <<
"', state of object is:"
248 #ifdef UQ_SIP_READS_SOLVER_OPTION
249 <<
"\n" << m_option_solver <<
" = " <<
m_ov.m_solverString
261 optionsDesc.add_options()
262 (
m_option_help.c_str(),
"produce help message for statistical inverse problem")
266 #ifdef UQ_SIP_READS_SOLVER_OPTION
267 (m_option_solver.c_str(), boost::program_options::value<std::string>()->default_value(UQ_SIP_SOLVER_ODV ),
"algorithm for calibration" )
296 std::vector<double> tmpAllow(0,0.);
300 if (tmpAllow.size() > 0) {
301 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
307 #ifdef UQ_SIP_READS_SOLVER_OPTION
309 m_ov.m_solverString = ((
const boost::program_options::variable_value&)
m_env.
allOptionsMap()[m_option_solver]).as<std::string>();
std::string m_option_help
std::string m_dataOutputFileName
BoostInputOptionsParser * m_parser
This class provides options for a Statistical Inverse Problem if no input file is available...
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
std::string m_option_computeSolution
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
std::string m_option_help
SipOptionsValues()
Default constructor.
SipOptionsValues & operator=(const SipOptionsValues &rhs)
Assignment operator; it copies rhs to this.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SIP options as the default options.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
#define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
boost::program_options::variables_map & allOptionsMap() const
~StatisticalInverseProblemOptions()
Destructor.
#define queso_require_equal_to_msg(expr1, expr2, msg)
StatisticalInverseProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
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_computeSolution
#define queso_require_msg(asserted, msg)
std::string m_option_dataOutputFileName
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SIP.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
std::string m_option_dataOutputAllowedSet
#define UQ_SIP_COMPUTE_SOLUTION_ODV
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
std::string m_option_dataOutputAllowedSet
virtual ~SipOptionsValues()
Destructor.
std::set< unsigned int > m_dataOutputAllowedSet
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
void print(std::ostream &os) const
It prints the option values.
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
const BaseEnvironment & m_env
#define queso_deprecated()
std::string m_help
If this string is non-empty, options are print to the output file.
void scanOptionsValues()
It scans the option values from the options input file.
This class reads option values for a Statistical Inverse Problem from an input file.
std::string m_option_dataOutputFileName
boost::program_options::options_description * m_optionsDesc
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.