www.mooseframework.org
ElementDamper.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 "ElementDamper.h"
16 
17 // MOOSE includes
18 #include "Assembly.h"
19 #include "FEProblem.h"
20 #include "MooseVariable.h"
21 #include "SubProblem.h"
22 #include "SystemBase.h"
23 
24 #include "libmesh/quadrature.h"
25 
26 template <>
29 {
32  params.addRequiredParam<NonlinearVariableName>(
33  "variable", "The name of the variable that this damper operates on");
34  return params;
35 }
36 
38  : Damper(parameters),
40  _tid(parameters.get<THREAD_ID>("_tid")),
41  _assembly(_subproblem.assembly(_tid)),
42  _coord_sys(_assembly.coordSystem()),
43  _var(_sys.getVariable(_tid, parameters.get<NonlinearVariableName>("variable"))),
44 
45  _current_elem(_var.currentElem()),
46  _q_point(_assembly.qPoints()),
47  _qrule(_assembly.qRule()),
48  _JxW(_assembly.JxW()),
49 
50  _u_increment(_var.increment()),
51 
52  _u(_var.sln()),
53  _grad_u(_var.gradSln())
54 {
55 }
56 
57 Real
59 {
60  Real damping = 1.0;
61  Real cur_damping = 1.0;
62 
63  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
64  {
65  cur_damping = computeQpDamping();
66  if (cur_damping < damping)
67  damping = cur_damping;
68  }
69 
70  return damping;
71 }
InputParameters validParams< MaterialPropertyInterface >()
QBase *& _qrule
Quadrature rule.
Definition: ElementDamper.h:78
ElementDamper(const InputParameters &parameters)
Definition: ElementDamper.C:37
unsigned int _qp
Quadrature point index.
Definition: ElementDamper.h:74
InputParameters validParams< Damper >()
Definition: Damper.C:22
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
An interface for accessing Materials.
virtual Real computeQpDamping()=0
This MUST be overridden by a child damper.
InputParameters validParams< ElementDamper >()
Definition: ElementDamper.C:28
Base class for deriving dampers.
Definition: Damper.h:35
Real computeDamping()
Computes this Damper&#39;s damping for one element.
Definition: ElementDamper.C:58
unsigned int THREAD_ID
Definition: MooseTypes.h:79