LCOV - code coverage report
Current view: top level - src/timesteppers - ConstantDT.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31405 (292dce) with base fef103 Lines: 14 15 93.3 %
Date: 2025-09-04 07:52:05 Functions: 4 4 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 "ConstantDT.h"
      11             : 
      12             : registerMooseObject("MooseApp", ConstantDT);
      13             : 
      14             : InputParameters
      15       74715 : ConstantDT::validParams()
      16             : {
      17       74715 :   InputParameters params = TimeStepper::validParams();
      18      298860 :   params.addRequiredParam<Real>("dt", "Size of the time step");
      19             : 
      20             :   // The addRangeCheckedParam and addClassDescription are used in MOOSE documentation, if you
      21             :   // change the order or insert something you will mess it up.
      22      448290 :   params.addRangeCheckedParam<Real>(
      23             :       "growth_factor",
      24             :       2,
      25             :       "growth_factor>=1",
      26             :       "Maximum ratio of new to previous timestep sizes following a step that required the time"
      27             :       " step to be cut due to a failed solve.");
      28       74715 :   params.addClassDescription("Timestepper that takes a constant time step size");
      29             : 
      30       74715 :   return params;
      31           0 : }
      32             : 
      33       30225 : ConstantDT::ConstantDT(const InputParameters & parameters)
      34             :   : TimeStepper(parameters),
      35       30225 :     _constant_dt(getParam<Real>("dt")),
      36       90675 :     _growth_factor(getParam<Real>("growth_factor"))
      37             : {
      38       30225 : }
      39             : 
      40             : Real
      41       54490 : ConstantDT::computeInitialDT()
      42             : {
      43       54490 :   return _constant_dt;
      44             : }
      45             : 
      46             : Real
      47      170414 : ConstantDT::computeDT()
      48             : {
      49      170414 :   return std::min(_constant_dt, _growth_factor * getCurrentDT());
      50             : }

Generated by: LCOV version 1.14