LCOV - code coverage report
Current view: top level - src/kernels - VectorFunctionReaction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 15 15 100.0 %
Date: 2025-08-08 20:01:16 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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       14589 : VectorFunctionReaction::validParams()
      16             : {
      17       14589 :   InputParameters params = VectorKernel::validParams();
      18       14589 :   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       14589 :   MooseEnum sign("positive=1 negative=-1", "positive");
      22       14589 :   params.addParam<MooseEnum>("sign", sign, "Sign of boundary term in weak form.");
      23       14589 :   params.addParam<FunctionName>("function", "1.0", "Function coefficient multiplier for field.");
      24       29178 :   return params;
      25       14589 : }
      26             : 
      27         168 : VectorFunctionReaction::VectorFunctionReaction(const InputParameters & parameters)
      28         168 :   : VectorKernel(parameters), _sign(getParam<MooseEnum>("sign")), _function(getFunction("function"))
      29             : {
      30         168 : }
      31             : 
      32             : Real
      33     2104704 : VectorFunctionReaction::computeQpResidual()
      34             : {
      35     2104704 :   return _sign * _function.value(_t, _q_point[_qp]) * _u[_qp] * _test[_i][_qp];
      36             : }
      37             : 
      38             : Real
      39     8760960 : VectorFunctionReaction::computeQpJacobian()
      40             : {
      41     8760960 :   return _sign * _function.value(_t, _q_point[_qp]) * _phi[_j][_qp] * _test[_i][_qp];
      42             : }

Generated by: LCOV version 1.14