LCOV - code coverage report
Current view: top level - src/materials - ADFluxFromGradientMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 15 16 93.8 %
Date: 2026-05-29 20:35:17 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #include "ADFluxFromGradientMaterial.h"
       2             : 
       3             : registerMooseObject("MooseApp", ADFluxFromGradientMaterial);
       4             : 
       5             : InputParameters
       6        3265 : ADFluxFromGradientMaterial::validParams()
       7             : {
       8        3265 :   InputParameters params = Material::validParams();
       9             : 
      10        6530 :   params.addClassDescription("Computes a flux vector material property based on the gradient of a "
      11             :                              "coupled variable and a scalar diffusivity.");
      12             : 
      13             :   // Required name for the output flux property
      14       13060 :   params.addRequiredParam<MaterialPropertyName>("flux", "Name of the flux material property");
      15             : 
      16             :   // Coupled variable whose gradient is used
      17       13060 :   params.addRequiredCoupledVar("u", "Variable used to compute the flux");
      18             : 
      19             :   // Optional name for the diffusivity material property (default: 'diffusivity')
      20        9795 :   params.addParam<MaterialPropertyName>(
      21             :       "diffusivity", "diffusivity", "The diffusivity material property name");
      22             : 
      23        3265 :   return params;
      24           0 : }
      25             : 
      26         156 : ADFluxFromGradientMaterial::ADFluxFromGradientMaterial(const InputParameters & parameters)
      27             :   : Material(parameters),
      28         156 :     _grad_u(adCoupledGradient("u")),
      29         312 :     _diffusivity(getADMaterialProperty<Real>("diffusivity")),
      30         468 :     _flux(declareADProperty<RealVectorValue>("flux"))
      31             : {
      32         156 : }
      33             : 
      34             : void
      35     2229904 : ADFluxFromGradientMaterial::computeQpProperties()
      36             : {
      37     2229904 :   _flux[_qp] = -_diffusivity[_qp] * _grad_u[_qp];
      38     2229904 : }

Generated by: LCOV version 1.14