Skip to content

Commit

Permalink
Check for the postprocessors in the criterion expression for being up…
Browse files Browse the repository at this point in the history
… to date on evaluation

refs idaholab#24479
  • Loading branch information
GiudGiud committed May 25, 2023
1 parent 175ba1a commit 3924d69
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion framework/include/userobjects/Terminator.h
Expand Up @@ -42,7 +42,7 @@ class Terminator : public GeneralUserObject

Terminator(const InputParameters & parameters);

virtual void initialize() override {}
virtual void initialize() override;
virtual void execute() override;
virtual void finalize() override {}

Expand Down
19 changes: 19 additions & 0 deletions framework/src/userobjects/Terminator.C
Expand Up @@ -85,6 +85,25 @@ Terminator::Terminator(const InputParameters & parameters)
_params.resize(_pp_num);
}

void
Terminator::initialize()
{
// Check execution schedule of the postprocessors
if (_fail_mode == FailMode::SOFT)
for (unsigned int i = 0; i < _pp_num; i++)
// Make sure the postprocessor is executed at least as often
{
const auto & pp_exec = _fe_problem.getUserObjectBase(_pp_names[i], _tid).getExecuteOnEnum();
for (const auto & flag : getExecuteOnEnum())
if (!pp_exec.contains(flag))
paramWarning("expression",
"Postprocessor '" + _pp_names[i] + "' is not executed on " +
EXEC_LINEAR.name() +
", which it really should be to serve in the criterion "
"expression for throwing.");
}
}

void
Terminator::handleMessage()
{
Expand Down

0 comments on commit 3924d69

Please sign in to comment.