From 4c6a4e2c2ede4b11cf600e0e59f146fdcb7a0c53 Mon Sep 17 00:00:00 2001 From: "Joshua E. Hansel" Date: Tue, 15 Aug 2023 07:40:27 -0500 Subject: [PATCH] Threw error for post-processor/scalar output mismatch in CSV Refs #25211 --- framework/src/outputs/CSV.C | 10 ++++++++++ test/tests/outputs/csv/csv.i | 7 +++++-- test/tests/outputs/csv/tests | 8 ++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/framework/src/outputs/CSV.C b/framework/src/outputs/CSV.C index befa95b4ef4c..50c44e981faf 100644 --- a/framework/src/outputs/CSV.C +++ b/framework/src/outputs/CSV.C @@ -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 diff --git a/test/tests/outputs/csv/csv.i b/test/tests/outputs/csv/csv.i index b23fd294f780..b120f4c2758d 100644 --- a/test/tests/outputs/csv/csv.i +++ b/test/tests/outputs/csv/csv.i @@ -85,8 +85,11 @@ [] [Outputs] - execute_on = 'timestep_end' - csv = true + file_base = 'csv_out' + [csv] + type = CSV + execute_on = 'TIMESTEP_END' + [] [] [ICs] diff --git a/test/tests/outputs/csv/tests b/test/tests/outputs/csv/tests index 13b50ce3d460..7521720557ea 100644 --- a/test/tests/outputs/csv/tests +++ b/test/tests/outputs/csv/tests @@ -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" + [] []