Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make flag to optionally print/suppress aux variable creation printing #29665

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions framework/doc/content/source/actions/MaterialOutputAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MaterialOutputAction

!syntax description /Outputs/MaterialOutputAction

This [Action.md] is used to output the material properties computed by a [Material](syntax/Materials/index.md)
or a [FunctorMaterial](syntax/FunctorMaterials/index.md) to an auxiliary variable.
Vector, tensor, and array-valued properties can be output to variables prefixed with the component or index.

!syntax parameters /Outputs/MaterialOutputAction
9 changes: 8 additions & 1 deletion framework/src/actions/MaterialOutputAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ InputParameters
MaterialOutputAction::validParams()
{
InputParameters params = Action::validParams();
params.addClassDescription("Outputs material properties to various Outputs objects, based on the "
"parameters set in each Material");
/// A flag to tell this action whether or not to print the unsupported properties
/// 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 @@ -189,7 +195,8 @@ MaterialOutputAction::act()
" to restrict the material properties to output");
_problem->addAuxVariable("MooseVariableConstMonomial", var_name, params);
}
if (material_names.size() > 0)

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
9 changes: 9 additions & 0 deletions test/tests/materials/output/tests
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,13 @@
requirement = "The system shall show the field variable names for outputting material data added by materials."
prereq = warn_unsupported_types
[]
[dont_show_added_aux_vars]
type = RunApp
input = output_warning.i
cli_args = Outputs/print_automatic_aux_variable_creation=false
allow_warnings = true
absent_out = "The following total 145 aux variables:"
requirement = "The system shall be able to not show the field variable names for outputting material data added by materials."
prereq = show_added_aux_vars
[]
[]