Skip to content

Commit

Permalink
Merge pull request #25910 from joshuahansel/pp-outputs-warning-fix
Browse files Browse the repository at this point in the history
Removed unnecessary warning for 'outputs' parameter
  • Loading branch information
joshuahansel authored Nov 10, 2023
2 parents 72056f3 + 426ae8f commit 03eeb23
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 37 deletions.
43 changes: 12 additions & 31 deletions framework/include/outputs/AdvancedOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(const std::string &
oss << "execute_" << execute_data_name << "_on";
std::string execute_on_name = oss.str();

// True if the postprocessors has been limited using 'outputs' parameter
bool has_limited_pps = false;

std::vector<UserObject *> objs;
_problem_ptr->theWarehouse()
.query()
Expand Down Expand Up @@ -412,35 +409,19 @@ AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(const std::string &
if (!_advanced_execute_on.contains(execute_data_name) ||
(_advanced_execute_on[execute_data_name].isValid() &&
_advanced_execute_on[execute_data_name].contains("none")))
mooseWarning(
"Postprocessor '",
pps->PPName(),
"' has requested to be output by the '",
name(),
"' output, but postprocessor output is not support by this type of output object.");
}

// Set the flag state for postprocessors that utilize 'outputs' parameter
if (!pps_outputs.empty() && pps_outputs.find("all") == pps_outputs.end())
has_limited_pps = true;
}

// Produce the warning when 'outputs' is used, but postprocessor output is disabled
if (has_limited_pps && isParamValid(execute_on_name))
{
const ExecFlagEnum & pp_on = getParam<ExecFlagEnum>(execute_on_name);
if (pp_on.contains(EXEC_NONE))
{
if (execute_on_name == "execute_postprocessors_on")
mooseWarning("A Postprocessor utilizes the 'outputs' parameter; however, postprocessor "
"output is disabled for the '",
name(),
"' output object.");
else if (execute_on_name == "execute_vectorpostprocessors_on")
mooseWarning("A VectorPostprocessor utilizes the 'outputs' parameter; however, vector "
"postprocessor output is disabled for the '",
{
const bool is_pp_type = (execute_data_name == "postprocessors");
const std::string pp_type_str = is_pp_type ? "post-processor" : "vector post-processor";
mooseWarning("The ",
pp_type_str,
" '",
pps->PPName(),
"' has requested to be output by the '",
name(),
"' output object.");
"' output, but ",
pp_type_str,
" output is disabled for that output object.");
}
}
}
}
8 changes: 4 additions & 4 deletions framework/src/outputs/AdvancedOutput.C
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ AdvancedOutput::initialSetup()
void
AdvancedOutput::init()
{
// Initialize the execution flags
for (auto & [name, input] : _advanced_execute_on)
initExecutionTypes(name, input);

// Clear existing execute information lists
_execute_data.reset();

Expand Down Expand Up @@ -185,10 +189,6 @@ AdvancedOutput::init()
// Initialize the show/hide/output lists for each of the types of output
for (auto & it : _execute_data)
initOutputList(it.second);

// Initialize the execution flags
for (auto & it : _advanced_execute_on)
initExecutionTypes(it.first, it.second);
}

AdvancedOutput::~AdvancedOutput() {}
Expand Down
3 changes: 1 addition & 2 deletions test/tests/outputs/format/tests
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@
[pps_screen_out_warn_test]
type = 'RunApp'
input = 'pps_screen_out_warn.i'
expect_out = "A Postprocessor utilizes the 'outputs' parameter; however, postprocessor output is "
"disabled for the 'console' output object."
expect_out = "The post-processor 'avg_block' has requested to be output by the 'console' output, but post-processor output is disabled for that output object"
allow_warnings = true
max_parallel = 1 # warning can mix on multiple processes
issues = '#1426'
Expand Down

0 comments on commit 03eeb23

Please sign in to comment.