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 "VectorFunctionReaction.h" 11 : 12 : registerMooseObject("MooseApp", VectorFunctionReaction); 13 : 14 : InputParameters 15 14565 : VectorFunctionReaction::validParams() 16 : { 17 14565 : InputParameters params = VectorKernel::validParams(); 18 14565 : params.addClassDescription( 19 : "Kernel representing the contribution of the PDE term $sign * f * u$, where $f$ " 20 : "is a function coefficient and $u$ is a vector variable."); 21 14565 : MooseEnum sign("positive=1 negative=-1", "positive"); 22 14565 : params.addParam<MooseEnum>("sign", sign, "Sign of boundary term in weak form."); 23 14565 : params.addParam<FunctionName>("function", "1.0", "Function coefficient multiplier for field."); 24 29130 : return params; 25 14565 : } 26 : 27 156 : VectorFunctionReaction::VectorFunctionReaction(const InputParameters & parameters) 28 156 : : VectorKernel(parameters), _sign(getParam<MooseEnum>("sign")), _function(getFunction("function")) 29 : { 30 156 : } 31 : 32 : Real 33 1870848 : VectorFunctionReaction::computeQpResidual() 34 : { 35 1870848 : return _sign * _function.value(_t, _q_point[_qp]) * _u[_qp] * _test[_i][_qp]; 36 : } 37 : 38 : Real 39 7787520 : VectorFunctionReaction::computeQpJacobian() 40 : { 41 7787520 : return _sign * _function.value(_t, _q_point[_qp]) * _phi[_j][_qp] * _test[_i][_qp]; 42 : }