44 #include "MoochoPack_EvalNewPointStd_StepSetOptions.hpp"
45 #include "OptionsFromStreamPack_StringToBool.hpp"
46 #include "Teuchos_Assert.hpp"
51 const int local_num_options = 3;
56 ,DECOMP_SYS_TESTING_PRINT_LEVEL
59 const char* local_SOptions[local_num_options] = {
62 ,
"decomp_sys_testing_print_level"
67 namespace MoochoPack {
69 EvalNewPointStd_StepSetOptions::EvalNewPointStd_StepSetOptions(
70 EvalNewPointStd_Step* target
71 ,
const char opt_grp_name[] )
72 : OptionsFromStreamPack::SetOptionsFromStreamNode(
73 opt_grp_name, local_num_options, local_SOptions )
74 , OptionsFromStreamPack::SetOptionsToTargetBase<
75 EvalNewPointStd_Step >( target )
78 void EvalNewPointStd_StepSetOptions::setOption(
79 int option_num,
const std::string& option_value )
81 using OptionsFromStreamPack::StringToBool;
83 typedef EvalNewPointStd_Step target_t;
84 switch( (local_EOptions)option_num ) {
85 case FD_DERIV_TESTING:
87 const std::string &option = option_value.c_str();
88 if( option ==
"FD_DEFAULT" )
89 target().fd_deriv_testing( target_t::FD_DEFAULT );
90 else if( option ==
"FD_TEST" )
91 target().fd_deriv_testing( target_t::FD_TEST );
92 else if( option ==
"FD_NO_TEST" )
93 target().fd_deriv_testing( target_t::FD_NO_TEST );
96 true, std::invalid_argument
97 ,
"Error, incorrect value for "
98 "\"fd_deriv_testing\". Only the options "
99 "FD_DEFAULT, FD_TEST, and FD_NO_TEST "
103 case DECOMP_SYS_TESTING:
105 const std::string &option = option_value.c_str();
106 if( option ==
"DST_DEFAULT" )
107 target().decomp_sys_testing( DecompositionSystemHandler_Strategy::DST_DEFAULT );
108 else if( option ==
"DST_TEST" )
109 target().decomp_sys_testing( DecompositionSystemHandler_Strategy::DST_TEST );
110 else if( option ==
"DST_NO_TEST" )
111 target().decomp_sys_testing( DecompositionSystemHandler_Strategy::DST_NO_TEST );
114 true, std::invalid_argument
115 ,
"Error, incorrect value for "
116 "\"decomp_sys_testing\". Only the options "
117 "DST_DEFAULT, DST_TEST, and DST_NO_TEST "
121 case DECOMP_SYS_TESTING_PRINT_LEVEL:
123 const std::string &option = option_value.c_str();
124 if( option ==
"DSPL_USE_GLOBAL" )
125 target().decomp_sys_testing_print_level( DecompositionSystemHandler_Strategy::DSPL_USE_GLOBAL);
126 else if( option ==
"DSPL_LEAVE_DEFAULT" )
127 target().decomp_sys_testing_print_level( DecompositionSystemHandler_Strategy::DSPL_LEAVE_DEFAULT);
130 true, std::invalid_argument
131 ,
"Error, incorrect value for "
132 "\"decomp_sys_testing_print_level\". Only the options "
133 "DSPL_USE_GLOBAL and DSPL_LEAVE_DEFAULT are available" );
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)