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);
A MultiMooseEnum object to hold "execute_on" flags.
registerMooseAction("MooseApp", ElementIDOutputAction, "add_aux_kernel")
virtual void act()
Method to add objects to the simulation or perform other setup tasks.
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
Factory & _factory
The Factory associated with the MooseApp.
Action for creating output objects.
static InputParameters validParams()
InputParameters & getObjectParams()
Retrieve the parameters of the object to be created by this action.
static InputParameters validParams()
const std::string & _current_task
The current action (even though we have separate instances for each action)
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
MooseApp & _app
The MOOSE application this is associated with.
std::shared_ptr< MooseMesh > & _mesh
bool hasActions(const std::string &task) const
Check if Actions associated with passed in task exist.
ElementIDOutputAction(const InputParameters ¶meters)
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
const ExecFlagType EXEC_INITIAL