From d14e5d11dd3c93513b9a2c3ce3f183ef6c16ff9e Mon Sep 17 00:00:00 2001 From: Logan Harbour Date: Sat, 17 Apr 2021 23:09:38 -0600 Subject: [PATCH] Move over-zealous assertion refs #17605 --- framework/src/postprocessors/Postprocessor.C | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/framework/src/postprocessors/Postprocessor.C b/framework/src/postprocessors/Postprocessor.C index a93e3988b12e..415f4a6f5c7e 100644 --- a/framework/src/postprocessors/Postprocessor.C +++ b/framework/src/postprocessors/Postprocessor.C @@ -37,16 +37,18 @@ Postprocessor::Postprocessor(const MooseObject * moose_object) const PostprocessorReporterName r_name(moose_object->name()); - mooseAssert(!fe_problem.getReporterData().hasReporterValue(r_name), - "Postprocessor Reporter value is already declared"); - // Declare the Reporter value on thread 0 only; this lets us add error checking to // make sure that it really is added only once - const auto tid = moose_object->parameters().isParamValid("_tid") - ? moose_object->parameters().get("_tid") - : 0; - if (tid == 0) + if (moose_object->parameters().get("_tid") == 0) + { + mooseAssert(!fe_problem.getReporterData().hasReporterValue(r_name), + "Postprocessor Reporter value is already declared"); + fe_problem.getReporterData(ReporterData::WriteKey()) .declareReporterValue>( r_name, REPORTER_MODE_UNSET, *moose_object); + } + else + mooseAssert(fe_problem.getReporterData().hasReporterValue(r_name), + "Postprocessor Reporter value is not declared"); }