本文整理汇总了C++中FEProblem::storePetscOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ FEProblem::storePetscOptions方法的具体用法?C++ FEProblem::storePetscOptions怎么用?C++ FEProblem::storePetscOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FEProblem
的用法示例。
在下文中一共展示了FEProblem::storePetscOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
CreateExecutionerAction::storeCommonExecutionerParams(FEProblem & fe_problem, InputParameters & params)
{
// Note: Options set in the Preconditioner block will override those set in the Executioner block
if (params.isParamValid("solve_type"))
{
// Extract the solve type
const std::string & solve_type = params.get<MooseEnum>("solve_type");
fe_problem.solverParams()._type = Moose::stringToEnum<Moose::SolveType>(solve_type);
}
MooseEnum line_search = params.get<MooseEnum>("line_search");
if (fe_problem.solverParams()._line_search == Moose::LS_INVALID || line_search != "default")
fe_problem.solverParams()._line_search = Moose::stringToEnum<Moose::LineSearchType>(line_search);
#ifdef LIBMESH_HAVE_PETSC
MultiMooseEnum petsc_options = params.get<MultiMooseEnum>("petsc_options");
std::vector<std::string> petsc_options_iname = params.get<std::vector<std::string> >("petsc_options_iname");
std::vector<std::string> petsc_options_value = params.get<std::vector<std::string> >("petsc_options_value");
fe_problem.storePetscOptions(petsc_options, petsc_options_iname, petsc_options_value);
#endif //LIBMESH_HAVE_PETSC
}