LCOV - code coverage report
Current view: top level - src/dampers - Damper.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 19 20 95.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 "Damper.h"
      11             : #include "SystemBase.h"
      12             : #include "SubProblem.h"
      13             : #include "Conversion.h"
      14             : 
      15             : InputParameters
      16       57457 : Damper::validParams()
      17             : {
      18       57457 :   InputParameters params = MooseObject::validParams();
      19       57457 :   params.declareControllable("enable"); // allows Control to enable/disable this type of object
      20       57457 :   params.registerBase("Damper");
      21       57457 :   params.registerSystemAttributeName("Damper");
      22      172371 :   params.addParam<Real>("min_damping",
      23      114914 :                         0.0,
      24             :                         "Minimum value of computed damping. Damping lower than "
      25             :                         "this will result in an exception being thrown and "
      26             :                         "cutting the time step");
      27       57457 :   return params;
      28           0 : }
      29             : 
      30         217 : Damper::Damper(const InputParameters & parameters)
      31             :   : MooseObject(parameters),
      32             :     SetupInterface(this),
      33             :     Restartable(this, "Dampers"),
      34             :     MeshChangedInterface(parameters),
      35         217 :     _subproblem(*getCheckedPointerParam<SubProblem *>("_subproblem")),
      36         217 :     _sys(*getCheckedPointerParam<SystemBase *>("_sys")),
      37         434 :     _min_damping(getParam<Real>("min_damping"))
      38             : {
      39         217 : }
      40             : 
      41             : void
      42        9590 : Damper::checkMinDamping(const Real cur_damping) const
      43             : {
      44        9590 :   if (cur_damping < _min_damping)
      45         152 :     throw MooseException("From damper: '",
      46          76 :                          name(),
      47             :                          "' damping below min_damping: ",
      48             :                          cur_damping,
      49         152 :                          " Cutting timestep.");
      50        9514 : }

Generated by: LCOV version 1.14