本文整理汇总了C++中teuchos::ParameterList::validateParametersAndSetDefaults方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::validateParametersAndSetDefaults方法的具体用法?C++ ParameterList::validateParametersAndSetDefaults怎么用?C++ ParameterList::validateParametersAndSetDefaults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::ParameterList
的用法示例。
在下文中一共展示了ParameterList::validateParametersAndSetDefaults方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
// ****************************************************************
// ****************************************************************
void Thyra::NOXNonlinearSolver::
validateAndParseThyraGroupOptions(Teuchos::ParameterList& thyra_group_options_sublist)
{
using Teuchos::ParameterList;
ParameterList validParams;
{
Teuchos::setStringToIntegralParameter<int>(
"Function Scaling",
"None",
"Determines if function scaling of residual, Jacobian, etc. should be used.",
Teuchos::tuple<std::string>("None","Row Sum", "User Defined"),
&validParams
);
Teuchos::setStringToIntegralParameter<int>(
"Update Row Sum Scaling",
"Before Each Nonlinear Solve",
"Determines if function scaling of residual, Jacobian, etc. should be used.",
Teuchos::tuple<std::string>("Before Each Nonlinear Solve","Before Each Nonlinear Iteration"),
&validParams
);
validParams.set<Teuchos::RCP< ::Thyra::VectorBase<double> > >("User Defined Scaling", Teuchos::null);
validParams.set<bool >("Do Right Scaling First", false);
}
thyra_group_options_sublist.validateParametersAndSetDefaults(validParams);
function_scaling_ = thyra_group_options_sublist.get<std::string>("Function Scaling");
if (function_scaling_ =="Row Sum")
do_row_sum_scaling_ = true;
else
do_row_sum_scaling_ = false;
std::string string_when_to_update = thyra_group_options_sublist.get<std::string>("Update Row Sum Scaling");
if (string_when_to_update == "Before Each Nonlinear Solve")
when_to_update_ = NOX::RowSumScaling::UpdateInvRowSumVectorAtBeginningOfSolve;
else if (string_when_to_update == "Before Each Nonlinear Iteration")
when_to_update_ = NOX::RowSumScaling::UpdateInvRowSumVectorAtBeginningOfIteration;
if (function_scaling_ =="User Defined")
scaling_vector_ = thyra_group_options_sublist.get<Teuchos::RCP< ::Thyra::VectorBase<double> > >("User Defined Scaling");
rightScalingFirst_ = thyra_group_options_sublist.get<bool>("Do Right Scaling First");
}