28 "auto_preconditioning",
30 "When true, the application will attempt to use the correct preconditioning given the "
31 "Executioner settings for the nonlinear systems that do not have a preconditioner in the "
32 "[Preconditioning] block.");
37 :
MooseObjectAction(params), _auto_preconditioning(getParam<bool>(
"auto_preconditioning"))
44 std::shared_ptr<EigenProblem> eigen_problem = std::dynamic_pointer_cast<EigenProblem>(
_problem);
49 std::shared_ptr<Executioner> executioner =
52 if ((eigen_problem !=
nullptr) != executioner->hasSolveObject<
EigenProblemSolve>())
53 mooseError(
"Executioner is not consistent with each other; EigenExecutioner needs an "
54 "EigenProblem, and Steady and Transient need a FEProblem");
70 std::set<unsigned int> preconditioned_nl_sys;
77 preconditioned_nl_sys.
insert(
78 pc_params.isParamValid(
"nl_sys")
79 ?
_problem->nlSysNum(pc_params.get<NonlinearSystemName>(
"nl_sys"))
88 if (preconditioned_nl_sys.empty())
92 if (solve_type !=
"NEWTON" && solve_type !=
"LINEAR")
96 for (
const auto & nl_sys_name :
_problem->getNonlinearSystemNames())
98 if (preconditioned_nl_sys.count(
_problem->nlSysNum(nl_sys_name)))
103 params.
set<std::string>(
"type") =
"SMP";
110 "SetupPreconditionerAction",
112 std::vector<std::string>({
"_moose_auto",
static_cast<std::string
>(nl_sys_name)}),
"_"),
116 std::shared_ptr<MooseObjectAction> moa_ptr = std::static_pointer_cast<MooseObjectAction>(ptr);
118 mo_params.
set<NonlinearSystemName>(
"nl_sys") = nl_sys_name;
registerMooseAction("MooseApp", CreateExecutionerAction, "setup_executioner")
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name)
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
void addActionBlock(std::shared_ptr< Action > blk)
This method add an Action instance to the warehouse.
void associateWithParameter(const std::string ¶m_name, InputParameters ¶ms) const
Associates the object's parameters params with the input location from this Action's parameter with t...
MooseApp & _app
The MOOSE application this is associated with.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
const bool _auto_preconditioning
CreateExecutionerAction(const InputParameters ¶ms)
static InputParameters validParams()
virtual void setupAutoPreconditioning()
EigenProblemSolve is used to solve an eigenvalue problem interfacing SLEPc.
Problem for solving eigenvalue problems.
Executioners are objects that do the actual work of solving your problem.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
void setExecutioner(std::shared_ptr< Executioner > &&executioner)
Set the Executioner for this App.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
InputParameters _moose_object_pars
The parameters for the object to be created.
static InputParameters validParams()
InputParameters & getObjectParams()
Retrieve the parameters of the object to be created by this action.
std::string _type
The Object type that is being created.
ActionFactory & _action_factory
Builds Actions.
Factory & _factory
The Factory associated with the MooseApp.
Set the preconditioner up.
Generic class for solving transient nonlinear problems.
void insert(const std::string &)