Skip to content

Commit

Permalink
Threw error for post-processor/scalar output mismatch in CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahansel committed Aug 15, 2023
1 parent 3c86f3d commit 4c6a4e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
10 changes: 10 additions & 0 deletions framework/src/outputs/CSV.C
Expand Up @@ -90,6 +90,16 @@ CSV::initialSetup()
MooseUtils::clearSymlink(out_final);
}
}

// See https://github.com/idaholab/moose/issues/25211.
if ((advancedExecuteOn().find("postprocessors")->second !=
advancedExecuteOn().find("scalars")->second &&
getScalarOutput().size() > 0) ||
(advancedExecuteOn().find("postprocessors")->second !=
advancedExecuteOn().find("reporters")->second &&
getReporterOutput().size() > 0))
mooseError("The parameters 'execute_postprocessors_on', 'execute_scalars_on', and "
"'execute_reporters_on' must be the same for CSV output.");
}

std::string
Expand Down
7 changes: 5 additions & 2 deletions test/tests/outputs/csv/csv.i
Expand Up @@ -85,8 +85,11 @@
[]

[Outputs]
execute_on = 'timestep_end'
csv = true
file_base = 'csv_out'
[csv]
type = CSV
execute_on = 'TIMESTEP_END'
[]
[]

[ICs]
Expand Down
8 changes: 8 additions & 0 deletions test/tests/outputs/csv/tests
Expand Up @@ -105,4 +105,12 @@
requirement = "The system shall support CSV output to files on nonlinear iterations, generating unique filenames containing the time step and current nonlinear iteration number."
issues = "#24705"
[]
[pp_scalar_execute_on_mismatch]
type = RunException
input = 'csv.i'
cli_args = 'Outputs/csv/execute_postprocessors_on=FINAL'
expect_err = "The parameters 'execute_postprocessors_on', 'execute_scalars_on', and 'execute_reporters_on' must be the same for CSV output"
requirement = "The system shall report an error if post-processors and scalar variables have different output frequency."
issues = "#25211"
[]
[]

0 comments on commit 4c6a4e2

Please sign in to comment.