LCOV - code coverage report
Current view: top level - src/kernels - FunctionDiffusion.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: fef103 Lines: 16 17 94.1 %
Date: 2025-09-03 20:01:23 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 "FunctionDiffusion.h"
      11             : #include "Function.h"
      12             : 
      13             : registerMooseObject("MooseApp", FunctionDiffusion);
      14             : 
      15             : InputParameters
      16       14630 : FunctionDiffusion::validParams()
      17             : {
      18       14630 :   InputParameters params = Diffusion::validParams();
      19       29260 :   params.addClassDescription("Diffusion with a function coefficient.");
      20       58520 :   params.addParam<FunctionName>("function", 1.0, "Function multiplier for diffusion term.");
      21       43890 :   params.addCoupledVar("v",
      22             :                        "Coupled concentration variable for kernel to operate on; if this "
      23             :                        "is not specified, the kernel's nonlinear variable will be used as "
      24             :                        "usual");
      25       14630 :   return params;
      26           0 : }
      27             : 
      28         190 : FunctionDiffusion::FunctionDiffusion(const InputParameters & parameters)
      29             :   : Diffusion(parameters),
      30         190 :     _function(getFunction("function")),
      31         380 :     _grad_v(isCoupled("v") ? coupledGradient("v") : _grad_u),
      32         380 :     _v_var(isCoupled("v") ? getVar("v", 0) : nullptr),
      33         570 :     _grad_v_phi(isCoupled("v") ? _v_var->gradPhi() : _grad_phi)
      34             : {
      35         190 : }
      36             : 
      37             : Real
      38     2707392 : FunctionDiffusion::computeQpResidual()
      39             : {
      40     2707392 :   return _function.value(_t, _q_point[_qp]) * _grad_v[_qp] * _grad_test[_i][_qp];
      41             : }
      42             : 
      43             : Real
      44     9512528 : FunctionDiffusion::computeQpJacobian()
      45             : {
      46     9512528 :   return _function.value(_t, _q_point[_qp]) * _grad_v_phi[_j][_qp] * _grad_test[_i][_qp];
      47             : }

Generated by: LCOV version 1.14