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 : #include "ADKernelValue.h" 13 : 14 : /** 15 : * Base class for use when adding Pressure-Stabilized Petrov-Galerkin type stabilization (e.g. a 16 : * diagonal) to Lagrange multiplier constraints. This class will add its residual to both the primal 17 : * equation and the Lagrange multiplier constraint equation 18 : */ 19 : class LMKernel : public ADKernelValue 20 : { 21 : public: 22 : LMKernel(const InputParameters & parameters); 23 : 24 : static InputParameters validParams(); 25 : 26 : protected: 27 : void computeResidual() override; 28 : void computeResidualsForJacobian() override; 29 : 30 : /// The Lagrange multiplier variable 31 : MooseVariable & _lm_var; 32 : 33 : /// The values of the Lagrange multiplier variable at quadrature points 34 : const ADVariableValue & _lm; 35 : 36 : /// The values of the Lagrange multiplier test functions at quadrature points 37 : const VariableTestValue & _lm_test; 38 : 39 : /// The sign (either +1 or -1) applied to this object's residual when adding 40 : /// to the Lagrange multiplier constraint equation. The sign should be chosen 41 : /// such that the diagonals for the LM block of the matrix are positive 42 : const Real _lm_sign; 43 : 44 : private: 45 150300 : const std::vector<dof_id_type> & dofIndices() const override { return _all_dof_indices; } 46 : 47 : /// The union of the primary var dof indices as well as the LM dof indices 48 : std::vector<dof_id_type> _all_dof_indices; 49 : };