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 : typedef MooseVariableFE<VectorValue<Real>> VectorMooseVariable; 23 : class Assembly; 24 : 25 : namespace libMesh 26 : { 27 : class QBase; 28 : } 29 : 30 : /** 31 : * Base class for deriving element dampers 32 : */ 33 : class ElementDamper : public Damper, protected MaterialPropertyInterface 34 : { 35 : public: 36 : static InputParameters validParams(); 37 : 38 : ElementDamper(const InputParameters & parameters); 39 : 40 : /** 41 : * Computes this Damper's damping for one element. 42 : */ 43 : Real computeDamping(); 44 : 45 : /** 46 : * Get the variable this damper is acting on 47 : */ 48 1774 : MooseVariable * getVariable() { return &_var; } 49 : 50 : protected: 51 : /** 52 : * This MUST be overridden by a child damper. 53 : * 54 : * This is where they actually compute a number between 0 and 1. 55 : */ 56 : virtual Real computeQpDamping() = 0; 57 : 58 : /// Thread ID 59 : THREAD_ID _tid; 60 : Assembly & _assembly; 61 : 62 : /// Coordinate system 63 : const Moose::CoordinateSystemType & _coord_sys; 64 : 65 : /// Non-linear variable this damper works on 66 : MooseVariable & _var; 67 : 68 : /// Current element 69 : const Elem * const & _current_elem; 70 : 71 : /// Quadrature point index 72 : unsigned int _qp; 73 : /// Quadrature points 74 : const MooseArray<Point> & _q_point; 75 : /// Quadrature rule 76 : const libMesh::QBase * const & _qrule; 77 : /// Transformed Jacobian weights 78 : const MooseArray<Real> & _JxW; 79 : 80 : /// The current Newton increment 81 : const VariableValue & _u_increment; 82 : /// Holds the current solution at the current quadrature point 83 : const VariableValue & _u; 84 : /// Holds the current solution gradient at the current quadrature point 85 : const VariableGradient & _grad_u; 86 : };