LCOV - code coverage report
Current view: top level - src/materials - ThermalCompliance.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 16 17 94.1 %
Date: 2025-09-04 07:53:51 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          85 : ThermalCompliance::validParams()
      16             : {
      17          85 :   InputParameters params = Material::validParams();
      18          85 :   params.addClassDescription("Computes cost sensitivity needed for multimaterial SIMP method.");
      19         170 :   params.addRequiredCoupledVar("temperature", "temperature");
      20         170 :   params.addRequiredParam<MaterialPropertyName>("thermal_conductivity",
      21             :                                                 "DerivativeParsedMaterial for cost of materials.");
      22          85 :   return params;
      23           0 : }
      24             : 
      25          66 : ThermalCompliance::ThermalCompliance(const InputParameters & parameters)
      26             :   : DerivativeMaterialInterface<Material>(parameters),
      27          66 :     _grad_temperature(coupledGradient("temperature")),
      28          66 :     _thermal_conductivity(
      29         132 :         getMaterialPropertyByName<Real>(getParam<MaterialPropertyName>("thermal_conductivity"))),
      30         132 :     _thermal_compliance(declareProperty<Real>("thermal_compliance"))
      31             : {
      32          66 : }
      33             : 
      34             : void
      35      524272 : ThermalCompliance::computeQpProperties()
      36             : {
      37      524272 :   _thermal_compliance[_qp] =
      38      524272 :       0.5 * _thermal_conductivity[_qp] * _grad_temperature[_qp] * _grad_temperature[_qp];
      39      524272 : }

Generated by: LCOV version 1.14