www.mooseframework.org
Damper.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "Damper.h"
16 #include "SystemBase.h"
17 #include "SubProblem.h"
18 #include "Conversion.h"
19 
20 template <>
23 {
25  params.declareControllable("enable"); // allows Control to enable/disable this type of object
26  params.registerBase("Damper");
27  params.addParam<Real>("min_damping",
28  0.0,
29  "Minimum value of computed damping. Damping lower than "
30  "this will result in an exception being thrown and "
31  "cutting the time step");
32  return params;
33 }
34 
35 Damper::Damper(const InputParameters & parameters)
36  : MooseObject(parameters),
37  SetupInterface(this),
38  Restartable(parameters, "Dampers"),
39  MeshChangedInterface(parameters),
40  _subproblem(*parameters.get<SubProblem *>("_subproblem")),
41  _sys(*parameters.get<SystemBase *>("_sys")),
42  _min_damping(getParam<Real>("min_damping"))
43 {
44 }
45 
46 void
47 Damper::checkMinDamping(const Real cur_damping) const
48 {
49  if (cur_damping < _min_damping)
50  throw MooseException("From damper: '" + name() + "' damping below min_damping: " +
51  Moose::stringify(cur_damping) + " Cutting timestep.");
52 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
A class for creating restricted objects.
Definition: Restartable.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for a system (of equations)
Definition: SystemBase.h:91
Damper(const InputParameters &parameters)
Definition: Damper.C:35
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.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
const Real & _min_damping
Minimum allowable value of damping.
Definition: Damper.h:55
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:47
InputParameters validParams< Damper >()
Definition: Damper.C:22
void declareControllable(const std::string &name)
Declare the given parameters as controllable.
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:66
InputParameters validParams< MooseObject >()
Definition: MooseObject.C:22
Provides a way for users to bail out of the current solve.
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...