24 "Action for copying extra element IDs into auxiliary variables for output.");
40 for (
const auto &
act : output_actions)
49 params.
get<
bool>(
"output_extra_element_ids"))
51 bool has_element_id_names = params.
isParamValid(
"extra_element_ids_to_output");
52 std::vector<std::string> element_id_names;
53 if (has_element_id_names)
54 element_id_names = params.
get<std::vector<std::string>>(
"extra_element_ids_to_output");
59 for (
unsigned int i = 0; i <
_problem->assembly(0, 0).numExtraElemIntegers(); ++i)
61 auto & var_name =
_mesh->getMesh().get_elem_integer_name(i);
62 if (!has_element_id_names ||
63 (std::find(element_id_names.begin(), element_id_names.end(), var_name) !=
64 element_id_names.end()))
67 _problem->addAuxVariable(
"MooseVariableConstMonomial", var_name, var_params);
70 kernel_params.set<AuxVariableName>(
"variable") = var_name;
71 kernel_params.set<std::vector<ExtraElementIDName>>(
"extra_id_name") = {var_name};
72 _problem->addAuxKernel(
"ExtraElementIDAux",
"_output_" + var_name, kernel_params);
registerMooseAction("MooseApp", ElementIDOutputAction, "add_aux_kernel")
const ExecFlagType EXEC_INITIAL
bool hasActions(const std::string &task) const
Check if Actions associated with passed in task exist.
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
std::shared_ptr< MooseMesh > & _mesh
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
const std::string & _current_task
The current action (even though we have separate instances for each action)
Action for creating output objects.
virtual void act()
Method to add objects to the simulation or perform other setup tasks.
ElementIDOutputAction(const InputParameters ¶meters)
static InputParameters validParams()
A MultiMooseEnum object to hold "execute_on" flags.
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
InputParameters & getObjectParams()
Retrieve the parameters of the object to be created by this action.
Factory & _factory
The Factory associated with the MooseApp.