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, protected 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 : * Get the variable this damper is acting on 41 : */ 42 7440 : MooseVariable * getVariable() { return &_var; } 43 : 44 : protected: 45 : /** 46 : * This MUST be overridden by a child damper. 47 : * 48 : * This is where they actually compute a number between 0 and 1. 49 : */ 50 : virtual Real computeQpDamping() = 0; 51 : 52 : /// Thread ID 53 : THREAD_ID _tid; 54 : Assembly & _assembly; 55 : 56 : /// Coordinate system 57 : const Moose::CoordinateSystemType & _coord_sys; 58 : 59 : /// Non-linear variable this damper works on 60 : MooseVariable & _var; 61 : 62 : /// Current node 63 : const Node * const & _current_node; 64 : 65 : /// Quadrature point index 66 : unsigned int _qp; 67 : 68 : /// The current Newton increment 69 : const VariableValue & _u_increment; 70 : /// Holds the current solution at the current node 71 : const VariableValue & _u; 72 : };