LCOV - code coverage report
Current view: top level - src/timesteppers - ConstantDT.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 6f668f Lines: 14 15 93.3 %
Date: 2025-09-22 20:01:15 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       76219 : ConstantDT::validParams()
      16             : {
      17       76219 :   InputParameters params = TimeStepper::validParams();
      18      304876 :   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      457314 :   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       76219 :   params.addClassDescription("Timestepper that takes a constant time step size");
      29             : 
      30       76219 :   return params;
      31           0 : }
      32             : 
      33       30737 : ConstantDT::ConstantDT(const InputParameters & parameters)
      34             :   : TimeStepper(parameters),
      35       30737 :     _constant_dt(getParam<Real>("dt")),
      36       92211 :     _growth_factor(getParam<Real>("growth_factor"))
      37             : {
      38       30737 : }
      39             : 
      40             : Real
      41       55286 : ConstantDT::computeInitialDT()
      42             : {
      43       55286 :   return _constant_dt;
      44             : }
      45             : 
      46             : Real
      47      172014 : ConstantDT::computeDT()
      48             : {
      49      172014 :   return std::min(_constant_dt, _growth_factor * getCurrentDT());
      50             : }

Generated by: LCOV version 1.14