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 57459 : Damper::validParams() 17 : { 18 57459 : InputParameters params = MooseObject::validParams(); 19 57459 : params.declareControllable("enable"); // allows Control to enable/disable this type of object 20 57459 : params.registerBase("Damper"); 21 57459 : params.registerSystemAttributeName("Damper"); 22 172377 : params.addParam<Real>("min_damping", 23 114918 : 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 57459 : return params; 28 0 : } 29 : 30 218 : Damper::Damper(const InputParameters & parameters) 31 : : MooseObject(parameters), 32 : SetupInterface(this), 33 : Restartable(this, "Dampers"), 34 : MeshChangedInterface(parameters), 35 218 : _subproblem(*getCheckedPointerParam<SubProblem *>("_subproblem")), 36 218 : _sys(*getCheckedPointerParam<SystemBase *>("_sys")), 37 436 : _min_damping(getParam<Real>("min_damping")) 38 : { 39 218 : } 40 : 41 : void 42 9611 : Damper::checkMinDamping(const Real cur_damping) const 43 : { 44 9611 : 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 9535 : }