https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NumFailedTimeSteps.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "NumFailedTimeSteps.h"
11#include "Transient.h"
12
14
17{
19 params.addClassDescription("Collects the number of failed time steps from the time stepper.");
20 return params;
21}
22
24 : GeneralPostprocessor(parameters)
25{
27 {
28 _timestepper = dynamic_cast<TransientBase *>(_app.getExecutioner())->getTimeStepper();
29 if (!_timestepper)
30 mooseError("No user-specified time stepper in Executioner block");
31 }
32 else
33 mooseError("Problem is not transient, and will not calculate timesteps.");
34}
35
36Real
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
registerMooseObject("MooseApp", NumFailedTimeSteps)
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition MooseApp.C:2015
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
This postprocessor outputs the amount of failed time steps.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
const TimeStepper * _timestepper
Retrieves the current TimeStepper used by the executioner.
static InputParameters validParams()
NumFailedTimeSteps(const InputParameters &parameters)
virtual bool isTransient() const =0
unsigned int numFailures() const
Gets the number of failures and returns them.
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
SubProblem & _subproblem
Reference to the Subproblem for this user object.