LCOV - code coverage report
Current view: top level - src/postprocessors - NumFailedTimeSteps.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 12 15 80.0 %
Date: 2025-07-17 01:28:37 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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       14305 : NumFailedTimeSteps::validParams()
      17             : {
      18       14305 :   InputParameters params = GeneralPostprocessor::validParams();
      19       14305 :   params.addClassDescription("Collects the number of failed time steps from the time stepper.");
      20       14305 :   return params;
      21           0 : }
      22             : 
      23          20 : NumFailedTimeSteps::NumFailedTimeSteps(const InputParameters & parameters)
      24          20 :   : GeneralPostprocessor(parameters)
      25             : {
      26          20 :   if (_subproblem.isTransient())
      27             :   {
      28          20 :     _timestepper = dynamic_cast<TransientBase *>(_app.getExecutioner())->getTimeStepper();
      29          20 :     if (!_timestepper)
      30           0 :       mooseError("No user-specified time stepper in Executioner block");
      31             :   }
      32             :   else
      33           0 :     mooseError("Problem is not transient, and will not calculate timesteps.");
      34          20 : }
      35             : 
      36             : Real
      37         200 : NumFailedTimeSteps::getValue() const
      38             : {
      39         200 :   return _timestepper->numFailures();
      40             : }

Generated by: LCOV version 1.14