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 : #pragma once 11 : 12 : #include "DamageBase.h" 13 : 14 : // Forward declaration 15 : 16 : /** 17 : * Base class for scalar damage models. 18 : */ 19 : template <bool is_ad> 20 : class ScalarDamageBaseTempl : public DamageBaseTempl<is_ad> 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : ScalarDamageBaseTempl(const InputParameters & parameters); 26 : 27 : virtual void initQpStatefulProperties() override; 28 : 29 : virtual void updateDamage() override; 30 : 31 : virtual void updateStressForDamage(GenericRankTwoTensor<is_ad> & stress_new) override; 32 : 33 : virtual void updateJacobianMultForDamage(RankFourTensor & jacobian_mult) override; 34 : 35 : virtual void computeUndamagedOldStress(RankTwoTensor & stress_old) override; 36 : 37 : virtual Real computeTimeStepLimit() override; 38 : 39 : /** 40 : * Get the value of the damage index for the current quadrature point. 41 : */ 42 : const GenericReal<is_ad> & getQpDamageIndex(unsigned int qp); 43 : 44 : /** 45 : * Get the name of the material property containing the damage index 46 : */ 47 0 : const std::string getDamageIndexName() const { return _damage_index_name; } 48 : 49 : protected: 50 : /// Name of the material property where the damage index is stored 51 : const MaterialPropertyName _damage_index_name; 52 : 53 : /// Update the damage index at the current qpoint 54 : virtual void updateQpDamageIndex() = 0; 55 : 56 : ///@{ Material property that provides the damage index 57 : GenericMaterialProperty<Real, is_ad> & _damage_index; 58 : const MaterialProperty<Real> & _damage_index_old; 59 : const MaterialProperty<Real> & _damage_index_older; 60 : ///@} 61 : 62 : /// If true, use the damage index from the old state (rather than the current state) 63 : const bool _use_old_damage; 64 : 65 : /// Residual fraction of stiffness used for material that is fully damaged 66 : const Real & _residual_stiffness_fraction; 67 : 68 : /// Maximum damage increment allowed for the time step 69 : const Real & _maximum_damage_increment; 70 : 71 : /// Maximum allowed value for the damage index 72 : const Real & _maximum_damage; 73 : 74 : using DamageBaseTempl<is_ad>::_qp; 75 : using DamageBaseTempl<is_ad>::_base_name; 76 : using DamageBaseTempl<is_ad>::setQp; 77 : using DamageBaseTempl<is_ad>::_dt; 78 : }; 79 : 80 : typedef ScalarDamageBaseTempl<false> ScalarDamageBase; 81 : typedef ScalarDamageBaseTempl<true> ADScalarDamageBase;