LCOV - code coverage report
Current view: top level - src/materials - ComputeDilatationThermalExpansionEigenstrainBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 8 9 88.9 %
Date: 2025-07-25 05:00:39 Functions: 4 6 66.7 %
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 "ComputeDilatationThermalExpansionEigenstrainBase.h"
      11             : 
      12             : template <bool is_ad>
      13             : InputParameters
      14           0 : ComputeDilatationThermalExpansionEigenstrainBaseTempl<is_ad>::validParams()
      15             : {
      16          48 :   return ComputeThermalExpansionEigenstrainBaseTempl<is_ad>::validParams();
      17             : }
      18             : 
      19             : template <bool is_ad>
      20          36 : ComputeDilatationThermalExpansionEigenstrainBaseTempl<is_ad>::
      21             :     ComputeDilatationThermalExpansionEigenstrainBaseTempl(const InputParameters & parameters)
      22          36 :   : ComputeThermalExpansionEigenstrainBaseTempl<is_ad>(parameters)
      23             : {
      24          36 : }
      25             : 
      26             : template <bool is_ad>
      27             : ValueAndDerivative<is_ad>
      28        4800 : ComputeDilatationThermalExpansionEigenstrainBaseTempl<is_ad>::computeThermalStrain()
      29             : {
      30        4800 :   const auto stress_free = computeDilatation(this->_stress_free_temperature[_qp]);
      31        4800 :   const auto current = computeDilatation(this->_temperature[_qp]);
      32             : 
      33             :   // in non-AD mode the T derivative of the stress_free term needs get dropped.
      34             :   // We assume _stress_free_temperature does not depend on T. In AD mode this is automatic.
      35        4800 :   return current - (is_ad ? stress_free : stress_free.value());
      36             : }
      37             : 
      38             : template class ComputeDilatationThermalExpansionEigenstrainBaseTempl<false>;
      39             : template class ComputeDilatationThermalExpansionEigenstrainBaseTempl<true>;

Generated by: LCOV version 1.14