25 #include <queso/MLSamplingOptions.h>
26 #include <queso/Miscellaneous.h>
32 m_prefix ((std::string)(prefix) +
"ml_" ),
33 m_help (UQ_ML_SAMPLING_HELP),
35 m_restartOutput_levelPeriod (UQ_ML_SAMPLING_RESTART_OUTPUT_LEVEL_PERIOD_ODV ),
36 m_restartOutput_baseNameForFiles (UQ_ML_SAMPLING_RESTART_OUTPUT_BASE_NAME_FOR_FILES_ODV),
37 m_restartOutput_fileType (UQ_ML_SAMPLING_RESTART_OUTPUT_FILE_TYPE_ODV ),
38 m_restartInput_baseNameForFiles (UQ_ML_SAMPLING_RESTART_INPUT_BASE_NAME_FOR_FILES_ODV ),
48 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
51 m_option_help (m_prefix +
"help" ),
53 m_option_restartOutput_levelPeriod (m_prefix +
"restartOutput_levelPeriod" ),
54 m_option_restartOutput_baseNameForFiles(m_prefix +
"restartOutput_baseNameForFiles"),
55 m_option_restartOutput_fileType (m_prefix +
"restartOutput_fileType" ),
56 m_option_restartInput_baseNameForFiles (m_prefix +
"restartInput_baseNameForFiles" ),
57 m_option_restartInput_fileType (m_prefix +
"restartInput_fileType" ),
59 m_option_restartInputFileName (m_prefix +
"restartInputFileName"),
60 m_option_restartInputFileType (m_prefix +
"restartInputFileType"),
61 m_option_restartChainSize (m_prefix +
"restartChainSize" ),
63 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
64 m_option_dataOutputAllowedSet (m_prefix +
"dataOutputAllowedSet")
66 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
68 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
69 m_parser->
registerOption<
unsigned int>(m_option_restartOutput_levelPeriod, UQ_ML_SAMPLING_RESTART_OUTPUT_LEVEL_PERIOD_ODV,
"restartOutput_levelPeriod" );
70 m_parser->
registerOption<std::string >(m_option_restartOutput_baseNameForFiles, UQ_ML_SAMPLING_RESTART_OUTPUT_BASE_NAME_FOR_FILES_ODV,
"restartOutput_baseNameForFiles" );
71 m_parser->
registerOption<std::string >(m_option_restartOutput_fileType, UQ_ML_SAMPLING_RESTART_OUTPUT_FILE_TYPE_ODV,
"restartOutput_fileType" );
72 m_parser->
registerOption<std::string >(m_option_restartInput_baseNameForFiles, UQ_ML_SAMPLING_RESTART_INPUT_BASE_NAME_FOR_FILES_ODV,
"restartInput_baseNameForFiles" );
85 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
86 m_parser->
getOption<
unsigned int>(m_option_restartOutput_levelPeriod, m_restartOutput_levelPeriod);
87 m_parser->
getOption<std::string >(m_option_restartOutput_baseNameForFiles, m_restartOutput_baseNameForFiles);
88 m_parser->
getOption<std::string >(m_option_restartOutput_fileType, m_restartOutput_fileType);
89 m_parser->
getOption<std::string >(m_option_restartInput_baseNameForFiles, m_restartInput_baseNameForFiles);
90 m_parser->
getOption<std::string >(m_option_restartInput_fileType, m_restartInput_fileType);
100 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
101 m_restartOutput_levelPeriod =
m_env.
input()(m_option_restartOutput_levelPeriod, UQ_ML_SAMPLING_RESTART_OUTPUT_LEVEL_PERIOD_ODV);
102 m_restartOutput_baseNameForFiles =
m_env.
input()(m_option_restartOutput_baseNameForFiles, UQ_ML_SAMPLING_RESTART_OUTPUT_BASE_NAME_FOR_FILES_ODV);
103 m_restartOutput_fileType =
m_env.
input()(m_option_restartOutput_fileType, UQ_ML_SAMPLING_RESTART_OUTPUT_FILE_TYPE_ODV);
104 m_restartInput_baseNameForFiles =
m_env.
input()(m_option_restartInput_baseNameForFiles, UQ_ML_SAMPLING_RESTART_INPUT_BASE_NAME_FOR_FILES_ODV);
116 for (
unsigned int i = 0; i < size; i++) {
123 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
143 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
144 if ((m_restartOutput_levelPeriod > 0))
queso_require_not_equal_to_msg(m_restartOutput_baseNameForFiles, std::string(
"."), std::string(
"Option 'restartOutput_levelPeriod' is > 0, but 'restartOutput_baseNameForFiles' is not specified..."));
151 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
152 os << m_option_restartOutput_levelPeriod <<
" = " << m_restartOutput_levelPeriod
153 <<
"\n" << m_option_restartOutput_baseNameForFiles <<
" = " << m_restartOutput_baseNameForFiles
154 <<
"\n" << m_option_restartOutput_fileType <<
" = " << m_restartOutput_fileType
155 <<
"\n" << m_option_restartInput_baseNameForFiles <<
" = " << m_restartInput_baseNameForFiles
156 <<
"\n" << m_option_restartInput_fileType <<
" = " << m_restartInput_fileType
174 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
175 os << (*(obj.
m_parser)) << std::endl;
176 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
BoostInputOptionsParser * m_parser
const GetPot & input() const
The GetPot input file parser.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
#define UQ_ML_SAMPLING_DATA_OUTPUT_ALLOWED_SET_ODV
#define ML_CODE_HAS_NEW_RESTART_CAPABILITY
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
std::string m_restartInputFileName
Name of restart input file.
MLSamplingOptions(const BaseEnvironment &env, const char *prefix)
Default constructor.
#define UQ_ML_SAMPLING_DATA_OUTPUT_FILE_NAME_ODV
void checkOptions(const BaseEnvironment *env)
virtual ~MLSamplingOptions()
Destructor.
std::string m_dataOutputFileName
Name of generic output file.
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.
This class provides options for the Multilevel sequence generator if no input file is available...
#define UQ_ML_SAMPLING_RESTART_INPUT_FILE_NAME_ODV
#define UQ_ML_SAMPLING_RESTART_CHAIN_SIZE_ODV
const BaseEnvironment & m_env
std::string m_option_help
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
unsigned int m_restartChainSize
Size of restart chain.
void scanInputFile()
This is the method that parses the input file.
std::string m_restartInputFileType
Type of restart input file.
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
std::string m_option_dataOutputFileName
std::string m_option_restartInputFileType
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_option_restartChainSize
std::string m_option_restartInputFileName
std::string m_option_dataOutputAllowedSet
void print(std::ostream &os) const
It prints the option values.
std::string m_help
If non-empty string, options and values are printed to the output file.
#define UQ_ML_SAMPLING_RESTART_INPUT_FILE_TYPE_ODV