Skip to content

Commit

Permalink
Move parameter to print or not material property output aux variavles to
Browse files Browse the repository at this point in the history
material output action
refs idaholab#29664
  • Loading branch information
GiudGiud committed Jan 9, 2025
1 parent 1db3ed2 commit ff0159a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
5 changes: 0 additions & 5 deletions framework/src/actions/CommonOutputAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ CommonOutputAction::validParams()
"A list of the variables and postprocessors that should be output to the Exodus file "
"(may include Variables, ScalarVariables, and Postprocessor names).");

params.addParam<bool>("print_automatic_aux_variable_creation",
true,
"Flag to print list of aux variables created for automatic output by "
"MaterialOutputAction.");

// Add the 'execute_on' input parameter
ExecFlagEnum exec_enum = Output::getDefaultExecFlagEnum();
exec_enum = {EXEC_INITIAL, EXEC_TIMESTEP_END};
Expand Down
13 changes: 5 additions & 8 deletions framework/src/actions/MaterialOutputAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "MooseEnum.h"
#include "MooseVariableConstMonomial.h"
#include "FunctorMaterial.h"
#include "CommonOutputAction.h"

#include "libmesh/utility.h"

Expand All @@ -36,6 +35,10 @@ MaterialOutputAction::validParams()
/// Note: A derived class can set this to false, override materialOutput and output
/// a particular property that is not supported by this class.
params.addPrivateParam("print_unsupported_prop_names", true);
params.addParam<bool>("print_automatic_aux_variable_creation",
true,
"Flag to print list of aux variables created for automatic output by "
"MaterialOutputAction.");
return params;
}

Expand Down Expand Up @@ -191,13 +194,7 @@ MaterialOutputAction::act()
_problem->addAuxVariable("MooseVariableConstMonomial", var_name, params);
}

bool print_aux_creation = true;
const auto common_actions = _app.actionWarehouse().getActions<CommonOutputAction>();
mooseAssert(common_actions.size() <= 1, "Should not be more than one CommonOutputAction");
const Action * common = common_actions.empty() ? nullptr : *common_actions.begin();
if (common && !common->getParam<bool>("print_automatic_aux_variable_creation"))
print_aux_creation = false;
if (material_names.size() > 0 && print_aux_creation)
if (material_names.size() > 0 && getParam<bool>("print_automatic_aux_variable_creation"))
_console << COLOR_CYAN << "The following total " << material_names.size()
<< " aux variables:" << oss.str() << "\nare added for automatic output by " << type()
<< "." << COLOR_DEFAULT << std::endl;
Expand Down
1 change: 1 addition & 0 deletions framework/src/base/Moose.C
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/)

registerSyntax("AddOutputAction", "Outputs/*");
registerSyntax("CommonOutputAction", "Outputs");
registerSyntax("MaterialOutputAction", "Outputs");
registerSyntax("AutoCheckpointAction", "Outputs");
syntax.registerSyntaxType("Outputs/*", "OutputName");

Expand Down

0 comments on commit ff0159a

Please sign in to comment.