LCOV - code coverage report
Current view: top level - src/materials - ADConstantMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 14 15 93.3 %
Date: 2026-05-29 20:41:18 Functions: 3 3 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 "ADConstantMaterial.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", ADConstantMaterial);
      13             : 
      14             : InputParameters
      15        7035 : ADConstantMaterial::validParams()
      16             : {
      17        7035 :   InputParameters params = Material::validParams();
      18       14070 :   params.addParam<Real>("value", 0., "Constant value being assigned into the property");
      19       14070 :   params.addRequiredParam<std::string>("property_name", "The property name to declare");
      20        7035 :   params.addClassDescription("Defines a constant AD material property");
      21        7035 :   return params;
      22           0 : }
      23             : 
      24        5442 : ADConstantMaterial::ADConstantMaterial(const InputParameters & parameters)
      25             :   : Material(parameters),
      26        5442 :     _value(getParam<Real>("value")),
      27        5442 :     _property_name(getParam<std::string>("property_name")),
      28       10884 :     _property(declareADProperty<Real>(_property_name))
      29             : {
      30        5442 : }
      31             : 
      32             : void
      33    13565305 : ADConstantMaterial::computeQpProperties()
      34             : {
      35    13565305 :   _property[_qp] = _value;
      36    13565305 : }

Generated by: LCOV version 1.14