LCOV - code coverage report
Current view: top level - src/materials - ADConstantMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 14 15 93.3 %
Date: 2025-07-30 13:02:48 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       14320 : ADConstantMaterial::validParams()
      16             : {
      17       14320 :   InputParameters params = Material::validParams();
      18       28640 :   params.addParam<Real>("value", 0., "Constant value being assigned into the property");
      19       28640 :   params.addRequiredParam<std::string>("property_name", "The property name to declare");
      20       14320 :   params.addClassDescription("Defines a constant AD material property");
      21       14320 :   return params;
      22           0 : }
      23             : 
      24       11202 : ADConstantMaterial::ADConstantMaterial(const InputParameters & parameters)
      25             :   : Material(parameters),
      26       11202 :     _value(getParam<Real>("value")),
      27       11202 :     _property_name(getParam<std::string>("property_name")),
      28       22404 :     _property(declareADProperty<Real>(_property_name))
      29             : {
      30       11202 : }
      31             : 
      32             : void
      33    20495503 : ADConstantMaterial::computeQpProperties()
      34             : {
      35    20495503 :   _property[_qp] = _value;
      36    20495503 : }

Generated by: LCOV version 1.14