LCOV - code coverage report
Current view: top level - src/materials - ThermalCompliance.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #32971 (54bef8) with base c6cf66 Lines: 16 17 94.1 %
Date: 2026-05-29 20:37:03 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 "ThermalCompliance.h"
      11             : 
      12             : registerMooseObject("HeatTransferApp", ThermalCompliance);
      13             : 
      14             : InputParameters
      15          39 : ThermalCompliance::validParams()
      16             : {
      17          39 :   InputParameters params = Material::validParams();
      18          39 :   params.addClassDescription("Computes cost sensitivity needed for multimaterial SIMP method.");
      19          78 :   params.addRequiredCoupledVar("temperature", "temperature");
      20          78 :   params.addRequiredParam<MaterialPropertyName>("thermal_conductivity",
      21             :                                                 "DerivativeParsedMaterial for cost of materials.");
      22          39 :   return params;
      23           0 : }
      24             : 
      25          30 : ThermalCompliance::ThermalCompliance(const InputParameters & parameters)
      26             :   : DerivativeMaterialInterface<Material>(parameters),
      27          30 :     _grad_temperature(coupledGradient("temperature")),
      28          30 :     _thermal_conductivity(
      29          60 :         getMaterialPropertyByName<Real>(getParam<MaterialPropertyName>("thermal_conductivity"))),
      30          60 :     _thermal_compliance(declareProperty<Real>("thermal_compliance"))
      31             : {
      32          30 : }
      33             : 
      34             : void
      35      355888 : ThermalCompliance::computeQpProperties()
      36             : {
      37      355888 :   _thermal_compliance[_qp] =
      38      355888 :       0.5 * _thermal_conductivity[_qp] * _grad_temperature[_qp] * _grad_temperature[_qp];
      39      355888 : }

Generated by: LCOV version 1.14