https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Damper.C
Go to the documentation of this file.
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
17{
19 params.declareControllable("enable"); // allows Control to enable/disable this type of object
20 params.registerBase("Damper");
21 params.registerSystemAttributeName("Damper");
22 params.addParam<Real>("min_damping",
23 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 return params;
28}
29
31 : MooseObject(parameters),
32 SetupInterface(this),
33 Restartable(this, "Dampers"),
34 MeshChangedInterface(parameters),
35 _subproblem(*getCheckedPointerParam<SubProblem *>("_subproblem")),
36 _sys(*getCheckedPointerParam<SystemBase *>("_sys")),
37 _min_damping(getParam<Real>("min_damping"))
38{
39}
40
41void
42Damper::checkMinDamping(const Real cur_damping) const
43{
44 if (cur_damping < _min_damping)
45 throw MooseException("From damper: '",
46 name(),
47 "' damping below min_damping: ",
48 cur_damping,
49 " Cutting timestep.");
50}
static InputParameters validParams()
Definition Damper.C:16
const Real & _min_damping
Minimum allowable value of damping.
Definition Damper.h:46
void checkMinDamping(const Real cur_damping) const
Check whether damping is below the user-specified minimum value, and throw an exception if it is.
Definition Damper.C:42
Damper(const InputParameters &parameters)
Definition Damper.C:30
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void registerSystemAttributeName(const std::string &value)
This method is used to define the MOOSE system name that is used by the TheWarehouse object for stori...
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
Interface for notifications that the mesh has changed.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
Provides a way for users to bail out of the current solve.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
static InputParameters validParams()
Definition MooseObject.C:25
A class for creating restricted objects.
Definition Restartable.h:29
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
Base class for a system (of equations)
Definition SystemBase.h:87