LCOV - code coverage report
Current view: top level - src/materials - ComputeThermalExpansionEigenstrain.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 11 12 91.7 %
Date: 2025-09-04 07:57:23 Functions: 6 6 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 "ComputeThermalExpansionEigenstrain.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", ComputeThermalExpansionEigenstrain);
      13             : registerMooseObject("SolidMechanicsApp", ADComputeThermalExpansionEigenstrain);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17        2684 : ComputeThermalExpansionEigenstrainTempl<is_ad>::validParams()
      18             : {
      19        2684 :   InputParameters params = ComputeThermalExpansionEigenstrainBaseTempl<is_ad>::validParams();
      20        2684 :   params.addClassDescription("Computes eigenstrain due to thermal expansion "
      21             :                              "with a constant coefficient");
      22        5368 :   params.addRequiredParam<Real>("thermal_expansion_coeff", "Thermal expansion coefficient");
      23        5368 :   params.declareControllable("thermal_expansion_coeff");
      24             : 
      25        2684 :   return params;
      26           0 : }
      27             : 
      28             : template <bool is_ad>
      29        2013 : ComputeThermalExpansionEigenstrainTempl<is_ad>::ComputeThermalExpansionEigenstrainTempl(
      30             :     const InputParameters & parameters)
      31             :   : ComputeThermalExpansionEigenstrainBaseTempl<is_ad>(parameters),
      32        4026 :     _thermal_expansion_coeff(this->template getParam<Real>("thermal_expansion_coeff"))
      33             : {
      34        2013 : }
      35             : 
      36             : template <bool is_ad>
      37             : ValueAndDerivative<is_ad>
      38     7348674 : ComputeThermalExpansionEigenstrainTempl<is_ad>::computeThermalStrain()
      39             : {
      40     7348674 :   return _thermal_expansion_coeff * (_temperature[_qp] - _stress_free_temperature[_qp]);
      41             : }
      42             : 
      43             : template class ComputeThermalExpansionEigenstrainTempl<false>;
      44             : template class ComputeThermalExpansionEigenstrainTempl<true>;

Generated by: LCOV version 1.14