queso-0.56.0
Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
QUESO::SfpOptionsValues Class Reference

This class provides options for a Statistical Forward Problem if no input file is available. More...

#include <StatisticalForwardProblemOptions.h>

Collaboration diagram for QUESO::SfpOptionsValues:
Collaboration graph
[legend]

Public Member Functions

 SfpOptionsValues ()
 Constructor/Destructor methods. More...
 
 SfpOptionsValues (const BaseEnvironment *env, const char *prefix)
 
 SfpOptionsValues (const SfpOptionsValues &src)
 Copy constructor. More...
 
virtual ~SfpOptionsValues ()
 Destructor. More...
 
Set methods
SfpOptionsValuesoperator= (const SfpOptionsValues &rhs)
 Assignment operator; it copies rhs to this. More...
 

Public Attributes

std::string m_prefix
 
std::string m_help
 If non-empty string, options and values are printed to the output file. More...
 
bool m_computeSolution
 
bool m_computeCovariances
 
bool m_computeCorrelations
 
std::string m_dataOutputFileName
 
std::set< unsigned int > m_dataOutputAllowedSet
 

Private Member Functions

void copy (const SfpOptionsValues &src)
 Copies the option values from src to this. More...
 
void checkOptions ()
 

Private Attributes

BoostInputOptionsParserm_parser
 
std::string m_option_help
 
std::string m_option_computeSolution
 
std::string m_option_computeCovariances
 
std::string m_option_computeCorrelations
 
std::string m_option_dataOutputFileName
 
std::string m_option_dataOutputAllowedSet
 

Friends

std::ostream & operator<< (std::ostream &os, const SfpOptionsValues &obj)
 

Detailed Description

This class provides options for a Statistical Forward Problem if no input file is available.

In order to solve a Statistical Forward Problem (SFP), QUESO expects some options for its methods to be fully defined. This class provides default values for such options if no input file is available.

Definition at line 69 of file StatisticalForwardProblemOptions.h.

Constructor & Destructor Documentation

QUESO::SfpOptionsValues::SfpOptionsValues ( )

Constructor/Destructor methods.

Default constructor.

Assigns the default suite of options to the Statistical Forward Problem.

Definition at line 40 of file StatisticalForwardProblemOptions.C.

41  :
42  m_prefix ("fp_"),
48  //m_dataOutputAllowedSet(),
49 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
50  m_parser(NULL),
51 #endif // 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 )
61 #endif
62 {
63 }
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
std::string m_help
If non-empty string, options and values are printed to the output file.
#define UQ_SFP_COMPUTE_SOLUTION_ODV
#define UQ_SFP_COMPUTE_COVARIANCES_ODV
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
QUESO::SfpOptionsValues::SfpOptionsValues ( const BaseEnvironment env,
const char *  prefix 
)

Definition at line 65 of file StatisticalForwardProblemOptions.C.

References checkOptions(), QUESO::BoostInputOptionsParser::getOption(), QUESO::BaseEnvironment::input(), m_computeCorrelations, m_computeCovariances, m_computeSolution, m_dataOutputAllowedSet, m_dataOutputFileName, m_help, m_option_computeCorrelations, m_option_computeCovariances, m_option_computeSolution, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_parser, QUESO::BoostInputOptionsParser::registerOption(), QUESO::BoostInputOptionsParser::scanInputFile(), UQ_SFP_COMPUTE_CORRELATIONS_ODV, UQ_SFP_COMPUTE_COVARIANCES_ODV, UQ_SFP_COMPUTE_SOLUTION_ODV, UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV, UQ_SFP_HELP, and GetPot::vector_variable_size().

67  :
68  m_prefix ((std::string)(prefix) + "fp_"),
74  //m_dataOutputAllowedSet(),
75 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
76  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
77 #endif // 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 )
87 #endif
88 {
89 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
90  m_parser->registerOption<std::string>(m_option_help, UQ_SFP_HELP, "produce help message for statistical forward problem");
91  m_parser->registerOption<bool >(m_option_computeSolution, UQ_SFP_COMPUTE_SOLUTION_ODV , "compute solution process" );
94  m_parser->registerOption<std::string>(m_option_dataOutputFileName, UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV , "name of data output file" );
95  m_parser->registerOption<std::string>(m_option_dataOutputAllowedSet, UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV, "subEnvs that will write to data output file" );
96 #ifdef UQ_SFP_READS_SOLVER_OPTION
97  m_parser->registerOption<std::string>(m_option_solver, UQ_SFP_SOLVER_ODV , "algorithm for propagation" );
98 #endif
99 
101 
102  m_parser->getOption<std::string>(m_option_help, m_help);
108 #ifdef UQ_SFP_READS_SOLVER_OPTION
109  m_parser->getOption<std::string>(m_option_solver, m_solver);
110 #endif
111 #else
112  m_help = env->input()(m_option_help, UQ_SFP_HELP);
117 
118  // UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
119  unsigned int size = env->input().vector_variable_size(m_option_dataOutputAllowedSet);
120  for (unsigned int i = 0; i < size; i++) {
121  // We default to empty set, so the default values are actually never
122  // used here
123  unsigned int allowed = env->input()(m_option_dataOutputAllowedSet, i, i);
124  m_dataOutputAllowedSet.insert(allowed);
125  }
126 
127 #ifdef UQ_SFP_READS_SOLVER_OPTION
128  m_solver = env->input()(m_option_solver, UQ_SFP_SOLVER_ODV);
129 #endif
130 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
131 
132  checkOptions();
133 }
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
std::string m_help
If non-empty string, options and values are printed to the output file.
#define UQ_SFP_COMPUTE_SOLUTION_ODV
#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.
void scanInputFile()
This is the method that parses the input file.
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
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV
QUESO::SfpOptionsValues::SfpOptionsValues ( const SfpOptionsValues src)

