Skip to content

Commit

Permalink
Move over-zealous assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
loganharbour committed Apr 27, 2021
1 parent 4021dbc commit 0490c0d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions framework/src/postprocessors/Postprocessor.C
Expand Up @@ -37,16 +37,18 @@ Postprocessor::Postprocessor(const MooseObject * moose_object)

const PostprocessorReporterName r_name(moose_object->name());

mooseAssert(!fe_problem.getReporterData().hasReporterValue<PostprocessorValue>(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<THREAD_ID>("_tid")
: 0;
if (tid == 0)
if (moose_object->parameters().get<THREAD_ID>("_tid") == 0)
{
mooseAssert(!fe_problem.getReporterData().hasReporterValue<PostprocessorValue>(r_name),
"Postprocessor Reporter value is already declared");

fe_problem.getReporterData(ReporterData::WriteKey())
.declareReporterValue<PostprocessorValue, ReporterGeneralContext<PostprocessorValue>>(
r_name, REPORTER_MODE_UNSET, *moose_object);
}
else
mooseAssert(fe_problem.getReporterData().hasReporterValue<PostprocessorValue>(r_name),
"Postprocessor Reporter value is not declared");
}

0 comments on commit 0490c0d

Please sign in to comment.