LCOV - code coverage report
Current view: top level - src/materials - ComputeThermalExpansionEigenstrain.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 11 12 91.7 %
Date: 2024-02-27 11:53:14 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://www.mooseframework.org
       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("TensorMechanicsApp", ComputeThermalExpansionEigenstrain);
      13             : registerMooseObject("TensorMechanicsApp", ADComputeThermalExpansionEigenstrain);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17        1172 : ComputeThermalExpansionEigenstrainTempl<is_ad>::validParams()
      18             : {
      19        1172 :   InputParameters params = ComputeThermalExpansionEigenstrainBaseTempl<is_ad>::validParams();
      20        1172 :   params.addClassDescription("Computes eigenstrain due to thermal expansion "
      21             :                              "with a constant coefficient");
      22        2344 :   params.addRequiredParam<Real>("thermal_expansion_coeff", "Thermal expansion coefficient");
      23        2344 :   params.declareControllable("thermal_expansion_coeff");
      24             : 
      25        1172 :   return params;
      26           0 : }
      27             : 
      28             : template <bool is_ad>
      29         879 : ComputeThermalExpansionEigenstrainTempl<is_ad>::ComputeThermalExpansionEigenstrainTempl(
      30             :     const InputParameters & parameters)
      31             :   : ComputeThermalExpansionEigenstrainBaseTempl<is_ad>(parameters),
      32        1758 :     _thermal_expansion_coeff(this->template getParam<Real>("thermal_expansion_coeff"))
      33             : {
      34         879 : }
      35             : 
      36             : template <bool is_ad>
      37             : ValueAndDerivative<is_ad>
      38     2799237 : ComputeThermalExpansionEigenstrainTempl<is_ad>::computeThermalStrain()
      39             : {
      40     2799237 :   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