https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
postprocessors
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
13
registerMooseObject
(
"MooseApp"
,
NumFailedTimeSteps
);
14
15
InputParameters
16
NumFailedTimeSteps::validParams
()
17
{
18
InputParameters
params =
GeneralPostprocessor::validParams
();
19
params.
addClassDescription
(
"Collects the number of failed time steps from the time stepper."
);
20
return
params;
21
}
22
23
NumFailedTimeSteps::NumFailedTimeSteps
(
const
InputParameters
& parameters)
24
:
GeneralPostprocessor
(parameters)
25
{
26
if
(
_subproblem
.
isTransient
())
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
36
Real
37
NumFailedTimeSteps::getValue
()
const
38
{
39
return
_timestepper
->
numFailures
();
40
}
mooseError
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition
MooseError.h:311
registerMooseObject
registerMooseObject("MooseApp", NumFailedTimeSteps)
NumFailedTimeSteps.h
Transient.h
GeneralPostprocessor
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
Definition
GeneralPostprocessor.h:22
GeneralPostprocessor::validParams
static InputParameters validParams()
Definition
GeneralPostprocessor.C:13
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition
InputParameters.h:68
InputParameters::addClassDescription
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.
Definition
InputParameters.C:81
MooseApp::getExecutioner
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition
MooseApp.C:2015
MooseObject::_app
MooseApp & _app
The MOOSE application this is associated with.
Definition
MooseBase.h:375
NumFailedTimeSteps
This postprocessor outputs the amount of failed time steps.
Definition
NumFailedTimeSteps.h:19
NumFailedTimeSteps::getValue
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition
NumFailedTimeSteps.C:37
NumFailedTimeSteps::_timestepper
const TimeStepper * _timestepper
Retrieves the current TimeStepper used by the executioner.
Definition
NumFailedTimeSteps.h:31
NumFailedTimeSteps::validParams
static InputParameters validParams()
Definition
NumFailedTimeSteps.C:16
NumFailedTimeSteps::NumFailedTimeSteps
NumFailedTimeSteps(const InputParameters ¶meters)
Definition
NumFailedTimeSteps.C:23
SubProblem::isTransient
virtual bool isTransient() const =0
TimeStepper::numFailures
unsigned int numFailures() const
Gets the number of failures and returns them.
Definition
TimeStepper.C:195
TransientBase
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
Definition
TransientBase.h:28
UserObjectBase::_subproblem
SubProblem & _subproblem
Reference to the Subproblem for this user object.
Definition
UserObjectBase.h:177
Generated on Tue Aug 25 2026 16:18:39 for https://mooseframework.inl.gov by
1.9.8