Copy constructor.

It assigns the same options values from src to this.

Definition at line 136 of file StatisticalForwardProblemOptions.C.

References copy().

137 {
138  this->copy(src);
139 }
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.
QUESO::SfpOptionsValues::~SfpOptionsValues ( )
virtual

Destructor.

Definition at line 141 of file StatisticalForwardProblemOptions.C.

142 {
143 }

Member Function Documentation

void QUESO::SfpOptionsValues::checkOptions ( )
private

Definition at line 153 of file StatisticalForwardProblemOptions.C.

Referenced by SfpOptionsValues().

154 {
155  // Do nothing
156 }
void QUESO::SfpOptionsValues::copy ( const SfpOptionsValues src)
private

Copies the option values from src to this.

Definition at line 160 of file StatisticalForwardProblemOptions.C.

References m_computeCorrelations, m_computeCovariances, m_computeSolution, m_dataOutputAllowedSet, and m_dataOutputFileName.

Referenced by operator=(), and SfpOptionsValues().

161 {
162  m_computeSolution = src.m_computeSolution;
163  m_computeCovariances = src.m_computeCovariances;
164  m_computeCorrelations = src.m_computeCorrelations;
165  m_dataOutputFileName = src.m_dataOutputFileName;
166  m_dataOutputAllowedSet = src.m_dataOutputAllowedSet;
167 #ifdef UQ_SFP_READS_SOLVER_OPTION
168  m_solverString = src.m_solverString;
169 #endif
170 
171  //m_mcOptionsValues = src.m_mcOptionsValues;
172 
173  return;
174 }
std::set< unsigned int > m_dataOutputAllowedSet
SfpOptionsValues & QUESO::SfpOptionsValues::operator= ( const SfpOptionsValues rhs)

Assignment operator; it copies rhs to this.

Definition at line 146 of file StatisticalForwardProblemOptions.C.

References copy().

147 {
148  this->copy(rhs);
149  return *this;
150 }
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const SfpOptionsValues obj 
)
friend

Definition at line 177 of file StatisticalForwardProblemOptions.C.

178 {
179 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
180  os << (*(obj.m_parser)) << std::endl;
181 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
182 
183  os << obj.m_option_computeSolution << " = " << obj.m_computeSolution
184  << "\n" << obj.m_option_computeCovariances << " = " << obj.m_computeCovariances
185  << "\n" << obj.m_option_computeCorrelations << " = " << obj.m_computeCorrelations
186  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
187  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
188  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
189  os << *setIt << " ";
190  }
191 #ifdef UQ_SFP_READS_SOLVER_OPTION
192  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
193 #endif
194  os << std::endl;
195  return os;
196 }

Member Data Documentation

bool QUESO::SfpOptionsValues::m_computeCorrelations
bool QUESO::SfpOptionsValues::m_computeCovariances
bool QUESO::SfpOptionsValues::m_computeSolution
std::set<unsigned int> QUESO::SfpOptionsValues::m_dataOutputAllowedSet
std::string QUESO::SfpOptionsValues::m_dataOutputFileName
std::string QUESO::SfpOptionsValues::m_help

If non-empty string, options and values are printed to the output file.

Definition at line 96 of file StatisticalForwardProblemOptions.h.

Referenced by SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_computeCorrelations
private

Definition at line 118 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_computeCovariances
private

Definition at line 117 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_computeSolution
private

Definition at line 116 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_dataOutputAllowedSet
private

Definition at line 120 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_dataOutputFileName
private

Definition at line 119 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_help
private

Definition at line 115 of file StatisticalForwardProblemOptions.h.

Referenced by SfpOptionsValues().

BoostInputOptionsParser* QUESO::SfpOptionsValues::m_parser
private

Definition at line 111 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_prefix

Definition at line 93 of file StatisticalForwardProblemOptions.h.


The documentation for this class was generated from the following files:

Generated on Tue Nov 29 2016 10:53:16 for queso-0.56.0 by  doxygen 1.8.5