From ff0159a866a6e64e4d1d31aad02ffa8435e3c4a7 Mon Sep 17 00:00:00 2001 From: Guillaume Giudicelli Date: Thu, 9 Jan 2025 09:57:43 -0700 Subject: [PATCH] Move parameter to print or not material property output aux variavles to material output action refs #29664 --- framework/src/actions/CommonOutputAction.C | 5 ----- framework/src/actions/MaterialOutputAction.C | 13 +++++-------- framework/src/base/Moose.C | 1 + 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/framework/src/actions/CommonOutputAction.C b/framework/src/actions/CommonOutputAction.C index 387c9877934e..2f3623f548a2 100644 --- a/framework/src/actions/CommonOutputAction.C +++ b/framework/src/actions/CommonOutputAction.C @@ -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("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}; diff --git a/framework/src/actions/MaterialOutputAction.C b/framework/src/actions/MaterialOutputAction.C index 2b811fe6880f..762bc7b6dc86 100644 --- a/framework/src/actions/MaterialOutputAction.C +++ b/framework/src/actions/MaterialOutputAction.C @@ -21,7 +21,6 @@ #include "MooseEnum.h" #include "MooseVariableConstMonomial.h" #include "FunctorMaterial.h" -#include "CommonOutputAction.h" #include "libmesh/utility.h" @@ -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("print_automatic_aux_variable_creation", + true, + "Flag to print list of aux variables created for automatic output by " + "MaterialOutputAction."); return params; } @@ -191,13 +194,7 @@ MaterialOutputAction::act() _problem->addAuxVariable("MooseVariableConstMonomial", var_name, params); } - bool print_aux_creation = true; - const auto common_actions = _app.actionWarehouse().getActions(); - 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("print_automatic_aux_variable_creation")) - print_aux_creation = false; - if (material_names.size() > 0 && print_aux_creation) + if (material_names.size() > 0 && getParam("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; diff --git a/framework/src/base/Moose.C b/framework/src/base/Moose.C index 91250cd67442..1de4e1c4b8e2 100644 --- a/framework/src/base/Moose.C +++ b/framework/src/base/Moose.C @@ -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");