https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeDamageStress.C
Go to the documentation of this file.
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 "ComputeDamageStress.h"
11#include "DamageBase.h"
12
15
16template <bool is_ad>
19{
22 "Compute stress for damaged elastic materials in conjunction with a damage model.");
23 params.addRequiredParam<MaterialName>("damage_model", "Name of the damage model");
24 return params;
25}
26
27template <bool is_ad>
29 : ComputeFiniteStrainElasticStressTempl<is_ad>(parameters),
30 _material_timestep_limit(this->template declareProperty<Real>("material_timestep_limit")),
31 _damage_model(nullptr)
32{
33}
34
35template <bool is_ad>
36void
38{
39 MaterialName damage_model_name = this->template getParam<MaterialName>("damage_model");
41 dynamic_cast<DamageBaseTempl<is_ad> *>(&this->getMaterialByName(damage_model_name));
42 if (dmb)
43 _damage_model = dmb;
44 else
45 this->paramError("damage_model",
46 "Damage Model " + damage_model_name +
47 " is not compatible with ComputeDamageStress");
48}
49
50template <>
51void
53{
55
56 _damage_model->setQp(_qp);
57 _damage_model->updateDamage();
58 _damage_model->updateStressForDamage(this->_stress[_qp]);
59 _damage_model->finiteStrainRotation(this->_rotation_increment[_qp]);
60 _damage_model->updateJacobianMultForDamage(_Jacobian_mult[_qp]);
61
62 _material_timestep_limit[_qp] = _damage_model->computeTimeStepLimit();
63}
64
65template <>
66void
68{
70
71 _damage_model->setQp(_qp);
72 _damage_model->updateDamage();
73 _damage_model->updateStressForDamage(this->_stress[_qp]);
74 _damage_model->finiteStrainRotation(this->_rotation_increment[_qp]);
75
76 _material_timestep_limit[_qp] = _damage_model->computeTimeStepLimit();
77}
78
registerMooseObject("SolidMechanicsApp", ComputeDamageStress)
typename std::conditional< is_ad, ADComputeFiniteStrainElasticStress, ComputeFiniteStrainElasticStress >::type ComputeFiniteStrainElasticStressTempl
ComputeDamageStress computes the stress for a damaged elasticity material.
static InputParameters validParams()
virtual void computeQpStress() override
ComputeDamageStressTempl(const InputParameters &parameters)
DamageBase is a base class for damage models, which modify the stress tensor computed by another mode...
Definition DamageBase.h:26
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)