https://mooseframework.inl.gov
Loading...
Searching...
No Matches
StressUpdateBase.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 "StressUpdateBase.h"
11
12#include "MooseMesh.h"
13
14template <bool is_ad, typename R2, typename R4>
17{
19 params.addClassDescription("Calculates an admissible state (stress that lies on or within the "
20 "yield surface, plastic strains, internal parameters, etc). This "
21 "class is intended to be a parent class for classes with specific "
22 "constitutive models.");
23 params.addParam<std::string>(
24 "base_name",
25 "Optional parameter that defines a prefix for all material "
26 "properties related to this stress update model. This allows for "
27 "multiple models of the same type to be used without naming conflicts.");
28 // The return stress increment classes are intended to be iterative materials, so must set compute
29 // = false for all inheriting classes
30 params.set<bool>("compute") = false;
31 params.suppressParameter<bool>("compute");
32 return params;
33}
34
35template <bool is_ad, typename R2, typename R4>
37 : Material(parameters),
38 _base_name(this->isParamValid("base_name")
39 ? this->template getParam<std::string>("base_name") + "_"
40 : "")
41{
42}
43
44template <bool is_ad, typename R2, typename R4>
45void
47{
48 _qp = qp;
49}
50
51template <bool is_ad, typename R2, typename R4>
52void
54{
56 "propagateQpStatefulProperties called: it needs to be implemented by your inelastic model");
57}
58
59template <bool is_ad, typename R2, typename R4>
60Real
62{
63 return std::numeric_limits<Real>::max();
64}
65
66template <bool is_ad, typename R2, typename R4>
67void
69 GR2 & /*strain_increment*/,
70 GR2 & /*inelastic_strain_increment*/,
71 const GR2 & /*rotation_increment*/,
72 GR2 & /*stress_new*/,
73 const RankTwoTensor & /*stress_old*/,
74 const GR4 & /*elasticity_tensor*/,
75 const RankTwoTensor & /*elastic_strain_old*/,
76 bool /*compute_full_tangent_operator = false*/,
77 RankFourTensor & /*tangent_operator = _identityTensor*/)
78{
79 mooseError("updateState called: it needs to be implemented by your inelastic model");
80}
81
82template <bool is_ad, typename R2, typename R4>
83void
85 GR2 & /*strain_increment*/,
86 GR2 & /*inelastic_strain_increment*/,
87 const GR2 & /*rotation_increment*/,
88 GR2 & /*stress_new*/,
89 const RankTwoTensor & /*stress_old*/,
90 const GR4 & /*elasticity_tensor*/,
91 const RankTwoTensor & /*elastic_strain_old*/,
92 bool /*compute_full_tangent_operator*/,
93 RankFourTensor & /*tangent_operator*/)
94{
95 this->paramError("use_substep",
96 "updateStateSubstep called: it needs to be implemented by your inelastic model");
97}
98
99template <bool is_ad, typename R2, typename R4>
105
106template <>
109{
111 "getTangentCalculationMethod called: no tangent moduli calculation is needed while using AD");
113}
114
115template class StressUpdateBaseTempl<false>;
116template class StressUpdateBaseTempl<true>;
void mooseError(Args &&... args)
TangentCalculationMethod
TangentCalculationMethod is an enum that determines the calculation method for the tangent operator.
void suppressParameter(const std::string &name)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
StressUpdateBase is a material that is not called by MOOSE because of the compute=false flag set in t...
GenericRankFourTensor< is_ad > GR4
static InputParameters validParams()
GenericRankTwoTensor< is_ad > GR2
StressUpdateBaseTempl(const InputParameters &parameters)
virtual Real computeTimeStepLimit()
void setQp(unsigned int qp)
Sets the value of the global variable _qp for inheriting classes.
virtual void propagateQpStatefulProperties()
If updateState is not called during a timestep, this will be.
virtual TangentCalculationMethod getTangentCalculationMethod()
virtual void updateStateSubstep(GR2 &, GR2 &, const GR2 &, GR2 &, const RankTwoTensor &, const GR4 &, const RankTwoTensor &, bool compute_full_tangent_operator=false, RankFourTensor &tangent_operator=StressUpdateBaseTempl< is_ad >::_identityTensor)
Similar to the updateState function, this method updates the strain and stress for one substep.
virtual void updateState(GR2 &strain_increment, GR2 &inelastic_strain_increment, const GR2 &rotation_increment, GR2 &stress_new, const RankTwoTensor &stress_old, const GR4 &elasticity_tensor, const RankTwoTensor &elastic_strain_old, bool compute_full_tangent_operator=false, RankFourTensor &tangent_operator=StressUpdateBaseTempl< is_ad >::_identityTensor)
Given a strain increment that results in a trial stress, perform some procedure (such as an iterative...