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 "Material.h" 13 : #include "RankFourTensor.h" 14 : #include "RankTwoTensor.h" 15 : 16 : // Forward declaration 17 : 18 : /** 19 : * DamageBase is a base class for damage models, which modify the stress tensor 20 : * computed by another model based on a damage mechanics formulation. 21 : * These models are designed to be called by another model, so they have 22 : * compute=false set. 23 : */ 24 : template <bool is_ad> 25 : class DamageBaseTempl : public Material 26 : { 27 : public: 28 : static InputParameters validParams(); 29 : 30 : DamageBaseTempl(const InputParameters & parameters); 31 : 32 : /** 33 : * Update the internal variable(s) that evolve the damage 34 : */ 35 : virtual void updateDamage(); 36 : 37 : /** 38 : * Update the current stress tensor for effects of damage. 39 : * @param stress_new Undamaged stress to be modified by the damage model 40 : */ 41 : virtual void updateStressForDamage(GenericRankTwoTensor<is_ad> & stress_new) = 0; 42 : 43 : /** 44 : * Update the material constitutive matrix 45 : * @param jacobian_mult Material constitutive matrix to be modified for 46 : * effects of damage 47 : */ 48 : virtual void updateJacobianMultForDamage(RankFourTensor & jacobian_mult) = 0; 49 : 50 : virtual void computeUndamagedOldStress(RankTwoTensor & stress_old) = 0; 51 : /** 52 : * Compute the limiting value of the time step for this material 53 : * @return Limiting time step 54 : */ 55 : virtual Real computeTimeStepLimit(); 56 : 57 : /** 58 : * Perform any necessary rotation of internal variables for finite 59 : * strain. 60 : * @param rotation_increment The finite-strain rotation increment 61 : */ 62 : virtual void finiteStrainRotation(const GenericRankTwoTensor<is_ad> & rotation_increment); 63 : 64 : /// Sets the value of the member variable _qp for use in inheriting classes 65 : void setQp(unsigned int qp); 66 : 67 : ///@{ Retained as empty methods to avoid a warning from Material.C in framework. These methods are unused in all inheriting classes and should not be overwritten. 68 0 : void resetQpProperties() final {} 69 557880 : void resetProperties() final {} 70 : ///@} 71 : 72 : protected: 73 : /// Base name optionally used as prefix to material tensor names 74 : const std::string _base_name; 75 : }; 76 : 77 : typedef DamageBaseTempl<false> DamageBase; 78 : typedef DamageBaseTempl<true> ADDamageBase;