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 : #pragma once 11 : 12 : // Moose Includes 13 : #include "Damper.h" 14 : #include "MaterialPropertyInterface.h" 15 : #include "MooseTypes.h" 16 : 17 : class SubProblem; 18 : class SystemBase; 19 : template <typename> 20 : class MooseVariableFE; 21 : typedef MooseVariableFE<Real> MooseVariable; 22 : class Assembly; 23 : 24 : /** 25 : * Base class for deriving nodal dampers 26 : */ 27 : class NodalDamper : public Damper, public MaterialPropertyInterface 28 : { 29 : public: 30 : static InputParameters validParams(); 31 : 32 : NodalDamper(const InputParameters & parameters); 33 : 34 : /** 35 : * Computes this Damper's damping for one node. 36 : */ 37 : Real computeDamping(); 38 : 39 : /** 40 : * Check whether this damper's variable has DOFs on the given node 41 : */ 42 : bool variableDefinedOnNode(const Node * node) const; 43 : 44 : /** 45 : * Get the variable this damper is acting on 46 : */ 47 7525 : MooseVariable * getVariable() { return &_var; } 48 : 49 : protected: 50 : /** 51 : * This MUST be overridden by a child damper. 52 : * 53 : * This is where they actually compute a number between 0 and 1. 54 : */ 55 : virtual Real computeQpDamping() = 0; 56 : 57 : /// Thread ID 58 : THREAD_ID _tid; 59 : Assembly & _assembly; 60 : 61 : /// Coordinate system 62 : const Moose::CoordinateSystemType & _coord_sys; 63 : 64 : /// Non-linear variable this damper works on 65 : MooseVariable & _var; 66 : 67 : /// Current node 68 : const Node * const & _current_node; 69 : 70 : /// Quadrature point index 71 : unsigned int _qp; 72 : 73 : /// The current Newton increment 74 : const VariableValue & _u_increment; 75 : /// Holds the current solution at the current node 76 : const VariableValue & _u; 77 : };