112 typename std::shared_ptr<T> p;
115 if (act_ptr->name() ==
name)
124 std::vector<std::string> all_names;
126 if (!act_ptr->name().empty())
127 all_names.push_back(act_ptr->name());
129 all_names.push_back(
"unnamed");
132 "' does not exist.\n These are the Actions that do exist:",
146 typename std::map<std::string, const std::shared_ptr<T>> actions;
151 actions.insert(std::make_pair(act_ptr->name(), p));
154 std::vector<const T *> action_vector;
155 for (
auto & pair : actions)
156 action_vector.push_back(pair.second.get());
157 return action_vector;
174 for (
const auto & action : it->second)
176 T * tp =
dynamic_cast<T *
>(action);
180 mooseError(
"More than one actions have been detected in getActionByTask for the task '",
197 bool hasActions(
const std::string & task)
const;
247 std::shared_ptr<FEProblem>
problem();
264 bool hasTask(
const std::string & task)
const;
std::string name(const ElemQuality q)
bool _show_parser
Whether or not to print messages when actions are inserted in the warehouse by the parser...
void checkUnsatisfiedActions() const
This method checks the actions stored in the warehouse against the list of required registered action...
std::list< Action * >::iterator ActionIterator
alias to hide implementation details
const Action * getCurrentAction() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
bool isTaskComplete(const std::string &task) const
Syntax & _syntax
Reference to a "syntax" of actions.
std::shared_ptr< MooseMesh > & displacedMesh()
const std::shared_ptr< MooseMesh > & getMesh() const
bool hasTask(const std::string &task) const
const std::string & getMooseAppName()
void setFinalTask(const std::string &task)
std::string getCurrentActionName() const
void showActions(bool state=true)
This method sets a Boolean which is used to show information about action execution of various wareho...
Base class for MOOSE-based applications.
Storage for action instances.
void addActionBlock(std::shared_ptr< Action > blk)
This method add an Action instance to the warehouse.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
void showActionDependencies(bool state=true)
This method sets a Boolean which is used to print information about action dependencies before variou...
void printInputFile(std::ostream &out)
This method uses the Actions in the warehouse to reproduce the input file.
void executeActionsWithAction(const std::string &name)
This method executes only the actions in the warehouse that satisfy the task passed in...
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
void printActionDependencySets() const
This method is used only during debugging when show_actions is set to true.
std::shared_ptr< FEProblemBase > & problemBase()
std::string _final_task
Last task to run before (optional) early termination - blank means no early termination.
std::vector< std::string > _ordered_names
The container that holds the sorted action names from the DependencyResolver.
std::shared_ptr< MooseMesh > & mesh()
void showParser(bool state=true)
This method sets a Boolean which is used to show debugging information when actions are inserted in t...
bool empty() const
returns a Boolean indicating whether the warehouse is empty or not.
std::set< std::string > _completed_tasks
The completed tasks.
Specialized factory for generic Action System objects.
An inteface for the _console for outputting to the Console object.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
std::map< std::string, std::list< Action * > > _action_blocks
Pointers to the actual parsed input file blocks.
std::string stringify(const T &t)
conversion to string
std::shared_ptr< MooseMesh > _displaced_mesh
Possible mesh for displaced problem.
bool _generator_valid
Flag to indicate whether or not there is an active iterator on this class.
const std::string & getCurrentTaskName() const
const std::list< Action * > _empty_action_list
std::vector< std::shared_ptr< Action > > _all_ptrs
std::shared_ptr< FEProblemBase > _problem
Problem class.
bool hasActions(const std::string &task) const
Check if Actions associated with passed in task exist.
ActionWarehouse(MooseApp &app, Syntax &syntax, ActionFactory &factory)
std::shared_ptr< MooseMesh > _mesh
Mesh class.
const std::shared_ptr< MooseMesh > & getDisplacedMesh() const
bool _show_actions
Whether or not the action warehouse prints the action execution information.
MooseApp & _app
The MooseApp this Warehouse is associated with.
const std::vector< std::shared_ptr< Action > > & allActionBlocks() const
Returns a reference to all of the actions.
void build()
Builds all auto-buildable tasks.
Holding syntax for parsing input files.
const T * getActionByTask(const std::string &task)
Retrieve the action on a specific task with its type.
void executeAllActions()
This method loops over all actions in the warehouse and executes them.
ActionIterator actionBlocksWithActionEnd(const std::string &task)
std::set< std::string > _unsatisfied_dependencies
Use to store the current list of unsatisfied dependencies.
bool _show_action_dependencies
Whether or not the action warehouse prints the action dependency information.
const T & getAction(const std::string &name)
Retrieve an action with its name and the desired type.
std::shared_ptr< FEProblem > problem()
std::vector< const T * > getActions()
Retrieve all actions in a specific type ordered by their names.
ActionIterator actionBlocksWithActionBegin(const std::string &task)
Iterators to the Actions in the warehouse.
void clear()
This method deletes all of the Actions in the warehouse.
void buildBuildableActions(const std::string &task)
This method auto-builds all Actions that needs to be built and adds them to ActionWarehouse.
ActionFactory & _action_factory
The Factory that builds Actions.
std::string _current_task