Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
14 template <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 
35 template <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 
44 template <bool is_ad, typename R2, typename R4>
45 void
47 {
48  _qp = qp;
49 }
50 
51 template <bool is_ad, typename R2, typename R4>
52 void
54 {
55  mooseError(
56  "propagateQpStatefulProperties called: it needs to be implemented by your inelastic model");
57 }
58 
59 template <bool is_ad, typename R2, typename R4>
60 Real
62 {
63  return std::numeric_limits<Real>::max();
64 }
65 
66 template <bool is_ad, typename R2, typename R4>
67 void
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 
82 template <bool is_ad, typename R2, typename R4>
83 void
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->template paramError(
96  "use_substep",
97  "updateStateSubstep called: it needs to be implemented by your inelastic model");
98 }
99 
100 template <bool is_ad, typename R2, typename R4>
103 {
105 }
106 
107 template <>
110 {
111  mooseError(
112  "getTangentCalculationMethod called: no tangent moduli calculation is needed while using AD");
114 }
115 
116 template class StressUpdateBaseTempl<false>;
117 template class StressUpdateBaseTempl<true>;
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void mooseError(Args &&... args)
virtual Real computeTimeStepLimit()
virtual void propagateQpStatefulProperties()
If updateState is not called during a timestep, this will be.
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
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...
void suppressParameter(const std::string &name)
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...
GenericRankFourTensor< is_ad > GR4
StressUpdateBaseTempl(const InputParameters &parameters)
virtual TangentCalculationMethod getTangentCalculationMethod()
static InputParameters validParams()
StressUpdateBase is a material that is not called by MOOSE because of the compute=false flag set in t...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
GenericRankTwoTensor< is_ad > GR2
void setQp(unsigned int qp)
Sets the value of the global variable _qp for inheriting classes.
void addClassDescription(const std::string &doc_string)
TangentCalculationMethod
TangentCalculationMethod is an enum that determines the calculation method for the tangent operator...