https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ScalarMaterialDamage.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
11
14
15template <bool is_ad>
18{
21 "Scalar damage model for which the damage is prescribed by another material");
22 params.addRequiredParam<MaterialPropertyName>("damage_index",
23 "Name of the material property containing the "
24 "damage index, which goes from 0 (undamaged) to 1 "
25 "(fully damaged)");
26 return params;
27}
28
29template <bool is_ad>
31 : ScalarDamageBaseTempl<is_ad>(parameters),
32 _damage_property(this->template getGenericMaterialProperty<Real, is_ad>("damage_index"))
33{
34}
35
36template <bool is_ad>
37void
39{
40 _damage_index[_qp] = _damage_property[_qp];
41
42 if (MooseUtils::absoluteFuzzyLessThan(_damage_index[_qp], 0.0) ||
43 MooseUtils::absoluteFuzzyGreaterThan(_damage_index[_qp], 1.0))
44 mooseError(_base_name + "damage_index ",
45 "must be between 0 and 1. Current value is: ",
46 _damage_index[_qp]);
47}
48
void mooseError(Args &&... args)
registerMooseObject("SolidMechanicsApp", ScalarMaterialDamage)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Base class for scalar damage models.
static InputParameters validParams()
Scalar damage model for which the damage is prescribed by another material.
virtual void updateQpDamageIndex() override
Update the damage index at the current qpoint.
static InputParameters validParams()
ScalarMaterialDamageTempl(const InputParameters &parameters)