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 : #include "NullScalarKernel.h" 11 : 12 : // MOOSE includes 13 : #include "Assembly.h" 14 : 15 : registerMooseObject("MooseApp", NullScalarKernel); 16 : 17 : InputParameters 18 14265 : NullScalarKernel::validParams() 19 : { 20 14265 : InputParameters params = ScalarKernel::validParams(); 21 14265 : params.addClassDescription( 22 : "Scalar kernel that sets a zero residual, to avoid error from system missing this variable."); 23 42795 : params.addParam<Real>("jacobian_fill", 24 28530 : 0.0, 25 : "On diagonal Jacobian fill term, potentially needed for preconditioner"); 26 14265 : return params; 27 0 : } 28 : 29 0 : NullScalarKernel::NullScalarKernel(const InputParameters & parameters) 30 0 : : ScalarKernel(parameters), _jacobian_fill(getParam<Real>("jacobian_fill")) 31 : { 32 0 : } 33 : 34 : void 35 0 : NullScalarKernel::reinit() 36 : { 37 0 : } 38 : 39 : Real 40 0 : NullScalarKernel::computeQpResidual() 41 : { 42 0 : return 0; 43 : } 44 : 45 : Real 46 0 : NullScalarKernel::computeQpJacobian() 47 : { 48 0 : return _jacobian_fill; 49 : }