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 "RadialReturnCreepStressUpdateBase.h" 11 : 12 : template <bool is_ad> 13 : InputParameters 14 4026 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::validParams() 15 : { 16 4026 : InputParameters params = RadialReturnStressUpdateTempl<is_ad>::validParams(); 17 4026 : params.set<std::string>("effective_inelastic_strain_name") = "effective_creep_strain"; 18 4026 : return params; 19 0 : } 20 : 21 : template <bool is_ad> 22 3020 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::RadialReturnCreepStressUpdateBaseTempl( 23 : const InputParameters & parameters) 24 : : RadialReturnStressUpdateTempl<is_ad>(parameters), 25 3020 : _creep_strain(this->template declareGenericProperty<RankTwoTensor, is_ad>(this->_base_name + 26 : "creep_strain")), 27 3020 : _creep_strain_old( 28 6040 : this->template getMaterialPropertyOld<RankTwoTensor>(this->_base_name + "creep_strain")) 29 : { 30 3020 : } 31 : 32 : template <bool is_ad> 33 : void 34 68512 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::initQpStatefulProperties() 35 : { 36 68512 : _creep_strain[_qp].zero(); 37 : 38 25552 : RadialReturnStressUpdateTempl<is_ad>::initQpStatefulProperties(); 39 68512 : } 40 : 41 : template <bool is_ad> 42 : void 43 517968 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::propagateQpStatefulProperties() 44 : { 45 517968 : _creep_strain[_qp] = _creep_strain_old[_qp]; 46 : 47 517968 : propagateQpStatefulPropertiesRadialReturn(); 48 517968 : } 49 : 50 : template <bool is_ad> 51 : Real 52 0 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::computeStressDerivative( 53 : const Real /*effective_trial_stress*/, const Real /*scalar*/) 54 : { 55 0 : mooseError("computeStressDerivative called: no stress derivative computation is needed for AD"); 56 : } 57 : 58 : template <> 59 : Real 60 443672 : RadialReturnCreepStressUpdateBaseTempl<false>::computeStressDerivative( 61 : const Real effective_trial_stress, const Real scalar) 62 : { 63 443672 : return -(computeDerivative(effective_trial_stress, scalar) + 1.0) / this->_three_shear_modulus; 64 : } 65 : 66 : template <bool is_ad> 67 : void 68 4786152 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::computeStressFinalize( 69 : const GenericRankTwoTensor<is_ad> & plastic_strain_increment) 70 : { 71 4786152 : _creep_strain[_qp] = _creep_strain_old[_qp] + plastic_strain_increment; 72 4786152 : } 73 : 74 : template class RadialReturnCreepStressUpdateBaseTempl<false>; 75 : template class RadialReturnCreepStressUpdateBaseTempl<true>;