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 "ArrayReactionNodalKernel.h" 11 : 12 : #include "Function.h" 13 : 14 : registerMooseObject("MooseApp", ArrayReactionNodalKernel); 15 : 16 : InputParameters 17 15035 : ArrayReactionNodalKernel::validParams() 18 : { 19 15035 : InputParameters params = ArrayNodalKernel::validParams(); 20 30070 : params.addClassDescription( 21 : "Implements a simple consuming reaction term at nodes for an array variable"); 22 45105 : params.addRequiredParam<RealEigenVector>("coeff", 23 : "Coefficients for multiplying the reaction term"); 24 15035 : return params; 25 0 : } 26 : 27 25 : ArrayReactionNodalKernel::ArrayReactionNodalKernel(const InputParameters & parameters) 28 50 : : ArrayNodalKernel(parameters), _coeff(getParam<RealEigenVector>("coeff")) 29 : { 30 25 : if (_coeff.size() != _count) 31 0 : paramError("coeff", 32 : "The size of the coefficient vector must match the size of the array variable"); 33 25 : } 34 : 35 : void 36 732 : ArrayReactionNodalKernel::computeQpResidual(RealEigenVector & residual) 37 : { 38 732 : residual = _coeff.cwiseProduct(_u[_qp]); 39 732 : } 40 : 41 : RealEigenVector 42 99 : ArrayReactionNodalKernel::computeQpJacobian() 43 : { 44 99 : return _coeff; 45 : }