https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GeneralizedRadialReturnStressUpdate.h
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#pragma once
11
12#include "StressUpdateBase.h"
14#include "MooseTypes.h"
15
16#include "libmesh/ignore_warnings.h"
17#include "Eigen/Dense"
18#include "Eigen/Eigenvalues"
19#include "libmesh/restore_warnings.h"
20
21#include <limits>
22
23namespace Eigen
24{
25namespace internal
26{
27template <>
28struct cast_impl<ADReal, int>
29{
30 static inline int run(const ADReal & x) { return static_cast<int>(MetaPhysicL::raw_value(x)); }
31};
32} // namespace internal
33} // namespace Eigen
34
35// Instantiation of ADReal will be enabled shortly, once
36// https://github.com/roystgnr/MetaPhysicL/issues/70 makes it to MOOSE
37// typedef Eigen::Matrix<ADReal, 6, 6> AnisotropyMatrix;
38
39typedef Eigen::Matrix<Real, 6, 6> AnisotropyMatrixReal;
40typedef Eigen::Matrix<Real, 3, 3> AnisotropyMatrixRealBlock;
41
52template <bool is_ad>
55{
56public:
58
60
72 virtual void
74 GenericRankTwoTensor<is_ad> & inelastic_strain_increment,
75 const GenericRankTwoTensor<is_ad> & rotation_increment,
76 GenericRankTwoTensor<is_ad> & stress_new,
77 const RankTwoTensor & stress_old,
79 const RankTwoTensor & elastic_strain_old,
80 bool /*compute_full_tangent_operator = false*/,
81 RankFourTensor & /*tangent_operator = StressUpdateBaseTempl<is_ad>::_identityTensor*/)
82 override;
83
84 virtual Real
85 computeReferenceResidual(const GenericDenseVector<is_ad> & effective_trial_stress,
86 const GenericDenseVector<is_ad> & stress_new,
87 const GenericReal<is_ad> & residual,
88 const GenericReal<is_ad> & scalar_effective_inelastic_strain) override;
89
91 const GenericDenseVector<is_ad> & /*effective_trial_stress*/) const override
92 {
93 return 0.0;
94 }
95
96 virtual GenericReal<is_ad>
97 maximumPermissibleValue(const GenericDenseVector<is_ad> & effective_trial_stress) const override;
98
103 virtual Real computeTimeStepLimit() override;
104
110 virtual Real computeIntegrationErrorTimeStep() { return std::numeric_limits<Real>::max(); }
111
115 bool requiresIsotropicTensor() override { return true; }
116
121
122protected:
124 using Material::_dt;
125 using Material::_q_point;
126 using Material::_qp;
127
128 virtual void initQpStatefulProperties() override;
129
139
145 virtual void
147 const GenericDenseVector<is_ad> & /*stress*/,
148 const GenericRankFourTensor<is_ad> & /*elasticity_tensor*/) = 0;
149
155 virtual GenericReal<is_ad> computeStressDerivative(const Real /*effective_trial_stress*/,
156 const Real /*scalar*/)
157 {
158 return 0.0;
159 }
160
168 virtual void computeStressFinalize(const GenericRankTwoTensor<is_ad> & inelasticStrainIncrement,
169 const GenericReal<is_ad> & delta_gamma,
171 const GenericDenseVector<is_ad> & /*stress_dev*/,
172 const GenericRankTwoTensor<is_ad> & stress_old,
173 const GenericRankFourTensor<is_ad> & elasticity_tensor) = 0;
181 virtual void computeStrainFinalize(GenericRankTwoTensor<is_ad> & inelasticStrainIncrement,
182 const GenericRankTwoTensor<is_ad> & stress,
183 const GenericDenseVector<is_ad> & stress_dev,
184 const GenericReal<is_ad> & delta_gamma) = 0;
185
186 /*
187 * Method that determines the tangent calculation method. For anisotropic creep only models, the
188 * tangent calculation method is ELASTIC for now
189 */
194
195 void outputIterationSummary(std::stringstream * iter_output,
196 const unsigned int total_it) override;
197
201 void computeTangentOperator(Real /*effective_trial_stress*/,
202 RankTwoTensor & /*stress_new*/,
203 bool /*compute_full_tangent_operator*/,
204 RankFourTensor & /*tangent_operator*/);
205
208
212
216
219
222
225
228};
229
DualNumber< Real, DNDerivativeType, true > ADReal
const std::vector< double > x
GeneralizedRadialReturnStressUpdateTempl< true > ADGeneralizedRadialReturnStressUpdate
Eigen::Matrix< Real, 6, 6 > AnisotropyMatrixReal
Eigen::Matrix< Real, 3, 3 > AnisotropyMatrixRealBlock
GeneralizedRadialReturnStressUpdateTempl< false > GeneralizedRadialReturnStressUpdate
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
Moose::GenericType< DenseVector< Real >, is_ad > GenericDenseVector
Moose::GenericType< Real, is_ad > GenericReal
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor
TangentCalculationMethod
TangentCalculationMethod is an enum that determines the calculation method for the tangent operator.
void ErrorVector unsigned int
ADGeneralizedRadialReturnStressUpdate computes the generalized radial return stress increment for ani...
void outputIterationSummary(std::stringstream *iter_output, const unsigned int total_it) override
Output summary information for the convergence history of the model.
const bool _use_transformation
Whether to use fully transformed Hill's tensor due to rigid body or large deformation kinematic rotat...
GenericReal< is_ad > _three_shear_modulus
3 * shear modulus
virtual TangentCalculationMethod getTangentCalculationMethod() override
virtual Real computeReferenceResidual(const GenericDenseVector< is_ad > &effective_trial_stress, const GenericDenseVector< is_ad > &stress_new, const GenericReal< is_ad > &residual, const GenericReal< is_ad > &scalar_effective_inelastic_strain) override
Compute a reference quantity to be used for checking relative convergence.
virtual GenericReal< is_ad > minimumPermissibleValue(const GenericDenseVector< is_ad > &) const override
Compute the minimum permissible value of the scalar.
virtual GenericReal< is_ad > computeStressDerivative(const Real, const Real)
Calculate the derivative of the strain increment with respect to the updated stress.
bool isBlockDiagonal(const AnisotropyMatrixReal &A)
Check if an anisotropic matrix is block diagonal.
void propagateQpStatefulPropertiesRadialReturn()
Propagate the properties pertaining to this intermediate class.
Real _max_inelastic_increment
Maximum inelastic strain increment for (next) time step prescription.
virtual void computeStressFinalize(const GenericRankTwoTensor< is_ad > &inelasticStrainIncrement, const GenericReal< is_ad > &delta_gamma, GenericRankTwoTensor< is_ad > &stress, const GenericDenseVector< is_ad > &, const GenericRankTwoTensor< is_ad > &stress_old, const GenericRankFourTensor< is_ad > &elasticity_tensor)=0
Perform any necessary steps to finalize state after return mapping iterations.
virtual Real computeIntegrationErrorTimeStep()
Compute the limiting value of the time step for this material according to the numerical integration ...
virtual void computeStressInitialize(const GenericDenseVector< is_ad > &, const GenericDenseVector< is_ad > &, const GenericRankFourTensor< is_ad > &)=0
Perform any necessary initialization before return mapping iterations.
MaterialProperty< Real > & _inelastic_strain_rate
Equivalent creep/plastic strain rate: facilitates user's control of integration errors.
Real _max_integration_error
Maximum integration error for creep.
GenericMaterialProperty< Real, is_ad > & _effective_inelastic_strain
Equivalent creep/plastic strain.
void computeTangentOperator(Real, RankTwoTensor &, bool, RankFourTensor &)
Calculate the tangent_operator.
virtual Real computeTimeStepLimit() override
Compute the limiting value of the time step for this material.
virtual GenericReal< is_ad > maximumPermissibleValue(const GenericDenseVector< is_ad > &effective_trial_stress) const override
Compute the maximum permissible value of the scalar.
bool requiresIsotropicTensor() override
Does the model require the elasticity tensor to be isotropic?
Real _max_integration_error_time_step
Maximum integration error time step.
virtual void updateState(GenericRankTwoTensor< is_ad > &strain_increment, GenericRankTwoTensor< is_ad > &inelastic_strain_increment, const GenericRankTwoTensor< is_ad > &rotation_increment, GenericRankTwoTensor< is_ad > &stress_new, const RankTwoTensor &stress_old, const GenericRankFourTensor< is_ad > &elasticity_tensor, const RankTwoTensor &elastic_strain_old, bool, RankFourTensor &) override
A radial return (J2) mapping method is performed with return mapping iterations.
virtual void computeStrainFinalize(GenericRankTwoTensor< is_ad > &inelasticStrainIncrement, const GenericRankTwoTensor< is_ad > &stress, const GenericDenseVector< is_ad > &stress_dev, const GenericReal< is_ad > &delta_gamma)=0
Perform any necessary steps to finalize strain increment after return mapping iterations.
Base class that provides capability for Newton generalized (anisotropic) return mapping iterations on...
unsigned int _qp
const Elem *const & _current_elem
const MooseArray< Point > & _q_point
const InputParameters & parameters() const
StressUpdateBase is a material that is not called by MOOSE because of the compute=false flag set in t...
Real & _dt
auto raw_value(const Eigen::Map< T > &in)
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)