LCOV - code coverage report
Current view: top level - src/materials - ComputeThermalExpansionEigenstrain.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 11 12 91.7 %
Date: 2025-07-25 05:00:39 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        2392 : ComputeThermalExpansionEigenstrainTempl<is_ad>::validParams()
      18             : {
      19        2392 :   InputParameters params = ComputeThermalExpansionEigenstrainBaseTempl<is_ad>::validParams();
      20        2392 :   params.addClassDescription("Computes eigenstrain due to thermal expansion "
      21             :                              "with a constant coefficient");
      22        4784 :   params.addRequiredParam<Real>("thermal_expansion_coeff", "Thermal expansion coefficient");
      23        4784 :   params.declareControllable("thermal_expansion_coeff");
      24             : 
      25        2392 :   return params;
      26           0 : }
      27             : 
      28             : template <bool is_ad>
      29        1794 : ComputeThermalExpansionEigenstrainTempl<is_ad>::ComputeThermalExpansionEigenstrainTempl(
      30             :     const InputParameters & parameters)
      31             :   : ComputeThermalExpansionEigenstrainBaseTempl<is_ad>(parameters),
      32        3588 :     _thermal_expansion_coeff(this->template getParam<Real>("thermal_expansion_coeff"))
      33             : {
      34        1794 : }
      35             : 
      36             : template <bool is_ad>
      37             : ValueAndDerivative<is_ad>
      38     5737762 : ComputeThermalExpansionEigenstrainTempl<is_ad>::computeThermalStrain()
      39             : {
      40     5737762 :   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