https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SetupPredictorAction.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10// MOOSE includes
12#include "TransientBase.h"
13#include "Predictor.h"
14#include "Factory.h"
15#include "NonlinearSystemBase.h"
16#include "FEProblemBase.h"
17
18registerMooseAction("MooseApp", SetupPredictorAction, "setup_predictor");
19
22{
24 params.addClassDescription("Add a Predictor object to the simulation.");
25 return params;
26}
27
32
33void
35{
36 if (_problem->isTransient())
37 {
38 TransientBase * transient = dynamic_cast<TransientBase *>(_app.getExecutioner());
39 if (!transient)
40 mooseError("You can setup time stepper only with executioners of transient type.");
41
42 _moose_object_pars.set<TransientBase *>("_executioner") = transient;
43 std::shared_ptr<Predictor> predictor =
45 predictor->_nl.setPredictor(predictor);
46 }
47}
registerMooseAction("MooseApp", SetupPredictorAction, "setup_predictor")
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition Action.h:178
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition Factory.C:142
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition MooseApp.C:2015
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...
Definition MooseBase.h:271
InputParameters _moose_object_pars
The parameters for the object to be created.
static InputParameters validParams()
std::string _type
The Object type that is being created.
void setPredictor(std::shared_ptr< Predictor > predictor)
Factory & _factory
The Factory associated with the MooseApp.
Base class for predictors.
Definition Predictor.h:29
NonlinearSystemBase & _nl
Definition Predictor.h:45
Sets the predictor.
SetupPredictorAction(const InputParameters &parameters)
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
static InputParameters validParams()
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...