www.mooseframework.org
ComputeDamageStress.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 registerMooseObject("SolidMechanicsApp", ComputeDamageStress);
14 registerMooseObject("SolidMechanicsApp", ADComputeDamageStress);
15 
16 template <bool is_ad>
19 {
21  params.addClassDescription(
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 
27 template <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 
35 template <bool is_ad>
36 void
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 
50 template <>
51 void
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 
65 template <>
66 void
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 
79 template class ComputeDamageStressTempl<false>;
80 template class ComputeDamageStressTempl<true>;
ComputeDamageStress computes the stress for a damaged elasticity material.
registerMooseObject("SolidMechanicsApp", ComputeDamageStress)
typename std::conditional< is_ad, ADComputeFiniteStrainElasticStress, ComputeFiniteStrainElasticStress >::type ComputeFiniteStrainElasticStressTempl
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters validParams()
DamageBase is a base class for damage models, which modify the stress tensor computed by another mode...
Definition: DamageBase.h:25
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void computeQpStress() override
void addClassDescription(const std::string &doc_string)
ComputeDamageStressTempl(const InputParameters &parameters)