LCOV - code coverage report
Current view: top level - src/materials - ADFluxFromGradientMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 863ef6 Lines: 15 16 93.8 %
Date: 2025-10-15 18:16:15 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       14967 : ADFluxFromGradientMaterial::validParams()
       7             : {
       8       14967 :   InputParameters params = Material::validParams();
       9             : 
      10       29934 :   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       59868 :   params.addRequiredParam<MaterialPropertyName>("flux", "Name of the flux material property");
      15             : 
      16             :   // Coupled variable whose gradient is used
      17       59868 :   params.addRequiredCoupledVar("u", "Variable used to compute the flux");
      18             : 
      19             :   // Optional name for the diffusivity material property (default: 'diffusivity')
      20       44901 :   params.addParam<MaterialPropertyName>(
      21             :       "diffusivity", "diffusivity", "The diffusivity material property name");
      22             : 
      23       14967 :   return params;
      24           0 : }
      25             : 
      26         168 : ADFluxFromGradientMaterial::ADFluxFromGradientMaterial(const InputParameters & parameters)
      27             :   : Material(parameters),
      28         168 :     _grad_u(adCoupledGradient("u")),
      29         336 :     _diffusivity(getADMaterialProperty<Real>("diffusivity")),
      30         504 :     _flux(declareADProperty<RealVectorValue>("flux"))
      31             : {
      32         168 : }
      33             : 
      34             : void
      35     2444664 : ADFluxFromGradientMaterial::computeQpProperties()
      36             : {
      37     2444664 :   _flux[_qp] = -_diffusivity[_qp] * _grad_u[_qp];
      38     2444664 : }

Generated by: LCOV version 1.14