25 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <boost/program_options.hpp>
27 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
29 #include <queso/Defines.h>
30 #include <queso/StatisticalInverseProblemOptions.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_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
55 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
56 #ifdef UQ_SIP_READS_SOLVER_OPTION
57 m_option_solver (m_prefix +
"solver" ),
58 m_solverString (UQ_SIP_SOLVER_ODV)
60 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
61 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
68 m_prefix((std::string)(prefix) +
"ip_"),
75 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
78 m_option_help (m_prefix +
"help" ),
79 m_option_computeSolution (m_prefix +
"computeSolution" ),
80 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
81 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
82 #ifdef UQ_SIP_READS_SOLVER_OPTION
83 m_option_solver (m_prefix +
"solver" ),
84 m_solverString (UQ_SIP_SOLVER_ODV)
86 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
87 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
89 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
94 #ifdef UQ_SIP_READS_SOLVER_OPTION
106 #ifdef UQ_SIP_READS_SOLVER_OPTION
118 for (
unsigned int i = 0; i < size; i++) {
125 #ifdef UQ_SIP_READS_SOLVER_OPTION
126 m_solver = env->
input()(m_option_solver, UQ_SIP_SOLVER_ODV);
130 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
164 #ifdef UQ_SIP_READS_SOLVER_OPTION
165 m_solverString = src.m_solverString;
180 #ifdef UQ_SIP_READS_SOLVER_OPTION
181 <<
"\n" << obj.m_option_solver <<
" = " << obj.m_solverString
197 m_prefix ((std::string)(prefix) +
"ip_"),
199 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
200 m_optionsDesc (new boost::program_options::options_description(
"Statistical Inverse Problem options")),
202 m_option_help (m_prefix +
"help" ),
203 m_option_computeSolution (m_prefix +
"computeSolution" ),
204 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
205 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
206 #ifdef UQ_SIP_READS_SOLVER_OPTION
207 m_option_solver (m_prefix +
"solver" )
209 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
210 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
222 m_ov (alternativeOptionsValues),
223 m_prefix ((std::string)(prefix) +
"ip_"),
225 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
226 m_optionsDesc (NULL),
228 m_option_help (m_prefix +
"help" ),
229 m_option_computeSolution (m_prefix +
"computeSolution" ),
230 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
231 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
232 #ifdef UQ_SIP_READS_SOLVER_OPTION
233 m_option_solver (m_prefix +
"solver" )
235 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
236 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
244 <<
": after setting values of options with prefix '" <<
m_prefix
245 <<
"', state of object is:"
254 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
256 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
263 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
269 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
273 <<
": after reading values of options with prefix '" <<
m_prefix
274 <<
"', state of object is:"
294 #ifdef UQ_SIP_READS_SOLVER_OPTION
295 <<
"\n" << m_option_solver <<
" = " <<
m_ov.m_solverString
304 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
310 optionsDesc.add_options()
311 (
m_option_help.c_str(),
"produce help message for statistical inverse problem")
315 #ifdef UQ_SIP_READS_SOLVER_OPTION
316 (m_option_solver.c_str(), boost::program_options::value<std::string>()->default_value(UQ_SIP_SOLVER_ODV ),
"algorithm for calibration" )
322 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
324 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
348 std::vector<double> tmpAllow(0,0.);
352 if (tmpAllow.size() > 0) {
353 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
359 #ifdef UQ_SIP_READS_SOLVER_OPTION
361 m_ov.m_solverString = ((
const boost::program_options::variable_value&)
m_env.
allOptionsMap()[m_option_solver]).as<std::string>();
373 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
#define UQ_SIP_COMPUTE_SOLUTION_ODV
std::string m_option_computeSolution
SipOptionsValues()
Default constructor.
std::string m_option_dataOutputAllowedSet
This class provides options for a Statistical Inverse Problem if no input file is available...
const GetPot & input() const
The GetPot input file parser.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
SipOptionsValues & operator=(const SipOptionsValues &rhs)
Assignment operator; it copies rhs to this.
std::string m_option_dataOutputAllowedSet
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
std::string m_option_dataOutputFileName
std::string m_dataOutputFileName
std::string m_option_seedWithMAPEstimator
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
bool m_useOptimizerMonitor
bool m_seedWithMAPEstimator
This class reads option values for a Statistical Inverse Problem from an input file.
std::string m_option_useOptimizerMonitor
std::string m_option_dataOutputFileName
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.
#define queso_require_equal_to_msg(expr1, expr2, msg)
boost::program_options::variables_map & allOptionsMap() const
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
std::string m_option_useOptimizerMonitor
#define queso_deprecated()
boost::program_options::options_description * m_optionsDesc
std::string m_option_computeSolution
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
~StatisticalInverseProblemOptions()
Destructor.
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.
const BaseEnvironment & m_env
StatisticalInverseProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::set< unsigned int > m_dataOutputAllowedSet
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SIP.
#define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
std::string m_option_seedWithMAPEstimator
#define queso_require_msg(asserted, msg)
virtual ~SipOptionsValues()
Destructor.
std::string m_option_help
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SIP options as the default options.
#define UQ_SIP_SEEDWITHMAPESTIMATOR
BoostInputOptionsParser * m_parser
std::string m_option_help
void print(std::ostream &os) const
It prints the option values.
std::string m_help
If this string is non-empty, options are print to the output file.
#define UQ_SIP_USEOPTIMIZERMONITOR
void scanOptionsValues()
It scans the option values from the options input file.