www.mooseframework.org
Damper.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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.addParam<Real>("min_damping",
22  0.0,
23  "Minimum value of computed damping. Damping lower than "
24  "this will result in an exception being thrown and "
25  "cutting the time step");
26  return params;
27 }
28 
29 Damper::Damper(const InputParameters & parameters)
30  : MooseObject(parameters),
31  SetupInterface(this),
32  Restartable(this, "Dampers"),
33  MeshChangedInterface(parameters),
34  _subproblem(*getCheckedPointerParam<SubProblem *>("_subproblem")),
35  _sys(*getCheckedPointerParam<SystemBase *>("_sys")),
36  _min_damping(getParam<Real>("min_damping"))
37 {
38 }
39 
40 void
41 Damper::checkMinDamping(const Real cur_damping) const
42 {
43  if (cur_damping < _min_damping)
44  throw MooseException("From damper: '",
45  name(),
46  "' damping below min_damping: ",
47  cur_damping,
48  " Cutting timestep.");
49 }
A class for creating restricted objects.
Definition: Restartable.h:28
static InputParameters validParams()
Definition: Damper.C:16
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:84
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:56
Damper(const InputParameters &parameters)
Definition: Damper.C:29
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.
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:41
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
const Real & _min_damping
Minimum allowable value of damping.
Definition: Damper.h:46
Provides a way for users to bail out of the current solve.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:75
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...
static InputParameters validParams()
Definition: MooseObject.C:24
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.