https://mooseframework.inl.gov
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
}
NumFailedTimeSteps::_timestepper
const TimeStepper * _timestepper
Retrieves the current TimeStepper used by the executioner.
Definition:
NumFailedTimeSteps.h:31
NumFailedTimeSteps.h
TimeStepper::numFailures
unsigned int numFailures() const
Gets the number of failures and returns them.
Definition:
TimeStepper.C:191
NumFailedTimeSteps
This postprocessor outputs the amount of failed time steps.
Definition:
NumFailedTimeSteps.h:18
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Definition:
InputParameters.h:65
GeneralPostprocessor
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
Definition:
GeneralPostprocessor.h:21
registerMooseObject
registerMooseObject("MooseApp", NumFailedTimeSteps)
NumFailedTimeSteps::validParams
static InputParameters validParams()
Definition:
NumFailedTimeSteps.C:16
Transient.h
UserObject::_subproblem
SubProblem & _subproblem
Reference to the Subproblem for this user object.
Definition:
UserObject.h:208
GeneralPostprocessor::validParams
static InputParameters validParams()
Definition:
GeneralPostprocessor.C:13
SubProblem::isTransient
virtual bool isTransient() const =0
TransientBase
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
Definition:
TransientBase.h:27
MooseBase::_app
MooseApp & _app
The MOOSE application this is associated with.
Definition:
MooseBase.h:353
MooseApp::getExecutioner
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition:
MooseApp.C:2123
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseBase::mooseError
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition:
MooseBase.h:267
NumFailedTimeSteps::NumFailedTimeSteps
NumFailedTimeSteps(const InputParameters ¶meters)
Definition:
NumFailedTimeSteps.C:23
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
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
Generated on Sun Aug 24 2025 13:53:48 for https://mooseframework.inl.gov by
1.8.14